Commit Graph

34 Commits

Author SHA1 Message Date
John Ciolfi 45febb409c Fix conflict between matlab-shell debugging and C++ (or other language) debugging.
Fix conflict between matlab-shell debugging and C++ (or other language) debugging.
- matlab-shell debugging previously leveraged gud.el for debugging of *.m files.
- C++ debugging also leverages gud.el for debugging.
- Only one instance of a gud.el debugger can be active. If you run two, say
  *.m debugging and C++ debugging. Then you get odd errors such as the
  ebbreak not being recognized by gdb.
To fix these issue, I copied gud.el and made a new namespace "mlgud". I also
removed a lot of unused code from mlgud.el, though there's still more that can
be removed. Now one can debug *.m files and *.cpp files in one Emacs session.
2022-03-11 14:55:04 -05:00
Eric Ludlam 9c5e34d633 matlab-shell-gud.el:
(mlg-set-stack, mlg-add-breakpoint):
Use make-instance to create instances of objects.
2021-03-30 12:48:38 -04:00
Eric Ludlam 54b3279762 matlab-shell-gud.el:
(matlab-shell-mode-gud-enable-bindings): Remove call to `matlab-frame-init'
which is obsolete.
2021-03-30 11:07:16 -04:00
Eric Ludlam 448646f989 matlab.el
(matlab-frame-init): Menu biding for ebstack now calls gud-list-breakpoints.
matlab-shell-gud.el:
Replace all bindings around mlg-show-breakpoints, and replace with
gud-list-breakpoints.
2019-12-20 22:23:11 -05:00
Eric Ludlam 65da8f15fb matlab-shell-gud.el:
(gud-matlab-tool-bar-map): Remove impl for default value.
(matlab-shell-mode-gud-enable-bindings): Init matlab frame,
then init `gud-matlab-tool-bar-map'.
2019-12-19 15:21:15 -05:00
Eric Ludlam e598ebfa46 matlab-shell-gud.el:
Fix misc typos across the file.
2019-12-18 14:14:26 -05:00
Eric Ludlam 5853edf895 matlab-shell-gud.el:
(gud-matlab-tool-bar-map): Add show stack and breakpoints.
Remove up/down.
Pull buttons from matlab-mode-map, not gud-minor-mode-map.
(matlab-shell-mode-gud-enable-bindings):
Bind stop-subjob to C-q
Finish is now dbstep out.
(matlab-shell-gud-minor-mode-map):
q now bound to stop-subjob.
2019-12-17 21:19:02 -05:00
Eric Ludlam 0f8e50a0c6 matlab-shell-gud.el:
(matlab-at-fcn): Add %% to all commands.
2019-12-17 20:12:19 -05:00
Eric Ludlam 8ac0cf226d matlab-shell-gud.el:
(matlab-shell-mode-gud-enable-bindings): Update bindings.
Change remove breakpoint to be C-x.
Add ebstatus, ebstack on C-v, C-w.
(matlab-shell-gud-minor-mode-map): Update bindings.
change gud-remove to be x
Add SPC to be gud-step
show-stack is now w.
show breakpoints is now v.
show symbol value is now e
Remove e binding to "edit" - leave as C-x C-q only.
(define-minor-mode): Resort bindings in help to be
same as in MATLAB->Debug menu.
2019-12-17 17:40:44 -05:00
Eric Ludlam a8cb6c02a8 matlab-shell-gud.el:
(matlab-shell=gud-minor-mode): Fixup help to be same as MATLAB debug menu.
2019-12-16 20:27:31 -05:00
Eric Ludlam d5d36c01dc matlab-shell-gud.el:
(matlab-shell-gud-menu): Delete

matlab.el:
(matlab-frame-init): Improve Debug menu.
Add exit gud debug mode.
Rename various items to be clearer.
Add list breakpoints and show stack.
2019-12-16 20:22:58 -05:00
Eric Ludlam cd70817b60 matlab-shell-gud.el:
(mlg-breakpoint): New slot: name.
(mlg-breakpooints::mlg-print): New method to print in a buffer.
(mlg-add-breakpoint): Add 'fcn' input - put in name slot.
(mlg-del-breakpoint): Add 'fcn' input - then ignore.  Needed to line up w/ add.
(mlg-refresh-breakpoint-buffer, mlg-show-breakpoints): New
Manage contents of a buffer listing all the breakpoints.
(mlg-breakpoint-mode-map, mlg-breakpoint-mode-syntax-table): New.
(mlg-breakpoint-mode): New mode.
(mlg-breakpoint-quit, mlg-breakpoint-next, mlg-breakpoint-prev)
(mlg-breakpoint-click, mlg-breakpoint-choose):
New commands for breakpoint mode.
(matlab-shell-gud-minor-mode-map): Add 'w' to show breakpoints.
(easy-menu-define): Add Show Breakpoints menu item.

toolbox/ebstatus.m:
Always show the breakpoint buffer in emacs when called.

toolbox/+emacs/@Breakpoints/Breakpoints.m:
(updateEmacs): Add show input arg.
This forces breakpoints to show.
If not showing, update breakpoint buffer.
2019-12-15 15:05:18 -05:00
Eric Ludlam e10f2c763f matlab-shell-gud.el:
(matlab-gud-debug-tracker): Make sure point is @ end of buffer
before checking of the prompt type.
2019-12-15 11:17:43 -05:00
Eric Ludlam e46a324bc2 matlab-shell-gud.el:
(mlg-show-frame): Fix so if stack is 1 deep, it still shows
the stack.
2019-12-14 19:19:22 -05:00
Eric Ludlam aef2037284 matlab-shell-gud.el:
(gud-matlab-marker-filter): Remove old hotlink url output scanning.
Replace with evaluating forms sent from MATLAB.
When exiting debug mode, also find and close the stack window.
(mlg-set-stack-frame-via-gud): New, called from MATLAB.
(mlg-stack-quit): New for stack mode.  Replaces 'delete-window which
sometimes fails.
(matlab-shell-gud-minor-mode-map): Add 'v' binding to view stack frame
window.
(easy-menu-define): Add "Show Stack" menu item to show stack window.

toolbox/+emacs/@Stack/Stack.m:
Add `StackPending' and `FramePending' flags for when that part changes.
(captureStack): New method - uses what was in updateEmacs for computing
the part of the stack we will use.
(updateEmacs): Remove chunk, put in above.
Always post the request to show, as this is used from ebstack, and it should
always do something.
(updateForHotLinks): New method, called from dbhotlinks.
Sends over stack only if needed.
(stackEqual): Rename output arg to better indicate what it is.

toolbox/dbhotlink.m:
Remove most of the content.
Replace with use of EmacsStack object, using updateForHotLinks method.
2019-12-14 18:58:10 -05:00
Eric Ludlam f23a926bb2 matlab-shell-gud.el:
Fix varous issues in doc strings and messages identified by `checkdoc'
command.
2019-12-12 22:22:09 -05:00
Eric Ludlam e620ab40a5 matlab-shell-gud.el:
(mlg-set-stack,mlg-refresh-stack-buffer,mlg-add-breakpoint):
Make compatible with Emacs 24.
2019-12-12 19:05:26 -05:00
Eric Ludlam 9f8014d2b0 matlab-shell-gud.el:
(gud-matlab-find-file, mlg-stack-choose):
Remove "..file are the same.." type warings.
2019-12-12 17:22:53 -05:00
Eric Ludlam f4352eb763 matlab-shell-gud.el
(mlg-reset-breakpoints): Add autoload cookie.
Needed so netshell startup loads this library.
2019-12-11 22:02:41 -05:00
Eric Ludlam eed7a5c20c matlab-shell-gud.el:
Enable dbstack display and navigation feature.
(mlg-stack-frame): New class.
(mlg-stack-frame::mlg-print): New method
(mlg-stack, mlg-frame): New variables.
(mlg-set-stack, mlg-set-stack-frame): New commands run from ML.
(mlg-show-frame, mlg-refresh-stack-buffer)
(mlg-show-stack): New commands to setup and display the stack.
(mlg-stack-mode-map, mlg-stack-mode-syntax-table): New
(mlg-stack-mode): New mode.
(mlg-stack-next, mlg-stack-prev, mlg-stack-click)
(mlg-stack-choose): New mode commands.
2019-12-08 22:20:02 -05:00
Eric Ludlam 9bca22a465 matlab-compat.el:
New compat macros for cl-defmethod, pulse, and font-lock stuff.

linemark.el, mlint.el, matlab-shell-gud.el, semanticdb-matlab.el:
Replace defmethod with cl-defmethod.
Replace call-next-method with cl-call-next-method.

linemark.el:
Also require matlab-compat.el

tests/Makefile:
Allow EMACS to be overridable
2019-12-08 13:08:43 -05:00
Eric Ludlam bff15251f2 matlab-shell-gud.el:
Enable debug commands via netshell.
(matlab-at-fcn): New macro, dispatch to netshell if active.
(matlab-gud-fcn): Revise doc, it was wrong.
Use matlab-at-fcn internally.
(matlab-shell-mode-gud-enable-bindings): Use matlab-at-fcn for
dbstop/dbclear.
(gud-matlab-tooltip-tips): Fix bug for events from the shell
buffer, which seem to generate events with a window that has no
buffer.
2019-12-08 12:33:37 -05:00
Eric Ludlam a6bcf575fa matlab-shell-gud.el:
Add support for visible breakpoints.
(matlab-shell-mode-gud-enable-bindings): Use ebstop,ebclear instead
of dbstop,dbclear.
(mlg-breakpoint): New class.
(matlab-gud-visible-breakpoints): New variable.
(mlg-reset-breakpoints, mlg-add-breakpoints, mlg-del-breakpoint): New.
Manage list of breakpoints.
On first add, add matlab-mode-hook to activate breakpoints when a
new ML buffer is pulled into a buffer.
(mlg-breakpoint-face): New face.
(mlg-breakpoint::mlg-activate): New method.
Creates an overlay at the loction of the breakpoint.
(mlg-breakpoint::mlg-deactivate)
(mlg-breakpoint-activate-buffer-opened-hook): New
(mlg-breakpoint-flush-and-reactivate): New command for debugging.

(matlab-shell-gud-minor-mode): Fix bug - want to make-local-variable,
not make it buffer local.
2019-12-07 19:41:49 -05:00
Eric Ludlam d4dc0cce54 matlab-shell-gud.el:
Refine some of the debugging environment.
(matlab-shell-mode-gud-enable-bindings): Remove extra /
from stop/clear commands.
Don't provide a print.
(matlab-shell-gud-minor-mode-map): Add C-xC-q binding
to disable the minor mode.  (like e)
(matlab-shell-gud-menu): Change text for exiting the minor mode.
Add show symbol value option.
(define-minor-mode): Replace the gud toolbar with our own.
Disable toolbar with our mode.

matlab.el:
Re-enable debug mode if it is available.
(matlab-mode-map): Replace `toggle-read-only' with
a matlab version.
(matlab-toggle-read-only): New command.
If the debugger is active, turn on matlab-shell-gud-minor-mode.
Otherwise do read-only-mode.
2019-12-07 13:17:57 -05:00
Eric Ludlam 30b8450c02 matlab-shell-gud.el:
(gud-matlab-marker-filter): For any output not terminated by \n,
check for any special prefixes, and dump the rest if those aren't there.
2019-12-02 21:53:48 -05:00
Eric Ludlam cb744da33e matlab-shell-gud.el:
(matlab-shell-gud-minor-mode): Make buffers in this mode read only.
Restore read only state by asking file if it is writable.
Do not change read only state for buffers w/out files.
2019-11-30 20:41:13 -05:00
Eric Ludlam e83947829f matlab-shell-gud.el;
(matlab-shell-debug-tooltips-p): New config variable.
(define-minor-mode): Only enable tooltips if new flag
is non-nil.
2019-11-30 20:15:45 -05:00
Eric Ludlam 65444dfa8a matlab-shell-gud.el:
(matlab-gud-fcn): New macro for controlling when gud commands are active.
(matlab-shell-mode-gud-enable-bindings): change gud commands to use
above macro.
Set gud-minor-mode to 'matlab
2019-11-29 11:21:56 -05:00
Eric Ludlam 90e0c7dcf7 matlab-shell-gud.el:
(gud-matlab-tool-bar-map): New.
(matlab-shell-mode-gud-enable-bindings): Disable gud toolbar.
(gud-matlab-debug-tracker): enable and disable gud toolbar only when K>> prompt is around.
2019-11-29 09:55:42 -05:00
Eric Ludlam 28e8d240f2 matlab-shell-gud.el:
Add debugging tooltips.
(matlab-shell-gud-startup): Remove `gud-overload-functions' code.
It doesn't seem to exist anymore.
(matlab-shell-gud-show-symbol-value): Use improved region query.
Don't show help if there was an error.  Instead note the
error in minibuffer.
(gud-matlab-tooltip-tips): Use new fcn below to compute tip.
Use emacstipstring ML command to compute text to show.
(matlab-shell-gud-find-tooltip-expression): New.
Compute the expression to send to ML to display.
2019-11-29 08:52:24 -05:00
Eric Ludlam 7e2b44d613 matlab-shell-gud.el:
Add support for data tooltips when debugging.
(matlab-shell-gud-startup): Add matlab-mode to list of gud tooltip supported modes.
(matlab-shell-gud-minor-mode): Add enable/disable of gud-toolti-mode,
and our special hook.
(gud-matlab-tooltip-tips): New.  Fcn for displaying a tooltip via the help of
gud-tooltip-mode, and tooltip-mode.
2019-11-28 23:31:00 -05:00
Eric Ludlam 843f05b112 matlab-shell-gud.el:
(matlab-shell-gud-minor-mode-map): Add 'p' to print.
(matlab-shell-gud-show-symbol-value): New.
2019-11-28 21:19:37 -05:00
Eric Ludlam 54dcd8a8e5 matlab-shell-gud.el:
Add fancy debugging mode for MATLAB buffers.
(matlab-shell-gud-startup): Add a debug tracker hook.
(gud-matlab-marker-regexp-k>>): Rename from borig -1
(gud-matlab-marker-regexp->>): New
(gud-matlab-marker-regexp-2): Delete
(gud-matlab-marker-filter): Use renamed or new vars from above.
(gud-matlab-debug-active): New
(gud-matlab-debug-activate-hook, *-deactivate-hook): New
(gud-matlab-debug-tracker): New fcn to activate and deactivate
our special debug features.
(matlab-shell-gud-minor-mode-map)
(matlab-shell-god-menu)
(matlab-shell-gud-minor-mode)
(global-matlab-shell-gud-minor-mode)
(matlab-shell-gud-mode-edit)
(matlab-shell-gud-mode-help-notice)
(matlab-shell-gud-mode-help): New minor mode that provides
direct access to gud comands w/out prefix keys.
2019-11-28 20:31:30 -05:00
Eric Ludlam 7ff56a8246 matlab-shell-gud.el:
New, content copied from matlab-shell, includes
all the GUD specific support, including the process filter.

Makefile, Project.ede:
Include matlab-shell-gud.el
2019-11-28 18:14:25 -05:00