diff options
| author | rocky <rb@dustyfeet.com> | 2019-05-02 19:50:53 -0400 |
|---|---|---|
| committer | rocky <rb@dustyfeet.com> | 2019-05-02 19:50:53 -0400 |
| commit | bee815c69fb31656fb400e352ac0fe043c35c284 (patch) | |
| tree | cf6e6813f5e753d8897ec3e597a2ae1416da990f | |
| parent | 09f927fec12656e32a302a88a3cc2483039c3f7c (diff) | |
Add "frame" command. File name futzing.
| -rw-r--r-- | lldb/core.el | 26 | ||||
| -rw-r--r-- | lldb/init.el | 43 |
2 files changed, 40 insertions, 29 deletions
diff --git a/lldb/core.el b/lldb/core.el index 5dba2b7..8abc61f 100644 --- a/lldb/core.el +++ b/lldb/core.el @@ -48,21 +48,14 @@ filesystem") (defun realgud:lldb-find-file(cmd-marker filename directory) - "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." + "A find-file specific for lldb. 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 @@ -70,6 +63,21 @@ that works." (puthash filename resolved-filename realgud:lldb-file-remap))) )) +(defun realgud:cmd-lldb-break() + "Set a breakpoint storing mapping between a file and its basename" + (let* ((resolved-filename (realgud-expand-format "%X")) + (cmdbuf (realgud-get-cmdbuf)) + (filename (file-name-nondirectory resolved-filename))) + + ;; Save mapping from basename to long name so that we know what's + ;; up in a "Breakpoint set at" message + (puthash filename resolved-filename realgud:lldb-file-remap) + + ;; Run actual command + (realgud:cmd-break) + )) + + ;; FIXME: setting a breakpoint should add a[ file-to-basename mapping ;; so that when this is called it can look up the short name and ;; remap it. diff --git a/lldb/init.el b/lldb/init.el index 236632a..86a5b06 100644 --- a/lldb/init.el +++ b/lldb/init.el @@ -152,26 +152,29 @@ realgud-loc-pat struct") "Hash key is command name like 'continue' and the value is the lldb command to use, like 'process continue'") -(setf (gethash "backtrace" realgud:lldb-command-hash) "bt") -(setf (gethash "break" realgud:lldb-command-hash) "b %X:%l") -(setf (gethash "delete" realgud:lldb-command-hash) "break delete %p") -(setf (gethash "clear" realgud:lldb-command-hash) "break clear %X:%l") -(setf (gethash "continue" realgud:lldb-command-hash) "process continue") -(setf (gethash "delete" realgud:lldb-command-hash) "*not-implemented*") ;; Or rather don't know what the equvalent is -(setf (gethash "delete_all" realgud:lldb-command-hash) "*not-implemented*") -(setf (gethash "disable" realgud:lldb-command-hash) "break disable %p") -(setf (gethash "disable_all" realgud:lldb-command-hash) "break disable") -(setf (gethash "down" realgud:lldb-command-hash) "down %p") -(setf (gethash "enable" realgud:lldb-command-hash) "break enable %p") -(setf (gethash "enable_all" realgud:lldb-command-hash) "break enable") -(setf (gethash "eval" realgud:lldb-command-hash) "print %s") -(setf (gethash "finish" realgud:lldb-command-hash) "thread step-out") -(setf (gethash "quit" realgud:lldb-command-hash) "quit") -(setf (gethash "restart" realgud:lldb-command-hash) "run") -(setf (gethash "step" realgud:lldb-command-hash) "thread step-in --count %p") -(setf (gethash "shell" realgud:lldb-command-hash) "platform shell %s") -(setf (gethash "until" realgud:lldb-command-hash) "thread until %l") -(setf (gethash "up" realgud:lldb-command-hash) "up %p") +(setf (gethash "backtrace" realgud:lldb-command-hash) "bt") +(setf (gethash "break" realgud:lldb-command-hash) "b %X:%l") +(setf (gethash "lldb-break" realgud:lldb-command-hash) "b %X:%l") +(setf (gethash "delete" realgud:lldb-command-hash) "break delete %p") +(setf (gethash "clear" realgud:lldb-command-hash) "break clear %X:%l") +(setf (gethash "continue" realgud:lldb-command-hash) "process continue") +(setf (gethash "delete" realgud:lldb-command-hash) "*not-implemented*") ;; Or rather don't know what the equvalent is +(setf (gethash "delete_all" realgud:lldb-command-hash) "*not-implemented*") +(setf (gethash "disable" realgud:lldb-command-hash) "break disable %p") +(setf (gethash "disable_all" realgud:lldb-command-hash) "break disable") +(setf (gethash "down" realgud:lldb-command-hash) "down %p") +(setf (gethash "enable" realgud:lldb-command-hash) "break enable %p") +(setf (gethash "enable_all" realgud:lldb-command-hash) "break enable") +(setf (gethash "eval" realgud:lldb-command-hash) "print %s") +(setf (gethash "finish" realgud:lldb-command-hash) "thread step-out") +(setf (gethash "frame" realgud:lldb-command-hash) "frame select %p") +(setf (gethash "info-breakponts" realgud:lldb-command-hash) "break list") +(setf (gethash "quit" realgud:lldb-command-hash) "quit") +(setf (gethash "restart" realgud:lldb-command-hash) "run") +(setf (gethash "step" realgud:lldb-command-hash) "thread step-in --count %p") +(setf (gethash "shell" realgud:lldb-command-hash) "platform shell %s") +(setf (gethash "until" realgud:lldb-command-hash) "thread until %l") +(setf (gethash "up" realgud:lldb-command-hash) "up %p") (setf (gethash "lldb" realgud-command-hash) realgud:lldb-command-hash) (setf (gethash "lldb" realgud-pat-hash) realgud:lldb-pat-hash) |
