MCPcopy Create free account
hub / github.com/chigraph/chigraph / Debugger

Method Debugger

libchigraphdebugger/src/Debugger.cpp:33–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace chi {
32
33Debugger::Debugger(const char* pathToChig, GraphModule& mod) : mModule{&mod} {
34// point it to lldb-server
35#if __linux__
36 auto lldbServerPath = fs::path(pathToChig).parent_path() / "lldb-server";
37 setenv("LLDB_DEBUGSERVER_PATH", lldbServerPath.c_str(), 1);
38#endif
39
40 lldb::SBDebugger::Initialize();
41 mDebugger = lldb::SBDebugger::Create();
42
43 // set the logger to stderr for testing
44 mDebugger.SetLoggingCallback(
45 [](const char* msg, void* dbg) {
46 std::cerr << msg;
47 std::cerr.flush();
48 },
49 this);
50
51 const char* val[] = {"api", nullptr};
52 mDebugger.EnableLog("lldb", val);
53
54 // create target
55 mTarget = mDebugger.CreateTarget(pathToChig);
56}
57
58Debugger::~Debugger() { lldb::SBDebugger::Terminate(); }
59

Callers

nothing calls this directly

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected