From 4f21e03d095684788ee61d98cfbb94dcca7b34dd Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 19 Mar 2016 16:19:08 -0400 Subject: [PATCH] Debugger: Avoid unnecessary work in ThreadHandler. ThreadHandler: - When stepping over a function call, ensure that we actually have a valid value for the stepped over function address before adding a return value info entry. While this had no visible adverse effect, it did result in unnecessary work when creating the list of variables to display later, since such entries would have no valid function to resolve to, and thus had to be ignored/thrown away. --- src/apps/debugger/controllers/ThreadHandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/debugger/controllers/ThreadHandler.cpp b/src/apps/debugger/controllers/ThreadHandler.cpp index fd5d228de5..c178a52db7 100644 --- a/src/apps/debugger/controllers/ThreadHandler.cpp +++ b/src/apps/debugger/controllers/ThreadHandler.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2010-2015, Rene Gollent, rene@gollent.com. + * Copyright 2010-2016, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -720,8 +720,8 @@ ThreadHandler::_HandleBreakpointHitStep(CpuState* cpuState) } } - if (fPreviousFrameAddress != 0 && fSteppedOverFunctionAddress - != cpuState->InstructionPointer()) { + if (fPreviousFrameAddress != 0 && fSteppedOverFunctionAddress != 0 + && fSteppedOverFunctionAddress != cpuState->InstructionPointer()) { TRACE_CONTROL("STEP_OVER: called function address %#" B_PRIx64 ", previous frame address: %#" B_PRIx64 ", frame address: %#" B_PRIx64 ", adding return info\n", fSteppedOverFunctionAddress,