Reputation: 757
When using GDB (using text interface, TTY, and SSH on Gentoo Linux) for debugging C code, I want to print the data in objects. When I try using print-object <objectname>
, I get the message
evaluation of this expression requires the program to have a function "_NSPrintForDebugger"
I can't find any documentation or examples (is it me, or is Linux documentation very short on examples?) of how to create such a function. I would like an example(s) of NSPrintForDebugger functions for gdb that I can model. Note that I am new to C, Linux, MPI, emacs, and gdb.
To make this a little more difficult, I can't find the definition of all the objects I want to print.
If it helps make an example, some of the objects I'd like to print-object
are:
UserData
typedef struct { realtype dx, hdcoef, hacoef; int npes, my_pe MPI_Comm comm; realtype z[100]; } *UserData; UserData data;
N_Vector (part of SUNDIALS, may have varying definitions).
P.S. I have noticed that, for instance, p *data
displays a lot of information. But I want more.
Upvotes: 1
Views: 778
Reputation:
The NSPrintForDebugger
function that the GDB print-object
command is calling is part of the Objective-C runtime. Since you aren't using Objective-C, ignore it.
Upvotes: 2