1 http://sourceware.org/ml/gdb-patches/2010-09/msg00365.html
2 Subject: [patch] python: load *-gdb.py for shlibs during attach
6 currently if you attach to or load a core file for executable, its -gdb.py
7 script is loaded. But none -gdb.py for the shared libraries.
9 Spawned or with the fix (libstdc++-gdb.py):
10 #1 0x00000000004007b5 in f (s="a") at 1.C:4
13 Attached/core without the fix:
14 #1 0x00000000004007b5 in f (s=...) at 1.C:4
16 No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
18 Mostly obvious, I will check it in later.
26 2010-09-22 Jan Kratochvil <jan.kratochvil@redhat.com>
28 * main.c: Include objfiles.h.
29 (captured_main): New variable objfile. Call
30 load_auto_scripts_for_objfile for ALL_OBJFILES.
32 --- ./gdb/main.c 2010-09-22 10:51:32.000000000 +0200
33 +++ ./gdb/main.c 2010-09-22 10:50:44.000000000 +0200
36 #include "cli/cli-cmds.h"
37 #include "python/python.h"
38 +#include "objfiles.h"
40 /* The selected interpreter. This will be used as a set command
41 variable, so it should always be malloc'ed - since
42 @@ -323,6 +324,7 @@ captured_main (void *data)
46 + struct objfile *objfile;
48 struct cleanup *pre_stat_chain = make_command_stats_cleanup (0);
50 @@ -957,8 +959,8 @@ Can't attach to process and specify a co
51 We wait until now because it is common to add to the source search
52 path in local_gdbinit. */
53 gdbpy_global_auto_load = save_auto_load;
54 - if (symfile_objfile != NULL)
55 - load_auto_scripts_for_objfile (symfile_objfile);
56 + ALL_OBJFILES (objfile)
57 + load_auto_scripts_for_objfile (objfile);
59 for (i = 0; i < ncmd; i++)