Skip to content

Commit a71136f

Browse files
committed
fixup! src: implement JavaScript API
1 parent 6a1d7ad commit a71136f

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

src/llnode_api.cc

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <lldb/API/SBCommandReturnObject.h>
22
#include <lldb/API/SBCompileUnit.h>
33
#include <lldb/API/SBDebugger.h>
4+
#include <lldb/API/SBEvent.h>
45
#include <lldb/API/SBFileSpec.h>
56
#include <lldb/API/SBFrame.h>
67
#include <lldb/API/SBModule.h>
@@ -66,36 +67,7 @@ std::string LLNodeApi::GetProcessInfo() {
6667
uint32_t LLNodeApi::GetProcessID() { return process->GetProcessID(); }
6768

6869
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());
9971
}
10072

10173
uint32_t LLNodeApi::GetThreadCount() { return process->GetNumThreads(); }

0 commit comments

Comments
 (0)