digitalmars.D - mangle
- Ellery Newcomer (8/8) Jul 01 2010 test.o: In function
- Adam Ruppe (1/1) Jul 01 2010 http://dpldocs.info/std.demangle
- Ellery Newcomer (10/11) Jul 02 2010 import std.demangle;
- Rory McGuire (7/18) Jul 02 2010 Perhaps make one or fix the std one. The mangle definition seems to be i...
- Jacob Carlborg (9/19) Jul 03 2010 std.demangle is incomplete, missing newer D2 features like return by
- Brad Roberts (5/27) Jul 05 2010 Obviously any failures to demangle symbols produced by the compiler is a...
- Jacob Carlborg (4/31) Jul 06 2010 Already filed, issue 4323 and 3334.
- Jonathan M Davis (9/9) Jul 01 2010 By the way, why _does_ D mangle its names? What's the advantage? I under...
- Rainer Deyke (4/13) Jul 01 2010 Because DMD is stuck with a C-age linker.
- Jonathan M Davis (7/19) Jul 01 2010 Well, I guess that it just goes to show how little I understand about ex...
- Rainer Deyke (7/15) Jul 01 2010 That, and to allow for overloaded functions, functions with the same
- Leandro Lucarella (15/29) Jul 02 2010 You can use fully qualified names, like:
- Justin Spahr-Summers (6/28) Jul 01 2010 C doesn't require mangling because functions can't be overloaded. To
- Steven Schveighoffer (9/46) Jul 02 2010 This isn't really the reason for "mangling". The issue is that the C
- Norbert Nemec (4/10) Jul 02 2010 Perhaps this limitation could be removed in the C linker? Why not allow
- Justin Spahr-Summers (5/59) Jul 04 2010 Right, but that's only an issue because of overloaded types. C suffers
- Leandro Lucarella (10/10) Jul 04 2010 What about including a demangling tool in the DMD distribution? That
- Don (2/5) Jul 11 2010 There's std.demangle. It just has bugs.
test.o: In function `_D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover': test.d:(.text._D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ 1RandomCover+0x69): undefined reference to `_D3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngine4saveMFNdZS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngine' collect2: ld returned 1 exit status --- errorlevel 1 err, could someone point me to a decent demangler?
Jul 01 2010
On 07/01/2010 08:16 PM, Adam Ruppe wrote:http://dpldocs.info/std.demangleimport std.demangle; import std.stdio; void main(){ writeln(demangle("_D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover")); } gives _D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover There wouldn't happen to be any other demanglers about, would there?
Jul 02 2010
On Fri, 02 Jul 2010 18:17:03 +0200, Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:On 07/01/2010 08:16 PM, Adam Ruppe wrote:Perhaps make one or fix the std one. The mangle definition seems to be in mtype.c:193 and in template.c:4480 there is genIdent which seems to generate the template identifier not sure though (Just had a quick look for the 'V' char in the mangled symbol you have here). -Roryhttp://dpldocs.info/std.demangleimport std.demangle; import std.stdio; void main(){ writeln(demangle("_D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover")); } gives _D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover There wouldn't happen to be any other demanglers about, would there?
Jul 02 2010
On 2010-07-02 18.17, Ellery Newcomer wrote:On 07/01/2010 08:16 PM, Adam Ruppe wrote:std.demangle is incomplete, missing newer D2 features like return by reference, and incorrectly handles floating point numbers in tempaltes. If it encounters something it can't demangle it will just return the original mangled name.http://dpldocs.info/std.demangleimport std.demangle; import std.stdio; void main(){ writeln(demangle("_D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover")); } gives _D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCoverThere wouldn't happen to be any other demanglers about, would there?You could try the one in tango but I wouldn't think you have any more luck with that one. -- Jacob Carlborg
Jul 03 2010
On 7/3/2010 11:34 AM, Jacob Carlborg wrote:On 2010-07-02 18.17, Ellery Newcomer wrote:Obviously any failures to demangle symbols produced by the compiler is a bug and should be treated as such.. so.. please file 'em. Thanks, BradOn 07/01/2010 08:16 PM, Adam Ruppe wrote:std.demangle is incomplete, missing newer D2 features like return by reference, and incorrectly handles floating point numbers in tempaltes. If it encounters something it can't demangle it will just return the original mangled name.http://dpldocs.info/std.demangleimport std.demangle; import std.stdio; void main(){ writeln(demangle("_D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover")); } gives _D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover
Jul 05 2010
On 2010-07-06 07.21, Brad Roberts wrote:On 7/3/2010 11:34 AM, Jacob Carlborg wrote:Already filed, issue 4323 and 3334. -- Jacob CarlborgOn 2010-07-02 18.17, Ellery Newcomer wrote:Obviously any failures to demangle symbols produced by the compiler is a bug and should be treated as such.. so.. please file 'em. Thanks, BradOn 07/01/2010 08:16 PM, Adam Ruppe wrote:std.demangle is incomplete, missing newer D2 features like return by reference, and incorrectly handles floating point numbers in tempaltes. If it encounters something it can't demangle it will just return the original mangled name.http://dpldocs.info/std.demangleimport std.demangle; import std.stdio; void main(){ writeln(demangle("_D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover")); } gives _D3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover4saveMFNdZS3std6random156__T11RandomCoverTAiTS3std6random98__T21MersenneTwisterEngineTkVi32Vi624Vi397Vi31Vk2567483615Vi11Vi7Vk2636928640Vi15Vk4022730752Vi18Z21MersenneTwisterEngineZ11RandomCover
Jul 06 2010
By the way, why _does_ D mangle its names? What's the advantage? I understood that C++ does it because it was forced to back in the days when it was transformed into C code during compilation but that it's now generally considered a legacy problem that we're stuck with rather than something that would still be considered a good design decision. So, why did D go with name mangling? It certainly makes stuff like stack traces harder to deal with. I've never heard of any advantage to name mangling, only disadvantages. - Jonathan M Davis
Jul 01 2010
On 7/1/2010 19:32, Jonathan M Davis wrote:By the way, why _does_ D mangle its names? What's the advantage? I understood that C++ does it because it was forced to back in the days when it was transformed into C code during compilation but that it's now generally considered a legacy problem that we're stuck with rather than something that would still be considered a good design decision. So, why did D go with name mangling? It certainly makes stuff like stack traces harder to deal with. I've never heard of any advantage to name mangling, only disadvantages.Because DMD is stuck with a C-age linker. -- Rainer Deyke - rainerd eldwood.com
Jul 01 2010
On Thursday, July 01, 2010 19:13:02 Rainer Deyke wrote:On 7/1/2010 19:32, Jonathan M Davis wrote:Well, I guess that it just goes to show how little I understand about exactly how linking works when I don't understand what that means. After all, C doesn't using name mangling. Does that mean that name mangling it meant as a namespacing tool to ensure that no D function could possibly have the same linking name as a C function? - Jonathan M DavisBy the way, why _does_ D mangle its names? What's the advantage? I understood that C++ does it because it was forced to back in the days when it was transformed into C code during compilation but that it's now generally considered a legacy problem that we're stuck with rather than something that would still be considered a good design decision. So, why did D go with name mangling? It certainly makes stuff like stack traces harder to deal with. I've never heard of any advantage to name mangling, only disadvantages.Because DMD is stuck with a C-age linker.
Jul 01 2010
On 7/1/2010 20:34, Jonathan M Davis wrote:On Thursday, July 01, 2010 19:13:02 Rainer Deyke wrote:That, and to allow for overloaded functions, functions with the same name in different modules, and member functions. Each symbol with external linkage must map to a single unique identifier. The concerns are exactly the same as those in C++. -- Rainer Deyke - rainerd eldwood.comBecause DMD is stuck with a C-age linker.Well, I guess that it just goes to show how little I understand about exactly how linking works when I don't understand what that means. After all, C doesn't using name mangling. Does that mean that name mangling it meant as a namespacing tool to ensure that no D function could possibly have the same linking name as a C function?
Jul 01 2010
Rainer Deyke, el 1 de julio a las 20:59 me escribiste:On 7/1/2010 20:34, Jonathan M Davis wrote:You can use fully qualified names, like: p1.m1.f1(int, float) p1.m1.f1(charp[]) p2.m2.f1(int, float) I don't know if that names are supported by the linker. -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- Come on, now, I hear you're feeling down. Well I can ease your pain Get you on your feet again.On Thursday, July 01, 2010 19:13:02 Rainer Deyke wrote:That, and to allow for overloaded functions, functions with the same name in different modules, and member functions. Each symbol with external linkage must map to a single unique identifier. The concerns are exactly the same as those in C++.Because DMD is stuck with a C-age linker.Well, I guess that it just goes to show how little I understand about exactly how linking works when I don't understand what that means. After all, C doesn't using name mangling. Does that mean that name mangling it meant as a namespacing tool to ensure that no D function could possibly have the same linking name as a C function?
Jul 02 2010
On Thu, 1 Jul 2010 19:34:09 -0700, Jonathan M Davis <jmdavisprog gmail.com> wrote:On Thursday, July 01, 2010 19:13:02 Rainer Deyke wrote:C doesn't require mangling because functions can't be overloaded. To make D (or C++) compatible with C linkers, symbol names need to be unique, so functions with identical names but different types need to be represented with different symbols.On 7/1/2010 19:32, Jonathan M Davis wrote:Well, I guess that it just goes to show how little I understand about exactly how linking works when I don't understand what that means. After all, C doesn't using name mangling. Does that mean that name mangling it meant as a namespacing tool to ensure that no D function could possibly have the same linking name as a C function? - Jonathan M DavisBy the way, why _does_ D mangle its names? What's the advantage? I understood that C++ does it because it was forced to back in the days when it was transformed into C code during compilation but that it's now generally considered a legacy problem that we're stuck with rather than something that would still be considered a good design decision. So, why did D go with name mangling? It certainly makes stuff like stack traces harder to deal with. I've never heard of any advantage to name mangling, only disadvantages.Because DMD is stuck with a C-age linker.
Jul 01 2010
On Thu, 01 Jul 2010 23:03:31 -0400, Justin Spahr-Summers <Justin.SpahrSummers gmail.com> wrote:On Thu, 1 Jul 2010 19:34:09 -0700, Jonathan M Davis <jmdavisprog gmail.com> wrote:This isn't really the reason for "mangling". The issue is that the C linker requires symbols to be the same as source symbols. That is, made up only of A-Z,a-z,0-9 and _. I'd much rather see symbol names like this: foo(int,string) than fooIvS45whatever -SteveOn Thursday, July 01, 2010 19:13:02 Rainer Deyke wrote:C doesn't require mangling because functions can't be overloaded. To make D (or C++) compatible with C linkers, symbol names need to be unique, so functions with identical names but different types need to be represented with different symbols.On 7/1/2010 19:32, Jonathan M Davis wrote:daysBy the way, why _does_ D mangle its names? What's the advantage? I understood that C++ does it because it was forced to back in theit's nowwhen it was transformed into C code during compilation but thatthangenerally considered a legacy problem that we're stuck with ratherstacksomething that would still be considered a good design decision. So, why did D go with name mangling? It certainly makes stuff likenametraces harder to deal with. I've never heard of any advantage toWell, I guess that it just goes to show how little I understand about exactly how linking works when I don't understand what that means. After all, C doesn't using name mangling. Does that mean that name mangling it meant as a namespacing tool to ensure that no D function could possibly have the same linking name as a C function? - Jonathan M Davismangling, only disadvantages.Because DMD is stuck with a C-age linker.
Jul 02 2010
On 02/07/10 13:41, Steven Schveighoffer wrote:This isn't really the reason for "mangling". The issue is that the C linker requires symbols to be the same as source symbols. That is, made up only of A-Z,a-z,0-9 and _. I'd much rather see symbol names like this: foo(int,string) than fooIvS45whateverPerhaps this limitation could be removed in the C linker? Why not allow arbitrary strings as symbols in a modern implementation? I could well imagine that this could be realized in some extension of the standard?
Jul 02 2010
On Fri, 02 Jul 2010 08:41:45 -0400, Steven Schveighoffer <schveiguy yahoo.com> wrote:On Thu, 01 Jul 2010 23:03:31 -0400, Justin Spahr-Summers <Justin.SpahrSummers gmail.com> wrote:Right, but that's only an issue because of overloaded types. C suffers no such problems because a symbol with a given name is guaranteed to be unique within the same translation unit.On Thu, 1 Jul 2010 19:34:09 -0700, Jonathan M Davis <jmdavisprog gmail.com> wrote:This isn't really the reason for "mangling". The issue is that the C linker requires symbols to be the same as source symbols. That is, made up only of A-Z,a-z,0-9 and _. I'd much rather see symbol names like this: foo(int,string) than fooIvS45whatever -SteveOn Thursday, July 01, 2010 19:13:02 Rainer Deyke wrote:C doesn't require mangling because functions can't be overloaded. To make D (or C++) compatible with C linkers, symbol names need to be unique, so functions with identical names but different types need to be represented with different symbols.On 7/1/2010 19:32, Jonathan M Davis wrote:daysBy the way, why _does_ D mangle its names? What's the advantage? I understood that C++ does it because it was forced to back in theit's nowwhen it was transformed into C code during compilation but thatthangenerally considered a legacy problem that we're stuck with ratherstacksomething that would still be considered a good design decision. So, why did D go with name mangling? It certainly makes stuff likenametraces harder to deal with. I've never heard of any advantage toWell, I guess that it just goes to show how little I understand about exactly how linking works when I don't understand what that means. After all, C doesn't using name mangling. Does that mean that name mangling it meant as a namespacing tool to ensure that no D function could possibly have the same linking name as a C function? - Jonathan M Davismangling, only disadvantages.Because DMD is stuck with a C-age linker.
Jul 04 2010
What about including a demangling tool in the DMD distribution? That would be helpful and avoid the DIY status we have now... -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- ¿Qué será lo que hace que una brújula siempre marque el norte? - Ser aguja, nada más, y cumplir su misión. -- Ricardo Vaporeso
Jul 04 2010
Leandro Lucarella wrote:What about including a demangling tool in the DMD distribution? That would be helpful and avoid the DIY status we have now...There's std.demangle. It just has bugs.
Jul 11 2010