4/5 - fix/implement x86_64 gdbarch_get_longjmp_target

Pedro Alves pedro@codesourcery.com
Mon Apr 7 02:40:00 GMT 2008


The i386_get_longjmp_target is really not suitable for amd64/x86_64.
It tries to read the jmp_buf out of the stack, which is suitable
for x86, but on all x86_64 implementations I looked at, jmp_buf
is passed on %rdi as normal.  The only am64 targets that currently
sets tdep->jb_pc_offset are netbsd, and openbsd in amd64nbsd-tdep.c
and amd64obsd-tdep.c respectivelly.

But, peeking at the sources, reveals that all use %rdi too.

netbsd:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/arch/x86_64/gen/_setjmp.S?rev=1.1&content-type=text/x-cvsweb-markup

openbsd:
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/arch/amd64/gen/setjmp.S?rev=1.2&content-type=text/x-cvsweb-markup

As I don't have access to NetBSD or OpenBSD, I tested this in combination
with patch 5/5 that makes x86_64-unknown-linux-gnu use this too.

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: longjmp_amd64.diff
Type: text/x-diff
Size: 3914 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080407/e64b9c3f/attachment.bin>


More information about the Gdb-patches mailing list