This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] [2/2] .debug_gdb_scripts: defer main symfile auto-loading


On Tue, Apr 20, 2010 at 12:29 PM, Doug Evans <dje@google.com> wrote:
> On Tue, Apr 20, 2010 at 12:19 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>>
>> Doug> So this patch defers auto-loading of scripts in the main symfile
>> Doug> at startup until after ./.gdbinit has been sourced.
>>
>> This approach means that disabling auto-loading in ./.gdbinit will not
>> work. ?This seems like something that ought to be documented, at least.
>
> Or it could be done differently, e.g. set some other flag that
> disabled auto-loading and not touch the user-visible one.
>
>> Doug> +/* Load any auto-loaded scripts for OBJFILE. ?*/
>> Doug> +
>> Doug> +void
>> Doug> +load_auto_scripts_for_objfile (struct objfile *objfile)
>> Doug> +{
>> Doug> + ?auto_load_objfile_script (objfile, GDBPY_AUTO_FILE_NAME);
>> Doug> + ?auto_load_section_scripts (objfile, GDBPY_AUTO_SECTION_NAME);
>> Doug> ?}
>>
>> I suspect you need a dummy version of this function so that the
>> --disable-python case continues to work.
>
> Blech, I thought I had one. ?Must have been thinking of something else
> at the time.
>
> Thanks.
>

Here's what I checked in.

2010-04-23  Doug Evans  <dje@google.com>

        * 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.

Attachment: gdb-100423-defer-auto-load-2.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]