Files
cnmcdee e6678e13b8 Debugger: fix Step Out in main, Stop on GUI apps, Run target switch, temp main bp persistence
(c) step_out() refused in the outermost frame instead of sending
    -exec-finish: new can_step_out() (frames>1, fallback on the stop
    frame level); the UI now shows a status-line note, no modal.
(d) gdb runs in synchronous mode by default, so -exec-interrupt sat
    unread while the target ran: enable mi-async at spawn, and
    interrupt() falls back to SIGINT then SIGSTOP on the inferior pid.
    Interrupt of a target in gtk_main now lands in ~0.1s (was a 5s
    timeout, timed out waiting for gdb reply).
(e) new restart_or_start(exe, args): same target restarts, a changed
    Target/Args kills the old target (via gdb kill, so it is reaped
    at once) and starts the new one. kill_target() uses gdb kill as
    primary; raw SIGKILL left a dead-but-unreaped inferior that made
    -file-exec-and-symbols fail. Failed breakpoint re-applies stay
    staged (id 0) so they come back when switching back.
(f) break-on-main breakpoint is now marked temporary: never written
    to debugger_bps.conf, never duplicated on the next session, and
    load dedupes stale duplicate main lines. add_breakpoint and the
    refresh merge preserve the temporary flag.
Tests: harness 37-41 console (step_out refused, can_step_out in a
call, break-on-main not persisted, restart_or_start switches target,
interrupt stops a running target) + gtkspin target and GTK test 37
(interrupt_gtkapp_in_gtk_main). Console 42/42, GTK 8/8.
2026-12-02 10:46:12 +00:00

15 lines
534 B
C++

// Debugger test target: GTK app that sits in gtk_main forever (no timers).
// Used to probe Stop/interrupt behaviour on a GUI app.
#include <gtk/gtk.h>
int main(int argc, char** argv) {
gtk_init(&argc, &argv);
GtkWidget* win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(win), "Debugger GTK Spin");
gtk_window_set_default_size(GTK_WINDOW(win), 300, 120);
g_signal_connect(win, "destroy", G_CALLBACK(gtk_main_quit), nullptr);
gtk_widget_show_all(win);
gtk_main();
return 0;
}