regs and we can step into!
This commit is contained in:
@@ -5,19 +5,55 @@
|
||||
#include <lldb/API/SBTarget.h>
|
||||
#include <lldb/API/SBProcess.h>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
namespace dbgui::backend {
|
||||
struct LLDBBackend : Backend {
|
||||
// TODO: source_init_file: false
|
||||
LLDBBackend(std::string filename);
|
||||
virtual ~LLDBBackend();
|
||||
namespace dbgui::backend
|
||||
{
|
||||
struct LLDBBackend : Backend
|
||||
{
|
||||
struct RegSet
|
||||
{
|
||||
std::string set_name;
|
||||
// map from debugger reg idx to frontend reg idx
|
||||
// std::vector<uint16_t> idx_map;
|
||||
std::vector<const char *> names;
|
||||
// TODO: make this data structure not garbage
|
||||
std::vector<std::vector<uint8_t>> values;
|
||||
};
|
||||
|
||||
void start() override;
|
||||
// TODO: source_init_file: false
|
||||
LLDBBackend(std::string filename);
|
||||
virtual ~LLDBBackend();
|
||||
|
||||
private:
|
||||
std::string _filename;
|
||||
lldb::SBDebugger _instance;
|
||||
lldb::SBTarget _target;
|
||||
std::optional<lldb::SBProcess> _process;
|
||||
};
|
||||
}
|
||||
void start() override;
|
||||
|
||||
bool step_into() override;
|
||||
bool step_over() override;
|
||||
bool step_out() override;
|
||||
|
||||
private:
|
||||
void run_msg_loop();
|
||||
void wait_for_debug_events();
|
||||
|
||||
void handle_state_change(lldb::StateType);
|
||||
|
||||
void prepare_proc_info(BackToFront::InitialProcessInfo &,
|
||||
std::vector<BackToFront::RegsChanged> &);
|
||||
void dump_threads();
|
||||
void check_reg_changes();
|
||||
|
||||
std::string _filename;
|
||||
lldb::SBDebugger _instance;
|
||||
|
||||
std::mutex _data_lock;
|
||||
lldb::SBTarget _target;
|
||||
std::optional<lldb::SBProcess> _process;
|
||||
std::thread _msg_thread;
|
||||
|
||||
// process state
|
||||
bool _first_run = true;
|
||||
TargetState _state = TargetState::stopped;
|
||||
std::vector<RegSet> _reg_sets = {};
|
||||
};
|
||||
} // namespace dbgui::backend
|
||||
Reference in New Issue
Block a user