* gdbtk-cmds.c (get_register): Call get_saved_register instead of
authorKeith Seitz <keiths@cygnus>
Mon, 21 Dec 1998 19:18:57 +0000 (19:18 +0000)
committerKeith Seitz <keiths@cygnus>
Mon, 21 Dec 1998 19:18:57 +0000 (19:18 +0000)
        read_relative_register_raw_bytes to fetch registers.

gdb/ChangeLog-gdbtk
gdb/gdbtk-cmds.c

index e4e0201565886a6cfd747d9ad64f821831e36385..6f8e2dfcb9929f267f3bd036ea68dd233da15c24 100644 (file)
@@ -1,3 +1,8 @@
+Mon Dec 21 11:11:02 1998  Keith Seitz  <keiths@cygnus.com>
+
+       * gdbtk-cmds.c (get_register): Call get_saved_register instead of
+       read_relative_register_raw_bytes to fetch registers.
+
 Thu Dec 17 09:00:56 1998  Keith Seitz  <keiths@cygnus.com>
 
         * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and
index da3683e2a709e54918192aed217e32d1148fc5dd..5ce63b1bef227977d9a0e0edee54d1005b72159a 100644 (file)
@@ -1654,11 +1654,18 @@ get_register (regnum, fp)
   char raw_buffer[MAX_REGISTER_RAW_SIZE];
   char virtual_buffer[MAX_REGISTER_VIRTUAL_SIZE];
   int format = (int)fp;
+  int optim;
 
   if (format == 'N')
     format = 0;
 
-  if (read_relative_register_raw_bytes (regnum, raw_buffer))
+  /* read_relative_register_raw_bytes returns a virtual frame pointer
+     (FRAME_FP (selected_frame)) if regnum == FP_REGNUM instead
+     of the real contents of the register. To get around this,
+     use get_saved_register instead. */
+  get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL, selected_frame,
+                      regnum, (enum lval_type *) NULL);
+  if (optim)
     {
       Tcl_ListObjAppendElement (NULL, result_ptr->obj_ptr,
                                Tcl_NewStringObj ("Optimized out", -1));