Re: [PATCH/RFC] faster language identification

Daniel Jacobowitz
2002-11-10T19:03:56Z

On Sun, Nov 10, 2002 at 05:01:25PM +0200, Elias Athanasopoulos wrote:
> Hi Michael,
>
> On Thu, Nov 07, 2002 at 12:55:47PM -0800, Michael Snyder wrote:
> > Elias Athanasopoulos wrote:
> > > On Thu, Nov 07, 2002 at 02:48:38PM -0500, Daniel Jacobowitz wrote:
> > > > No, the patch converts the psymtab to a symtab and uses the language in
> > > > the symtab. That's what I want you NOT to do. psymtab_to_symtab is
> > > > expensive!
> > Perhaps the patch could be added to psymtab_to_symtab,
> > so that it would not try to get the language until
> > the symbols were going to be read anyway?
>
> Yes, that may work, although I don't know exactly where gdb *really* needs
> to set the language.
>
> I was thinking of what Daniel proposed; a psymtab_language() function. But,
> even in the DWARF case, consider this:
>
> % gcc -Wa,-gdwarf2 bar.s foo.c -o foo
>
> Now, the language should be set to 'asm'? This is what you'll get if you try
> to parse the .debug_info section. Currently, gdb in the above case sets it
> to 'c'.
>
> Also, there is the case that you enable DWARF in both as and gcc, but I think
> this shouldn't be allowed by gcc.

Well, it _should_ be asm. We don't have line number information for
the .c source. IMHO.

(Also IMHO, the user just shouldn't do that...)

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer