defined.
* values.c (unpack_double) [INVALID_FLOAT]: Ditto.
* mips-tdep.c (mips_print_register): Don't test float validity.
* config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
config/arm/tm-arm.h, config/convex/tm-convex.h,
config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
config/i386/tm-i386v.h, config/i386/tm-sun386.h,
config/i960/tm-i960.h, config/m68k/tm-m68k.h,
config/m88k/tm-m88k.h, config/mips/tm-mips.h,
config/ns32k/tm-merlin.h, config/ns32k/tm-nbsd.h,
config/ns32k/tm-ns32km3.h, config/ns32k/tm-umax.h,
config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
config/rs6000/tm-rs6000.h, config/sh/tm-sh.h,
config/sparc/tm-sparc.h, config/z8k/tm-z8k.h (INVALID_FLOAT):
Remove definition.
+Sun Sep 25 12:50:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * infcmd.c (do_registers_info) [INVALID_FLOAT]: Only use if
+ defined.
+ * values.c (unpack_double) [INVALID_FLOAT]: Ditto.
+ * mips-tdep.c (mips_print_register): Don't test float validity.
+ * config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
+ config/arm/tm-arm.h, config/convex/tm-convex.h,
+ config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
+ config/i386/tm-i386v.h, config/i386/tm-sun386.h,
+ config/i960/tm-i960.h, config/m68k/tm-m68k.h,
+ config/m88k/tm-m88k.h, config/mips/tm-mips.h,
+ config/ns32k/tm-merlin.h, config/ns32k/tm-nbsd.h,
+ config/ns32k/tm-ns32km3.h, config/ns32k/tm-umax.h,
+ config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
+ config/rs6000/tm-rs6000.h, config/sh/tm-sh.h,
+ config/sparc/tm-sparc.h, config/z8k/tm-z8k.h (INVALID_FLOAT):
+ Remove definition.
+
+Sun Sep 25 06:07:37 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Remove item about adding general multi-threaded stuff;
+ this is done.
+ Remove item about specifying arbitrary locations of stack frames
+ (this works on some machines).
+ Remove item about debugging functions without a frame pointer
+ (this works on some machines).
+ Remove item about re-writing macros which handle frame chaining and
+ frameless functions. They have been re-written at least once
+ since that item was written.
+ Remove item about gdb catching SIGINT when attached; this is done.
+ Remove item about having list_command not read symbols--why bother?
+
Sat Sep 24 17:40:10 1994 Stan Shebs (shebs@andros.cygnus.com)
* TODO: Append contents of Projects file.
#define ABOUT_TO_RETURN(pc) \
((read_memory_integer (pc, 4) & 0xff0000ff) == 0xc0000080)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) ((read_memory_unsigned_integer (pc, 2) & ~0x3) == 0x4e74)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long registers are. */
#define REGISTER_SIZE 4
#define ABOUT_TO_RETURN(pc) about_to_return(pc)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long registers are. */
#define REGISTER_TYPE unsigned long
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the 386. */
-
-#define INVALID_FLOAT(p, len) (0)
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0xc3)
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes -- not relevant on the 386. */
-
-#define INVALID_FLOAT(p, len) (0)
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(ip) (read_memory_integer(ip,4) == 0x0a000000)
-/* Return 1 if P points to an invalid floating point value.
- LEN is the length in bytes. */
-
-#define INVALID_FLOAT(p, len) (0)
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) ((read_memory_integer (pc, 2) & ~0x3) == 0x4e74)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 2) == 0xF800)
-/* This is taken care of in print_floating [IEEE_FLOAT]. */
-
-#define INVALID_FLOAT(p,len) 0
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 4) == 0x3e00008)
-/* This is taken care of in print_floating [IEEE_FLOAT]. */
-
-#define INVALID_FLOAT(p,l) 0
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0
-
/* Define this to say that the "svc" insn is followed by
codes in memory saying which kind of system call it is. */
#define START_INFERIOR_TRAPS_EXPECTED 2
/* Most definitions from umax could be used. */
-#define INVALID_FLOAT(p, s) isa_NAN(p, s)
+
#include "ns32k/tm-umax.h"
+
+/* Generic NetBSD definitions. */
+
#include "tm-nbsd.h"
/* Saved Pc. Get it from sigcontext if within sigtramp. */
/* we can do it */
#define ATTACH_DETACH 1
-#define INVALID_FLOAT(p, s) isa_NAN(p, s)
-
/* Address of end of stack space.
* for MACH, see <ns532/vmparam.h>
*/
#define ABOUT_TO_RETURN(pc) (read_memory_integer (pc, 1) == 0x12)
+#if 0 /* Disable until fixed *correctly*. */
#ifndef INVALID_FLOAT
#ifndef NaN
#include <nan.h>
NaF (*(float *) p) : \
NaD (*(double *) p))
#endif /* INVALID_FLOAT */
+#endif
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
/* Nonzero if instruction at PC is a return instruction. */
#define ABOUT_TO_RETURN(pc) (read_memory_integer(pc,2) == 0x000b)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long registers are. */
#define REGISTER_TYPE long
#define ABOUT_TO_RETURN(pc) \
((read_memory_integer (pc, 4)|0x00040000) == 0x81c7e008)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define ABOUT_TO_RETURN(pc) about_to_return(pc)
-/* Return 1 if P points to an invalid floating point value. */
-
-#define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
-
/* Say how long registers are. */
#define REGISTER_TYPE unsigned int
CORE_ADDR start_pc, limit_pc;
FRAME next_frame;
{
- CORE_ADDR sp = next_frame ? next_frame->frame : read_register (SP_REGNUM);
+ CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
CORE_ADDR cur_pc;
int frame_size;
int has_frame_reg = 0;
CORE_ADDR
mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
int nargs;
- value *args;
+ value_ptr *args;
CORE_ADDR sp;
int struct_return;
CORE_ADDR struct_addr;
int fake_args = 0;
for (i = 0, m_arg = mips_args; i < nargs; i++, m_arg++) {
- extern value value_arg_coerce();
- value arg = value_arg_coerce (args[i]);
+ value_ptr arg = value_arg_coerce (args[i]);
m_arg->len = TYPE_LENGTH (VALUE_TYPE (arg));
/* This entire mips-specific routine is because doubles must be aligned
* on 8-byte boundaries. It still isn't quite right, because MIPS decided
printf_filtered (": ");
/* If virtual format is floating, print it that way. */
- if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT
- && ! INVALID_FLOAT (raw_buffer, REGISTER_VIRTUAL_SIZE(regnum))) {
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)
val_print (REGISTER_VIRTUAL_TYPE (regnum), raw_buffer, 0,
gdb_stdout, 0, 1, 0, Val_pretty_default);
- }
/* Else print as integer in hex. */
else
- {
- print_scalar_formatted (raw_buffer,
- REGISTER_VIRTUAL_TYPE (regnum),
- 'x',
- 0,
- gdb_stdout);
- }
+ print_scalar_formatted (raw_buffer, REGISTER_VIRTUAL_TYPE (regnum),
+ 'x', 0, gdb_stdout);
}
/* Replacement for generic do_registers_info. */
unsigned long inst;
int offset;
int seen_sp_adjust = 0;
+ int load_immediate_bytes = 0;
/* Skip the typical prologue instructions. These are the stack adjustment
instruction and the instructions that save registers on the stack
if ((inst & 0xffff0000) == 0x27bd0000) /* addiu $sp,$sp,offset */
seen_sp_adjust = 1;
+ else if (inst == 0x03a1e823 || /* subu $sp,$sp,$at */
+ inst == 0x03a8e823) /* subu $sp,$sp,$t0 */
+ seen_sp_adjust = 1;
else if ((inst & 0xFFE00000) == 0xAFA00000 && (inst & 0x001F0000))
continue; /* sw reg,n($sp) */
/* reg != $zero */
else if (inst == 0x0399e021 /* addu $gp,$gp,$t9 */
|| inst == 0x033ce021) /* addu $gp,$t9,$gp */
continue;
+ /* The following instructions load $at or $t0 with an immediate
+ value in preparation for a stack adjustment via
+ subu $sp,$sp,[$at,$t0]. These instructions could also initialize
+ a local variable, so we accept them only before a stack adjustment
+ instruction was seen. */
+ else if (!seen_sp_adjust)
+ {
+ if ((inst & 0xffff0000) == 0x3c010000 || /* lui $at,n */
+ (inst & 0xffff0000) == 0x3c080000) /* lui $t0,n */
+ {
+ load_immediate_bytes += 4;
+ continue;
+ }
+ else if ((inst & 0xffff0000) == 0x34210000 || /* ori $at,$at,n */
+ (inst & 0xffff0000) == 0x35080000 || /* ori $t0,$t0,n */
+ (inst & 0xffff0000) == 0x34010000 || /* ori $at,$zero,n */
+ (inst & 0xffff0000) == 0x34080000) /* ori $t0,$zero,n */
+ {
+ load_immediate_bytes += 4;
+ continue;
+ }
+ else
+ break;
+ }
else
- break;
+ break;
}
- return pc + offset;
-/* FIXME schauer. The following code seems no longer necessary if we
- always skip the typical prologue instructions. */
-
-#if 0
- if (seen_sp_adjust)
- return pc + offset;
-
- /* Well, it looks like a frameless. Let's make sure.
- Note that we are not called on the current PC,
- but on the function`s start PC, and I have definitely
- seen optimized code that adjusts the SP quite later */
- b = block_for_pc(pc);
- if (!b) return pc;
-
- f = lookup_symbol(MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE, 0, NULL);
- if (!f) return pc;
- /* Ideally, I would like to use the adjusted info
- from mips_frame_info(), but for all practical
- purposes it will not matter (and it would require
- a different definition of SKIP_PROLOGUE())
-
- Actually, it would not hurt to skip the storing
- of arguments on the stack as well. */
- if (((mips_extra_func_info_t)SYMBOL_VALUE(f))->pdr.frameoffset)
- return pc + 4;
-
- return pc;
-#endif
+ /* In a frameless function, we might have incorrectly
+ skipped some load immediate instructions. Undo the skipping
+ if the load immediate was not followed by a stack adjustment. */
+ if (load_immediate_bytes && !seen_sp_adjust)
+ offset -= load_immediate_bytes;
+ return pc + offset;
}
#if 0
*invp = 0; /* Assume valid. */
if (code == TYPE_CODE_FLT)
{
+#ifdef INVALID_FLOAT
if (INVALID_FLOAT (valaddr, len))
{
*invp = 1;
return 1.234567891011121314;
}
+#endif
return extract_floating (valaddr, len);
}
else if (nosign)