This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC/i386newframe] Restore all registers from sigframe
- From: Mark Kettenis <kettenis at chello dot nl>
- To: mludvig at suse dot cz
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 31 May 2003 18:01:39 +0200 (CEST)
- Subject: Re: [RFC/i386newframe] Restore all registers from sigframe
- References: <3ED6050F.9010908@suse.cz>
Date: Thu, 29 May 2003 15:03:11 +0200
From: Michal Ludvig <mludvig@suse.cz>
Hi,
the attachd patch enables restoration of all registers when unwinding
from a signal handler. Currenty only PC and SP were restored and it's a
loss since all GPRs are there on the stack.
It's even more important for AMD64 because there parameters are usually
passed in regs and not on the stack.
Indeed. We defenitely need %ebp too to reliably unwind on the i386.
Might just as well go all the way. The other registers are usefull
for local variables stored in registers too. Floating-point registers
are a bit tricky though. It's fine to leave them out for now though.
I did it for amd64-linux and i386-linux as I don't know appropriate
offsets for other i386-targets. For this reason I kept a fallback to
sc_pc_offset/sc_sp_offset.
That's fine. I killed the fallback for amd64 though. And I added the
appropriate offsets for *BSD.
Do you like the idea? Or would you choose a different approach?
This was more or less what I had in mind. I made some changes to the
code though (you changed the offset of %esp on Linux :-().
Will check it in shortly.
Thanks,
Mark