Improve release doc slightly.
[deliverable/binutils-gdb.git] / gdb / am29k-tdep.c
index 4d52f99b11f236949a2015449f3abeb0c5eedd12..d5399b7460287a76edbd473ebdd0934c90e101c5 100644 (file)
@@ -20,15 +20,21 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include "defs.h"
 #include "gdbcore.h"
-#include <stdio.h>
 #include "frame.h"
 #include "value.h"
 /*#include <sys/param.h> */
 #include "symtab.h"
 #include "inferior.h"
+#include "gdbcmd.h"
 
 extern CORE_ADDR text_start;   /* FIXME, kludge... */
 
+/* The user-settable top of the register stack in virtual memory.  We
+   won't attempt to access any stored registers above this address, if set
+   nonzero.  */
+
+static CORE_ADDR rstack_high_address = UINT_MAX;
+
 /* Structure to hold cached info about function prologues.  */
 struct prologue_info
 {
@@ -504,11 +510,10 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
   long rfb = read_register (RFB_REGNUM);
   long rsp = read_register (RSP_REGNUM);
 
-#ifdef RSTACK_HIGH_ADDR        /* Highest allowed address in register stack */
   /* If we don't do this 'info register' stops in the middle. */
-  if (memaddr >= RSTACK_HIGH_ADDR
+  if (memaddr >= rstack_high_address
     {
-      int val=-1;                      /* a bogus value */
+      int val = -1;                    /* a bogus value */
       /* It's in a local register, but off the end of the stack.  */
       int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
       if (myaddr != NULL)
@@ -519,9 +524,7 @@ read_register_stack (memaddr, myaddr, actual_mem_addr, lval)
       if (actual_mem_addr != NULL)
        *actual_mem_addr = REGISTER_BYTE (regnum);
     }
-  else
-#endif /* RSTACK_HIGH_ADDR */
-  if (memaddr < rfb)
+  else if (memaddr < rfb)
     {
       /* It's in a register.  */
       int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
@@ -570,17 +573,14 @@ write_register_stack (memaddr, myaddr, actual_mem_addr)
 {
   long rfb = read_register (RFB_REGNUM);
   long rsp = read_register (RSP_REGNUM);
-#ifdef RSTACK_HIGH_ADDR        /* Highest allowed address in register stack */
   /* If we don't do this 'info register' stops in the middle. */
-  if (memaddr >= RSTACK_HIGH_ADDR
+  if (memaddr >= rstack_high_address
     {
       /* It's in a register, but off the end of the stack.  */
       if (actual_mem_addr != NULL)
        *actual_mem_addr = NULL; 
     }
-  else
-#endif /* RSTACK_HIGH_ADDR */
-  if (memaddr < rfb)
+  else if (memaddr < rfb)
     {
       /* It's in a register.  */
       int regnum = (memaddr - rsp) / 4 + LR0_REGNUM;
@@ -769,7 +769,7 @@ push_dummy_frame ()
       for (i = 0; i < num_bytes; i += 4)
        {
          /* Note:  word is in target byte order.  */
-         read_register_gen (LR0_REGNUM + i / 4, &word, 4);
+         read_register_gen (LR0_REGNUM + i / 4, &word);
          write_memory (rfb - num_bytes + i, &word, 4);
        }
     }
@@ -812,5 +812,13 @@ _initialize_29k()
 {
   add_com ("reginv ", class_obscure, reginv_com, 
         "Invalidate gdb's internal register cache.");
-}
 
+  /* FIXME, there should be a way to make a CORE_ADDR variable settable. */
+  add_show_from_set
+    (add_set_cmd ("rstack_high_address", class_support, var_uinteger,
+                 (char *)&rstack_high_address,
+                 "Set top address in memory of the register stack.\n\
+Attempts to access registers saved above this address will be ignored\n\
+or will produce the value -1.", &setlist),
+     &showlist);
+}
This page took 0.023727 seconds and 4 git commands to generate.