1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Improved callstack handling with inlined methods

This commit is contained in:
Brian Fiete 2022-05-30 15:43:49 -07:00
parent 75333a0928
commit f29a74888c
13 changed files with 151 additions and 28 deletions

View file

@ -2,8 +2,13 @@
[[Type]]
Name = "System.CallStackAddr"
DisplayString = "{__funcName(this), ne}"
Action = "ShowCodeAddr {(int)this,X}"
DisplayString = "{__funcName(this - 1), ne}"
Action = "ShowCodeAddr {(int)this - 1,X}"
[[Type]]
Name = "System.CallStackList"
DisplayString = "{__funcName(((int*)(int)this)[0] - 1), ne}"
[Type.Expand.CallStackList]
[[Type]]
Name = "System.DeferredCall"

View file

@ -260,7 +260,7 @@ namespace IDE.Debugger
static extern int32 CallStack_GetBreakStackFrameIdx();
[CallingConvention(.Stdcall),CLink]
static extern char8* Debugger_GetCodeAddrInfo(int addr, out int32 hotIdx, out int32 defLineStart, out int32 defLineEnd, out int32 line, out int32 column);
static extern char8* Debugger_GetCodeAddrInfo(int addr, int inlineCallAddr, out int32 hotIdx, out int32 defLineStart, out int32 defLineEnd, out int32 line, out int32 column);
[CallingConvention(.Stdcall),CLink]
static extern void Debugger_GetStackAllocInfo(int addr, out int threadId, int32* outStackIdx);
@ -940,14 +940,14 @@ namespace IDE.Debugger
return Debugger_GetStackFrameCalleeAddr(stackFrameIdx);
}
public void GetCodeAddrInfo(int addr, String outFile, out int hotIdx, out int defLineStart, out int defLineEnd, out int line, out int column)
public void GetCodeAddrInfo(int addr, int inlineCallAddr, String outFile, out int hotIdx, out int defLineStart, out int defLineEnd, out int line, out int column)
{
int32 hotIdxOut;
int32 lineOut;
int32 columnOut;
int32 defLineStartOut = -1;
int32 defLineEndOut = -1;
char8* locationStr = Debugger_GetCodeAddrInfo(addr, out hotIdxOut, out defLineStartOut, out defLineEndOut, out lineOut, out columnOut);
char8* locationStr = Debugger_GetCodeAddrInfo(addr, inlineCallAddr, out hotIdxOut, out defLineStartOut, out defLineEndOut, out lineOut, out columnOut);
hotIdx = hotIdxOut;
defLineStart = defLineStartOut;
defLineEnd = defLineEndOut;

View file

@ -1127,13 +1127,17 @@ namespace IDE
sourceViewPanel.RecordHistoryLocation();
int64 addr = int64.Parse(cmds[1], System.Globalization.NumberStyles.HexNumber).GetValueOrDefault();
int64 inlineCallAddr = 0;
if (cmds.Count >= 2)
inlineCallAddr = int64.Parse(cmds[2], System.Globalization.NumberStyles.HexNumber).GetValueOrDefault();
String fileName = scope String();
int lineNum = 0;
int column;
int hotIdx;
int defLineStart;
int defLineEnd;
mDebugger.GetCodeAddrInfo((int)addr, fileName, out hotIdx, out defLineStart, out defLineEnd, out lineNum, out column);
mDebugger.GetCodeAddrInfo((int)addr, (int)inlineCallAddr, fileName, out hotIdx, out defLineStart, out defLineEnd, out lineNum, out column);
if (fileName.Length > 0)
{
int showHotIdx = -1;