[m-rev.] for review: fix debugger/solver_test failing test case
Ian MacLarty
maclarty at cs.mu.OZ.AU
Wed Jul 27 01:51:13 AEST 2005
For review by anyone.
Estimated hours taken: 1
Branches: main and 0.12
Only show procedures *declared* in a the module given to the `procedures' mdb
command.
trace/mercury_trace_tables.c:
Check that each procedure is declared in the named module before
printing it.
trace/mercury_trace_tables.h:
Add a function to get the name of module in which the procedure
is declared.
Index: trace/mercury_trace_tables.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_tables.c,v
retrieving revision 1.34
diff -u -r1.34 mercury_trace_tables.c
--- trace/mercury_trace_tables.c 14 Feb 2005 08:04:03 -0000 1.34
+++ trace/mercury_trace_tables.c 26 Jul 2005 15:39:54 -0000
@@ -351,6 +351,7 @@
{
const MR_Module_Layout *module;
int i;
+ MR_ConstString decl_module;
module = MR_search_module_info_by_unique_name(fp, name);
if (module == NULL) {
@@ -360,7 +361,13 @@
fprintf(fp, "List of procedures in module `%s'\n\n", name);
for (i = 0; i < module->MR_ml_proc_count; i++) {
- MR_print_proc_id_and_nl(fp, module->MR_ml_procs[i]);
+ decl_module = MR_get_proc_decl_module(module->MR_ml_procs[i]);
+ /*
+ ** Only show procs which are declared in the module.
+ */
+ if (MR_streq(decl_module, name)) {
+ MR_print_proc_id_and_nl(fp, module->MR_ml_procs[i]);
+ }
}
}
@@ -1054,6 +1061,16 @@
{
MR_print_proc_id(fp, entry_layout);
fprintf(fp, "\n");
+}
+
+MR_ConstString
+MR_get_proc_decl_module(const MR_Proc_Layout *proc)
+{
+ if (MR_PROC_LAYOUT_IS_UCI(proc)) {
+ return (&proc->MR_sle_uci)->MR_uci_type_module;
+ } else {
+ return (&proc->MR_sle_user)->MR_user_decl_module;
+ }
}
void
Index: trace/mercury_trace_tables.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_tables.h,v
retrieving revision 1.18
diff -u -r1.18 mercury_trace_tables.h
--- trace/mercury_trace_tables.h 14 Feb 2005 08:04:03 -0000 1.18
+++ trace/mercury_trace_tables.h 26 Jul 2005 15:33:18 -0000
@@ -184,6 +184,13 @@
extern void MR_print_pred_id_and_nl(FILE *fp, const MR_Proc_Layout *proc);
/*
+** MR_get_proc_decl_module(proc):
+** Return the module name the procedure is declared in.
+*/
+
+extern MR_ConstString MR_get_proc_decl_module(const MR_Proc_Layout *proc);
+
+/*
** MR_proc_layout_stats(fp):
** Prints statistics about the proc layout structures of the program.
*/
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list