This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Add support for the --readnever command-line option (DWARF only)
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, Joel Brobecker <brobecker at adacore dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 23 Nov 2017 17:29:01 +0000
- Subject: Re: [PATCH v2] Add support for the --readnever command-line option (DWARF only)
- Authentication-results: sourceware.org; auth=none
- References: <1467838463-15786-1-git-send-email-brobecker@adacore.com> <CAH=s-PMEfPZKPEUPJyGe8skZYE-Th5AP_SSGwz0VSkmfb_Op0Q@mail.gmail.com> <d9cdbae0-3ccd-e1fd-c9ab-8da83114a97a@redhat.com> <87o9ntddb6.fsf_-_@redhat.com> <2cb6d01b-b40b-0a73-2df4-65f4e2094731@redhat.com> <87efoodi79.fsf@redhat.com>
On 11/23/2017 05:21 PM, Sergio Durigan Junior wrote:
>>> +This option is currently limited to debug information in DWARF format.
>>> +For all other format, this option has no effect.
>>
>> How hard would it be to just make it work? There's only stabs and mdebug
>> left, I think? There should be a single a function somewhere that we can
>> add an early return. And then we don't need to document this limitation...
>>
>> For example, in elf_symfile_read, we could just skip the elf_locate_sections
>> call. In coffread.c we could skip reading stabs right after
>> bfd_map_over_sections (abfd, coff_locate_sections....);
>>
>> Looking for:
>>
>> $ grep -h "^[a-z]*_build_psymtabs" gdb/
>> coffstab_build_psymtabs (struct objfile *objfile,
>> elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
>> stabsect_build_psymtabs (struct objfile *objfile, char *stab_name,
>> mdebug_build_psymtabs (minimal_symbol_reader &reader,
>> elfmdebug_build_psymtabs (struct objfile *objfile,
>>
>> finds all the relevant places.
>>
>> Maybe it wouldn't be that hard to make this be an objfile flag
>> afterall (like OBJF_READNOW is). That'd make it possible
>> to add the location "-readnever" counterpart switch to add-symbol-file
>> too, BTW:
I meant "logical" instead of "location". I was staring at
gdb/location.c at that time. :-P
>>
>> symfile.c: if (strcmp (arg, "-readnow") == 0)
>> symfile.c: else if (strcmp (arg, "-readnow") == 0)
>
> Hm, I'll look into this. Just to make it clear: the idea is to have
> both a --readnever global option and also a OBJF_READNEVER specific to
> each objfile?
Sure, the idea is to do something similar to what's done for --readnow.
Thanks,
Pedro Alves