[m-dev.] spypoints in external debugger
Erwan Jahier
Erwan.Jahier at irisa.fr
Wed Oct 20 00:19:32 AEST 1999
Fergus wrote:
| I've just committed a change to browser/debugger_interface.m which
| adds a description of the format used by MR_print_proc_id_to_socket(),
| so the "described below" bit will make sense.
|
| Note that my comment has a number of XXXs in it.
| Erwan, it would be great if you could fix those XXXs!
--
Estimated hours taken: 1
Remove some XXXs saying that not all terms sent to the external debugger were
valid Mercury terms. Declare in browser/debugger_interface.m all the
response_type used in trace/mercury_trace_external.c.
browser/debugger_interface.m
Add several items the debugger_response type that are sent via
trace/mercury_trace_external.c.
trace/mercury_trace_external.c:
Make MR_print_proc_id_to_socket() send Mercury terms.
Index: browser/debugger_interface.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/debugger_interface.m,v
retrieving revision 1.11
diff -u -r1.11 debugger_interface.m
--- debugger_interface.m 1999/09/20 08:16:32 1.11
+++ debugger_interface.m 1999/10/19 14:09:40
@@ -196,7 +196,6 @@
% The debugger_response type is used for response sent
% to the debugger process from the Mercury program being debugged.
-% This type would need to be extended.
:- type debugger_response
% sending hello
---> hello % are you there?
@@ -238,17 +237,35 @@
)
% responses to current_vars
; current_vars(list(univ), list(string))
- % reponse to current_nth_var
+ % responses to current_nth_var
; current_nth_var(univ)
% responses to current_live_var_names
; current_live_var_names(list(string), list(string))
% response sent when the last event is reached
; last_event
- % responses to abort_prog or no_trace
+ % responses to a successful browse request session
+ ; browser_end
+ % responses to a successful mmc_option request
+ ; mmc_option_ok
+ % responses to requests that proceeded successfully
; ok
- % responses to anything
+ % responses to requests that went wrong
; error(string)
- .
+ % responses to stack
+ % The protocol between the debugger and the debuggee is described is
+ % trace/mercury_trace_external.c.
+ ; level(int) % stack level
+ ; proc(string, string, string, int, int) % compiler generated proc
+ ; proc(string, string, int, int) % user generated proc
+ ; def_module(string)
+ ; detail(int, int, int)
+ ; (pred)
+ ; (func)
+ ; det(string)
+ ; end_stack
+ % responses to stack_regs
+ ; stack_regs(int, int, int).
+
%-----------------------------------------------------------------------------%
% send to the debugger (e.g. Opium) the wanted features.
Index: mercury_trace_external.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.21
diff -u -r1.21 mercury_trace_external.c
--- mercury_trace_external.c 1999/09/27 05:20:57 1.21
+++ mercury_trace_external.c 1999/10/19 14:08:23
@@ -1029,18 +1029,16 @@
** of the procedure)
** - the atom 'pred' or 'func' depending if the procedure is a function
** or not
-** - proc('string:string'/long-long) (the name of the procedure)
-** XXX this is not valid format for a Mercury term
+** - proc(string, string, long, long) (the procedure)
** - det(string) (the determinism of the procedure)
-** - def_module(string) (the name of the defining module if different from
-** the current one)
+** - def_module(string) (the name of the defining module) if different from
+** the current one.
**
** For each compiler generated procedures, the debuggee sends:
** - level(int) (as above)
** - detail(unsigned long, unsigned long, unsigned long) (as above)
-** - proc('string for string:string'/long-long) (the name of the
+** - proc(string, string, string, long, long) (the name of the
** compiler-generated procedure)
-** XXX this is not valid format for a Mercury term
** - det(string) (as above)
** - def_module(string) (as above)
** 3) The debuggee sends "end_stack"
@@ -1115,8 +1113,7 @@
if (MR_ENTRY_LAYOUT_COMPILER_GENERATED(entry)) {
MR_send_message_to_socket_format(
- /* XXX Names with ' may cause some problems here */
- "proc('%s for %s:%s'/%ld-%ld).\n",
+ "proc(%s,%s,%s,%ld,%ld).\n",
entry->MR_sle_comp.MR_comp_pred_name,
entry->MR_sle_comp.MR_comp_type_module,
entry->MR_sle_comp.MR_comp_type_name,
@@ -1142,8 +1139,7 @@
}
MR_send_message_to_socket_format(
- /* XXX Names with ' may cause some problems here */
- "proc('%s:%s'/%ld-%ld).\n",
+ "proc(%s,%s,%ld,%ld).\n",
entry->MR_sle_user.MR_user_decl_module,
entry->MR_sle_user.MR_user_name,
(long) entry->MR_sle_user.MR_user_arity,
--
R1.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list