mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 13:28:41 +00:00
This commit is contained in:
parent
972d87603d
commit
e099a451cc
2 changed files with 17 additions and 8 deletions
|
|
@ -89,11 +89,15 @@ namespace Cosmos.Debug.Common {
|
|||
mConnection.Open();
|
||||
var xSQL = new SQL(mConnection);
|
||||
|
||||
// Be careful with indexes, they slow down inserts. So on tables that we have a
|
||||
// lot of inserts, but limited look ups, dont add them.
|
||||
//
|
||||
// Labels
|
||||
// Labels is a big table. Avoid indexes when possible, because we need inserts to be fast.
|
||||
// -ADDRESS - Dont index - We dont look up on it very much
|
||||
// -LABELNAME - We do lookup a lot on this, but will change to asm line as key prob
|
||||
xSQL.MakeIndex("Labels", "Name", true);
|
||||
xSQL.MakeIndex("Methods", "DocumentID", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -102,6 +106,16 @@ namespace Cosmos.Debug.Common {
|
|||
}
|
||||
}
|
||||
|
||||
// The GUIDs etc are populated by the MSBuild task, so they wont be loaded when the debugger runs.
|
||||
// Because of this, we also allow manual loading.
|
||||
public void LoadLookups() {
|
||||
using (var xDB = DB()) {
|
||||
foreach (var xDoc in xDB.Documents) {
|
||||
DocumentGUIDs.Add(xDoc.Pathname, xDoc.ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public UInt32 AddressOfLabel(string aLabel) {
|
||||
using (var xDB = DB()) {
|
||||
var xRow = xDB.Labels.SingleOrDefault(q => q.Name == aLabel);
|
||||
|
|
@ -244,9 +258,8 @@ namespace Cosmos.Debug.Common {
|
|||
}
|
||||
|
||||
if (aFilterHiddenLines) {
|
||||
//xResult = xResult.Where(
|
||||
return xResult.Where(q => q.LineStart != 0xFEEFEE).ToArray();
|
||||
}
|
||||
|
||||
return xResult;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,21 +85,17 @@ namespace Cosmos.IL2CPU {
|
|||
//
|
||||
// This doesnt seem right to store as a field, but old code had it that way so we
|
||||
// continue using a field for now.
|
||||
mSequences = DebugInfo.GetSequencePoints(aMethod.MethodBase, false);
|
||||
mSequences = DebugInfo.GetSequencePoints(aMethod.MethodBase, true);
|
||||
if (mSequences.Length > 0) {
|
||||
DebugInfo.AddDocument(mSequences[0].Document);
|
||||
|
||||
if (mSequences[0].LineStart == 0xFEEFEE) {
|
||||
int i = 1;
|
||||
}
|
||||
|
||||
var xMethod = new Method() {
|
||||
TypeToken = aMethod.MethodBase.DeclaringType.MetadataToken,
|
||||
MethodToken = aMethod.MethodBase.MetadataToken,
|
||||
LabelName = xMethodLabel,
|
||||
AssemblyFileID = DebugInfo.AssemblyGUIDs[aMethod.MethodBase.DeclaringType.Assembly],
|
||||
DocumentID = DebugInfo.DocumentGUIDs[mSequences[0].Document],
|
||||
LineStart = mSequences[0].LineStart,
|
||||
LineStart = mSequences[0].LineStart,
|
||||
ColStart = mSequences[0].ColStart,
|
||||
LineEnd = mSequences[mSequences.Length - 1].LineEnd,
|
||||
ColEnd = mSequences[mSequences.Length - 1].ColEnd
|
||||
|
|
|
|||
Loading…
Reference in a new issue