* Re: gdb improvement for printing FP values, and Linux/Alpha FP bug?
@ 1996-05-23 6:12 David Mosberger-Tang
0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger-Tang @ 1996-05-23 6:12 UTC (permalink / raw)
Could you try the following gdb:
ftp://ftp.azstarnet.com/pub/linux/axp/misc/axpbin-gdb-4.16.tar.gz
It's linked against glibc and it is able to print NaNs and Infs etc.
So if that is really the problem, it should work now. Please let me
know how it works so I can fix things if necessary (or feel good about
it if it does work... :-)
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: gdb improvement for printing FP values, and Linux/Alpha FP bug?
@ 1996-05-22 20:29 David Mosberger
0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger @ 1996-05-22 20:29 UTC (permalink / raw)
I believe a gdb linked against glibc would avoid this problem. This is
because (AFAIK), all fp I/O in glibc is done through multiprecision (integer)
arithmetic. So printing exceptional numbers such as NaNs and Infs should not
be a problem. But to be honest, I haven't had time yet to try this. I have
been planning on building binutils and gdb against glibc in the next few
days (hopefully starting today). I'll test this and if it works, send you
a note.
The alternative would be to rebuild the entire libc with -mieee, but that would
be painful.
--david
^ permalink raw reply [flat|nested] 3+ messages in thread
* gdb improvement for printing FP values, and Linux/Alpha FP bug?
@ 1996-05-22 20:12 Craig Burley
0 siblings, 0 replies; 3+ messages in thread
From: Craig Burley @ 1996-05-22 20:12 UTC (permalink / raw)
Okay Peter, thanks for the pointer -- `i r $f10' does indeed
show the raw contents (in the wrong byte-order for this machine,
as you point out ;-), but note that it does so only _after_ it
shows the floating-point value.
On my Alpha, that means that the output of `i r $f10' when $f10
contains a denormal is:
(gdb) i r $f10
f10 Erroneous arithmetic operation
(gdb)
In other words, I don't get the raw value. Perhaps this could be
shown first?
Regardless, for now, due to what you suggest might be a Linux/Alpha bug,
I can work around this simply by issuing the command again -- at which
point, apparently, denormal support works properly, because I get
the appropriate output.
My concern is that, down the road, if _this_ bug is fixed (however
that might happen), I then wouldn't be able to examine the contents
of the register at all if the FP contents of the register caused
a trap. That's why I'd rather see the raw contents displayed first,
since that cannot trap, followed by the FP interpretation of the
contents. Does that make sense?
I'm sending this along to axp-list in case Linux/Alpha people want
to comment. Hope that's okay with you.
tq vm, (burley)
>From: "Peter.Schauer" <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
>Subject: Re: Need Way To Examine Bit Contents of FP Register
>To: burley@gnu.ai.mit.edu (Craig Burley)
>Date: Wed, 22 May 96 21:34:09 MET DST
>Cc: shebs@cygnus.com
>In-Reply-To: <199605190410.AAA18249@apple-gunkies.gnu.ai.mit.edu>; from "Craig Burley" at May 19, 96 12:10 am
>X-Mailer: ELM [version 2.3 PL6]
>
>E.g. `i r $f16' should supply what you want.
>Please note that the raw format output is in little endian order. This
>will be fixed in the next version of GDB.
>
>The other problem looks like a Linux bug. As long as you aren't calling
>functions in the inferior, I see no way why a print in the debugger
>should affect the inferior. It looks like the kernel is somehow sharing
>FPU state between processes.
>
>> Trying to debug some miscompiled code on the Alpha (by g77/gcc),
>> I ran into this frustrating problem using gdb-4.14, which maybe
>> gdb-4.16 addresses, but I haven't tried it yet (need to try
>> applying an AXP patch for 4.15.1, etc., and I don't want to
>> wait to submit this report until I try that, because I might
>> forget).
>>
>> The problem is that if an FP register contains an invalid value,
>> e.g. a denormal, gdb will complain when you try to print it out,
>> even if you try to print it out as hex. At least, I can't figure
>> out how to get gdb to not access and interpret the contents as
>> a simple bit pattern -- p/x, etc., would all complain.
>>
>> Not only that, but after the first complaint, gdb or Linux or
>> something would manage to set some state differently so not only
>> did the complaint go away, but so did the crash for the program
>> being debugged. Even "file a.out" still resulted in the program
>> running fine, despite undoubtedly still internally trapping on the
>> denormal -- I had to exit and reenter gdb repeatedly to resurrect
>> the abort that normally (?) happens on the trap. But, maybe this
>> is a behavior of Linux or something.
>>
>> Let me know if you need a transcript of these problems.
>>
>> tq vm, (burley)
>>
>
>
>--
>Peter Schauer pes@regent.e-technik.tu-muenchen.de
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-05-23 6:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-23 6:12 gdb improvement for printing FP values, and Linux/Alpha FP bug? David Mosberger-Tang
-- strict thread matches above, loose matches on Subject: below --
1996-05-22 20:29 David Mosberger
1996-05-22 20:12 Craig Burley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox