diff options
author | Fred Fish <fnf@specifix.com> | 1992-06-29 23:34:38 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-06-29 23:34:38 +0000 |
commit | 51b57ded888cbdacb5ad126363f8ae6adc9541b6 (patch) | |
tree | 2e4f19add96d95001bd828328f309ca1b4a6b0a7 /gdb/i386-tdep.c | |
parent | 22fd4704bccdd29ab742445e9a4017e457ef449f (diff) | |
download | gdb-51b57ded888cbdacb5ad126363f8ae6adc9541b6.zip gdb-51b57ded888cbdacb5ad126363f8ae6adc9541b6.tar.gz gdb-51b57ded888cbdacb5ad126363f8ae6adc9541b6.tar.bz2 |
* dbxread.c, i386-pinsn.c, i386-tdep.c, regex.c, solib.c, symmisc.c,
symtab.h, tm-i386v4.h, valprint.c, values.c: Lint.
* breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c,
findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c,
putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h,
utils.c, valarith.c, valops.c, valprint.c, values.c:
Replace bcopy() use with memcpy(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c,
ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h,
target.c, values.c:
Replace bzero() use with memset(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
* i386-tdep.c, main.c, valprint.c:
Replace bcmp() use with memcmp(), which is more standard and can
take advantage of gcc's builtin functions for increased performance.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index ab56e62..da3f3cb 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "frame.h" #include "inferior.h" #include "gdbcore.h" +#include "target.h" #ifdef USE_PROC_FS /* Target dependent support for /proc */ #include <sys/procfs.h> @@ -203,9 +204,9 @@ i386_get_frame_setup (pc) static unsigned char proto2[4] = { 0x87,0x44,0x24,0x00 }; pos = codestream_tell (); codestream_read (buf, 4); - if (bcmp (buf, proto1, 3) == 0) + if (memcmp (buf, proto1, 3) == 0) pos += 3; - else if (bcmp (buf, proto2, 4) == 0) + else if (memcmp (buf, proto2, 4) == 0) pos += 4; codestream_seek (pos); @@ -388,13 +389,12 @@ i386_frame_find_saved_regs (fip, fsrp) struct frame_saved_regs *fsrp; { long locals; - unsigned char *p; unsigned char op; CORE_ADDR dummy_bottom; CORE_ADDR adr; int i; - bzero (fsrp, sizeof *fsrp); + (void) memset (fsrp, 0, sizeof *fsrp); /* if frame is the end of a dummy, compute where the * beginning would be @@ -644,3 +644,37 @@ fill_fpregset (fpregsetp, regno) #endif /* defined (FP0_REGNUM) */ #endif /* USE_PROC_FS */ + +#ifdef GET_LONGJMP_TARGET + +/* Figure out where the longjmp will land. Slurp the args out of the stack. + We expect the first arg to be a pointer to the jmp_buf structure from which + we extract the pc (JB_PC) that we will land at. The pc is copied into PC. + This routine returns true on success. */ + +int +get_longjmp_target(pc) + CORE_ADDR *pc; +{ + CORE_ADDR sp, jb_addr; + + sp = read_register(SP_REGNUM); + + if (target_read_memory(sp + SP_ARG0, /* Offset of first arg on stack */ + (char *) &jb_addr, + sizeof(CORE_ADDR))) + return 0; + + + SWAP_TARGET_AND_HOST(&jb_addr, sizeof(CORE_ADDR)); + + if (target_read_memory(jb_addr + JB_PC * JB_ELEMENT_SIZE, (char *) pc, + sizeof(CORE_ADDR))) + return 0; + + SWAP_TARGET_AND_HOST(pc, sizeof(CORE_ADDR)); + + return 1; +} + +#endif /* GET_LONGJMP_TARGET */ |