mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 12:53:47 +00:00
Estimated hours taken: 80 Add a front end to the declarative debugger, written in Mercury. Modify the back end to call this whenever an EDT is built. Also, various bug fixes and improvements. browser/declarative_debugger.m: New module. This is a first implementation of the front end of the declarative debugger. It uses a simple top-down algorithm to search the EDT for a buggy node. The results are printed in a simple format to the output stream. It is called from the back end, in trace/mercury_trace_declarative.c. browser/declarative_oracle.m: New module. This is a first implementation of an oracle for the declarative debugger. It simply passes all queries directly on to the user. browser/browser_library.m: Import the new modules. trace/mercury_trace_declarative.c: - Various fixes/improvements of comments. - Fix bugs where `int' is used instead of `Unsigned'. - Pass the event_info structure to MR_trace_decl_update_path, rather than passing various components of it. - Use the copy of MR_trace_event_number in the event_info structure rather than referring to the global variable directly. - Remove the EDT printing functions, as they have been superseded by the new front end. Call the new front end instead of these old functions. - Provide an interface to the EDT nodes that is imported by the front end. - Ensure that, after diagnosis, we end up at the same event we started at. - Fix a bug where it was assumed all procedures had at least one argument. - Ensure that the user is notified if the dd_wrong operation cannot be started due to MR_trace_retry failing. trace/mercury_trace_declarative.h: - Move a #include to the correct place. - Declare the interface to the EDT nodes. trace/mercury_trace_internal.c: Fix a bug introduced earlier. runtime/mercury_conf_param.h: Add a new configuration macro, MR_DEBUG_DD_BACK_END. When defined this causes information about the declarative debugger back end to be printed out during operation.
33 lines
1.1 KiB
Mathematica
33 lines
1.1 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% Copyright (C) 1998-1999 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU Library General
|
|
% Public License - see the file COPYING.LIB in the Mercury distribution.
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module browser_library.
|
|
|
|
:- interface.
|
|
|
|
:- pred browser_library__version(string::out) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module browse, frame, help, parse, util.
|
|
:- import_module debugger_interface, declarative_debugger, declarative_oracle.
|
|
:- import_module interactive_query, dl, name_mangle.
|
|
|
|
% See library/library.m for why we implement this predicate this way.
|
|
|
|
:- pragma c_code(browser_library__version(Version::out),
|
|
will_not_call_mercury, "
|
|
ConstString version_string =
|
|
MR_VERSION "", configured for "" MR_FULLARCH;
|
|
/*
|
|
** Cast away const needed here, because Mercury declares Version
|
|
** with type String rather than ConstString.
|
|
*/
|
|
Version = (String) (Word) version_string;
|
|
").
|
|
|
|
%---------------------------------------------------------------------------%
|