This is the mail archive of the gdb-prs@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: gdb/1799: $fp is not a left value, would be useful to be


The following reply was made to PR gdb/1799; it has been noted by GNATS.

From: Daniel Jacobowitz <drow@false.org>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: gdb/1799: $fp is not a left value, would be useful to be
Date: Sat, 27 Nov 2004 18:31:20 -0500

 On Sat, Nov 27, 2004 at 06:22:28PM +0100, Samuel Thibault wrote:
 > Le ven 29 oct 2004 à 22:12:14 -0400, Daniel Jacobowitz a tapoté sur son clavier :
 > > On Wed, Oct 27, 2004 at 12:16:40PM -0000, samuel.thibault@ens-lyon.org wrote:
 > > > I'm writing some context-switching functions, and can't get a way to
 > > > arch-independantly write in $fp register:
 > > 
 > > Could you explain a little better what it is that you are trying to do?
 > 
 > I am trying to debug a user-level thread library which stores contextes
 > in a jmp_buf structure. Gdb's info threads command isn't aware of
 > such threads of course, but by altering registers by hand (esp,
 > eip and ebp on x86), one can be able to switch between different
 > user-level threads (though in practice it doesn't work really well, gdb
 > almost always crashes on the second switch).
 > 
 > > $fp doesn't have an architecture-independant meaning; in many cases it
 > > is computed, not a register at all.
 > 
 > Hum, indeed.
 > Could there be any architecture-independant way of achieving context
 > switches by hand ? (sort of longjmp, but without actually continuing the
 > program)
 
 The layout of the jmp_buf is already architecture dependent.  Why not
 just ship an appropriate .gdbinit file for each architecture, defining
 a macro which sets the registers?
 
 -- 
 Daniel Jacobowitz


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