From: "Simon Marchi (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: [review v7] gdb/mi: Add -symbol-info-module-{variables,functions}
Date: Wed, 27 Nov 2019 04:21:00 -0000 [thread overview]
Message-ID: <20191127042126.AB09A20AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571909344000.Ic96f12dd14bd7e34774c3cde008fec30a4055bfe@gnutoolchain-gerrit.osci.io>
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_symbol_search> 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 <andrew.burgess@embecosm.com>
Gerrit-CC: Joel Brobecker <brobecker@adacore.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Wed, 27 Nov 2019 04:21:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
next prev parent reply other threads:[~2019-11-27 4:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <gerrit.1571909344000.Ic96f12dd14bd7e34774c3cde008fec30a4055bfe@gnutoolchain-gerrit.osci.io>
2019-11-01 1:28 ` [review v2] " Andrew Burgess (Code Review)
2019-11-22 16:42 ` [review v4] " Andrew Burgess (Code Review)
2019-11-22 19:28 ` Eli Zaretskii
2019-11-26 23:26 ` [review v6] " Andrew Burgess (Code Review)
2019-11-27 4:21 ` Simon Marchi (Code Review) [this message]
2019-11-27 14:19 ` [review v8] " Andrew Burgess (Code Review)
2019-11-27 14:21 ` Andrew Burgess (Code Review)
2019-11-28 20:05 ` Simon Marchi (Code Review)
2019-12-02 19:15 ` [review v9] " Andrew Burgess (Code Review)
2019-12-02 19:16 ` Andrew Burgess (Code Review)
2019-12-02 23:44 ` [review v10] " Andrew Burgess (Code Review)
2019-12-03 1:53 ` Simon Marchi (Code Review)
2019-12-03 4:04 ` Simon Marchi (Code Review)
2019-12-03 10:24 ` [review v11] " Andrew Burgess (Code Review)
2019-12-03 10:25 ` [review v10] " Andrew Burgess (Code Review)
2019-12-03 16:38 ` [review v11] " Simon Marchi (Code Review)
2019-12-04 10:49 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-04 10:49 ` Sourceware to Gerrit sync (Code Review)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191127042126.AB09A20AF6@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=andrew.burgess@embecosm.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=gnutoolchain-gerrit@osci.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox