This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: MI tests: tolerate prototypes


> Daniel Jacobowitz <drow@mvista.com> writes:
> 
>> > Ah, by building `prototype'-style types for all the functions, even
>> > those declared without prototypes, and using the called-as types as
>> > the prototype argument types.  It'll work because, even though the
>> > type claims to be prototyped, the argument types are such that we end
>> > up doing the same promotions required by the rules for calling
>> > non-prototyped functions.
> 
>> 
>> So, the question becomes - do we need MAYBE_PROTOTYPED?  If we accept
>> that the types marked in stabs as parameters are promoted types, then
>> we can simply mark stabs functions as being prototyped, and trust
>> TYPE_FLAG_PROTOTYPED more than we do.
> 
> 
> If we do that, then:
> - Dwarf 2 will continue to work correctly, since its prototype info
>   has always been accurate,
> - under STABS, calls to functions whose definitions we have debug info
>   for will always work, unlike the current state of affairs, and 
> - under STABS, calls via function pointers will do non-prototyped
>   argument promotion, which is no worse than now.
> 
> Sounds good to me.
> 
> It does bother me, sort of on principle, that we won't really have
> info about which functions were declared in which way.  I mean,
> prototypedness is a real property of function types in ISO C.  But
> given that our debug format doesn't carry the info we need, I guess
> I'll just get over it. :)


Jim, my preference here is more along your proposal - have an explicit 
``prototype-unknown'' state.

 From memory the last time this came up I also suggested here that 
changing the default behavour across GDB is probably a good thing.  I 
don't think this is something that individual targets should be 
deciding.  Instead GDB should exibit consistent behavour across 
host/target combinations, the decision being made on the basis of the 
debug info.

enjoy,
Andrew




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]