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

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

[elpa] externals/realgud 2c77776a47 2/2: Merge pull request #313 from ya


From: ELPA Syncer
Subject: [elpa] externals/realgud 2c77776a47 2/2: Merge pull request #313 from yangyingchao/master
Date: Mon, 19 Jun 2023 09:59:29 -0400 (EDT)

branch: externals/realgud
commit 2c77776a4797805d8633636fd68148dfb32fab65
Merge: aff03aeef1 7343f28cc2
Author: R. Bernstein <rocky@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #313 from yangyingchao/master
    
    (gdb) use variable to hold commands to be executed after command buff…
---
 realgud/debugger/gdb/gdb.el | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/realgud/debugger/gdb/gdb.el b/realgud/debugger/gdb/gdb.el
index f0e669b9ef..a37b534bd6 100644
--- a/realgud/debugger/gdb/gdb.el
+++ b/realgud/debugger/gdb/gdb.el
@@ -54,6 +54,19 @@ This should be an executable on your path, or an absolute 
file name."
   :type 'string
   :group 'realgud:gdb)
 
+(defvar realgud:gdb-init-commands
+  '("set annotate 1"
+    ;; In gdb, when setting breakpoint on function, we want it to produce an 
absolute
+    ;; path, so set filename-display to absolute. We want:
+    ;;   (gdb) b functionName
+    ;;   Breakpoint 1 at 0x7fff607e4dd6: file /abs/path/to/file.cpp, line 273.
+    ;; Without this, gdb will display the path supplied when the code was 
compiled, i.e.
+    ;; if a relative path is supplied to gcc, gdb will display the relative 
path
+    ;; tripping up realgud, causing it to ask if you want to blacklist the 
file.
+    "set filename-display absolute"
+    )
+  "List of commands to be executed right after command buffer setup.")
+
 (declare-function realgud:gdb-track-mode     'realgud:gdb-track-mode)
 (declare-function realgud-command            'realgud:cmds)
 (declare-function realgud:gdb-parse-cmd-args 'realgud:gdb-core)
@@ -136,18 +149,9 @@ fringe and marginal icons.
        (let ((process (get-buffer-process cmd-buf)))
          (if (and process (eq 'run (process-status process)))
              (with-current-buffer cmd-buf
-               (realgud-command "set annotate 1" nil nil nil)
-                ;; In gdb, when setting breakpoint on function, we want it to 
produce an absolute
-                ;; path, so set filename-display to absolute. We want:
-                ;;   (gdb) b functionName
-                ;;   Breakpoint 1 at 0x7fff607e4dd6: file 
/abs/path/to/file.cpp, line 273.
-                ;; Without this, gdb will display the path supplied when the 
code was compiled, i.e.
-                ;; if a relative path is supplied to gcc, gdb will display the 
relative path
-                ;; tripping up realgud, causing it to ask if you want to 
blacklist the file.
-                (realgud-command "set filename-display absolute" nil nil nil)
-               )))
-      )
-    ))
+                (dolist (it realgud:gdb-init-commands)
+                  (realgud-command it nil nil nil))))))
+    cmd-buf))
 
 (provide-me "realgud-")
 



reply via email to

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