[MI] -file-list-exec-source-files
Andrew Cagney
cagney@gnu.org
Tue Feb 17 20:27:00 GMT 2004
>> >2. -file-list-exec-fetch-fullname [filename]
>> >
>> > This will be a new MI command.
>> >
>> > This will return a fullname given a filename.
>> > If the symtab is read in, it calls source.c:symtab_to_filename.
>> > If the symtab is not read in, it reads it in and calls the above
>> > function.
>> >
>> > This function is necessary because all of the other MI commands still
>> > output just the filename and not the fullname. For example, breakpoints,
>> > stack, ...
>
>
> Yes, I guess it's a bug. However, these commands have never returned the
> fullname.
That's cos no one thought to point out the bug :-(
> Here you are making a big change to the way GDB deals with front ends.
> You are saying that GDB should only let the front end know about
> fullnames, and know nothing about filenames.
Both:
filename=...,fullname=...
should be output. That's where MI is ment to be upward compatible.
> I consider this desirable as a front end writer, since the fullname is
> the only valid unique key to a front end.
>
> It would be nice if I could do this in 2 phase's.
> First add this function, for backwards compatibility, and then, change
> all the existing commands to return fullnames.
I'd just fix the commands as each causes a problem as otherwize ...
> Although, leaving this function around, doesn't hurt anything.
... GDB would end up having to support that command :-(
>> >3. -file-list-exec-source-files [force_fullnames]
>> >
>> > This will implement an existing unimplemented MI command.
>> >
>> > By default, this will return
>> > 1. filename for each psymtab, with no fullname
>> > 2. filename/fullname for each symtab
>> >
>> > If the option "force_fullnames" is passed, it will have GDB convert all
>> > of the psymtabs to symtabs, thus printing out the filename/fullname for
>> > all symtabs. The overhead of doing this is probably high, and
>> > undesirable by default.
>> >
>> > If the front end wants to be more efficient, it could show the user the
>> > "filenames" and then do the "fullname" lookup just on that file. Thus,
>> > only reading in one symtab.
>
>>
>> This specification is too heavily dependent on GDB's current underlying
>> implementation - symtab and psymtab are internal details and do not
>> belong in this interface specification.
>
>
> I was just showing how this interface is affected by GDB's
> implementation of psymtab/symtab. The user will have no idea of these 2
> concepts.
>
> Anyways, if I can get the dirname into psymtab, this will no longer be an
> issue. The user will always get the filename/fullname combo.
>
> With that said, do you like the implementation?
I've not looked at it in detail.
Andrew
More information about the Gdb
mailing list