From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38059 invoked by alias); 21 Jul 2017 20:37:43 -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 35976 invoked by uid 89); 21 Jul 2017 20:37:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Jul 2017 20:37:41 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v6LKbYtk026862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Jul 2017 16:37:39 -0400 Received: by simark.ca (Postfix, from userid 112) id 45AC11E5B1; Fri, 21 Jul 2017 16:37:34 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id D3C781E194; Fri, 21 Jul 2017 16:37:33 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 21 Jul 2017 20:37:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org, sergiodj@redhat.com Subject: Re: [RFA v2 3/4] Use std::vector in syscall_catchpoint In-Reply-To: <20170719203225.6714-4-tom@tromey.com> References: <20170719203225.6714-1-tom@tromey.com> <20170719203225.6714-4-tom@tromey.com> Message-ID: <547db13b31e162956b647e5e5a3929dd@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 21 Jul 2017 20:37:34 +0000 X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00323.txt.bz2 Hi Tom, Just a nit in addition to what Sergio pointed out, otherwise LGTM too. On 2017-07-19 22:32, Tom Tromey wrote: > @@ -385,23 +355,17 @@ print_recreate_catch_syscall (struct breakpoint > *b, struct ui_file *fp) > > fprintf_unfiltered (fp, "catch syscall"); > > - if (c->syscalls_to_be_caught) > + for (int iter : c->syscalls_to_be_caught) > { > - int i, iter; > - > - for (i = 0; > - VEC_iterate (int, c->syscalls_to_be_caught, i, iter); > - i++) > - { > - struct syscall s; > + struct syscall s; > > - get_syscall_by_number (gdbarch, iter, &s); > - if (s.name) > - fprintf_unfiltered (fp, " %s", s.name); > - else > - fprintf_unfiltered (fp, " %d", s.number); > - } > + get_syscall_by_number (gdbarch, iter, &s); > + if (s.name) Could you add a != NULL while at it? Thanks, Simon