A new debugger for Linux - would it work for D?

Bruno Medeiros brunodomedeiros+spam at com.gmail
Thu Nov 23 14:01:46 PST 2006


Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Frits van Bommel schrieb am 2006-11-23:
>> Bruno Medeiros wrote:
>>> Can we define functions that do not have D linkage, but have D name 
>>> mangling?
>> Not as far as I know.
>>
>>> If so, does that even make sense? It was my understanding that
>>> any function with linkage other than D is used for obj/lib/dll level 
>>> compatibility with other programs written in other languages (i.e., ABI 
>>> level compatibility). As such, these other languages don't understand D 
>>> name mangling but only C name mangling, so what's a non-D-linkage with 
>>> D-name-mangling for?
> 
> # extern(C) void outer(){
> #	void inner(){
> #	}
> # }
> 
> current mangling:
>> outer
>> outer5innerFZv
> 
> Don's proposal:
>> outer
>> 0U5outer5innerFZv
> 
> Thomas
> 
> 

Ah, got it. But in terms of calling convention, is outer.inner still of 
regular D calling convention? (I think so, given some obj2asm tests I did)

As for fixes, how about just mangling the inner function with a full D 
name mangling, treating the parent names as if they were D-mangled too?:
_D4modl4funcFZv5innerFZv
This way we (maybe) can't tell the calling convention of the parent 
functions... but does that matter?

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-announce mailing list