1 //===-- SingleStepCheck.h ------------------------------------- -*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_SingleStepCheck_H_ 11 #define liblldb_SingleStepCheck_H_ 12 13 namespace lldb_private 14 { 15 namespace process_linux 16 { 17 18 namespace impl 19 { 20 extern bool 21 SingleStepWorkaroundNeeded(); 22 } 23 24 // arm64 linux had a bug which prevented single-stepping and watchpoints from working on non-boot 25 // cpus, due to them being incorrectly initialized after coming out of suspend. This issue is 26 // particularly affecting android M, which uses suspend ("doze mode") quite aggressively. This 27 // code detects that situation and makes single-stepping work by doing all the step operations on 28 // the boot cpu. 29 // 30 // The underlying issue has been fixed in android N and linux 4.4. This code can be removed once 31 // these systems become obsolete. 32 inline bool 33 SingleStepWorkaroundNeeded() 34 { 35 static bool value = impl::SingleStepWorkaroundNeeded(); 36 return value; 37 } 38 } // end namespace process_linux 39 } // end namespace lldb_private 40 41 #endif // #ifndef liblldb_SingleStepCheck_H_ 42