[m-rev.] for review: make all mdb commands unconditional

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Mar 10 17:58:37 AEDT 2003


For review by anyone.

Zoltan.

trace/mercury_trace_internal.c:
	Make all mdb commands exist regardless of compilation options:
	make the commands that are meaningful only with some compilation
	options report an error if those options aren't specified. This
	should simplify mdb for users, and should simplify testing (e.g.
	tests/debugger/completion).

doc/user_guide.texi:
	Document the previously conditionally defined commands that weren't
	documented before.

tests/debugger/mdb_command_test.inp:
	Test the documentation of the previously undocumented commands.

tests/debugger/completion.exp:
	Update the expected output of command completion to include the now
	unconditionally defined mdb commands.

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
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.359
diff -u -b -r1.359 user_guide.texi
--- doc/user_guide.texi	5 Mar 2003 15:55:21 -0000	1.359
+++ doc/user_guide.texi	10 Mar 2003 04:25:14 -0000
@@ -3183,6 +3183,11 @@
 of the Mercury implementation.
 @sp 1
 @table @code
+ at item gen_stack
+ at kindex gen_stack (mdb command)
+Prints the contents of the frames on the generator stack,
+which is part of the implementation of minimal model tabling.
+ at sp 1
 @item nondet_stack [-d]
 @kindex nondet_stack (mdb command)
 Prints the contents of the frames on the nondet stack.
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/graphics
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/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/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 java
cvs diff: Diffing java/library
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/completion.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/completion.exp,v
retrieving revision 1.10
diff -u -b -r1.10 completion.exp
--- tests/debugger/completion.exp	17 Jan 2003 05:56:52 -0000	1.10
+++ tests/debugger/completion.exp	10 Mar 2003 06:53:59 -0000
@@ -3,25 +3,26 @@
 Command echo enabled.
 mdb> register --quiet
 mdb> 
-?                  document_category  maxdepth           return
-P                  down               mindepth           s
-alias              e                  mmc_options        save
-all_regs           echo               modules            scope
-b                  enable             next               scroll
-break              exception          nondet_stack       set
-browse             excp               p                  source
-c                  f                  print              stack
-cc_query           finish             print_optionals    stack_regs
-context            forward            printlevel         step
-continue           g                  proc_body          table
-current            goto               proc_stats         table_io
-d                  h                  procedures         unalias
-dd                 help               query              unhide_events
-dd_dd              ignore             quit               up
-delete             io_query           r                  v
-disable            label_stats        register           vars
-document           level              retry              view
-h     help  
+?                  document_category  label_stats        retry
+P                  down               level              return
+alias              e                  maxdepth           s
+all_regs           echo               mindepth           save
+b                  enable             mmc_options        scope
+break              exception          modules            scroll
+browse             excp               next               set
+c                  f                  nondet_stack       source
+cc_query           finish             p                  stack
+clear_histogram    forward            print              stack_regs
+context            g                  print_optionals    step
+continue           gen_stack          printlevel         table
+current            goto               proc_body          table_io
+d                  h                  proc_stats         unalias
+dd                 help               procedures         unhide_events
+dd_dd              histogram_all      query              up
+delete             histogram_exp      quit               v
+disable            ignore             r                  vars
+document           io_query           register           view
+h              help           histogram_all  histogram_exp  
 vars  view  
 help vars 
 vars
Index: tests/debugger/mdb_command_test.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/mdb_command_test.inp,v
retrieving revision 1.22
diff -u -b -r1.22 mdb_command_test.inp
--- tests/debugger/mdb_command_test.inp	15 Nov 2002 04:50:44 -0000	1.22
+++ tests/debugger/mdb_command_test.inp	10 Mar 2003 05:11:44 -0000
@@ -45,6 +45,7 @@
 histogram_all        xyzzy xyzzy xyzzy xyzzy xyzzy
 histogram_exp        xyzzy xyzzy xyzzy xyzzy xyzzy
 clear_histogram      xyzzy xyzzy xyzzy xyzzy xyzzy
+gen_stack            xyzzy xyzzy xyzzy xyzzy xyzzy
 nondet_stack         xyzzy xyzzy xyzzy xyzzy xyzzy
 stack_regs           xyzzy xyzzy xyzzy xyzzy xyzzy
 all_regs             xyzzy xyzzy xyzzy xyzzy xyzzy
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_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.151
diff -u -b -r1.151 mercury_trace_internal.c
--- trace/mercury_trace_internal.c	26 Feb 2003 08:55:59 -0000	1.151
+++ trace/mercury_trace_internal.c	9 Mar 2003 12:45:51 -0000
@@ -535,11 +535,9 @@
 			MR_Event_Details *event_details, MR_Code **jumpaddr);
 #endif	/* MR_TRACE_HISTOGRAM */
 
-#ifdef MR_USE_MINIMAL_MODEL
 static MR_Next	MR_trace_cmd_gen_stack(char **words, int word_count,
 			MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info,
 			MR_Event_Details *event_details, MR_Code **jumpaddr);
-#endif /* MR_USE_MINIMAL_MODEL */
 
 static MR_Next	MR_trace_cmd_nondet_stack(char **words, int word_count,
 			MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info,
@@ -3156,13 +3154,13 @@
 	return KEEP_INTERACTING;
 }
 
-#ifdef	MR_TRACE_HISTOGRAM
-
 static MR_Next
 MR_trace_cmd_histogram_all(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
 	MR_Event_Info *event_info, MR_Event_Details *event_details,
 	MR_Code **jumpaddr)
 {
+#ifdef	MR_TRACE_HISTOGRAM
+
 	if (word_count == 2) {
 		FILE	*fp;
 
@@ -3189,6 +3187,13 @@
 		MR_trace_usage("exp", "histogram_all");
 	}
 
+#else	/* MR_TRACE_HISTOGRAM */
+
+	fprintf(MR_mdb_out, "mdb: the `histogram_all' command is available "
+		"only when histogram gathering is enabled.\n");
+
+#endif	/* MR_TRACE_HISTOGRAM */
+
 	return KEEP_INTERACTING;
 }
 
@@ -3197,6 +3202,8 @@
 	MR_Event_Info *event_info, MR_Event_Details *event_details,
 	MR_Code **jumpaddr)
 {
+#ifdef	MR_TRACE_HISTOGRAM
+
 	if (word_count == 2) {
 		FILE	*fp;
 
@@ -3223,6 +3230,13 @@
 		MR_trace_usage("exp", "histogram_exp");
 	}
 
+#else	/* MR_TRACE_HISTOGRAM */
+
+	fprintf(MR_mdb_out, "mdb: the `histogram_exp' command is available "
+		"only when histogram gathering is enabled.\n");
+
+#endif	/* MR_TRACE_HISTOGRAM */
+
 	return KEEP_INTERACTING;
 }
 
@@ -3231,6 +3245,8 @@
 	MR_Trace_Cmd_Info *cmd, MR_Event_Info *event_info,
 	MR_Event_Details *event_details, MR_Code **jumpaddr)
 {
+#ifdef	MR_TRACE_HISTOGRAM
+
 	if (word_count == 1) {
 		int i;
 
@@ -3241,18 +3257,23 @@
 		MR_trace_usage("exp", "clear_histogram");
 	}
 
-	return KEEP_INTERACTING;
-}
+#else	/* MR_TRACE_HISTOGRAM */
+
+	fprintf(MR_mdb_out, "mdb: the `clear_histogram' command is available "
+		"only when histogram gathering is enabled.\n");
 
 #endif	/* MR_TRACE_HISTOGRAM */
 
-#ifdef	MR_USE_MINIMAL_MODEL
+	return KEEP_INTERACTING;
+}
 
 static MR_Next
 MR_trace_cmd_gen_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
 	MR_Event_Info *event_info, MR_Event_Details *event_details,
 	MR_Code **jumpaddr)
 {
+#ifdef	MR_USE_MINIMAL_MODEL
+
 	if (word_count == 1) {
 		MR_bool	saved_tabledebug;
 
@@ -3265,11 +3286,16 @@
 		MR_trace_usage("developer", "gen_stack");
 	}
 
+#else	/* MR_USE_MINIMAL_MODEL */
+
+	fprintf(MR_mdb_out, "mdb: the `gen_stack' command is available "
+		"only in minimal model grades.\n");
+
+#endif	/* MR_USE_MINIMAL_MODEL */
+
 	return KEEP_INTERACTING;
 }
 
-#endif
-
 static MR_Next
 MR_trace_cmd_nondet_stack(char **words, int word_count, MR_Trace_Cmd_Info *cmd,
 	MR_Event_Info *event_info, MR_Event_Details *event_details,
@@ -6187,19 +6213,15 @@
 	{ "misc", "quit", MR_trace_cmd_quit,
 		MR_trace_quit_cmd_args, NULL},
 
-#ifdef	MR_TRACE_HISTOGRAM
 	{ "exp", "histogram_all", MR_trace_cmd_histogram_all,
 		NULL, MR_trace_filename_completer },
 	{ "exp", "histogram_exp", MR_trace_cmd_histogram_exp,
 		NULL, MR_trace_filename_completer },
 	{ "exp", "clear_histogram", MR_trace_cmd_clear_histogram,
 		NULL, MR_trace_null_completer },
-#endif
 
-#ifdef	MR_USE_MINIMAL_MODEL
 	{ "developer", "gen_stack", MR_trace_cmd_gen_stack,
 		NULL, MR_trace_null_completer },
-#endif
 	{ "developer", "nondet_stack", MR_trace_cmd_nondet_stack,
 		MR_trace_stack_cmd_args, MR_trace_null_completer },
 	{ "developer", "stack_regs", MR_trace_cmd_stack_regs,
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