This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] future gdb-gdb.py things in my pipeline...
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 15 Jan 2010 11:13:09 -0700
- Subject: Re: [RFC] future gdb-gdb.py things in my pipeline...
- References: <20100115093910.GD6667@adacore.com>
- Reply-to: tromey at redhat dot com
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I'll try to think of something generic that allows us:
Joel> - exclude certain fields
Joel> - print the fields we want in the order we want
Joel> - add certain artificial fields?
Joel> - other requirements???
If you change the printer to return a container, this problem is a lot
simpler. For any field where you just want to see the value as gdb
would ordinarily print it, you simply append the field's value:
result.append ('fieldname', value['fieldname'])
This is simple enough that, IMO, we don't need any extra machinery:
* To exclude a field, just don't append it.
* To order the fields, append them in the order you want.
* To add an artificial field, just append it with whatever name and
value you want.
Joel> * struct type pretty-printer. Would it make sense to print
Joel> the type code and name even if this information is in main_type.
Joel> The amount of output generated is still going to be reasonable,
Joel> while the extra data could be potentially very useful.
Yes please, usually when I print a struct type I want to see the name.
Joel> * We need pretty-printers for other GDB types as well. For instance,
Joel> a pretty-printer for struct value would be nice...
Yeah, that would be handy.
Tom