2007-06-09 Markus Deuling <deuling@de.ibm.com>
authorUlrich Weigand <uweigand@de.ibm.com>
Sat, 9 Jun 2007 13:55:51 +0000 (13:55 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Sat, 9 Jun 2007 13:55:51 +0000 (13:55 +0000)
* gdbarch.sh (DECR_PC_AFTER_BREAK): Replace by
gdbarch_decr_pc_after_break.
* tracepoint.c (trace_dump_command): Likewise.
* solib-sunos.c (sunos_solib_create_inferior_hook): Likewise.
* linux-thread-db.c (check_event): Likewise.
* linux-nat.c (cancel_breakpoints_callback): Likewise.
* infrun.c (adjust_pc_after_break, normal_stop): Likewise.
* frame.h: Likewise (comment).
* dummy-frame.c (deprecated_pc_in_call_dummy): Likewise.
* aix-thread.c (aix_thread_wait): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.

12 files changed:
gdb/ChangeLog
gdb/aix-thread.c
gdb/dummy-frame.c
gdb/frame.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/infrun.c
gdb/linux-nat.c
gdb/linux-thread-db.c
gdb/solib-sunos.c
gdb/tracepoint.c

index a6365f160ffa96ea64fc9f9778799b669480f85b..cc1a3a38132b5ff26a03f484137b76d4f2a23307 100644 (file)
@@ -1,3 +1,17 @@
+2007-06-09  Markus Deuling  <deuling@de.ibm.com>
+
+       * gdbarch.sh (DECR_PC_AFTER_BREAK): Replace by
+       gdbarch_decr_pc_after_break.
+       * tracepoint.c (trace_dump_command): Likewise.
+       * solib-sunos.c (sunos_solib_create_inferior_hook): Likewise.
+       * linux-thread-db.c (check_event): Likewise.
+       * linux-nat.c (cancel_breakpoints_callback): Likewise.
+       * infrun.c (adjust_pc_after_break, normal_stop): Likewise.
+       * frame.h: Likewise (comment).
+       * dummy-frame.c (deprecated_pc_in_call_dummy): Likewise.
+       * aix-thread.c (aix_thread_wait): Likewise.
+       * gdbarch.c, gdbarch.h: Regenerate.
+
 2007-06-09  Markus Deuling  <deuling@de.ibm.com>
 
        * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS): Replace by
index ccb275a586337c49bcd30ec25a8ab8523075c0a6..32b7430d5684aae2f1950d2310d2aa430b930bee 100644 (file)
@@ -1013,8 +1013,9 @@ aix_thread_wait (ptid_t ptid, struct target_waitstatus *status)
 
   /* Check whether libpthdebug might be ready to be initialized.  */
   if (!pd_active && status->kind == TARGET_WAITKIND_STOPPED &&
-      status->value.sig == TARGET_SIGNAL_TRAP &&
-      read_pc_pid (ptid) - DECR_PC_AFTER_BREAK == pd_brk_addr)
+      status->value.sig == TARGET_SIGNAL_TRAP
+      && read_pc_pid (ptid)
+        - gdbarch_decr_pc_after_break (current_gdbarch) == pd_brk_addr)
     return pd_activate (0);
 
   return pd_update (0);
index ec6e8b56b936bd985cbd2e0b9ba2bcc890af8059..4308d351061cef2bf588810731d486dae31f49e5 100644 (file)
@@ -52,7 +52,7 @@ static struct dummy_frame *dummy_frame_stack = NULL;
 /* Function: deprecated_pc_in_call_dummy (pc)
 
    Return non-zero if the PC falls in a dummy frame created by gdb for
-   an inferior call.  The code below which allows DECR_PC_AFTER_BREAK
+   an inferior call.  The code below which allows gdbarch_decr_pc_after_break
    is for infrun.c, which may give the function a PC without that
    subtracted out.
 
@@ -75,7 +75,8 @@ deprecated_pc_in_call_dummy (CORE_ADDR pc)
        dummyframe = dummyframe->next)
     {
       if ((pc >= dummyframe->id.code_addr)
-         && (pc <= dummyframe->id.code_addr + DECR_PC_AFTER_BREAK))
+         && (pc <= dummyframe->id.code_addr
+                   + gdbarch_decr_pc_after_break (current_gdbarch)))
        return 1;
     }
   return 0;
index b29370ab30258f3565942f7314033717b215dd53..53bb5fa4b013bc2ef66e1a3f9cd92eb88061deb3 100644 (file)
@@ -709,7 +709,7 @@ extern struct frame_info *deprecated_safe_get_selected_frame (void);
 extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc);
 
 /* FIXME: cagney/2002-12-06: Has the PC in the current frame changed?
-   "infrun.c", Thanks to DECR_PC_AFTER_BREAK, can change the PC after
+   "infrun.c", Thanks to gdbarch_decr_pc_after_break, can change the PC after
    the initial frame create.  This puts things back in sync.
 
    This replaced: frame->pc = ....; */
index 9edc8abfc6e2faa53df786601072271f3b1c21c2..f3b894ce00131c1f373bc19548aa370f1d64f1be 100644 (file)
@@ -760,11 +760,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: convert_register_p = <0x%lx>\n",
                       (long) current_gdbarch->convert_register_p);
-#ifdef DECR_PC_AFTER_BREAK
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
-                      XSTRING (DECR_PC_AFTER_BREAK));
-#endif
   fprintf_unfiltered (file,
                       "gdbarch_dump: decr_pc_after_break = 0x%s\n",
                       paddr_nz (current_gdbarch->decr_pc_after_break));
index 1632a5bc9f6fddf51cad453f83eea65789c085a0..e195f8a4c632cc233628bdbe2f688609aef07fdf 100644 (file)
@@ -718,12 +718,6 @@ extern void set_gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, gdbar
 
 extern CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch);
 extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break);
-#if !defined (GDB_TM_FILE) && defined (DECR_PC_AFTER_BREAK)
-#error "Non multi-arch definition of DECR_PC_AFTER_BREAK"
-#endif
-#if !defined (DECR_PC_AFTER_BREAK)
-#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
-#endif
 
 /* A function can be addressed by either it's "pointer" (possibly a
    descriptor address) or "entry point" (first executable instruction).
index 4e286c79cb39e33c7bdd91d65070016942f0af40..81cc07d255b2a5f60a4a23bfb1d1a58c58352c72 100755 (executable)
@@ -547,7 +547,7 @@ f:=:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, len
 M::CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
 f:=:int:memory_insert_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_insert_breakpoint::0
 f:=:int:memory_remove_breakpoint:struct bp_target_info *bp_tgt:bp_tgt:0:default_memory_remove_breakpoint::0
-v:=:CORE_ADDR:decr_pc_after_break:::0:::0
+v::CORE_ADDR:decr_pc_after_break:::0:::0
 
 # A function can be addressed by either it's "pointer" (possibly a
 # descriptor address) or "entry point" (first executable instruction).
index c6da74678e1314afff857613817cc24995be5c7c..db2c4a9f622b9b3f4522b587ed54dda7c3a318ab 100644 (file)
@@ -1148,29 +1148,29 @@ adjust_pc_after_break (struct execution_control_state *ecs)
 
   /* If this target does not decrement the PC after breakpoints, then
      we have nothing to do.  */
-  if (DECR_PC_AFTER_BREAK == 0)
+  if (gdbarch_decr_pc_after_break (current_gdbarch) == 0)
     return;
 
   /* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP.  If
      we aren't, just return.
 
      We assume that waitkinds other than TARGET_WAITKIND_STOPPED are not
-     affected by DECR_PC_AFTER_BREAK.  Other waitkinds which are implemented
-     by software breakpoints should be handled through the normal breakpoint
-     layer.
+     affected by gdbarch_decr_pc_after_break.  Other waitkinds which are
+     implemented by software breakpoints should be handled through the normal
+     breakpoint layer.
 
      NOTE drow/2004-01-31: On some targets, breakpoints may generate
      different signals (SIGILL or SIGEMT for instance), but it is less
      clear where the PC is pointing afterwards.  It may not match
-     DECR_PC_AFTER_BREAK.  I don't know any specific target that generates
-     these signals at breakpoints (the code has been in GDB since at least
-     1992) so I can not guess how to handle them here.
+     gdbarch_decr_pc_after_break.  I don't know any specific target that
+     generates these signals at breakpoints (the code has been in GDB since at
+     least 1992) so I can not guess how to handle them here.
 
      In earlier versions of GDB, a target with 
      gdbarch_have_nonsteppable_watchpoint would have the PC after hitting a
-     watchpoint affected by DECR_PC_AFTER_BREAK.  I haven't found any target
-     with both of these set in GDB history, and it seems unlikely to be correct,
-     so gdbarch_have_nonsteppable_watchpoint is not checked here.  */
+     watchpoint affected by gdbarch_decr_pc_after_break.  I haven't found any
+     target with both of these set in GDB history, and it seems unlikely to be
+     correct, so gdbarch_have_nonsteppable_watchpoint is not checked here.  */
 
   if (ecs->ws.kind != TARGET_WAITKIND_STOPPED)
     return;
@@ -1180,7 +1180,8 @@ adjust_pc_after_break (struct execution_control_state *ecs)
 
   /* Find the location where (if we've hit a breakpoint) the
      breakpoint would be.  */
-  breakpoint_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK;
+  breakpoint_pc = read_pc_pid (ecs->ptid) - gdbarch_decr_pc_after_break
+                                           (current_gdbarch);
 
   if (SOFTWARE_SINGLE_STEP_P ())
     {
@@ -3083,12 +3084,12 @@ normal_stop (void)
   /* NOTE drow/2004-01-17: Is this still necessary?  */
   /* Make sure that the current_frame's pc is correct.  This
      is a correction for setting up the frame info before doing
-     DECR_PC_AFTER_BREAK */
+     gdbarch_decr_pc_after_break */
   if (target_has_execution)
     /* FIXME: cagney/2002-12-06: Has the PC changed?  Thanks to
-       DECR_PC_AFTER_BREAK, the program counter can change.  Ask the
+       gdbarch_decr_pc_after_break, the program counter can change.  Ask the
        frame code to check for this and sort out any resultant mess.
-       DECR_PC_AFTER_BREAK needs to just go away.  */
+       gdbarch_decr_pc_after_break needs to just go away.  */
     deprecated_update_frame_pc_hack (get_current_frame (), read_pc ());
 
   if (target_has_execution && breakpoints_inserted)
index 158657e1865a60a7c1376a4d636e04d2746f50b5..695dbb0bfc0d9bdf664f3ee862eed139cc033ef6 100644 (file)
@@ -1767,7 +1767,8 @@ cancel_breakpoints_callback (struct lwp_info *lp, void *data)
   if (lp->status != 0
       && WIFSTOPPED (lp->status) && WSTOPSIG (lp->status) == SIGTRAP
       && breakpoint_inserted_here_p (read_pc_pid (lp->ptid) -
-                                    DECR_PC_AFTER_BREAK))
+                                    gdbarch_decr_pc_after_break
+                                      (current_gdbarch)))
     {
       if (debug_linux_nat)
        fprintf_unfiltered (gdb_stdlog,
@@ -1775,8 +1776,10 @@ cancel_breakpoints_callback (struct lwp_info *lp, void *data)
                            target_pid_to_str (lp->ptid));
 
       /* Back up the PC if necessary.  */
-      if (DECR_PC_AFTER_BREAK)
-       write_pc_pid (read_pc_pid (lp->ptid) - DECR_PC_AFTER_BREAK, lp->ptid);
+      if (gdbarch_decr_pc_after_break (current_gdbarch))
+       write_pc_pid (read_pc_pid (lp->ptid) - gdbarch_decr_pc_after_break
+                                                (current_gdbarch),
+                     lp->ptid);
 
       /* Throw away the SIGTRAP.  */
       lp->status = 0;
index 63bd8525386977bd1b0a90b4ebdd1f24f06a4894..eb7bb80720641c8b85e430847e8ad11f30ed6793 100644 (file)
@@ -804,7 +804,7 @@ check_event (ptid_t ptid)
   int loop = 0;
 
   /* Bail out early if we're not at a thread event breakpoint.  */
-  stop_pc = read_pc_pid (ptid) - DECR_PC_AFTER_BREAK;
+  stop_pc = read_pc_pid (ptid) - gdbarch_decr_pc_after_break (current_gdbarch);
   if (stop_pc != td_create_bp_addr && stop_pc != td_death_bp_addr)
     return;
 
index b87361e9e163cf687ead5b13c4558b8cf08772ba..6f5c5894a5056c56c2fffd6ad67afd965a072529 100644 (file)
@@ -777,9 +777,9 @@ sunos_solib_create_inferior_hook (void)
      the PC as necessary after a breakpoint, disable the breakpoint, and
      add any shared libraries that were mapped in. */
 
-  if (DECR_PC_AFTER_BREAK)
+  if (gdbarch_decr_pc_after_break (current_gdbarch))
     {
-      stop_pc -= DECR_PC_AFTER_BREAK;
+      stop_pc -= gdbarch_decr_pc_after_break (current_gdbarch);
       write_register (PC_REGNUM, stop_pc);
     }
 
index 41d45438e648135bfea6114ccc5fde21aab0cd7e..a2a073d0d5fa7b3d30159fc23218fcd3b04d7e17 100644 (file)
@@ -2584,7 +2584,8 @@ trace_dump_command (char *args, int from_tty)
      to the tracepoint PC.  If not, then the current frame was
      collected during single-stepping.  */
 
-  stepping_frame = (t->address != (read_pc () - DECR_PC_AFTER_BREAK));
+  stepping_frame = (t->address != (read_pc () - gdbarch_decr_pc_after_break
+                                                 (current_gdbarch)));
 
   for (action = t->actions; action; action = action->next)
     {