[m-rev.] diff: print procedure list by module nicknames

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Jan 17 15:31:15 AEDT 2005


trace/mercury_trace_tables.c:
	When printing the list of procedures in a module, allow the module name
	to be specified by a nickname (a less than fully qualified name).

tests/debugger/breakpoints.{a.m,inp,exp*}:
	Test the new capability.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/breakpoints.a.m
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/breakpoints.a.m,v
retrieving revision 1.1
diff -u -b -r1.1 breakpoints.a.m
--- tests/debugger/breakpoints.a.m	21 Jan 2004 04:55:45 -0000	1.1
+++ tests/debugger/breakpoints.a.m	11 Jan 2005 10:17:56 -0000
@@ -4,3 +4,9 @@
 
 :- include_module breakpoints__a__testmod.
 :- import_module breakpoints__a__testmod.
+
+:- func afunc = int.
+
+:- implementation.
+
+afunc = 42.
Index: tests/debugger/breakpoints.exp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/breakpoints.exp,v
retrieving revision 1.11
diff -u -b -r1.11 breakpoints.exp
--- tests/debugger/breakpoints.exp	16 Nov 2004 00:16:38 -0000	1.11
+++ tests/debugger/breakpoints.exp	11 Jan 2005 15:22:10 -0000
@@ -166,6 +166,15 @@
 The matches are:
 breakpoints.a.testmod
 breakpoints.b.testmod
+mdb> procedures a
+List of procedures in module `a'
+
+func breakpoints.a.afunc/0-0 (det)
+mdb> procedures a.testmod
+List of procedures in module `a.testmod'
+
+func breakpoints.a.testmod.test_in_ab/0-0 (det)
+func breakpoints.a.testmod.test_in_a/0-0 (det)
 mdb> break -O test_in_ab
 Ambiguous procedure specification. The matches are:
 0: func breakpoints.a.testmod.test_in_ab/0-0 (det)
Index: tests/debugger/breakpoints.exp2
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/breakpoints.exp2,v
retrieving revision 1.7
diff -u -b -r1.7 breakpoints.exp2
--- tests/debugger/breakpoints.exp2	16 Nov 2004 00:16:38 -0000	1.7
+++ tests/debugger/breakpoints.exp2	11 Jan 2005 13:35:22 -0000
@@ -174,6 +174,15 @@
 The matches are:
 breakpoints.a.testmod
 breakpoints.b.testmod
+mdb> procedures a
+List of procedures in module `a'
+
+func breakpoints.a.afunc/0-0 (det)
+mdb> procedures a.testmod
+List of procedures in module `a.testmod'
+
+func breakpoints.a.testmod.test_in_ab/0-0 (det)
+func breakpoints.a.testmod.test_in_a/0-0 (det)
 mdb> break -O test_in_ab
 Ambiguous procedure specification. The matches are:
 0: func breakpoints.a.testmod.test_in_ab/0-0 (det)
Index: tests/debugger/breakpoints.inp
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/breakpoints.inp,v
retrieving revision 1.6
diff -u -b -r1.6 breakpoints.inp
--- tests/debugger/breakpoints.inp	21 Jan 2004 04:55:45 -0000	1.6
+++ tests/debugger/breakpoints.inp	11 Apr 2004 17:11:23 -0000
@@ -54,6 +54,8 @@
 break test_only_in_printlist
 delete *
 procedures testmod
+procedures a
+procedures a.testmod
 break -O test_in_ab
 break -O testmod.test_in_ab
 break -O a.testmod.test_in_ab
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace_tables.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace_tables.c,v
retrieving revision 1.31
diff -u -b -r1.31 mercury_trace_tables.c
--- trace/mercury_trace_tables.c	9 Dec 2004 01:03:22 -0000	1.31
+++ trace/mercury_trace_tables.c	9 Dec 2004 01:11:28 -0000
@@ -312,17 +312,13 @@
 	int				j;
 
 	module = MR_search_module_info_by_name(name);
-	if (module != NULL) {
-		fprintf(fp, "List of procedures in module `%s'\n\n", name);
-		for (j = 0; j < module->MR_ml_proc_count; j++) {
-			MR_print_proc_id_and_nl(fp, module->MR_ml_procs[j]);
-		}
-	} else {
+	if (module == NULL) {
 		modules = MR_search_module_info_by_nickname(name);
 		if (modules == NULL) {
 			fprintf(fp, "There is no debugging info "
 				"about module `%s'\n", name);
-		} else {
+			return;
+		} else if (MR_dlist_length(modules) != 1) {
 			fprintf(fp, "Module name `%s' is ambiguous.\n", name);
 			fprintf(fp, "The matches are:\n");
 			MR_for_dlist (element_ptr, modules) {
@@ -330,7 +326,16 @@
 					MR_dlist_data(element_ptr);
 				fprintf(fp, "%s\n", module->MR_ml_name);
 			}
+			return;
+		} else {
+			module = (const MR_Module_Layout *)
+				MR_dlist_first(modules);
+		}
 		}
+
+	fprintf(fp, "List of procedures in module `%s'\n\n", name);
+	for (j = 0; j < module->MR_ml_proc_count; j++) {
+		MR_print_proc_id_and_nl(fp, module->MR_ml_procs[j]);
 	}
 }
 
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
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