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
At 09:49 03/11/99 -0500, Jim Blandy wrote:
>
>> easy (its a fake one !)
>>
>> static int test(int a;double c);
>> would give
>> if pascal is current laguage in auto mode
>>
>> static int test(a : longint;c : double);
>>
>> The function syntax is C but thesyntax of args is the pascal one !!
>
>Yeah, that's what I was afraid of.
>
>This is a bug in GDB. There is no plausible reason to want to print
>the function using one language, and its arguments in a different
>language. Some piece of code is using current-language when it
>shouldn't. Could you track this down, and see where the inappropriate
>switch from C to Pascal occurs?
But this will not be easy I fear !
print_symbol_info calls
type_print
which in turn just uses
LA_PRINT_TYPE()
but the problem is that I am not sure that using source language would
be a good thing for
all calls to type_print !
I only thought this would be helpful for print_symbol_info
because there you can get several different sources.
But I would not like to have a
"p PASCAL_RECORD"
giving a pascal format if I am currently inside some C code
that uses a global pascal variable !
>I haven't actually looked at the code yet, though, so I don't know how
>easy it will be to fix. I have the feeling that C and C++ are sharing
>code in some ungodly fashion which will make this difficult to fix.
>
>> I really tried first your proposal and as I did not like the result
>> above I changed the method to what I sent you !
>
>I understand. But in situations like this it's important to fix the
>real bug, instead of kludging around it.
The problem is that even if the case of args of a function is quite clear
I suspect that in other cases it will no be so easy to decide
when we should use current_language and when
we should use the source file langage !
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99