aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-06-09 13:55:51 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-06-09 13:55:51 +0000
commitb798847d060c439bc350e5fbaf6e8d315b18c727 (patch)
treee39756e91de6bf6205aea8beb77b9840e1fe2d2e
parent849957d956897855dceff00600cc47248f657eaa (diff)
downloadfsf-binutils-gdb-b798847d060c439bc350e5fbaf6e8d315b18c727.zip
fsf-binutils-gdb-b798847d060c439bc350e5fbaf6e8d315b18c727.tar.gz
fsf-binutils-gdb-b798847d060c439bc350e5fbaf6e8d315b18c727.tar.bz2
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.
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/aix-thread.c5
-rw-r--r--gdb/dummy-frame.c5
-rw-r--r--gdb/frame.h2
-rw-r--r--gdb/gdbarch.c5
-rw-r--r--gdb/gdbarch.h6
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/infrun.c29
-rw-r--r--gdb/linux-nat.c9
-rw-r--r--gdb/linux-thread-db.c2
-rw-r--r--gdb/solib-sunos.c4
-rw-r--r--gdb/tracepoint.c3
12 files changed, 48 insertions, 38 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a6365f1..cc1a3a3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index ccb275a..32b7430 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -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);
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index ec6e8b5..4308d35 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -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;
diff --git a/gdb/frame.h b/gdb/frame.h
index b29370a..53bb5fa 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -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 = ....; */
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 9edc8ab..f3b894c 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -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));
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 1632a5b..e195f8a 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -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).
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 4e286c7..81cc07d 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -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).
diff --git a/gdb/infrun.c b/gdb/infrun.c
index c6da7467..db2c4a9 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -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)
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 158657e..695dbb0 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -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;
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 63bd852..eb7bb80 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -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;
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index b87361e..6f5c589 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -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);
}
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 41d4543..a2a073d 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -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)
{