From ae29d39570cacf4c82590162a26d89bacbb6d8d3 Mon Sep 17 00:00:00 2001 From: Chaoren Lin Date: Tue, 3 Feb 2015 01:50:46 +0000 Subject: llgs: fix up some handling of stepping. Tracked down while working on https://github.com/tfiala/lldb/issues/75. This is not a complete fix for that issue, but moves us farther along. Fixes: * When a thread step is requested via vCont:{s,S}, Resume() now marks the stepping thread as (1) currently stepping and (2) does trigger the deferred signal for the stepped thread. This fixes a bug where we were actually triggering a deferred stop cycle here for the non-stepping thread since the single step thread was not part of the Resume() deferred signal mechanism. The stepping thread is also marked in the thread state coordinator as running (via a resume callback). * When we get the SIGTRAP signal for the step completion, we don't do a deferred signal call - that happened during the vCont:{s,S} processing in Resume() already. Now we just need to mark that the stepping thread is now stopped. If this is the last thread in the set that needs to stop, it will trigger the process/delegate stop call that will notify lldb. Otherwise, that'll happen when the final thead we're waiting for stops. Misc: * Fixed up thread stop logging to use a leading 0 (0x%PRIx32) so we don't get log lines like 0x5 for 0x05 SIGTRAP. llvm-svn: 227911 --- lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index c237b8d6a121..f5cbe23ec45b 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -39,10 +39,10 @@ namespace switch (stop_info.reason) { case eStopReasonSignal: - log.Printf ("%s: %s signal 0x%" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo); + log.Printf ("%s: %s signal 0x%02" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo); return; case eStopReasonException: - log.Printf ("%s: %s exception type 0x%" PRIx64, __FUNCTION__, header, stop_info.details.exception.type); + log.Printf ("%s: %s exception type 0x%02" PRIx64, __FUNCTION__, header, stop_info.details.exception.type); return; case eStopReasonExec: log.Printf ("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo); -- cgit v1.2.3