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 namespace process_linux { 15 16 namespace impl { 17 extern bool SingleStepWorkaroundNeeded(); 18 } 19 20 // arm64 linux had a bug which prevented single-stepping and watchpoints from 21 // working on non-boot 22 // cpus, due to them being incorrectly initialized after coming out of suspend. 23 // This issue is 24 // particularly affecting android M, which uses suspend ("doze mode") quite 25 // aggressively. This 26 // code detects that situation and makes single-stepping work by doing all the 27 // 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 31 // be removed once 32 // these systems become obsolete. 33 inline bool SingleStepWorkaroundNeeded() { 34 static bool value = impl::SingleStepWorkaroundNeeded(); 35 return value; 36 } 37 } // end namespace process_linux 38 } // end namespace lldb_private 39 40 #endif // #ifndef liblldb_SingleStepCheck_H_ 41