emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 9df42fe 12/56: Towards tracking breakpoints more often


From: Rocky Bernstein
Subject: [elpa] master 9df42fe 12/56: Towards tracking breakpoints more often
Date: Sat, 27 May 2017 05:02:29 -0400 (EDT)

branch: master
commit 9df42fe2a7166aa21e53471188a4dec464ef27b9
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Towards tracking breakpoints more often
    
    file.el: Create and set a source-file marker in the list of breakpoint
    track.el: Add source breakpoint annotations when we add the source-file
    maker in the list of breakpoints
---
 realgud/common/bp.el    |  2 +-
 realgud/common/file.el  | 34 +++++++++++++++++++++-------------
 realgud/common/track.el |  7 +++++--
 3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/realgud/common/bp.el b/realgud/common/bp.el
index a330945..8d426e3 100644
--- a/realgud/common/bp.el
+++ b/realgud/common/bp.el
@@ -166,7 +166,7 @@ highlighted with FACE."
   "Add a breakpoint icon at POS according to breakpoint-display-style.
 Use the fringe if available, and the margin otherwise.  Record
 breakpoint status ENABLE? and breakpoint number BP-NUM in
-overlay.  BUF is the buffer that POS refers to; it detaults to
+overlay.  BUF is the buffer that POS refers to; it defaults to
 the current buffer."
   (let* ((bp-text) (bp-face) (line-face) (margin-icon) (fringe-icon))
     (realgud-set-bp-icons)
diff --git a/realgud/common/file.el b/realgud/common/file.el
index 257ffc3..2bcefde 100644
--- a/realgud/common/file.el
+++ b/realgud/common/file.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2010-2011, 2013-2014 Free Software Foundation, Inc
+;; Copyright (C) 2010-2011, 2013-2014, 2016 Free Software Foundation, Inc
 
 ;; Author: Rocky Bernstein <address@hidden>
 
@@ -113,18 +113,26 @@ problem as best as we can determine."
                                    (realgud:file-column-from-string filename
                                                                    line-number
                                                                    
source-text))
-                                  ;; And you thought we'd never get around to
-                                  ;; doing something other than validation?
-                                  (loc (make-realgud-loc
-                                        :num           bp-num
-                                        :cmd-marker    cmd-marker
-                                        :filename      filename
-                                        :line-number   line-number
-                                        :column-number column-number
-                                        :source-text   source-text
-                                        :marker        (make-marker)
-                                        )))
-                             loc)
+                                  (source-buffer (find-file-noselect filename))
+                                  (loc)
+                                  (source-mark))
+
+                             ;; And you thought we'd never get around to
+                             ;; doing something other than validation?
+                             (with-current-buffer source-buffer
+                               (goto-char (point-min))
+                               ;; FIXME also allow column number and byte 
offset
+                               (forward-line (1- line-number))
+                               (setq source-mark (point-marker))
+                               (make-realgud-loc
+                                     :num           bp-num
+                                     :cmd-marker    cmd-marker
+                                     :filename      filename
+                                     :line-number   line-number
+                                     :column-number column-number
+                                     :source-text   source-text
+                                     :marker        source-mark)
+                                    ))
                          ;; else
                          (format "File %s has only %d lines. (Line %d 
requested.)"
                                  filename line-count line-number))
diff --git a/realgud/common/track.el b/realgud/common/track.el
index f4e34b5..17d0341 100644
--- a/realgud/common/track.el
+++ b/realgud/common/track.el
@@ -504,10 +504,13 @@ Otherwise return nil. CMD-MARK is set in the realgud-loc 
object created.
                                             ;; set to return nil
                                             nil)
                                         ;; else
-                                        (progn
+                                        (let ((loc loc-or-error))
                                           ;; Add breakpoint to list of 
breakpoints
+                                          (with-current-buffer (marker-buffer 
(realgud-loc-marker loc))
+                                            (realgud-bp-add-info loc))
+
                                           (realgud-cmdbuf-info-bp-list=
-                                           (cons loc-or-error (realgud-sget 
'cmdbuf-info 'bp-list)))
+                                           (cons loc (realgud-sget 
'cmdbuf-info 'bp-list)))
                                           ;; Set to return location
                                           loc-or-error))))
                                 nil))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]