Function: dbx

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

Signature

(dbx COMMAND-LINE)

Documentation

Run dbx on program FILE in buffer *gud-FILE*.

The directory containing FILE becomes the initial working directory and source-file directory for your debugger.

Probably introduced at or before Emacs version 19.20.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
;;;###autoload
(defun dbx (command-line)
  "Run dbx on program FILE in buffer *gud-FILE*.
The directory containing FILE becomes the initial working directory
and source-file directory for your debugger."
  (interactive (list (gud-query-cmdline 'dbx)))

  (cond
   (gud-mips-p
    (gud-common-init command-line nil 'gud-mipsdbx-marker-filter))
   (gud-irix-p
    (gud-common-init command-line 'gud-dbx-massage-args
		     'gud-irixdbx-marker-filter))
   (t
    (gud-common-init command-line 'gud-dbx-massage-args
		     'gud-dbx-marker-filter)))

  (setq-local gud-minor-mode 'dbx)

  (cond
   (gud-mips-p
    (gud-def gud-up	"up %p"	  "<" "Up (numeric arg) stack frames.")
    (gud-def gud-down	"down %p" ">" "Down (numeric arg) stack frames.")
    (gud-def gud-break  "stop at \"%f\":%l"
				  "\C-b" "Set breakpoint at current line.")
    (gud-def gud-finish "return"  "\C-f" "Finish executing current function."))
   (gud-irix-p
    (gud-def gud-break  "stop at \"%d%f\":%l"
				  "\C-b" "Set breakpoint at current line.")
    (gud-def gud-finish "return"  "\C-f" "Finish executing current function.")
    (gud-def gud-up	"up %p; printf \"\032\032%1d:\",(int)$curline;file\n"
	     "<" "Up (numeric arg) stack frames.")
    (gud-def gud-down "down %p; printf \"\032\032%1d:\",(int)$curline;file\n"
	     ">" "Down (numeric arg) stack frames.")
    ;; Make dbx give out the source location info that we need.
    (process-send-string (get-buffer-process gud-comint-buffer)
			 "printf \"\032\032%1d:\",(int)$curline;file\n"))
   (t
    (gud-def gud-up	"up %p"   "<" "Up (numeric arg) stack frames.")
    (gud-def gud-down	"down %p" ">" "Down (numeric arg) stack frames.")
    (gud-def gud-break "file \"%d%f\"\nstop at %l"
				  "\C-b" "Set breakpoint at current line.")
    (if gud-dbx-use-stopformat-p
	(process-send-string (get-buffer-process gud-comint-buffer)
			     "set $stopformat=1\n"))))

  (gud-def gud-remove "clear %l"  "\C-d" "Remove breakpoint at current line")
  (gud-def gud-step   "step %p"   "\C-s" "Step one line with display.")
  (gud-def gud-stepi  "stepi %p"  "\C-i" "Step one instruction with display.")
  (gud-def gud-next   "next %p"   "\C-n" "Step one line (skip functions).")
  (gud-def gud-nexti  "nexti %p"   nil  "Step one instruction (skip functions).")
  (gud-def gud-cont   "cont"      "\C-r" "Continue with display.")
  (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
  (gud-def gud-run    "run"	     nil    "Run the program.")

  (gud-set-repeat-map-property 'gud-dbx-repeat-map)

  (setq comint-prompt-regexp  "^[^)\n]*dbx) *")
  (setq paragraph-start comint-prompt-regexp)
  (run-hooks 'dbx-mode-hook)
  )