This change implement the retry command for the external debugger.

Estimated hours taken: 10

This change implement the retry command for the external debugger.


trace/mercury_trace.[ch]:
trace/mercury_trace_internal.[ch]:
	Move MR_trace_retry() and MR_trace_find_input_arg() from
	mercury_trace_internal.c to mercury_trace.c since they are also needed
	in the external debugger.

	MR_trace_retry() now returns a `char *' pointer which is either
	NULL if the retry proceeds correctly or an error message if it fails.

trace/mercury_trace_internal.h:
trace/mercury_trace.h:
	Move the definition of the type MR_Event_Details from
	mercury_trace_internal.h to mercury_trace.h since both are also
	needed in the external debugger.

	Idem for the constant MR_INIT_ARG_COUNT.


trace/mercury_trace.c:
trace/mercury_trace_external.[ch]:
	MR_trace_external() now returns a code address to jump in.

	Pass the integer max_mr_num in argument of MR_trace_external() since
	it is needed by MR_trace_retry().

	Add a MR_send_message_to_socket_format() that allows to send formated
	message to the socket. I need that because the error message send to the
	socket must be a prolog term.

trace/mercury_trace_external.c:
	Implement the retry command in MR_trace_event_external().


browse/debugger_interface.m:
	Add support for the retry port.

	Make all the lines fits in 80 colums.
This commit is contained in:
Erwan Jahier
1999-02-10 22:31:27 +00:00
parent ad2ee03194
commit d211b9e2f3
7 changed files with 265 additions and 200 deletions

View File

@@ -1,6 +1,5 @@
%-----------------------------------------------------------------------------%
% Copyright (C) 1998 The University of Melbourne.
% Copyright (C) 1998-1999 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%-----------------------------------------------------------------------------%
@@ -18,7 +17,10 @@
:- interface.
% This module exports the following C functions:
% ML_DI_output_current
% ML_DI_output_current_slots
% ML_DI_output_current_vars
% ML_DI_output_current_nth_var
% ML_DI_output_current_live_var_names
% ML_DI_found_match
% ML_DI_read_request_from_socket
% These are used by runtime/mercury_trace_external.c.
@@ -109,13 +111,16 @@ dummy_pred_to_avoid_warning_about_nothing_exported.
% A 'current_nth_var' request instructs the debuggee to
% retrieve the specified live variable.
; current_nth_var(int)
; abort_prog
% just abort the program
; no_trace
; abort_prog
% stop tracing, and run the program to completion
; error(string)
; no_trace
% restarts execution at the call port of the call
% corresponding to the current event
; retry
% something went wrong when trying to get the
% next request
; error(string)
.
:- type event_number == int.
@@ -206,7 +211,8 @@ output_current_slots(EventNumber, CallNumber, DepthNumber, Port,
% output_current_vars "ML_DI_output_current_vars":
% send to the debugger the list of the live variables of the current event.
:- pragma export(output_current_vars(in, in, in, di, uo), "ML_DI_output_current_vars").
:- pragma export(output_current_vars(in, in, in, di, uo),
"ML_DI_output_current_vars").
:- pred output_current_vars(list(univ), list(string),
io__output_stream, io__state, io__state).
@@ -223,7 +229,8 @@ output_current_vars(VarList, StringList, OutputStream) -->
% output_current_nth_var "ML_DI_output_current_nth_var":
% send to the debugger the requested live variable of the current event.
:- pragma export(output_current_nth_var(in, in, di, uo), "ML_DI_output_current_nth_var").
:- pragma export(output_current_nth_var(in, in, di, uo),
"ML_DI_output_current_nth_var").
:- pred output_current_nth_var(univ, io__output_stream, io__state, io__state).
:- mode output_current_nth_var(in, in, di, uo) is det.
@@ -375,6 +382,7 @@ classify_request(abort_prog, 5).
classify_request(error(_), 6).
classify_request(current_live_var_names, 7).
classify_request(current_nth_var(_), 8).
classify_request(retry, 9).
%-----------------------------------------------------------------------------%