From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53339 invoked by alias); 27 Nov 2019 04:21:48 -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 53323 invoked by uid 89); 27 Nov 2019 04:21:47 -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=HX-Languages-Length:2497 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, 27 Nov 2019 04:21:37 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id EBA2820387; Tue, 26 Nov 2019 23:21:35 -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 CC76420187; Tue, 26 Nov 2019 23:21:26 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id AB09A20AF6; Tue, 26 Nov 2019 23:21:26 -0500 (EST) X-Gerrit-PatchSet: 7 Date: Wed, 27 Nov 2019 04:21:00 -0000 From: "Simon Marchi (Code Review)" To: Andrew Burgess , gdb-patches@sourceware.org Cc: Joel Brobecker Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v7] gdb/mi: Add -symbol-info-module-{variables,functions} X-Gerrit-Change-Id: Ic96f12dd14bd7e34774c3cde008fec30a4055bfe X-Gerrit-Change-Number: 268 X-Gerrit-ChangeURL: X-Gerrit-Commit: cc7fa2c04b73b402230b04a7d56b871e6086dca7 In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 26 Nov 2019 23:21:26 -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: <20191127042126.AB09A20AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg01020.txt.bz2 Simon Marchi has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/268 ...................................................................... Patch Set 7: (2 comments) | --- gdb/mi/mi-symbol-cmds.c | +++ gdb/mi/mi-symbol-cmds.c | @@ -219,0 +268,34 @@ mi_info_module_functions_or_variables (enum search_domain kind, | + } | + } | + | + std::vector module_symbols | + = search_module_symbols (module_regexp, regexp, type_regexp, kind); | + | + struct ui_out *uiout = current_uiout; | + ui_out_emit_list all_matching_symbols (uiout, "symbols"); | + | + for (int i = 0; i < module_symbols.size (); ) PS7, Line 277: I would appreciate a few comments in this function, that explains what each step does, at a high level. Otherwise I'm not sure of what's the intention, and therefore if the code what you intended it to do. | + { | + gdb_assert (module_symbols[i].second.symbol != nullptr); | + const symbol *mod_sym = module_symbols[i].first.symbol; | + const symbol *first_mod_sym = mod_sym; | + | + ui_out_emit_tuple module_tuple (uiout, nullptr); | + uiout->field_string ("module", mod_sym->print_name ()); | + | + for (; (i < module_symbols.size () | + && first_mod_sym == module_symbols[i].first.symbol);) | + { | + ui_out_emit_list files_list (uiout, "files"); | + | + for (; (i < module_symbols.size () | + && first_mod_sym == module_symbols[i].first.symbol);) PS7, Line 292: For example, this for loop is identical to the previous for loop. I find it a bit odd, but maybe that's intended? | + { | + ui_out_emit_tuple current_file (uiout, nullptr); | + const symbol_search &q = module_symbols[i].second; | + struct symtab *s = symbol_symtab (q.symbol); | + uiout->field_string ("filename", | + symtab_to_filename_for_display (s)); | + uiout->field_string ("fullname", symtab_to_fullname (s)); | + ui_out_emit_list item_list (uiout, "symbols"); | + const symtab *last_symtab = symbol_symtab (q.symbol); -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: Ic96f12dd14bd7e34774c3cde008fec30a4055bfe Gerrit-Change-Number: 268 Gerrit-PatchSet: 7 Gerrit-Owner: Andrew Burgess Gerrit-CC: Joel Brobecker Gerrit-CC: Simon Marchi Gerrit-Comment-Date: Wed, 27 Nov 2019 04:21:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment