This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] Add PTRACE_GETTRACESIG handling in ptrace_request_to_str
- From: Pedro Alves <palves at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 04 Jan 2013 20:43:59 +0000
- Subject: Re: [commit] Add PTRACE_GETTRACESIG handling in ptrace_request_to_str
- References: <1355742749-11506-1-git-send-email-brobecker@adacore.com>
On 12/17/2012 11:12 AM, Joel Brobecker wrote:
> Hello,
>
> We use this ptrace request when handling SIGTRAP signals,
> and without this change, the debug traces show:
>
> PTRACE (<unknown-request>, ...
>
> This patch fixes this.
>
> gdb/gdbserver/ChangeLog:
>
> * lynx-low.c (ptrace_request_to_str): Add handling for
> PTRACE_GETTRACESIG.
>
> Tested on ppc-lynx5. Will commit.
>
> ---
> gdb/gdbserver/lynx-low.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
> index 766843b..0360dc0 100644
> --- a/gdb/gdbserver/lynx-low.c
> +++ b/gdb/gdbserver/lynx-low.c
> @@ -255,6 +255,9 @@ ptrace_request_to_str (int request)
> case PTRACE_GETLOADINFO:
> return "PTRACE_GETLOADINFO";
> break;
> + case PTRACE_GETTRACESIG:
> + return "PTRACE_GETTRACESIG";
> + break;
"break" is unreachable after "return".
We could also get rid of the risk of typoing
the string with something like:
#define CASE(X) case X: return #X
switch (request)
{
CASE(PTRACE_TRACEME);
CASE(PTRACE_PEEKTEXT);
...
}
#undef CASE
--
Pedro Alves