[commit] Add PTRACE_GETTRACESIG handling in ptrace_request_to_str

Joel Brobecker brobecker@adacore.com
Mon Jan 7 11:56:00 GMT 2013


> "break" is unreachable after "return".

Yeah - it's a bad habit of mine to consider "break;" as a syntactic
element of the case. 

> 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

Indeed. Suggestion applied thusly, after having been tested
on ppc-lynx178 (with and without debug enabled).

gdb/gdbserver/ChangeLog:

        * lynx-low.c (ptrace_request_to_str): Define a temporary
        macro and use it to simplify this function's implementation.

Thanks!
-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-Simplifly-ptrace_request_to_str-s-implementation.patch
Type: text/x-diff
Size: 7170 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20130107/c5827434/attachment.bin>


More information about the Gdb-patches mailing list