From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127629 invoked by alias); 19 Nov 2019 14:23:02 -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 127617 invoked by uid 89); 19 Nov 2019 14:23:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy= X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Nov 2019 14:23:01 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 738BE20373; Tue, 19 Nov 2019 09:22:59 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 2DE5520300; Tue, 19 Nov 2019 09:22:58 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 0EC2F2816F; Tue, 19 Nov 2019 09:22:58 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Tue, 19 Nov 2019 14:23:00 -0000 From: "Simon Marchi (Code Review)" To: Luis Machado , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v2] [AArch64, SVE] Improve target description check for SVE in gdbserver X-Gerrit-Change-Id: I28b782cb1677560ca9a06a1be442974b25aabae4 X-Gerrit-Change-Number: 690 X-Gerrit-ChangeURL: X-Gerrit-Commit: 0fb2b2f2613f782f00701f73a24f1c416f0e1f76 In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 19 Nov 2019 09:22:57 -0500 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191119142258.0EC2F2816F@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00590.txt.bz2 Simon Marchi has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/690 ...................................................................... Patch Set 2: (3 comments) Here are some minor comments. I think Alan Hayward will be in a better position to assess the correctness of the patch. | --- gdb/gdbserver/tdesc.c | +++ gdb/gdbserver/tdesc.c | @@ -184,5 +184,22 @@ tdesc_create_feature (struct target_desc *tdesc, const char *name) | { | struct tdesc_feature *new_feature = new tdesc_feature (name); | tdesc->features.emplace_back (new_feature); | return new_feature; | } | + | +/* See gdbsupport/tdesc.h. */ | + | +bool | +tdesc_contains_feature (const target_desc *tdesc, const std::string feature) PS2, Line 193: Pass feature as a reference. | +{ | + if (tdesc && !tdesc->features.empty ()) PS2, Line 195: tdesc != nullptr Or just assume/assert it is not NULL? Is there a legitimate use case for passing a NULL tdesc? | + { | + for (const tdesc_feature_up &f : tdesc->features) | + { | + if (f->name.compare (feature) == 0) PS2, Line 199: This can be f->name == feature | + return true; | + } | + } | + | + return false; | +} -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I28b782cb1677560ca9a06a1be442974b25aabae4 Gerrit-Change-Number: 690 Gerrit-PatchSet: 2 Gerrit-Owner: Luis Machado Gerrit-CC: Simon Marchi Gerrit-Comment-Date: Tue, 19 Nov 2019 14:22:57 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment