From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123127 invoked by alias); 30 Oct 2019 14:19:24 -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 123113 invoked by uid 89); 30 Oct 2019 14:19:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 spammy=2100, unpack, 2096 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; Wed, 30 Oct 2019 14:19:22 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 83E03203AF; Wed, 30 Oct 2019 10:19:20 -0400 (EDT) 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 4ACD720266; Wed, 30 Oct 2019 10:19:19 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 278FB20AF6; Wed, 30 Oct 2019 10:19:19 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Wed, 30 Oct 2019 14:19:00 -0000 From: "Tom Tromey (Code Review)" To: Andrew Burgess , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review] gdb: Introduce symbol_search_spec X-Gerrit-Change-Id: I488ab292a892d9e9e84775c632c5f198b6ad3710 X-Gerrit-Change-Number: 264 X-Gerrit-ChangeURL: X-Gerrit-Commit: 38e4dba5045aa9b6293b8484708fc5c28b1605a3 In-Reply-To: References: X-Gerrit-Comment-Date: Wed, 30 Oct 2019 10:19:19 -0400 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-74-g460fb0f7e9 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191030141919.278FB20AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg01091.txt.bz2 Tom Tromey has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/264 ...................................................................... Patch Set 1: Code-Review+2 (2 comments) Thanks, this looks good. I did have one question about whether search_symbols should remain a function or should be a method of the new struct. https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/264/1/gdb/symtab.h File gdb/symtab.h: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/264/1/gdb/symtab.h@2094 PS1, Line 2094: 2069 | struct search_symbols_spec | ... 2093 | /* Constructor. */ 2094 | search_symbols_spec (enum search_domain kind, 2095 | const char *symbol_regexp = nullptr, 2096 | const char *type_regexp = nullptr, 2097 | bool exclude_minsyms = false) 2098 | : kind (kind), 2099 | symbol_regexp (symbol_regexp), 2100 | type_regexp (type_regexp), 2101 | exclude_minsyms (exclude_minsyms) 2102 | { /* Nothing. */ } This could gdb_assert (kind != ALL_DOMAIN) https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/264/1/gdb/symtab.c File gdb/symtab.c: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/264/1/gdb/symtab.c@4449 PS1, Line 4449: 4447 | 4448 | std::vector 4449 | search_symbols (const search_symbols_spec &search_spec) 4450 | { 4451 | /* Unpack the search spec. */ 4452 | const char *regexp = search_spec.symbol_regexp; 4453 | enum search_domain kind = search_spec.kind; 4454 | const char *t_regexp = search_spec.type_regexp; 4455 | int nfiles = search_spec.filenames.size (); 4456 | bool exclude_minsyms = search_spec.exclude_minsyms; Did you consider making search_symbols a method of search_symbols_spec? Then this unpacking wouldn't be needed. -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I488ab292a892d9e9e84775c632c5f198b6ad3710 Gerrit-Change-Number: 264 Gerrit-PatchSet: 1 Gerrit-Owner: Andrew Burgess Gerrit-Reviewer: Tom Tromey Gerrit-Comment-Date: Wed, 30 Oct 2019 14:19:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment