[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 56bf176 6/6: Merge commit 'db34a79efd068f28643cefd6f16a732
From: |
Rocky Bernstein |
Subject: |
[elpa] master 56bf176 6/6: Merge commit 'db34a79efd068f28643cefd6f16a7329ba24dbf1' |
Date: |
Thu, 4 Aug 2016 13:50:19 +0000 (UTC) |
branch: master
commit 56bf176e92ab57449ef3b0dd776edeff6fd37ca6
Merge: c2b86af db34a79
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Merge commit 'db34a79efd068f28643cefd6f16a7329ba24dbf1'
---
packages/realgud/realgud/common/buffer/command.el | 10 +++++++--
packages/realgud/realgud/common/core.el | 22 ++++++++++++--------
packages/realgud/realgud/common/file.el | 4 ++--
packages/realgud/realgud/common/run.el | 5 +++++
packages/realgud/realgud/common/send.el | 13 ++++++------
packages/realgud/realgud/common/track.el | 19 +++++++++++++----
packages/realgud/realgud/debugger/bashdb/init.el | 3 +++
packages/realgud/realgud/debugger/jdb/init.el | 21 ++++++++++---------
packages/realgud/realgud/debugger/kshdb/init.el | 3 +++
packages/realgud/realgud/debugger/remake/init.el | 15 +++++++------
.../realgud/realgud/debugger/trepan.pl/init.el | 2 +-
11 files changed, 77 insertions(+), 40 deletions(-)
diff --git a/packages/realgud/realgud/common/buffer/command.el
b/packages/realgud/realgud/common/buffer/command.el
index fb80190..760db53 100644
--- a/packages/realgud/realgud/common/buffer/command.el
+++ b/packages/realgud/realgud/common/buffer/command.el
@@ -102,7 +102,9 @@
loc-hist ;; ring of locations seen in the course of execution
;; see realgud-lochist
-)
+ starting-directory ;; directory where initial debug command was issued.
+ ;; this can be used to resolve relative file names
+ )
(make-variable-buffer-local 'realgud-cmdbuf-info)
(make-variable-buffer-local 'realgud-last-output-start)
@@ -122,6 +124,7 @@
(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")
+(realgud-struct-field-setter "realgud-cmdbuf-info" "starting-directory")
(defun realgud:cmdbuf-follow-buffer(event)
(interactive "e")
@@ -167,6 +170,8 @@ Information is put in an internal buffer called *Describe*."
(json-encode (realgud-cmdbuf-info-debugger-name info)))
(format " - Command-line args ::\t%s\n"
(json-encode (realgud-cmdbuf-info-cmd-args info)))
+ (format " - Starting directory ::\t%s\n"
+ (realgud-cmdbuf-info-starting-directory info))
(format " - Selected window should contain source? :: %s\n"
(realgud-cmdbuf-info-in-srcbuf? info))
(format " - Last input end ::\t%s\n"
@@ -286,7 +291,8 @@ Information is put in an internal buffer called *Describe*."
;; removed.
(defun realgud-cmdbuf-init
- (cmd-buf debugger-name regexp-hash &optional cmd-hash base-variable-name)
+ (cmd-buf debugger-name regexp-hash &optional cmd-hash base-variable-name
+ starting-directory)
"Initialize CMD-BUF for a working with a debugger.
DEBUGGER-NAME is the name of the debugger; REGEXP-HASH are debugger-specific
values set in the debugger's init.el."
diff --git a/packages/realgud/realgud/common/core.el
b/packages/realgud/realgud/common/core.el
index ad5dd6a..d7dade7 100644
--- a/packages/realgud/realgud/common/core.el
+++ b/packages/realgud/realgud/common/core.el
@@ -13,7 +13,6 @@
;; GNU General Public License for more details.
;; (require 'term)
-(require 'files)
(if (< emacs-major-version 24)
(error
@@ -36,6 +35,7 @@
(declare-function realgud-cmdbuf-debugger-name 'realgud-buffer-command)
(declare-function realgud-cmdbuf-info-bp-list= 'realgud-buffer-command)
(declare-function realgud-cmdbuf-info-in-debugger?= 'realgud-buffer-command)
+(declare-function realgud-cmdbuf-info-starting-directory=
'realgud-buffer-command)
(declare-function realgud-cmdbuf-mode-line-update 'realgud-buffer-command)
(declare-function realgud-cmdbuf? 'realgud-helper)
(declare-function realgud-command-string 'realgud-buffer-command)
@@ -50,6 +50,7 @@
(declare-function realgud-suggest-lang-file 'realgud-lang)
(defvar realgud-srcbuf-info)
+(defvar starting-directory)
(defun realgud:expand-file-name-if-exists (filename)
"Return FILENAME expanded using `expand-file-name' if that name exists.
@@ -227,20 +228,20 @@ NO-RESET is nil, then that information which may point
into other
buffers and source buffers which may contain marks and fringe or
marginal icons is reset."
- (let* ((starting-directory
+ (let* ((current-directory
(or (file-name-directory script-filename)
default-directory "./"))
(cmdproc-buffer-name
- (replace-regexp-in-string "\s+" "\s"
- (format "*%s %s shell*"
- (file-name-nondirectory debugger-name)
- (file-name-nondirectory script-filename))))
+ (replace-regexp-in-string
+ "\s+" "\s"
+ (format "*%s %s shell*"
+ (file-name-nondirectory debugger-name)
+ (file-name-nondirectory script-filename))))
(cmdproc-buffer (get-buffer-create cmdproc-buffer-name))
(realgud-buf (current-buffer))
(cmd-args (cons program args))
(process (get-buffer-process cmdproc-buffer)))
-
(with-current-buffer cmdproc-buffer
;; If the found command buffer isn't for the same debugger
;; invocation command, rename that and start a new one.
@@ -262,10 +263,13 @@ marginal icons is reset."
cmdproc-buffer
(with-current-buffer cmdproc-buffer
(and (realgud-cmdbuf?) (not no-reset) (realgud:reset))
- (setq default-directory default-directory)
- (insert "Current directory: " default-directory "\n")
+ (make-local-variable 'starting-directory)
+ (setq starting-directory current-directory)
+
+ (insert "Current directory: " current-directory "\n")
(insert "Command: " (mapconcat 'identity cmd-args " ") "\n")
+
;; For term.el
;; (term-mode)
;; (set (make-local-variable 'term-term-name) realgud-term-name)
diff --git a/packages/realgud/realgud/common/file.el
b/packages/realgud/realgud/common/file.el
index 15a3e67..257ffc3 100644
--- a/packages/realgud/realgud/common/file.el
+++ b/packages/realgud/realgud/common/file.el
@@ -60,7 +60,7 @@ at LINE-NUMBER or nil if it is not there"
&optional cmd-marker source-text
bp-num
;; FIXME: remove ignore-file-re and
cover with
;; find-file-fn.
- ignore-file-re find-file-fn)
+ ignore-file-re find-file-fn
directory)
"Return a realgud-loc for FILENAME and LINE-NUMBER and the
other optional position information.
@@ -93,7 +93,7 @@ problem as best as we can determine."
(progn
(setq remapped-filename
(buffer-file-name
- (compilation-find-file (point-marker) filename nil)))
+ (compilation-find-file (point-marker) filename directory)))
(when (and remapped-filename (file-exists-p remapped-filename))
(puthash filename remapped-filename realgud-file-remap)
(setq filename remapped-filename)
diff --git a/packages/realgud/realgud/common/run.el
b/packages/realgud/realgud/common/run.el
index f8cf09d..a24e123 100644
--- a/packages/realgud/realgud/common/run.el
+++ b/packages/realgud/realgud/common/run.el
@@ -26,10 +26,13 @@
(declare-function realgud-cmdbuf-info-in-debugger?= 'realgud-buffer-command)
(declare-function realgud-cmdbuf-info-cmd-args= 'realgud-buffer-command)
(declare-function realgud:track-set-debugger 'realgud-track)
+(declare-function realgud-cmdbuf-info-starting-directory=
'realgud-buffer-command)
(declare-function realgud-parse-command-arg 'realgud-core)
(declare-function realgud:expand-file-name-if-exists 'realgud-core)
(declare-function realgud:flatten 'realgud-utils)
+(defvar starting-directory)
+
(defun realgud:parse-cmd-args(args two-args opt-two-args interp-regexp
debugger-regexp
path-args-list annotate-args)
"Parse command line ARGS for the annotate level and name of script to debug.
@@ -146,6 +149,8 @@ marginal icons is reset."
(let* ((info realgud-cmdbuf-info)
(cmd-args (realgud-cmdbuf-info-cmd-args info))
(cmd-str (mapconcat 'identity cmd-args " ")))
+ (if (boundp 'starting-directory)
+ (realgud-cmdbuf-info-starting-directory=
starting-directory))
(set minibuffer-history
(remove-duplicates
(cons cmd-str (eval minibuffer-history)) :from-end)
diff --git a/packages/realgud/realgud/common/send.el
b/packages/realgud/realgud/common/send.el
index c068c4f..b8b1f7e 100644
--- a/packages/realgud/realgud/common/send.el
+++ b/packages/realgud/realgud/common/send.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015 Free Software Foundation, Inc
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
@@ -31,11 +31,12 @@
"Sends command buffer line either to comint or eshell"
(interactive)
(let ((mode (realgud:canonic-major-mode)))
- (cond ((eq mode 'eshell)
- (eshell-send-input))
- ((eq mode 'comint)
- (comint-send-input))
- )))
+ (ignore-errors
+ (cond ((eq mode 'eshell)
+ (eshell-send-input))
+ ((eq mode 'comint)
+ (comint-send-input))
+ ))))
(defun realgud:send-command-common (process command-str)
"Assume we are in a comint buffer. Insert COMMAND-STR and
diff --git a/packages/realgud/realgud/common/track.el
b/packages/realgud/realgud/common/track.el
index f047c13..36f8e98 100644
--- a/packages/realgud/realgud/common/track.el
+++ b/packages/realgud/realgud/common/track.el
@@ -81,6 +81,7 @@
(fn-p-to-fn?-alias 'realgud-loc-p)
(defvar realgud-track-divert-string)
+(defvar starting-directory)
(defun realgud-track-comint-output-filter-hook(text)
"An output-filter hook custom for comint shells. Find
@@ -411,7 +412,11 @@ Otherwise return nil."
(match-string alt-line-group text)))
(source-str (and text-group
(match-string text-group text)))
- (lineno (string-to-number (or line-str "1"))))
+ (lineno (string-to-number (or line-str "1")))
+ (directory
+ (cond ((boundp 'starting-directory) starting-directory)
+ (t nil)))
+ )
(when source-str
(setq source-str (ansi-color-filter-apply
source-str)))
@@ -426,7 +431,10 @@ Otherwise return nil."
(realgud:file-loc-from-line filename lineno
cmd-mark
source-str nil
- ignore-file-re)
+ ignore-file-re
+ nil
+ directory
+ )
;; else
nil)))))
;; else
@@ -472,13 +480,16 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc
object created.
(unless line-str
(message "line number not found -- using 1"))
(if (and filename lineno)
- (let ((loc-or-error
+ (let* ((directory
+ (cond ((boundp 'starting-directory)
staring-directory)
+ (t nil)))
+ (loc-or-error
(realgud:file-loc-from-line
filename lineno
cmd-mark
source-str
(string-to-number bp-num)
- ignore-file-re
+ ignore-file-re nil directory
)))
(if (stringp loc-or-error)
(progn
diff --git a/packages/realgud/realgud/debugger/bashdb/init.el
b/packages/realgud/realgud/debugger/bashdb/init.el
index 49a58dd..2e3f8a3 100644
--- a/packages/realgud/realgud/debugger/bashdb/init.el
+++ b/packages/realgud/realgud/debugger/bashdb/init.el
@@ -40,6 +40,9 @@ realgud-loc-pat struct")
;; (/etc/init.d/apparmor:35):
(setf (gethash "loc" realgud:bashdb-pat-hash) realgud:POSIX-debugger-loc-pat)
+;; Top frame number
+(setf (gethash "top-frame-num" realgud:bashdb-pat-hash) 0)
+
;; Regular expression that describes a bashdb command prompt
;; For example:
;; bashdb<10>
diff --git a/packages/realgud/realgud/debugger/jdb/init.el
b/packages/realgud/realgud/debugger/jdb/init.el
index 185edab..13548e0 100644
--- a/packages/realgud/realgud/debugger/jdb/init.el
+++ b/packages/realgud/realgud/debugger/jdb/init.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2014-2015 Free Software Foundation, Inc
+;; Copyright (C) 2014-2016 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
@@ -31,7 +31,7 @@ realgud-loc-pat struct")
(setf (gethash "loc-callback-fn" realgud:jdb-pat-hash)
'realgud:jdb-loc-fn-callback)
-;; Regular expression that describes a jdb location generally shown
+;; realgud-loc-pat that describes a jdb location generally shown
;; before a command prompt. For example:
;; Breakpoint hit: "thread=main", TestMe.main(), line=7 bci=0
;; Step completed: "thread=main", TestMe.<init>(), line=15 bci=0
@@ -43,7 +43,7 @@ realgud-loc-pat struct")
:line-group 3
:text-group 6))
-;; Regular expression that describes a jdb command prompt
+;; realgud-loc-pat that describes a jdb command prompt
;; For example:
;; main[1]
;; main[2]
@@ -56,11 +56,11 @@ realgud-loc-pat struct")
:num 1
))
-;; Regular expression that describes a Java syntax error line.
+;; realgud-loc-pat that describes a Java syntax error line.
;; (setf (gethash "syntax-error" realgud:jdb-pat-hash)
;; realgud-java-syntax-error-pat)
-;; Regular expression that describes a Java backtrace line.
+;; realgud-loc-pat that describes a Java backtrace line.
;; For example:
;; [1] ca.snpEffect.commandLine.SnpEff.run (SnpEff.java:7)
(setf (gethash "lang-backtrace" realgud:jdb-pat-hash)
@@ -70,7 +70,7 @@ realgud-loc-pat struct")
:file-group 1
:line-group 2))
-;; Regular expression that describes a "breakpoint set" line.
+;; realgud-loc-pat that describes a "breakpoint set" line.
;; For example:
;; Set breakpoint TestMe:7
(setf (gethash "brkpt-set" realgud:jdb-pat-hash)
@@ -79,7 +79,7 @@ realgud-loc-pat struct")
:num 1
:line-group 2))
-;; Regular expression that describes a debugger "delete" (breakpoint) response.
+;; realgud-loc-pat that describes a debugger "delete" (breakpoint) response.
;; For example:
;; Removed: breakpoint TestMe:7
(setf (gethash "brkpt-del" realgud:jdb-pat-hash)
@@ -99,10 +99,11 @@ backtrace listing.")
;; Top frame number
(setf (gethash "top-frame-num" realgud:jdb-pat-hash) 0)
-;; Regular expression that describes a debugger "selected" frame in in
+;; realgud-loc-pat that describes a debugger "selected" frame in
;; a frame-motion command.
;; For example:
-;; --> #1 TOP Object#<top /usr/local/bin/irb> in file /usr/local/bin/irb at
line 9
+;; --> #1 [1] TestMe.main (TestMe.java:7)
+;; Rocky: sometimes I am not getting the frame indicator.
(setf (gethash "selected-frame" realgud:jdb-pat-hash)
(make-realgud-loc-pat
:regexp
@@ -111,7 +112,7 @@ backtrace listing.")
realgud:jdb-frame-file-regexp)
:num 1))
-;; Regular expression that describes a jdb backtrace line.
+;; realgud-loc-pat that describes a jdb backtrace line.
;; For example:
;; [1] TestMe.main (TestMe.java:7)
;; [2] java.lang.Class.privateGetDeclaredMethods (Class.java:2,570)
diff --git a/packages/realgud/realgud/debugger/kshdb/init.el
b/packages/realgud/realgud/debugger/kshdb/init.el
index 3f392f1..44fcdb8 100644
--- a/packages/realgud/realgud/debugger/kshdb/init.el
+++ b/packages/realgud/realgud/debugger/kshdb/init.el
@@ -26,6 +26,9 @@
backtrace, prompt, etc. The values of a hash entry is a
realgud-loc-pat struct")
+;; Top frame number
+(setf (gethash "top-frame-num" realgud:kshdb-pat-hash) 0)
+
;; Regular expression that describes a kshdb location generally shown
;; before a command prompt.
;; For example:
diff --git a/packages/realgud/realgud/debugger/remake/init.el
b/packages/realgud/realgud/debugger/remake/init.el
index fbaa643..6e398a2 100644
--- a/packages/realgud/realgud/debugger/remake/init.el
+++ b/packages/realgud/realgud/debugger/remake/init.el
@@ -31,7 +31,10 @@
backtrace, prompt, etc. The values of a hash entry is a
realgud-loc-pat struct")
-;; Regular expression that describes a remake location generally shown
+;; Top frame number
+(setf (gethash "top-frame-num" realgud:remake-pat-hash) 0)
+
+;; realgud-loc-pat that describes a remake location generally shown
;; before a command prompt.
;; For example:
;; -- (emacs-dbgr/realgud/debugger/Makefile:168)
@@ -51,7 +54,7 @@ realgud-loc-pat struct")
:num 1
))
-;; Regular expression that describes a "breakpoint set" line
+;; realgud-loc-pat that describes a "breakpoint set" line
(setf (gethash "brkpt-set" realgud:remake-pat-hash)
(make-realgud-loc-pat
:regexp "^Breakpoint \\([0-9]+\\) on target \\([^:]*\\): file \\(.+\\),
line \\([0-9]+\\).\n"
@@ -59,7 +62,7 @@ realgud-loc-pat struct")
:file-group 3
:line-group 4))
-;; Regular expression that describes a debugger "delete" (breakpoint) response.
+;; realgud-loc-pat that describes a debugger "delete" (breakpoint) response.
;; For example:
;; Removed 1 breakpoint(s).
(setf (gethash "brkpt-del" realgud:remake-pat-hash)
@@ -77,7 +80,7 @@ backtrace listing.")
(defconst realgud:remake-frame-file-regexp " at \\(.*\\):\\([0-9]+\\)")
-;; Regular expression that describes a remake "backtrace" command line.
+;; realgud-loc-pat that describes a remake "backtrace" command line.
;; For example:
;; #0 Makefile.in at /tmp/Makefile:216
;; #1 Makefile at /tmp/Makefile:230
@@ -93,7 +96,7 @@ backtrace listing.")
:line-group 4)
)
-;; Regular expression that describes a debugger "backtrace" command line.
+;; realgud-loc-pat that describes a debugger "backtrace" command line.
;; For example:
;; =>#0 Makefile.in at /tmp/Makefile:216
;; #1 Makefile at /tmp/Makefile:230
@@ -110,7 +113,7 @@ backtrace listing.")
:line-group 5)
)
-;; Regular expression that describes which frame is selected in
+;; realgud-loc-pat that describes which frame is selected in
;; a debugger backtrace listing.
(setf (gethash "selected-frame-indicator" realgud:remake-pat-hash)
realgud:remake-selected-frame-arrow)
diff --git a/packages/realgud/realgud/debugger/trepan.pl/init.el
b/packages/realgud/realgud/debugger/trepan.pl/init.el
index c66041c..d201d10 100644
--- a/packages/realgud/realgud/debugger/trepan.pl/init.el
+++ b/packages/realgud/realgud/debugger/trepan.pl/init.el
@@ -173,7 +173,7 @@ backtrace listing.")
;; Top frame number
(setf (gethash "top-frame-num" realgud:trepanpl-pat-hash) 0)
-;; Regular expression that describes a debugger "selected" frame in in
+;; realgud-loc-pat that describes a debugger "selected" frame in in
;; a frame-motion command.
;; For example:
;; --> #1 TOP Object#<top /usr/local/bin/irb> in file /usr/local/bin/ipl at
line 9
- [elpa] master updated (c2b86af -> 56bf176), Rocky Bernstein, 2016/08/04
- [elpa] master 3551ab2 1/6: Ignore process send errors, Rocky Bernstein, 2016/08/04
- [elpa] master 3bef00c 2/6: Merge branch 'master' of github.com:realgud/realgud, Rocky Bernstein, 2016/08/04
- [elpa] master 0387891 3/6: Merge branch 'master' of github.com:realgud/realgud, Rocky Bernstein, 2016/08/04
- [elpa] master 6a41dc7 4/6: Add starting directory in info and..., Rocky Bernstein, 2016/08/04
- [elpa] master db34a79 5/6: (require 'files) is unnecessary - preloaded, Rocky Bernstein, 2016/08/04
- [elpa] master 56bf176 6/6: Merge commit 'db34a79efd068f28643cefd6f16a7329ba24dbf1',
Rocky Bernstein <=