diff options
author | Chris Lattner <sabre@nondot.org> | 2010-06-08 16:52:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-06-08 16:52:24 +0000 |
commit | 30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c (patch) | |
tree | f70013106f6a461a14abcd71c65f48a95a2979a6 /lldb/source/Core/State.cpp | |
parent | 312c4c799da215b337f790fda330f70c4aa757cf (diff) | |
download | bcm5719-llvm-30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c.tar.gz bcm5719-llvm-30fdc8d841c9d24ac5f3d452b6ece84ee0ac991c.zip |
Initial checkin of lldb code from internal Apple repo.
llvm-svn: 105619
Diffstat (limited to 'lldb/source/Core/State.cpp')
-rw-r--r-- | lldb/source/Core/State.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/lldb/source/Core/State.cpp b/lldb/source/Core/State.cpp new file mode 100644 index 00000000000..cf9a8345818 --- /dev/null +++ b/lldb/source/Core/State.cpp @@ -0,0 +1,87 @@ +//===-- State.cpp -----------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/Core/State.h" + +using namespace lldb; +using namespace lldb_private; + +const char * +lldb_private::StateAsCString (StateType state) +{ + switch (state) + { + case eStateInvalid: return "Invalid"; + case eStateUnloaded: return "Unloaded"; + case eStateAttaching: return "Attaching"; + case eStateLaunching: return "Launching"; + case eStateStopped: return "Stopped"; + case eStateRunning: return "Running"; + case eStateStepping: return "Stepping"; + case eStateCrashed: return "Crashed"; + case eStateDetached: return "Detached"; + case eStateExited: return "Exited"; + case eStateSuspended: return "Suspended"; + } + static char unknown_state_string[64]; + snprintf(unknown_state_string, sizeof (unknown_state_string), "StateType = %i", state); + return unknown_state_string; +} + +bool +lldb_private::StateIsRunningState (StateType state) +{ + switch (state) + { + case eStateAttaching: + case eStateLaunching: + case eStateRunning: + case eStateStepping: + return true; + + case eStateDetached: + case eStateInvalid: + case eStateUnloaded: + case eStateStopped: + case eStateCrashed: + case eStateExited: + case eStateSuspended: + default: + break; + } + return false; +} + +bool +lldb_private::StateIsStoppedState (StateType state) +{ + switch (state) + { + case eStateInvalid: + case eStateAttaching: + case eStateLaunching: + case eStateRunning: + case eStateStepping: + case eStateDetached: + default: + break; + + case eStateUnloaded: + case eStateStopped: + case eStateCrashed: + case eStateExited: + case eStateSuspended: + return true; + } + return false; +} |