diff options
| author | Gerd Möllmann | 2023-10-19 11:27:14 +0200 |
|---|---|---|
| committer | Gerd Möllmann | 2023-10-19 11:27:14 +0200 |
| commit | 0fd7f785e76c9f2eea1baa40aed6ee327f68a993 (patch) | |
| tree | c58d3dc7721ad9bc551d11312dc39c34f44a529a | |
| parent | f2ae1996f74320a0fbefa66cb7acc88fe4c163e3 (diff) | |
| download | emacs-0fd7f785e76c9f2eea1baa40aed6ee327f68a993.tar.gz emacs-0fd7f785e76c9f2eea1baa40aed6ee327f68a993.zip | |
Gud support for column numbers
Allow gud-last-frame to be of the form (FILE LINE COLUMN).
* lisp/progmodes/gud.el (gud-display-frame): Support column numbers.
(gud-display-line): New optional parameter for column number. Move
point to that column, if set.
(gud-lldb-marker-filter): Set column number.
| -rw-r--r-- | lisp/progmodes/gud.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 5bc333c6730..805e7a1b7a4 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -3021,7 +3021,12 @@ Obeying it means displaying in another window the specified file and line." | |||
| 3021 | (interactive) | 3021 | (interactive) |
| 3022 | (when gud-last-frame | 3022 | (when gud-last-frame |
| 3023 | (gud-set-buffer) | 3023 | (gud-set-buffer) |
| 3024 | (gud-display-line (car gud-last-frame) (cdr gud-last-frame)) | 3024 | ;; Support either (file . line) or (file line column). |
| 3025 | (if (consp (cdr gud-last-frame)) | ||
| 3026 | (let ((line (cadr gud-last-frame)) | ||
| 3027 | (column (caddr gud-last-frame))) | ||
| 3028 | (gud-display-line (car gud-last-frame) line column)) | ||
| 3029 | (gud-display-line (car gud-last-frame) (cdr gud-last-frame))) | ||
| 3025 | (setq gud-last-last-frame gud-last-frame | 3030 | (setq gud-last-last-frame gud-last-frame |
| 3026 | gud-last-frame nil))) | 3031 | gud-last-frame nil))) |
| 3027 | 3032 | ||
| @@ -3054,7 +3059,7 @@ line, until it is displaced by subsequent cursor motion." | |||
| 3054 | "Face for highlighting the source code line being executed." | 3059 | "Face for highlighting the source code line being executed." |
| 3055 | :version "30.1") | 3060 | :version "30.1") |
| 3056 | 3061 | ||
| 3057 | (defun gud-display-line (true-file line) | 3062 | (defun gud-display-line (true-file line &optional column) |
| 3058 | (let* ((last-nonmenu-event t) ; Prevent use of dialog box for questions. | 3063 | (let* ((last-nonmenu-event t) ; Prevent use of dialog box for questions. |
| 3059 | (buffer | 3064 | (buffer |
| 3060 | (with-current-buffer gud-comint-buffer | 3065 | (with-current-buffer gud-comint-buffer |
| @@ -3080,6 +3085,8 @@ line, until it is displaced by subsequent cursor motion." | |||
| 3080 | (goto-char (point-min)) | 3085 | (goto-char (point-min)) |
| 3081 | (forward-line (1- line)) | 3086 | (forward-line (1- line)) |
| 3082 | (setq pos (point)) | 3087 | (setq pos (point)) |
| 3088 | (when column | ||
| 3089 | (forward-char (1- column))) | ||
| 3083 | (or gud-overlay-arrow-position | 3090 | (or gud-overlay-arrow-position |
| 3084 | (setq gud-overlay-arrow-position (make-marker))) | 3091 | (setq gud-overlay-arrow-position (make-marker))) |
| 3085 | (set-marker gud-overlay-arrow-position (point) (current-buffer)) | 3092 | (set-marker gud-overlay-arrow-position (point) (current-buffer)) |
| @@ -3859,8 +3866,8 @@ so they have been disabled.")) | |||
| 3859 | "Default command to run an executable under LLDB." | 3866 | "Default command to run an executable under LLDB." |
| 3860 | :type 'string) | 3867 | :type 'string) |
| 3861 | 3868 | ||
| 3862 | (cl-defun gud-lldb-stop (&key file line _column) | 3869 | (cl-defun gud-lldb-stop (&key file line column) |
| 3863 | (setq gud-last-frame (cons file line))) | 3870 | (setq gud-last-frame (list file line column))) |
| 3864 | 3871 | ||
| 3865 | (defun gud-lldb-marker-filter (string) | 3872 | (defun gud-lldb-marker-filter (string) |
| 3866 | "Deduce interesting stuff from process output STRING." | 3873 | "Deduce interesting stuff from process output STRING." |