1254721Semaste//===-- State.h -------------------------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_State_h_
11254721Semaste#define liblldb_State_h_
12254721Semaste
13254721Semaste// C Includes
14254721Semaste// C++ Includes
15254721Semaste// Other libraries and framework includes
16254721Semaste// Project includes
17254721Semaste#include "lldb/lldb-private.h"
18254721Semaste
19254721Semastenamespace lldb_private {
20254721Semaste
21254721Semaste//------------------------------------------------------------------
22254721Semaste/// Converts a StateType to a C string.
23254721Semaste///
24254721Semaste/// @param[in] state
25254721Semaste///     The StateType object to convert.
26254721Semaste///
27254721Semaste/// @return
28254721Semaste///     A NULL terminated C string that describes \a state. The
29254721Semaste///     returned string comes from constant string buffers and does
30254721Semaste///     not need to be freed.
31254721Semaste//------------------------------------------------------------------
32254721Semasteconst char *
33254721SemasteStateAsCString (lldb::StateType state);
34254721Semaste
35254721Semaste//------------------------------------------------------------------
36254721Semaste/// Check if a state represents a state where the process or thread
37254721Semaste/// is running.
38254721Semaste///
39254721Semaste/// @param[in] state
40254721Semaste///     The StateType enumeration value
41254721Semaste///
42254721Semaste/// @return
43254721Semaste///     \b true if the state represents a process or thread state
44254721Semaste///     where the process or thread is running, \b false otherwise.
45254721Semaste//------------------------------------------------------------------
46254721Semastebool
47254721SemasteStateIsRunningState (lldb::StateType state);
48254721Semaste
49254721Semaste//------------------------------------------------------------------
50254721Semaste/// Check if a state represents a state where the process or thread
51254721Semaste/// is stopped. Stopped can mean stopped when the process is still
52254721Semaste/// around, or stopped when the process has exited or doesn't exist
53254721Semaste/// yet. The \a must_exist argument tells us which of these cases is
54254721Semaste/// desired.
55254721Semaste///
56254721Semaste/// @param[in] state
57254721Semaste///     The StateType enumeration value
58254721Semaste///
59254721Semaste/// @param[in] must_exist
60254721Semaste///     A boolean that indicates the thread must also be alive
61254721Semaste///     so states like unloaded or exited won't return true.
62254721Semaste///
63254721Semaste/// @return
64254721Semaste///     \b true if the state represents a process or thread state
65254721Semaste///     where the process or thread is stopped. If \a must_exist is
66254721Semaste///     \b true, then the process can't be exited or unloaded,
67254721Semaste///     otherwise exited and unloaded or other states where the
68254721Semaste///     process no longer exists are considered to be stopped.
69254721Semaste//------------------------------------------------------------------
70254721Semastebool
71254721SemasteStateIsStoppedState (lldb::StateType state, bool must_exist);
72254721Semaste
73254721Semasteconst char *
74254721SemasteGetPermissionsAsCString (uint32_t permissions);
75254721Semaste
76254721Semaste} // namespace lldb_private
77254721Semaste
78254721Semaste#endif  // liblldb_State_h_
79