Skip to content

Commit

Permalink
debugger: add step and follow commands
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi committed Oct 13, 2024
1 parent 69e03b1 commit 8cc0ad3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/debugger/debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ _cmd_help(Debugger *self, gint argc, gchar *argv[])
printf("syslog-ng interactive console, the following commands are available\n\n"
" help, h, or ? Display this help\n"
" continue or c Continue until the next breakpoint\n"
" step or s Single step\n"
" follow or f Follow this message, ignoring any other breakpoints\n"
" trace or t Trace this message along the configuration\n"
" info Display information about the current execution state\n"
" list or l Display source code at the current location\n"
Expand Down Expand Up @@ -294,6 +296,13 @@ _cmd_continue(Debugger *self, gint argc, gchar *argv[])
return FALSE;
}

static gboolean
_cmd_step(Debugger *self, gint argc, gchar *argv[])
{
_set_mode(self, DBG_WAITING_FOR_STEP, FALSE);
return FALSE;
}

static gboolean
_cmd_trace(Debugger *self, gint argc, gchar *argv[])
{
Expand All @@ -302,6 +311,13 @@ _cmd_trace(Debugger *self, gint argc, gchar *argv[])
return FALSE;
}

static gboolean
_cmd_follow(Debugger *self, gint argc, gchar *argv[])
{
_set_mode(self, DBG_FOLLOW_AND_BREAK, TRUE);
return FALSE;
}

static gboolean
_cmd_quit(Debugger *self, gint argc, gchar *argv[])
{
Expand All @@ -326,6 +342,10 @@ struct
{ "?", _cmd_help },
{ "continue", _cmd_continue },
{ "c", _cmd_continue },
{ "step", _cmd_step },
{ "s", _cmd_step },
{ "follow", _cmd_follow, .requires_breakpoint_site = TRUE },
{ "f", _cmd_follow, .requires_breakpoint_site = TRUE },
{ "print", _cmd_print, .requires_breakpoint_site = TRUE },
{ "p", _cmd_print, .requires_breakpoint_site = TRUE },
{ "list", _cmd_list, },
Expand Down

0 comments on commit 8cc0ad3

Please sign in to comment.