This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv2] Record objfile->original_name as an absolute path
- From: Doug Evans <dje at google dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 10 Oct 2013 09:31:22 -0700
- Subject: Re: [patchv2] Record objfile->original_name as an absolute path
- Authentication-results: sourceware.org; auth=none
- References: <yjt2zjr09xqr dot fsf at ruffy dot mtv dot corp dot google dot com> <20130926084713 dot GA11031 at host2 dot jankratochvil dot net> <20131009144629 dot GC27355 at host2 dot jankratochvil dot net> <CADPb22QC+HRc6fju=+s1mzGL1dkkRJ01N8JEAEJ6xzQ=qpu=Sw at mail dot gmail dot com> <20131010045819 dot GL3092 at adacore dot com>
On Wed, Oct 9, 2013 at 9:58 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> > +/* Cheezy hack to prevent set_initial_language from trying to look up main.
>> > + We do this so that gdb won't try to open the dwp file when the file is
>> > + first selected. This gives us a chance to do a chdir before attempting
>> > + to access the debug info. */
>> > +asm (".globl main.main");
>> > +asm ("main.main: .byte 0");
>> > +
>> > int
>> > main (int argc, char **argv)
>> > {
>>
>> People are actually ok with this?
>
> FWIW, I tend to be a little less demanding in the testsuite.
> But the first question is whether there is another alternative.
> Is there?
I was thinking,
We have auto-solib-add and sharedlibrary.
We just need something like that for symfile_objfile.
[I realize it's a bit different. What I mean is we need a way to stop
gdb from auto-loading symbols and then a command to load the symbols
at a later point. The catch here is that we need gdb to already know
about the file (we need to exercise whatever path gets set in the
objfile) - we just need to defer loading symbols until after we get
gdb to cd to a different directory.]
I'm trying to think of a use-case beyond the testsuite to better
justify having such a feature.
[One could do something to defer setting the initial language, but
that's just one reason why gdb might want to load symbols
immediately.]