Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Clarify documentation of signal numbers
@ 2024-12-20 20:19 Tom Tromey
  2024-12-21  6:34 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2024-12-20 20:19 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-06 18:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-20 20:19 [PATCH] Clarify documentation of signal numbers Tom Tromey
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox