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 a6365f1..cc1a3a3 100644 (file)
@@ -1,5 +1,19 @@
 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
        gdbarch_address_class_type_flags.
        * dwarf2read.c (read_tag_pointer_type): Likewise.
index ccb275a..32b7430 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 ec6e8b5..4308d35 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 b29370a..53bb5fa 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 9edc8ab..f3b894c 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 1632a5b..e195f8a 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 4e286c7..81cc07d 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 c6da746..db2c4a9 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 158657e..695dbb0 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 63bd852..eb7bb80 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 b87361e..6f5c589 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 41d4543..a2a073d 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)
     {