branch: externals/realgud commit 446c26bdfba3c85b75cfca180797fb1f1b9c19c0 Author: rocky <ro...@gnu.org> Commit: rocky <ro...@gnu.org>
Adds ource-path to cmdbuf... to track last source code file seen. Don't require breakpoint-set messages to require a filename or a breakpoint location. Use the current source-code path if it is no source path is given. --- configure.ac | 6 +++--- realgud/common/buffer/command.el | 6 +++++- realgud/common/file.el | 3 +++ realgud/common/track.el | 10 +++++++--- realgud/lang/Makefile.am | 1 + 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 8914c39..de0d932 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,7 @@ AC_ARG_WITH(emacs, AC_HELP_STRING([--with-emacs], AC_MSG_NOTICE("Checking emacs version") $EMACS -batch -q --no-site-file -eval \ - '(if (<= emacs-major-version 23) + '(if (< emacs-major-version 24) (progn (error "You need GNU Emacs 24 or better.") (kill-emacs 1) @@ -33,8 +33,8 @@ if test $? -ne 0 ; then fi ################################################################## -# See if --with-lispdir was set. If not, set it to a reasonable default -# based on where bash thinks bashdb is supposed to be installed. +# See if --with-lispdir was set. If not, set it to a reasonable +#default. ################################################################## AM_MISSING_PROG(GIT2CL, git2cl, $missing_dir) diff --git a/realgud/common/buffer/command.el b/realgud/common/buffer/command.el index bfb870a..31d3767 100644 --- a/realgud/common/buffer/command.el +++ b/realgud/common/buffer/command.el @@ -81,6 +81,8 @@ ;; this debugger. Eventually loc-regexp, file-group ;; and line-group below will removed and stored here. srcbuf-list ;; list of source buffers we have stopped at + source-path ;; last source-code path we've seen + bt-buf ;; backtrace buffer if it exists bp-list ;; list of breakpoints divert-output? ;; Output is part of a conversation between front-end @@ -95,7 +97,6 @@ ;; when evaluating an expression. For example, ;; some trepan debuggers expression values prefaced with: ;; $DB::D[0] = - ;; FIXME: REMOVE THIS and use regexp-hash loc-regexp ;; Location regular expression string file-group @@ -155,6 +156,7 @@ (realgud-struct-field-setter "realgud-cmdbuf-info" "no-record?") (realgud-struct-field-setter "realgud-cmdbuf-info" "prior-prompt-regexp") (realgud-struct-field-setter "realgud-cmdbuf-info" "src-shortkey?") +(realgud-struct-field-setter "realgud-cmdbuf-info" "source-path") (realgud-struct-field-setter "realgud-cmdbuf-info" "in-debugger?") (realgud-struct-field-setter "realgud-cmdbuf-info" "callback-loc-fn") (realgud-struct-field-setter "realgud-cmdbuf-info" "callback-eval-filter") @@ -280,6 +282,8 @@ This is based on an org-mode buffer. Hit tab to expand/contract sections. (json-encode (realgud-cmdbuf-info-cmd-args info))) (format " - Starting directory ::\t%s\n" (realgud-cmdbuf-info-starting-directory info)) + (format " - Current source-code path ::\t[[%s]]\n" + (realgud-cmdbuf-info-source-path info)) (format " - Selected window should contain source? :: %s\n" (realgud-cmdbuf-info-in-srcbuf? info)) (format " - Last input end ::\t%s\n" diff --git a/realgud/common/file.el b/realgud/common/file.el index 06ef03f..51746e6 100644 --- a/realgud/common/file.el +++ b/realgud/common/file.el @@ -156,6 +156,9 @@ problem as best as we can determine." (source-buffer (find-file-noselect filename)) (source-mark)) + ;; Set this filename as the last one seen in cmdbuf + (realgud-cmdbuf-info-source-path= filename) + ;; And you thought we'd never get around to ;; doing something other than validation? (with-current-buffer source-buffer diff --git a/realgud/common/track.el b/realgud/common/track.el index db808ff..0250700 100644 --- a/realgud/common/track.el +++ b/realgud/common/track.el @@ -492,7 +492,7 @@ Otherwise return nil." ) (defun realgud-track-bp-loc(text &optional cmd-mark cmdbuf opt-ignore-re-file-list) - "Do regular-expression matching to find a file name and line number inside + "Do regular-expression matching to find a file name and line number inside string TEXT. If we match, we will turn the result into a realgud-loc struct. Otherwise return nil. CMD-MARK is set in the realgud-loc object created. " @@ -526,8 +526,12 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc object created. ) (if loc-regexp (if (string-match loc-regexp text) - (let* ((bp-num (match-string bp-num-group text)) - (filename (match-string file-group text)) + (let* ((bp-num (and bp-num-group (match-string bp-num-group text))) + (filename + (if file-group + (match-string file-group text) + (realgud-sget 'cmdbuf-info 'source-path) + )) (line-str (match-string line-group text)) (source-str (and text-group (match-string text-group text))) (lineno (string-to-number (or line-str "1"))) diff --git a/realgud/lang/Makefile.am b/realgud/lang/Makefile.am index a6f5e4c..58c16cf 100644 --- a/realgud/lang/Makefile.am +++ b/realgud/lang/Makefile.am @@ -1,3 +1,4 @@ +include $(top_srcdir)/common.mk lispdir = @lispdir_realgud@/$(notdir $(subdir)) lisp_files := $(wildcard *.el) lisp_LISP = $(lisp_files)