From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Clarify documentation of signal numbers
Date: Fri, 20 Dec 2024 13:19:40 -0700 [thread overview]
Message-ID: <20241220201940.3235367-1-tromey@adacore.com> (raw)
A user was confused by the meaning of signal numbers in the gdb CLI.
For instance, when using "signal 3", exactly which signal is
delivered? Is it always 3, or is it always SIGQUIT?
This patch attempts to clarify the documentation here.
Let me know what you think. I'm not sure this is phrased in the
clearest way possible.
---
gdb/doc/gdb.texinfo | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 7b6000abbea..28a29edbd7c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -6882,6 +6882,17 @@ fatal so it can carry out the purpose of the interrupt: to kill the program.
program. You can tell @value{GDBN} in advance what to do for each kind of
signal.
+When specifying a signal by number, @value{GDBN} translates the number
+to the target platform according to the corresponding signal name.
+For example, @value{GDBN} always treats signal 1 as @code{SIGHUP}.
+So, when specifying @samp{1} as a signal, @value{GDBN} will translate
+this to the target's @code{SIGHUP}, whatever that might be.
+
+Numbers may only be used for signals 1 through 15. Where POSIX
+specifies a signal's number, @value{GDBN} uses the same value.
+Additionally, @value{GDBN} uses 7 for @code{SIGEMT}, 10 for
+@code{SIGBUS}, and 12 for @code{SIGSYS}.
+
@cindex handling signals
Normally, @value{GDBN} is set up to let the non-erroneous signals like
@code{SIGALRM} be silently passed to your program
--
2.47.0
next reply other threads:[~2024-12-20 20:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 20:19 Tom Tromey [this message]
2024-12-21 6:34 ` Eli Zaretskii
2025-01-02 23:27 ` Maciej W. Rozycki
2025-01-06 17:51 ` Tom Tromey
2025-01-06 18:37 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220201940.3235367-1-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox