1202 |
(interactive) |
(interactive) |
1203 |
(save-excursion |
(save-excursion |
1204 |
(beginning-of-line 1) |
(beginning-of-line 1) |
1205 |
(if (not (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")) |
(if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) |
1206 |
(error "Not recognized as break/watchpoint line") |
(looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)") |
1207 |
(gdb-enqueue-input |
(looking-at |
1208 |
(list |
"\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*\\S-*\\s-*\\S-*:[0-9]+")) |
1209 |
(concat |
(gdb-enqueue-input |
1210 |
(if (eq ?y (char-after (match-beginning 2))) |
(list |
1211 |
(concat gdb-server-prefix "disable ") |
(concat gdb-server-prefix |
1212 |
(concat gdb-server-prefix "enable ")) |
(if (eq ?y (char-after (match-beginning 2))) |
1213 |
(match-string 1) "\n") |
"disable " |
1214 |
'ignore))))) |
"enable ") |
1215 |
|
(match-string 1) "\n") 'ignore)) |
1216 |
|
(error "Not recognized as break/watchpoint line")))) |
1217 |
|
|
1218 |
(defun gdb-delete-breakpoint () |
(defun gdb-delete-breakpoint () |
1219 |
"Delete the breakpoint at current line." |
"Delete the breakpoint at current line." |
1220 |
(interactive) |
(interactive) |
1221 |
(beginning-of-line 1) |
(beginning-of-line 1) |
1222 |
(if (not (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")) |
(if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) |
1223 |
(error "Not recognized as break/watchpoint line") |
(looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)") |
1224 |
(gdb-enqueue-input |
(looking-at |
1225 |
(list (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore)))) |
"\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\S-*:[0-9]+")) |
1226 |
|
(gdb-enqueue-input |
1227 |
|
(list |
1228 |
|
(concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore)) |
1229 |
|
(error "Not recognized as break/watchpoint line"))) |
1230 |
|
|
1231 |
(defun gdb-goto-breakpoint () |
(defun gdb-goto-breakpoint () |
1232 |
"Display the breakpoint location specified at current line." |
"Display the breakpoint location specified at current line." |
1233 |
(interactive) |
(interactive) |
1234 |
(save-excursion |
(save-excursion |
1235 |
(beginning-of-line 1) |
(beginning-of-line 1) |
1236 |
(if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) |
(if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) |
1237 |
(progn |
(looking-at ".*in\\s-+\\S-+\\s-+at\\s-+\\(\\S-*\\):\\([0-9]+\\)") |
1238 |
(re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t) |
(looking-at |
1239 |
(looking-at "\\(\\S-*\\):\\([0-9]+\\)")) |
"[0-9]+\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")) |
1240 |
(looking-at |
(let ((line (match-string 2)) |
1241 |
"[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)"))) |
(file (match-string 1))) |
1242 |
(if (match-string 2) |
(save-selected-window |
1243 |
(let ((line (match-string 2)) |
(let* ((buf (find-file-noselect (if (file-exists-p file) |
1244 |
(file (match-string 1))) |
file |
1245 |
(save-selected-window |
(expand-file-name file gdb-cdir)))) |
1246 |
(let* ((buf (find-file-noselect (if (file-exists-p file) |
(window (gdb-display-buffer buf))) |
1247 |
file |
(with-current-buffer buf |
1248 |
(expand-file-name file gdb-cdir)))) |
(goto-line (string-to-number line)) |
1249 |
(window (gdb-display-buffer buf))) |
(set-window-point window (point)))))) |
1250 |
(with-current-buffer buf |
(error "Not recognized as break/watchpoint line")))) |
|
(goto-line (string-to-number line)) |
|
|
(set-window-point window (point)))))))) |
|
1251 |
|
|
1252 |
(defun gdb-mouse-goto-breakpoint (event) |
(defun gdb-mouse-goto-breakpoint (event) |
1253 |
"Display the breakpoint location that you click on." |
"Display the breakpoint location that you click on." |