You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
@@ -72,15 +72,22 @@ namespace Mono
|
||||
if (ilOffset < 0)
|
||||
return false;
|
||||
|
||||
SequencePoint sp = null;
|
||||
foreach (var instr in method.Body.Instructions) {
|
||||
if (instr.SequencePoint != null)
|
||||
sp = instr.SequencePoint;
|
||||
|
||||
if (instr.Offset >= ilOffset) {
|
||||
if (!method.DebugInformation.HasSequencePoints)
|
||||
return false;
|
||||
|
||||
SequencePoint prev = null;
|
||||
foreach (var sp in method.DebugInformation.SequencePoints.OrderBy (l => l.Offset)) {
|
||||
if (sp.Offset >= ilOffset) {
|
||||
sfData.SetLocation (sp.Document.Url, sp.StartLine);
|
||||
return true;
|
||||
}
|
||||
|
||||
prev = sp;
|
||||
}
|
||||
|
||||
if (prev != null) {
|
||||
sfData.SetLocation (prev.Document.Url, prev.StartLine);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@@ -27,7 +27,7 @@ CHECK_DIFF = @\
|
||||
$(MONO) $(TEST_EXE) > $(STACKTRACE_FILE); \
|
||||
$(MONO) $(LIB_PATH)/$(PROGRAM) $(MSYM_DIR) $(STACKTRACE_FILE) > $(SYMBOLICATE_RAW_FILE); \
|
||||
sed "s/) .* in .*\/mcs\//) in mcs\//" $(SYMBOLICATE_RAW_FILE) | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
|
||||
DIFF=$$(diff $(SYMBOLICATE_RESULT_FILE) $(SYMBOLICATE_EXPECTED_FILE)); \
|
||||
DIFF=$$(diff -up $(SYMBOLICATE_EXPECTED_FILE) $(SYMBOLICATE_RESULT_FILE)); \
|
||||
if [ ! -z "$$DIFF" ]; then \
|
||||
echo "Symbolicate tests failed."; \
|
||||
echo "If $(SYMBOLICATE_RESULT_FILE) is correct copy it to $(SYMBOLICATE_EXPECTED_FILE)."; \
|
||||
|
@@ -57,7 +57,7 @@ namespace Mono
|
||||
return null;
|
||||
}
|
||||
|
||||
assemblyPath = (exeFiles.Length > 0)? exeFiles[0] : dllFiles[0];
|
||||
assemblyPath = exeFiles.Length > 0 ? exeFiles[0] : dllFiles[0];
|
||||
|
||||
var locProvider = new AssemblyLocationProvider (assemblyPath, logger);
|
||||
|
||||
@@ -97,10 +97,13 @@ namespace Mono
|
||||
var dllFiles = Directory.GetFiles (dir, "*.dll");
|
||||
var assemblies = exeFiles.Concat (dllFiles);
|
||||
foreach (var assemblyPath in assemblies) {
|
||||
var mdbPath = assemblyPath + ".mdb";
|
||||
if (!File.Exists (mdbPath)) {
|
||||
logger.LogWarning ("Directory {0} contains {1} but no mdb {2}.", dir, Path.GetFileName (assemblyPath), Path.GetFileName (mdbPath));
|
||||
// assemblies without mdb files are useless
|
||||
|
||||
// TODO: Ignore embedded pdb
|
||||
var symbolFile = GetSymbolFile (assemblyPath);
|
||||
|
||||
if (symbolFile == null) {
|
||||
logger.LogWarning ("Directory {0} contains {1} but no debug symbols file was found.", dir, Path.GetFileName (assemblyPath));
|
||||
// assemblies without debug symbols are useless
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -112,7 +115,7 @@ namespace Mono
|
||||
if (Directory.Exists (mvidDir)) {
|
||||
try {
|
||||
Directory.Delete (mvidDir, true);
|
||||
} catch (DirectoryNotFoundException e) {}
|
||||
} catch (DirectoryNotFoundException) {}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory (mvidDir);
|
||||
@@ -120,12 +123,26 @@ namespace Mono
|
||||
var mvidAssemblyPath = Path.Combine (mvidDir, Path.GetFileName (assemblyPath));
|
||||
File.Copy (assemblyPath, mvidAssemblyPath);
|
||||
|
||||
var mvidMdbPath = Path.Combine (mvidDir, Path.GetFileName (mdbPath));
|
||||
File.Copy (mdbPath, mvidMdbPath);
|
||||
var mvidDebugPath = Path.Combine (mvidDir, Path.GetFileName (symbolFile));
|
||||
File.Copy (symbolFile, mvidDebugPath);
|
||||
|
||||
// TODO create MVID dir for non main modules with links to main module MVID
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static string GetSymbolFile (string assembly)
|
||||
{
|
||||
var pdbName = Path.ChangeExtension (assembly, "pdb");
|
||||
if (File.Exists (pdbName))
|
||||
return pdbName;
|
||||
|
||||
var mdbName = assembly + ".mdb";
|
||||
|
||||
if (File.Exists (mdbName))
|
||||
return mdbName;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user