Skip to content

Commit 687323f

Browse files
committed
fix soft-halt with thread freezes; fix disabling/tooltips of top-bar controls
1 parent 51dce36 commit 687323f

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

src/dbg_engine/dbg_engine_core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,6 +2381,14 @@ d_tick(Arena *arena, D_TargetArray *targets, D_BreakpointArray *breakpoints, D_P
23812381
msg->entity = e->handle;
23822382
}
23832383
}
2384+
if(d_ctrl_targets_running())
2385+
{
2386+
need_run = 1;
2387+
run_kind = d_state->ctrl_last_run_kind;
2388+
run_thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, d_state->ctrl_last_run_thread_handle);
2389+
run_flags = d_state->ctrl_last_run_flags;
2390+
run_traps = d_state->ctrl_last_run_traps;
2391+
}
23842392
}break;
23852393

23862394
//- rjf: entity decoration

src/raddbg/raddbg_core.c

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5952,19 +5952,7 @@ rd_window_frame(RD_Window *ws)
59525952
RD_Font(RD_FontSlot_Main)
59535953
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
59545954
{
5955-
ui_labelf("Restart all running targets:");
5956-
{
5957-
for(RD_EntityNode *n = processes.first; n != 0; n = n->next)
5958-
{
5959-
RD_Entity *process = n->entity;
5960-
RD_Entity *target = rd_entity_from_handle(process->entity_handle);
5961-
if(!rd_entity_is_nil(target))
5962-
{
5963-
String8 target_display_name = rd_display_string_from_entity(scratch.arena, target);
5964-
ui_label(target_display_name);
5965-
}
5966-
}
5967-
}
5955+
ui_labelf("Restart");
59685956
}
59695957
}
59705958
if(ui_clicked(sig))
@@ -6029,16 +6017,26 @@ rd_window_frame(RD_Window *ws)
60296017
}
60306018

60316019
//- rjf: step over button
6032-
UI_TextAlignment(UI_TextAlign_Center)
6020+
UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled))
60336021
{
60346022
UI_Signal sig = ui_button(rd_icon_kind_text_table[RD_IconKind_StepOver]);
60356023
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
60366024
if(ui_hovering(sig))
60376025
{
6038-
UI_Tooltip
6039-
RD_Font(RD_FontSlot_Main)
6040-
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
6041-
ui_labelf("Step Over");
6026+
if(can_play)
6027+
{
6028+
UI_Tooltip
6029+
RD_Font(RD_FontSlot_Main)
6030+
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
6031+
ui_labelf("Step Over");
6032+
}
6033+
else
6034+
{
6035+
UI_Tooltip
6036+
RD_Font(RD_FontSlot_Main)
6037+
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
6038+
ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist");
6039+
}
60426040
}
60436041
if(ui_clicked(sig))
60446042
{
@@ -6047,16 +6045,26 @@ rd_window_frame(RD_Window *ws)
60476045
}
60486046

60496047
//- rjf: step into button
6050-
UI_TextAlignment(UI_TextAlign_Center)
6048+
UI_TextAlignment(UI_TextAlign_Center) UI_Flags((can_play ? 0 : UI_BoxFlag_Disabled))
60516049
{
60526050
UI_Signal sig = ui_button(rd_icon_kind_text_table[RD_IconKind_StepInto]);
60536051
os_window_push_custom_title_bar_client_area(ws->os, sig.box->rect);
60546052
if(ui_hovering(sig))
60556053
{
6056-
UI_Tooltip
6057-
RD_Font(RD_FontSlot_Main)
6058-
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
6059-
ui_labelf("Step Into");
6054+
if(can_play)
6055+
{
6056+
UI_Tooltip
6057+
RD_Font(RD_FontSlot_Main)
6058+
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
6059+
ui_labelf("Step Over");
6060+
}
6061+
else
6062+
{
6063+
UI_Tooltip
6064+
RD_Font(RD_FontSlot_Main)
6065+
UI_FontSize(rd_font_size_from_slot(RD_FontSlot_Main))
6066+
ui_labelf("Disabled: %s", have_targets ? "Targets are currently running" : "No active targets exist");
6067+
}
60606068
}
60616069
if(ui_clicked(sig))
60626070
{

0 commit comments

Comments
 (0)