gdb

Eclipse CDT debugger does not show console

Hi, I'm trying to debug a C program using Eclipse CDT-s debugger and gdb on a Windows7 system, and everything seems fine, except for the console not showing up, which is bad, because my program needs input at some points from the keyboard. So how should I make Eclipse's debugger work properly? Thank you. ...

Why does gdb show two different returns?

Hello all, Last week I was a debugging a code and a weird situation came up: gdb passes through two different return clauses. I made a simple example that illustrates the situation: #include <iostream> using namespace std; int test() { string a = "asd"; string b = "asd"; while (true) { if (a == b) { ...

Pretty printing boost::unordered_map on gdb

Hi all, recently I've started to use the excellent boost::unordered_map on my system, but got one drawback: I couldn't figure how to inspect its contents. Printing it on gdb gives me a table_ and a buckets_, but haven't found where are the items. Anyone has a clue about this? ...

Cannot place breakpoint in gdb in emacs

I'm trying to debug a small program I've written in C. I open up the file in emacs, M-x gdb, give the program filename (a.out). When i switch to the source file in the emacs pane, and try to place a breakpoint in the main function, I get the message "No default breakpoint address now." and the breakpoint doesn't place, so I can't debug t...

Auto tester/debugger for g++ ?

I just finished a project for my cryptography class and it all seems to go well (mostly). Because the key is generated randomly, I wanted to ensure it would work for all keys. Anyway, I ran it a bunch of times and hit a segfault at around the 30th run. I haven't been able to reproduce this segfault in gdb. Does gdb have a command, or is ...

Assembly GDB Print String

So in assembly I declare the following String: Sample db "This is a sample string",0 In GDB I type "p Sample" (without quotes) and it spits out 0x73696854. I want the actual String to print out. So I tried "printf "%s", Sample" (again, without quotes) and it spits out "Cannot access memory at address 0x73696854." Short version: How d...

Pointing symbol-file folder for gdb

You can point a single symbol file to gdb with command symbol-file /usr/lib/debug/symbolfile.so But how to tell gdb to load all symbol-files from given path including subdirectories? ...

How to make the debugged app find shared libraries when invoked in gdb inside Eclipse CDT?

I'm trying to debug Firefox trunk inside Eclipse CDT on Linux x86_64 (Ubuntu Karmic). I have done the following: I have made a path mapping from / to / per DevMo in the Source pane of the project-level Run/Debug config. I have set /opt/Projects/obj-debug/dist/bin/firefox-bin as the C++ app in the Main pane. (My Firefox obj dir is /opt...

Need info on "set endian" on solaris machine

Hi, Can any 1 please tell or show the difference in the behaviour of any program before and after I "set endian little" in gdb on solaris machine? I want to know the effect of changing it. Thanks! ...

Stepping Over in Emacs GDB

I'm having some trouble stepping over in GDB. I've built an example program from the ffmpeg library with debug symbols on and stripping off. Although I configured the ffmpeg library to static and explicitly disabled shared, it looks like the program I'm debugging is linking dynamically, since its file size is only 99kB. I don't know t...

qapps runs well but breakpoint sometimes generates segmentation fault

I have a qApp that generates a segmentation fault only when a breakpoint is inserted in the code (I can put it at different places) and only after 4-5 breakpoint stops. Do I have a problem with my code or is this a DBG bug. the method is part of a QThread Class. Basically what I did is i took the mandlebrot example, and have 3 instan...

Can I Always debug multiple instances of a same object that is of type thread with GDB?

program runs fine. When I put a breakpoint a segmentation fault is generated. Is it me or GDB? At run time this never happens and if I instantiate only one object then no problems. Im using QtCreator on ubuntu x86_64 karmic koala. UPDATE1: I have made a small program containing a simplified version of that class. You can download ...

Help with a cryptic error message with KGDB - Bogus trace status reply from target: E22

Hi, I'm using gdb to connect to a 2.6.31.13 linux kernel patched with KGDB over Ethernet, and when I try to detach the debugger I get this: (gdb) quit A debugging session is active. Inferior 1 [Remote target] will be killed. Quit anyway? (y or n) y Bogus trace status reply from target: E22 after that the session is still open, I c...

gdb+osx: redirecting stdout may cause printf to have a 2**14 bytes buffer?

I attached to a program with gdb in OSX and I want to use CFShow in the gdb console etc. However, nothing shows up. printf shows nothing as well: (gdb) call (int) printf("Hello\n") $10 = 6 (gdb) call (int) printf("Hello World!\n") $11 = 13 Apple suggests the following tip for when attaching with gdb, to make the output appear in the g...

Improve GDB macro

I have this gdb macro, which is used to print meaningful stacktraces when debugging the mono runtime. It iterates over all stackframes, figures out if that frame is native or managed. If it is managed, it uses info from mono_pmip() to print a decent description of that frame. If it is native, it calls gdb's "frame" to describe the frame...

Debugging in emacs (with gud) often results in stack overflow error

Hi, I'm getting this message in emacs when debugging: error in process filter: gdb-stack-list-locals-handler: Stack overflow in regexp matcher error in process filter: Stack overflow in regexp matcher I then have to kill gdb and restart the debugging session. Any ideas? ...

Problems debugging using Cygwin gdb in Eclipse CDT(Helios)

I am trying to debug an application using Eclipse CDT and cygwin gdb and I am facing a problem if my code calls Sleep(), it looks like whenever a sleep is encountered in the code the debugger seems to go in an infinite loop(I meant it never terminates or hit a breakpoint after sleep). On pressing pause the code is stuck on one of the thr...

Using gdb with GMP variables

I am debugging some C code with gdb. My program has a variable of type mpz_t * retval. If I run the command print *retval I get the output $23 = {{ _mp_alloc = 6, _mp_size = 5, _mp_d = 0x1001008d0 }} Is there anything else I can do to get more information about the value stored in retval? ...

debugging native code (C++) using gdb on android with Eclipse. Is it possible?

Hi, I have some piece of code which uses JNI. I can debug code wrote in Java directly in Eclipse (using ADT). I even have a script, which help me debug native code with gdb. However this is not very comfortable way for doing this. Is it possible to configure Eclipse to use gdb (I guess gdbserver) for debbuging android native applicatio...

How do I get a visual debugger on Mac OS when I have no XCode project?

I am porting a project over to OS X. I am finding GDB debugging in the console to be woefully insufficient and really need a visual debugger. My project is built using Scons and as such, it sidesteps Xcode's IDE entirely. This is acceptable until I need to fire up a visual debugger and step through my code. Aside from generating and ...