fix compile, fix clang-format, add demo window debug setting, add setting to stop at entry or go to main directly
This commit is contained in:
@@ -9,12 +9,13 @@
|
||||
using namespace dbgui;
|
||||
using namespace dbgui::frontend;
|
||||
|
||||
Target::Target(std::string filename)
|
||||
Target::Target(std::string filename, bool stop_at_entry)
|
||||
{
|
||||
state = TargetState::startup;
|
||||
this->filename = filename;
|
||||
id = 0;
|
||||
backend = std::make_shared<backend::LLDBBackend>(this->filename.c_str());
|
||||
backend = std::make_shared<backend::LLDBBackend>(this->filename.c_str(),
|
||||
stop_at_entry);
|
||||
}
|
||||
|
||||
Frontend::Frontend()
|
||||
@@ -43,6 +44,11 @@ void Frontend::run_frame()
|
||||
ImGui::ShowStackToolWindow();
|
||||
}
|
||||
|
||||
if (_draw_demo_window)
|
||||
{
|
||||
ImGui::ShowDemoWindow();
|
||||
}
|
||||
|
||||
this->handle_msgs();
|
||||
this->draw_open_popup();
|
||||
this->draw_header();
|
||||
@@ -154,6 +160,7 @@ void Frontend::draw_header()
|
||||
{
|
||||
ImGui::MenuItem("Metrics", nullptr, &_draw_metric_window);
|
||||
ImGui::MenuItem("Stack Tool", nullptr, &_draw_stack_tool);
|
||||
ImGui::MenuItem("Demo Window", nullptr, &_draw_demo_window);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMainMenuBar();
|
||||
@@ -314,10 +321,13 @@ void Frontend::draw_open_popup()
|
||||
|
||||
if (ImGui::Button("Start"))
|
||||
{
|
||||
this->target = Target{_open_popup_name_buf.data()};
|
||||
this->target =
|
||||
Target{_open_popup_name_buf.data(), _open_popup_stop_at_entry};
|
||||
this->target->backend->start();
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
ImGui::Checkbox("Stop at _start", &_open_popup_stop_at_entry);
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,10 +44,12 @@ namespace dbgui::frontend
|
||||
|
||||
bool _draw_metric_window = false;
|
||||
bool _draw_stack_tool = false;
|
||||
bool _draw_demo_window = false;
|
||||
|
||||
bool _draw_open_popup = false;
|
||||
ImGuiID _open_popup_id = 0;
|
||||
std::vector<char> _open_popup_name_buf = {};
|
||||
bool _open_popup_stop_at_entry = false;
|
||||
|
||||
std::vector<Window> _windows = {};
|
||||
};
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace dbgui::frontend
|
||||
bool is_cstr = false;
|
||||
};
|
||||
|
||||
Target(std::string filename);
|
||||
Target(std::string filename, bool stop_at_entry);
|
||||
|
||||
std::optional<uint16_t> data_idx_for_src_id(size_t id)
|
||||
{
|
||||
|
||||
@@ -908,6 +908,8 @@ bool SourceWindow::draw(Frontend &frontend)
|
||||
|
||||
ImGui::GetWindowDrawList()->AddTriangleFilled(
|
||||
pos, p2, p3, IM_COL32(227, 197, 103, 255));
|
||||
ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,
|
||||
ImGui::GetColorU32(ImVec4(1.f, 1.f, 1.f, 0.2f)));
|
||||
}
|
||||
|
||||
// TODO: write custom code to catch mouse clicks in the whole cell, including padding
|
||||
@@ -1374,7 +1376,8 @@ void WatchWindow::draw_value(Frontend &frontend,
|
||||
}
|
||||
|
||||
expr_path.push_back(ExprPathPart{
|
||||
.ident = std::string_view{name_begin, name_end - name_begin},
|
||||
.ident = std::string_view{name_begin, static_cast<size_t>(
|
||||
name_end - name_begin)},
|
||||
.deref = false});
|
||||
this->draw_value(frontend, member.type_id, member.name, node_idx,
|
||||
off + member.offset, expr_path);
|
||||
@@ -1390,7 +1393,8 @@ void WatchWindow::draw_value(Frontend &frontend,
|
||||
frontend.target->types[type_id.idx].byte_size / member_size;
|
||||
|
||||
expr_path.push_back(ExprPathPart{
|
||||
.ident = std::string_view{name_begin, name_end - name_begin},
|
||||
.ident = std::string_view{name_begin,
|
||||
static_cast<size_t>(name_end - name_begin)},
|
||||
.array = true});
|
||||
|
||||
char buf[32];
|
||||
|
||||
Reference in New Issue
Block a user