mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Implement MarkupLineNumberTable.DumpTable()
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
namespace Microsoft.Iris.Debug.Data;
|
||||||
|
|
||||||
|
public record struct MarkupLineNumberEntry(uint Offset, int Line, int Column);
|
||||||
@@ -69,6 +69,8 @@ namespace Microsoft.Iris.Markup
|
|||||||
bool wasInDebugState = false;
|
bool wasInDebugState = false;
|
||||||
bool debugging = Application.Debugger != null;
|
bool debugging = Application.Debugger != null;
|
||||||
|
|
||||||
|
context.LoadResult.LineNumberTable.DumpTable();
|
||||||
|
|
||||||
void OnDecode(InterpreterEntry entry)
|
void OnDecode(InterpreterEntry entry)
|
||||||
{
|
{
|
||||||
if (!debugging) return;
|
if (!debugging) return;
|
||||||
|
|||||||
@@ -4,20 +4,18 @@
|
|||||||
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
|
||||||
// Assembly location: C:\Program Files\Zune\UIX.dll
|
// Assembly location: C:\Program Files\Zune\UIX.dll
|
||||||
|
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace Microsoft.Iris.Markup
|
namespace Microsoft.Iris.Markup
|
||||||
{
|
{
|
||||||
public class MarkupLineNumberTable
|
public class MarkupLineNumberTable
|
||||||
{
|
{
|
||||||
private const ulong OFFSET_MASK = 4194303;
|
private const ulong OFFSET_MASK = 0x3F_FFFFUL;
|
||||||
private const uint OFFSET_MAX = 4194303;
|
private const uint OFFSET_MAX = 0x3F_FFFF;
|
||||||
private const ulong LINE_MASK = 8796088827904;
|
private const ulong LINE_MASK = 0x7FF_FFC0_0000UL;
|
||||||
private const int LINE_SHIFT = 22;
|
private const int LINE_SHIFT = 22;
|
||||||
private const uint LINE_MAX = 2097151;
|
private const uint LINE_MAX = 0x1F_FFFF;
|
||||||
private const ulong COLUMN_MASK = 18446735277616529408;
|
private const ulong COLUMN_MASK = 0xFFFF_F800_0000_0000UL;
|
||||||
private const int COLUMN_SHIFT = 43;
|
private const int COLUMN_SHIFT = 43;
|
||||||
private const uint COLUMN_MAX = 2097151;
|
private const uint COLUMN_MAX = 0x1F_FFFF;
|
||||||
private Vector<ulong> _lookupTable;
|
private Vector<ulong> _lookupTable;
|
||||||
private ulong[] _runtimeList;
|
private ulong[] _runtimeList;
|
||||||
|
|
||||||
@@ -64,17 +62,25 @@ namespace Microsoft.Iris.Markup
|
|||||||
|
|
||||||
internal ulong[] PersistList => _runtimeList;
|
internal ulong[] PersistList => _runtimeList;
|
||||||
|
|
||||||
[Conditional("DEBUG")]
|
public Vector<Debug.Data.MarkupLineNumberEntry> DumpTable()
|
||||||
public void DEBUG_DumpTable()
|
|
||||||
{
|
{
|
||||||
|
Vector<Debug.Data.MarkupLineNumberEntry> knownLines = new();
|
||||||
|
|
||||||
|
for (int index = 0; index < _runtimeList.Length; ++index)
|
||||||
|
{
|
||||||
|
var value = _runtimeList[index];
|
||||||
|
knownLines.Add(new(UnpackOffset(value), UnpackLine(value), UnpackColumn(value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return knownLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ulong Pack(uint offset, int line, int column) => (ulong)(offset | (long)line << 22 | (long)column << 43);
|
private static ulong Pack(uint offset, int line, int column) => (ulong)(offset | (long)line << LINE_SHIFT | (long)column << COLUMN_SHIFT);
|
||||||
|
|
||||||
private static uint UnpackOffset(ulong value) => (uint)(value & 0x3F_FFFFUL);
|
private static uint UnpackOffset(ulong value) => (uint)(value & OFFSET_MASK);
|
||||||
|
|
||||||
private static int UnpackLine(ulong value) => (int)((value & 0x7FF_FFC0_0000UL) >> 22);
|
private static int UnpackLine(ulong value) => (int)((value & LINE_MASK) >> LINE_SHIFT);
|
||||||
|
|
||||||
private static int UnpackColumn(ulong value) => (int)((value & 0xFFFF_F800_0000_0000UL) >> 43);
|
private static int UnpackColumn(ulong value) => (int)((value & COLUMN_MASK) >> COLUMN_SHIFT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user