diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-10-11 21:08:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-10-11 21:08:57 +0000 |
commit | 60e86a677efb1cab3983ef936b8530907b6f06a0 (patch) | |
tree | e0f33843ef3b9877579e48bf38ec38e7ba0e04dd | |
parent | b255ccdb40a5f088f7a55d945e1ebec06d5430c1 (diff) | |
download | gdb-60e86a677efb1cab3983ef936b8530907b6f06a0.zip gdb-60e86a677efb1cab3983ef936b8530907b6f06a0.tar.gz gdb-60e86a677efb1cab3983ef936b8530907b6f06a0.tar.bz2 |
* lynx-nat.c (child_wait): Correct handling of byte reversed SPARC
Lynx wait status.
(fetch_core_registers): Don't try to fetch a register if
regmap maps it to -1.
* sparc-tdep.c (sparc_frame_find_saved_regs): Use FRAME_SAVED_I0
and FRAME_SAVED_L0 when setting saved_regs_addr. SPARC Lynx
stores the registers in a weird order.
These patches make SPARC Lynx gdb usable, though it still has problems.
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/lynx-nat.c | 33 |
2 files changed, 37 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2ff7b19..0afa127 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +Tue Oct 11 15:51:01 1994 Ian Lance Taylor <ian@sanguine.cygnus.com> + + * lynx-nat.c (child_wait): Correct handling of byte reversed SPARC + Lynx wait status. + (fetch_core_registers): Don't try to fetch a register if + regmap maps it to -1. + * sparc-tdep.c (sparc_frame_find_saved_regs): Use FRAME_SAVED_I0 + and FRAME_SAVED_L0 when setting saved_regs_addr. SPARC Lynx + stores the registers in a weird order. + Sat Oct 8 20:59:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com) * blockframe.c (reinit_frame_cache): Reinstate select_frame call diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c index ea224f0..0a62229 100644 --- a/gdb/lynx-nat.c +++ b/gdb/lynx-nat.c @@ -606,10 +606,6 @@ child_wait (pid, ourstatus) set_sigint_trap(); /* Causes SIGINT to be passed on to the attached process. */ pid = wait (&status); -#ifdef SPARC -/* Swap halves of status so that the rest of GDB can understand it */ - status.w_status = ((unsigned)status.w_status << 16) | ((unsigned)status.w_status >> 16); -#endif save_errno = errno; @@ -662,7 +658,31 @@ child_wait (pid, ourstatus) } } +#ifdef SPARC + /* SPARC Lynx uses an byte reversed wait status; we must use the + host macros to access it. These lines just a copy of + store_waitstatus. We can't use CHILD_SPECIAL_WAITSTATUS + because target.c can't include the Lynx <sys/wait.h>. */ + if (WIFEXITED (status)) + { + ourstatus->kind = TARGET_WAITKIND_EXITED; + ourstatus->value.integer = WEXITSTATUS (status); + } + else if (!WIFSTOPPED (status)) + { + ourstatus->kind = TARGET_WAITKIND_SIGNALLED; + ourstatus->value.sig = + target_signal_from_host (WTERMSIG (status)); + } + else + { + ourstatus->kind = TARGET_WAITKIND_STOPPED; + ourstatus->value.sig = + target_signal_from_host (WSTOPSIG (status)); + } +#else store_waitstatus (ourstatus, status.w_status); +#endif return pid; } @@ -744,8 +764,9 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr) unsigned int regno; for (regno = 0; regno < NUM_REGS; regno++) - supply_register (regno, core_reg_sect + offsetof (st_t, ec) - + regmap[regno]); + if (regmap[regno] != -1) + supply_register (regno, core_reg_sect + offsetof (st_t, ec) + + regmap[regno]); #ifdef SPARC /* Fetching this register causes all of the I & L regs to be read from the |