mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Improve diagnostics for bad conditions on breakpoints.
trace/mercury_trace_internal.c:
Make the diagnostic more easily readable.
trace/mercury_trace_vars.c:
Add disabled-but-could-be-enabled-again debugging code.
This commit is contained in:
@@ -201,9 +201,10 @@ MR_trace_event_internal(MR_TraceCmdInfo *cmd, MR_bool interactive,
|
||||
}
|
||||
|
||||
// We want to make sure that the Mercury code used to implement some
|
||||
// of the debugger's commands (a) doesn't generate any trace events,
|
||||
// (b) doesn't generate any unwanted debugging output, and (c) doesn't
|
||||
// do any I/O tabling.
|
||||
// of the debugger's commands
|
||||
// (a) does not generate any trace events,
|
||||
// (b) does not generate any unwanted debugging output, and
|
||||
// (c) does not do any I/O tabling.
|
||||
|
||||
MR_turn_off_debug(&MR_saved_debug_state, MR_FALSE);
|
||||
|
||||
@@ -213,8 +214,10 @@ MR_trace_event_internal(MR_TraceCmdInfo *cmd, MR_bool interactive,
|
||||
|
||||
if (MR_spy_point_cond_problem != NULL) {
|
||||
fprintf(MR_mdb_err, "mdb: couldn't evaluate break point condition\n");
|
||||
fprintf(MR_mdb_err, " ");
|
||||
MR_print_spy_cond(MR_mdb_err, MR_spy_point_cond_bad);
|
||||
fprintf(MR_mdb_err, ": %s.\n", MR_spy_point_cond_problem);
|
||||
fprintf(MR_mdb_err, ".\n");
|
||||
fprintf(MR_mdb_err, "The error is: %s.\n", MR_spy_point_cond_problem);
|
||||
MR_spy_point_cond_bad = NULL;
|
||||
MR_spy_point_cond_problem = NULL;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// vim: ts=4 sw=4 expandtab ft=c
|
||||
|
||||
// Copyright (C) 1999-2011 The University of Melbourne.
|
||||
// Copyright (C) 2014, 2016, 2018 The Mercury team.
|
||||
// Copyright (C) 2014, 2016, 2018, 2025 The Mercury team.
|
||||
// This file is distributed under the terms specified in COPYING.LIB.
|
||||
|
||||
// This file contains the code for managing information about the
|
||||
@@ -2031,6 +2031,19 @@ MR_lookup_var_spec(MR_VarSpec var_spec, MR_TypeInfo *type_info_ptr,
|
||||
}
|
||||
|
||||
if (! found) {
|
||||
#if 0
|
||||
// Enable this code if necessary for debugging.
|
||||
fprintf(stdout, "searching for %s\n",
|
||||
var_spec.MR_var_spec_name);
|
||||
for (vn = 0; vn < MR_point.MR_point_var_count; vn++) {
|
||||
value = &MR_point.MR_point_vars[vn];
|
||||
if (value->MR_value_kind == MR_VALUE_PROG_VAR) {
|
||||
fprintf(stdout, "var %d: %s\n",
|
||||
vn, value->MR_value_var.MR_var_fullname);
|
||||
}
|
||||
}
|
||||
fflush(stdout);
|
||||
#endif
|
||||
return "there is no such variable";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user