Skip to content

Commit

Permalink
debugger: add welcome blurb on startup
Browse files Browse the repository at this point in the history
Also, stop at the prompt immediately, instead of wait for a message.

Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi committed Oct 13, 2024
1 parent 323a0b9 commit 69e03b1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/debugger/debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct _Debugger
GThread *debugger_thread;
BreakpointSite *breakpoint_site;
struct timespec last_trace_event;
gboolean starting_up;

/* user interface related state */
gchar *command_buffer;
Expand Down Expand Up @@ -436,10 +437,10 @@ _handle_interactive_prompt(Debugger *self)
_display_source_line(self);
_display_msg_with_template(self, self->breakpoint_site->msg, self->display_template);
}
else
else if (!self->starting_up)
{
_set_current_location(self, NULL);
printf("Stopping on interrupt, message related commands are unavailable...\n");
printf(" Stopping on Interrupt...\n");
}
while (1)
{
Expand Down Expand Up @@ -484,7 +485,16 @@ static gpointer
_debugger_thread_func(Debugger *self)
{
app_thread_start();
printf("Waiting for breakpoint...\n");
self->breakpoint_site = NULL;

printf("axosyslog interactive debugger\n"
"Copyright (c) 2024 Axoflow and contributors\n"
"License LGPLV2.1+ and GPLv2+\n\n"
"For help, type \"help\".\n");

self->starting_up = TRUE;
_handle_interactive_prompt(self);
self->starting_up = FALSE;
while (1)
{
if (!_debugger_wait_for_event(self))
Expand Down

0 comments on commit 69e03b1

Please sign in to comment.