[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)))
- [elpa] branch externals/realgud-lldb created (now d784d9c), Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 6426b24 05/56: Note that this isn't finished., Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 938fc3c 02/56: Minor fixes, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 28d43e6 03/56: From the outside I think you just require "realgud", Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 90d5673 04/56: All external realgud-... refrences removed as well as load-relative when that's no longer needed, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb e0a2361 08/56: go over command args, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 8873745 07/56: Correct location tracking; use native lldb commands, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 232841a 12/56: Set top frame number, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 805ef5b 11/56: More lldb loc hacking,
Rocky Bernstein <=
- [elpa] externals/realgud-lldb 477fa68 13/56: Markdown INSTALL. Remove require 'cl, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb bc90a4f 30/56: Correct "make install", Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb d1ad104 32/56: remake doc comment correction, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 6025a38 14/56: Some small typos/omissions, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb c8f80dd 15/56: Add check-short filter, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 0f00728 18/56: Merge branch 'master' of github.com:realgud/realgud-lldb, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 25fa790 36/56: Add until command, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb ad6f3a3 21/56: Con't need cl-lib (yet)., Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb b26a09b 16/56: Fix up packaging, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 17cac00 09/56: bang on location regexps, Rocky Bernstein, 2019/05/23