This is the mail archive of the gdb@sources.redhat.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]
Other format: [Raw text]

Re: [Q] Accessing fs:0 on x86 Linux?


At 01:51 14/12/2001 , Robert Baruch a écrit:
>Hi all,
>
>I'm trying to debug something in wine on an x86 Linux box. It requires looking at what is stored in memory starting at fs:0. I've searched all over for how to do this, but I've only seen one thread that seems to indicate that it can't be done.

Its not possible with the current GDB.

>Can anyone confirm or deny this?

  But I once announced that I had a tool that is able to do this on
the go32v2 target.
See
http://sources.redhat.com/ml/gdb/2000-q1/msg00515.html
and related thread.

  This was never really considered for insertion into GDB CVS...
Eli, there was no followup to your answer
http://sources.redhat.com/ml/gdb/2000-q1/msg00535.html
????

   On that target, its rather easy, as the debugger and debuggee share the same local descriptors.
  It should also be possible to do this on cygwin target.
We would need to use GetThreadSelectorEntry
win32 API function to get
the linear base  address of the %fs selector.
   This function is not called in current xwin32-nat.c code and this only works
because win32 kernel does give a zero linear base address to the 
ordinary code and data selector (value of %cs for code , %ds, %es and %ss for data selector).

   Regarding wine on linux, this really depends on how wine does set the %fs selector 
base and size, I have no idea how this is done...


Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


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