This commit is contained in:
T0b1
2023-05-31 23:14:05 +02:00
commit d4bf6731a3
14 changed files with 548 additions and 0 deletions

View 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);
}