summaryrefslogtreecommitdiff
path: root/gdb
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
commitac89f65a370ad5d9a74c354bc57d0ba346d8d690 (patch)
treedce0ad2695b2e538dbbc8294d7ac53e44ff7bb52 /gdb
parent377313a3c8694a9e2537a2b3ab8b36a21676c353 (diff)
downloadgdb-ac89f65a370ad5d9a74c354bc57d0ba346d8d690.tar.gz
* 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')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/arch-utils.c22
-rw-r--r--gdb/hppa-tdep.c5
-rw-r--r--gdb/lin-lwp.c5
-rw-r--r--gdb/linux-thread.c5
-rw-r--r--gdb/m3-nat.c3
6 files changed, 39 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ffa0147dbfc..6fa1a5c0af1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+2001-06-06 Jonathan Larmour <jlarmour@redhat.com>
+
+ * 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.
+
2001-06-06 Jim Blandy <jimb@redhat.com>
* gdbarch.sh, gdbarch.c: Revert change of 2001-06-01; all
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index de977ddbbe8..733b2b96d02 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;
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 072b0a4b916..1c28e87faef 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -4594,7 +4594,10 @@ unwind_command (char *exp, int from_tty)
putting the BPT instruction in and taking it out.
Note that this implementation is potentially redundant now that
- default_prepare_to_proceed() has been added. */
+ default_prepare_to_proceed() has been added.
+
+ FIXME This may not support switching threads after Ctrl-C
+ correctly. The default implementation does support this. */
int
hppa_prepare_to_proceed (void)
{
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c
index 280936ec22e..0948a543161 100644
--- a/gdb/lin-lwp.c
+++ b/gdb/lin-lwp.c
@@ -263,7 +263,10 @@ iterate_over_lwps (int (*callback) (struct lwp_info *, void *), void *data)
layer.
Note that this implementation is potentially redundant now that
- default_prepare_to_proceed() has been added. */
+ default_prepare_to_proceed() has been added.
+
+ FIXME This may not support switching threads after Ctrl-C
+ correctly. The default implementation does support this. */
int
lin_lwp_prepare_to_proceed (void)
diff --git a/gdb/linux-thread.c b/gdb/linux-thread.c
index 62c07c4b164..f93387bfc7a 100644
--- a/gdb/linux-thread.c
+++ b/gdb/linux-thread.c
@@ -1040,7 +1040,10 @@ quit:
return 1 otherwise 0.
Note that this implementation is potentially redundant now that
- default_prepare_to_proceed() has been added. */
+ default_prepare_to_proceed() has been added.
+
+ FIXME This may not support switching threads after Ctrl-C
+ correctly. The default implementation does support this. */
int
linuxthreads_prepare_to_proceed (int step)
diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c
index 3ab160b3cb8..d01e22cdb24 100644
--- a/gdb/m3-nat.c
+++ b/gdb/m3-nat.c
@@ -1575,6 +1575,9 @@ mach_thread_output_id (int mid)
*
* Note that this implementation is potentially redundant now that
* default_prepare_to_proceed() has been added.
+ *
+ * FIXME This may not support switching threads after Ctrl-C
+ * correctly. The default implementation does support this.
*/
mach3_prepare_to_proceed (int select_it)