aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-01-02 23:40:27 +0000
committerRichard M. Stallman1995-01-02 23:40:27 +0000
commit7f629252801871bed48456926dbf838ca71e8ed9 (patch)
tree7c5f5881bfe7f75796e6c21bf7257f01c67f9740
parente4d02e0473af317a8c49fc91903297f407614c36 (diff)
downloademacs-7f629252801871bed48456926dbf838ca71e8ed9.tar.gz
emacs-7f629252801871bed48456926dbf838ca71e8ed9.zip
(gud-dbx-marker-filter): Use gud-marker-acc like gud-gdb-marker-filter.
(gud-sdb-marker-filter): Use gud-marker-acc.
-rw-r--r--lisp/gud.el116
1 files changed, 76 insertions, 40 deletions
diff --git a/lisp/gud.el b/lisp/gud.el
index d39e87484df..dac53a13469 100644
--- a/lisp/gud.el
+++ b/lisp/gud.el
@@ -367,38 +367,57 @@ available with older versions of GDB."
367 (cons file args)) 367 (cons file args))
368 368
369(defun gud-sdb-marker-filter (string) 369(defun gud-sdb-marker-filter (string)
370 (cond 370 (setq gud-marker-acc
371 ;; System V Release 3.2 uses this format 371 (if gud-marker-acc (concat gud-marker-acc string) string))
372 ((string-match "\\(^0x\\w* in \\|^\\|\n\\)\\([^:\n]*\\):\\([0-9]*\\):.*\n" 372 (let (start)
373 string) 373 ;; Process all complete markers in this chunk
374 (setq gud-last-frame 374 (while
375 (cons 375 (cond
376 (substring string (match-beginning 2) (match-end 2)) 376 ;; System V Release 3.2 uses this format
377 (string-to-int 377 ((string-match "\\(^0x\\w* in \\|^\\|\n\\)\\([^:\n]*\\):\\([0-9]*\\):.*\n"
378 (substring string (match-beginning 3) (match-end 3)))))) 378 gud-marker-acc start)
379 ;; System V Release 4.0 quite often clumps two lines together 379 (setq gud-last-frame
380 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):" 380 (cons
381 string) 381 (substring gud-marker-acc (match-beginning 2) (match-end 2))
382 (setq gud-sdb-lastfile 382 (string-to-int
383 (substring string (match-beginning 2) (match-end 2))) 383 (substring gud-marker-acc (match-beginning 3) (match-end 3))))))
384 (setq gud-last-frame 384 ;; System V Release 4.0 quite often clumps two lines together
385 (cons 385 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):"
386 gud-sdb-lastfile 386 gud-marker-acc start)
387 (string-to-int 387 (setq gud-sdb-lastfile
388 (substring string (match-beginning 3) (match-end 3)))))) 388 (substring gud-marker-acc (match-beginning 2) (match-end 2)))
389 ;; System V Release 4.0 389 (setq gud-last-frame
390 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n" 390 (cons
391 string) 391 gud-sdb-lastfile
392 (setq gud-sdb-lastfile 392 (string-to-int
393 (substring string (match-beginning 2) (match-end 2)))) 393 (substring gud-marker-acc (match-beginning 3) (match-end 3))))))
394 ((and gud-sdb-lastfile (string-match "^\\([0-9]+\\):" string)) 394 ;; System V Release 4.0
395 (setq gud-last-frame 395 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n"
396 (cons 396 gud-marker-acc start)
397 gud-sdb-lastfile 397 (setq gud-sdb-lastfile
398 (string-to-int 398 (substring gud-marker-acc (match-beginning 2) (match-end 2))))
399 (substring string (match-beginning 1) (match-end 1)))))) 399 ((and gud-sdb-lastfile (string-match "^\\([0-9]+\\):"
400 (t 400 gud-marker-acc start))
401 (setq gud-sdb-lastfile nil))) 401 (setq gud-last-frame
402 (cons
403 gud-sdb-lastfile
404 (string-to-int
405 (substring gud-marker-acc (match-beginning 1) (match-end 1))))))
406 (t
407 (setq gud-sdb-lastfile nil)))
408 (setq start (match-end 0)))
409
410 ;; Search for the last incomplete line in this chunk
411 (while (string-match "\n" gud-marker-acc start)
412 (setq start (match-end 0)))
413
414 ;; If we have an incomplete line, store it in gud-marker-acc.
415 ;; Otherwise clear gud-marker-acc. to avoid an
416 ;; unnecessary concat when this function runs next.
417 (setq gud-marker-acc
418 (if (= start (length gud-marker-acc))
419 (substring gud-marker-acc start)
420 nil)))
402 string) 421 string)
403 422
404(defun gud-sdb-find-file (f) 423(defun gud-sdb-find-file (f)
@@ -453,17 +472,34 @@ and source-file directory for your debugger."
453 (cons file args)) 472 (cons file args))
454 473
455(defun gud-dbx-marker-filter (string) 474(defun gud-dbx-marker-filter (string)
456 (if (or (string-match 475 (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string))
457 "stopped in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\"" 476
458 string) 477 (let (start)
459 (string-match 478 ;; Process all complete markers in this chunk.
460 "signal .* in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\"" 479 (while (or (string-match
461 string)) 480 "stopped in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\""
481 gud-marker-acc start)
482 (string-match
483 "signal .* in .* at line \\([0-9]*\\) in file \"\\([^\"]*\\)\""
484 gud-marker-acc start))
462 (setq gud-last-frame 485 (setq gud-last-frame
463 (cons 486 (cons
464 (substring string (match-beginning 2) (match-end 2)) 487 (substring gud-marker-acc (match-beginning 2) (match-end 2))
465 (string-to-int 488 (string-to-int
466 (substring string (match-beginning 1) (match-end 1)))))) 489 (substring gud-marker-acc (match-beginning 1) (match-end 1))))
490 start (match-end 0)))
491
492 ;; Search for the last incomplete line in this chunk
493 (while (string-match "\n" gud-marker-acc start)
494 (setq start (match-end 0)))
495
496 ;; If the incomplete line APPEARS to begin with another marker, keep it
497 ;; in the accumulator. Otherwise, clear the accumulator to avoid an
498 ;; unnecessary concat during the next call.
499 (setq gud-marker-acc
500 (if (string-match "\\(stopped\\|signal\\)" gud-marker-acc start)
501 (substring gud-marker-acc (match-beginning 0))
502 nil)))
467 string) 503 string)
468 504
469;; Functions for Mips-style dbx. Given the option `-emacs', documented in 505;; Functions for Mips-style dbx. Given the option `-emacs', documented in