diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk index e4e0201565..6f8e2dfcb9 100644 --- a/gdb/ChangeLog-gdbtk +++ b/gdb/ChangeLog-gdbtk @@ -1,3 +1,8 @@ +Mon Dec 21 11:11:02 1998 Keith Seitz + + * 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 * gdbtk-cmds.c (gdb_search): Don't mention C++ RTTI and diff --git a/gdb/gdbtk-cmds.c b/gdb/gdbtk-cmds.c index da3683e2a7..5ce63b1bef 100644 --- a/gdb/gdbtk-cmds.c +++ b/gdb/gdbtk-cmds.c @@ -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));