Function: lldb

lldb is an autoloaded, interactive and byte-compiled function defined in gud.el.gz.

Signature

(lldb COMMAND-LINE)

Documentation

Run LLDB passing it COMMAND-LINE as arguments.

If COMMAND-LINE names a program FILE to debug, LLDB will run in a buffer named *gud-FILE*, and the directory containing FILE becomes the initial working directory and source-file directory for the debug session. If you don't want default-directory to change to the directory of FILE, specify FILE without leading directories, in which case FILE should reside either in the directory of the buffer from which this command is invoked, or it can be found by searching PATH.

If COMMAND-LINE requests that LLDB attaches to a process PID, LLDB will run in *gud-PID*, otherwise it will run in *gud*; in these cases the initial working directory is the default-directory of the buffer in which this command was invoked.

Please note that completion framework that complete while you type, like Corfu, do not work well with this mode. You should consider to turn them off in this mode.

This command runs functions from lldb-mode-hook.

View in manual

Probably introduced at or before Emacs version 30.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
;;;###autoload
(defun lldb (command-line)
  "Run LLDB passing it COMMAND-LINE as arguments.
If COMMAND-LINE names a program FILE to debug, LLDB will run in
a buffer named *gud-FILE*, and the directory containing FILE
becomes the initial working directory and source-file directory
for the debug session.  If you don't want `default-directory' to
change to the directory of FILE, specify FILE without leading
directories, in which case FILE should reside either in the
directory of the buffer from which this command is invoked, or
it can be found by searching PATH.

If COMMAND-LINE requests that LLDB attaches to a process PID, LLDB
will run in *gud-PID*, otherwise it will run in *gud*; in these
cases the initial working directory is the `default-directory' of
the buffer in which this command was invoked.

Please note that completion framework that complete while you
type, like Corfu, do not work well with this mode.  You should
consider to turn them off in this mode.

This command runs functions from `lldb-mode-hook'."
  (interactive (list (gud-query-cmdline 'lldb)))
  (gud-common-init command-line nil 'gud-lldb-marker-filter)
  (setq-local gud-minor-mode 'lldb)

  (gud-def gud-break
           "breakpoint set --joint-specifier %f:%l"
           "\C-b"
           "Set breakpoint at current line.")
  (gud-def gud-tbreak
           "_regexp-tbreak %f:%l"
           "\C-t"
	   "Set temporary breakpoint at current line.")
  (gud-def gud-remove
           "breakpoint clear  --line %l --file %f"
           "\C-d"
           "Remove breakpoint at current line")
  (gud-def gud-step "thread step-in --count %p"
           "\C-s"
           "Step one source line with display.")
  (gud-def gud-stepi
           "thread step-inst --count %p"
           "\C-i"
           "Step one instruction with display.")
  (gud-def gud-next
           "thread step-over --count %p"
           "\C-n"
           "Step one line (skip functions).")
  (gud-def gud-nexti
           "thread step-inst-over --count %p"
           nil
           "Step one instruction (skip functions).")
  (gud-def gud-cont
           "process continue --ignore-count %p"
           "\C-r"
           "Continue with display.")
  (gud-def gud-finish
           "thread step-out"
           "\C-f"
           "Finish executing current function.")
  (gud-def gud-jump
	   (progn
             (gud-call "_regexp-break %f:%l" arg)
             (gud-call "_regexp-jump %f:%l"))
	   "\C-j"
           "Set execution address to current line.")
  (gud-def gud-up
           "_regexp-up %p"
           "<"
           "Up N stack frames (numeric arg).")
  (gud-def gud-down
           "_regexp-down %p"
           ">"
           "Down N stack frames (numeric arg).")
  (gud-def gud-print
           "dwim-print %e"
           "\C-p"
           "Evaluate C expression at point.")
  (gud-def gud-pstar
           "dwim-print *%e"
           nil
	   "Evaluate C dereferenced pointer expression at point.")
  (gud-def gud-pv
           "xprint %e"
           "\C-v"
           "Print value of lisp variable (for debugging Emacs only).")
  (gud-def gud-until
           "thread until %l"
           "\C-u"
           "Continue to current line.")
  (gud-def gud-run
           ;; Extension for process launch --tty?
           "process launch -X true"
	   nil
           "Run the program.")

  (add-hook 'completion-at-point-functions
            #'gud-lldb-completion-at-point
            nil 'local)
  ;; Bind TAB not <tab> so that it also works on ttys.
  (keymap-local-set "TAB" #'completion-at-point)

  (gud-set-repeat-map-property 'gud-gdb-repeat-map)
  (setq comint-prompt-regexp (rx line-start "(lldb)" (0+ blank)))
  (setq comint-process-echoes t)
  (setq paragraph-start comint-prompt-regexp)
  (setq gud-running nil)
  (gud-lldb-initialize)
  (run-hooks 'lldb-mode-hook))