WIP
This commit is contained in:
24
src/backend/lldb/lldb_backend.cpp
Normal file
24
src/backend/lldb/lldb_backend.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "lldb_backend.h"
|
||||
#include <lldb/API/SBListener.h>
|
||||
#include <filesystem>
|
||||
|
||||
using namespace dbgui::backend;
|
||||
|
||||
LLDBBackend::~LLDBBackend() {
|
||||
|
||||
}
|
||||
|
||||
LLDBBackend::LLDBBackend(std::string filename) {
|
||||
_filename = filename;
|
||||
_instance = lldb::SBDebugger::Create(false);
|
||||
_target = _instance.CreateTarget(filename.c_str());
|
||||
}
|
||||
|
||||
void LLDBBackend::start() {
|
||||
const char* argv[2] = {_filename.c_str(), nullptr};
|
||||
const auto cwd = std::filesystem::current_path();
|
||||
|
||||
auto error = lldb::SBError();
|
||||
auto listener = lldb::SBListener();
|
||||
_process = _target.Launch(listener, argv, nullptr, nullptr, nullptr, nullptr, cwd.c_str(), lldb::LaunchFlags::eLaunchFlagNone, true, error);
|
||||
}
|
||||
Reference in New Issue
Block a user