Skip to content

Commit 295876c

Browse files
committed
debugger: print different help message depending on breakpoint or interrupt stop
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
1 parent 4fabccd commit 295876c

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

lib/debugger/debugger.c

+25-10
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,31 @@ _display_source_line(LogExprNode *expr_node)
140140
static gboolean
141141
_cmd_help(Debugger *self, gint argc, gchar *argv[])
142142
{
143-
printf("syslog-ng interactive console, the following commands are available\n\n"
144-
" help, h, ? Display this help\n"
145-
" info, i Display information about the current execution state\n"
146-
" continue, c Continue until the next breakpoint\n"
147-
" display Set the displayed message template\n"
148-
" trace, t Display timing information as the message traverses the config\n"
149-
" print, p Print the current log message\n"
150-
" drop, d Drop the current message\n"
151-
" quit, q Tell syslog-ng to exit\n"
152-
);
143+
if (self->breakpoint_site)
144+
{
145+
printf("syslog-ng interactive console\n"
146+
"Stopped on a breakpoint.\n"
147+
"The following commands are available:\n\n"
148+
" help, h, ? Display this help\n"
149+
" info, i Display information about the current execution state\n"
150+
" continue, c Continue until the next breakpoint\n"
151+
" display Set the displayed message template\n"
152+
" trace, t Display timing information as the message traverses the config\n"
153+
" print, p Print the current log message\n"
154+
" drop, d Drop the current message\n"
155+
" quit, q Tell syslog-ng to exit\n"
156+
);
157+
}
158+
else
159+
{
160+
printf("syslog-ng interactive console\n"
161+
"Stopped on an interrupt.\n"
162+
"The following commands are available:\n\n"
163+
" help, h, ? Display this help\n"
164+
" continue, c Continue until the next breakpoint\n"
165+
" quit, q Tell syslog-ng to exit\n"
166+
);
167+
}
153168
return TRUE;
154169
}
155170

0 commit comments

Comments
 (0)