VERSION 1.10.3

This package provides the client and server for a Maple Debugger
Client/Server architecture, an enhancement to the existing Maple
debugger.

The server side is an Emacs package with several major modes
for displaying and controlling the code that is being debugged.
The client side is a Maple package that, when invoked,
replaces the Maple library debugger.

REQUIREMENTS
------------
* GNU Emacs 23.1+ (earlier versions may work)
* Maple 14+ (earlier versions should work)

INSTALLATION
------------
0. On a Linux system, with maple the command-line version of Maple,
   you can do 

   $ ./run-installer

   and then skip to step 4.

1. Launch standard Maple

2. Select File -> Open, choose File Type: 
   Maple Archive (.mla) [it is the last choice]

3. Open the installer file mdc-installer-VERSION.mla

4. Click through the installation scripts.

5. LOCATION
   The installer unpacks the files it needs into the
   subdirectory $HOME/maple/toolbox/emacs.

6. CUSTOMIZATION
   By default, the installer uses the following locations
   Lisp files:
     $HOME/.emacs.d/maple
   Info files:
     $HOME/share/info
   Maple archives and help databases:
     $HOME/maple/toolbox/emacs/lib

   To modify these defaults, stop the installation after it unpacks
   the files, rename _config.mpl (located at $HOME/maple/toolbox/emacs)
   to config.mpl, and edit it appropriately for your system.

7. Create/modify your .emacs file (normally located at $HOME/.emacs).  
   To determine what Emacs uses for your home directory,
   execute (getenv "HOME").  To do that, type M-x getenv
   and then HOME.  M-x usually means hold down the Alt key
   and press the x key.
   Add the following statements to the .emacs file

;; add ~/.emacs.d/maple to Emacs load-path.
;; This line won't work on Windows because the string returned
;; by getenv includes back-slashes.
(setq load-path (cons (format "%s/.emacs.d/maple" (getenv "HOME")) load-path))
;; On a Windows system, do something like
(setq load-path (cons "C:/Users/foo/AppData/Roaming/.emacs.d/maple/" load-path))

;; mds package
(autoload 'mds "mds" "Restart the Maple Debugger Server" t)
;; Assign the function keys f12 and Ctrl-f12.
;; Choose appropriate keys.
(global-set-key [f12] 'mds-wm-cycle-clients) 
(global-set-key [C-f12] 'mds-wm-cycle-groups)
;; The following command starts the Maple debugger server.
(mds) 
;; maplev package
(autoload 'maplev-mode "maplev" "Maple editing mode" t)


The binding to the f12 key is to permit quickly cycling through the
connected clients.  Use C-f12 to cycle through groups of clients
(which can be generated by using the mdc:-Grid package, see the Maple
help pages, ?mdc[Grid]).

  You may also need to update Emacs info directory list;
  I do so by adding the following line to the .emacs
  file, modify per your setup:

(add-to-list 'Info-default-directory-list 
	(format "%s/share/info" (getenv "HOME")))

8. On non-Unix machines, the lisp files are not automatically
   byte-compiled.  Byte-compiling is not a requirement, but will
   allow the code to run faster.  You can manually byte-compile the
   files from inside Emacs using the command byte-recompile-directory.
   Launch Emacs, then type C-u 0 M-x byte-recompile-directory and
   select the directory where the lisp files were installed.

9. On non-Unix machines, the dir file, used by Emacs help system to
   provide a menu of help topics, is not automatically updated.  You
   can do so manually.  If you cannot figure out how to do so, an html
   version of the documentation for mds (the Emacs-based Maple Debugger
   Server) is provided in the doc subdirectory of the installation.

USAGE
-----
Fire up Emacs and launch the Maple debugger server:

M-x mds

Now launch Maple, either tty or the GUI.  If libname
is set properly, you should be able to access help for
the Maple Debugger Client (mdc), by typing ?mdc.

For those in hurry, just do

> mdc(stopat=int): # you can use regular stopat as well.
> int(x,x);

If you then go to Emacs, you should see an mds-showstat
and mds-output buffer displayed.

In the mds-showstat buffer, type C-h m to get the following help,
which briefly describes what each key does.

Tracing
-------
SPC repeat the last tracing command
c (cont) continue execution until next breakpoint
n (next) execute next statement at current nesting level
i (into) execute next statement at any level in current procedure
o (outfrom) execute current statement sequence or until breakpoint
r (return) continue executing until current procedure returns
s (step) execute next statement at any level
t (trace) set tracing mode
q (quit) terminate debugging

Breakpoints
-----------
b (stopat) set breakpoint at cursor
B (stopat-cond) set conditional breakpoint at cursor
u (unstopat) clear breakpoint at cursor
p (showstop) display all breakpoints
I (stopwhenif) set watchpoint on variable = value
w (stopwhen) set watchpoint on local variable
C-u w (stopwhen) clear watchpoint on local variable
W (stopwhen) set watchpoint on global variable
C-u W (stopwhen) clear watchpoint on global variable

Information
-----------
A display the parameter names and values
a display the arguments of the current procedure
h display Maple debugger help page
k (showstack) display abbreviated stack
K (where) display stack of procedure calls
l move (return) cursor to current state
X display the last error
x display the last exception

Evaluation
----------
e evaluate a Maple expression
E evaluate a Maple expression in a global context
. evaluate and prettyprint a Maple expression

Miscellaneous
-------------
C clear the debugger output buffer
h display help page for the Maple debugger
H display info page for mds
T toggle-truncate-lines (C-u for output buffer)
? display a Maple help page
M-? display a Maple procedure


