aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch-utils.c
diff options
context:
space:
mode:
authorJonathan Larmour <jifl@eCosCentric.com>2001-06-06 16:31:32 +0000
committerJonathan Larmour <jifl@eCosCentric.com>2001-06-06 16:31:32 +0000
commit8849f47dd926d34632dc6b2a16e99114f36ffa2a (patch)
treedcfc968cb7acbb6b037d11dcee08d131f727b467 /gdb/arch-utils.c
parentb3cc30771bb218c2101d0f5499e058d121e6af07 (diff)
downloadgdb-8849f47dd926d34632dc6b2a16e99114f36ffa2a.zip
gdb-8849f47dd926d34632dc6b2a16e99114f36ffa2a.tar.gz
gdb-8849f47dd926d34632dc6b2a16e99114f36ffa2a.tar.bz2
* arch-utils.c (generic_prepare_to_proceed): Allow for having
stopped due to a Ctrl-C as well as breakpoints. * hppa-tdep.c (hppa_prepare_to_proceed): Add FIXME as this may not support thread switches after Ctrl-C. * lin-lwp.c (lin_lwp_prepare_to_proceed): Ditto. * linux-thread.c (linuxthreads_prepare_to_proceed): Ditto. * m3-nat.c (mach3_prepare_to_proceed): Ditto.
Diffstat (limited to 'gdb/arch-utils.c')
-rw-r--r--gdb/arch-utils.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index de977dd..733b2b9 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -258,9 +258,11 @@ generic_prepare_to_proceed (int select_it)
/* Get the last target status returned by target_wait(). */
get_last_target_status (&wait_ptid, &wait_status);
- /* Make sure we were stopped at a breakpoint. */
+ /* Make sure we were stopped either at a breakpoint, or because
+ of a Ctrl-C. */
if (wait_status.kind != TARGET_WAITKIND_STOPPED
- || wait_status.value.sig != TARGET_SIGNAL_TRAP)
+ || (wait_status.value.sig != TARGET_SIGNAL_TRAP &&
+ wait_status.value.sig != TARGET_SIGNAL_INT))
{
return 0;
}
@@ -271,14 +273,11 @@ generic_prepare_to_proceed (int select_it)
/* Switched over from WAIT_PID. */
CORE_ADDR wait_pc = read_pc_pid (wait_ptid);
- /* Avoid switching where it wouldn't do any good, i.e. if both
- threads are at the same breakpoint. */
- if (wait_pc != read_pc () && breakpoint_here_p (wait_pc))
+ if (wait_pc != read_pc ())
{
if (select_it)
{
- /* User hasn't deleted the breakpoint. Switch back to
- WAIT_PID and return non-zero. */
+ /* Switch back to WAIT_PID thread. */
inferior_ptid = wait_ptid;
/* FIXME: This stuff came from switch_to_thread() in
@@ -288,8 +287,13 @@ generic_prepare_to_proceed (int select_it)
stop_pc = wait_pc;
select_frame (get_current_frame (), 0);
}
-
- return 1;
+ /* We return 1 to indicate that there is a breakpoint here,
+ so we need to step over it before continuing to avoid
+ hitting it straight away. */
+ if (breakpoint_here_p (wait_pc))
+ {
+ return 1;
+ }
}
}
return 0;