From 608fba645ccfc4639a142d03d4ac1101f784cb4a Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 23 Jul 2026 16:01:06 -0400 Subject: [PATCH 1/2] 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 1f35f972fc54471c117ed5fd983baf7aa7ea5c3a Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 23 Jul 2026 16:01:42 -0400 Subject: [PATCH 2/2] 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.