#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); \
}
#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
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. */
#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. */
#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); \
}
#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
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.
{
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. */
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;
}
\f
/* Low level examining and depositing of registers.
#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));
#include <sys/reg.h>
#endif
-#include "ieee-float.h"
+#include "floatformat.h"
#include "target.h"
-extern struct ext_format ext_format_i387;
\f
/* this table must line up with REGISTER_NAMES in tm-i386v.h */
/* symbols like 'EAX' come from <sys/reg.h> */
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
\f
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);
}
#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. */
#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
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.
#include "target.h"
#include "gdbcore.h"
#include "command.h"
-#include "ieee-float.h"
+#include "floatformat.h"
#include "wait.h"
#include <sys/file.h>
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 ();
&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)]);
}
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);
#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 */
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));
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 */
-};
\f
#ifdef USE_PROC_FS /* Target dependent support for /proc */