comparison lisp/gud.el @ 15624:2cf06d9df144

(gud-irix-p): Exclude Irix6.1 up. (gud-dbx-use-stopformat-p): New variable. (dbx): Use it to send $stopformat for Irix6. (gud-irixdbx-marker-filter): Cast $curline to int, not long (see added comments). (dbx): Likewise.
author Karl Heuer <kwzh@gnu.org>
date Sun, 07 Jul 1996 22:29:37 +0000
parents 751cae978048
children 95be49f33453
comparison
equal deleted inserted replaced
15623:f7b797ba1874 15624:2cf06d9df144
2 2
3 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 3 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
4 ;; Maintainer: FSF 4 ;; Maintainer: FSF
5 ;; Keywords: unix, tools 5 ;; Keywords: unix, tools
6 6
7 ;; Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 7 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
646 ;; number rather than a line number etc. Maybe this could be made to 646 ;; number rather than a line number etc. Maybe this could be made to
647 ;; work by listing all the breakpoints and picking the one(s) with the 647 ;; work by listing all the breakpoints and picking the one(s) with the
648 ;; correct line number, but life's too short. 648 ;; correct line number, but life's too short.
649 ;; d.love@dl.ac.uk (Dave Love) can be blamed for this 649 ;; d.love@dl.ac.uk (Dave Love) can be blamed for this
650 650
651 (defvar gud-irix-p (string-match "^mips-[^-]*-irix" system-configuration) 651 (defvar gud-irix-p
652 (and (string-match "^mips-[^-]*-irix" system-configuration)
653 (not (string-match "irix[6-9]\\.[1-9]" system-configuration)))
652 "Non-nil to assume the interface appropriate for IRIX dbx. 654 "Non-nil to assume the interface appropriate for IRIX dbx.
653 This works in IRIX 4, 5 and 6.") 655 This works in IRIX 4, 5 and 6, but `gud-dbx-use-stopformat-p' provides
656 a better solution in 6.1 upwards.")
657 (defvar gud-dbx-use-stopformat-p
658 (string-match "irix[6-9]\\.[1-9]" system-configuration)
659 "Non-nil to use the dbx feature present at least from Irix 6.1
660 whereby $stopformat=1 produces an output format compatiable with
661 `gud-dbx-marker-filter'.")
654 ;; [Irix dbx seems to be a moving target. The dbx output changed 662 ;; [Irix dbx seems to be a moving target. The dbx output changed
655 ;; subtly sometime between OS v4.0.5 and v5.2 so that, for instance, 663 ;; subtly sometime between OS v4.0.5 and v5.2 so that, for instance,
656 ;; the output from `up' is no longer spotted by gud (and it's probably 664 ;; the output from `up' is no longer spotted by gud (and it's probably
657 ;; not distinctive enough to try to match it -- use C-<, C-> 665 ;; not distinctive enough to try to match it -- use C-<, C->
658 ;; exclusively) . For 5.3 and 6.0, the $curline variable changed to 666 ;; exclusively) . For 5.3 and 6.0, the $curline variable changed to
659 ;; `long long'(why?!), so the printf stuff needed changing. The line 667 ;; `long long'(why?!), so the printf stuff needed changing. The line
660 ;; number is cast to `long' as a compromise between the new `long 668 ;; number was cast to `long' as a compromise between the new `long
661 ;; long' and the original `int'. The process filter is also somewhat 669 ;; long' and the original `int'. This is reported not to work in 6.2,
670 ;; so it's changed back to int -- don't make your sources too long.
671 ;; From Irix6.1 (but not 6.0?) dbx supports an undocumented feature
672 ;; whereby `set $stopformat=1' reportedly produces output compatible
673 ;; with `gud-dbx-marker-filter', which we prefer.
674
675 ;; The process filter is also somewhat
662 ;; unreliable, sometimes not spotting the markers; I don't know 676 ;; unreliable, sometimes not spotting the markers; I don't know
663 ;; whether there's anything that can be done about that. It would be 677 ;; whether there's anything that can be done about that. It would be
664 ;; much better if SGI could be persuaded to (re?)instate the MIPS 678 ;; much better if SGI could be persuaded to (re?)instate the MIPS
665 ;; -emacs flag for gdb-like output (which ought to be possible as most 679 ;; -emacs flag for gdb-like output (which ought to be possible as most
666 ;; of the communication I've had over it has been from sgi.com).] 680 ;; of the communication I've had over it has been from sgi.com).]
683 "^\\(\\[[0-9]+] \\)?Process +[0-9]+ ([^)]*) [^[]+\\[[^]\n]*]\n" 697 "^\\(\\[[0-9]+] \\)?Process +[0-9]+ ([^)]*) [^[]+\\[[^]\n]*]\n"
684 result) 698 result)
685 ;; prod dbx into printing out the line number and file 699 ;; prod dbx into printing out the line number and file
686 ;; name in a form we can grok as below 700 ;; name in a form we can grok as below
687 (process-send-string (get-buffer-process gud-comint-buffer) 701 (process-send-string (get-buffer-process gud-comint-buffer)
688 "printf \"\032\032%1ld:\",(long)$curline;file\n")) 702 "printf \"\032\032%1d:\",(int)$curline;file\n"))
689 ;; look for result of, say, "up" e.g.: 703 ;; look for result of, say, "up" e.g.:
690 ;; .pplot.pplot(0x800) ["src/pplot.f":261, 0x400c7c] 704 ;; .pplot.pplot(0x800) ["src/pplot.f":261, 0x400c7c]
691 ;; (this will also catch one of the lines printed by "where") 705 ;; (this will also catch one of the lines printed by "where")
692 ((string-match 706 ((string-match
693 "^[^ ][^[]*\\[\"\\([^\"]+\\)\":\\([0-9]+\\), [^]]+]\n" 707 "^[^ ][^[]*\\[\"\\([^\"]+\\)\":\\([0-9]+\\), [^]]+]\n"
762 (gud-def gud-finish "return" "\C-f" "Finish executing current function.")) 776 (gud-def gud-finish "return" "\C-f" "Finish executing current function."))
763 (gud-irix-p 777 (gud-irix-p
764 (gud-def gud-break "stop at \"%d%f\":%l" 778 (gud-def gud-break "stop at \"%d%f\":%l"
765 "\C-b" "Set breakpoint at current line.") 779 "\C-b" "Set breakpoint at current line.")
766 (gud-def gud-finish "return" "\C-f" "Finish executing current function.") 780 (gud-def gud-finish "return" "\C-f" "Finish executing current function.")
767 (gud-def gud-up "up %p; printf \"\032\032%1ld:\",(long)$curline;file\n" 781 (gud-def gud-up "up %p; printf \"\032\032%1d:\",(int)$curline;file\n"
768 "<" "Up (numeric arg) stack frames.") 782 "<" "Up (numeric arg) stack frames.")
769 (gud-def gud-down "down %p; printf \"\032\032%1ld:\",(long)$curline;file\n" 783 (gud-def gud-down "down %p; printf \"\032\032%1d:\",(int)$curline;file\n"
770 ">" "Down (numeric arg) stack frames.") 784 ">" "Down (numeric arg) stack frames.")
771 ;; Make dbx give out the source location info that we need. 785 ;; Make dbx give out the source location info that we need.
772 (process-send-string (get-buffer-process gud-comint-buffer) 786 (process-send-string (get-buffer-process gud-comint-buffer)
773 "printf \"\032\032%1ld:\",(long)$curline;file\n")) 787 "printf \"\032\032%1d:\",(int)$curline;file\n"))
788 (gud-dbx-use-stopformat-p
789 (process-send-string (get-buffer-process gud-comint-buffer)
790 "set $stopformat=1\n"))
774 (t 791 (t
775 (gud-def gud-up "up %p" "<" "Up (numeric arg) stack frames.") 792 (gud-def gud-up "up %p" "<" "Up (numeric arg) stack frames.")
776 (gud-def gud-down "down %p" ">" "Down (numeric arg) stack frames.") 793 (gud-def gud-down "down %p" ">" "Down (numeric arg) stack frames.")
777 (gud-def gud-break "file \"%d%f\"\nstop at %l" 794 (gud-def gud-break "file \"%d%f\"\nstop at %l"
778 "\C-b" "Set breakpoint at current line."))) 795 "\C-b" "Set breakpoint at current line.")))