OSDN Git Service

* Adapt to read_pc function removal.
authormuller <muller>
Wed, 6 May 2009 15:52:10 +0000 (15:52 +0000)
committermuller <muller>
Wed, 6 May 2009 15:52:10 +0000 (15:52 +0000)
* generic/gdbtk-cmds.c: Add "cache.h" include.
(gdb_loc): Use regcache_read_pc instead of read_pc.

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

index 5657876..e053317 100644 (file)
@@ -1,3 +1,9 @@
+2009-05-06  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+       * Adapt to read_pc function removal.
+       * generic/gdbtk-cmds.c: Add "cache.h" include.
+       (gdb_loc): Use regcache_read_pc instead of read_pc.
+
 2009-04-23  Keith Seitz  <keiths@redhat.com>
 
        * library/vartree.itb (constructor): Remove the borderwidth 0
index f390133..dc0b17c 100644 (file)
@@ -44,6 +44,7 @@
 #include "language.h"
 #include "target.h"
 #include "valprint.h"
+#include "regcache.h"
 
 /* tcl header files includes varargs.h unless HAS_STDARG is defined,
    but gdb uses stdarg.h, so make sure HAS_STDARG is defined.  */
@@ -2141,10 +2142,13 @@ gdb_loc (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST obj
       else
        {
          struct frame_info *frame;
+         CORE_ADDR frame_pc, current_pc;
 
          frame = get_selected_frame (NULL);
-
-         if (get_frame_pc (frame) != read_pc ())
+         current_pc = regcache_read_pc (get_current_regcache ());
+         frame_pc = get_frame_pc (frame);
+         if (frame_pc != current_pc)
            {
              /* Note - this next line is not correct on all architectures.
                 For a graphical debugger we really want to highlight the 
@@ -2152,12 +2156,12 @@ gdb_loc (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST obj
                 Many architectures have the next instruction saved as the
                 pc on the stack, so what happens is the next instruction 
                 is highlighted. FIXME */
-             pc = get_frame_pc (frame);
+             pc = frame_pc;
              find_frame_sal (frame, &sal);
            }
          else
            {
-             pc = read_pc ();
+             pc = current_pc;
              sal = find_pc_line (pc, 0);
            }
        }