diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-02-28 06:06:05 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-02-28 06:06:05 +0000 |
commit | 4879254531c753527f4ae3bcf7e625fa71ca3902 (patch) | |
tree | 36769293d673d3ce5fd18acbc4b568911d05cb61 | |
parent | b30601cb28a62dee5579e2cffe2b2d02bd1e0a9d (diff) | |
download | gdb-4879254531c753527f4ae3bcf7e625fa71ca3902.zip gdb-4879254531c753527f4ae3bcf7e625fa71ca3902.tar.gz gdb-4879254531c753527f4ae3bcf7e625fa71ca3902.tar.bz2 |
* i387-tdep.c, i386-tdep.c i386v-nat.c, i386aix-nat.c,
i386m3-nat.c, config/m68k/tm-m68k.h, i960-tdep.c
config/i960/tm-i960.h, remote-nindy.c, config/m88k/tm-m88k.h,
m88k-tdep.c: Use floatformat.h instead of ieee-float.h.
* sparc-tdep.c: Remove now-obsolete ieee-float.h stuff
* findvar.c: Update comment regarding ieee-float.h.
-rw-r--r-- | gdb/config/i960/tm-i960.h | 8 | ||||
-rw-r--r-- | gdb/config/m88k/tm-m88k.h | 8 | ||||
-rw-r--r-- | gdb/findvar.c | 23 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 4 | ||||
-rw-r--r-- | gdb/i386aix-nat.c | 3 | ||||
-rw-r--r-- | gdb/i386m3-nat.c | 4 | ||||
-rw-r--r-- | gdb/i960-tdep.c | 9 | ||||
-rw-r--r-- | gdb/m88k-tdep.c | 8 | ||||
-rw-r--r-- | gdb/remote-nindy.c | 9 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 35 |
10 files changed, 49 insertions, 62 deletions
diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h index f93b5aa..f13795e 100644 --- a/gdb/config/i960/tm-i960.h +++ b/gdb/config/i960/tm-i960.h @@ -166,15 +166,15 @@ extern CORE_ADDR saved_pc_after_call (); #define REGISTER_CONVERTIBLE(N) ((N) >= FP0_REGNUM) +#include "floatformat.h" + /* Convert data from raw format for register REGNUM in buffer FROM to virtual format with type TYPE in buffer TO. */ -extern struct ext_format ext_format_i960; - #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ { \ double val; \ - ieee_extended_to_double (&ext_format_i960, (FROM), &val); \ + floatformat_to_double (&floatformat_i960_ext, (FROM), &val); \ store_floating ((TO), TYPE_LENGTH (TYPE), val); \ } @@ -184,7 +184,7 @@ extern struct ext_format ext_format_i960; #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ { \ double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - double_to_ieee_extended (&ext_format_i960, &val, (TO)); \ + floatformat_from_double (&floatformat_i960_ext, &val, (TO)); \ } /* Return the GDB type object for the "standard" data type diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h index 9b50dcf..0228907 100644 --- a/gdb/config/m88k/tm-m88k.h +++ b/gdb/config/m88k/tm-m88k.h @@ -18,8 +18,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "ieee-float.h" - /* g++ support is not yet included. */ /* Define the bit, byte, and word ordering of the machine. */ @@ -388,7 +386,7 @@ if (!target_is_m88110) \ #define REGISTER_CONVERTIBLE(N) ((N) >= XFP_REGNUM) -extern const struct ext_format ext_format_m88110; +#include "floatformat.h" /* Convert data from raw format for register REGNUM in buffer FROM to virtual format with type TYPE in buffer TO. */ @@ -396,7 +394,7 @@ extern const struct ext_format ext_format_m88110; #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ { \ double val; \ - ieee_extended_to_double (&ext_format_m88110, (FROM), &val); \ + floatformat_to_double (&floatformat_m88110_ext, (FROM), &val); \ store_floating ((TO), TYPE_LENGTH (TYPE), val); \ } @@ -406,7 +404,7 @@ extern const struct ext_format ext_format_m88110; #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ { \ double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - double_to_ieee_extended (&ext_format_m88110, &val, (TO)); \ + floatformat_from_double (&floatformat_m88110_ext, &val, (TO)); \ } /* Return the GDB type object for the "standard" data type diff --git a/gdb/findvar.c b/gdb/findvar.c index 8f28b90..531075e 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -195,9 +195,8 @@ store_address (addr, len, val) formats. So if host is IEEE floating and target is VAX floating, or vice-versa, it loses. This means that we can't (yet) use these routines for extendeds. Extendeds are handled by - REGISTER_CONVERTIBLE. What we want is a fixed version of - ieee-float.c (the current version can't deal with single or double, - and I suspect it is probably broken for some extendeds too). + REGISTER_CONVERTIBLE. What we want is to use floatformat.h, but that + doesn't yet handle VAX floating at all. 2. We can't deal with it if there is more than one floating point format in use. This has to be fixed at the unpack_double level. @@ -423,14 +422,14 @@ value_of_register (regnum) { CORE_ADDR addr; int optim; - register value val; + register value reg_val; char raw_buffer[MAX_REGISTER_RAW_SIZE]; enum lval_type lval; get_saved_register (raw_buffer, &optim, &addr, selected_frame, regnum, &lval); - val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum)); + reg_val = allocate_value (REGISTER_VIRTUAL_TYPE (regnum)); /* Convert raw data to virtual format if necessary. */ @@ -438,17 +437,17 @@ value_of_register (regnum) if (REGISTER_CONVERTIBLE (regnum)) { REGISTER_CONVERT_TO_VIRTUAL (regnum, REGISTER_VIRTUAL_TYPE (regnum), - raw_buffer, VALUE_CONTENTS_RAW (val)); + raw_buffer, VALUE_CONTENTS_RAW (reg_val)); } else #endif - memcpy (VALUE_CONTENTS_RAW (val), raw_buffer, + memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, REGISTER_RAW_SIZE (regnum)); - VALUE_LVAL (val) = lval; - VALUE_ADDRESS (val) = addr; - VALUE_REGNO (val) = regnum; - VALUE_OPTIMIZED_OUT (val) = optim; - return val; + VALUE_LVAL (reg_val) = lval; + VALUE_ADDRESS (reg_val) = addr; + VALUE_REGNO (reg_val) = regnum; + VALUE_OPTIMIZED_OUT (reg_val) = optim; + return reg_val; } /* Low level examining and depositing of registers. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 4b2471f..3ddb2ff 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -22,12 +22,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "inferior.h" #include "gdbcore.h" #include "target.h" -<<<<<<< i386-tdep.c #include "floatformat.h" -||||||| 1.26 -======= #include "symtab.h" ->>>>>>> 1.27 static long i386_get_frame_setup PARAMS ((int)); diff --git a/gdb/i386aix-nat.c b/gdb/i386aix-nat.c index 15e02b0..6a26380 100644 --- a/gdb/i386aix-nat.c +++ b/gdb/i386aix-nat.c @@ -47,11 +47,10 @@ extern int errno; #include <sys/reg.h> #endif -#include "ieee-float.h" +#include "floatformat.h" #include "target.h" -extern struct ext_format ext_format_i387; /* this table must line up with REGISTER_NAMES in tm-i386v.h */ /* symbols like 'EAX' come from <sys/reg.h> */ diff --git a/gdb/i386m3-nat.c b/gdb/i386m3-nat.c index 7f1d47b..8892e16 100644 --- a/gdb/i386m3-nat.c +++ b/gdb/i386m3-nat.c @@ -55,8 +55,6 @@ FIXME!! UPAGES is neither 2 nor 16 extern void print_387_control_word (); /* i387-tdep.h */ extern void print_387_status_word (); -extern struct ext_format ext_format_i387; - #define private static @@ -313,7 +311,7 @@ print_387_status (status, ep) for (i = 9; i >= 0; i--) printf_unfiltered ("%02x", ep->regs[fpreg][i]); - ieee_extended_to_double (&ext_format_i387, (char *)ep->regs[fpreg], + floatformat_to_double (&floatformat_i387_ext, (char *)ep->regs[fpreg], &val); printf_unfiltered (" %g\n", val); } diff --git a/gdb/i960-tdep.c b/gdb/i960-tdep.c index 2df0f57..d7b2ca6 100644 --- a/gdb/i960-tdep.c +++ b/gdb/i960-tdep.c @@ -27,16 +27,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symtab.h" #include "value.h" #include "frame.h" -#include "ieee-float.h" +#include "floatformat.h" #include "target.h" -/* Structure of i960 extended floating point format. */ - -const struct ext_format ext_format_i960 = { -/* tot sbyte smask expbyte manbyte */ - 12, 9, 0x80, 9,8, 4,0, /* i960 */ -}; - /* gdb960 is always running on a non-960 host. Check its characteristics. This routine must be called as part of gdb initialization. */ diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index 189db6f..a9d9e12 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -26,7 +26,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symtab.h" #include "setjmp.h" #include "value.h" -#include "ieee-float.h" /* for ext_format & friends */ /* Size of an instruction */ #define BYTES_PER_88K_INSN 4 @@ -37,13 +36,6 @@ void frame_find_saved_regs (); relevance for the ways in which we screw with instruction pointers. */ int target_is_m88110 = 0; -/* FIXME: this is really just a guess based on m88110 being big - endian. */ -const struct ext_format ext_format_m88110 = { -/* tot sbyte smask expbyte manbyte */ - 10, 0, 0x80, 0,1, 4,8 /* m88110 */ -}; - /* Given a GDB frame, determine the address of the calling function's frame. This will be used to create a new GDB frame struct, and then INIT_EXTRA_FRAME_INFO and INIT_FRAME_PC will be called for the new frame. diff --git a/gdb/remote-nindy.c b/gdb/remote-nindy.c index f9cac2b..8c9c624 100644 --- a/gdb/remote-nindy.c +++ b/gdb/remote-nindy.c @@ -107,7 +107,7 @@ NINDY ROM monitor at the other end of the line. #include "target.h" #include "gdbcore.h" #include "command.h" -#include "ieee-float.h" +#include "floatformat.h" #include "wait.h" #include <sys/file.h> @@ -129,7 +129,6 @@ extern void generic_mourn_inferior (); extern struct target_ops nindy_ops; extern GDB_FILE *instream; -extern struct ext_format ext_format_i960; /* i960-tdep.c */ extern char ninStopWhy (); extern int ninMemGet (); @@ -442,7 +441,7 @@ nindy_fetch_registers(regno) &nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)], &inv); /* dub now in host byte order */ - double_to_ieee_extended (&ext_format_i960, &dub, + floatformat_from_double (&floatformat_i960_ext, &dub, ®isters[REGISTER_BYTE (regnum)]); } @@ -471,8 +470,8 @@ nindy_store_registers(regno) memcpy (nindy_regs.tcw, ®isters[REGISTER_BYTE (TCW_REGNUM)], 1*4); for (regnum = FP0_REGNUM; regnum < FP0_REGNUM + 4; regnum++) { - ieee_extended_to_double (&ext_format_i960, - ®isters[REGISTER_BYTE (regnum)], &dub); + floatformat_to_double (&floatformat_i960_ext, + ®isters[REGISTER_BYTE (regnum)], &dub); store_floating (&nindy_regs.fp_as_double[8 * (regnum - FP0_REGNUM)], REGISTER_VIRTUAL_SIZE (regnum), dub); diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index da7fd2c..7deca28 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -22,7 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "inferior.h" #include "obstack.h" #include "target.h" -#include "ieee-float.h" +#include "value.h" #include "symfile.h" /* for objfiles.h */ #include "objfiles.h" /* for find_pc_section */ @@ -164,6 +164,29 @@ sparc_frame_saved_pc (frame) char buf[MAX_REGISTER_RAW_SIZE]; CORE_ADDR addr; + if (frame->signal_handler_caller) + { + /* This is the signal trampoline frame. + Get the saved PC from the sigcontext structure. */ + +#ifndef SIGCONTEXT_PC_OFFSET +#define SIGCONTEXT_PC_OFFSET 12 +#endif + + CORE_ADDR sigcontext_addr; + char scbuf[TARGET_PTR_BIT / HOST_CHAR_BIT]; + + /* The sigcontext address is contained in register O2. */ + get_saved_register (buf, (int *)NULL, (CORE_ADDR *)NULL, + frame, O0_REGNUM + 2, (enum lval_type *)NULL); + sigcontext_addr = extract_address (buf, REGISTER_RAW_SIZE (O0_REGNUM)); + + /* Don't cause a memory_error when accessing sigcontext in case the + stack layout has changed or the stack is corrupt. */ + target_read_memory (sigcontext_addr + SIGCONTEXT_PC_OFFSET, + scbuf, sizeof (scbuf)); + return extract_address (scbuf, sizeof (scbuf)); + } addr = (frame->bottom + FRAME_SAVED_I0 + REGISTER_RAW_SIZE (I7_REGNUM) * (I7_REGNUM - I0_REGNUM)); read_memory (addr, buf, REGISTER_RAW_SIZE (I7_REGNUM)); @@ -568,16 +591,6 @@ sparc_pc_adjust(pc) else return pc+8; } - - -/* Structure of SPARC extended floating point numbers. - This information is not currently used by GDB, since no current SPARC - implementations support extended float. */ - -const struct ext_format ext_format_sparc = { -/* tot sbyte smask expbyte manbyte */ - 16, 0, 0x80, 0,1, 4,8, /* sparc */ -}; #ifdef USE_PROC_FS /* Target dependent support for /proc */ |