gdb

configure gdb compiler in netbeans6.8 in linux platform

hi guys, i have a small problem.can anybody say how we can configure gdb compiler in netbeans6.8 in linux platform. thanks in advance. ...

How can I debug my Qt application?

I have to debug something in my Qt application but the stack shows instructions that are not part of my code and I have 3 threads (including main) running. What is the best way to debug this? DO I need squish? Would you be able to help if I pasted the stacks? Here is the stack trace of the thread that seems to be in fault: 0 raise ...

pthread_t to gdb thread id

Does anyone know a way to go from a pthread_t to what GDB displays with info threads? So I have: (gdb) info threads 37 Thread 22887 0xb7704422 in __kernel_vsyscall () 36 Thread 22926 0xb7704422 in __kernel_vsyscall () 35 Thread 22925 0xb7704422 in __kernel_vsyscall () 34 Thread 22924 0xb7704422 in __kernel_vsyscall () 33 ...

Using gdb with remote sources

Hi, I'm mostly developing C++ applications with g++ on solaris 10, x64 boxes. These applications are built and deployed with symbols, but without sources on the remote site. When debugging you can then set breakpoints and inspect variables, but you have to "manually" map the reported line numbers to an editor (usually vim/gvim) where yo...

gdb debugger in xcode doesn't work

I'm trying to use direct commands to gdb through xcode's console window when the program is paused. But the (gdb) prompt just accepts the carriage returns, and does nothing. Has anyone encountered this? I'm on the latest version of Mac OS X (10.6.2) with the XCode 3.2 beta. ...

page level watchpoints in gdb

Is there anyway in GDB to put a memory watchpoints on page level? I want to break on first access to a page, this access can be anywhere on that page, so i can't put a normal memory watchpoints - since I don't know the address - Also, is there anyway to change the page protection of memory page in GDB ( say change from r/w to no access )...

How to set up gdb watchpoints in a program consisting of many files in C++ ?

I am trying to set up a watchpoint to monitor a variable in a package consisting of many C++ files. There are many files abc.cpp qwe.cpp .. xyz.cpp and so on I want to monitor a variable 'temp' in some function qwerty() in the file abc.cpp How do I set the watchpoint ? I tried watch abc.cpp::temp watch abc.cpp:temp watch temp but...

How do I get GDB to break out of a loop?

I can tell GDB to return from a function immediately with return, and call a function with call myFunction. But how do I get it break out of the current loop? i.e. to act as if it's hit a break; statement. Is jump myfile.c:<linenumber> the way to do this? ...

How to attach VC++ debugger (or gdb) in this situation?

I'm running a typical producer and consumer process, but they are executed by using pipe in the command line like the following: c:\>producer | consumer producer is just printing out data to stdout, and consumer reads from stdin. My problem is that I want to debug consumer process. What is the best way to do it in both VC++ and gdb? ...

Saving debugging state and backwards debugging with Xcode or friends

Hi, I am using Xcode in order to debug C++ programs. The main problem for me is that it takes around 10 munutes till the program gets to the point of the program that I need to debug. Then I realize about something inspecting the variables and some other stuff, and modify the code. Then 15 minutes again and so ... I wonder if there is ...

automatically skipping/ignoring external code in gdb

anybody know how to tell gdb to only enter code that is in your project? I know it's hard for a debugger to know what is "in the project" and what is a library....but I thought some naive checks could help, eg don't look in any files that aren't in the users home directory. I frequently have code like this: MyFunction(complexVarable, co...

gdb: breakpoint when register will have value 0xffaa

Can I set the breakpoint/watchpoint/smth else in gdb for register value? I want to break when $eax will have value 0x0000ffaa. Is it possible with gdb or dbx or any other unix debugger? ...

How to write commands in a GDB script that get executed every time a particular brkpt is hit ?

I need to debug a certain set of commands each time i invoke gdb - so I decided to put them in my .gdbinit. Everything was fine , till i decided to use commands (to execute a certain set of gdb commands each time a certain brkpt is hit). My script looks is as follows: define setup handle SIGTRAP noprint nostop br 'Class1::Fun1(voi...

gdb fails with error 193 when debugging MinGW-compiled code

This is shown when I try to debug my code with Eclipse: I then tried creating a simple Hello World program manually with Notepad++ and the command-line gcc. When I launched the gdb debugger this happened: (gdb) run Starting program: C:\Documents and Settings\Pieter\Bureaublad/test.exe Error creating process C:\Documents...

Setting a breakpoint on a member function called on a specific object

In gdb, is it possible to set a breakpoint on a member function called on a specific object? To be more specific, imagine class A has a member function Foo(). I'd like the program to stop when Foo is called on a specific object of type A (0xFF11DEADBEAF for example). Is this at all possible? ...

gdb: howto list open files

I am wondering if it might be possible to get a list of files/directories that the debugged application has opened but not closed from GDB itself ? Currently I set a breakpoint and then I use an external program like lsof to check for opened files. But this approach is really annoying. Environment: Debian-Lenny with gdb v6.8 EDIT: I ...

Shared library debug in forked process

How can I debug a shared library in the this case: A daemon is checking which job is set to run, if find one, the daemon will fork a process. This process will do dlopen/dlsym etc to use the shared library. The shared library is under my control so I can put one with debug information. While the daemon is not under my control and canno...

glibc detected error

Hey, Can anybody please help me make sense of this error message? *** glibc detected *** ./kprank_new3_norm: munmap_chunk(): invalid pointer: 0x00000000096912d0 *** ======= Backtrace: ========= /lib64/libc.so.6(cfree+0x1b6)[0x3df6e75a36] ./kprank_new3_norm[0x409277] ./kprank_new3_norm[0x4092a9] ./kprank_new3_norm[0x4092ea] ./kprank_new3...

GCC option that can cause trouble when debugging with GDB

Hi all, I was wondering if I can get a list of gcc option that can cause gdb to behave strange. Of course, we all know that using optimization options (-O3 for instance) causes weird behaviour in gdb, but what are the other options that can have such impact? (I'm currently trying to run an mpeg2 decoder in gdb and I get weird behaviou...

Variable name conflict with GDB debugger

I'm debugging a C++ program with GDB on Linux, and I need to see the value of a member variable while the program is running. The member variable, unfortunately, is named list, which happens to be a GDB keyword. So when I try: print m_operations.m_data[10].m_data.list I get... A syntax error in expression, near list'. I tried all s...