This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] add support for debugging fixed-point numbers
- From: Tom Tromey <tromey at redhat dot com>
- To: "Sean D'Epagnier" <geckosenator at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 07 Jan 2009 12:56:13 -0700
- Subject: Re: [patch] add support for debugging fixed-point numbers
- References: <b9d4feda0812291740s62b913dbwee970d9c406d9d40@mail.gmail.com> <m3hc4lxwkj.fsf@fleche.redhat.com> <b9d4feda0812311245m3e7143bnc8760b0b2b8dc97f@mail.gmail.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Sean" == Sean D'Epagnier <geckosenator@gmail.com> writes:
Sean> Thanks so much for reviewing my patch. I am sorry for all the
Sean> inconsistencies, I will do my best to correct them, more comments
Sean> below.
Oh, don't be sorry... the coding standard is just a little hurdle
everybody has to get over when they first contribute, not a big deal.
Tom> I am not really that familiar with the fixed-point extension to C. My
Tom> understanding is that some of the types saturate -- but I didn't see
Tom> any code here related to saturation. Am I missing something?
Sean> If the type is _Sat, then it is a saturating type. I did not have any
Sean> support for this, however there is currently no way for me to know if
Sean> a variable is a saturating type (nothing in the dwarf format
Sean> specifying it) So gdb might be inconsistent in the sense that if you
Sean> add a number to a saturating variable ie: "p x+.5" and x saturates,
Sean> then gdb won't know to saturate it, but unless we add more fields to
Sean> dwarf specifying this. What do you suggest we do about this? At
Sean> least you can examine saturating values correctly.
This sounds like a Dwarf oversight to me. Perhaps we can either get
something officially defined here (I don't know how to do that,
though), or define a GNU extension. I think that, at least, this
ought to be filed as a GCC bug, and maybe a GDB bug as well, once your
patch goes in.
IMO, the absence of this information should not block your patch.
Sean> I also noticed what seems to be a quirk in gdb. Maybe you have some
Sean> insight. If you launch gdb and type something like:
Sean> (gdb) p ((unsigned _Accum)- 1)
Sean> $7 = -1
Sean> (gdb) p ((unsigned int)- 1)
Sean> $8 = 65535
[...]
Offhand, I have no idea what is going on here, sorry.
Sean> I'm not sure which is best, to try to add fixed-point support to stabs
Sean> format too, or to make gdb read the types from the dwarf format in
Sean> this case (or maybe both)
I also have no idea about this :). I don't know anything about stabs,
I'm afraid.
Tom