This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: extending Gdb to display app specific data
> From: bstell@ix.netcom.com
> Date: Fri, 10 Nov 2000 08:51:29 -0800
>
> Eli Zaretskii wrote:
> > One way is to call the functions in the debuggee that convert these
> > strings to a printable representation, then print the result ...
> > Does that solve the problem?
>
> If it can be put in a ".gdb_display_funcs"
> and the user can type "p unichar_ptr"
> and it works then that would be great.
That would require GDB to support every possible charset out there;
Unicode is not the only game in town.
While it would be extremely nice if GDB knew about all the charsets
and their encodings, it looks like a terribly huge job to add that.
> Having to remember a display function puts
> the knowledge burden on the (non expert)
> user. The user has to know the data type
> and then know the display function.
I'm assuming that a person who debugs a program knows something about
its internals, including how it represents non-ASCII characters.
> Imagine the frustration if one had to type
> "p display_string(ptr)" every time they
> wanted to see a ascii string.
That's exactly what I need to do when, for example, I need to print a
Lisp data structure, such as an alist, when I debug Emacs.
> Doesn't gdb already know the data type?
GDB knows the data type, but it doesn't necessarily know how to
generate a human-readable representation of that data type.