From ca3d9c111e6a9f1343bece432f5e6c6a2825e758 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 23 Jul 2026 16:01:06 -0400 Subject: [PATCH 1/4] Navigate double-clicked address literals in place when in current function OnTokenDoubleClicked opened every address-literal token (integer, possible address, code-relative) in a separate pane while debugging. When the target falls inside the function the user is already viewing, they most likely want to jump to it in place, so fall through to the default in-pane navigation in that case and only open a second pane for out-of-function targets. Closes #1136 Co-Authored-By: Claude Opus 4.8 (1M context) --- ui/uinotification.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ui/uinotification.cpp b/ui/uinotification.cpp index a9ad89bf..56a533c0 100644 --- a/ui/uinotification.cpp +++ b/ui/uinotification.cpp @@ -246,6 +246,26 @@ bool NotificationListener::OnTokenDoubleClicked(UIContext* context, ViewFrame* f // AddressDisplayToken is intentionally left out: those keep navigating in the current view. // NOTE: opening address-valued literals in a new pane is arguably a better default // and should probably become the standard behavior even outside of a debug session. + + // If the target lands inside the function the user is already looking at, they most + // likely want to jump to it in place rather than open a second pane. Fall through to + // the default double-click behavior (in-pane navigation) in that case. + auto func = location.getFunction(); + if (!func) + { + auto funcs = data->GetAnalysisFunctionsContainingAddress(location.getOffset()); + if (!funcs.empty()) + func = funcs[0]; + } + if (func) + { + for (const auto& range : func->GetAddressRanges()) + { + if ((token.addr >= range.start) && (token.addr < range.end)) + return false; + } + } + target = token.addr; haveTarget = true; } From 065d7421506a056b97c32f33e14afe8e386b82f4 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 23 Jul 2026 16:01:42 -0400 Subject: [PATCH 2/4] Intercept data symbol and string double-click to open in another pane OnTokenDoubleClicked ignored data symbol tokens (e.g. data_100003fa9) and inline string tokens, so they fell through to the default in-pane navigation. While a debug session is live, resolve the referenced address and open it in another pane instead, so the disassembly the user is looking at stays put. Closes #1137 Co-Authored-By: Claude Opus 4.8 (1M context) --- ui/uinotification.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/uinotification.cpp b/ui/uinotification.cpp index 56a533c0..e05e4550 100644 --- a/ui/uinotification.cpp +++ b/ui/uinotification.cpp @@ -269,6 +269,15 @@ bool NotificationListener::OnTokenDoubleClicked(UIContext* context, ViewFrame* f target = token.addr; haveTarget = true; } + else if (token.type == DataSymbolToken || token.type == StringToken) + { + // A data symbol (e.g. data_100003fa9) or an inline string. The default behavior + // navigates to it in the same view; while debugging we instead open it in another + // pane so the disassembly the user is looking at stays put. The referenced address is + // carried in the token's value (the address field is not populated for these tokens). + target = token.addrValid ? token.addr : token.token.value; + haveTarget = true; + } else if (token.type == RegisterToken) { // A raw register token: navigate to the address currently held in the register. From 46dd0c9f27cd0f6e06b94a7ff9e6f8299a521ac4 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 31 Jul 2026 14:37:31 -0400 Subject: [PATCH 3/4] Only navigate to the string token in the other pane when it is actually a string reference --- ui/uinotification.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ui/uinotification.cpp b/ui/uinotification.cpp index e05e4550..a70b540d 100644 --- a/ui/uinotification.cpp +++ b/ui/uinotification.cpp @@ -271,11 +271,18 @@ bool NotificationListener::OnTokenDoubleClicked(UIContext* context, ViewFrame* f } else if (token.type == DataSymbolToken || token.type == StringToken) { - // A data symbol (e.g. data_100003fa9) or an inline string. The default behavior + // A data symbol (e.g. data_100003fa9) or a string reference. The default behavior // navigates to it in the same view; while debugging we instead open it in another - // pane so the disassembly the user is looking at stays put. The referenced address is - // carried in the token's value (the address field is not populated for these tokens). - target = token.addrValid ? token.addr : token.token.value; + // pane so the disassembly the user is looking at stays put. + + if ((token.type == StringToken) && (token.token.context != StringReferenceTokenContext) + && (token.token.context != StringDataVariableTokenContext)) + return false; + + if (!token.addrValid) + return false; + + target = token.addr; haveTarget = true; } else if (token.type == RegisterToken) @@ -341,6 +348,5 @@ bool NotificationListener::OnTokenDoubleClicked(UIContext* context, ViewFrame* f return false; // Open the target in another pane so the disassembly the user is looking at stays put. - view->navigateOnOtherPane(target); - return true; + return view->navigateOnOtherPane(target); } From 1904843cf91d5931c7d18af3c963c6b3254fd32b Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 31 Jul 2026 16:00:01 -0400 Subject: [PATCH 4/4] Let the debugger eat the double click event if it tries to navigate but failed --- ui/uinotification.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/uinotification.cpp b/ui/uinotification.cpp index a70b540d..5645ce36 100644 --- a/ui/uinotification.cpp +++ b/ui/uinotification.cpp @@ -348,5 +348,6 @@ bool NotificationListener::OnTokenDoubleClicked(UIContext* context, ViewFrame* f return false; // Open the target in another pane so the disassembly the user is looking at stays put. - return view->navigateOnOtherPane(target); + view->navigateOnOtherPane(target); + return true; }