Fri Mar 5 17:39:45 1993 John Gilmore (gnu@cacophony.cygnus.com)
- * am29k-tdep.c (initialize_29k): Fix call_scratch_address doc.
- Remove reginv command.
+ * am29k-tdep.c (TAGWORD_ZERO_MASK): New #define.
+ (examine_tag): Use it.
+ (read_register_stack): Only look in the local registers for a
+ memory address if it's between rfb and rsp; go to memory otherwise.
+ (initialize_29k): Fix call_scratch_address doc. Remove reginv_com.
(reginv_com): Remove ancient kludge command.
Fri Mar 5 17:16:26 1993 K. Richard Pixley (rich@rtl.cygnus.com)
#include "gdbcore.h"
#include "frame.h"
#include "value.h"
-/*#include <sys/param.h> */
#include "symtab.h"
#include "inferior.h"
#include "gdbcmd.h"
+/* If all these bits in an instruction word are zero, it is a "tag word"
+ which precedes a function entry point and gives stack traceback info.
+ This used to be defined as 0xff000000, but that treated 0x00000deb as
+ a tag word, while it is really used as a breakpoint. */
+#define TAGWORD_ZERO_MASK 0xff00f800
+
extern CORE_ADDR text_start; /* FIXME, kludge... */
/* The user-settable top of the register stack in virtual memory. We
unsigned int tag1, tag2;
tag1 = read_memory_integer (p, 4);
- if ((tag1 & 0xff000000) != 0) /* Not a tag word */
+ if ((tag1 & TAGWORD_ZERO_MASK) != 0) /* Not a tag word */
return 0;
if (tag1 & (1<<23)) /* A two word tag */
{
do not trace back beyond the start of the text segment
(just as a sanity check to avoid going into never-never land). */
while (p >= text_start
- && ((insn = read_memory_integer (p, 4)) & 0xff000000) != 0)
+ && ((insn = read_memory_integer (p, 4)) & TAGWORD_ZERO_MASK) != 0)
p -= 4;
if (p < text_start)
if (actual_mem_addr != NULL)
*actual_mem_addr = REGISTER_BYTE (regnum);
}
- else if (memaddr < rfb)
+ /* If it's in the part of the register stack that's in real registers,
+ get the value from the registers. If it's anywhere else in memory
+ (e.g. in another thread's saved stack), skip this part and get
+ it from real live memory. */
+ else if (memaddr < rfb && memaddr >= rsp)
{
/* It's in a register. */
int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
- if (regnum < LR0_REGNUM || regnum > LR0_REGNUM + 127)
+ if (regnum > LR0_REGNUM + 127)
error ("Attempt to read register stack out of range.");
if (myaddr != NULL)
read_register_gen (regnum, myaddr);
{
/* Note: word is in host byte order. */
word = read_memory_integer (rfb + i, 4);
- write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
+ write_register (LR0_REGNUM + ((rfb - gr1) % 0x80) + i / 4, word);
}
}
flush_cached_frames ();
write_register (lrnum, read_register (NPC_REGNUM));
}
+
void
_initialize_29k()
{