mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 22:03:26 +00:00
Estimated hours taken: 7 Branches: main Improve the declarative debugger interface. The two main changes are to use the mdb help system and not re-display the question after the user issues a command which does not answer the question. For example if the user issues an `info' command, then previously the question would be redisplayed after the requested information and if the question is big then the information would be scrolled off the screen. browser/declarative_analyser.m: Remove extra new line characters when printing info. These are no longer necessary since the question is not redisplayed. browser/declarative_debugger.m: Pass the help system from mdb to the oracle state when initialising the diagnoser. browser/declarative_oracle.m: Pass the help system to the user state when initialising the oracle state. browser/declarative_user.m: Add two new fields to the user state: one to keep a reference to the help system and one to indicate whether the current question should be displayed when getting a user input. Allow the user to redisplay the question by issuing a `print' command with no arguments. If the question is not to be displayed the show a "dd>" prompt. Change the `abort' command to `quit'. This is more consistent with the rest of mdb. doc/commands: Add a script to print all the commands in a section in the user guide. doc/generate_mdb_doc: Generate help for the declarative debugger. doc/mdb_categories: Add a category, `decl', for commands that can be executed inside the declarative debugger. Change the `dd' category to mdb_dd, because 1) `help dd' used to show help about the `dd' category AND the `dd' command and 2) `dd' is too general a category name now that we have a `decl' category. Add an item, `decl_debug' to the concepts category. doc/user_guide.texi: Document some dd commands which previously weren't documented here. Add a short overview of the declarative debugger. This is displayed when the user issues a `help' command from within the dd. Move the bit about the behaviour when no command is given to before the list of commands. This is necessary so util/info_to_mdb.c doesn't include this in the help of the last command in the list. tests/debugger/declarative/app.exp: tests/debugger/declarative/app.inp: tests/debugger/declarative/browse_arg.exp: tests/debugger/declarative/browse_arg.inp: tests/debugger/declarative/browser_mode.exp: tests/debugger/declarative/browser_mode.inp: tests/debugger/declarative/confirm_abort.exp: tests/debugger/declarative/confirm_abort.inp: tests/debugger/declarative/dependency.exp: tests/debugger/declarative/dependency.inp: tests/debugger/declarative/find_origin.exp: tests/debugger/declarative/find_origin.exp2: tests/debugger/declarative/info.exp: tests/debugger/declarative/info.inp: tests/debugger/declarative/io_stream_test.exp: tests/debugger/declarative/io_stream_test.exp2: tests/debugger/declarative/mapinit.exp: tests/debugger/declarative/mapinit.inp: tests/debugger/declarative/output_term_dep.exp: tests/debugger/declarative/output_term_dep.inp: tests/debugger/declarative/resume.exp: tests/debugger/declarative/resume.inp: tests/debugger/declarative/skip.exp: tests/debugger/declarative/skip.inp: tests/debugger/declarative/solutions.exp3: tests/debugger/declarative/tabled_read_decl.exp: Update tests. trace/mercury_trace_declarative.c: trace/mercury_trace_help.c: trace/mercury_trace_help.h: Pass the help system to the frontend.
56 lines
1.6 KiB
C
56 lines
1.6 KiB
C
/*
|
|
** Copyright (C) 1998,2002, 2005 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.
|
|
*/
|
|
|
|
/*
|
|
** mercury_trace_help.h
|
|
**
|
|
** Defines the interface of the help system for the internal debugger.
|
|
*/
|
|
|
|
#ifndef MERCURY_TRACE_HELP_H
|
|
#define MERCURY_TRACE_HELP_H
|
|
|
|
#include "mercury_trace_completion.h"
|
|
|
|
/*
|
|
** This global keeps a reference to the help system.
|
|
*/
|
|
|
|
extern MR_Word MR_trace_help_system;
|
|
|
|
/*
|
|
** These function add a help node, which must a category or an item
|
|
** within a category. It returns NULL if the addition was successful,
|
|
** and a pointer to an error message otherwise.
|
|
*/
|
|
|
|
extern const char *MR_trace_add_cat(const char *category, int slot,
|
|
const char *text);
|
|
|
|
extern const char *MR_trace_add_item(const char *category,
|
|
const char *item, int slot, const char *text);
|
|
|
|
/*
|
|
** These functions print help to standard output.
|
|
**
|
|
** MR_trace_help prints a list of the top-level help nodes.
|
|
** MR_trace_help_word prints the text of all the help nodes with the given
|
|
** name. If there are none, it prints a list of the top-level help nodes.
|
|
** MR_trace_help_cat_item prints the text of the node at path cat/item.
|
|
*/
|
|
|
|
extern void MR_trace_help(void);
|
|
extern void MR_trace_help_word(const char *word);
|
|
|
|
extern void MR_trace_help_cat_item(const char *cat,
|
|
const char *item);
|
|
|
|
/* A Readline completer for help topics. */
|
|
extern MR_Completer_List *MR_trace_help_completer(const char *word,
|
|
size_t word_len);
|
|
|
|
#endif /* MERCURY_TRACE_HELP_H */
|