Function: gdb-locals-handler-custom

gdb-locals-handler-custom is a byte-compiled function defined in gdb-mi.el.gz.

Signature

(gdb-locals-handler-custom)

Documentation

Handler to rebuild the local variables table buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
;; Complex data types are looked up in `gdb-locals-values-table'.
(defun gdb-locals-handler-custom ()
  "Handler to rebuild the local variables table buffer."
  (let ((locals-list (bindat-get-field (gdb-mi--partial-output) 'variables))
        (table (make-gdb-table)))
    (dolist (local locals-list)
      (let ((name (gdb-mi--field local 'name))
            (value (gdb-mi--field local 'value))
            (type (gdb-mi--field local 'type)))
        (when (not value)
          (setq value
                (if gdb-locals-simple-values-only
                    "<complex data type>"
                  (gethash name gdb-locals-values-table "<unavailable>"))))
        (setq value (gdb-locals-value-filter value))

        (if (or (not value)
                (string-match "0x" value))
            (add-text-properties 0 (length name)
                                 `(mouse-face highlight
                                              help-echo "mouse-2: create watch expression"
                                              local-map ,gdb-locals-watch-map)
                                 name)
          (add-text-properties 0 (length value)
                               `(mouse-face highlight
                                            help-echo "mouse-2: edit value"
                                            local-map ,gdb-edit-locals-map-1)
                               value))
        (gdb-table-add-row
         table
         (list
          (propertize type 'font-lock-face font-lock-type-face)
          (propertize name 'font-lock-face font-lock-variable-name-face)
          value)
         `(gdb-local-variable ,local))))
    (insert (gdb-table-string table " "))
    (setq mode-name
          (gdb-current-context-mode-name
           (concat "Locals: "
                   (gdb-mi--field (gdb-current-buffer-frame) 'func))))))