• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- State.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_State_h_
11 #define liblldb_State_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/lldb-private.h"
18 
19 namespace lldb_private {
20 
21 //------------------------------------------------------------------
22 /// Converts a StateType to a C string.
23 ///
24 /// @param[in] state
25 ///     The StateType object to convert.
26 ///
27 /// @return
28 ///     A NULL terminated C string that describes \a state. The
29 ///     returned string comes from constant string buffers and does
30 ///     not need to be freed.
31 //------------------------------------------------------------------
32 const char *
33 StateAsCString (lldb::StateType state);
34 
35 //------------------------------------------------------------------
36 /// Check if a state represents a state where the process or thread
37 /// is running.
38 ///
39 /// @param[in] state
40 ///     The StateType enumeration value
41 ///
42 /// @return
43 ///     \b true if the state represents a process or thread state
44 ///     where the process or thread is running, \b false otherwise.
45 //------------------------------------------------------------------
46 bool
47 StateIsRunningState (lldb::StateType state);
48 
49 //------------------------------------------------------------------
50 /// Check if a state represents a state where the process or thread
51 /// is stopped. Stopped can mean stopped when the process is still
52 /// around, or stopped when the process has exited or doesn't exist
53 /// yet. The \a must_exist argument tells us which of these cases is
54 /// desired.
55 ///
56 /// @param[in] state
57 ///     The StateType enumeration value
58 ///
59 /// @param[in] must_exist
60 ///     A boolean that indicates the thread must also be alive
61 ///     so states like unloaded or exited won't return true.
62 ///
63 /// @return
64 ///     \b true if the state represents a process or thread state
65 ///     where the process or thread is stopped. If \a must_exist is
66 ///     \b true, then the process can't be exited or unloaded,
67 ///     otherwise exited and unloaded or other states where the
68 ///     process no longer exists are considered to be stopped.
69 //------------------------------------------------------------------
70 bool
71 StateIsStoppedState (lldb::StateType state, bool must_exist);
72 
73 const char *
74 GetPermissionsAsCString (uint32_t permissions);
75 
76 } // namespace lldb_private
77 
78 #endif  // liblldb_State_h_
79