[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/realgud a6783f5 129/140: Add breakpoint buffer tracking
From: |
Rocky Bernstein |
Subject: |
[elpa] externals/realgud a6783f5 129/140: Add breakpoint buffer tracking to source window |
Date: |
Sat, 25 May 2019 19:35:49 -0400 (EDT) |
branch: externals/realgud
commit a6783f5d7172c0c7d9a2fa93e3793b8f5f3f104b
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Add breakpoint buffer tracking to source window
---
realgud/common/buffer/breakpoint.el | 20 ++++++++++----------
realgud/common/buffer/command.el | 11 ++++++++---
realgud/common/follow.el | 1 +
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/realgud/common/buffer/breakpoint.el
b/realgud/common/buffer/breakpoint.el
index da49db2..23cb047 100644
--- a/realgud/common/buffer/breakpoint.el
+++ b/realgud/common/buffer/breakpoint.el
@@ -94,6 +94,7 @@
(with-current-buffer-safe cmdbuf
(let ((brkpt-pat (realgud-cmdbuf-pat "debugger-breakpoint"))
(brkpt-pos-ring)
+ (bp-list (realgud-cmdbuf-info-bp-list realgud-cmdbuf-info))
(sleep-count 0)
)
(unless brkpt-pat
@@ -126,7 +127,7 @@
(if divert-string
(let* ((duple
(realgud:breakpoint-add-text-properties
- brkpt-pat cmdbuf divert-string))
+ brkpt-pat cmdbuf divert-string bp-list))
(string-with-props
(ansi-color-filter-apply (car duple)))
(brkpt-num-pos-list (cadr duple))
@@ -246,14 +247,11 @@ non-digit will start entry number from the beginning
again."
(setq acc "")))))
(message "`realgud-goto-breakpoint-n' must be bound to a number key")))
-(defun realgud:breakpoint-add-text-properties(brkpt-pat cmdbuf &optional
opt-string)
- "Parse OPT-STRING or the current buffer and add frame properties: frame
number,
-filename, line number, whether the frame is selected as text properties."
+(defun realgud:breakpoint-add-text-properties(brkpt-pat cmdbuf string bp-list)
+ "Parse STRING or the current buffer and add frame properties: breakpoint
number,
+filename, and line number as text properties."
- (let* ((string (or opt-string
- (buffer-substring (point-min) (point-max))
- ))
- (stripped-string (ansi-color-filter-apply string))
+ (let* ((stripped-string (ansi-color-filter-apply string))
(brkpt-regexp (realgud-loc-pat-regexp brkpt-pat))
(brkpt-group-pat (realgud-loc-pat-num brkpt-pat))
(file-group-pat (realgud-loc-pat-file-group brkpt-pat))
@@ -265,6 +263,7 @@ filename, line number, whether the frame is selected as
text properties."
)
(while (string-match brkpt-regexp stripped-string last-pos)
(let ((brkpt-num-str) (brkpt-num) (line-num) (filename)
+ (loc)
;; From https://github.com/realgud/realgud/pull/192
;; Each brkpt of breakpoint is searched via string-match
;; invocation and a position of the current brkpt is
@@ -284,13 +283,14 @@ filename, line number, whether the frame is selected as
text properties."
(match-beginning brkpt-group-pat)
(match-end brkpt-group-pat)))
(setq brkpt-num (string-to-number brkpt-num-str))
+ (setq loc (seq-find (lambda (elt) (equal brkpt-num
(realgud-loc-num elt))) bp-list))
(setq brkpt-num-pos (match-beginning brkpt-group-pat))
(cl-pushnew brkpt-num-pos brkpt-num-pos-list)
(add-text-properties (match-beginning brkpt-group-pat)
(match-end brkpt-group-pat)
(list 'mouse-face 'highlight
'help-echo "mouse-2: goto this brkpt"
- 'brkpt brkpt-num)
+ 'mark (realgud-loc-marker loc))
string)
)
; else
@@ -330,7 +330,7 @@ filename, line number, whether the frame is selected as
text properties."
(when (and (stringp filename) (numberp line-num))
(let ((loc (realgud:file-loc-from-line filename line-num cmdbuf)))
(put-text-property whole-match-begin whole-match-end
- 'loc loc string)
+ 'mark loc string)
))
(put-text-property whole-match-begin whole-match-end
'brkpt-num brkpt-num string)
diff --git a/realgud/common/buffer/command.el b/realgud/common/buffer/command.el
index 66b381d..f8bf7ee 100644
--- a/realgud/common/buffer/command.el
+++ b/realgud/common/buffer/command.el
@@ -203,13 +203,18 @@
;; FIXME: this is a cheat. We are inserting
;; and afterwards inserting ""
(defun realgud:cmdbuf-bp-list-describe (info)
- (let ((bp-list (delete-dups (realgud-cmdbuf-info-bp-list info))))
+ (let ((bp-list (realgud-cmdbuf-info-bp-list info))
+ ;; For reasons I don't understand bp-list has duplicates
+ (bp-nums nil))
(cond (bp-list
(insert "** Breakpoint list (bp-list)\n")
(dolist (loc bp-list "")
(let ((bp-num (realgud-loc-num loc)))
- (insert (format "*** Breakpoint %d\n" bp-num))
- (realgud:org-mode-append-loc loc))))
+ (when (not (cl-member bp-num bp-nums))
+ (insert (format "*** Breakpoint %d\n" bp-num))
+ (realgud:org-mode-append-loc loc)
+ (setq bp-nums (cl-adjoin bp-num bp-nums))
+ ))))
;; Since we are inserting, the below in fact
;; inserts nothing. The string return is
;; aspirational for when this is fixed
diff --git a/realgud/common/follow.el b/realgud/common/follow.el
index 65aa879..fe7e305 100644
--- a/realgud/common/follow.el
+++ b/realgud/common/follow.el
@@ -33,6 +33,7 @@
(frame-num (get-text-property pos 'frame-num))
)
(cond ((markerp mark) (realgud:follow-mark mark) 't)
+ ((realgud-loc-p mark) (realgud:follow-mark (realgud-loc-marker mark))
't)
((stringp filename)
(find-file-other-window filename))
((numberp frame-num) (realgud:cmd-frame frame-num))
- [elpa] externals/realgud 9a9f6dc 132/140: Add 'B' key to get list of breakpoints, (continued)
- [elpa] externals/realgud 9a9f6dc 132/140: Add 'B' key to get list of breakpoints, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 36782d6 108/140: Merge pull request #226 from Apteryks/master, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 296a802 106/140: Hoist syntax-checking kbd command, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 4548392 100/140: Add alternate breakpoint match regexp..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud dd8909a 110/140: add key 'h' for cmd-until-here: continue until the current line, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud cf993af 114/140: change pdb to python -m pdb., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 565ac78 112/140: Adjust for v8 tracebacks inside a debugger console, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2ae8fbf 111/140: Merge pull request #230 from cranechu/master, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud fa2d601 120/140: cl-seq -> cl-lib, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 5631fa2 115/140: Fix wiki links in README, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud a6783f5 129/140: Add breakpoint buffer tracking to source window,
Rocky Bernstein <=
- [elpa] externals/realgud 3630fef 121/140: keep history in attaching command-buffers ..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2a46513 134/140: Some small tweaks, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 2987c80 136/140: Compile linting, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 06d73e1 130/140: remake and gdb breakpoint buffers + add to menu, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 096bd87 088/140: Merge pull request #212 from realgud/filter-lists, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 4d9c31b 119/140: Improve realgud:attach-cmd-buffer..., Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 79c982d 124/140: Add a comment, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 0821db0 137/140: Get ready for release 1.4.6, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud c5d52ff 131/140: Add breakpoint-all regexps for most debuggers, Rocky Bernstein, 2019/05/25
- [elpa] externals/realgud 7c0acdc 140/140: Another pass over function declarations, Rocky Bernstein, 2019/05/25