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

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

[elpa] externals/realgud-lldb 805ef5b 11/56: More lldb loc hacking


From: Rocky Bernstein
Subject: [elpa] externals/realgud-lldb 805ef5b 11/56: More lldb loc hacking
Date: Thu, 23 May 2019 02:11:37 -0400 (EDT)

branch: externals/realgud-lldb
commit 805ef5bbeae0705da64aae33479c058d95b86834
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    More lldb loc hacking
---
 lldb/init.el             | 10 +++++++---
 test/test-regexp-lldb.el | 44 ++++++++++++++++++++++----------------------
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/lldb/init.el b/lldb/init.el
index 2c1f868..6748fa1 100644
--- a/lldb/init.el
+++ b/lldb/init.el
@@ -35,8 +35,10 @@ realgud-loc-pat struct")
 (defconst realgud:lldb-frame-start-regexp
   "\\(?:^\\|\n\\)")
 
+;; Some versions of lldb insert "frame" and some don't.
 (defconst realgud:lldb-frame-num-regexp
-  (format "[ ]*frame #%s: " realgud:regexp-captured-num))
+  (format "[ ]*\\(?:frame \\)?#%s[:]? "
+         realgud:regexp-captured-num realgud:regexp-captured-num))
 
 ;; realgud-loc-pat that describes a lldb location generally shown
 ;; before a command prompt.
@@ -52,12 +54,14 @@ realgud-loc-pat struct")
 ;; realgud-loc-pat that describes a lldb frame generally shown
 ;; before a command prompt or in frame switching commands
 ;;  frame #1: 0x00000000004015e2 ctest`main(argc=1, argv=0x00007fffffffd778) + 
90 at ctest.c:83
+;; Some versions of lldb give:
+;; #0  main (argc=2, argv=0xbffff564, envp=0xbffff570) at main.c:935
+;; instead
 
 (setf (gethash "selected-frame" realgud:lldb-pat-hash)
       (make-realgud-loc-pat
-       :regexp         (concat "^" realgud:lldb-frame-start-regexp
+       :regexp         (format "^%s.* at %s"
                        realgud:lldb-frame-num-regexp
-                       ".*[ ]+at "
                        realgud:lldb-frame-file-regexp
                        )
        :num 1
diff --git a/test/test-regexp-lldb.el b/test/test-regexp-lldb.el
index 7d112cd..0e3b19d 100644
--- a/test/test-regexp-lldb.el
+++ b/test/test-regexp-lldb.el
@@ -30,20 +30,20 @@
 ;; FIXME: we get a void variable somewhere in here when running
 ;;        even though we define it in lexical-let. Dunno why.
 ;;        setq however will workaround this.
-(setq test-text "/home/rocky/c/ctest.c:80:2000:beg:0x8048748>")
-(note "traceback location matching")
+;; (setq test-text "/home/rocky/c/ctest.c:80:2000:beg:0x8048748>")
+;; (note "traceback location matching")
 
-(assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location")
-(assert-equal "/home/rocky/c/ctest.c"
-             (match-string (realgud-cmdbuf-info-file-group test-dbgr)
-                           test-text) "extract file name")
-(assert-equal "80"
-             (match-string (realgud-cmdbuf-info-line-group test-dbgr)
-                           test-text) "extract line number")
+;; (assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location")
+;; (assert-equal "/home/rocky/c/ctest.c"
+;;           (match-string (realgud-cmdbuf-info-file-group test-dbgr)
+;;                         test-text) "extract file name")
+;; (assert-equal "80"
+;;           (match-string (realgud-cmdbuf-info-line-group test-dbgr)
+;;                         test-text) "extract line number")
 (note "debugger-backtrace")
 (setq realgud-bt-pat  (gethash "debugger-backtrace"
                            realgud:gdb-pat-hash))
-(setq s1
+(setq test-text
       "#0  main (argc=2, argv=0xbffff564, envp=0xbffff570) at main.c:935
 #1  0xb7e9f4a5 in *__GI___strdup (s=0xbffff760 \"/tmp/remake/remake\") at 
strdup.c:42
 #2  0x080593ac in main (argc=2, argv=0xbffff5a4, envp=0xbffff5b0)
@@ -54,49 +54,49 @@
 (setq realgud-bt-re (realgud-loc-pat-regexp realgud-bt-pat))
 (setq file-group (realgud-loc-pat-file-group realgud-bt-pat))
 (setq line-group (realgud-loc-pat-line-group realgud-bt-pat))
-(assert-equal 0 (string-match realgud-bt-re s1))
+(assert-equal 0 (string-match realgud-bt-re test-text))
 (assert-equal "main.c"
-             (substring s1
+             (substring test-text
                         (match-beginning file-group)
                         (match-end file-group)))
 (assert-equal "935"
-             (substring s1
+             (substring test-text
                         (match-beginning line-group)
                         (match-end line-group)))
 
 (setq pos (match-end 0))
 (assert-equal 65 pos)
-(assert-equal 65 (string-match realgud-bt-re s1 pos))
+(assert-equal 65 (string-match realgud-bt-re test-text pos))
 (assert-equal "strdup.c"
-             (substring s1
+             (substring test-text
                         (match-beginning file-group)
                         (match-end file-group)))
 (assert-equal "42"
-             (substring s1
+             (substring test-text
                         (match-beginning line-group)
                         (match-end line-group)))
 
 (setq pos (match-end 0))
 (assert-equal 149 pos)
-(assert-equal 149 (string-match realgud-bt-re s1 pos))
+(assert-equal 149 (string-match realgud-bt-re test-text pos))
 (assert-equal "main.c"
-             (substring s1
+             (substring test-text
                         (match-beginning file-group)
                         (match-end file-group)))
 (assert-equal "952"
-             (substring s1
+             (substring test-text
                         (match-beginning line-group)
                         (match-end line-group)))
 
 (setq pos (match-end 0))
 (assert-equal 233 pos)
-(assert-equal 233 (string-match realgud-bt-re s1 pos))
+(assert-equal 233 (string-match realgud-bt-re test-text pos))
 (assert-equal "vm_insnhelper.c"
-             (substring s1
+             (substring test-text
                         (match-beginning file-group)
                         (match-end file-group)))
 (assert-equal "410"
-             (substring s1
+             (substring test-text
                         (match-beginning line-group)
                         (match-end line-group)))
 



reply via email to

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