digitalmars.D - Is std.demangle usable?
- Andrej Mitrovic (13/13) Dec 22 2010 import std.stdio;
- Andrej Mitrovic (15/30) Dec 22 2010 Okay, this works:
- Andrej Mitrovic (2/2) Dec 22 2010 It's really weird though, because I can only demangle a few names from
- Sean Kelly (1/1) Dec 22 2010 std.demangle is moderately broken. Use core.demangle instead. I meant ...
- Sean Kelly (2/3) Dec 22 2010 Okay, I'm about to check in this change. With it, demangle works on the...
- Andrej Mitrovic (8/12) Dec 22 2010 Thanks. It works for _D3 as well. But not all of them. I can demangle th...
- Brad Roberts (3/21) Dec 22 2010 Please file a bug against druntime with any symbols that it can't handle...
- Stanislav Blinov (5/18) Dec 23 2010 Do you mean it works with _D3 even for mangled name starting with
- Andrej Mitrovic (4/8) Dec 23 2010 I see. It does make reading the trace logs more difficult when some
- kenji hara (8/20) Dec 23 2010 I tested this issue.
- kenji hara (6/27) Dec 23 2010 Sorry, current dmd does't provide the mangled name from function symbol.
- Andrej Mitrovic (2/32) Dec 23 2010
import std.stdio; import std.demangle; import std.traits; void main() { void test() { } auto mystr = mangledName!(test); // ----------- demangle4mainFAAyaZv4testMFZv writeln(demangle(mystr)); // writes back demangle4mainFAAyaZv4testMFZv } Also, the example code is broken in http://www.digitalmars.com/d/2.0/phobos/std_demangle.html
Dec 22 2010
Okay, this works: import std.stdio; import std.demangle; import std.traits; void main() { void test() { } auto mystr = "_D3std5stdio4File17LockingTextWriter11__T3putTAaZ3putMFAaZv"; writeln(demangle(mystr)); // void std.stdio.File.LockingTextWriter.put!(char[]).put(char[]) } So maybe mangledName!() doesn't work properly. On 12/23/10, Andrej Mitrovic <none none.none> wrote:import std.stdio; import std.demangle; import std.traits; void main() { void test() { } auto mystr = mangledName!(test); // ----------- demangle4mainFAAyaZv4testMFZv writeln(demangle(mystr)); // writes back demangle4mainFAAyaZv4testMFZv } Also, the example code is broken in http://www.digitalmars.com/d/2.0/phobos/std_demangle.html
Dec 22 2010
It's really weird though, because I can only demangle a few names from a .log file when using -profile with DMD. Is this normal?
Dec 22 2010
std.demangle is moderately broken. Use core.demangle instead. I meant to have std.demangle call core.demangle for this release, but forgot to make the change.
Dec 22 2010
Sean Kelly Wrote:std.demangle is moderately broken. Use core.demangle instead. I meant to have std.demangle call core.demangle for this release, but forgot to make the change.Okay, I'm about to check in this change. With it, demangle works on the string you supplied provided it's prefixed with "_D8" or "D8". Simply having "demangle4mainFAAyaZv4testMFZv" isn't a complete symbol.
Dec 22 2010
On 12/23/10, Sean Kelly <sean invisibleduck.org> wrote:Okay, I'm about to check in this change. With it, demangle works on the string you supplied provided it's prefixed with "_D8" or "D8". Simply having "demangle4mainFAAyaZv4testMFZv" isn't a complete symbol.Thanks. It works for _D3 as well. But not all of them. I can demangle this: _D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFAyaZvble(char)[]) but not this: _D3std9algorithm28__T6reduceVAyaa5_61202b2062Z255__T6reduceTS3std9algorithm221__T3MapS723std10fu1B89DCD92D22D288E31BD77EB8883277 That one's from a trace log. I don't know why this name is mangled like that, though.void std.stdio.File.LockingTextWriter.put!(immutable(char)[]).put(immuta
Dec 22 2010
Please file a bug against druntime with any symbols that it can't handle. If you know the symbol name it should decode to, that'd help. On Thu, 23 Dec 2010, Andrej Mitrovic wrote:On 12/23/10, Sean Kelly <sean invisibleduck.org> wrote:Okay, I'm about to check in this change. With it, demangle works on the string you supplied provided it's prefixed with "_D8" or "D8". Simply having "demangle4mainFAAyaZv4testMFZv" isn't a complete symbol.Thanks. It works for _D3 as well. But not all of them. I can demangle this: _D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFAyaZvble(char)[]) but not this: _D3std9algorithm28__T6reduceVAyaa5_61202b2062Z255__T6reduceTS3std9algorithm221__T3MapS723std10fu1B89DCD92D22D288E31BD77EB8883277 That one's from a trace log. I don't know why this name is mangled like that, though.void std.stdio.File.LockingTextWriter.put!(immutable(char)[]).put(immuta
Dec 22 2010
23.12.2010 7:49, Andrej Mitrovic пишет:On 12/23/10, Sean Kelly<sean invisibleduck.org> wrote:Do you mean it works with _D3 even for mangled name starting with "demangle"? It shouldn't. 3 is a character count of the following name.Okay, I'm about to check in this change. With it, demangle works on the string you supplied provided it's prefixed with "_D8" or "D8". Simply having "demangle4mainFAAyaZv4testMFZv" isn't a complete symbol.Thanks. It works for _D3 as well. But not all of them. I can demangle this:_D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFAyaZvI beleive the hex part at the end is a hash that is used to mangle very long names.ble(char)[]) but not this: _D3std9algorithm28__T6reduceVAyaa5_61202b2062Z255__T6reduceTS3std9algorithm221__T3MapS723std10fu1B89DCD92D22D288E31BD77EB8883277 That one's from a trace log. I don't know why this name is mangled like that, though.void std.stdio.File.LockingTextWriter.put!(immutable(char)[]).put(immuta
Dec 23 2010
On 12/23/10, Stanislav Blinov <blinov loniir.ru> wrote:Do you mean it works with _D3 even for mangled name starting with "demangle"? It shouldn't. 3 is a character count of the following name.No, I meant without "demangle", so that's fine.I beleive the hex part at the end is a hash that is used to mangle very long names.I see. It does make reading the trace logs more difficult when some functions are demangled while others are not.
Dec 23 2010
I tested this issue. I think mangledName does not support nested function. I'll try to resolve it. Kenji Hara 2010/12/23 Andrej Mitrovic <none none.none>:import std.stdio; import std.demangle; import std.traits; void main() { =A0 =A0void test() =A0 =A0{ =A0 =A0} =A0 =A0auto mystr =3D mangledName!(test); // ----------- demangle4mainFAA=yaZv4testMFZv=A0 =A0writeln(demangle(mystr)); =A0 =A0 =A0 =A0// writes back demangle4m=ainFAAyaZv4testMFZv} Also, the example code is broken in http://www.digitalmars.com/d/2.0/phob=os/std_demangle.html
Dec 23 2010
Sorry, current dmd does't provide the mangled name from function symbol. see http://d.puremagic.com/issues/show_bug.cgi?id=3D2774 2010/12/24 kenji hara <k.hara.pg gmail.com>:I tested this issue. I think mangledName does not support nested function. I'll try to resolve it. Kenji Hara 2010/12/23 Andrej Mitrovic <none none.none>:AyaZv4testMFZvimport std.stdio; import std.demangle; import std.traits; void main() { =A0 =A0void test() =A0 =A0{ =A0 =A0} =A0 =A0auto mystr =3D mangledName!(test); // ----------- demangle4mainFA=mainFAAyaZv4testMFZv=A0 =A0writeln(demangle(mystr)); =A0 =A0 =A0 =A0// writes back demangle4=bos/std_demangle.html} Also, the example code is broken in http://www.digitalmars.com/d/2.0/pho=
Dec 23 2010
Okay, thanks for letting me know! On 12/23/10, kenji hara <k.hara.pg gmail.com> wrote:Sorry, current dmd does't provide the mangled name from function symbol. see http://d.puremagic.com/issues/show_bug.cgi?id=3D2774 2010/12/24 kenji hara <k.hara.pg gmail.com>:I tested this issue. I think mangledName does not support nested function. I'll try to resolve it. Kenji Hara 2010/12/23 Andrej Mitrovic <none none.none>:import std.stdio; import std.demangle; import std.traits; void main() { =A0 =A0void test() =A0 =A0{ =A0 =A0} =A0 =A0auto mystr =3D mangledName!(test); // ----------- demangle4mainFAAyaZv4testMFZv =A0 =A0writeln(demangle(mystr)); =A0 =A0 =A0 =A0// writes back demangle4mainFAAyaZv4testMFZv } Also, the example code is broken in http://www.digitalmars.com/d/2.0/phobos/std_demangle.html
Dec 23 2010