aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-10-15 19:55:47 +0000
committerMark Kettenis <kettenis@gnu.org>2003-10-15 19:55:47 +0000
commit73be9954d521a6bfd84d7dac4e3383797e569df2 (patch)
tree55a0f55fe59913be12f4f2019e99dead45b89d63
parentfa81c7f81db0d68b1556d2d9153430c516dbd2ef (diff)
downloadgdb-73be9954d521a6bfd84d7dac4e3383797e569df2.zip
gdb-73be9954d521a6bfd84d7dac4e3383797e569df2.tar.gz
gdb-73be9954d521a6bfd84d7dac4e3383797e569df2.tar.bz2
* infrun.c (handle_inferior_event): Allow for breakpoint
instructions to generate a SIGSEGV in addition to SIGTRAP, SIGILL and SIGEMT. Update comments.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/infrun.c27
2 files changed, 24 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c5c461c..b97b3ac 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-15 Mark Kettenis <kettenis@gnu.org>
+
+ * infrun.c (handle_inferior_event): Allow for breakpoint
+ instructions to generate a SIGSEGV in addition to SIGTRAP, SIGILL
+ and SIGEMT. Update comments.
+
2003-09-20 Mark Kettenis <kettenis@gnu.org>
* Makefile.in (sparc-sol2-nat.o): Fix typo.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index f4ab632..c87a007 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1845,16 +1845,21 @@ handle_inferior_event (struct execution_control_state *ecs)
will be made according to the signal handling tables. */
/* First, distinguish signals caused by the debugger from signals
- that have to do with the program's own actions.
- Note that breakpoint insns may cause SIGTRAP or SIGILL
- or SIGEMT, depending on the operating system version.
- Here we detect when a SIGILL or SIGEMT is really a breakpoint
- and change it to SIGTRAP. */
+ that have to do with the program's own actions. Note that
+ breakpoint insns may cause SIGTRAP or SIGILL or SIGEMT, depending
+ on the operating system version. Here we detect when a SIGILL or
+ SIGEMT is really a breakpoint and change it to SIGTRAP. We do
+ something similar for SIGSEGV, since a SIGSEGV will be generated
+ when we're trying to execute a breakpoint instruction on a
+ non-executable stack. This happens for call dummy breakpoints
+ for architectures like SPARC that place call dummies on the
+ stack. */
if (stop_signal == TARGET_SIGNAL_TRAP
|| (breakpoints_inserted &&
(stop_signal == TARGET_SIGNAL_ILL
- || stop_signal == TARGET_SIGNAL_EMT))
+ || stop_signal == TARGET_SIGNAL_EMT
+ || stop_signal == TARGET_SIGNAL_SEGV))
|| stop_soon == STOP_QUIETLY
|| stop_soon == STOP_QUIETLY_NO_SIGSTOP)
{
@@ -1937,10 +1942,14 @@ handle_inferior_event (struct execution_control_state *ecs)
If someone ever tries to get get call dummys on a
non-executable stack to work (where the target would stop
- with something like a SIGSEG), then those tests might need to
- be re-instated. Given, however, that the tests were only
+ with something like a SIGSEGV), then those tests might need
+ to be re-instated. Given, however, that the tests were only
enabled when momentary breakpoints were not being used, I
- suspect that it won't be the case. */
+ suspect that it won't be the case.
+
+ NOTE: kettenis/2003-10-15: Indeed such checks don't seem to
+ be necessary for call dummies on a non-executable stack on
+ SPARC. */
if (stop_signal == TARGET_SIGNAL_TRAP)
ecs->random_signal