[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decladebug

Title:Digital Ladebug debugger
Moderator:TLE::LUCIA
Created:Fri Feb 28 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:969
Total number of notes:3959

741.0. "Ladebug not useful for examining floating registers" by STEVEN::hobbs (Steven Hobbs) Thu Dec 05 1996 11:48

T.RTitleUserPersonal
Name
DateLines
741.1TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlThu Dec 05 1996 17:0514
741.2px doesn't work well with floating point registersDECC::SEIGELFri Dec 06 1996 08:0813
741.3A more specific list of separate requestsSTEVEN::hobbsSteven HobbsFri Dec 06 1996 11:4938
741.4ADA9X::BRETTFri Feb 14 1997 14:076
You can see the precise value this way...

(ladebug) printf "%.18le",f
3.804305472977598400e-322

/Bevin
741.5Nonfinites in registers is the problemSTEVEN::hobbsSteven HobbsSat Feb 15 1997 17:2617
> You can see the precise value this way...

> (ladebug) printf "%.18le",f
> 3.804305472977598400e-322

I can see how this suggestion helps my point (5)--a cross reference
note 726--but I do not see how helps points (1) - (4) of this note
which deal with looking at architectural floating registers when they
contain values other than a finite T-float.

I know of two work arounds for problems (1) to (4): (a) patch a STT
instruction into memory, step over this instruction, and then examine
the memory location into which the floating register was stored; and
(b) switch from using ladebug to dbx and use the dbx printx command.
It would be helpful if the decladebug team could give me a more
convenient work around for examining architectural floating point
registers that do not contain finite T-floats.
741.6ADA9X::BRETTSat Feb 15 1997 23:215
I believe the following may be capable of doing what you want

(ladebug) call printf("%c%c%c%c%c %p\n",0,0,0,0,0, $f0)

Of course its gross, and should be hidden under an alias.,..
741.7Nice try (if I were using dbx)STEVEN::hobbsSteven HobbsSun Feb 16 1997 17:088
The (ugly) work around suggested in .6 for looking at nonfinites in
floating registers works fine in dbx but I get an internal error when
I use it in ladebug (also see your note 844).

Do you want suggest another workaround??  (I now know 3 different ways
that work correctly in dbx but which demonstrate a bug in ladebug.
Will the next suggestion be a fourth example of a ladebug "feature"
that is missing in dbx?)
741.8ADA9X::BRETTMon Feb 17 1997 08:0249
The following seems to work consistently...

% cat tmp.c

/* A couple of functions to call from the debugger */

void pd(double f)
{
    printf("%c%c%c%c%c %p\n",0,0,0,0,0,f);
}

void pf(float f)
{
    printf("%c%c%c%c%c %p\n",0,0,0,0,0,f);
}

int main()
{
    float f = 3.0;
    return 0;
}

% cc -g tmp.c
%
% ladebug a.out

Welcome to the Ladebug Debugger Version 4.0-30
------------------
object file name: a.out
Reading symbolic information ...done

(ladebug) stop in main; run
[#1: stop in int main(void) ]
[1] stopped at [main:13 0x120001234]
     13     float f = 3.0;

(ladebug) call pd(1.0)
 3ff0000000000000

(ladebug) call pf(1.0)
 3ff0000000000000

(ladebug) call pd(1.0)
 3ff0000000000000

(ladebug) call pf(1.0)
 3ff0000000000000


741.9TLE::BRETTWed Apr 02 1997 09:253
I have assigned this to Subir

/Bevin
741.10TLE::BRETTThu May 01 1997 09:3634
4.0 BL36

(ladebug) px $f14
0x1018

(ladebug) px $f0
0x1

(ladebug) px $f12
0x3fb999999999999a

(ladebug) printf "0x%16x\n",$f12
0x3fb999999999999a

(ladebug) printf "0x%17x\n",$f12
0x 3fb999999999999a

(ladebug) printf "0x%31x\n",$f12
0x               3fb999999999999a


Basically we taught the debugger how to interpret floating point values 
to match a %x format.

Hmmm, how about this...

(ladebug) p $f12
99
(ladebug) printf "%d\n",$f12
99

%d prints the numeric value, not the bit-pattern value.

/Bevin
741.11TLE::LUCIAhttp://asaab.zko.dec.com/~lucia/biography.htmlFri May 02 1997 12:256
My original thought, on reading about px and po, was that there were new
commands added, ala dbx 'printx' which says, get this bit pattern and print it
in hex, regardless of what type it really is.  Treating printf with the %x and
%o as special is troubling.  All printf patterns should match their C brethren,
which is, get these bits and display them as I asked.  "Size" really means
precision for printing, not to be confused with how many bits to fetch.
741.12problem (2) is fixedPACKED::ALLENChristopher Allen, Ladebug, dtn 381-0864Fri May 02 1997 12:259
This problem from .3 has been fixed in 4.0-36:

    (2) Ladebug needs a way to examine floating registers in hex.  (The
    notes I was referred to did not help).

The ladebug "printf" command has been enhanced to do this.  Use the
ladebug "px" alias, which is an alias for the "printf" command.

-Chris
741.13TLE::BRETTSat May 17 1997 13:014
844 problems with the call has been fixed
closed

/Bevin