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: Sun, 28 Nov 2004 18:34:53 -0500

 On Sun, Nov 28, 2004 at 01:55:50AM +0100, Samuel Thibault wrote:
 >     set $eip=$marcel_saved_pc
 >     set $esp=$marcel_saved_sp
 >     set $ebp=$marcel_saved_bp
 
 > (gdb) printf "%p %p %p\n", $eip, $esp, $ebp
 > 0x805afd2 0x3ffff7d0 0xbffefb18
 > (gdb) save-ctx
 > (gdb) set-ctx __main_thread
 > (gdb) printf "%p %p %p\n", $eip, $esp, $ebp
 > 0x805bf85 0xbffef9a0 0xbffefbb8
 > (gdb) rest-ctx
 > Cannot access memory at address 0x40000000
 > (gdb) printf "%p %p %p\n", $eip, $esp, $ebp
 > 0x805afd2 0x3ffff7d0 0xbffefbb8
 > (gdb) rest-ctx 
 > (gdb) printf "%p %p %p\n", $eip, $esp, $ebp
 > 0x805afd2 0x3ffff7d0 0xbffefb18
 > 
 > gdb has difficulties with setting back all three registers to previous
 > value. Putting instructions twice in rest-ctx doesn't help (although
 > calling it twice seems to !) Neither does putting instructions in
 > another order help. Would there be any cleaner way to do it ?
 
 I imagine GDB is trying to reset the notion of the frame in here somewhere.
 then because the registers are in an inconsistent state something goes
 wrong.  You may want to debug GDB, putting a breakpoint on
 memory_error, to see where the access came from.
 
 You may be able to do:
 set $eip = $savedip, $esp = $savedsp, $ebp = $savedbp
 
 I don't know if that will help.
 
 -- 
 Daniel Jacobowitz


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