This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: extending Gdb to display app specific data


> From: Michael Meissner <meissner@cygnus.com>
> Date: Fri, 10 Nov 2000 19:14:44 -0500
> 
> Do like GCC does and include functions in your code that take your type as an
> argument, and print the type in question to stdout (or stderr).  For example
> within gcc, there is debug_rtx, which takes a rtx pointer, and prints out the
> value in tree format, and similarly debug_tree which does it for tree nodes.
> To further enhance the debugging experience, the .gdbinit command includes
> several shortcuts (like pr/pt) that pass the last value to the above
> functions.

Emacs does the same; see the function `debug_print'.

For example, if I want to print an alist kept in a C variable
my_alist, I say:

 (gdb) call debug_print(my_alist)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]