This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for power-pc gdb.server/non-existing-program.exp


Hi Carl,

thanks for the patch! I have just few nits below:

On 08/24/2016 01:50 PM, Carl E. Love wrote:
> Fix for power-pc gdb.server/non-existing-program.exp
> 
> The ptrace function reports an error when it is called on a process that
> has already terminated.  This commit fixes the issue by checking in function
> ppc_arch_setup() and returning without fetching the registers for the
> inferior.  Function ppc_arch_setup() is defined in:
> 
>    gdbserver/linux-ppc-low.c
> 
> gdbserver/ChangeLog
> 
> 2016-08-24  Carl Love  <cel@us.ibm.com>
> 
>       	* gdbserver/linux-ppc-low.c: check if process has exited already.

Relative File path (without 'gdbserver/'); changed function name between
parentheses; capital letter after colon.

> 
> ---
>  gdb/gdbserver/linux-ppc-low.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
> index 1d013f1..eedca57 100644
> --- a/gdb/gdbserver/linux-ppc-low.c
> +++ b/gdb/gdbserver/linux-ppc-low.c
> @@ -620,6 +620,15 @@ ppc_arch_setup (void)
>  #ifdef __powerpc64__
>    long msr;
>    struct regcache *regcache;
> +  int tid;
> +
> +  tid = lwpid_of (current_thread);
> +  if (getpgid(tid) <= 0) {
> +	  /* process doesn't exist, exit or subsequent call to ptrace will fail
> +		  on on-existent process */
> +	  fflush(stdout);
> +     return;
> +  }

GDB recommends to follow the GNU coding standards
<https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards>, so
the braces should appear in separate lines and the comment should be
formatted properly too.

> 
>    /* On a 64-bit host, assume 64-bit inferior process with no
>       AltiVec registers.  Reset ppc_hwcap to ensure that the
> 


Thanks and regards,
--
Edjunior


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]