From 149d5f22ed95e6f4ff81a6cc9969525e4dbddf70 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 31 Mar 2025 08:58:14 -0400 Subject: [PATCH] BeefPerf '%p' support --- BeefTools/BeefPerf/src/BPApp.bf | 10 +++++++--- BeefTools/BeefPerf/src/BPClient.bf | 2 ++ BeefTools/BeefPerf/src/BpStateContext.bf | 6 ++++++ BeefTools/BeefPerf/src/PerfView.bf | 11 +++++++++++ BeefySysLib/util/BeefPerf.cpp | 17 +++++++++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/BeefTools/BeefPerf/src/BPApp.bf b/BeefTools/BeefPerf/src/BPApp.bf index 2b255562..f5d5d188 100644 --- a/BeefTools/BeefPerf/src/BPApp.bf +++ b/BeefTools/BeefPerf/src/BPApp.bf @@ -155,8 +155,9 @@ namespace BeefPerf LogLine(text); mFailed = true; - if (!mShuttingDown) - Shutdown(); + /*if (!mShuttingDown) + Shutdown();*/ + //Stop(); return; } @@ -647,7 +648,7 @@ namespace BeefPerf public override void UnhandledCommandLine(String key, String value) { - Fail(StackStringFormat!("Unhandled command line param: {0}", key)); + Fail(scope:: String()..AppendF("Unhandled command line param: {0}", key)); } void SetupNewWindow(WidgetWindow window) @@ -729,6 +730,9 @@ namespace BeefPerf public override void Update(bool batchStart) { + if (mFailed) + Stop(); + base.Update(batchStart); /*if (!mListenSocket.IsConnected) diff --git a/BeefTools/BeefPerf/src/BPClient.bf b/BeefTools/BeefPerf/src/BPClient.bf index 3e38662c..ca4cd5aa 100644 --- a/BeefTools/BeefPerf/src/BPClient.bf +++ b/BeefTools/BeefPerf/src/BPClient.bf @@ -1441,6 +1441,8 @@ namespace BeefPerf if (cNext == 'd') zoneName.mParamsSize += 4; + else if (cNext == 'p') + zoneName.mParamsSize += 8; else if (cNext == 'f') zoneName.mParamsSize += 4; else if (cNext == 's') diff --git a/BeefTools/BeefPerf/src/BpStateContext.bf b/BeefTools/BeefPerf/src/BpStateContext.bf index 236bc301..45ce7842 100644 --- a/BeefTools/BeefPerf/src/BpStateContext.bf +++ b/BeefTools/BeefPerf/src/BpStateContext.bf @@ -216,6 +216,12 @@ namespace BeefPerf Read(&val, 4); val.ToString(outStr); } + else if (cNext == 'p') + { + int64 val = 0; + Read(&val, 8); + val.ToString(outStr, "X", null); + } else if (cNext == 'f') { float val = 0; diff --git a/BeefTools/BeefPerf/src/PerfView.bf b/BeefTools/BeefPerf/src/PerfView.bf index e844201e..429d3424 100644 --- a/BeefTools/BeefPerf/src/PerfView.bf +++ b/BeefTools/BeefPerf/src/PerfView.bf @@ -767,6 +767,12 @@ namespace BeefPerf stateCtx.Read(&val, 4); val.ToString(str); } + else if (cNext == 'p') + { + int64 val = 0; + stateCtx.Read(&val, 8); + val.ToString(str, "X", null); + } else if (cNext == 'f') { float val = 0; @@ -2316,6 +2322,11 @@ namespace BeefPerf { switch (keyCode) { + case (KeyCode)'C': + if (DarkTooltipManager.sTooltip != null) + { + gApp.SetClipboardText(DarkTooltipManager.sTooltip.mText); + } case (KeyCode)'Z': mUndoManager.Undo(); case (KeyCode)'Y': diff --git a/BeefySysLib/util/BeefPerf.cpp b/BeefySysLib/util/BeefPerf.cpp index e1dae1c1..4bd150fb 100644 --- a/BeefySysLib/util/BeefPerf.cpp +++ b/BeefySysLib/util/BeefPerf.cpp @@ -430,6 +430,11 @@ void BpCmdTarget::Enter(const char* name, va_list args) intptr val = va_arg(args, intptr); paramSize += 4; // int32 } + else if (nextC == 'p') + { + intptr val = va_arg(args, intptr); + paramSize += 8; // int64 + } else if (nextC == 's') { const char* str = ToStrPtr(va_arg(args, char*)); @@ -488,6 +493,10 @@ void BpCmdTarget::Enter(const char* name, va_list args) { BPCMD_MEMBER(int32) = (int32)va_arg(args, intptr); } + else if (nextC == 'p') + { + BPCMD_MEMBER(int64) = (int64)va_arg(args, intptr); + } else if (nextC == 's') { const char* str = ToStrPtr(va_arg(args, char*)); @@ -1120,6 +1129,10 @@ void BpManager::ThreadProc() { zoneName->mSize += 4; } + else if (nextC == 'p') + { + zoneName->mSize += 8; + } else if (nextC == 's') { isDyn = true; @@ -1175,6 +1188,10 @@ void BpManager::ThreadProc() { checkDataIn += 4; } + else if (nextC == 'p') + { + checkDataIn += 8; + } else if (nextC == 's') { int len = (int)strlen((const char*)checkDataIn);