Files
clang-p2996/lldb/include/lldb/Core/State.h
Greg Clayton 2637f82542 Fixed an issue with the pthread_setspecific() where we weren't NULL-ing out
the thread specific data and were destroying the thread specfic data more
than once.

Also added the ability to ask a lldb::StateType if it is stopped with an
additional paramter of "must_exist" which means that the state must be a
stopped state for a process that still exists. This means that eStateExited
and eStateUnloaded will no longer return true if "must_exist" is set to true.

llvm-svn: 144875
2011-11-17 01:23:07 +00:00

79 lines
2.6 KiB
C++

//===-- State.h -------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_State_h_
#define liblldb_State_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
namespace lldb_private {
//------------------------------------------------------------------
/// Converts a StateType to a C string.
///
/// @param[in] state
/// The StateType object to convert.
///
/// @return
/// A NULL terminated C string that describes \a state. The
/// returned string comes from constant string buffers and does
/// not need to be freed.
//------------------------------------------------------------------
const char *
StateAsCString (lldb::StateType state);
//------------------------------------------------------------------
/// Check if a state represents a state where the process or thread
/// is running.
///
/// @param[in] state
/// The StateType enumeration value
///
/// @return
/// \b true if the state represents a process or thread state
/// where the process or thread is running, \b false otherwise.
//------------------------------------------------------------------
bool
StateIsRunningState (lldb::StateType state);
//------------------------------------------------------------------
/// Check if a state represents a state where the process or thread
/// is stopped. Stopped can mean stopped when the process is still
/// around, or stopped when the process has exited or doesn't exist
/// yet. The \a must_exist argument tells us which of these cases is
/// desired.
///
/// @param[in] state
/// The StateType enumeration value
///
/// @param[in] must_exist
/// A boolean that indicates the thread must also be alive
/// so states like unloaded or exited won't return true.
///
/// @return
/// \b true if the state represents a process or thread state
/// where the process or thread is stopped. If \a must_exist is
/// \b true, then the process can't be exited or unloaded,
/// otherwise exited and unloaded or other states where the
/// process no longer exists are considered to be stopped.
//------------------------------------------------------------------
bool
StateIsStoppedState (lldb::StateType state, bool must_exist);
const char *
GetPermissionsAsCString (uint32_t permissions);
} // namespace lldb_private
#endif // liblldb_State_h_