This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Make 'symbol-file' not care about the position of command line arguments
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Pedro Alves <palves at redhat dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>
- Date: Wed, 29 Nov 2017 16:44:51 -0500
- Subject: [PATCH] Make 'symbol-file' not care about the position of command line arguments
- Authentication-results: sourceware.org; auth=none
- References: <779a2d21-badf-b54c-e1c9-2f869716fd71@redhat.com>
This is a bug that's been detected while doing the readnever work.
Currently if you use the 'symbol-file' command you have to be careful
about the position of each argument you pass on the command line.
This is because while parsing its arguments, if the command detects a
filename, it promptly calls 'symbol_file_add_main_1' without waiting
to see if there are other args on the line. This only affects the
'-readnow' argument so far, but while implementing the '-readnever'
command it also affected it.
gdb/ChangeLog:
2017-11-29 Sergio Durigan Junior <sergiodj@redhat.com>
* symfile.c (symbol_file_command): Call
'symbol_file_add_main_1' only after processing all command
line options.
---
gdb/symfile.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 4bbe0b5a62..9565570734 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1634,14 +1634,13 @@ symbol_file_command (const char *args, int from_tty)
else if (*arg == '-')
error (_("unknown option `%s'"), arg);
else
- {
- symbol_file_add_main_1 (arg, add_flags, flags);
- name = arg;
- }
+ name = arg;
}
if (name == NULL)
error (_("no symbol file name was specified"));
+
+ symbol_file_add_main_1 (arg, add_flags, flags);
}
}
--
2.13.3