[m-rev.] for review: Delete support for browsing terms as XML.

Peter Wang novalazy at gmail.com
Wed Oct 14 14:28:51 AEDT 2020


The 'browse --xml' command has not worked with current versions of
xsltproc for quite some time, but we have not received any bug reports,
nor has anyone tried to fix it. We have a method for interactively
exploring a term in 'browse --web' so IMHO there is no need to keep
support for 'browse --xml'.

browser/browse.m:
browser/browser_info.m:
browser/declarative_user.m:
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
    Delete code.

doc/mdb_categories:
doc/user_guide.texi:
    Delete documentation.

configure.ac:
    Don't search for a XUL browser and xsltproc.

scripts/mdbrc.in:
    Delete 'xml_browser_cmd' and 'xml_tmp_filename' lines.

scripts/xul_tree.xsl:
    Delete now unused file.

scripts/Mmakefile:
    Conform to deletions.

tests/debugger/Mmakefile:
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp3:
tests/debugger/browser_test.inp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
tests/declarative_debugger/browse_arg.exp:
tests/declarative_debugger/browse_arg.inp:
    Don't test 'browse --xml' any longer.

extras/xml_stylesheets/README:
    Delete reference to 'browse --xml' command.

NEWS:
    Announce change.
---
 NEWS                                      |   4 +
 browser/browse.m                          |  82 -------
 browser/browser_info.m                    | 125 +----------
 browser/declarative_user.m                |  89 +-------
 configure.ac                              |  20 --
 doc/mdb_categories                        |   5 +-
 doc/user_guide.texi                       |  79 +------
 extras/xml_stylesheets/README             |   3 -
 scripts/Mmakefile                         |   3 -
 scripts/mdbrc.in                          |   2 -
 scripts/xul_tree.xsl                      | 258 ----------------------
 tests/debugger/Mmakefile                  |   8 +-
 tests/debugger/browser_test.exp           |  61 -----
 tests/debugger/browser_test.exp3          |  60 -----
 tests/debugger/browser_test.inp           |   4 -
 tests/debugger/completion.exp             |  81 ++++---
 tests/debugger/mdb_command_test.inp       |   2 -
 tests/debugger/save.exp2                  |   2 -
 tests/declarative_debugger/browse_arg.exp |  33 +--
 tests/declarative_debugger/browse_arg.inp |   4 -
 trace/mercury_trace_browse.c              |  18 --
 trace/mercury_trace_browse.h              |   4 -
 trace/mercury_trace_cmd_browsing.c        |  51 +----
 trace/mercury_trace_cmd_parameter.c       |  76 -------
 trace/mercury_trace_cmd_parameter.h       |   2 -
 trace/mercury_trace_internal.c            |   4 -
 26 files changed, 69 insertions(+), 1011 deletions(-)
 delete mode 100644 scripts/xul_tree.xsl

diff --git a/NEWS b/NEWS
index 27a769baa..aa3bb8453 100644
--- a/NEWS
+++ b/NEWS
@@ -149,6 +149,10 @@ Changes to the Mercury debugger
   the command is set using `list_cmd`.  For example, the command could
   produce syntax highlighted source listings.
 
+* We have removed support for browsing terms as XML (`browse --xml`)
+  as it was unmaintained and does not work any more. The `browse --web`
+  command provides another method of interactively exploring a term.
+
 
 NEWS for Mercury 20.06.1
 ========================
diff --git a/browser/browse.m b/browser/browse.m
index 78a7c14a9..f9b247fb7 100644
--- a/browser/browse.m
+++ b/browser/browse.m
@@ -146,13 +146,6 @@
 :- pred save_term_to_file_xml(string::in, browser_term::in,
     io.output_stream::in, io::di, io::uo) is cc_multi.
 
-    % Dump the term as an XML file and launch the XML browser specified
-    % by the xml_browser_cmd field in the browser_persistent_state.
-    %
-:- pred save_and_browse_browser_term_xml(browser_term::in,
-    io.output_stream::in, io.output_stream::in,
-    browser_persistent_state::in, io::di, io::uo) is cc_multi.
-
     % Save BrowserTerm in an HTML file and launch the web browser specified
     % by the web_browser_cmd field in the browser_persistent_state.
     %
@@ -236,10 +229,6 @@
 :- pragma foreign_export("C", save_term_to_file_xml(in, in, in, di, uo),
     "ML_BROWSE_save_term_to_file_xml").
 
-:- pragma foreign_export("C",
-    save_and_browse_browser_term_xml(in, in, in, in, di, uo),
-    "ML_BROWSE_browse_term_xml").
-
 :- pragma foreign_export("C",
     save_and_browse_browser_term_web(in, in, in, in, di, uo),
     "ML_BROWSE_browse_term_web").
@@ -1397,77 +1386,6 @@ maybe_save_term_to_file_xml(FileName, BrowserTerm, FileStreamRes, !IO) :-
 
 %---------------------------------------------------------------------------%
 
-save_and_browse_browser_term_xml(Term, OutStream, ErrStream, State, !IO) :-
-    MaybeXMLBrowserCmd = State ^ xml_browser_cmd,
-    MaybeTmpFileName = State ^ xml_tmp_filename,
-    (
-        MaybeXMLBrowserCmd = yes(CommandStr),
-        MaybeTmpFileName = yes(TmpFileName),
-        io.write_string(OutStream, "Saving term to XML file...\n", !IO),
-        maybe_save_term_to_file_xml(TmpFileName, Term, SaveResult, !IO),
-        (
-            SaveResult = ok(_),
-            launch_xml_browser(OutStream, ErrStream, CommandStr, !IO)
-        ;
-            SaveResult = error(Error),
-            io.error_message(Error, Msg),
-            io.write_string(ErrStream,
-                "Error opening file `" ++ TmpFileName ++ "': ", !IO),
-            io.write_string(ErrStream, Msg, !IO),
-            io.nl(!IO)
-        )
-    ;
-        MaybeXMLBrowserCmd = yes(_),
-        MaybeTmpFileName = no,
-        io.write_string(ErrStream, "mdb: You need to issue a " ++
-            "\"set xml_tmp_filename '<filename>'\" command first.\n", !IO)
-    ;
-        MaybeXMLBrowserCmd = no,
-        MaybeTmpFileName = yes(_),
-        io.write_string(ErrStream, "mdb: You need to issue a " ++
-            "\"set xml_browser_cmd '<command>'\" command first.\n", !IO)
-    ;
-        MaybeXMLBrowserCmd = no,
-        MaybeTmpFileName = no,
-        io.write_string(ErrStream, "mdb: You need to issue a " ++
-            "\"set xml_browser_cmd '<command>'\" command\n" ++
-            "and a \"set xml_tmp_filename '<filename>'\" command first.\n",
-            !IO)
-    ).
-
-:- pred launch_xml_browser(io.output_stream::in, io.output_stream::in,
-    string::in, io::di, io::uo) is det.
-
-launch_xml_browser(OutStream, ErrStream, CommandStr, !IO) :-
-    io.write_string(OutStream, "Launching XML browser "
-        ++ "(this may take some time) ...\n", !IO),
-    % Flush the output stream, so output appears in the correct order
-    % for tests where the `cat' command is used as the XML browser.
-    io.flush_output(OutStream, !IO),
-    io.call_system_return_signal(CommandStr, Result, !IO),
-    (
-        Result = ok(ExitStatus),
-        (
-            ExitStatus = exited(ExitCode),
-            ( if ExitCode = 0 then
-                true
-            else
-                io.write_string(ErrStream,
-                    "mdb: The command `" ++ CommandStr ++
-                    "' terminated with a non-zero exit code.\n", !IO)
-            )
-        ;
-            ExitStatus = signalled(_),
-            io.write_string(ErrStream, "mdb: The browser was killed.\n", !IO)
-        )
-    ;
-        Result = error(Error),
-        io.write_string(ErrStream, "mdb: Error launching browser: "
-            ++ string.string(Error) ++ ".\n", !IO)
-    ).
-
-%---------------------------------------------------------------------------%
-
 save_and_browse_browser_term_web(Term, OutStream, ErrStream, State, !IO) :-
     get_mdb_dir(MaybeMdbDir, !IO),
     (
diff --git a/browser/browser_info.m b/browser/browser_info.m
index e4ed5c678..614015944 100644
--- a/browser/browser_info.m
+++ b/browser/browser_info.m
@@ -181,12 +181,6 @@
 :- pred info_set_num_io_actions(int::in,
     browser_info::in, browser_info::out) is det.
 
-:- pred info_set_xml_browser_cmd(string::in,
-    browser_info::in, browser_info::out) is det.
-
-:- pred info_set_xml_tmp_filename(string::in,
-    browser_info::in, browser_info::out) is det.
-
 :- pred info_set_web_browser_cmd(string::in,
     browser_info::in, browser_info::out) is det.
 
@@ -198,14 +192,6 @@
     %
 :- type browser_persistent_state.
 
-:- func browser_persistent_state ^ xml_browser_cmd = maybe(string).
-:- func browser_persistent_state ^ xml_browser_cmd := maybe(string) =
-    browser_persistent_state.
-
-:- func browser_persistent_state ^ xml_tmp_filename = maybe(string).
-:- func browser_persistent_state ^ xml_tmp_filename := maybe(string) =
-    browser_persistent_state.
-
 :- func browser_persistent_state ^ web_browser_cmd = maybe(string).
 :- func browser_persistent_state ^ web_browser_cmd := maybe(string) =
     browser_persistent_state.
@@ -262,15 +248,6 @@
     ;       format_param(maybe_option_table(setting_option), setting)
     ;       num_io_actions(int)
     ;       print_params.
-% We can't set the browser command from within the browser because we parse
-% user commands from the browser by breaking them up into words at whitespace,
-% which doesn't respect quotation marks. Since the browser command will usually
-% include spaces, this parsing method would need to be changed before we could
-% include xml_browser_cmd here. And until we handle xml_browser_cmd, there is
-% no point in handling xml_tmp_filename.
-%
-%   ;       xml_browser_cmd(string)
-%   ;       xml_tmp_filename(string)
 
 :- type debugger
     --->    debugger_internal
@@ -432,16 +409,6 @@ info_set_num_io_actions(N, !Info) :-
     set_num_io_actions(N, PersistentState0, PersistentState),
     !Info ^ bri_state := PersistentState.
 
-info_set_xml_browser_cmd(Cmd, !Info) :-
-    PersistentState0 = !.Info ^ bri_state,
-    set_xml_browser_cmd_from_mdb(Cmd, PersistentState0, PersistentState),
-    !Info ^ bri_state := PersistentState.
-
-info_set_xml_tmp_filename(FileName, !Info) :-
-    PersistentState0 = !.Info ^ bri_state,
-    set_xml_tmp_filename_from_mdb(FileName, PersistentState0, PersistentState),
-    !Info ^ bri_state := PersistentState.
-
 info_set_web_browser_cmd(Cmd, !Info) :-
     PersistentState0 = !.Info ^ bri_state,
     set_web_browser_cmd_from_mdb(Cmd, PersistentState0, PersistentState),
@@ -509,58 +476,6 @@ set_format_from_mdb(P, B, A, Format, !Browser) :-
     set_browser_param(no, P, B, A, no, no, no, no, setting_format(Format),
         !Browser).
 
-:- pred get_xml_browser_cmd_from_mdb(browser_persistent_state::in,
-    string::out) is det.
-:- pragma foreign_export("C", get_xml_browser_cmd_from_mdb(in, out),
-    "ML_BROWSE_get_xml_browser_cmd_from_mdb").
-
-get_xml_browser_cmd_from_mdb(Browser, Command) :-
-    MaybeCommand = Browser ^ xml_browser_cmd,
-    (
-        MaybeCommand = no,
-        Command = ""
-    ;
-        MaybeCommand = yes(Command)
-    ).
-
-:- pred set_xml_browser_cmd_from_mdb(string::in,
-    browser_persistent_state::in, browser_persistent_state::out) is det.
-:- pragma foreign_export("C", set_xml_browser_cmd_from_mdb(in, in, out),
-    "ML_BROWSE_set_xml_browser_cmd_from_mdb").
-
-set_xml_browser_cmd_from_mdb(Command, !Browser) :-
-    ( if Command = "" then
-        !Browser ^ xml_browser_cmd := no
-    else
-        !Browser ^ xml_browser_cmd := yes(Command)
-    ).
-
-:- pred get_xml_tmp_filename_from_mdb(browser_persistent_state::in,
-    string::out) is det.
-:- pragma foreign_export("C", get_xml_tmp_filename_from_mdb(in, out),
-    "ML_BROWSE_get_xml_tmp_filename_from_mdb").
-
-get_xml_tmp_filename_from_mdb(Browser, FileName) :-
-    MaybeFileName = Browser ^ xml_tmp_filename,
-    (
-        MaybeFileName = no,
-        FileName = ""
-    ;
-        MaybeFileName = yes(FileName)
-    ).
-
-:- pred set_xml_tmp_filename_from_mdb(string::in,
-    browser_persistent_state::in, browser_persistent_state::out) is det.
-:- pragma foreign_export("C", set_xml_tmp_filename_from_mdb(in, in, out),
-    "ML_BROWSE_set_xml_tmp_filename_from_mdb").
-
-set_xml_tmp_filename_from_mdb(FileName, !Browser) :-
-    ( if FileName = "" then
-        !Browser ^ xml_tmp_filename := no
-    else
-        !Browser ^ xml_tmp_filename := yes(FileName)
-    ).
-
 :- pred get_web_browser_cmd_from_mdb(browser_persistent_state::in,
     string::out) is det.
 :- pragma foreign_export("C", get_web_browser_cmd_from_mdb(in, out),
@@ -613,12 +528,6 @@ mercury_bool_no = no.
                 print_all_params        :: caller_params,
                 num_printed_io_actions  :: int,
 
-                % The command to launch the user's preferred XML browser.
-                xml_browser_cmd         :: maybe(string),
-
-                % The file to save XML to before launching the browser.
-                xml_tmp_filename        :: maybe(string),
-
                 % The command to launch the user's preferred web browser.
                 web_browser_cmd         :: maybe(string)
             ).
@@ -658,7 +567,7 @@ init_persistent_state(State) :-
     Browse = caller_type_browse_defaults,
     PrintAll = caller_type_print_all_defaults,
     State = browser_persistent_state(Print, Browse, PrintAll,
-        num_printed_io_actions_default, no, no, no).
+        num_printed_io_actions_default, no).
 
 :- func caller_type_print_defaults = caller_params.
 
@@ -740,7 +649,6 @@ set_browser_param(FromBrowser, P0, B0, A0, F0, Pr0, V0, NPr0, Setting,
     maybe_set_param(A, F, Pr, V, NPr, Setting, AParams0, AParams),
     !:State = browser_persistent_state(PParams, BParams, AParams,
         !.State ^ num_printed_io_actions,
-        !.State ^ xml_browser_cmd, !.State ^ xml_tmp_filename,
         !.State ^ web_browser_cmd).
 
 set_browser_param_with_caller_type(CallerType, P0, B0, A0, F0, Pr0, V0, NPr0,
@@ -768,7 +676,6 @@ set_browser_param_with_caller_type(CallerType, P0, B0, A0, F0, Pr0, V0, NPr0,
     maybe_set_param(A, F, Pr, V, NPr, Setting, AParams0, AParams),
     !:State = browser_persistent_state(PParams, BParams, AParams,
         !.State ^ num_printed_io_actions,
-        !.State ^ xml_browser_cmd, !.State ^ xml_tmp_filename,
         !.State ^ web_browser_cmd).
 
 set_browser_param_maybe_caller_type(FromBrowser, MaybeCallerType,
@@ -924,12 +831,6 @@ run_param_command(Debugger, ParamCmd, ShowPath, !PersistentState, !IO) :-
     ;
         ParamCmd = print_params,
         show_settings(Debugger, ShowPath, !.PersistentState, !IO)
-%   ;
-%       ParamCmd = xml_browser_cmd(Cmd),
-%       set_xml_browser_cmd(Cmd, !PersistentState)
-%   ;
-%       ParamCmd = xml_tmp_filename(FileName),
-%       set_xml_tmp_filename(FileName, !PersistentState)
     ).
 
 %---------------------------------------------------------------------------%
@@ -1134,34 +1035,13 @@ send_term_to_socket(Term, !IO) :-
 
 browser_params_to_string(Browser, Desc) :-
     Browser = browser_persistent_state(PrintParams, BrowseParams,
-        PrintAllParams, NumIOActions, MaybeXMLBrowserCmd, MaybeXMLTmpFileName,
-        MaybeWebBrowserCmd),
+        PrintAllParams, NumIOActions, MaybeWebBrowserCmd),
     ParamCmds =
         caller_params_to_mdb_command("-P ", PrintParams) ++
         caller_params_to_mdb_command("-B ", BrowseParams) ++
         caller_params_to_mdb_command("-A ", PrintAllParams),
     NumIOActionCmd =
         "max_io_actions " ++ int_to_string(NumIOActions) ++ "\n",
-    ( if
-        MaybeXMLBrowserCmd = yes(XMLBrowserCmd),
-        % XMLBrowserCmd shouldn't be "" if MaybeXMLBrowserCmd is yes,
-        % but better safe than sorry.
-        XMLBrowserCmd \= ""
-    then
-        XMLBrowserCmdCmd = "xml_browser_cmd " ++ XMLBrowserCmd ++ "\n"
-    else
-        XMLBrowserCmdCmd = ""
-    ),
-    ( if
-        MaybeXMLTmpFileName = yes(XMLTmpFileName),
-        % XMLTmpFileName shouldn't be "" if MaybeXMLTmpFileName is yes,
-        % but better safe than sorry.
-        XMLTmpFileName \= ""
-    then
-        XMLTmpFileNameCmd = "xml_tmp_filename " ++ XMLTmpFileName ++ "\n"
-    else
-        XMLTmpFileNameCmd = ""
-    ),
     ( if
         MaybeWebBrowserCmd = yes(WebBrowserCmd),
         WebBrowserCmd \= ""
@@ -1171,7 +1051,6 @@ browser_params_to_string(Browser, Desc) :-
         WebBrowserCmdCmd = ""
     ),
     Desc = ParamCmds ++ NumIOActionCmd ++
-        XMLBrowserCmdCmd ++ XMLTmpFileNameCmd ++
         WebBrowserCmdCmd.
 
 :- func caller_params_to_mdb_command(string, caller_params) = string.
diff --git a/browser/declarative_user.m b/browser/declarative_user.m
index 02bb3e009..a9d4f1fd0 100644
--- a/browser/declarative_user.m
+++ b/browser/declarative_user.m
@@ -152,9 +152,6 @@
             % Browse the nth argument before answering. Or browse
             % the whole predicate/function if the maybe is no.
 
-    ;       user_cmd_browse_xml_arg(maybe(int))
-            % Browse the argument using an XML browser.
-
     ;       user_cmd_browse_io(int)
             % Browse the nth IO action before answering.
 
@@ -329,18 +326,6 @@ handle_command(Cmd, UserQuestion, Response, !User, !IO) :-
                 query_user(UserQuestion, Response, !User, !IO)
             )
         )
-    ;
-        Cmd = user_cmd_browse_xml_arg(MaybeArgNum),
-        Question = get_decl_question(UserQuestion),
-        edt_node_trace_atoms(Question, _, FinalAtom),
-        (
-            MaybeArgNum = yes(ArgNum),
-            browse_xml_atom_argument(FinalAtom, ArgNum, !.User, !IO)
-        ;
-            MaybeArgNum = no,
-            browse_xml_atom(FinalAtom, !.User, !IO)
-        ),
-        query_user(UserQuestion, Response, !User, !IO)
     ;
         Cmd = user_cmd_print_arg(From, To),
         Question = get_decl_question(UserQuestion),
@@ -640,19 +625,6 @@ browse_decl_bug(Bug, MaybeArgNum, !User, !IO) :-
         browse_atom(InitAtom, FinalAtom, _, !User, !IO)
     ).
 
-:- pred browse_xml_decl_bug(decl_bug::in, maybe(int)::in, user_state::in,
-    io::di, io::uo) is cc_multi.
-
-browse_xml_decl_bug(Bug, MaybeArgNum, User, !IO) :-
-    decl_bug_trace_atom(Bug, _, FinalAtom),
-    (
-        MaybeArgNum = yes(ArgNum),
-        browse_xml_atom_argument(FinalAtom, ArgNum, User, !IO)
-    ;
-        MaybeArgNum = no,
-        browse_xml_atom(FinalAtom, User, !IO)
-    ).
-
 :- pred browse_atom_argument(trace_atom::in, trace_atom::in, int::in,
     maybe_track_subterm(term_path)::out, user_state::in, user_state::out,
     io::di, io::uo) is cc_multi.
@@ -679,24 +651,6 @@ browse_atom_argument(InitAtom, FinalAtom, ArgNum, MaybeTrack, !User, !IO) :-
         MaybeTrack = no_track
     ).
 
-:- pred browse_xml_atom_argument(trace_atom::in, int::in, user_state::in,
-    io::di, io::uo) is cc_multi.
-
-browse_xml_atom_argument(Atom, ArgNum, User, !IO) :-
-    Atom = atom(_, Args0),
-    maybe_filter_headvars(chosen_head_vars_presentation, Args0, Args),
-    ( if
-        list.index1(Args, ArgNum, ArgInfo),
-        ArgInfo = arg_info(_, _, MaybeArg),
-        MaybeArg = yes(ArgRep),
-        term_rep.rep_to_univ(ArgRep, Arg)
-    then
-        save_and_browse_browser_term_xml(univ_to_browser_term(Arg),
-            User ^ outstr, User ^ outstr, User ^ browser, !IO)
-    else
-        io.write_string(User ^ outstr, "Invalid argument number\n", !IO)
-    ).
-
 :- pred browse_atom(trace_atom::in, trace_atom::in,
     maybe_track_subterm(term_path)::out,
     user_state::in, user_state::out, io::di, io::uo) is cc_multi.
@@ -717,21 +671,6 @@ browse_atom(InitAtom, FinalAtom, MaybeTrack, !User, !IO) :-
         MaybeTrackDirs, MaybeTrack),
     !User ^ browser := Browser.
 
-:- pred browse_xml_atom(trace_atom::in, user_state::in, io::di, io::uo)
-    is cc_multi.
-
-browse_xml_atom(Atom, User, !IO) :-
-    Atom = atom(ProcLayout, Args),
-    ProcLabel = get_proc_label_from_layout(ProcLayout),
-    get_user_arg_values(Args, ArgValues),
-    get_pred_attributes(ProcLabel, Module, Name, _, PredOrFunc),
-    IsFunction = pred_to_bool(unify(PredOrFunc, pf_function)),
-    ModuleStr = sym_name_to_string(Module),
-    BrowserTerm = synthetic_term_to_browser_term(ModuleStr ++ "." ++ Name,
-        ArgValues, IsFunction),
-    save_and_browse_browser_term_xml(BrowserTerm, User ^ outstr,
-        User ^ outstr, User ^ browser, !IO).
-
 :- func get_subterm_mode_from_atoms(trace_atom::in, trace_atom::in,
     list(down_dir)::in) = (browser_term_mode::out) is det.
 
@@ -924,8 +863,6 @@ cmd_handler("size",     format_param_arg_cmd("size")).
 cmd_handler("width",    format_param_arg_cmd("width")).
 cmd_handler("lines",    format_param_arg_cmd("lines")).
 cmd_handler("actions",  num_io_actions_cmd).
-% cmd_handler("xml_browser_cmd", set_xml_browser_cmd_cmd).
-% cmd_handler("xml_tmp_filename", set_xml_tmp_filename_cmd).
 cmd_handler("t",        trust_arg_cmd).
 cmd_handler("trust",    trust_arg_cmd).
 cmd_handler("mode",     search_mode_cmd).
@@ -942,16 +879,8 @@ one_word_cmd(Cmd, [], Cmd).
 
 browse_arg_cmd([], user_cmd_browse_arg(no)).
 browse_arg_cmd([Arg], BrowseCmd) :-
-    ( if string.to_int(Arg, ArgNum) then
-        BrowseCmd = user_cmd_browse_arg(yes(ArgNum))
-    else
-        ( Arg = "-x" ; Arg = "--xml" ),
-        BrowseCmd = user_cmd_browse_xml_arg(no)
-    ).
-browse_arg_cmd(["-x", Arg], user_cmd_browse_xml_arg(yes(ArgNum))) :-
-    string.to_int(Arg, ArgNum).
-browse_arg_cmd(["--xml", Arg], user_cmd_browse_xml_arg(yes(ArgNum))) :-
-    string.to_int(Arg, ArgNum).
+    string.to_int(Arg, ArgNum),
+    BrowseCmd = user_cmd_browse_arg(yes(ArgNum)).
 browse_arg_cmd(["io", Arg], user_cmd_browse_io(ArgNum)) :-
     string.to_int(Arg, ArgNum).
 
@@ -1009,16 +938,6 @@ format_param_arg_cmd(Cmd, ArgWords0, Command) :-
 num_io_actions_cmd([Arg], user_cmd_param_command(num_io_actions(N))) :-
     string.to_int(Arg, N).
 
-% :- func set_xml_browser_cmd_cmd(list(string)::in) = (user_command::out)
-%     is semidet.
-%
-% set_xml_browser_cmd_cmd([Arg]) = param_command(xml_browser_cmd(Arg)).
-%
-% :- func set_xml_tmp_filename_cmd(list(string)::in) = (user_command::out)
-%     is semidet.
-%
-% set_xml_tmp_filename_cmd([Arg]) = param_command(xml_tmp_filename(Arg)).
-
 :- pred trust_arg_cmd(list(string)::in, user_command::out) is semidet.
 
 trust_arg_cmd([], user_cmd_trust_predicate).
@@ -1094,10 +1013,6 @@ user_confirm_bug(Bug, Response, !User, !IO) :-
             Command = user_cmd_browse_arg(MaybeArgNum),
             browse_decl_bug(Bug, MaybeArgNum, !User, !IO),
             user_confirm_bug(Bug, Response, !User, !IO)
-        ;
-            Command = user_cmd_browse_xml_arg(MaybeArgNum),
-            browse_xml_decl_bug(Bug, MaybeArgNum, !.User, !IO),
-            user_confirm_bug(Bug, Response, !User, !IO)
         ;
             Command = user_cmd_browse_io(ActionNum),
             decl_bug_io_actions(Bug, MaybeIoActions),
diff --git a/configure.ac b/configure.ac
index 57d8701c7..de9f3a2a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5490,26 +5490,6 @@ then
     fi
 fi
 
-#-----------------------------------------------------------------------------#
-#
-# Check for a XUL browser and xsltproc and if we find both then set the
-# default xml_browser_command and xml_tmp_filename mdb options.
-#
-
-AC_PATH_PROGS(XUL_BROWSER, firefox mozilla, "")
-AC_PATH_PROGS(XSLTPROC, xsltproc, "")
-
-if test "$XUL_BROWSER" != "" && test "$XSLTPROC" != ""; then
-    DEFAULT_XML_BROWSER_CMD="$XSLTPROC $DEFAULT_MERCURY_DEBUGGER_INIT_DIR/xul_tree.xsl $TMPDIR/mdbtmp.xml > $TMPDIR/mdbtmp.xul && $XUL_BROWSER file://$TMPDIR/mdbtmp.xul"
-    DEFAULT_XML_TMP_FILENAME="$TMPDIR/mdbtmp.xml"
-else
-    DEFAULT_XML_BROWSER_CMD=""
-    DEFAULT_XML_TMP_FILENAME=""
-fi
-
-AC_SUBST(DEFAULT_XML_BROWSER_CMD)
-AC_SUBST(DEFAULT_XML_TMP_FILENAME)
-
 #-----------------------------------------------------------------------------#
 #
 # Set the default web_browser_cmd.
diff --git a/doc/mdb_categories b/doc/mdb_categories
index 7942a7724..f2437f858 100644
--- a/doc/mdb_categories
+++ b/doc/mdb_categories
@@ -49,9 +49,8 @@ parameter  - Commands that let users access debugger parameters.
              `stack_default_limit', `goal_paths' `scope', `echo', 
              `context', `user_event_context', `list_context_lines',
 	     `list_path', `push_list_dir', `pop_list_dir', `fail_trace_counts',
-	     `pass_trace_counts', `max_io_actions', `xml_browser_cmd',
-	     `xml_tmp_filename', `format', `format_param', `alias'
-	     and `unalias'.
+	     `pass_trace_counts', `max_io_actions', `format', `format_param',
+	     `alias' and `unalias'.
 
 end
 document_category 800 help
diff --git a/doc/user_guide.texi b/doc/user_guide.texi
index 8de22baae..34171077e 100644
--- a/doc/user_guide.texi
+++ b/doc/user_guide.texi
@@ -3169,8 +3169,8 @@ and @samp{-v} or @samp{--verbose} specify the format to use for printing.
 @c The options @samp{-f} or @samp{--flat}, @samp{-p} or @samp{--pretty},
 @c and @samp{-v} or @samp{--verbose} specify the format to use for printing.
 @sp 1
- at item browse [-fpvxw] @var{name}[@var{termpath}]
- at itemx browse [-fpvxw] @var{num}[@var{termpath}]
+ at item browse [-fpvw] @var{name}[@var{termpath}]
+ at itemx browse [-fpvw] @var{num}[@var{termpath}]
 @kindex browse (mdb command)
 Invokes an interactive term browser to browse
 the value of the variable in the current environment
@@ -3185,11 +3185,6 @@ The displayed terms may also be clipped to fit within a single screen.
 @sp 1
 The options @samp{-f} or @samp{--flat}, @samp{-p} or @samp{--pretty},
 and @samp{-v} or @samp{--verbose} specify the format to use for browsing.
-The @samp{-x} or @samp{--xml} option tells mdb to dump the value of the
-variable to an XML file and then invoke an XML browser on the file.
-The XML filename as well as the command to invoke the XML browser can
-be set using the @samp{set} command.  See the documentation for @samp{set}
-for more details.
 The @samp{-w} or @samp{--web} option tells mdb to dump the value of the
 variable to an HTML file and then invoke a web browser on that file.
 @sp 1
@@ -3197,67 +3192,45 @@ For further documentation on the interactive term browser,
 invoke the @samp{browse} command from within @samp{mdb} and then
 type @samp{help} at the @samp{browser>} prompt.
 @sp 1
- at item browse [-fpvxw]
- at itemx browse [-fpvxw] goal
+ at item browse [-fpvw]
+ at itemx browse [-fpvw] goal
 Invokes the interactive term browser to browse
 the goal of the current call in its present state of instantiation.
 @sp 1
 The options @samp{-f} or @samp{--flat}, @samp{-p} or @samp{--pretty},
 and @samp{-v} or @samp{--verbose} specify the format to use for browsing.
-The @samp{-x} or @samp{--xml} option tells mdb
-to dump the goal to an XML file and then invoke an XML browser on the file.
-The XML filename as well as the command to invoke the XML browser
-can be set using the @samp{set} command.
-See the documentation for @samp{set} for more details.
 The @samp{-w} or @samp{--web} option tells mdb
 to dump the goal to an HTML file and then invoke a web browser on that file.
 @sp 1
- at item browse [-fpvxw] exception
+ at item browse [-fpvw] exception
 Invokes the interactive term browser to browse
 the value of the exception at an EXCP port.
 Reports an error if the current event does not refer to such a port.
 @sp 1
 The options @samp{-f} or @samp{--flat}, @samp{-p} or @samp{--pretty},
 and @samp{-v} or @samp{--verbose} specify the format to use for browsing.
-The @samp{-x} or @samp{--xml} option tells mdb
-to dump the exception to an XML file
-and then invoke an XML browser on the file.
-The XML filename as well as the command to invoke the XML browser
-can be set using the @samp{set} command.
-See the documentation for @samp{set} for more details.
 The @samp{-w} or @samp{--web} option tells mdb
 to dump the exception to an HTML file
 and then invoke a web browser on that file.
 @sp 1
- at item browse [-fpvxw] io @var{num}
- at itemx browse [-fpvxw] action @var{num}
+ at item browse [-fpvw] io @var{num}
+ at itemx browse [-fpvw] action @var{num}
 Invokes an interactive term browser to browse a representation
 of the @var{num}'th I/O action executed by the program,
 if there was such an action and if it was recorded.
 @sp 1
 The options @samp{-f} or @samp{--flat}, @samp{-p} or @samp{--pretty},
 and @samp{-v} or @samp{--verbose} specify the format to use for browsing.
-The @samp{-x} or @samp{--xml} option tells mdb
-to dump the I/O action representation to an XML file
-and then invoke an XML browser on the file.
-The XML filename as well as the command to invoke the XML browser
-can be set using the @samp{set} command.
-See the documentation for @samp{set} for more details.
 The @samp{-w} or @samp{--web} option tells mdb
 to dump the I/O action representation to an HTML file,
 and then invoke a web browser on that file.
 @c @sp 1
- at c @item browse [-fpvx] proc_body
+ at c @item browse [-fpv] proc_body
 @c Invokes an interactive term browser to browse a representation
 @c of the body of the current procedure, if it is available.
 @c @sp 1
 @c The options @samp{-f} or @samp{--flat}, @samp{-p} or @samp{--pretty},
 @c and @samp{-v} or @samp{--verbose} specify the format to use for browsing.
- at c The @samp{-x} or @samp{--xml} option tells mdb to dump the procedure
- at c body representation to an XML file and then invoke an XML browser on the
- at c file.  The XML filename as well as the command to invoke the XML
- at c browser can be set using the @samp{set} command.  See the documentation
- at c for @samp{set} for more details.
 @sp 1
 
 @item stack [-a] [-d] [-c at var{cliquelines}] [-f at var{numframes}] [@var{numlines}]
@@ -4169,36 +4142,6 @@ in questions from the declarative debugger to @var{num}.
 Prints the maximum number of I/O actions to print
 in questions from the declarative debugger.
 @sp 1
- at item xml_browser_cmd @var{command}
- at kindex xml_browser_cmd (mdb command)
-Set the shell command used to launch an XML browser to @var{command}.
-If you want a stylesheet to be applied to the XML
-before the browser is invoked,
-then you should do that in this command using the appropriate program
-(such as xsltproc, which comes with libxslt
-and is available from @uref{http://xmlsoft.org/XSLT/}).
-By default if xsltproc and mozilla (or firefox) are available,
-xsltproc is invoked to apply the xul_tree.xsl stylesheet in
-extras/xml_stylesheets, then mozilla is invoked on the resulting XUL file.
- at sp 1
-You can use the apostrophe character (') to quote the command string,
-for example "xml_browser_cmd 'firefox file:///tmp/mdbtmp.xml'".
- at sp 1
- at item xml_browser_cmd
-Prints the shell command used to launch an XML browser,
-if this has been set.
- at sp 1
- at item xml_tmp_filename @var{filename}
- at kindex xml_tmp_filename (mdb command)
-Tells the debugger to dump XML into the named file
-before invoking the XML browser.
-The command named as the argument of @samp{xml_browser_cmd}
-will usually refer to this file.
- at sp 1
- at item xml_tmp_filename
-Prints the temporary filename used for XML browsing,
-if this has been set.
- at sp 1
 @item web_browser_cmd @var{command}
 @kindex web_browser_cmd (mdb command)
 Set the shell command used to launch a web browser to @var{command}.
@@ -5101,7 +5044,7 @@ Undo the most recent answer or mode change.
 Change the current search mode.  The search modes may be abbreviated to
 @samp{td}, @samp{dq} and @samp{b} respectively.
 @sp 1
- at item browse [--xml | --web] [@var{n}]
+ at item browse [--web] [@var{n}]
 Start the interactive term browser and browse the @var{n}th argument
 before answering.  If the argument number
 is omitted then browse the whole call as if it were a data term.
@@ -5113,12 +5056,10 @@ on the use of the interactive term browser see the @samp{browse} command
 in @ref{Browsing commands} or type @samp{help} from within the
 interactive query browser.
 @sp 1
-Giving the @samp{--xml} or @samp{-x} option causes the term to be displayed
-in an XML browser.
 Giving the @samp{--web} or @samp{-w} option causes the term to be displayed
 in a web browser.
 @sp 1
- at item browse io [--xml | --web] @var{n}
+ at item browse io [--web] @var{n}
 Browse the @var{n}'th I/O action.
 @sp 1
 @item print [@var{n}]
diff --git a/extras/xml_stylesheets/README b/extras/xml_stylesheets/README
index bd9762d38..7d1e4710b 100644
--- a/extras/xml_stylesheets/README
+++ b/extras/xml_stylesheets/README
@@ -6,9 +6,6 @@ You can apply a stylesheet to an XML document using the program xsltproc
 include a reference to the stylesheet in the XML document and have your browser
 apply the stylesheet, although this only works with some browsers.
 
-These stylesheets can also be used with mdb's `browse --xml' command
-(see the user guide for more details on `browse --xml').
-
 mercury_term.xsl
 	Stylesheet to convert an XML document generated with 
 	term_to_xml.write_xml_doc/6 back to a Mercury term suitable for reading
diff --git a/scripts/Mmakefile b/scripts/Mmakefile
index e46e9899f..c006b18ce 100644
--- a/scripts/Mmakefile
+++ b/scripts/Mmakefile
@@ -53,7 +53,6 @@ CONF_DEBUG_SCRIPTS = \
 
 DEBUGGER_SCRIPTS = \
 	$(CONF_DEBUG_SCRIPTS) \
-	xul_tree.xsl \
 	mdb_open \
 	mdb_grep \
 	mdb_track \
@@ -116,10 +115,8 @@ test_mdbrc: mdbrc.in mdbrc
 	sed \
 		-e "s:@DEFAULT_MERCURY_DEBUGGER_DOC@:$${ABS_MERCURY_DIR}/doc/mdb_doc:" \
 		-e "s:@DEFAULT_MERCURY_DEBUGGER_INIT_DIR@:$${ABS_MERCURY_DIR}/scripts:" \
-		-e '/^xml_/d' \
 		-e '/^web_/d' \
 	< mdbrc.in > test_mdbrc
-	egrep '^xml_' < mdbrc >> test_mdbrc
 	egrep '^web_' < mdbrc >> test_mdbrc
 	@if grep '@' test_mdbrc; then \
 		echo "unhandled configuration variable in test_mdbrc"; \
diff --git a/scripts/mdbrc.in b/scripts/mdbrc.in
index bebbed6fd..c550e76e7 100644
--- a/scripts/mdbrc.in
+++ b/scripts/mdbrc.in
@@ -19,6 +19,4 @@ alias	!	shell
 alias	open	source @DEFAULT_MERCURY_DEBUGGER_INIT_DIR@/mdb_open
 alias	grep	source @DEFAULT_MERCURY_DEBUGGER_INIT_DIR@/mdb_grep
 alias	track	source @DEFAULT_MERCURY_DEBUGGER_INIT_DIR@/mdb_track
-xml_browser_cmd '@DEFAULT_XML_BROWSER_CMD@'
-xml_tmp_filename '@DEFAULT_XML_TMP_FILENAME@'
 web_browser_cmd '@DEFAULT_WEB_BROWSER_CMD@'
diff --git a/scripts/xul_tree.xsl b/scripts/xul_tree.xsl
deleted file mode 100644
index 2e8ddf92b..000000000
--- a/scripts/xul_tree.xsl
+++ /dev/null
@@ -1,258 +0,0 @@
[snip]

diff --git a/tests/debugger/Mmakefile b/tests/debugger/Mmakefile
index 1d9b7ec56..f71f5a1c8 100644
--- a/tests/debugger/Mmakefile
+++ b/tests/debugger/Mmakefile
@@ -561,14 +561,12 @@ resume_typeinfos.out: resume_typeinfos resume_typeinfos.inp
 retry.out: retry retry.inp
 	$(MDB_STD) ./retry < retry.inp > retry.out 2>&1
 
-# The values of web_browser_cmd, xml_browser_cmd and xml_tmp_filename will be
-# system specific, so we pipe the output through sed and replace the system
-# specific bit with a known character sequence.
+# The value of web_browser_cmd will be system specific, so we pipe the output
+# through sed and replace the system specific bit with a known character
+# sequence.
 save.out: save save.inp
 	$(MDB) ./save < save.inp 2>&1 | \
 	    sed 's/web_browser_cmd.*/web_browser_cmd ZZZ/g' | \
-	    sed 's/xml_browser_cmd.*/xml_browser_cmd ZZZ/g' | \
-	    sed 's/xml_tmp_filename.*/xml_tmp_filename ZZZ/g' | \
 	    sed 's/^alias grep source.*$$/alias grep source ZZZ\/mdb_grep/' | \
 	    sed 's/^alias open source.*$$/alias open source ZZZ\/mdb_open/' | \
 	    sed 's/^alias track source.*$$/alias track source ZZZ\/mdb_track/'\
diff --git a/tests/debugger/browser_test.exp b/tests/debugger/browser_test.exp
index 29ce50bce..7326806cf 100644
--- a/tests/debugger/browser_test.exp
+++ b/tests/debugger/browser_test.exp
@@ -3,7 +3,6 @@ Goal path printing is now on.
 Registering debuggable procedures... done.
 There is one debuggable module, with 7 procedures.
 mdb: there is no such procedure.
-mdb: xml_browser_cmd: usage error -- type `help xml_browser_cmd' for help.
 Trusting the Mercury standard library
 mdb> echo on
 Command echo enabled.
@@ -122,66 +121,6 @@ big(
   3, 
   big(big(small, 4, big(small, 5, small)), 6, small))
 browser> quit
-mdb> xml_tmp_filename './browser_test.xml.out'
-mdb> xml_browser_cmd 'cat ./browser_test.xml.out'
-mdb> browse --xml 1
-Saving term to XML file...
-Launching XML browser (this may take some time) ...
-<?xml version="1.0"?>
-<big functor="big" type="browser_test.big" arity="3">
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">1</Int>
-			<small functor="small" type="browser_test.big" arity="0" />
-		</big>
-		<Int type="int">2</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-	<Int type="int">3</Int>
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">4</Int>
-			<big functor="big" type="browser_test.big" arity="3">
-				<small functor="small" type="browser_test.big" arity="0" />
-				<Int type="int">5</Int>
-				<small functor="small" type="browser_test.big" arity="0" />
-			</big>
-		</big>
-		<Int type="int">6</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-</big>
-mdb> browse -x Data
-Saving term to XML file...
-Launching XML browser (this may take some time) ...
-<?xml version="1.0"?>
-<big functor="big" type="browser_test.big" arity="3">
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">1</Int>
-			<small functor="small" type="browser_test.big" arity="0" />
-		</big>
-		<Int type="int">2</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-	<Int type="int">3</Int>
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">4</Int>
-			<big functor="big" type="browser_test.big" arity="3">
-				<small functor="small" type="browser_test.big" arity="0" />
-				<Int type="int">5</Int>
-				<small functor="small" type="browser_test.big" arity="0" />
-			</big>
-		</big>
-		<Int type="int">6</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-</big>
 mdb> format_param -A -f depth 1
 mdb> print *
        Data (arg 1)           	big(big/3, 3, big/3)
diff --git a/tests/debugger/browser_test.exp3 b/tests/debugger/browser_test.exp3
index fb7c3eff2..31e40f8df 100644
--- a/tests/debugger/browser_test.exp3
+++ b/tests/debugger/browser_test.exp3
@@ -107,66 +107,6 @@ big(
   3, 
   big(big(small, 4, big(small, 5, small)), 6, small))
 browser> quit
-mdb> xml_tmp_filename './browser_test.xml.out'
-mdb> xml_browser_cmd 'cat ./browser_test.xml.out'
-mdb> browse --xml 1
-Saving term to XML file...
-Launching XML browser (this may take some time) ...
-<?xml version="1.0"?>
-<big functor="big" type="browser_test.big" arity="3">
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">1</Int>
-			<small functor="small" type="browser_test.big" arity="0" />
-		</big>
-		<Int type="int">2</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-	<Int type="int">3</Int>
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">4</Int>
-			<big functor="big" type="browser_test.big" arity="3">
-				<small functor="small" type="browser_test.big" arity="0" />
-				<Int type="int">5</Int>
-				<small functor="small" type="browser_test.big" arity="0" />
-			</big>
-		</big>
-		<Int type="int">6</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-</big>
-mdb> browse -x Data
-Saving term to XML file...
-Launching XML browser (this may take some time) ...
-<?xml version="1.0"?>
-<big functor="big" type="browser_test.big" arity="3">
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">1</Int>
-			<small functor="small" type="browser_test.big" arity="0" />
-		</big>
-		<Int type="int">2</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-	<Int type="int">3</Int>
-	<big functor="big" type="browser_test.big" arity="3">
-		<big functor="big" type="browser_test.big" arity="3">
-			<small functor="small" type="browser_test.big" arity="0" />
-			<Int type="int">4</Int>
-			<big functor="big" type="browser_test.big" arity="3">
-				<small functor="small" type="browser_test.big" arity="0" />
-				<Int type="int">5</Int>
-				<small functor="small" type="browser_test.big" arity="0" />
-			</big>
-		</big>
-		<Int type="int">6</Int>
-		<small functor="small" type="browser_test.big" arity="0" />
-	</big>
-</big>
 mdb> format_param -A -f depth 1
 mdb> print *
        Data (arg 1)           	big(big/3, 3, big/3)
diff --git a/tests/debugger/browser_test.inp b/tests/debugger/browser_test.inp
index b69807663..07fab643b 100644
--- a/tests/debugger/browser_test.inp
+++ b/tests/debugger/browser_test.inp
@@ -37,10 +37,6 @@ ls
 cdr 3 ../1/..
 ls
 quit
-xml_tmp_filename './browser_test.xml.out'
-xml_browser_cmd 'cat ./browser_test.xml.out'
-browse --xml 1
-browse -x Data
 format_param -A -f depth 1
 print *
 print Data/1
diff --git a/tests/debugger/completion.exp b/tests/debugger/completion.exp
index 775545e25..88b7d853b 100644
--- a/tests/debugger/completion.exp
+++ b/tests/debugger/completion.exp
@@ -3,47 +3,46 @@ mdb> echo on
 Command echo enabled.
 mdb> register --quiet
 mdb> 
-!                    fail_trace_counts    push_list_dir
-?                    finish               query
-P                    flag                 quit
-alias                format               r
-all_class_decls      format_param         register
-all_procedures       forward              retry
-all_regs             g                    return
-all_type_ctors       gen_stack            s
-ambiguity            goal_paths           save
-b                    goto                 scope
-break                grep                 scroll
-break_print          h                    shell
-browse               held_vars            source
-c                    help                 stack
-cc_query             histogram_all        stack_default_limit
-class_decl           histogram_exp        stack_regs
-clear_histogram      hold                 stats
-condition            ignore               step
-consumer             io_query             subgoal
-context              level                table
-continue             list                 table_io
-current              list_cmd             term_size
-cut_stack            list_context_lines   track
-d                    list_path            trail_details
-dd                   max_io_actions       trust
-debug_vars           maxdepth             trusted
-delete               mindepth             type_ctor
-dice                 mm_stacks            unalias
-diff                 mmc_options          unhide_events
-disable              modules              untrust
-document             next                 up
-document_category    nondet_stack         user
-down                 open                 user_event_context
-dump                 p                    v
-e                    pass_trace_counts    var_details
-echo                 pneg_stack           vars
-enable               pop_list_dir         view
-exception            print                web_browser_cmd
-excp                 print_optionals      xml_browser_cmd
-f                    printlevel           xml_tmp_filename
-fail                 procedures           
+!                    fail                 printlevel
+?                    fail_trace_counts    procedures
+P                    finish               push_list_dir
+alias                flag                 query
+all_class_decls      format               quit
+all_procedures       format_param         r
+all_regs             forward              register
+all_type_ctors       g                    retry
+ambiguity            gen_stack            return
+b                    goal_paths           s
+break                goto                 save
+break_print          grep                 scope
+browse               h                    scroll
+c                    held_vars            shell
+cc_query             help                 source
+class_decl           histogram_all        stack
+clear_histogram      histogram_exp        stack_default_limit
+condition            hold                 stack_regs
+consumer             ignore               stats
+context              io_query             step
+continue             level                subgoal
+current              list                 table
+cut_stack            list_cmd             table_io
+d                    list_context_lines   term_size
+dd                   list_path            track
+debug_vars           max_io_actions       trail_details
+delete               maxdepth             trust
+dice                 mindepth             trusted
+diff                 mm_stacks            type_ctor
+disable              mmc_options          unalias
+document             modules              unhide_events
+document_category    next                 untrust
+down                 nondet_stack         up
+dump                 open                 user
+e                    p                    user_event_context
+echo                 pass_trace_counts    v
+enable               pneg_stack           var_details
+exception            pop_list_dir         vars
+excp                 print                view
+f                    print_optionals      web_browser_cmd
 h              help           histogram_exp  
 held_vars      histogram_all  hold           
 var_details  vars         view         
diff --git a/tests/debugger/mdb_command_test.inp b/tests/debugger/mdb_command_test.inp
index 413af5e04..a74c8bf53 100644
--- a/tests/debugger/mdb_command_test.inp
+++ b/tests/debugger/mdb_command_test.inp
@@ -79,8 +79,6 @@ list_cmd             xyzzy xyzzy xyzzy xyzzy xyzzy
 fail_trace_counts    xyzzy xyzzy xyzzy xyzzy xyzzy
 pass_trace_counts    xyzzy xyzzy xyzzy xyzzy xyzzy
 max_io_actions       xyzzy xyzzy xyzzy xyzzy xyzzy
-xml_browser_cmd      xyzzy xyzzy xyzzy xyzzy xyzzy
-xml_tmp_filename     xyzzy xyzzy xyzzy xyzzy xyzzy
 web_browser_cmd      xyzzy xyzzy xyzzy xyzzy xyzzy
 format               xyzzy xyzzy xyzzy xyzzy xyzzy
 format_param         xyzzy xyzzy xyzzy xyzzy xyzzy
diff --git a/tests/debugger/save.exp2 b/tests/debugger/save.exp2
index 4c9715554..9a36b3850 100644
--- a/tests/debugger/save.exp2
+++ b/tests/debugger/save.exp2
@@ -105,8 +105,6 @@ format_param -A -p size 10
 format_param -A -p width 80
 format_param -A -p lines 2
 max_io_actions 20
-xml_browser_cmd ZZZ
-xml_tmp_filename ZZZ
 web_browser_cmd ZZZ
 trust save
 trust std lib
diff --git a/tests/declarative_debugger/browse_arg.exp b/tests/declarative_debugger/browse_arg.exp
index d531eadee..5de651dcd 100644
--- a/tests/declarative_debugger/browse_arg.exp
+++ b/tests/declarative_debugger/browse_arg.exp
@@ -9,8 +9,6 @@ mdb> continue
 mdb> finish
        3:      2  2 EXIT pred browse_arg.p/2-0 (det) browse_arg.m:25 (browse_arg.m:14)
 mdb> format_param depth 10
-mdb> xml_browser_cmd 'cat ./browse_arg.xml.out'
-mdb> xml_tmp_filename './browse_arg.xml.out'
 mdb> dd -d 3 -n 7
 p(1, baz(1, bar))
 Valid? browse 2
@@ -36,36 +34,7 @@ p
 Valid? format -P pretty
 dd> p
 p(1, baz(1, bar))
-Valid? b -x 2
-Saving term to XML file...
-Launching XML browser (this may take some time) ...
-<?xml version="1.0"?>
-<baz functor="baz" type="browse_arg.foo" arity="2">
-	<Int type="int">1</Int>
-	<bar functor="bar" type="browse_arg.foo" arity="0" />
-</baz>
-dd> b --xml
-Saving term to XML file...
-Launching XML browser (this may take some time) ...
-<?xml version="1.0"?>
-<predicate functor="predicate" type="mdb.browse.xml_predicate_wrapper" arity="2">
-	<String type="string" field="predicate_name">browse_arg.p</String>
-	<List functor="[|]" field="predicate_arguments" type="list.list(univ.univ)" arity="2">
-		<univ_cons functor="univ_cons" type="univ.univ" arity="1">
-			<Int type="int">1</Int>
-		</univ_cons>
-		<List functor="[|]" type="list.list(univ.univ)" arity="2">
-			<univ_cons functor="univ_cons" type="univ.univ" arity="1">
-				<baz functor="baz" type="browse_arg.foo" arity="2">
-					<Int type="int">1</Int>
-					<bar functor="bar" type="browse_arg.foo" arity="0" />
-				</baz>
-			</univ_cons>
-			<Nil functor="[]" type="list.list(univ.univ)" arity="0" />
-		</List>
-	</List>
-</predicate>
-dd> no
+Valid? no
 Found incorrect contour:
 p(1, baz(1, bar))
 Is this a bug? yes
diff --git a/tests/declarative_debugger/browse_arg.inp b/tests/declarative_debugger/browse_arg.inp
index 2781e25a6..5a48a2b24 100644
--- a/tests/declarative_debugger/browse_arg.inp
+++ b/tests/declarative_debugger/browse_arg.inp
@@ -4,8 +4,6 @@ break p
 continue
 finish
 format_param depth 10
-xml_browser_cmd 'cat ./browse_arg.xml.out'
-xml_tmp_filename './browse_arg.xml.out'
 dd -d 3 -n 7
 browse 2
 ls
@@ -16,8 +14,6 @@ format -B pretty
 p
 format -P pretty
 p
-b -x 2
-b --xml
 no
 yes
 continue
diff --git a/trace/mercury_trace_browse.c b/trace/mercury_trace_browse.c
index e73bd6daa..357f9e4a4 100644
--- a/trace/mercury_trace_browse.c
+++ b/trace/mercury_trace_browse.c
@@ -106,24 +106,6 @@ MR_trace_save_term_xml(const char *filename, MR_Word browser_term)
             MR_wrap_output_stream(&mdb_out));
     );
 }
-
-void
-MR_trace_save_and_invoke_xml_browser(MR_Word browser_term)
-{
-    MercuryFile mdb_out;
-    MercuryFile mdb_err;
-
-    MR_c_file_to_mercury_file(MR_mdb_out, &mdb_out);
-    MR_c_file_to_mercury_file(MR_mdb_err, &mdb_err);
-
-    MR_TRACE_CALL_MERCURY(
-        ML_BROWSE_browse_term_xml(browser_term,
-            MR_wrap_output_stream(&mdb_out),
-            MR_wrap_output_stream(&mdb_err),
-            MR_trace_browser_persistent_state);
-    );
-}
-
 void
 MR_trace_save_and_invoke_web_browser(MR_Word browser_term)
 {
diff --git a/trace/mercury_trace_browse.h b/trace/mercury_trace_browse.h
index e9fa2b1ce..ad5a9b8a1 100644
--- a/trace/mercury_trace_browse.h
+++ b/trace/mercury_trace_browse.h
@@ -74,10 +74,6 @@ extern  void        MR_trace_browse_external(MR_Word type_info, MR_Word value,
                         MR_BrowseCallerType caller, MR_BrowseFormat format);
 #endif
 
-// Browse a term using an XML browser.
-
-extern  void        MR_trace_save_and_invoke_xml_browser(MR_Word browser_term);
-
 // Browse a term using a web browser.
 
 extern  void        MR_trace_save_and_invoke_web_browser(MR_Word browser_term);
diff --git a/trace/mercury_trace_cmd_browsing.c b/trace/mercury_trace_cmd_browsing.c
index 343314f94..8fc711791 100644
--- a/trace/mercury_trace_cmd_browsing.c
+++ b/trace/mercury_trace_cmd_browsing.c
@@ -44,13 +44,6 @@ static  const char  *MR_trace_browse_proc_body(MR_EventInfo *event_info,
                         MR_Browser browser, MR_BrowseCallerType caller,
                         MR_BrowseFormat format);
 
-// Functions to invoke the user's XML browser on terms or goals.
-static  void        MR_trace_browse_xml(MR_Word type_info, MR_Word value,
-                        MR_BrowseCallerType caller, MR_BrowseFormat format);
-static  void        MR_trace_browse_goal_xml(MR_ConstString name,
-                        MR_Word arg_list, MR_Word is_func,
-                        MR_BrowseCallerType caller, MR_BrowseFormat format);
-
 // Functions to invoke the user's web browser on terms or goals.
 static  void        MR_trace_browse_web(MR_Word type_info, MR_Word value,
                         MR_BrowseCallerType caller, MR_BrowseFormat format);
@@ -79,7 +72,7 @@ static  MR_bool     MR_trace_options_print(MR_BrowseFormat *format,
                         MR_bool *set_max_printed_actions,
                         char ***words, int *word_count);
 static  MR_bool     MR_trace_options_browse(MR_BrowseFormat *format,
-                        MR_bool *xml, MR_bool *web,
+                        MR_bool *web,
                         char ***words, int *word_count);
 static  MR_bool     MR_trace_options_view(const char **window_cmd,
                         const char **server_cmd, const char **server_name,
@@ -497,21 +490,17 @@ MR_trace_cmd_browse(char **words, int word_count, MR_TraceCmdInfo *cmd,
     MR_EventInfo *event_info, MR_Code **jumpaddr)
 {
     MR_BrowseFormat     format;
-    MR_bool             xml;
     MR_bool             web;
     MR_IoActionNum      action;
     MR_GoalBrowser      goal_browser;
     MR_Browser          browser;
     const char          *problem;
 
-    if (! MR_trace_options_browse(&format, &xml, &web, &words, &word_count)) {
+    if (! MR_trace_options_browse(&format, &web, &words, &word_count)) {
         // The usage message has already been printed.
         ;
     } else {
-        if (xml) {
-            goal_browser = MR_trace_browse_goal_xml;
-            browser = MR_trace_browse_xml;
-        } else if (web) {
+        if (web) {
             goal_browser = MR_trace_browse_goal_web;
             browser = MR_trace_browse_web;
         } else {
@@ -1079,28 +1068,6 @@ MR_trace_browse_proc_body(MR_EventInfo *event_info, MR_Browser browser,
     return (const char *) NULL;
 }
 
-static void
-MR_trace_browse_xml(MR_Word type_info, MR_Word value,
-    MR_BrowseCallerType caller, MR_BrowseFormat format)
-{
-    MR_Word     browser_term;
-
-    browser_term = MR_type_value_to_browser_term((MR_TypeInfo) type_info,
-        value);
-
-    MR_trace_save_and_invoke_xml_browser(browser_term);
-}
-
-static void
-MR_trace_browse_goal_xml(MR_ConstString name, MR_Word arg_list,
-    MR_Word is_func, MR_BrowseCallerType caller, MR_BrowseFormat format)
-{
-    MR_Word     browser_term;
-
-    browser_term = MR_synthetic_to_browser_term(name, arg_list, is_func);
-    MR_trace_save_and_invoke_xml_browser(browser_term);
-}
-
 static void
 MR_trace_browse_web(MR_Word type_info, MR_Word value,
     MR_BrowseCallerType caller, MR_BrowseFormat format)
@@ -1421,22 +1388,20 @@ static struct MR_option MR_trace_browse_opts[] =
     { "raw_pretty", MR_no_argument, NULL,   'r' },
     { "verbose",    MR_no_argument, NULL,   'v' },
     { "pretty",     MR_no_argument, NULL,   'p' },
-    { "xml",        MR_no_argument, NULL,   'x' },
     { "web",        MR_no_argument, NULL,   'w' },
     { NULL,         MR_no_argument, NULL,   0   }
 };
 
 static MR_bool
-MR_trace_options_browse(MR_BrowseFormat *format, MR_bool *xml, MR_bool *web,
+MR_trace_options_browse(MR_BrowseFormat *format, MR_bool *web,
     char ***words, int *word_count)
 {
     int c;
 
     *format = MR_BROWSE_DEFAULT_FORMAT;
-    *xml = MR_FALSE;
     *web = MR_FALSE;
     MR_optind = 0;
-    while ((c = MR_getopt_long(*word_count, *words, "frvpxw",
+    while ((c = MR_getopt_long(*word_count, *words, "frvpw",
         MR_trace_browse_opts, NULL)) != EOF)
     {
         switch (c) {
@@ -1457,14 +1422,8 @@ MR_trace_options_browse(MR_BrowseFormat *format, MR_bool *xml, MR_bool *web,
                 *format = MR_BROWSE_FORMAT_PRETTY;
                 break;
 
-            case 'x':
-                *xml = MR_TRUE;
-                *web = MR_FALSE;
-                break;
-
             case 'w':
                 *web = MR_TRUE;
-                *xml = MR_FALSE;
                 break;
 
             default:
diff --git a/trace/mercury_trace_cmd_parameter.c b/trace/mercury_trace_cmd_parameter.c
index 2623117d1..46101986f 100644
--- a/trace/mercury_trace_cmd_parameter.c
+++ b/trace/mercury_trace_cmd_parameter.c
@@ -706,82 +706,6 @@ MR_trace_cmd_max_io_actions(char **words, int word_count,
     return KEEP_INTERACTING;
 }
 
-MR_Next
-MR_trace_cmd_xml_browser_cmd(char **words, int word_count,
-    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
-{
-    if (word_count == 2) {
-        char    *copied_value;
-        char    *aligned_value;
-
-        copied_value = (char *) MR_GC_malloc(strlen(words[1]) + 1);
-        strcpy(copied_value, words[1]);
-        MR_TRACE_USE_HP(
-            MR_make_aligned_string(aligned_value, copied_value);
-        );
-        MR_TRACE_CALL_MERCURY(
-            ML_BROWSE_set_xml_browser_cmd_from_mdb(aligned_value,
-                MR_trace_browser_persistent_state,
-                &MR_trace_browser_persistent_state);
-        );
-    } else if (word_count == 1) {
-        MR_String   command;
-
-        MR_TRACE_CALL_MERCURY(
-            ML_BROWSE_get_xml_browser_cmd_from_mdb(
-                MR_trace_browser_persistent_state, &command);
-        );
-
-        if (command != NULL && strlen(command) > 0) {
-            fprintf(MR_mdb_out, "The XML browser command is %s\n", command);
-        } else {
-            fprintf(MR_mdb_out, "The XML browser command has not been set.\n");
-        }
-    } else {
-        MR_trace_usage_cur_cmd();
-    }
-
-    return KEEP_INTERACTING;
-}
-
-MR_Next
-MR_trace_cmd_xml_tmp_filename(char **words, int word_count,
-    MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
-{
-    if (word_count == 2) {
-        char    *copied_value;
-        char    *aligned_value;
-
-        copied_value = (char *) MR_GC_malloc(strlen(words[1]) + 1);
-        strcpy(copied_value, words[1]);
-        MR_TRACE_USE_HP(
-            MR_make_aligned_string(aligned_value, copied_value);
-        );
-        MR_TRACE_CALL_MERCURY(
-            ML_BROWSE_set_xml_tmp_filename_from_mdb(aligned_value,
-                MR_trace_browser_persistent_state,
-                &MR_trace_browser_persistent_state);
-        );
-    } else if (word_count == 1) {
-        MR_String   file;
-
-        MR_TRACE_CALL_MERCURY(
-            ML_BROWSE_get_xml_browser_cmd_from_mdb(
-                MR_trace_browser_persistent_state, &file);
-        );
-
-        if (file != NULL && strlen(file) > 0) {
-            fprintf(MR_mdb_out, "The XML tmp filename is %s\n", file);
-        } else {
-            fprintf(MR_mdb_out, "The XML tmp filename has not been set.\n");
-        }
-    } else {
-        MR_trace_usage_cur_cmd();
-    }
-
-    return KEEP_INTERACTING;
-}
-
 MR_Next
 MR_trace_cmd_web_browser_cmd(char **words, int word_count,
     MR_TraceCmdInfo *cmd, MR_EventInfo *event_info, MR_Code **jumpaddr)
diff --git a/trace/mercury_trace_cmd_parameter.h b/trace/mercury_trace_cmd_parameter.h
index 261227e06..44aa109de 100644
--- a/trace/mercury_trace_cmd_parameter.h
+++ b/trace/mercury_trace_cmd_parameter.h
@@ -105,8 +105,6 @@ extern  MR_TraceCmdFunc     MR_trace_cmd_list_cmd;
 extern  MR_TraceCmdFunc     MR_trace_cmd_fail_trace_counts;
 extern  MR_TraceCmdFunc     MR_trace_cmd_pass_trace_counts;
 extern  MR_TraceCmdFunc     MR_trace_cmd_max_io_actions;
-extern  MR_TraceCmdFunc     MR_trace_cmd_xml_browser_cmd;
-extern  MR_TraceCmdFunc     MR_trace_cmd_xml_tmp_filename;
 extern  MR_TraceCmdFunc     MR_trace_cmd_web_browser_cmd;
 extern  MR_TraceCmdFunc     MR_trace_cmd_format;
 extern  MR_TraceCmdFunc     MR_trace_cmd_format_param;
diff --git a/trace/mercury_trace_internal.c b/trace/mercury_trace_internal.c
index 1845ae047..c19b5050c 100644
--- a/trace/mercury_trace_internal.c
+++ b/trace/mercury_trace_internal.c
@@ -1564,10 +1564,6 @@ static const MR_TraceCmdTableEntry  MR_trace_command_table[] =
         NULL, MR_trace_filename_completer },
     { "parameter", "max_io_actions", MR_trace_cmd_max_io_actions,
         NULL, MR_trace_null_completer },
-    { "parameter", "xml_browser_cmd", MR_trace_cmd_xml_browser_cmd,
-        NULL, MR_trace_null_completer },
-    { "parameter", "xml_tmp_filename", MR_trace_cmd_xml_tmp_filename,
-        NULL, MR_trace_null_completer },
     { "parameter", "web_browser_cmd", MR_trace_cmd_web_browser_cmd,
         NULL, MR_trace_null_completer },
     { "parameter", "format", MR_trace_cmd_format,
-- 
2.28.0



More information about the reviews mailing list