[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/realgud-lldb 2b329f9 22/56: Hack to use "global" to res
From: |
Rocky Bernstein |
Subject: |
[elpa] externals/realgud-lldb 2b329f9 22/56: Hack to use "global" to resolve names. |
Date: |
Thu, 23 May 2019 02:11:39 -0400 (EDT) |
branch: externals/realgud-lldb
commit 2b329f9792d029610ab6cd64431162001267186a
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Hack to use "global" to resolve names.
---
lldb/core.el | 35 +++++++++++++++++++++++++++++++++++
lldb/init.el | 4 +++-
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/lldb/core.el b/lldb/core.el
index 5e9e3bb..20341b0 100644
--- a/lldb/core.el
+++ b/lldb/core.el
@@ -41,6 +41,41 @@
'realgud:lldb-minibuffer-history
opt-debugger))
+(defvar realgud:lldb-file-remap (make-hash-table :test 'equal)
+ "How to remap lldb files in when we otherwise can't find in
+ the filesystem. The hash key is the file string we saw, and the
+ value is associated filesystem string presumably in the
+ filesystem")
+
+(defun realgud:lldb-find-file(filename)
+ "A find-file specific for lldb. We use `global' to map a
+name to a filename. Failing that
+we will prompt for a mapping and save that in `realgud:lldb-file-remap' when
+that works."
+ (let ((resolved-filename filename)
+ (global-output)
+ (remapped-filename (gethash filename realgud:lldb-file-remap)))
+ (cond
+ ((and remapped-filename (stringp remapped-filename)
+ (file-exists-p remapped-filename)) remapped-filename)
+ ((file-exists-p filename) filename)
+ ((and (setq resolved-filename (shell-command-to-string (format "global -P
%s" filename)))
+ (stringp resolved-filename)
+ (file-exists-p (setq resolved-filename (realgud:strip
resolved-filename))))
+ (puthash filename resolved-filename realgud:lldb-file-remap))
+ ('t
+ (setq resolved-filename
+ (buffer-file-name
+ (compilation-find-file (point-marker) filename nil "")))
+ (puthash filename resolved-filename realgud:lldb-file-remap)))
+ ))
+
+(defun realgud:lldb-loc-fn-callback(text filename lineno source-str
+ ignore-file-re cmd-mark)
+ (realgud:file-loc-from-line filename lineno
+ cmd-mark source-str nil
+ ignore-file-re 'realgud:lldb-find-file))
+
(defun realgud:lldb-parse-cmd-args (orig-args)
"Parse command line ARGS for the annotate level and name of script to debug.
diff --git a/lldb/init.el b/lldb/init.el
index 42a9e6e..a8c4961 100644
--- a/lldb/init.el
+++ b/lldb/init.el
@@ -38,7 +38,9 @@ realgud-loc-pat struct")
;; Some versions of lldb insert "frame" and some don't.
(defconst realgud:lldb-frame-num-regexp
(format "[ ]*\\(?:frame \\)?#%s[:]? "
- realgud:regexp-captured-num realgud:regexp-captured-num))
+ realgud:regexp-captured-num))
+
+(setf (gethash "loc-callback-fn" realgud:lldb-pat-hash)
'realgud:lldb-loc-fn-callback)
;; realgud-loc-pat that describes a lldb location generally shown
;; before a command prompt.
- [elpa] externals/realgud-lldb 477fa68 13/56: Markdown INSTALL. Remove require 'cl, (continued)
- [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
- [elpa] externals/realgud-lldb 2b329f9 22/56: Hack to use "global" to resolve names.,
Rocky Bernstein <=
- [elpa] externals/realgud-lldb caed6ef 25/56: file remapping is buffer local, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 22536f6 35/56: Fix typo, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb f995954 23/56: wrong name, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 43e1399 38/56: correct realgud:lldb-file-remap initialization, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 006bda2 20/56: Update INSTALL.md, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 386588a 17/56: Fix up packaging, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 2e397f0 31/56: typo, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb f35ace0 33/56: Small changes, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb 8132538 06/56: Lots of fixups, Rocky Bernstein, 2019/05/23
- [elpa] externals/realgud-lldb b78e0ae 10/56: Doc corrections, Rocky Bernstein, 2019/05/23