Function: gdb-thread-exited

gdb-thread-exited is a byte-compiled function defined in gdb-mi.el.gz.

Signature

(gdb-thread-exited TOKEN OUTPUT-FIELD)

Documentation

Handle =thread-exited async record.

Unset gdb-thread-number if current thread exited and update threads list.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gdb-mi.el.gz
(defun gdb-thread-exited (_token output-field)
  "Handle =thread-exited async record.
Unset `gdb-thread-number' if current thread exited and update threads list."
  (let* ((thread-id (gdb-mi--field (gdb-mi--from-string output-field) 'id)))
    (if (string= gdb-thread-number thread-id)
        (gdb-setq-thread-number nil))
    ;; When we continue current thread and it quickly exits,
    ;; the pending triggers in gdb-handler-list left after gdb-running
    ;; disallow us to properly call -thread-info without --thread option.
    ;; Thus we need to use gdb-wait-for-pending.
    (gdb-wait-for-pending
     (lambda () (gdb-emit-signal gdb-buf-publisher 'update-threads)))))