This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: print_symbol_info patch for source code not current language
- To: Pierre Muller <muller at cerbere dot u-strasbg dot fr>
- Subject: Re: print_symbol_info patch for source code not current language
- From: Jim Blandy <jimb at cygnus dot com>
- Date: 29 Oct 1999 14:40:23 -0500
- Cc: gdb-patches at sourceware dot cygnus dot com
- References: <381824BF.BCE63370@cygnus.com><5mogdjbkr2.fsf@jtc.redbacknetworks.com><199910291101.NAA00678@cerbere.u-strasbg.fr>
> Using my pascal patched GDB
> with a executable that links both C and pascal code I noticed that
> all the functions where printed out using the current language,
> even if in automatic mode !!
> C functions printed out in pascal conventions are really uggly !!
> (And I don't say that because I prefer C,
> remember that I am a codevelopper of Free Pascal
> and that I started coding C just to be able to patch GDB !)
>
> Shouldn't we use the language of source if known at least if
> the current language mode is auto ??
>
> This short patch to symtab.c solve this problem
This looks good!
However, saving, setting, and restoring the current language is
somewhat messy. Note that the definition of type_print just calls
LA_PRINT_TYPE, which calls current_language->la_print_type. Your code
could simply determine the appropriate language, L, and then call
L->la_print_type directly, instead of print_type.
I don't know if it is possible for symbols to have language_auto as
their language. It is probably best to handle that case somehow, even
if it never arises.