diff options
| author | rocky <rb@dustyfeet.com> | 2016-08-26 07:05:52 -0400 |
|---|---|---|
| committer | rocky <rb@dustyfeet.com> | 2016-08-26 07:05:52 -0400 |
| commit | 93cfd7d2e55b5d98cdd093df4d368668d9ec8e72 (patch) | |
| tree | f4960a4244a5b1651a607833483e51c5ce5258bd | |
| parent | 0f007284d4517637ddf1f0b7de424ae58bb83069 (diff) | |
| parent | caed6efabb0c97d333ed844041b39f755dc8a7dd (diff) | |
Merge branch 'master' of github.com:realgud/realgud-lldb
| -rw-r--r-- | INSTALL.md | 2 | ||||
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | lldb/core.el | 35 | ||||
| -rw-r--r-- | lldb/init.el | 4 | ||||
| -rw-r--r-- | lldb/lldb.el | 11 | ||||
| -rw-r--r-- | realgud-lldb.el | 4 | ||||
| -rw-r--r-- | test/regexp-helper.el | 2 |
7 files changed, 49 insertions, 10 deletions
@@ -1,4 +1,4 @@ -* Have `realgud` installed. +* Have `realgud` and `test-simple` installed. * From inside emacs, evaluate: ```lisp (compile (format "EMACSLOADPATH=:%s:%s ./autogen.sh" (file-name-directory (locate-library "test-simple.elc")) (file-name-directory (locate-library "realgud.elc")))) diff --git a/configure.ac b/configure.ac index f70128f..deb1ed7 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,7 @@ AC_SUBST([lispdir_realgud]) AM_CONDITIONAL(INSTALL_EMACS_LISP, test "x$lispdir_realgud" != "x") AC_CONFIG_FILES([Makefile \ + common.mk \ lldb/Makefile \ test/Makefile \ ]) 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. diff --git a/lldb/lldb.el b/lldb/lldb.el index a2b71e5..de64b4f 100644 --- a/lldb/lldb.el +++ b/lldb/lldb.el @@ -37,11 +37,12 @@ This should be an executable on your path, or an absolute file name." :group 'realgud:lldb) (declare-function realgud:lldb-track-mode 'realgud:lldb-track-mode) -(declare-function realgud-command 'realgud:lldb-core) +(declare-function realgud-command 'realgud:lldb-core) (declare-function realgud:lldb-parse-cmd-args 'realgud:lldb-core) (declare-function realgud:lldb-query-cmdline 'realgud:lldb-core) -(declare-function realgud:run-process 'realgud-core) -(declare-function realgud:flatten 'realgud-utils) +(declare-function realgud:run-process 'realgud-core) +(declare-function realgud:flatten 'realgud-utils) +(declare-function realgud:remove-ansi-schmutz 'realgud-utils) ;; ------------------------------------------------------------------- ;; The end. @@ -62,7 +63,6 @@ buffers and source buffers which may contain marks and fringe or marginal icons is reset. See `loc-changes-clear-buffer' to clear fringe and marginal icons. " - (interactive) (let* ((cmd-str (or opt-cmd-line (realgud:lldb-query-cmdline "lldb"))) (cmd-args (split-string-and-unquote cmd-str)) @@ -78,7 +78,8 @@ fringe and marginal icons. ) (if cmd-buf (with-current-buffer cmd-buf - ; (realgud-command "set annotate 1" nil nil nil) + (set (make-local-variable 'realgud:lldb-file-remap)) + (realgud:remove-ansi-schmutz) ) ) ) diff --git a/realgud-lldb.el b/realgud-lldb.el index c98ea17..4d0398d 100644 --- a/realgud-lldb.el +++ b/realgud-lldb.el @@ -2,7 +2,7 @@ ;; Author: Rocky Bernstein ;; Version: 1.0 -;; Package-Requires: ((realgud "1.4.2") (cl-lib "0.5") (emacs "24")) +;; Package-Requires: ((realgud "1.4.2") (emacs "24")) ;; URL: http://github.com/rocky/realgud-lldb ;; Compatibility: GNU Emacs 24.x @@ -35,7 +35,7 @@ (require 'load-relative) -(defgroup realgud-byebug nil +(defgroup realgud-lldb nil "Realgud interface to lldb" :group 'realgud :version "24.3") diff --git a/test/regexp-helper.el b/test/regexp-helper.el index 6c67de3..2660077 100644 --- a/test/regexp-helper.el +++ b/test/regexp-helper.el @@ -1,5 +1,5 @@ (require 'test-simple) -(require 'realgud-buffer-command) +(require 'realgud) (eval-when-compile (defvar helper-bps) |
