diff options
| author | Nick Roberts | 2007-02-26 21:10:38 +0000 |
|---|---|---|
| committer | Nick Roberts | 2007-02-26 21:10:38 +0000 |
| commit | f6f3d0b9133d06b29523c7bc744130cddc5c8d6b (patch) | |
| tree | 08827947b922f390382bf9f35372c9ae4db0212f | |
| parent | e8388d28ac9af5c3323e2317073466d9efae8573 (diff) | |
| download | emacs-f6f3d0b9133d06b29523c7bc744130cddc5c8d6b.tar.gz emacs-f6f3d0b9133d06b29523c7bc744130cddc5c8d6b.zip | |
(gud, gud-menu-map): Remove references to bash/bashdb.
(gud-bashdb-history, gud-bashdb-marker-filter)
(gud-bashdb-command-name, bashdb): Remove.
(gud-pdb-marker-regexp): Add optional <module> keyword for Python 2.5.
| -rw-r--r-- | lisp/progmodes/gud.el | 133 |
1 files changed, 6 insertions, 127 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 312b7187225..1662af1c924 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -58,7 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | (defgroup gud nil | 59 | (defgroup gud nil |
| 60 | "Grand Unified Debugger mode for gdb and other debuggers under Emacs. | 60 | "Grand Unified Debugger mode for gdb and other debuggers under Emacs. |
| 61 | Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb, and bash." | 61 | Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb." |
| 62 | :group 'unix | 62 | :group 'unix |
| 63 | :group 'tools) | 63 | :group 'tools) |
| 64 | 64 | ||
| @@ -166,18 +166,18 @@ Used to grey out relevant toolbar icons.") | |||
| 166 | ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak | 166 | ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak |
| 167 | :enable (not gud-running) | 167 | :enable (not gud-running) |
| 168 | :visible (memq gud-minor-mode | 168 | :visible (memq gud-minor-mode |
| 169 | '(gdbmi gdba gdb sdb xdb bashdb))) | 169 | '(gdbmi gdba gdb sdb xdb))) |
| 170 | ([break] menu-item "Set Breakpoint" gud-break | 170 | ([break] menu-item "Set Breakpoint" gud-break |
| 171 | :enable (not gud-running) | 171 | :enable (not gud-running) |
| 172 | :visible (gud-tool-bar-item-visible-no-fringe)) | 172 | :visible (gud-tool-bar-item-visible-no-fringe)) |
| 173 | ([up] menu-item "Up Stack" gud-up | 173 | ([up] menu-item "Up Stack" gud-up |
| 174 | :enable (not gud-running) | 174 | :enable (not gud-running) |
| 175 | :visible (memq gud-minor-mode | 175 | :visible (memq gud-minor-mode |
| 176 | '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))) | 176 | '(gdbmi gdba gdb dbx xdb jdb pdb))) |
| 177 | ([down] menu-item "Down Stack" gud-down | 177 | ([down] menu-item "Down Stack" gud-down |
| 178 | :enable (not gud-running) | 178 | :enable (not gud-running) |
| 179 | :visible (memq gud-minor-mode | 179 | :visible (memq gud-minor-mode |
| 180 | '(gdbmi gdba gdb dbx xdb jdb pdb bashdb))) | 180 | '(gdbmi gdba gdb dbx xdb jdb pdb))) |
| 181 | ([pp] menu-item "Print S-expression" gud-pp | 181 | ([pp] menu-item "Print S-expression" gud-pp |
| 182 | :enable (and (not gud-running) | 182 | :enable (and (not gud-running) |
| 183 | gdb-active-process) | 183 | gdb-active-process) |
| @@ -196,7 +196,7 @@ Used to grey out relevant toolbar icons.") | |||
| 196 | ([finish] menu-item "Finish Function" gud-finish | 196 | ([finish] menu-item "Finish Function" gud-finish |
| 197 | :enable (not gud-running) | 197 | :enable (not gud-running) |
| 198 | :visible (memq gud-minor-mode | 198 | :visible (memq gud-minor-mode |
| 199 | '(gdbmi gdba gdb xdb jdb pdb bashdb))) | 199 | '(gdbmi gdba gdb xdb jdb pdb))) |
| 200 | ([stepi] menu-item "Step Instruction" gud-stepi | 200 | ([stepi] menu-item "Step Instruction" gud-stepi |
| 201 | :enable (not gud-running) | 201 | :enable (not gud-running) |
| 202 | :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx))) | 202 | :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx))) |
| @@ -1520,7 +1520,7 @@ and source-file directory for your debugger." | |||
| 1520 | ;; Last group is for return value, e.g. "> test.py(2)foo()->None" | 1520 | ;; Last group is for return value, e.g. "> test.py(2)foo()->None" |
| 1521 | ;; Either file or function name may be omitted: "> <string>(0)?()" | 1521 | ;; Either file or function name may be omitted: "> <string>(0)?()" |
| 1522 | (defvar gud-pdb-marker-regexp | 1522 | (defvar gud-pdb-marker-regexp |
| 1523 | "^> \\([-a-zA-Z0-9_/.:\\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\)()\\(->[^\n]*\\)?\n") | 1523 | "^> \\([-a-zA-Z0-9_/.:\\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n]*\\)?\n") |
| 1524 | (defvar gud-pdb-marker-regexp-file-group 1) | 1524 | (defvar gud-pdb-marker-regexp-file-group 1) |
| 1525 | (defvar gud-pdb-marker-regexp-line-group 2) | 1525 | (defvar gud-pdb-marker-regexp-line-group 2) |
| 1526 | (defvar gud-pdb-marker-regexp-fnname-group 3) | 1526 | (defvar gud-pdb-marker-regexp-fnname-group 3) |
| @@ -2286,127 +2286,6 @@ gud, see `gud-mode'." | |||
| 2286 | (gud-jdb-build-source-files-list gud-jdb-directories | 2286 | (gud-jdb-build-source-files-list gud-jdb-directories |
| 2287 | "\\.java$")))) | 2287 | "\\.java$")))) |
| 2288 | (fset 'gud-jdb-find-source 'gud-jdb-find-source-file))) | 2288 | (fset 'gud-jdb-find-source 'gud-jdb-find-source-file))) |
| 2289 | |||
| 2290 | |||
| 2291 | ;; ====================================================================== | ||
| 2292 | ;; | ||
| 2293 | ;; BASHDB support. See http://bashdb.sourceforge.net | ||
| 2294 | ;; | ||
| 2295 | ;; AUTHOR: Rocky Bernstein <rocky@panix.com> | ||
| 2296 | ;; | ||
| 2297 | ;; CREATED: Sun Nov 10 10:46:38 2002 Rocky Bernstein. | ||
| 2298 | ;; | ||
| 2299 | ;; INVOCATION NOTES: | ||
| 2300 | ;; | ||
| 2301 | ;; You invoke bashdb-mode with: | ||
| 2302 | ;; | ||
| 2303 | ;; M-x bashdb <enter> | ||
| 2304 | ;; | ||
| 2305 | ;; It responds with: | ||
| 2306 | ;; | ||
| 2307 | ;; Run bashdb (like this): bash | ||
| 2308 | ;; | ||
| 2309 | |||
| 2310 | ;; History of argument lists passed to bashdb. | ||
| 2311 | (defvar gud-bashdb-history nil) | ||
| 2312 | |||
| 2313 | ;; Convert a command line as would be typed normally to run a script | ||
| 2314 | ;; into one that invokes an Emacs-enabled debugging session. | ||
| 2315 | ;; "--debugger" in inserted as the first switch. | ||
| 2316 | |||
| 2317 | ;; There's no guarantee that Emacs will hand the filter the entire | ||
| 2318 | ;; marker at once; it could be broken up across several strings. We | ||
| 2319 | ;; might even receive a big chunk with several markers in it. If we | ||
| 2320 | ;; receive a chunk of text which looks like it might contain the | ||
| 2321 | ;; beginning of a marker, we save it here between calls to the | ||
| 2322 | ;; filter. | ||
| 2323 | (defun gud-bashdb-marker-filter (string) | ||
| 2324 | (setq gud-marker-acc (concat gud-marker-acc string)) | ||
| 2325 | (let ((output "")) | ||
| 2326 | |||
| 2327 | ;; Process all the complete markers in this chunk. | ||
| 2328 | ;; Format of line looks like this: | ||
| 2329 | ;; (/etc/init.d/ntp.init:16): | ||
| 2330 | ;; but we also allow DOS drive letters | ||
| 2331 | ;; (d:/etc/init.d/ntp.init:16): | ||
| 2332 | (while (string-match "\\(^\\|\n\\)(\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\)):.*\n" | ||
| 2333 | gud-marker-acc) | ||
| 2334 | (setq | ||
| 2335 | |||
| 2336 | ;; Extract the frame position from the marker. | ||
| 2337 | gud-last-frame | ||
| 2338 | (cons (match-string 2 gud-marker-acc) | ||
| 2339 | (string-to-number (match-string 4 gud-marker-acc))) | ||
| 2340 | |||
| 2341 | ;; Append any text before the marker to the output we're going | ||
| 2342 | ;; to return - we don't include the marker in this text. | ||
| 2343 | output (concat output | ||
| 2344 | (substring gud-marker-acc 0 (match-beginning 0))) | ||
| 2345 | |||
| 2346 | ;; Set the accumulator to the remaining text. | ||
| 2347 | gud-marker-acc (substring gud-marker-acc (match-end 0)))) | ||
| 2348 | |||
| 2349 | ;; Does the remaining text look like it might end with the | ||
| 2350 | ;; beginning of another marker? If it does, then keep it in | ||
| 2351 | ;; gud-marker-acc until we receive the rest of it. Since we | ||
| 2352 | ;; know the full marker regexp above failed, it's pretty simple to | ||
| 2353 | ;; test for marker starts. | ||
| 2354 | (if (string-match "\032.*\\'" gud-marker-acc) | ||
| 2355 | (progn | ||
| 2356 | ;; Everything before the potential marker start can be output. | ||
| 2357 | (setq output (concat output (substring gud-marker-acc | ||
| 2358 | 0 (match-beginning 0)))) | ||
| 2359 | |||
| 2360 | ;; Everything after, we save, to combine with later input. | ||
| 2361 | (setq gud-marker-acc | ||
| 2362 | (substring gud-marker-acc (match-beginning 0)))) | ||
| 2363 | |||
| 2364 | (setq output (concat output gud-marker-acc) | ||
| 2365 | gud-marker-acc "")) | ||
| 2366 | |||
| 2367 | output)) | ||
| 2368 | |||
| 2369 | (defcustom gud-bashdb-command-name "bash --debugger" | ||
| 2370 | "File name for executing bash debugger." | ||
| 2371 | :type 'string | ||
| 2372 | :group 'gud) | ||
| 2373 | |||
| 2374 | ;;;###autoload | ||
| 2375 | (defun bashdb (command-line) | ||
| 2376 | "Run bashdb on program FILE in buffer *gud-FILE*. | ||
| 2377 | The directory containing FILE becomes the initial working directory | ||
| 2378 | and source-file directory for your debugger." | ||
| 2379 | (interactive | ||
| 2380 | (list (read-from-minibuffer "Run bashdb (like this): " | ||
| 2381 | (if (consp gud-bashdb-history) | ||
| 2382 | (car gud-bashdb-history) | ||
| 2383 | (concat gud-bashdb-command-name | ||
| 2384 | " ")) | ||
| 2385 | gud-minibuffer-local-map nil | ||
| 2386 | '(gud-bashdb-history . 1)))) | ||
| 2387 | |||
| 2388 | (gud-common-init command-line nil 'gud-bashdb-marker-filter) | ||
| 2389 | |||
| 2390 | (set (make-local-variable 'gud-minor-mode) 'bashdb) | ||
| 2391 | |||
| 2392 | (gud-def gud-break "break %l" "\C-b" "Set breakpoint at current line.") | ||
| 2393 | (gud-def gud-tbreak "tbreak %l" "\C-t" "Set temporary breakpoint at current line.") | ||
| 2394 | (gud-def gud-remove "clear %l" "\C-d" "Remove breakpoint at current line") | ||
| 2395 | (gud-def gud-step "step" "\C-s" "Step one source line with display.") | ||
| 2396 | (gud-def gud-next "next" "\C-n" "Step one line (skip functions).") | ||
| 2397 | (gud-def gud-cont "continue" "\C-r" "Continue with display.") | ||
| 2398 | (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") | ||
| 2399 | (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") | ||
| 2400 | (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") | ||
| 2401 | (gud-def gud-print "x %e" "\C-p" "Evaluate BASH expression at point.") | ||
| 2402 | |||
| 2403 | ;; Is this right? | ||
| 2404 | (gud-def gud-statement "eval %e" "\C-e" "Execute BASH statement at point.") | ||
| 2405 | |||
| 2406 | (setq comint-prompt-regexp "^bashdb<+(*[0-9]+)*>+ ") | ||
| 2407 | (setq paragraph-start comint-prompt-regexp) | ||
| 2408 | (run-hooks 'bashdb-mode-hook) | ||
| 2409 | ) | ||
| 2410 | 2289 | ||
| 2411 | ;; | 2290 | ;; |
| 2412 | ;; End of debugger-specific information | 2291 | ;; End of debugger-specific information |