aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-28 03:25:56 +0200
committerhachem <im@hachem.wtf>2026-08-28 03:25:56 +0200
commit9a6ce759212d293a96f82678b59148d8a49efc93 (patch)
tree684efea100bc473ce30745e8f0545e70de1f978c /src/ui
parent801c6a8916a495162b200fff0d14cfbf89ea854c (diff)
add: link llvm
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/source_view.cpp12
-rw-r--r--src/ui/ui.cpp31
-rw-r--r--src/ui/ui.h1
3 files changed, 37 insertions, 7 deletions
diff --git a/src/ui/source_view.cpp b/src/ui/source_view.cpp
index 37ceffc..7f80aa8 100644
--- a/src/ui/source_view.cpp
+++ b/src/ui/source_view.cpp
@@ -192,10 +192,14 @@ namespace Hsdbg
if (breakpoint != nullptr)
{
- draw_list->AddCircleFilled(marker_center,
- BREAKPOINT_RADIUS,
- breakpoint->enabled ? BREAKPOINT_COLOR
- : BREAKPOINT_DISABLED_COLOR);
+ const ImU32 color = breakpoint->enabled ? BREAKPOINT_COLOR
+ : BREAKPOINT_DISABLED_COLOR;
+
+ // hollow until lldb finds somewhere to actually put it
+ if (breakpoint->resolved)
+ draw_list->AddCircleFilled(marker_center, BREAKPOINT_RADIUS, color);
+ else
+ draw_list->AddCircle(marker_center, BREAKPOINT_RADIUS, color, 0, 1.5f);
}
else if (gutter_hovered)
{
diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp
index 91fab0a..bc7c910 100644
--- a/src/ui/ui.cpp
+++ b/src/ui/ui.cpp
@@ -28,8 +28,8 @@ namespace Hsdbg
constexpr const char* LOAD_TARGET_POPUP = "load target";
- // macos gives us a 4.1 core context, which speaks glsl 1.50
- // #portability
+ // the lowest glsl that every 3.2+ core profile accepts, and the window
+ // asks for a 3.3 core context on all three platforms
constexpr const char* GLSL_VERSION = "#version 150";
constexpr size_t MAX_CONSOLE_LINES = 2048;
@@ -173,6 +173,9 @@ namespace Hsdbg
{
build_default_layout(dockspace_id);
m_layout_built = true;
+
+ // otherwise whichever panel happens to be submitted last wins the tab
+ m_focus_breakpoints = true;
}
draw_status_bar(debugger);
@@ -190,6 +193,14 @@ namespace Hsdbg
if (m_visible.demo)
ImGui::ShowDemoWindow(&m_visible.demo);
+
+ // a window claims its tab when it is first submitted, so this can only be
+ // asked for once every panel in the node exists
+ if (m_focus_breakpoints)
+ {
+ ImGui::SetWindowFocus(PANEL_BREAKPOINTS);
+ m_focus_breakpoints = false;
+ }
}
auto Ui::build_default_layout(uint32_t dockspace_id) -> void
@@ -466,11 +477,12 @@ namespace Hsdbg
ImGuiTableFlags_SizingStretchProp |
ImGuiTableFlags_ScrollY;
- if (ImGui::BeginTable("##breakpoints", 5, flags))
+ if (ImGui::BeginTable("##breakpoints", 6, flags))
{
ImGui::TableSetupColumn("on", ImGuiTableColumnFlags_WidthFixed, 26.0f);
ImGui::TableSetupColumn("id", ImGuiTableColumnFlags_WidthFixed, 30.0f);
ImGui::TableSetupColumn("location");
+ ImGui::TableSetupColumn("address");
ImGui::TableSetupColumn("hits", ImGuiTableColumnFlags_WidthFixed, 40.0f);
ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 26.0f);
ImGui::TableSetupScrollFreeze(0, 1);
@@ -507,6 +519,19 @@ namespace Hsdbg
ImGui::SetTooltip("%s", breakpoint.file.string().c_str());
ImGui::TableNextColumn();
+ if (breakpoint.resolved)
+ {
+ ImGui::Text("0x%llx", static_cast<unsigned long long>(breakpoint.address));
+
+ if (ImGui::IsItemHovered() && !breakpoint.function.empty())
+ ImGui::SetTooltip("%s", breakpoint.function.c_str());
+ }
+ else
+ {
+ ImGui::TextDisabled("pending");
+ }
+
+ ImGui::TableNextColumn();
ImGui::Text("%u", breakpoint.hit_count);
ImGui::TableNextColumn();
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 20d4e1b..90c314d 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -75,5 +75,6 @@ namespace Hsdbg
bool m_layout_built = false;
bool m_console_scroll_pending = false;
bool m_load_target_pending = false;
+ bool m_focus_breakpoints = false;
};
}