Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Marcin Kościelnicki" <koriakin@0x04.net>
To: Andreas Arnez <arnez@linux.vnet.ibm.com>, gdb-patches@sourceware.org
Cc: Yao Qi <qiyaoltc@gmail.com>,
	"Metzger, Markus T" <markus.t.metzger@intel.com>
Subject: Re: [PATCH 1/3] linux-record: Fix bad fall-through for pipe/pipe2
Date: Wed, 16 Mar 2016 20:23:00 -0000	[thread overview]
Message-ID: <56E9C0C5.4090107@0x04.net> (raw)
In-Reply-To: <1458154517-25441-2-git-send-email-arnez@linux.vnet.ibm.com>

On 16/03/16 19:54, Andreas Arnez wrote:
> This patch added handling for some syscalls to linux-record.c:
>
>    https://sourceware.org/ml/gdb-patches/2015-10/msg00452.html
>
> But for both `pipe' and `pipe2' the patch lacks a statement after an
> `if', such that the following `break' is interpreted as the `if'-body
> instead.
>
> This adds the missing (return-) statements for the conditionals.

Whoops, my bad.  This looks like obvious patch material.  Though I 
wonder why it wasn't detected earlier by someone running GCC 6 with its 
-Wmisleading-indentation warning - does it not catch it?

Btw, it seems that cases gdb_sys_pipe2 and gdb_sys_pipe could be 
squashed into one.
>
> gdb/ChangeLog:
>
> 	* linux-record.c (record_linux_system_call): Add missing return
> 	statements to handling of pipe and pipe2 syscalls.
> ---
>   gdb/linux-record.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/gdb/linux-record.c b/gdb/linux-record.c
> index a40845a..2e86936 100644
> --- a/gdb/linux-record.c
> +++ b/gdb/linux-record.c
> @@ -354,6 +354,7 @@ record_linux_system_call (enum gdb_syscall syscall,
>         regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
>         if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
>   					 tdep->size_int * 2))
> +        return -1;
>         break;
>
>       case gdb_sys_times:
> @@ -2312,6 +2313,7 @@ Do you want to stop the program?"),
>         regcache_raw_read_unsigned (regcache, tdep->arg1, &tmpulongest);
>         if (record_full_arch_list_add_mem ((CORE_ADDR) tmpulongest,
>   					 tdep->size_int * 2))
> +        return -1;
>         break;
>
>       case gdb_sys_inotify_init1:
>


  reply	other threads:[~2016-03-16 20:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 18:55 [PATCH 0/3] Some cleanups in linux-record.c Andreas Arnez
2016-03-16 18:56 ` [PATCH 1/3] linux-record: Fix bad fall-through for pipe/pipe2 Andreas Arnez
2016-03-16 20:23   ` Marcin Kościelnicki [this message]
2016-03-17 12:51     ` Andreas Arnez
2016-03-17  8:42   ` Yao Qi
2016-03-17  9:11     ` Andreas Arnez
2016-03-16 18:56 ` [PATCH 2/3] linux-record.c: Fix whitespace issues Andreas Arnez
2016-03-17  8:44   ` Yao Qi
2016-03-17  9:12     ` Andreas Arnez
2016-03-16 18:57 ` [PATCH 3/3] linux-record: Simplify with record_mem_at_reg() Andreas Arnez
2016-03-17  8:45   ` Yao Qi
2016-03-17  9:11     ` Andreas Arnez

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=56E9C0C5.4090107@0x04.net \
    --to=koriakin@0x04.net \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    --cc=qiyaoltc@gmail.com \
    /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