This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Fwd: FLOAT INFO QUESTION]


The layout in tm-i386.h is how gdb wants to see things.
Each target, either native or remote, has to read the registers
and store them in that exact order/layout in the register file.

So you use your OS syscall to read the registers and copy them
to the register file placing them in the right places.

Look what i386-linux-tdep.c does.

Fernando

P.S.: I would suggest that anyone trying to understand how some
code works downloads and starts using SourceNavigator.  Your lives
will become considerable less complicated (at least in the hacking
front ;-).


> Date: Thu, 22 Jun 2000 06:47:32 -0700 (PDT)
> From: takis@xfree86.org
> To: gdb@sourceware.cygnus.com
> Subject: FLOAT INFO QUESTION
> 
> Hello,
> I had a look in the new float info routines
> of gdb 5.0 and I am a little confused. If you look
> in <linux/processor.h> you will find that the 387
> structure is like
>         cwd (fctrl)
>         swd (fstat)
>         twd (ftag)
>         fip
>         fcs
>         foo
>         80 bytes = 8*10
>         status
> 
> Now in the operating system that I run (aka DG/UX unix)
> and want to do a port of 5.0, I find the structure:
> 
> struct fpregset {
> 
>              union{
> 
>                     struct fpchip_state fpchip_state;
>                     emulation struct
>                     int f_fpreg[62];
>                   }
> 
>                   long f_wregs[33]; /* weitek */
>                  }
> 
> Where: struct fpchip_state {
>                   int state[27];
>                   int status;
>                  }
> 
> So the first member reserves 108 bytes = 7 4 bytes fpregs + 8 *10.
> Tah agrees with the linux idea.
> 
> Now in GDB-5.0 we find in tm-i386.h a new layout as
> 
>    fctrl, fstat, ftag, fiseg, fioff, foseg, fooff, fop
> 
> Which is clearly different from the struct of linux. Basically
> if I want to unpack fpchip_state above to floating regs I dont know
> if the order is fctrl, fstat, ftag , fiseg(=fcs), fioff(=?) , ????
> or (what I always thought is)
> 
>   fctrl,fstat,ftag,fip,fcs,fopoff,fopsel,status
> 
> And in this new layout in tm-i386.h which one is the status? I
> clearly have 108 bytes so how I would obtain the fop
> mentioned in tm-i386.h?
> 
> Regards,
> T.

-- 
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@cygnus.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]