diff options
author | Doug Evans <dje@google.com> | 2010-04-23 18:09:16 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2010-04-23 18:09:16 +0000 |
commit | 88a1906b0da33e2905cce61e133b67cdde314847 (patch) | |
tree | 8aad3a1bd84d470955e81b5eb1c79efc3ff1f7dd /gdb/main.c | |
parent | 66d0954266e5613064244015f3963ea617463ecf (diff) | |
download | gdb-88a1906b0da33e2905cce61e133b67cdde314847.zip gdb-88a1906b0da33e2905cce61e133b67cdde314847.tar.gz gdb-88a1906b0da33e2905cce61e133b67cdde314847.tar.bz2 |
* configure.ac (CONFIG_SRCS): Add py-auto-load.o even if not using
python.
* configure: Regenerate.
* main.c: #include "python/python.h".
(captured_main): Defer loading auto-loaded scripts until after
local_gdbinit has been sourced.
* python/py-auto-load.c (gdbpy_global_auto_load): New global.
(load_auto_scripts_for_objfile): New function.
(auto_load_new_objfile): Call it.
* python/python.h (gdbpy_global_auto_load): Declare.
(load_auto_scripts_for_objfile): Declare.
Diffstat (limited to 'gdb/main.c')
-rw-r--r-- | gdb/main.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -41,6 +41,7 @@ #include "main.h" #include "source.h" #include "cli/cli-cmds.h" +#include "python/python.h" /* If nonzero, display time usage both at startup and for each command. */ @@ -291,6 +292,7 @@ captured_main (void *data) char *local_gdbinit; int i; + int save_auto_load; long time_at_startup = get_run_time (); @@ -798,6 +800,11 @@ Excess command line arguments ignored. (%s%s)\n"), catch_command_errors (directory_switch, dirarg[i], 0, RETURN_MASK_ALL); xfree (dirarg); + /* Skip auto-loading section-specified scripts until we've sourced + local_gdbinit (which is often used to augment the source search path). */ + save_auto_load = gdbpy_global_auto_load; + gdbpy_global_auto_load = 0; + if (execarg != NULL && symarg != NULL && strcmp (execarg, symarg) == 0) @@ -857,6 +864,14 @@ Can't attach to process and specify a core file at the same time.")); if (local_gdbinit && !inhibit_gdbinit) catch_command_errors (source_script, local_gdbinit, 0, RETURN_MASK_ALL); + /* Now that all .gdbinit's have been read and all -d options have been + processed, we can read any scripts mentioned in SYMARG. + We wait until now because it is common to add to the source search + path in local_gdbinit. */ + gdbpy_global_auto_load = save_auto_load; + if (symfile_objfile != NULL) + load_auto_scripts_for_objfile (symfile_objfile); + for (i = 0; i < ncmd; i++) { if (cmdarg[i].type == CMDARG_FILE) |