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 <balazs.scheidler@axoflow.com>
  • Loading branch information
bazsi committed Dec 10, 2024
1 parent ebfaa60 commit bfd41fc
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 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 @@ -474,10 +475,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 @@ -522,7 +523,22 @@ 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\n"

"This program comes with ABSOLUTELY NO WARRANTY;\n"
"This is free software, and you are welcome to redistribute it\n"
"under certain conditions;\n"
"See https://github.com/axoflow/axosyslog/blob/main/COPYING\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 bfd41fc

Please sign in to comment.