For review: convert port into strings before sending it to the debugger process.

Erwan Jahier Erwan.Jahier at irisa.fr
Sat Jul 18 02:03:28 AEST 1998


Me again.

I made this conversion in order to keep the same name for ports display
as in the internal debugger. I could have made that conversion in the
debugger process, but I find it simpler to do it here. An other
advantage of doing this conversion here is that, if one day you decide
to change the naming convention for ports display in the internal
debugger, you would be able to change it here too ;-).

library/debugger_interface.m:
	Convert port into strings before sending it to the debugger process.
	
	Update another couple of comments.


Index: debugger_interface.m
===================================================================
RCS file:
/home/mercury1/repository/mercury/library/debugger_interface.m,v
retrieving revision 1.3
diff -u -r1.3 debugger_interface.m
--- debugger_interface.m	1998/07/16 14:28:45	1.3
+++ debugger_interface.m	1998/07/17 15:42:19
@@ -20,7 +20,7 @@
 %	ML_DI_output_current
 %	ML_DI_found_match
 %	ML_DI_read_request_from_socket
-% These are used by runtime/mercury_trace.c.
+% These are used by runtime/mercury_trace_external.c.
 
 :- pred dummy_pred_to_avoid_warning_about_nothing_exported is det.
 
@@ -74,7 +74,7 @@
 			match(event_number),
 			match(call_number),
 			match(depth_number),
-			match(trace_port_type),
+			match(string),		% port
 			match(string),		% module name
 			match(string),		% pred name
 			match(arity),
@@ -148,7 +148,7 @@
 			maybe(event_number),
 			maybe(call_number),
 			maybe(depth_number),
-			maybe(trace_port_type),
+			string,		% port
 			maybe(string),	% module name
 			maybe(string),	% pred name
 			maybe(arity),
@@ -253,12 +253,13 @@
 		DebuggerRequest = forward_move(MatchEventNumber,
 			MatchCallNumber, MatchDepthNumber, MatchPort,
 			MatchModuleName, MatchPredName, MatchArity,
-			MatchModeNum, MatchDeterminism, MatchArgs, MatchPath)
+			MatchModeNum, MatchDeterminism, MatchArgs, MatchPath),
+			trace_port_type_to_string(Port, PortStr)
 	->
 		match(MatchEventNumber, EventNumber),
 		match(MatchCallNumber, CallNumber),
 		match(MatchDepthNumber, DepthNumber),
-		match(MatchPort, Port),
+		match(MatchPort, PortStr),
 		match(MatchModuleName, ModuleName),
 		match(MatchPredName, PredName),
 		match(MatchArity, Arity),
@@ -324,7 +325,7 @@
 :- mode classify_request(in, out) is det.
 
 % the numbers here should match the definition of
-% MR_debugger_request_type in runtime/mercury_trace.c.
+% MR_debugger_request_type in runtime/mercury_trace_external.c.
 
 classify_request(hello_reply, 0).
 classify_request(forward_move(_, _, _, _, _, _, _, _, _, _, _), 1).
@@ -332,5 +333,20 @@
 classify_request(abort_prog, 3).
 classify_request(no_trace, 4).
 classify_request(error(_), 5).
+
+
+
+:- pred trace_port_type_to_string(trace_port_type, string).
+:- mode trace_port_type_to_string(in, out) is det.
+
+trace_port_type_to_string(call, "CALL").
+trace_port_type_to_string(exit, "EXIT").
+trace_port_type_to_string(fail, "FAIL").
+trace_port_type_to_string(ite_then, "THEN").
+trace_port_type_to_string(ite_else, "ELSE").
+trace_port_type_to_string(disj, "DISJ").
+trace_port_type_to_string(switch, "SWTC").
+trace_port_type_to_string(nondet_pragma_first, "FRST").
+trace_port_type_to_string(nondet_pragma_later, "LATR").
 

%-----------------------------------------------------------------------------%

-- 
R1.



More information about the developers mailing list