Function: def-gdb-auto-update-trigger

def-gdb-auto-update-trigger is a macro defined in gdb-mi.el.gz.

Signature

(def-gdb-auto-update-trigger TRIGGER-NAME GDB-COMMAND HANDLER-NAME &optional SIGNAL-LIST)

Documentation

Define a trigger TRIGGER-NAME which sends GDB-COMMAND and sets HANDLER-NAME as its handler. HANDLER-NAME is bound to current buffer with gdb-bind-function-to-buffer.

If SIGNAL-LIST is non-nil, GDB-COMMAND is sent only when the defined trigger is called with an argument from SIGNAL-LIST. It's not recommended to define triggers with empty SIGNAL-LIST. Normally triggers should respond at least to the update signal.

Normally the trigger defined by this command must be called from the buffer where HANDLER-NAME must work. This should be done so that buffer-local thread number may be used in GDB-COMMAND (by calling gdb-current-context-command). gdb-bind-function-to-buffer is used to achieve this, see gdb-get-buffer-create.

Triggers defined by this command are meant to be used as a trigger argument when describing buffer types with gdb-set-buffer-rules.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defmacro def-gdb-auto-update-trigger (trigger-name gdb-command
                                                    handler-name
                                                    &optional signal-list)
  "Define a trigger TRIGGER-NAME which sends GDB-COMMAND and sets
HANDLER-NAME as its handler.  HANDLER-NAME is bound to current
buffer with `gdb-bind-function-to-buffer'.

If SIGNAL-LIST is non-nil, GDB-COMMAND is sent only when the
defined trigger is called with an argument from SIGNAL-LIST.  It's
not recommended to define triggers with empty SIGNAL-LIST.
Normally triggers should respond at least to the `update' signal.

Normally the trigger defined by this command must be called from
the buffer where HANDLER-NAME must work.  This should be done so
that buffer-local thread number may be used in GDB-COMMAND (by
calling `gdb-current-context-command').
`gdb-bind-function-to-buffer' is used to achieve this, see
`gdb-get-buffer-create'.

Triggers defined by this command are meant to be used as a
trigger argument when describing buffer types with
`gdb-set-buffer-rules'."
  (declare (indent defun))
  `(defun ,trigger-name (&optional signal)
     (when
         (or (not ,signal-list)
             (memq signal ,signal-list))
       (gdb-input ,gdb-command
                  (gdb-bind-function-to-buffer ',handler-name (current-buffer))
                  (cons (current-buffer) ',trigger-name)))))