|
1 | 1 | #include <lldb/API/SBCommandReturnObject.h> |
2 | 2 | #include <lldb/API/SBCompileUnit.h> |
3 | 3 | #include <lldb/API/SBDebugger.h> |
| 4 | +#include <lldb/API/SBEvent.h> |
4 | 5 | #include <lldb/API/SBFileSpec.h> |
5 | 6 | #include <lldb/API/SBFrame.h> |
6 | 7 | #include <lldb/API/SBModule.h> |
@@ -66,36 +67,7 @@ std::string LLNodeApi::GetProcessInfo() { |
66 | 67 | uint32_t LLNodeApi::GetProcessID() { return process->GetProcessID(); } |
67 | 68 |
|
68 | 69 | std::string LLNodeApi::GetProcessState() { |
69 | | - int state = process->GetState(); |
70 | | - |
71 | | - switch (state) { |
72 | | - case lldb::StateType::eStateInvalid: |
73 | | - return "invalid"; |
74 | | - case lldb::StateType::eStateUnloaded: |
75 | | - return "unloaded"; |
76 | | - case lldb::StateType::eStateConnected: |
77 | | - return "connected"; |
78 | | - case lldb::StateType::eStateAttaching: |
79 | | - return "attaching"; |
80 | | - case lldb::StateType::eStateLaunching: |
81 | | - return "launching"; |
82 | | - case lldb::StateType::eStateStopped: |
83 | | - return "stopped"; |
84 | | - case lldb::StateType::eStateRunning: |
85 | | - return "running"; |
86 | | - case lldb::StateType::eStateStepping: |
87 | | - return "stepping"; |
88 | | - case lldb::StateType::eStateCrashed: |
89 | | - return "crashed"; |
90 | | - case lldb::StateType::eStateDetached: |
91 | | - return "detached"; |
92 | | - case lldb::StateType::eStateExited: |
93 | | - return "exited"; |
94 | | - case lldb::StateType::eStateSuspended: |
95 | | - return "suspended"; |
96 | | - default: |
97 | | - return "unknown"; |
98 | | - } |
| 70 | + return debugger->StateAsCString(process->GetState()); |
99 | 71 | } |
100 | 72 |
|
101 | 73 | uint32_t LLNodeApi::GetThreadCount() { return process->GetNumThreads(); } |
|
0 commit comments