0

Emacs doesn't show breakpoints in text mode. I tried integrating the suggestions here and here, but failed (I am not a lisp programmer).

I tried:

(require 'gdb-mi)
(setq default-text-properties '(foo 1111))

(defun set_breakpt_cmds ()
  "set breakpoint and indicate on editor"
  (interactive)
  (gud-break)
  (gdb-put-breakpoint-icon "false" (get-text-property 1 'foo)))

(global-set-key (kbd "<f12>") 'set_breakpt_cmds)

The resulting error is

Wrong number of arguments: (lambda (arg) "Set breakpoint at current line." (interactive "p") (if (not gud-running) (gud-call "dbstop \ at %l in %f" arg))), 0

Note: A similar issue is this (following this). However the solution there doesn't fit me because I would like to be able to call the fix from .emacs file. This way it is easier to duplicate my emacs configuration when I setup a new linux box.

Thanks

Community
  • 1
  • 1
Yuval Atzmon
  • 5,645
  • 3
  • 41
  • 74
  • `text mode` for me, is the major mode used when you edit files thatr contain just random text (e.g. with extension `.txt`), I think what you mean is `inside a text terminal`. – Stefan Oct 17 '16 at 12:39

1 Answers1

1

The error you get comes from the fact that gud-break expects an argument (which isn't used), so just use (gud-break 1).

The message reads as follow:

  • the error is of kind wrong number of arguments
  • when calling (lambda (arg) ...) (where we see that exactly one argument is expected)
  • and it was called with 0 arguments.
Stefan
  • 27,908
  • 4
  • 53
  • 82