gdb

A JTAG emulator for use with a Hawkboard and OpenOCD?

I'd like to try bare metal ARM programming with the Hawkboard, but the deployment process looks awful. I'm totally new to this, so I could be misunderstanding the instructions, but it appears that I have to use a program called AISgen to convert the binary file, then boot with u-Boot over UART and copy the AIS binary into memory. Not onl...

Xcode debugger stops with "EXC_BAD_ACCESS" - bug in my code or in Xcode?

Hi, I got this error just one time (non-repeatable) while running my Objective-C & C++ program with the Xcode debugger: Program received signal: “EXC_BAD_ACCESS”. Xcode could not locate source file: sweep.c (line: 1026) kill quit I don't have any references to any "sweep.c" in my code, so I'm thinking maybe it's a Xcode/GDB error. A...

How can I determine the arguments for a private API function?

I want to create a replacement for the app switcher (aka 'cmd + tab'). I know that it's possible because Lite Switch X does it. What I've got achieved so far: By force quitting the dock and calling CPSRegisterForKey() (which is a private API function) I can prevent the default cmd+tab from working. The second step is two register the...

Can I reconstruct C++ source code from debug binaries?

I have a C++ application compiled in debug (using MinGW and Qt) but I've lost some major changes because someone in my team forgot to commit his changes in the source control manager and overwrote the source code with other changes. When I run the program in debug (in Qt Creator) I can set a break point in main and then see the source c...

Using gdb and gdbserver with a 32 bit binary on a 64 bit machine with Centos 5 complains about memory access or badly formatted data

I have two identical 64 bit Centos 5 machines, that are networked, and share their /home mount. I compile a simple Hello World program on one, and then I have figured out how to use gdb on one machine to remotely debug it running on the other machine. That seems to work fine when everyone defaults to 64 bitness. However, if I compile ...

Xcode, no debug symbols for certain subclass

I'm using Xcode 3.2.3 and iPhone SDK So I'm trying to debug a UIView subclass, I hit a breakpoint in an overridden method and I can't see any symbols in either the GUI or gdb, just globals and registers. This is what I see: (gdb) po self No symbol "self" in current context. Yet when I set a breakpoint in a UIViewController subclass,...

Debugging with Bochs + GDB: "cannot find bounds of current function"?

I'm working on writing an OS and I'm running into problems trying to debug my code. I'm using GDB to connect to Bochs' GDB stub to "remotely" debug my kernel. Connecting works fine, as does loading debugging symbols from the kernel file. I set a breakpoint for the kmain function, which is successfully located, and the debugger breaks ...

What are the exact contents of a program stack in C?

I want to know the exact contents of a program stack. How is the branching operation done? What is meant by memory dump while debugging a program using gdb? Does it give the program stack? TIA, Praveen ...

What does this mean in gdb?

Program received signal SIGSEGV, Segmentation fault. 0x08049795 in execute_jobs () Current language: auto; currently asm (gdb) info symbol 0x08049795 execute_jobs + 22 in section .text (gdb) ptype 0x08049795 type = int How to get the line number at which the error occurred? ...

Want to monitor variables in gdb and log it

Hi, I would like to know if there is any way in which I can monitor a value of a variable until for example a counter reaches a value and then log the output of variable value during each counter value? ...

How to set Emacs gdb so that it shows recent command on arrow-up?

How can I set Emacs gdb so that it shows the most recent command when I press arrow-up? In the Emacs gdb it will just go one line up in the buffer. I know you can always just search backwards in the buffer and select a recent command there, but getting the command directly with arrow-up would be more convenient. ...

Adding breakpoint in gdb using fb -[NSTimer release] doesn't work. How can I add a breakpoint on [NSTimer release]?

Hi I have seen a few examples of adding breakpoints in gdb using the command fb. I have tried using the following but it doesn't work... fb -[NSTimer release] I tried it but it says. Function "-[NSTimer release]" not defined. As you can probably tell I want the debugger to stop when release is called on any NSTimer object. How c...

gdb & finding out when a memory address is written to

I am trying to figure out when a certain memory address is written to. I have tried couple of different loops in gdb but it never stoped. Any ideas? Ex: (gdb) while *0x68181b88 == 0 > step > end PS: This is a mips linux system. Edit: My MIPS does not have hw support/registers to watch memory values. Although watch works, it takes ab...

mipsel-gdb breakpoint from source code

It seems that gdb is failing to find breakpoints if a class is implemented in the header file. Therefore I am trying to force a breakpoint from the source. I guess I need the mips equivalent of asm("int3"). Any ideas? PS: asm("break 3") does not work ...

Debugging PostgreSQL User Defined Functions

I'm taking over development of a set of User Defined Functions and User Defined Aggregates written for PostgreSQL, and I'm having difficulty diagnosing what's causing the code to constantly seg fault. Does any one know if/how it's possible to use GDB with a UDF written in C++? A couple of google searches didn't turn up anything. I've ...

Using Eclipse to remotely debug with gdbserver

Does anyone know why I can't use Eclipse CDT to remotely debug a device when I manage it on the command-line with gdb using target remote command? I do get a warning when connecting, but other than that it seems to work fine. With Eclipse I should have the correct settings and gdbserver informs me on the remote machine that a connection...

How it's better to invoke gdb from program to print it's stacktrace?

Now I'm using function like this: void print_trace() { char pid_buf[30]; sprintf(pid_buf, "%d", getpid()); char name_buf[512]; name_buf[readlink("/proc/self/exe", name_buf, 511)]=0; int child_pid = fork(); if (!child_pid) { execlp("gdb", "gdb", "-batch", "-n", "-ex", "set pagination off", "-ex"...

How can I get the program's output from GDB/MI?

I'm trying to understand GDB's MI interface in order to write a basic frontend for it, but there's one thing that's confusing me. According to the documentation, any output from the running target is prepended with "@", but when I run a program on my own, the output from the program being debugged is not prepended with anything. Is GNU s...

gdb watch pointer that is not valid yet

Hi all, I have the following code: #include <stdlib.h> #include <stdio.h> #define SIZE 100 int* arr; main() { int i; arr = (int*)malloc(SIZE*sizeof(int)); if (arr == NULL) { printf("Could not allocate SIZE(=%d)", SIZE); } for (i=0; i<SIZE; i++) { arr[i] = 0; } free(arr); } I wan't to...

Global symbol not in symtab

I'm getting the following error when trying to output a stack trace through GDB: global symbol 'object' found in a.cpp psymtab but not in symtab What does this error mean exactly, and is it caused by my code or is it a GDB issue? ...