From: "Ali Tamur via gdb-patches" <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Ali Tamur <tamur@google.com>
Subject: [PATCH] Disambiguate info_print_options
Date: Sat, 25 Jan 2020 07:38:00 -0000 [thread overview]
Message-ID: <20200125050825.53004-1-tamur@google.com> (raw)
struct info_print_options is defined in both symtab.c and stack.c, which is
an ODR violation. So, I am renaming one of them. (Please suggest a better
name, what I picked is not good).
gdb/ChangeLog:
* symtab.c (info_print_options): Rename to
info_print_options_for_symtab.
(info_print_options_defs): Apply name change.
(make_info_print_options_def_group): Likewise.
(info_variables_command): Likewise.
(info_functions_command): Likewise.
---
gdb/symtab.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index f456f4d852..95c15ac6e0 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -4976,13 +4976,13 @@ symtab_symbol_info (bool quiet, bool exclude_minsyms,
and 'info functions' commands. These correspond to the -q, -t, and -n
options. */
-struct info_print_options
+struct info_print_options_for_symtab
{
bool quiet = false;
bool exclude_minsyms = false;
char *type_regexp = nullptr;
- ~info_print_options ()
+ ~info_print_options_for_symtab ()
{
xfree (type_regexp);
}
@@ -4992,23 +4992,23 @@ struct info_print_options
commands. */
static const gdb::option::option_def info_print_options_defs[] = {
- gdb::option::boolean_option_def<info_print_options> {
+ gdb::option::boolean_option_def<info_print_options_for_symtab> {
"q",
- [] (info_print_options *opt) { return &opt->quiet; },
+ [] (info_print_options_for_symtab *opt) { return &opt->quiet; },
nullptr, /* show_cmd_cb */
nullptr /* set_doc */
},
- gdb::option::boolean_option_def<info_print_options> {
+ gdb::option::boolean_option_def<info_print_options_for_symtab> {
"n",
- [] (info_print_options *opt) { return &opt->exclude_minsyms; },
+ [] (info_print_options_for_symtab *opt) { return &opt->exclude_minsyms; },
nullptr, /* show_cmd_cb */
nullptr /* set_doc */
},
- gdb::option::string_option_def<info_print_options> {
+ gdb::option::string_option_def<info_print_options_for_symtab> {
"t",
- [] (info_print_options *opt) { return &opt->type_regexp; },
+ [] (info_print_options_for_symtab *opt) { return &opt->type_regexp; },
nullptr, /* show_cmd_cb */
nullptr /* set_doc */
}
@@ -5018,7 +5018,7 @@ static const gdb::option::option_def info_print_options_defs[] = {
functions'. */
static gdb::option::option_def_group
-make_info_print_options_def_group (info_print_options *opts)
+make_info_print_options_def_group (info_print_options_for_symtab *opts)
{
return {{info_print_options_defs}, opts};
}
@@ -5045,7 +5045,7 @@ info_print_command_completer (struct cmd_list_element *ignore,
static void
info_variables_command (const char *args, int from_tty)
{
- info_print_options opts;
+ info_print_options_for_symtab opts;
auto grp = make_info_print_options_def_group (&opts);
gdb::option::process_options
(&args, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, grp);
@@ -5061,7 +5061,7 @@ info_variables_command (const char *args, int from_tty)
static void
info_functions_command (const char *args, int from_tty)
{
- info_print_options opts;
+ info_print_options_for_symtab opts;
auto grp = make_info_print_options_def_group (&opts);
gdb::option::process_options
(&args, gdb::option::PROCESS_OPTIONS_UNKNOWN_IS_OPERAND, grp);
--
2.25.0.341.g760bfbb309-goog
next reply other threads:[~2020-01-25 5:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-25 7:38 Ali Tamur via gdb-patches [this message]
2020-01-26 16:15 ` Tom Tromey
2020-01-28 10:14 ` Ali Tamur via gdb-patches
2020-02-01 23:22 ` Ali Tamur via gdb-patches
2020-02-05 21:40 ` Ali Tamur via gdb-patches
2020-02-05 21:49 ` Simon Marchi
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=20200125050825.53004-1-tamur@google.com \
--to=gdb-patches@sourceware.org \
--cc=tamur@google.com \
/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