Files
mercury/browser/mdb.m
Zoltan Somogyi ecdc285bc7 Split the existing browser library into two libraries, by making the
Estimated hours taken: 10
Branches: main

Split the existing browser library into two libraries, by making the
program_representation module into its own library. This is useful because
the compiler refers to program_representation.m, whose code thus needs to be
linked into compiler executables even if the compiler isn't compiled with
debugging enabled. By creating a new library for this module, we avoid any
chance of the linker dragging in the rest of the modules in the browser
library. (This is a problem with an upcoming diff.).

The name of the new library is "mdbcomp", because the intention is that it
contain code that is shared between the debugger and the compiler. This means
mostly the definitions of data structures that the compiler generates for the
debugger, and the predicates that operate on them.

Mmake.common.in:
	Allow MDB_COMP_ as a prefix for symbol names in the browser directory.

Mmake.workspace:
	Add a make variable holding for the name of the new library, and
	add the name to the relevant lists of libraries.

	Avoid duplicating the lists of filenames that need to be updated
	when adding new libraries or changing their names.

Mmakefile:
	Use make variables to refer to library names.

browser/mdbcomp.m:
browser/mer_mdbcomp.m:
	Add these files as the top modules of the new library.

browser/program_representation.m:
	Make program_representation.m a submodule of mdbcomp, not mdb.

browser/program_representation.m:
browser/browser_info.m:
	Move a predicate from program_representation.m to browser_info.m
	to avoid the mdbcomp library depend on the browser library, since
	this would negate the point of the exercise.

browser/mdb.m:
	Delete program_representation.m from the list of submodules.

browser/Mmakefile:
	Update this file to handle the new module.

browser/Mercury.options:
	Mention the new module.

browser/*.m:
	Update the lists of imported modules. Import only one browser module
	per line.

compiler/notes/overall_design.html:
	Document the new library.

compiler/compile_target_code.m:
	Add the mdbcomp library to the list of libraries we need to link with.

compiler/prog_rep.m:
trace/mercury_trace_internal.c:
	Import program_representation.m by its new name.

scripts/c2init.in:
	Centralize knowledge about which files need to be updated when the list
	of libraries changes here.

scripts/c2init.in:
scripts/ml.in:
tools/binary:
tools/binary_step:
tools/bootcheck:
tools/linear:
tools/lml:
	Update the list of libraries programs are linked with.
2003-10-27 06:00:50 +00:00

64 lines
1.9 KiB
Mathematica

%---------------------------------------------------------------------------%
% Copyright (C) 1998-2003 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 mdb.
:- interface.
:- import_module mdbcomp.
:- pred mdb__version(string::out) is det.
% These interface modules are used directly by the test programs
% or the libmer_trace library.
:- include_module browse.
:- include_module browser_info.
:- include_module collect_lib.
:- include_module debugger_interface.
:- include_module declarative_debugger.
:- include_module declarative_execution.
:- include_module help.
:- include_module interactive_query.
:- include_module io_action.
:- implementation.
:- include_module declarative_analyser.
:- include_module declarative_oracle.
:- include_module declarative_tree.
:- include_module declarative_user.
:- include_module frame.
:- include_module parse.
:- include_module sized_pretty.
:- include_module util.
:- include_module set_cc.
:- include_module tree234_cc.
% XXX these modules are more generally useful, but the
% dynamic linking library is not yet installed anywhere.
:- include_module dl.
:- include_module name_mangle.
% See library/library.m for why we implement this predicate this way.
:- pragma foreign_proc("C",
mdb__version(Version::out),
[will_not_call_mercury, promise_pure, thread_safe],
"
MR_ConstString version_string =
MR_VERSION "", configured for "" MR_FULLARCH;
/*
** Cast away const needed here, because Mercury declares Version
** with type MR_String rather than MR_ConstString.
*/
Version = (MR_String) (MR_Word) version_string;
").
mdb__version("unknown version").
%---------------------------------------------------------------------------%