gdb

Preventing GDB from stepping into a function (or file)

I have some C++ code like this that I'm stepping through with GDB: void foo(int num) { ... } void main() { Baz baz; foo (baz.get()); } When I'm in main(), I want to step into foo(), but I want to step over baz.get(). The GDB docs say that "the step command only enters a function if there is line number information for the functi...

Tips or resources for learning advanced debugging techniques GDB in xcode

Can someone recommend some good tips or resources to learn how to learn intermediate to advanced debugging tips and tricks using GDB in Xcode. ...

What debugger tools do you use to look at contents of a STL container (on linux)

I use gdb (actually DDD), and getting an element out of container is impossible. So I typically end up rolling my own loop for debugging purposes... What do you do? ...

how can I use debuginfo-install with a local file ?

hello, im trying to debug a program I wrote but the gdb tells me an error : Missing separate debuginfos, use: debuginfo-istall glibc-2.9-2.i686 when im trying to use that command, it gaves me an error because my fedora is disconnected from the internet. however, I have glibc-2.9-2.i686 in my fedora's cd. how can I use debuginfo-insta...

debuginfo-install using a local file

hello, im trying to debug a program I wrote but the gdb tells me an error : Missing separate debuginfos, use: debuginfo-istall glibc-2.9-2.i686 when im trying to use that command, it gaves me an error because my fedora is disconnected from the internet. however, I have glibc-2.9-2.i686 in my fedora's cd. how can I use debuginfo-insta...

What is a good unix alternative to DDD (Data Display Debugger)?

I am developing c on linux using vim and debugging using ddd. However I find that ddd performs very poorly at scrolling on this machine so its sometimes very frustrating to use. I like the way that ddd maps fairly closely to the gdb command set as this means I am free to use gdb commands when I choose, but using gdb itself is not an opt...

Go to previous line in gdb

Hi all, Is it possible in gdb to go to a line before the currently executing line. e.g: void my_fun( somePtrType** arr,int start,int end) { // arr is an array of pointers to somePtrType //line a ... some assignments swap( //line b (current line ) } I am at line b currently and can examine the arr values there but I want to go b...

Weird Error In Program

I am new to programming, so when I got this error, I didn't know what to do. In my iPhone app, I press a button to switch a view, then I get this in the log. GNU gdb 6.3.50-20050815 (Apple version gdb-966) (Tue Mar 10 02:43:13 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public...

Determine static initialization order after compilation?

In C++, I know that the compiler can choose to initialize static objects in any order that it chooses (subject to a few constraints), and that in general you cannot choose or determine the static initialization order. However, once a program has been compiled, the compiler has to have made a decision about what order to initialize these...

How to add a conditional breakpoint in Xcode

Hi, How to add a conditional breakpoint in Xcode? I try setting a breakpoint and then go to 'Edit breakpoint' I want to break when bytes is 0. So I add 'bytes==0' in the condition, but it never breaks. And then I try '(bytes == 0)' as my condition, the gdb crashes: bool SharedMemory::Map(size_t bytes) { if (mapped_file_ == -1) ...

Strange backtrace - where is the error?

Hi! I'm developing an image processing application in C++. I've seen a lot of compiler errors and backtraces, but this one is new to me. #0 0xb80c5430 in __kernel_vsyscall () #1 0xb7d1b6d0 in raise () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7d1d098 in abort () from /lib/tls/i686/cmov/libc.so.6 #3 0xb7d5924d in ?? () from /lib/tls/...

How can I force GDB to disassemble?

Hi! I'm trying to disassemble a program to see a syscall assembly instruction (the INT instruction, I believe) and the handler with GDB and have written a little program (see below) for it that opens and closes a file. I was able to follow the call to fopen with GDB until it executed a call. When I tried to tell GDB "disassemble 0x...."...

How do I set these break points in ~/.gdbinit?

Here is a list of break points to put in ~/.gdbinit that are really helpful in debugging memory problems: fb -[NSException raise] fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] #define NSZombies # this will give you help me...

Can I have gdb jump past a throw statement at the end of a function?

When I'm debugging, I sometimes find it useful to "replay" the last few statements of code. For example: void foo (int & i) { i = 0; ++i; i++; } While running this through the debugger, you can add a breakpoint at the top of the function body, and then from any statement inside of foo if you type: "jump file.cc:2" the debugger...

How can I continue to operate the gdb command console?

Maybe a simple question. When I attach to a process, I run "continue" to make it continue to run. Then I want to some other job like "add-symbol-file" with need not interactive with target process, but after the "continue" command, the gdb console will block, so I can not do any action before I break the process. Is there any way that...

SHowing Actvity Indicator View Using Thread Shows This Error in gdb?

i m using this on uitableviewcell's didselectrow method [NSThread detachNewThreadSelector:@selector(showMyWaitView) toTarget:self withObject:nil]; it works fine but it shows error in gdb like this 2009-08-10 12:45:01.313 FlashCards[1209:6307] * _NSAutoreleaseNoPool(): Object 0x458200 of class UIView autoreleased with no pool in place...

Dumping memory in gdb - how to choose the file name at run time

Hi, I'm running a program that does processing on a file. I want to be able to supply the program with several files, and by attaching to it with gdb, I want to get a memory dump at a certain point in the code for each of the files. I want the dump for each file to go to a file with the same filename as the input file (maybe after forma...

Multiple commands in gdb separted by some sort of delimiter ';'?

I am trying to execute two commands at once in gdb: finish; next I tried using the ';' to separate the commands but gdb did not let me do both at once. Is it possible to do multiple commands in gdb similar to bash commands separated by ';' delimiter? ...

how can i step through nested function calls in gdb?

sometimes i want to debug functions like this: my_func1(my_func2(my_func3(val))); is there a way i can step through this nested call in gdb? I want to step through my_func3, then my_func2, then my_func1 etc ...

Trouble debugging C++ using Eclipse Galileo on Mac

I am trying to debug c++ code using Eclipse Galileo on my MacBook Pro running Leopard. It's my first time trying this. I have a complicated c++ program I'd like to debug, but to test things out, I just tried to debug and step through the following: #include <iostream> using namespace std; int main() { int x = 0; cout << x << endl; ...