mirror of https://github.com/buggins/dlangide.git
lldbmi2 support fixes; better demangling of strange corrupted symbols under DMD OSX
This commit is contained in:
parent
df2ecd5b41
commit
b12ced369a
|
@ -54,11 +54,17 @@ MIValue parseMI(string s) {
|
|||
}
|
||||
}
|
||||
|
||||
string demangleFunctionName(string fn) {
|
||||
if (!fn)
|
||||
return fn;
|
||||
if (!fn.startsWith("_D"))
|
||||
return fn;
|
||||
string demangleFunctionName(string mangledName) {
|
||||
import std.ascii;
|
||||
if (!mangledName)
|
||||
return mangledName;
|
||||
string fn = mangledName;
|
||||
if (!fn.startsWith("_D")) {
|
||||
// trying to fix strange corrupted mangling under OSX/dmd/lldb
|
||||
if (fn.length < 3 || fn[0]!='D' || !isDigit(fn[1]))
|
||||
return mangledName;
|
||||
fn = "_" ~ mangledName;
|
||||
}
|
||||
import std.demangle;
|
||||
import std.ascii;
|
||||
//import core.demangle : Demangle;
|
||||
|
@ -72,7 +78,7 @@ string demangleFunctionName(string fn) {
|
|||
} catch (Exception e) {
|
||||
// cannot demangle
|
||||
Log.v("Failed to demangle " ~ fn[0..i]);
|
||||
return fn;
|
||||
return mangledName;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue