diff --git a/C/sysbits.c b/C/sysbits.c
index e7b819cd3..a987c4c0b 100644
--- a/C/sysbits.c
+++ b/C/sysbits.c
@@ -1254,6 +1254,10 @@ InteractSIGINT(int ch) {
#endif
}
return -1;
+ case 'b':
+ /* continue */
+ Yap_signal (YAP_BREAK_SIGNAL);
+ return 1;
case 'c':
/* continue */
return 1;
diff --git a/changes-5.1.html b/changes-5.1.html
index 8d364993c..664b3bfd4 100644
--- a/changes-5.1.html
+++ b/changes-5.1.html
@@ -16,6 +16,8 @@
Yap-5.1.0:
+- FIXED: ^C was very broken: break was not accepted, and debug,
+trace and statistics did not work at all.
- FIXED: format_has_tabs could miss tab signs.
- FIXED: plug holes in memory allocation from scanner.
- FIXED: instrument memory allocation use use_malloc.
diff --git a/pl/signals.yap b/pl/signals.yap
index 61a31cf37..5ec1ed81a 100644
--- a/pl/signals.yap
+++ b/pl/signals.yap
@@ -49,29 +49,26 @@
'$continue_signals',
'$current_module'(M0),
'$execute0'(G,M0).
-'$do_signal'(sig_trace, G) :-
+'$do_signal'(sig_trace, [M|G]) :-
'$continue_signals',
- trace.
-'$do_signal'(sig_debug, G) :-
+ trace,
+ '$execute'(M:G).
+'$do_signal'(sig_debug, [M|G]) :-
'$continue_signals',
- '$current_module'(M0),
debug,
- '$execute0'(G,M0).
-'$do_signal'(sig_break, G) :-
+ '$execute'(M:G).
+'$do_signal'(sig_break, [M|G]) :-
'$continue_signals',
- '$current_module'(M0),
break,
- '$execute0'(G,M0).
-'$do_signal'(sig_statistics, G) :-
+ '$execute0'(G,M).
+'$do_signal'(sig_statistics, [M|G]) :-
'$continue_signals',
- '$current_module'(M0),
statistics,
- '$execute0'(G,M0).
-'$do_signal'(sig_stack_dump, G) :-
+ '$execute0'(G,M).
+'$do_signal'(sig_stack_dump, [M|G]) :-
'$continue_signals',
- '$current_module'(M0),
'$stack_dump',
- '$execute0'(G,M0).
+ '$execute0'(G,M).
% Unix signals
'$do_signal'(sig_alarm, G) :-
'$signal_handler'(sig_alarm, G).