From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6968 invoked by alias); 16 Mar 2016 20:23:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6943 invoked by uid 89); 16 Mar 2016 20:23:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=interpreted, Hx-languages-length:1636, Hx-spam-relays-external:sk:!192.16, H*RU:sk:!192.16 X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Mar 2016 20:23:36 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id AC8AE3FE63; Wed, 16 Mar 2016 21:24:34 +0100 (CET) Received: from [192.168.13.108] (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by hogfather.0x04.net (Postfix) with ESMTPSA id A54655800FD; Wed, 16 Mar 2016 21:23:33 +0100 (CET) Subject: Re: [PATCH 1/3] linux-record: Fix bad fall-through for pipe/pipe2 To: Andreas Arnez , gdb-patches@sourceware.org References: <1458154517-25441-1-git-send-email-arnez@linux.vnet.ibm.com> <1458154517-25441-2-git-send-email-arnez@linux.vnet.ibm.com> Cc: Yao Qi , "Metzger, Markus T" From: =?UTF-8?Q?Marcin_Ko=c5=9bcielnicki?= Message-ID: <56E9C0C5.4090107@0x04.net> Date: Wed, 16 Mar 2016 20:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1458154517-25441-2-git-send-email-arnez@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00269.txt.bz2 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: >