'gdb-breakpoints-mode
'gdb-invalidate-breakpoints)
+(defun gdb-breakpoints--add-breakpoint-row (tbl bkpt)
+ (let ((at (gdb-mi--field bkpt 'at))
+ (pending (gdb-mi--field bkpt 'pending))
+ (addr (gdb-mi--field bkpt 'addr))
+ (func (gdb-mi--field bkpt 'func))
+ (type (gdb-mi--field bkpt 'type)))
+ (if (and (not func) (string-equal addr "<MULTIPLE>"))
+ (setq func ""))
+ (gdb-table-add-row tbl
+ (list
+ (gdb-mi--field bkpt 'number)
+ (or type "")
+ (or (gdb-mi--field bkpt 'disp) "")
+ (let ((flag (gdb-mi--field bkpt 'enabled)))
+ (if (string-equal flag "y")
+ (eval-when-compile
+ (propertize "y" 'font-lock-face
+ font-lock-warning-face))
+ (eval-when-compile
+ (propertize "n" 'font-lock-face
+ font-lock-comment-face))))
+ addr
+ (or (gdb-mi--field bkpt 'times) "")
+ (if (and type (string-match ".*watchpoint" type))
+ (gdb-mi--field bkpt 'what)
+ (or (and (equal func "") "")
+ pending at
+ (concat "in "
+ (propertize (or func "unknown")
+ 'font-lock-face
+ font-lock-function-name-face)
+ (gdb-frame-location bkpt)))))
+ ;; Add clickable properties only for
+ ;; breakpoints with file:line information
+ (append (list 'gdb-breakpoint bkpt)
+ (when func
+ '(help-echo "mouse-2, RET: visit breakpoint"
+ mouse-face highlight))))))
+
(defun gdb-breakpoints-list-handler-custom ()
(let ((breakpoints-list (gdb-mi--field
(gdb-mi--field (gdb-mi--partial-output 'bkpt)
(add-to-list 'gdb-breakpoints-list
(cons (gdb-mi--field breakpoint 'number)
breakpoint))
- (let ((at (gdb-mi--field breakpoint 'at))
- (pending (gdb-mi--field breakpoint 'pending))
- (func (gdb-mi--field breakpoint 'func))
- (type (gdb-mi--field breakpoint 'type)))
- (gdb-table-add-row table
- (list
- (gdb-mi--field breakpoint 'number)
- (or type "")
- (or (gdb-mi--field breakpoint 'disp) "")
- (let ((flag (gdb-mi--field breakpoint 'enabled)))
- (if (string-equal flag "y")
- (eval-when-compile
- (propertize "y" 'font-lock-face
- font-lock-warning-face))
- (eval-when-compile
- (propertize "n" 'font-lock-face
- font-lock-comment-face))))
- (gdb-mi--field breakpoint 'addr)
- (or (gdb-mi--field breakpoint 'times) "")
- (if (and type (string-match ".*watchpoint" type))
- (gdb-mi--field breakpoint 'what)
- (or pending at
- (concat "in "
- (propertize (or func "unknown")
- 'font-lock-face font-lock-function-name-face)
- (gdb-frame-location breakpoint)))))
- ;; Add clickable properties only for breakpoints with file:line
- ;; information
- (append (list 'gdb-breakpoint breakpoint)
- (when func '(help-echo "mouse-2, RET: visit breakpoint"
- mouse-face highlight))))))
+ ;; Add the breakpoint/header row to the table.
+ (gdb-breakpoints--add-breakpoint-row table breakpoint)
+ ;; If this breakpoint has multiple locations, add them as well.
+ (when-let ((locations (gdb-mi--field breakpoint 'locations)))
+ (dolist (loc locations)
+ (add-to-list 'gdb-breakpoints-list
+ (cons (gdb-mi--field loc 'number) loc))
+ (gdb-breakpoints--add-breakpoint-row table loc))))
(insert (gdb-table-string table " "))
(gdb-place-breakpoints)))