Bug 17304 – [SPEC] Anonymous symbols, show or ignore in demangler?
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-04-07T23:36:00Z
Last change time
2017-05-01T10:52:15Z
Assigned to
nobody
Creator
ibuclaw
Comments
Comment #0 by ibuclaw — 2017-04-07T23:36:41Z
Reduced-ish test:
---
template map(fun...) if (fun.length >= 1)
{
auto map(Range)(Range r)
{
return r;
}
}
unittest
{
import std.algorithm.mutation, std.string;
auto foo(string[] args)
{
return args.map!strip;
}
}
---
Emits the function:
_D9iteration29__T3mapS189iteration005stripZ13__T3mapTAAyaZ3mapFNaNbNiNfAAyaZAAya
Which falls under the following rule twice in the mangling ABI:
SymbolName:
0 // anonymous symbols
Current behaviour when the GNU binutils D demangler sees the 005, by mostly fluke, strtol() returns the number 5, which means the two anonymous symbols are skipped.
This seems to also be the case in the compiler also, as it doesn't should the internal symbol when compiling with `-v'.
However, should this be assumed the correct way to handle this symbol? If so I'll make it explicit.
Otherwise the alternative would be to demangle the symbol as `iteration.__anonymous.__anonymous.strip'.
Comment #1 by ibuclaw — 2017-04-07T23:38:16Z
> This seems to also be the case in the compiler also, as it doesn't should the internal symbol when compiling with `-v'.
As it doesn't *show* the internal symbol when compiling with `-v'.