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) {
|
string demangleFunctionName(string mangledName) {
|
||||||
if (!fn)
|
import std.ascii;
|
||||||
return fn;
|
if (!mangledName)
|
||||||
if (!fn.startsWith("_D"))
|
return mangledName;
|
||||||
return fn;
|
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.demangle;
|
||||||
import std.ascii;
|
import std.ascii;
|
||||||
//import core.demangle : Demangle;
|
//import core.demangle : Demangle;
|
||||||
|
@ -72,7 +78,7 @@ string demangleFunctionName(string fn) {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// cannot demangle
|
// cannot demangle
|
||||||
Log.v("Failed to demangle " ~ fn[0..i]);
|
Log.v("Failed to demangle " ~ fn[0..i]);
|
||||||
return fn;
|
return mangledName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue