This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: IA32: printing FP register variables
On Thu, Jul 08, 1999 at 10:59:00PM -0600, Jeffrey A Law wrote:
>
> In message <000d01bec9c2$06f4fdb0$3404010a@metrowerks.com>you write:
> > I would suggest that we may use a "negative" ST value. The debugger can
> > always know the depth of the stack from reading the status registers, so
> > saying that something was in ST(7) could be interpreted as the top-most
> > stack item, ST(6) as one below that, and so on. As long as the relative
> > position of items on the stack didn't change (this var is always 2 from the
> > top), this should be OK.
> Unfortunately, I believe the relative positions of items does change.
>
> Jim's brought up an interesting problem.
>
> I believe dwarf2 can handle this in a straightforward manner -- it has the
> capability to say variable X is in location Y between points A & B and in
> location Z between points C & D.
>
> This is more difficult to do with stabs, but possible since Cygnus defined a
> set of extensions to describe the same basic concepts.
>
> The more difficult problem is getting information about the state of the
> FP regstack into dwarf2out.c & dbxout.c in a reasonably clean manner.
This is actually a symptom of a much deeper problem that I would like to see
addressed in the compiler at some point, namely tracking variables being
reloaded, etc. For example, if the compiler determines that a variable is on
the stack, but needs to load up a variable into a register to work on it
(reload in gcc speak), we currently don't track this, so if you put a
breakpoint after the load has been done, but before it is used, you won't be
able to change the value to affect the running of the program.
Also when I first did the LRS changes, I thought that you could do LRS debug
information in any debug format, including crippled ones like COFF, if you were
willing to create a new block for every state change (ie, variable moving from
stack to register).
--
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: meissner@cygnus.com phone: 978-486-9304 fax: 978-692-4482