Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions ui/uinotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,42 @@ 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;
}
else if (token.type == DataSymbolToken || token.type == StringToken)
Comment thread
xusheng6 marked this conversation as resolved.
{
// 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.

if ((token.type == StringToken) && (token.token.context != StringReferenceTokenContext)
&& (token.token.context != StringDataVariableTokenContext))
return false;

if (!token.addrValid)
return false;

target = token.addr;
haveTarget = true;
}
Expand Down