aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-17 18:33:28 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-17 18:33:28 +0000
commit9f5a595d690a517ab5cf8d59f7d6b09125594d52 (patch)
tree21b9eefbd3eae4da2ff8c89c4251cc039b2b6902 /gdb
parent568d657528fe676571c95e51a2f64112782edfdb (diff)
downloadgdb-9f5a595d690a517ab5cf8d59f7d6b09125594d52.zip
gdb-9f5a595d690a517ab5cf8d59f7d6b09125594d52.tar.gz
gdb-9f5a595d690a517ab5cf8d59f7d6b09125594d52.tar.bz2
* infrun.c (cleanup_displaced_step_closure): Remove.
(displaced_step_clear_cleanup): Move to before displaced_step_prepare. (displaced_step_prepare): Use displaced_step_clear_cleanup instead of cleanup_displaced_step_closure. (handle_inferior_event, keep_going): Use thread architecture instead of current_gdbarch.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/infrun.c36
2 files changed, 25 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 320c178..b1409cc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
+ * infrun.c (cleanup_displaced_step_closure): Remove.
+ (displaced_step_clear_cleanup): Move to before displaced_step_prepare.
+ (displaced_step_prepare): Use displaced_step_clear_cleanup instead
+ of cleanup_displaced_step_closure.
+ (handle_inferior_event, keep_going): Use thread architecture instead
+ of current_gdbarch.
+
+2009-06-17 Ulrich Weigand <uweigand@de.ibm.com>
+
* infrun.c (handle_inferior_event): Use current frame architecture
or thread architecture instead of current_gdbarch. Pass to
handle_step_into_function and handle_step_into_function_backward.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index ad91a62..da2dc72 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -763,11 +763,9 @@ displaced_step_clear (void)
}
static void
-cleanup_displaced_step_closure (void *ptr)
+displaced_step_clear_cleanup (void *ignore)
{
- struct displaced_step_closure *closure = ptr;
-
- gdbarch_displaced_step_free_closure (current_gdbarch, closure);
+ displaced_step_clear ();
}
/* Dump LEN bytes at BUF in hex to FILE, followed by a newline. */
@@ -878,7 +876,15 @@ displaced_step_prepare (ptid_t ptid)
/* We don't support the fully-simulated case at present. */
gdb_assert (closure);
- make_cleanup (cleanup_displaced_step_closure, closure);
+ /* Save the information we need to fix things up if the step
+ succeeds. */
+ displaced_step_ptid = ptid;
+ displaced_step_gdbarch = gdbarch;
+ displaced_step_closure = closure;
+ displaced_step_original = original;
+ displaced_step_copy = copy;
+
+ make_cleanup (displaced_step_clear_cleanup, 0);
/* Resume execution at the copy. */
regcache_write_pc (regcache, copy);
@@ -891,23 +897,10 @@ displaced_step_prepare (ptid_t ptid)
fprintf_unfiltered (gdb_stdlog, "displaced: displaced pc to 0x%s\n",
paddr_nz (copy));
- /* Save the information we need to fix things up if the step
- succeeds. */
- displaced_step_ptid = ptid;
- displaced_step_gdbarch = gdbarch;
- displaced_step_closure = closure;
- displaced_step_original = original;
- displaced_step_copy = copy;
return 1;
}
static void
-displaced_step_clear_cleanup (void *ignore)
-{
- displaced_step_clear ();
-}
-
-static void
write_memory_ptid (ptid_t ptid, CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
{
struct cleanup *ptid_cleanup = save_inferior_ptid ();
@@ -2923,6 +2916,7 @@ targets should add new threads to the thread list themselves in non-stop mode.")
if (thread_hop_needed)
{
+ struct regcache *thread_regcache;
int remove_status = 0;
if (debug_infrun)
@@ -2945,7 +2939,8 @@ targets should add new threads to the thread list themselves in non-stop mode.")
/* If the arch can displace step, don't remove the
breakpoints. */
- if (!use_displaced_stepping (current_gdbarch))
+ thread_regcache = get_thread_regcache (ecs->ptid);
+ if (!use_displaced_stepping (get_regcache_arch (thread_regcache)))
remove_status = remove_breakpoints ();
/* Did we fail to remove breakpoints? If so, try
@@ -4281,7 +4276,8 @@ keep_going (struct execution_control_state *ecs)
if (ecs->event_thread->stepping_over_breakpoint)
{
- if (! use_displaced_stepping (current_gdbarch))
+ struct regcache *thread_regcache = get_thread_regcache (ecs->ptid);
+ if (!use_displaced_stepping (get_regcache_arch (thread_regcache)))
/* Since we can't do a displaced step, we have to remove
the breakpoint while we step it. To keep things
simple, we remove them all. */