forked from Imagelibrary/binutils-gdb
2001-01-26 Fernando Nasser <fnasser@redhat.com>
Fix double parsing of filenames passed as command line arguments
to GDB (causes weird handling of escape characters).
Also, remove dependencies on the CLI from libgdb.
* call-cmds.h: Remove declaration of exec_file_command().
* gdbcore.h: Remove declaration of exec_file_command().
Add declarations for exec_open() and exec_file_clear().
* symfile.h: Add declarations for symbol_file_add_main() and
symbol_file_clear().
* exec.c (exec_open): New function. Implements to_open for exec
targets.
(exec_file_clear): New function. Makes GDB forget about a previously
specified executable file.
(exec_file_attach): Move parsing of arguments from here ...
(exec_file_command): ... to here.
(init_exec_ops): Use exec_open(), not exec_file_command() to
implement to_open for exec targets.
* symfile.c (symbol_file_add_main): New function. Call symbol_file_add() with default values. Used when the file name has already been parsed.
(symbol_file_clear): New function. Makes GDB forget about previously
read symbols.
(symbol_file_command): Call the above function instead of inline code.
* main.c: Include "symfile.h" and "gdbcore.h" instead of the deprecated
"call-cmds.h".
(captured_main): Call exec_file_attach() and symbol_file_add_main()
instead of exec_file_command() and symbol_file_command().
(captured_main): Add comment.
* corefile.c: Include "symfile.h".
(core_file_command): Call symbol_file_add_main() instead of
symbol_file_command().
(reopen_exec_file): Call exec_open() instead of exec_file_command().
* infcmd.c: Include "symfile.h".
(attach_command): Call symbol_file_add_main() instead of
symbol_file_command().
* infrun.c: Remove comment about the inclusion of "symfile.h",
not any longer appropriate.
(follow_exec): Call symbol_file_add_main() instead of
symbol_file_command().
* remote-es.c: Include "symfile.h".
(es1800_load): Call symbol_file_add_main() instead of
symbol_file_command().
* remote-vx.c: Remove comment about the inclusion of "symfile.h",
not any longer appropriate.
(vx-wait): Call symbol_file_add_main() instead of
symbol_file_command().
* solib-svr4.c (open_symbol_file_object): Call symbol_file_add_main()
instead of symbol_file_command().
* v850ice.c (ice_file): Call exec_open(), exec_file_attach() and
symbol_file_add_main() instead of exec_file_command() and
symbol_file_command().
* Makefile.in: Update dependencies.
This commit is contained in:
12
gdb/main.c
12
gdb/main.c
@@ -22,7 +22,8 @@
|
||||
#include "top.h"
|
||||
#include "target.h"
|
||||
#include "inferior.h"
|
||||
#include "call-cmds.h"
|
||||
#include "symfile.h"
|
||||
#include "gdbcore.h"
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
@@ -474,6 +475,7 @@ extern int gdbtk_test (char *);
|
||||
execarg = argv[optind];
|
||||
break;
|
||||
case 2:
|
||||
/* FIXME: The documentation says this can be a "ProcID". as well. */
|
||||
corearg = argv[optind];
|
||||
break;
|
||||
case 3:
|
||||
@@ -592,15 +594,15 @@ extern int gdbtk_test (char *);
|
||||
/* The exec file and the symbol-file are the same. If we can't
|
||||
open it, better only print one error message.
|
||||
catch_command_errors returns non-zero on success! */
|
||||
if (catch_command_errors (exec_file_command, execarg, !batch, RETURN_MASK_ALL))
|
||||
catch_command_errors (symbol_file_command, symarg, 0, RETURN_MASK_ALL);
|
||||
if (catch_command_errors (exec_file_attach, execarg, !batch, RETURN_MASK_ALL))
|
||||
catch_command_errors (symbol_file_add_main, symarg, 0, RETURN_MASK_ALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (execarg != NULL)
|
||||
catch_command_errors (exec_file_command, execarg, !batch, RETURN_MASK_ALL);
|
||||
catch_command_errors (exec_file_attach, execarg, !batch, RETURN_MASK_ALL);
|
||||
if (symarg != NULL)
|
||||
catch_command_errors (symbol_file_command, symarg, 0, RETURN_MASK_ALL);
|
||||
catch_command_errors (symbol_file_add_main, symarg, 0, RETURN_MASK_ALL);
|
||||
}
|
||||
|
||||
/* After the symbol file has been read, print a newline to get us
|
||||
|
||||
Reference in New Issue
Block a user