mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
mono: Prefer trying to load portable PDBs generated by the modern roslyn compiler
This commit is contained in:
parent
f576adabd1
commit
5ff6d5f2a4
@ -106,21 +106,27 @@ namespace MCGalaxy.Scripting
|
|||||||
}
|
}
|
||||||
|
|
||||||
static byte[] GetDebugData(string path) {
|
static byte[] GetDebugData(string path) {
|
||||||
if (Server.RunningOnMono()) {
|
|
||||||
// Cmdtest.dll -> Cmdtest.dll.mdb
|
|
||||||
path += ".mdb";
|
|
||||||
} else {
|
|
||||||
// Cmdtest.dll -> Cmdtest.pdb
|
// Cmdtest.dll -> Cmdtest.pdb
|
||||||
path = Path.ChangeExtension(path, ".pdb");
|
string pdb_path = Path.ChangeExtension(path, ".pdb");
|
||||||
}
|
|
||||||
|
|
||||||
if (!File.Exists(path)) return null;
|
|
||||||
try {
|
try {
|
||||||
return File.ReadAllBytes(path);
|
return File.ReadAllBytes(pdb_path);
|
||||||
|
} catch (FileNotFoundException) {
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.LogError("Error loading .pdb " + path, ex);
|
Logger.LogError("Error loading .pdb " + pdb_path, ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Server.RunningOnMono()) return null;
|
||||||
|
|
||||||
|
// Cmdtest.dll -> Cmdtest.dll.mdb
|
||||||
|
string mdb_path = path + ".mdb";
|
||||||
|
try {
|
||||||
|
return File.ReadAllBytes(mdb_path);
|
||||||
|
} catch (FileNotFoundException) {
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.LogError("Error loading .mdb " + mdb_path, ex);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user