Hello I am using GDB, and I would like to know if there is any way to stop a program when is using a function from a certain file. Ideally what I am looking for is something like:
GDB Stop when use a function from file foo.cpp
The reason to do this is because I am debugging a code that is not mine and I do not know exactly what functi...
Sorry in advanced gdb gurus, but how can I ask to display multiple vars in one line? So I want to get output like:
30 if(s[i] != '\0')
5: s[i] = 101 'e'
4: exp = 14
3: val = 123.45
2: sign = 1
1: i = 6
I've been typing in disp s[i] ENTER disp exp ENTER (etc, etc) and I just know there's got to be a better way to do this in one line ...
Let's say I have an array in C++:
double* velocity = new double[100];
Using the GDB command line, I can view this array with the command:
> print *velocity @ 100
and it will print a nicely-formatted list of all the double values inside the array.
However, when using the Xcode debugger, the most it will do is treat this as a pointe...
Hi,
I have a list of breakpoints which I want to add each time I debug a particular program.
Is there a way I can put all these breakpoint information in a file and use it at the starting of each debug session? In other words can I provide a script file with breakpoint information to GDB before I give the 'run' command.
Thanks in Advan...
OK, info break lists the breakpoints, but not in a format that would work well with reusing them using the --command as in this question. Does gdb have a method for dumping them into a file acceptable for input again? Sometimes in a debugging session, it is necessary to restart gdb after building up a set of breakpoints for testing.
E...
Has anyone actually used a reversable debugger? The only product that Google turns up is UndoDB. It is for apparently for Linux only.
...
I'm using Eclipse on Windows to program C++ using Cygwin's toolchain. I would like to use it for debugging as well, but my problem is the following:
The executable to debug is in a sub-folder of the workspace (pretty standard, I guess) but not of the actual Project from which the executable is built.
Eclipse and GDB have different path...
I'm trying to use gdb in postmortem mode with the core dump of a crashed process. I can get a stack trace, but instead of showing me the actual location in the offending function, gdb shows me the line number of a two-line inlined function that the offending function calls.
The inlined function is called many, many places; how do I fin...
I would like to have my error handling code behave differently if it is running under the debugger. Specifically, if I am running on a handset, not attached to a debugger and fail an assertion I want to send the error to my server. When I am under gdb, I want to break into the debugger.
Although I can imagine how Apple would write the c...
I get a segmentation fault when I cancel my program. I am using gdb for debugging, the problem is that when I press Ctrl-C while I am debugging gdb does not cancel the program and do what it is supposed to do that is stop it.
What I want is do the Ctrl-C and do not allow gdb to stop it. Is there any way to do this? Any other recommendat...
Hi,
I am trying to debug a small operating system I have written in an university course in C++. At runtime somewhere one of my objects is getting corrupted. It seems like this happens due to accidentally writing to the wrong memory address. As I am unable to find the place where this happens from pure looking at the code, I need anothe...
I am trying to step into my yyparse function, which is defined in Bison generated code, but I get a message from GDB saying
Reading file "foo.tab.c"...No such file or directory.
The file generated by Bison is called foo.cc. Why is it looking for foo.tab.c, instead?
...
According to the manual, string concatenation isn't implemented in gdb. I need it however, so is there a way to achieve this, perhaps using array functions?
...
Is there is any way to switch to assembly when debugging a C or C++ program in gdb ? (Given that all source files and their corresponding assembly files are available)
...
Hi,
I am trying to port a fairly large C++ project to using g++ 4.0 on MacOS X. My project compiles without errors, but I can't get gdb to work properly. When I look at the stack by typing "bt" on the gdb command line, all file names and line numbers displayed are wrong.
For example, according to the gdb stack trace, my main() functio...
If I accidentally launch tab completion when debugging large binary,
gdb will freeze for some time scanning symbol table (up to 1 minute in my case).
So I have to wait until whole symbol table is scanned.
Is there any way to interrupt this process in gdb?
...
Hi,
I am currently porting a project with a few hundred code files and dependencies onto several third-party libraries to Mac Os. I've finally gotten to the point where the program compiles without warnings or errors, but it does not seem to execute my own main function.
Instead it seems to execute some other main function which seems...
Hello
I am using GDB to debug a closed source program on Solaris 10 x86.
I attach gdb to the program and continue execution, however when I want to pause execution later to examine some memory I cant. When I press CTRL-C it only prints ^C instead of pausing the program and dropping me to a (gdb) prompt.
bash-3.00# gdb --pid=1521
GNU g...
Right now, I have F5 set to start gdb in emacs for me:
(global-set-key [f5] 'gdb)
This switches to the mini-buffer, which I then type a path to an executable... I'd like to find a way to bypass this path typing...
I wrote an executable that looks at the Makefile, parses it and figures out the full path of the executable and prints it ...
I've only recently began using the debugger extensively, so I'm not sure if this is a limitation. When I debug on the iPhone, the variables aren't up to date unless I explicitly view it (ctrl click -> view variable as expression). Is there a way to view actual variables without viewing explicitly?
...