aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog33
-rw-r--r--gdb/config/a29k/tm-a29k.h4
-rw-r--r--gdb/config/h8300/tm-h8300.h4
-rw-r--r--gdb/config/h8500/tm-h8500.h4
-rw-r--r--gdb/config/i386/tm-i386v.h5
-rw-r--r--gdb/config/i386/tm-sun386.h5
-rw-r--r--gdb/config/i960/tm-i960.h5
-rw-r--r--gdb/config/m68k/tm-m68k.h4
-rw-r--r--gdb/config/m88k/tm-m88k.h4
-rw-r--r--gdb/config/mips/tm-mips.h4
-rw-r--r--gdb/config/ns32k/tm-merlin.h4
-rw-r--r--gdb/config/ns32k/tm-nbsd.h5
-rw-r--r--gdb/config/ns32k/tm-ns32km3.h2
-rw-r--r--gdb/config/ns32k/tm-umax.h2
-rw-r--r--gdb/config/sh/tm-sh.h4
-rw-r--r--gdb/config/sparc/tm-sparc.h4
-rw-r--r--gdb/config/z8k/tm-z8k.h4
-rw-r--r--gdb/mips-tdep.c85
-rw-r--r--gdb/values.c2
19 files changed, 82 insertions, 102 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5e445c0..570a45c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,36 @@
+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.
diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h
index c87b572..371b4dc 100644
--- a/gdb/config/a29k/tm-a29k.h
+++ b/gdb/config/a29k/tm-a29k.h
@@ -96,10 +96,6 @@ CORE_ADDR skip_prologue ();
#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. */
diff --git a/gdb/config/h8300/tm-h8300.h b/gdb/config/h8300/tm-h8300.h
index b62a931..b9a2918 100644
--- a/gdb/config/h8300/tm-h8300.h
+++ b/gdb/config/h8300/tm-h8300.h
@@ -91,10 +91,6 @@ extern CORE_ADDR h8300_skip_prologue ();
#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
diff --git a/gdb/config/h8500/tm-h8500.h b/gdb/config/h8500/tm-h8500.h
index 0a96b43..f169ad8 100644
--- a/gdb/config/h8500/tm-h8500.h
+++ b/gdb/config/h8500/tm-h8500.h
@@ -76,10 +76,6 @@ extern CORE_ADDR h8500_skip_prologue ();
#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
diff --git a/gdb/config/i386/tm-i386v.h b/gdb/config/i386/tm-i386v.h
index 49de3a0..e86506a 100644
--- a/gdb/config/i386/tm-i386v.h
+++ b/gdb/config/i386/tm-i386v.h
@@ -79,11 +79,6 @@ i386_skip_prologue PARAMS ((int));
#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. */
diff --git a/gdb/config/i386/tm-sun386.h b/gdb/config/i386/tm-sun386.h
index a34305a..657056a 100644
--- a/gdb/config/i386/tm-sun386.h
+++ b/gdb/config/i386/tm-sun386.h
@@ -81,11 +81,6 @@ i386_skip_prologue PARAMS ((int));
#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. */
diff --git a/gdb/config/i960/tm-i960.h b/gdb/config/i960/tm-i960.h
index f13795e..61ce5d7 100644
--- a/gdb/config/i960/tm-i960.h
+++ b/gdb/config/i960/tm-i960.h
@@ -68,11 +68,6 @@ extern CORE_ADDR saved_pc_after_call ();
#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. */
diff --git a/gdb/config/m68k/tm-m68k.h b/gdb/config/m68k/tm-m68k.h
index f95a532..164ae95 100644
--- a/gdb/config/m68k/tm-m68k.h
+++ b/gdb/config/m68k/tm-m68k.h
@@ -91,10 +91,6 @@ extern CORE_ADDR m68k_saved_pc_after_call PARAMS ((struct frame_info *));
#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. */
diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h
index fbe26a5..427bdbf 100644
--- a/gdb/config/m88k/tm-m88k.h
+++ b/gdb/config/m88k/tm-m88k.h
@@ -96,10 +96,6 @@ extern CORE_ADDR skip_prologue ();
#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. */
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index fa214b4..3deb7b6 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -83,10 +83,6 @@ extern int in_sigtramp PARAMS ((CORE_ADDR, char *));
#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. */
diff --git a/gdb/config/ns32k/tm-merlin.h b/gdb/config/ns32k/tm-merlin.h
index ec3505c..6603c22 100644
--- a/gdb/config/ns32k/tm-merlin.h
+++ b/gdb/config/ns32k/tm-merlin.h
@@ -66,10 +66,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#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. */
diff --git a/gdb/config/ns32k/tm-nbsd.h b/gdb/config/ns32k/tm-nbsd.h
index 871a153..23d7459 100644
--- a/gdb/config/ns32k/tm-nbsd.h
+++ b/gdb/config/ns32k/tm-nbsd.h
@@ -21,8 +21,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#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. */
diff --git a/gdb/config/ns32k/tm-ns32km3.h b/gdb/config/ns32k/tm-ns32km3.h
index 6cf6161..7928d0b 100644
--- a/gdb/config/ns32k/tm-ns32km3.h
+++ b/gdb/config/ns32k/tm-ns32km3.h
@@ -43,8 +43,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* 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>
*/
diff --git a/gdb/config/ns32k/tm-umax.h b/gdb/config/ns32k/tm-umax.h
index 7847041..a515d39 100644
--- a/gdb/config/ns32k/tm-umax.h
+++ b/gdb/config/ns32k/tm-umax.h
@@ -74,6 +74,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#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>
@@ -86,6 +87,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
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
diff --git a/gdb/config/sh/tm-sh.h b/gdb/config/sh/tm-sh.h
index 4dbe79e..83152eb 100644
--- a/gdb/config/sh/tm-sh.h
+++ b/gdb/config/sh/tm-sh.h
@@ -70,10 +70,6 @@ extern CORE_ADDR sh_skip_prologue ();
/* 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
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 94e4031..804aba1 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -126,10 +126,6 @@ extern CORE_ADDR sparc_pc_adjust();
#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. */
diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h
index cf6c86a..bd39652 100644
--- a/gdb/config/z8k/tm-z8k.h
+++ b/gdb/config/z8k/tm-z8k.h
@@ -70,10 +70,6 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
#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
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index faaeb6e..f2cc19a 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -328,7 +328,7 @@ heuristic_proc_desc(start_pc, limit_pc, next_frame)
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;
@@ -578,7 +578,7 @@ setup_arbitrary_frame (argc, argv)
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;
@@ -592,8 +592,7 @@ mips_push_arguments(nargs, args, sp, struct_return, 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
@@ -861,20 +860,13 @@ mips_print_register (regnum, all)
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. */
@@ -966,6 +958,7 @@ mips_skip_prologue (pc, lenient)
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
@@ -987,6 +980,9 @@ mips_skip_prologue (pc, lenient)
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 */
@@ -1006,39 +1002,40 @@ mips_skip_prologue (pc, lenient)
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
diff --git a/gdb/values.c b/gdb/values.c
index 9e8eeb8..81fa4e7 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -675,11 +675,13 @@ unpack_double (type, valaddr, invp)
*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)