Files
mercury/scripts/init_grade_options.sh-subr
Zoltan Somogyi c0f4d93a3c Add a new grade component, .decldebug. It is as proposed on mercury-developers,
Estimated hours taken: 2
Branches: main

Add a new grade component, .decldebug. It is as proposed on mercury-developers,
minus the implications about I/O tabling. Those will come later.

compiler/options.m:
	Add a new option, --decl-debug, that switches on declarative debugging.

compiler/trace_params.m:
	The procedure that converts strings representing trace levels to trace
	levels themselves now has an extra argument, which gives the value of
	the --decl-debug option. If set, it raises the minimum trace level,
	and turn explicitly specifying trace levels `shallow' and `deep'
	into errors (since they are not sufficient for declarative debugging).

compiler/handle_options.m:
	Pass the value of the --decl-debug option to trace_params, and handle
	the errors that may result. Handle the implications of --decl-debug
	and the .decldebug grade component.

compiler/compile_target_code.m:
	Define MR_DECL_DEBUG when invoking the C compiler if --decl-debug is
	set.

runtime/mercury_conf_param.h:
	Document MR_DECL_DEBUG, which is defined iff the grade is a .decldebug
	grade.

runtime/mercury_grade.h:
	Take MR_DECL_DEBUG into account when computing the grade component
	related to debugging.

	Update the list of places that need to be modified when adding new
	grade components.

doc/user_guide.texi:
	Document --decl-debug and the .decldebug grade component.

	Document the events used by declarative debugging, since Mark didn't.

	Fix some minor unrelated omissions.

scripts/init_grade.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/final_grade.sh-subr:
scripts/canonical_grade.sh-subr:
scripts/mgnuc.in:
scripts/ml.in:
	Add a new shell variable, decl_debug, to represent the value of
	MR_DECL_DEBUG, and handle it as appropriate.

tests/debugger/Mmakefile:
	Do not execute shallow traced tests in .decldebug grades, since we
	don't support shallow tracing in such grades.

	Specify --trace decl instead of --trace deep in .decldebug grades
	when compiling the other tests, since we don't support --trace deep
	in .decldebug grades.
2002-09-01 06:05:20 +00:00

81 lines
2.2 KiB
Plaintext

#---------------------------------------------------------------------------#
# Copyright (C) 1997-2002 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#---------------------------------------------------------------------------#
#
# init_grade_options.sh-subr:
# An `sh' subroutine for initializing grade-related options.
# Used by the `ml', `mgnuc' and `c2init' scripts.
#
# The code here should be inserted before a script's option-parsing
# loop. The invoking script must define a DEFAULT_GRADE option.
#
# IMPORTANT: any changes to the handling of grades here may also require
# changes to all the files indicated by runtime/mercury_grade.h.
#
# This file must initialize all the shell variables used by
# parse_grade_options.sh-subr, and must list all the options processed in
# parse_grade_options.sh-subr.
#
#---------------------------------------------------------------------------#
grade_usage="\
Grade options:
-s <grade>, --grade <grade>
--target {il, c, java, asm}
--il
--asm-labels
--gcc-non-local-gotos
--gcc-global-registers
-H, --high-level-code
--parallel
--gc {boehm, mps, accurate, none}
-p, --profiling
--profile-calls
--profile-time
--profile-memory
--profile-deep
--use-trail
--reserve-tag
--use-minimal-model
--pic-reg
--no-stack-trace
--debug
--decl-debug
See the documentation in the \"Invocation\" section
of the Mercury User's Guide."
# --gcc-nested-functions is not yet documented because it is not yet stable
# --high-level-data is not yet documented because it is not yet implemented
# --high-level is not yet documented because --high-level-data is
# not yet implemented
target=c
highlevel_code=false
highlevel_data=false
gcc_nested_functions=false
asm_labels=true
non_local_gotos=true
global_regs=true
thread_safe=false
gc_method=boehm
profile_time=false
profile_calls=false
profile_memory=false
profile_deep=false
use_trail=false
reserve_tag=false
use_minimal_model=false
pic_reg=false
stack_trace=false
require_tracing=false
decl_debug=false
case $# in
0) set - --grade "$DEFAULT_GRADE" ;;
*) set - --grade "$DEFAULT_GRADE" "$@" ;;
esac
#---------------------------------------------------------------------------#