gdb

How to print a string in gdb?

I have a variable char* x = "asd\nqwe\n ... " and I want to print it with newlines printed as newlines not backslash n. Is it possible? ...

Can I use my gdb to debug an XCode project

Hi, I have a XCode which builds and runs under XCode. I would like to know if it is possible to debug it using a gdb I build under Mac OSX (gdb 7 to be specified). If yes, can you please tell me how can I do that? Thank you. ...

how can I put a breakpoint on "something is printed to the terminal" in gdb?

I would like to know from where inside a huge application a certain message is printed. The application is so big and old that it uses all conceivable ways of printing text to the terminal; for example printf(), fprintf(stdout, ...) etc. I write to put a breakpoint on the write() system call but then I'm flooded with too many breakpoint...

C code - need to clarify the effectiveness.

Hi I have written a code based upon a requirement. (field1_6)*(field2_30)*(field3_16)*(field4_16)*(field5_1)*(field6_6)*(field7_2)*(field8_1)*..... this is one bucket(8 fields) of data. we will receive 20 buckets at a time means totally 160 fields. i need to take the values of field3,field7 & fields8 based upon predefined condition. i...

What does "dwarf2_read_address: Corrupted DWARF expression." mean?

I'm trying to do a little debugging in my iPhone project, and whenever i try to print out an object to see its description in one specific method i get this message in gdb: "dwarf2_read_address: Corrupted DWARF expression." Does anyone know why this happens and how i would go about fixing it so that i can inspect my variables? ...

Anyone tried reverse-debugging in gdb?

Has anyone tried using the new record/replay and reverse-debugging features in the newly released gdb-7.0? I am one of the gdb developer/maintainers, and I'm very eager for user feedback! ...

Optimized code on Unix?

What is the best and easiest method to debug optimized code on Unix which is written in C? Sometimes we also don't have the code for building an unoptimized library. ...

GDB structure output

I haven't worked with gdb for a long time and this feels like a basic question. I am trying to observe a structure as it changes but rather than break at a specific point and print it out I'd rather let the application run as normal and give me a snapshot of the structure at a specific point. Think a breakpoint that performs an action ...

How do I find out where an object was instanciated using gdb?

I'm debugging an application and it segfaults at a position where it is almost impossible to determine which of the many instances causes the segfault. I figured that if I'm able to resolve the position at which the object is created, I will know which instance is causing the problem and resolve the bug. To be able to retrieve this inf...

windows version of the GDB frontend DDD

Is there a native (not cygwin) version of DDD available for download somewhere? ...

How can I add debugging symbols to Audacious?

I am writing a plugin for audacious, and I am experiencing random segfaults. I looked around and I found that I can process the program's core dumps with gdb. So I did that, and I got this output: http://pastebin.com/m7d0d663d As you can see, it says no debugging symbols where found anywhere. I want to compile audacious with debuggin...

Instruct GDB 6.5 to use source embedded in object file

Hi All! I've been trying to make GNU gdb 6.5-14 to use the source code embedded on the object file when debugging, instead of scanning some directories for it. The main reason is that I develop for an embedded platform and I cross compile, which means that all the source is in my computer. I read about the -ggdb3 flag, that includes a...

How do I get gdb working with D programs under linux?

I have a patched gdb 6.8, but I can't get any debugging to work. Given this test file: import std.stdio; void main() { float f = 3.0; int i = 1; writeln(f, " ", i); f += cast(float)(i / 10.0); writeln(f, " ", i); i++; f += cast(float)(i / 10.0); writeln(f, " ", i); i += 2; f += cast(float)(i / 5....

gdb - how to print result of evaluation for C++

Hi, Ive been looking around but was unable to figure out how one could print out in gdb the result of an evaluation. ie for instance in the code below: if (strcmp(current_node->word,min_node->word) > 0) min_node = current_node; (above i was trying out a possible method for checking alphabetical order for strings, and wasnt abso...

Why can't gdb attach to server application summoned with inetd?

I have a server application that can be summoned for the client using inetd. However, if I try to attach to the server process that was launched with inetd, I get the following response: ptrace: Operation not permitted. gdb --annotate=3 /my/app/here <processId> Current directory is /usr/local/bin/ GNU gdb 6.8 Copyright (C) 2008 Free S...

Debugging with Eclipse CDT and GDB

Hy, I have Eclipse CDT C++ application project that uses shared library. This library is compiled with debug info and its' source is available at the right path. Now I try to debug my application with Eclipse and GDB. If I put breakpoints in my application source code, everything is fine. Then I open a source file of the included shar...

Debugging a Static Library with the Eclipse CDT

I'm working on getting set with Eclipse CDT for some embedded development and I'm having difficulty getting source level debugging working for static libraries. I'm using my own Makefiles, so that is my first suspect right now, especially since gdb claims that no symbol table info is available for the functions with no source. When usi...

Debugger Status in Xcode Console

Hi Everyone, I have a query regarding Debugger Status like The Debugger has exited With status 0 The Debugger has exited With status 1 and so on What are the Status of the Debugger ?? Based on which criteria Status can be Categorized ?? Please Let me know different kinds of status and its usages what are the consequences happen when...

iphone Xcode 3.1.4 3.1.2 SDK, watchpoints don't work?

If I try to set a watchpoint I get a gdb error: " can't clear hardware watchpoints without the 'Z2' (write-watchpoint) packet " Then it seems to corrupt the device (on restarting the device it complains that the OS is too old for the SDK, even though it's OS 3.1.2). I've got a bug to track down that really would be easy to track down ...

debugging C++ code with templates and STL with gdb

Hello, What do gdb users here think about its capabilities in regards to debugging code with templates and STL? Do you use any tricks to make the debugging any simpler? Perhaps some Python scripts? Or are you satisfied the way it is at present in gdb (ver 6.x, haven't tried 7.x yet)? Thanks. ...