aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schulz <[email protected]>2025-06-04 09:35:01 +0200
committerDavid Schulz <[email protected]>2025-06-05 12:18:33 +0000
commit11aebabd54c42ad3c217eebb5d4563e6fa22ec5c (patch)
tree32b4cb3de6a5c184ebfae97772c766b56258762d
parent5be287e130ffaadbb374299492cfb1a8385a3ddb (diff)
Debugger: Avoid requesting unusable amount of disassembler
Limit the requested range of dissassembler to a sensible amount when trying to match the beginning of the requested range to the closest function. Especially if there is no debug information for the debugged binary the next known function might be completely unrelated and to far away, resulting in a huge disassemble output that is not very user friendly and potentially freezes or even crashes Qt Creator. Fixes: QTCREATORBUG-32764 Change-Id: I6173daa4aeb0a551f51c4a4ea47e4ce7acae2363 Reviewed-by: hjk <[email protected]>
-rw-r--r--src/plugins/debugger/cdb/cdbengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp
index e813c5c1839..be0a83b54f9 100644
--- a/src/plugins/debugger/cdb/cdbengine.cpp
+++ b/src/plugins/debugger/cdb/cdbengine.cpp
@@ -1363,7 +1363,7 @@ void CdbEngine::handleResolveSymbolHelper(const QList<quint64> &addresses, Disas
// We have an address from the agent, find closest.
if (const quint64 closest = findClosestFunctionAddress(addresses, agentAddress)) {
if (closest <= agentAddress) {
- functionAddress = closest;
+ functionAddress = std::max(closest, agentAddress - DisassemblerRange / 2);
endAddress = agentAddress + DisassemblerRange / 2;
}
}