Mercurial > emacs
annotate lisp/progmodes/gdb-mi.el @ 104146:907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
(gdb-locals-buffer-name, gdb-registers-buffer-name)
(gdb-memory-buffer-name, gdb-stack-buffer-name): Do not switch
to (gud-comint-buffer) in *-buffer-name functions
because (gdb-get-target-string) already does that.
(gdb-locals-handler-custom, gdb-registers-handler-custom)
(gdb-changed-registers-handler): Rewritten without regexps.
author | Dmitry Dzhus <dima@sphinx.net.ru> |
---|---|
date | Tue, 04 Aug 2009 13:11:06 +0000 |
parents | ff7110a449a4 |
children | 9629847b09ed |
rev | line source |
---|---|
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1 ;;; gdb-mi.el --- User Interface for running GDB |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2 |
103563 | 3 ;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. |
4 | |
5 ;; Author: Nick Roberts <nickrob@gnu.org> | |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
6 ;; Maintainer: FSF |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
7 ;; Keywords: unix, tools |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
8 |
103563 | 9 ;; This file is part of GNU Emacs. |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
10 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
11 ;; Homepage: http://www.emacswiki.org/emacs/GDB-MI |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
12 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
16 ;; (at your option) any later version. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
17 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
22 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
25 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
26 ;;; Credits: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
27 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
28 ;; This file was written by by Nick Roberts following the general design |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
29 ;; used in gdb-ui.el for Emacs 22.1 - 23.1. It is currently being developed |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
30 ;; by Dmitry Dzhus <dima@sphinx.net.ru> as part of the Google Summer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
31 ;; of Code 2009 Project "Emacs GDB/MI migration". |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
32 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
33 ;;; Commentary: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
34 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
35 ;; This mode acts as a graphical user interface to GDB. You can interact with |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
36 ;; GDB through the GUD buffer in the usual way, but there are also further |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
37 ;; buffers which control the execution and describe the state of your program. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
38 ;; It separates the input/output of your program from that of GDB and displays |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
39 ;; expressions and their current values in their own buffers. It also uses |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
40 ;; features of Emacs 21 such as the fringe/display margin for breakpoints, and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
41 ;; the toolbar (see the GDB Graphical Interface section in the Emacs info |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
42 ;; manual). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
43 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
44 ;; M-x gdb will start the debugger. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
45 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
46 ;; This file uses GDB/MI as the primary interface to GDB. It is still under |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
47 ;; development and is part of a process to migrate Emacs from annotations (as |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
48 ;; used in gdb-ui.el) to GDB/MI. It runs gdb with GDB/MI (-interp=mi) and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
49 ;; access CLI using "-interpreter-exec console cli-command". This code works |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
50 ;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
51 ;; should be asynchronous. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
52 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
53 ;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
54 ;; doesn't update properly when execution commands are issued from GUD buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
55 ;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
56 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
57 ;; You need development version of GDB 7.0 for the thread buffer to work. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
58 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
59 ;; This file replaces gdb-ui.el and is for development with GDB. Use the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
60 ;; release branch of Emacs 22 for the latest version of gdb-ui.el. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
61 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
62 ;; Windows Platforms: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
63 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
64 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
65 ;; explicitly in your program if you want timely display of I/O in Emacs. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
66 ;; Alternatively you can make the output stream unbuffered, for example, by |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
67 ;; using a macro: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
68 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
69 ;; #ifdef UNBUFFERED |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
70 ;; setvbuf (stdout, (char *) NULL, _IONBF, 0); |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
71 ;; #endif |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
72 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
73 ;; and compiling with -DUNBUFFERED while debugging. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
74 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
75 ;; If you are using Cygwin GDB and find that the source is not being displayed |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
76 ;; in Emacs when you step through it, possible solutions are to: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
77 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
78 ;; 1) Use Cygwin X Windows and Cygwin Emacs. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
79 ;; (Since 22.1 Emacs builds under Cygwin.) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
80 ;; 2) Use MinGW GDB instead. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
81 ;; 3) Use cygwin-mount.el |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
82 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
83 ;;; Mac OSX: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
84 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
85 ;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
86 ;; some changes to the version that they include as part of Mac OSX. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
87 ;; This requires GDB version 7.0 or later (estimated release date Aug 2009) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
88 ;; as earlier versions don not compile on Mac OSX. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
89 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
90 ;;; Known Bugs: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
91 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
92 ;; 1) Stack buffer doesn't parse MI output if you stop in a routine without |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
93 ;; line information, e.g., a routine in libc (just a TODO item). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
94 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
95 ;; TODO: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
96 ;; 2) Watch windows to work with threads. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
97 ;; 3) Use treebuffer.el instead of the speedbar for watch-expressions? |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
98 ;; 4) Mark breakpoint locations on scroll-bar of source buffer? |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
99 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
100 ;;; Code: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
101 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
102 (require 'gud) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
103 (require 'json) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
104 (require 'bindat) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
105 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
106 (defvar tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
107 (defvar speedbar-initial-expansion-list-name) |
103955
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
108 (defvar speedbar-frame) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
109 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
110 (defvar gdb-pc-address nil "Initialization for Assembler buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
111 Set to \"main\" at start if `gdb-show-main' is t.") |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
112 (defvar gdb-memory-address "main") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
113 (defvar gdb-memory-last-address nil |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
114 "Last successfully accessed memory address.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
115 (defvar gdb-memory-next-page nil |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
116 "Address of next memory page for program memory buffer.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
117 (defvar gdb-memory-prev-page nil |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
118 "Address of previous memory page for program memory buffer.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
119 |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
120 (defvar gdb-frame-number "0") |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
121 (defvar gdb-thread-number "1" |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
122 "Main current thread. |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
123 |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
124 Invalidation triggers use this variable to query GDB for |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
125 information on the specified thread. |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
126 |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
127 This variable may be updated implicitly by GDB via |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
128 `gdb-thread-list-handler-custom' or explicitly by |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
129 `gdb-select-thread'.") |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
130 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
131 (defvar gdb-selected-frame nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
132 (defvar gdb-selected-file nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
133 (defvar gdb-selected-line nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
134 (defvar gdb-current-language nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
135 (defvar gdb-var-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
136 "List of variables in watch window. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
137 Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS) where |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
138 STATUS is nil (unchanged), `changed' or `out-of-scope'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
139 (defvar gdb-main-file nil "Source file from which program execution begins.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
140 (defvar gdb-overlay-arrow-position nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
141 (defvar gdb-stack-position nil) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
142 (defvar gdb-breakpoints-list nil |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
143 "List of breakpoints. |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
144 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
145 `gdb-get-field' is used to access breakpoints data stored in this |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
146 variable. Each element contains the same fields as \"body\" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
147 member of \"-break-info\".") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
148 (defvar gdb-location-alist nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
149 "Alist of breakpoint numbers and full filenames. Only used for files that |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
150 Emacs can't find.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
151 (defvar gdb-active-process nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
152 "GUD tooltips display variable values when t, and macro definitions otherwise.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
153 (defvar gdb-error "Non-nil when GDB is reporting an error.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
154 (defvar gdb-macro-info nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
155 "Non-nil if GDB knows that the inferior includes preprocessor macro info.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
156 (defvar gdb-register-names nil "List of register names.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
157 (defvar gdb-changed-registers nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
158 "List of changed register numbers (strings).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
159 (defvar gdb-buffer-fringe-width nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
160 (defvar gdb-last-command nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
161 (defvar gdb-prompt-name nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
162 (defvar gdb-token-number 0) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
163 (defvar gdb-handler-alist '()) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
164 (defvar gdb-handler-number nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
165 (defvar gdb-source-file-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
166 "List of source files for the current executable.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
167 (defvar gdb-first-done-or-error t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
168 (defvar gdb-source-window nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
169 (defvar gdb-inferior-status nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
170 (defvar gdb-continuation nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
171 (defvar gdb-filter-output nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
172 "Message to be shown in GUD console. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
173 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
174 This variable is updated in `gdb-done-or-error' and returned by |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
175 `gud-gdbmi-marker-filter'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
176 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
177 (defvar gdb-buffer-type nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
178 "One of the symbols bound in `gdb-buffer-rules'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
179 (make-variable-buffer-local 'gdb-buffer-type) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
180 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
181 (defvar gdb-output-sink 'nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
182 "The disposition of the output of the current gdb command. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
183 Possible values are these symbols: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
184 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
185 `user' -- gdb output should be copied to the GUD buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
186 for the user to see. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
187 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
188 `emacs' -- output should be collected in the partial-output-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
189 for subsequent processing by a command. This is the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
190 disposition of output generated by commands that |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
191 gdb mode sends to gdb on its own behalf.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
192 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
193 (defvar gdb-pending-triggers '() |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
194 "A list of trigger functions that have run later than their output handlers.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
195 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
196 (defcustom gdb-debug-log-max 128 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
197 "Maximum size of `gdb-debug-log'. If nil, size is unlimited." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
198 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
199 :type '(choice (integer :tag "Number of elements") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
200 (const :tag "Unlimited" nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
201 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
202 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
203 (defvar gdb-debug-log nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
204 "List of commands sent to and replies received from GDB. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
205 Most recent commands are listed first. This list stores only the last |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
206 `gdb-debug-log-max' values. This variable is used to debug GDB-MI.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
207 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
208 ;;;###autoload |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
209 (defcustom gdb-enable-debug nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
210 "Non-nil means record the process input and output in `gdb-debug-log'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
211 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
212 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
213 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
214 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
215 (defcustom gdb-cpp-define-alist-program "gcc -E -dM -" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
216 "Shell command for generating a list of defined macros in a source file. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
217 This list is used to display the #define directive associated |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
218 with an identifier as a tooltip. It works in a debug session with |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
219 GDB, when `gud-tooltip-mode' is t. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
220 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
221 Set `gdb-cpp-define-alist-flags' for any include paths or |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
222 predefined macros." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
223 :type 'string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
224 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
225 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
226 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
227 (defcustom gdb-cpp-define-alist-flags "" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
228 "Preprocessor flags for `gdb-cpp-define-alist-program'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
229 :type 'string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
230 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
231 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
232 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
233 (defcustom gdb-create-source-file-list t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
234 "Non-nil means create a list of files from which the executable was built. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
235 Set this to nil if the GUD buffer displays \"initializing...\" in the mode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
236 line for a long time when starting, possibly because your executable was |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
237 built from a large number of files. This allows quicker initialization |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
238 but means that these files are not automatically enabled for debugging, |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
239 e.g., you won't be able to click in the fringe to set a breakpoint until |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
240 execution has already stopped there." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
241 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
242 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
243 :version "23.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
244 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
245 (defcustom gdb-show-main nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
246 "Non-nil means display source file containing the main routine at startup. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
247 Also display the main routine in the disassembly buffer if present." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
248 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
249 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
250 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
251 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
252 ; Note: This mode requires a separate buffer for inferior IO. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
253 (defconst gdb-use-separate-io-buffer t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
254 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
255 (defun gdb-force-mode-line-update (status) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
256 (let ((buffer gud-comint-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
257 (if (and buffer (buffer-name buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
258 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
259 (setq mode-line-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
260 (format ":%s [%s]" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
261 (process-status (get-buffer-process buffer)) status)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
262 ;; Force mode line redisplay soon. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
263 (force-mode-line-update))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
264 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
265 (defun gdb-enable-debug (arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
266 "Toggle logging of transaction between Emacs and Gdb. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
267 The log is stored in `gdb-debug-log' as an alist with elements |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
268 whose cons is send, send-item or recv and whose cdr is the string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
269 being transferred. This list may grow up to a size of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
270 `gdb-debug-log-max' after which the oldest element (at the end of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
271 the list) is deleted every time a new one is added (at the front)." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
272 (interactive "P") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
273 (setq gdb-enable-debug |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
274 (if (null arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
275 (not gdb-enable-debug) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
276 (> (prefix-numeric-value arg) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
277 (message (format "Logging of transaction %sabled" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
278 (if gdb-enable-debug "en" "dis")))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
279 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
280 (defun gdb-find-watch-expression () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
281 (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
282 (varnum (car var)) expr array) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
283 (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
284 (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
285 (component-list (split-string (match-string 2 varnum) "\\." t))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
286 (setq expr (nth 1 var1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
287 (setq varnumlet (car var1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
288 (dolist (component component-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
289 (setq var2 (assoc varnumlet gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
290 (setq expr (concat expr |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
291 (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
292 (concat "[" component "]") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
293 (concat "." component)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
294 (setq varnumlet (concat varnumlet "." component))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
295 expr))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
296 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
297 (defvar gdb-locals-font-lock-keywords |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
298 '( |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
299 ;; var = type value |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
300 ( "\\(^\\(\\sw\\|[_.]\\)+\\)\t+\\(\\(\\sw\\|[_.]\\)+\\)" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
301 (1 font-lock-variable-name-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
302 (3 font-lock-type-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
303 ) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
304 "Font lock keywords used in `gdb-local-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
305 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
306 ;;;###autoload |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
307 (defun gdb (command-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
308 "Run gdb on program FILE in buffer *gud-FILE*. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
309 The directory containing FILE becomes the initial working directory |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
310 and source-file directory for your debugger. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
311 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
312 If `gdb-many-windows' is nil (the default value) then gdb just |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
313 pops up the GUD buffer unless `gdb-show-main' is t. In this case |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
314 it starts with two windows: one displaying the GUD buffer and the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
315 other with the source file with the main routine of the inferior. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
316 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
317 If `gdb-many-windows' is t, regardless of the value of |
103779
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
318 `gdb-show-main', the layout below will appear. Keybindings are |
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
319 shown in some of the buffers. |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
320 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
321 Watch expressions appear in the speedbar/slowbar. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
322 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
323 The following commands help control operation : |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
324 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
325 `gdb-many-windows' - Toggle the number of windows gdb uses. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
326 `gdb-restore-windows' - To restore the window layout. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
327 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
328 See Info node `(emacs)GDB Graphical Interface' for a more |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
329 detailed description of this mode. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
330 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
331 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
332 +----------------------------------------------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
333 | GDB Toolbar | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
334 +-----------------------------------+----------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
335 | GUD buffer (I/O of GDB) | Locals buffer | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
336 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
337 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
338 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
339 +-----------------------------------+----------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
340 | Source buffer | I/O buffer (of debugged program) | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
341 | | (comint-mode) | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
342 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
343 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
344 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
345 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
346 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
347 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
348 +-----------------------------------+----------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
349 | Stack buffer | Breakpoints buffer | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
350 | RET gdb-frames-select | SPC gdb-toggle-breakpoint | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
351 | | RET gdb-goto-breakpoint | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
352 | | D gdb-delete-breakpoint | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
353 +-----------------------------------+----------------------------------+" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
354 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
355 (interactive (list (gud-query-cmdline 'gdb))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
356 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
357 (when (and gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
358 (buffer-name gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
359 (get-buffer-process gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
360 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
361 (gdb-restore-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
362 (error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
363 "Multiple debugging requires restarting in text command mode")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
364 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
365 (gud-common-init command-line nil 'gud-gdbmi-marker-filter) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
366 (set (make-local-variable 'gud-minor-mode) 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
367 (setq comint-input-sender 'gdb-send) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
368 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
369 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
370 "Set temporary breakpoint at current line.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
371 (gud-def gud-jump |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
372 (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
373 "\C-j" "Set execution address to current line.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
374 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
375 (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
376 (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
377 (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
378 (gud-def gud-pstar "print* %e" nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
379 "Evaluate C dereferenced pointer expression at point.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
380 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
381 (gud-def gud-step "-exec-step %p" "\C-s" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
382 "Step one source line with display.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
383 (gud-def gud-stepi "-exec-step-instruction %p" "\C-i" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
384 "Step one instruction with display.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
385 (gud-def gud-next "-exec-next %p" "\C-n" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
386 "Step one line (skip functions).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
387 (gud-def gud-nexti "nexti %p" nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
388 "Step one instruction (skip functions).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
389 (gud-def gud-cont "-exec-continue" "\C-r" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
390 "Continue with display.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
391 (gud-def gud-finish "-exec-finish" "\C-f" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
392 "Finish executing current function.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
393 (gud-def gud-run "-exec-run" nil "Runn the program.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
394 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
395 (local-set-key "\C-i" 'gud-gdb-complete-command) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
396 (setq gdb-first-prompt t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
397 (setq gud-running nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
398 (gdb-update) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
399 (run-hooks 'gdb-mode-hook)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
400 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
401 (defun gdb-init-1 () |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
402 (gud-def gud-break (if (not (string-match "Disassembly" mode-name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
403 (gud-call "break %f:%l" arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
404 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
405 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
406 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
407 (gud-call "break *%a" arg))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
408 "\C-b" "Set breakpoint at current line or address.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
409 ;; |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
410 (gud-def gud-remove (if (not (string-match "Disassembly" mode-name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
411 (gud-call "clear %f:%l" arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
412 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
413 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
414 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
415 (gud-call "clear *%a" arg))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
416 "\C-d" "Remove breakpoint at current line or address.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
417 ;; |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
418 (gud-def gud-until (if (not (string-match "Disassembly" mode-name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
419 (gud-call "-exec-until %f:%l" arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
420 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
421 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
422 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
423 (gud-call "-exec-until *%a" arg))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
424 "\C-u" "Continue to current line or address.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
425 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
426 (gud-def |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
427 gud-go (gud-call (if gdb-active-process "-exec-continue" "-exec-run") arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
428 nil "Start or continue execution.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
429 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
430 ;; For debugging Emacs only. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
431 (gud-def gud-pp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
432 (gud-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
433 (concat |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
434 "pp1 " (if (eq (buffer-local-value |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
435 'major-mode (window-buffer)) 'speedbar-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
436 (gdb-find-watch-expression) "%e")) arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
437 nil "Print the Emacs s-expression.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
438 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
439 (define-key gud-minor-mode-map [left-margin mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
440 'gdb-mouse-set-clear-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
441 (define-key gud-minor-mode-map [left-fringe mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
442 'gdb-mouse-set-clear-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
443 (define-key gud-minor-mode-map [left-margin C-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
444 'gdb-mouse-toggle-breakpoint-margin) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
445 (define-key gud-minor-mode-map [left-fringe C-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
446 'gdb-mouse-toggle-breakpoint-fringe) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
447 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
448 (define-key gud-minor-mode-map [left-margin drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
449 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
450 (define-key gud-minor-mode-map [left-fringe drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
451 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
452 (define-key gud-minor-mode-map [left-margin mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
453 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
454 (define-key gud-minor-mode-map [left-fringe mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
455 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
456 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
457 (define-key gud-minor-mode-map [left-margin C-drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
458 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
459 (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
460 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
461 (define-key gud-minor-mode-map [left-fringe C-mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
462 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
463 (define-key gud-minor-mode-map [left-margin C-mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
464 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
465 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
466 ;; (re-)initialise |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
467 (setq gdb-pc-address (if gdb-show-main "main" nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
468 (setq gdb-selected-frame nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
469 gdb-frame-number nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
470 gdb-var-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
471 gdb-pending-triggers nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
472 gdb-output-sink 'user |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
473 gdb-location-alist nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
474 gdb-source-file-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
475 gdb-last-command nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
476 gdb-token-number 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
477 gdb-handler-alist '() |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
478 gdb-handler-number nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
479 gdb-prompt-name nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
480 gdb-first-done-or-error t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
481 gdb-buffer-fringe-width (car (window-fringes)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
482 gdb-debug-log nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
483 gdb-source-window nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
484 gdb-inferior-status nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
485 gdb-continuation nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
486 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
487 (setq gdb-buffer-type 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
488 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
489 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
490 (propertize "initializing..." 'face font-lock-variable-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
491 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
492 (when gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
493 (gdb-get-buffer-create 'gdb-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
494 (gdb-clear-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
495 (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
496 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
497 ;; Needs GDB 6.4 onwards |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
498 (list (concat "-inferior-tty-set " |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
499 (process-tty-name (get-process "gdb-inferior"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
500 'ignore))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
501 (if (eq window-system 'w32) |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
502 (gdb-input (list "-gdb-set new-console off" 'ignore))) |
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
503 (gdb-input (list "-gdb-set height 0" 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
504 ;; find source file and compilation directory here |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
505 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
506 ; Needs GDB 6.2 onwards. |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
507 (list "-file-list-exec-source-files" 'gdb-get-source-file-list)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
508 (if gdb-create-source-file-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
509 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
510 ; Needs GDB 6.0 onwards. |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
511 (list "-file-list-exec-source-file" 'gdb-get-source-file))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
512 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
513 (list "-gdb-show prompt" 'gdb-get-prompt))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
514 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
515 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
516 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
517 (defun gdb-create-define-alist () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
518 "Create an alist of #define directives for GUD tooltips." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
519 (let* ((file (buffer-file-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
520 (output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
521 (with-output-to-string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
522 (with-current-buffer standard-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
523 (and file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
524 (file-exists-p file) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
525 ;; call-process doesn't work with remote file names. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
526 (not (file-remote-p default-directory)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
527 (call-process shell-file-name file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
528 (list t nil) nil "-c" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
529 (concat gdb-cpp-define-alist-program " " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
530 gdb-cpp-define-alist-flags)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
531 (define-list (split-string output "\n" t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
532 (name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
533 (setq gdb-define-alist nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
534 (dolist (define define-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
535 (setq name (nth 1 (split-string define "[( ]"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
536 (push (cons name define) gdb-define-alist)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
537 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
538 (declare-function tooltip-show "tooltip" (text &optional use-echo-area)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
539 (defvar tooltip-use-echo-area) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
540 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
541 (defun gdb-tooltip-print (expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
542 (tooltip-show |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
543 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
544 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
545 (let ((string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
546 (if (search-forward "=" nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
547 (concat expr (buffer-substring (- (point) 2) (point-max))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
548 (buffer-string)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
549 ;; remove newline for gud-tooltip-echo-area |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
550 (substring string 0 (- (length string) 1)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
551 (or gud-tooltip-echo-area tooltip-use-echo-area |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
552 (not (display-graphic-p))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
553 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
554 ;; If expr is a macro for a function don't print because of possible dangerous |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
555 ;; side-effects. Also printing a function within a tooltip generates an |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
556 ;; unexpected starting annotation (phase error). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
557 (defun gdb-tooltip-print-1 (expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
558 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
559 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
560 (if (search-forward "expands to: " nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
561 (unless (looking-at "\\S-+.*(.*).*") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
562 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
563 (list (concat "print " expr) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
564 `(lambda () (gdb-tooltip-print ,expr)))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
565 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
566 (defun gdb-init-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
567 (set (make-local-variable 'gud-minor-mode) 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
568 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
569 (when gud-tooltip-mode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
570 (make-local-variable 'gdb-define-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
571 (gdb-create-define-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
572 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
573 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
574 (defmacro gdb-if-arrow (arrow-position &rest body) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
575 `(if ,arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
576 (let ((buffer (marker-buffer ,arrow-position)) (line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
577 (if (equal buffer (window-buffer (posn-window end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
578 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
579 (when (or (equal start end) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
580 (equal (posn-point start) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
581 (marker-position ,arrow-position))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
582 ,@body)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
583 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
584 (defun gdb-mouse-until (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
585 "Continue running until a source line past the current line. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
586 The destination source line can be selected either by clicking |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
587 with mouse-3 on the fringe/margin or dragging the arrow |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
588 with mouse-1 (default bindings)." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
589 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
590 (let ((start (event-start event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
591 (end (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
592 (gdb-if-arrow gud-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
593 (setq line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
594 (gud-call (concat "until " (number-to-string line)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
595 (gdb-if-arrow gdb-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
596 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
597 (goto-line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
598 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
599 (gud-call (concat "until *%a")))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
600 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
601 (defun gdb-mouse-jump (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
602 "Set execution address/line. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
603 The destination source line can be selected either by clicking with C-mouse-3 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
604 on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
605 Unlike `gdb-mouse-until' the destination address can be before the current |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
606 line, and no execution takes place." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
607 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
608 (let ((start (event-start event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
609 (end (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
610 (gdb-if-arrow gud-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
611 (setq line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
612 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
613 (gud-call (concat "tbreak " (number-to-string line))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
614 (gud-call (concat "jump " (number-to-string line))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
615 (gdb-if-arrow gdb-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
616 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
617 (goto-line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
618 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
619 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
620 (gud-call (concat "tbreak *%a")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
621 (gud-call (concat "jump *%a"))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
622 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
623 (defcustom gdb-show-changed-values t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
624 "If non-nil change the face of out of scope variables and changed values. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
625 Out of scope variables are suppressed with `shadow' face. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
626 Changed values are highlighted with the face `font-lock-warning-face'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
627 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
628 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
629 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
630 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
631 (defcustom gdb-max-children 40 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
632 "Maximum number of children before expansion requires confirmation." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
633 :type 'integer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
634 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
635 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
636 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
637 (defcustom gdb-delete-out-of-scope t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
638 "If non-nil delete watch expressions automatically when they go out of scope." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
639 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
640 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
641 :version "22.2") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
642 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
643 (defcustom gdb-speedbar-auto-raise nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
644 "If non-nil raise speedbar every time display of watch expressions is\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
645 updated." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
646 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
647 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
648 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
649 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
650 (defcustom gdb-use-colon-colon-notation nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
651 "If non-nil use FUN::VAR format to display variables in the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
652 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
653 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
654 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
655 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
656 (defun gdb-speedbar-auto-raise (arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
657 "Toggle automatic raising of the speedbar for watch expressions. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
658 With prefix argument ARG, automatically raise speedbar if ARG is |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
659 positive, otherwise don't automatically raise it." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
660 (interactive "P") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
661 (setq gdb-speedbar-auto-raise |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
662 (if (null arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
663 (not gdb-speedbar-auto-raise) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
664 (> (prefix-numeric-value arg) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
665 (message (format "Auto raising %sabled" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
666 (if gdb-speedbar-auto-raise "en" "dis")))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
667 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
668 (define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
669 (define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
670 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
671 (declare-function tooltip-identifier-from-point "tooltip" (point)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
672 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
673 (defun gud-watch (&optional arg event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
674 "Watch expression at point. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
675 With arg, enter name of variable to be watched in the minibuffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
676 (interactive (list current-prefix-arg last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
677 (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
678 (if (eq minor-mode 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
679 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
680 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
681 (require 'tooltip) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
682 (save-selected-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
683 (let ((expr |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
684 (if arg |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
685 (completing-read "Name of variable: " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
686 'gud-gdb-complete-command) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
687 (if (and transient-mark-mode mark-active) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
688 (buffer-substring (region-beginning) (region-end)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
689 (concat (if (eq major-mode 'gdb-registers-mode) "$") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
690 (tooltip-identifier-from-point (point))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
691 (set-text-properties 0 (length expr) nil expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
692 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
693 (list (concat"-var-create - * " expr "") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
694 `(lambda () (gdb-var-create-handler ,expr))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
695 (message "gud-watch is a no-op in this mode.")))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
696 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
697 (defconst gdb-var-create-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
698 "name=\"\\(.*?\\)\",.*numchild=\"\\(.*?\\)\",\\(?:.*value=\\(\".*\"\\),\\)?.*type=\"\\(.*?\\)\"") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
699 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
700 (defun gdb-var-create-handler (expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
701 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
702 (if (re-search-forward gdb-var-create-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
703 (let ((var (list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
704 (match-string 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
705 (if (and (string-equal gdb-current-language "c") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
706 gdb-use-colon-colon-notation gdb-selected-frame) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
707 (setq expr (concat gdb-selected-frame "::" expr)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
708 expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
709 (match-string 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
710 (match-string 4) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
711 (if (match-string 3) (read (match-string 3))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
712 nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
713 (push var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
714 (speedbar 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
715 (unless (string-equal |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
716 speedbar-initial-expansion-list-name "GUD") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
717 (speedbar-change-initial-expansion-list "GUD")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
718 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
719 (list |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
720 (concat "-var-evaluate-expression " (car var)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
721 `(lambda () (gdb-var-evaluate-expression-handler |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
722 ,(car var) nil))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
723 (message-box "No symbol \"%s\" in current context." expr))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
724 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
725 (defun gdb-speedbar-update () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
726 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
727 (not (member 'gdb-speedbar-timer gdb-pending-triggers))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
728 ;; Dummy command to update speedbar even when idle. |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
729 (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
730 ;; Keep gdb-pending-triggers non-nil till end. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
731 (push 'gdb-speedbar-timer gdb-pending-triggers))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
732 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
733 (defun gdb-speedbar-timer-fn () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
734 (if gdb-speedbar-auto-raise |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
735 (raise-frame speedbar-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
736 (setq gdb-pending-triggers |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
737 (delq 'gdb-speedbar-timer gdb-pending-triggers)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
738 (speedbar-timer-fn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
739 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
740 (defun gdb-var-evaluate-expression-handler (varnum changed) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
741 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
742 (re-search-forward ".*value=\\(\".*\"\\)" nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
743 (let ((var (assoc varnum gdb-var-list))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
744 (when var |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
745 (if changed (setcar (nthcdr 5 var) 'changed)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
746 (setcar (nthcdr 4 var) (read (match-string 1))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
747 (gdb-speedbar-update)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
748 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
749 ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
750 (defun gdb-var-list-children (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
751 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
752 (list (concat "-var-update " varnum) 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
753 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
754 (list (concat "-var-list-children --all-values " |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
755 varnum) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
756 `(lambda () (gdb-var-list-children-handler ,varnum))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
757 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
758 (defconst gdb-var-list-children-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
759 "child={.*?name=\"\\(.+?\\)\".*?,exp=\"\\(.+?\\)\".*?,\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
760 numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
761 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
762 (defun gdb-var-list-children-handler (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
763 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
764 (let ((var-list nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
765 (catch 'child-already-watched |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
766 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
767 (if (string-equal varnum (car var)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
768 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
769 (push var var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
770 (while (re-search-forward gdb-var-list-children-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
771 (let ((varchild (list (match-string 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
772 (match-string 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
773 (match-string 3) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
774 (match-string 5) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
775 (read (match-string 4)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
776 nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
777 (if (assoc (car varchild) gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
778 (throw 'child-already-watched nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
779 (push varchild var-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
780 (push var var-list))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
781 (setq gdb-var-list (nreverse var-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
782 (gdb-speedbar-update)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
783 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
784 (defun gdb-var-set-format (format) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
785 "Set the output format for a variable displayed in the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
786 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
787 (varnum (car var))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
788 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
789 (list (concat "-var-set-format " varnum " " format) 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
790 (gdb-var-update))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
791 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
792 (defun gdb-var-delete-1 (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
793 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
794 (list (concat "-var-delete " varnum) 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
795 (setq gdb-var-list (delq var gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
796 (dolist (varchild gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
797 (if (string-match (concat (car var) "\\.") (car varchild)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
798 (setq gdb-var-list (delq varchild gdb-var-list))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
799 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
800 (defun gdb-var-delete () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
801 "Delete watch expression at point from the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
802 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
803 (let ((text (speedbar-line-text))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
804 (string-match "\\(\\S-+\\)" text) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
805 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
806 (varnum (car var))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
807 (if (string-match "\\." (car var)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
808 (message-box "Can only delete a root expression") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
809 (gdb-var-delete-1 varnum))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
810 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
811 (defun gdb-var-delete-children (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
812 "Delete children of variable object at point from the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
813 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
814 (list (concat "-var-delete -c " varnum) 'ignore))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
815 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
816 (defun gdb-edit-value (text token indent) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
817 "Assign a value to a variable displayed in the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
818 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
819 (varnum (car var)) (value)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
820 (setq value (read-string "New value: ")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
821 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
822 (list (concat "-var-assign " varnum " " value) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
823 `(lambda () (gdb-edit-value-handler ,value)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
824 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
825 (defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
826 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
827 (defun gdb-edit-value-handler (value) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
828 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
829 (if (re-search-forward gdb-error-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
830 (message-box "Invalid number or expression (%s)" value))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
831 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
832 ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
833 (defun gdb-var-update () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
834 (if (not (member 'gdb-var-update gdb-pending-triggers)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
835 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
836 (list "-var-update --all-values *" 'gdb-var-update-handler))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
837 (push 'gdb-var-update gdb-pending-triggers)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
838 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
839 (defconst gdb-var-update-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
840 "{.*?name=\"\\(.*?\\)\".*?,\\(?:value=\\(\".*?\"\\),\\)?.*?\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
841 in_scope=\"\\(.*?\\)\".*?}") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
842 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
843 (defun gdb-var-update-handler () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
844 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
845 (setcar (nthcdr 5 var) nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
846 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
847 (while (re-search-forward gdb-var-update-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
848 (let* ((varnum (match-string 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
849 (var (assoc varnum gdb-var-list))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
850 (when var |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
851 (let ((match (match-string 3))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
852 (cond ((string-equal match "false") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
853 (if gdb-delete-out-of-scope |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
854 (gdb-var-delete-1 varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
855 (setcar (nthcdr 5 var) 'out-of-scope))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
856 ((string-equal match "true") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
857 (setcar (nthcdr 5 var) 'changed) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
858 (setcar (nthcdr 4 var) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
859 (read (match-string 2)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
860 ((string-equal match "invalid") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
861 (gdb-var-delete-1 varnum))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
862 (setq gdb-pending-triggers |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
863 (delq 'gdb-var-update gdb-pending-triggers)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
864 (gdb-speedbar-update)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
865 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
866 (defun gdb-speedbar-expand-node (text token indent) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
867 "Expand the node the user clicked on. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
868 TEXT is the text of the button we clicked on, a + or - item. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
869 TOKEN is data related to this node. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
870 INDENT is the current indentation depth." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
871 (cond ((string-match "+" text) ;expand this node |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
872 (let* ((var (assoc token gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
873 (expr (nth 1 var)) (children (nth 2 var))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
874 (if (or (<= (string-to-number children) gdb-max-children) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
875 (y-or-n-p |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
876 (format "%s has %s children. Continue? " expr children))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
877 (gdb-var-list-children token)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
878 ((string-match "-" text) ;contract this node |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
879 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
880 (if (string-match (concat token "\\.") (car var)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
881 (setq gdb-var-list (delq var gdb-var-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
882 (gdb-var-delete-children token) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
883 (speedbar-change-expand-button-char ?+) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
884 (speedbar-delete-subblock indent)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
885 (t (error "Ooops... not sure what to do"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
886 (speedbar-center-buffer-smartly)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
887 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
888 (defun gdb-get-target-string () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
889 (with-current-buffer gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
890 gud-target-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
891 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
892 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
893 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
894 ;; gdb buffers. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
895 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
896 ;; Each buffer has a TYPE -- a symbol that identifies the function |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
897 ;; of that particular buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
898 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
899 ;; The usual gdb interaction buffer is given the type `gdbmi' and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
900 ;; is constructed specially. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
901 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
902 ;; Others are constructed by gdb-get-buffer-create and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
903 ;; named according to the rules set forth in the gdb-buffer-rules-assoc |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
904 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
905 (defvar gdb-buffer-rules-assoc '()) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
906 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
907 (defun gdb-get-buffer (key) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
908 "Return the gdb buffer tagged with type KEY. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
909 The key should be one of the cars in `gdb-buffer-rules-assoc'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
910 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
911 (gdb-look-for-tagged-buffer key (buffer-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
912 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
913 (defun gdb-get-buffer-create (key) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
914 "Create a new gdb buffer of the type specified by KEY. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
915 The key should be one of the cars in `gdb-buffer-rules-assoc'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
916 (or (gdb-get-buffer key) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
917 (let* ((rules (assoc key gdb-buffer-rules-assoc)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
918 (name (funcall (gdb-rules-name-maker rules))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
919 (new (get-buffer-create name))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
920 (with-current-buffer new |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
921 (let ((trigger)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
922 (if (cdr (cdr rules)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
923 (setq trigger (funcall (car (cdr (cdr rules)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
924 (setq gdb-buffer-type key) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
925 (set (make-local-variable 'gud-minor-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
926 (buffer-local-value 'gud-minor-mode gud-comint-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
927 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
928 (if trigger (funcall trigger))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
929 new)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
930 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
931 (defun gdb-rules-name-maker (rules) (car (cdr rules))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
932 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
933 (defun gdb-look-for-tagged-buffer (key bufs) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
934 (let ((retval nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
935 (while (and (not retval) bufs) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
936 (set-buffer (car bufs)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
937 (if (eq gdb-buffer-type key) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
938 (setq retval (car bufs))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
939 (setq bufs (cdr bufs))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
940 retval)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
941 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
942 ;; Used to define all gdb-frame-*-buffer functions except |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
943 ;; `gdb-frame-separate-io-buffer' |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
944 (defmacro def-gdb-frame-for-buffer (name buffer &optional doc) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
945 "Define a function NAME which shows gdb BUFFER in a separate frame. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
946 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
947 DOC is an optional documentation string." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
948 `(defun ,name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
949 ,(when doc doc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
950 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
951 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
952 (special-display-frame-alist gdb-frame-parameters)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
953 (display-buffer (gdb-get-buffer-create ,buffer))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
954 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
955 (defmacro def-gdb-display-buffer (name buffer &optional doc) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
956 "Define a function NAME which shows gdb BUFFER. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
957 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
958 DOC is an optional documentation string." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
959 `(defun ,name () |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
960 ,(when doc doc) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
961 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
962 (gdb-display-buffer |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
963 (gdb-get-buffer-create ,buffer) t))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
964 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
965 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
966 ;; This assoc maps buffer type symbols to rules. Each rule is a list of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
967 ;; at least one and possible more functions. The functions have these |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
968 ;; roles in defining a buffer type: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
969 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
970 ;; NAME - Return a name for this buffer type. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
971 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
972 ;; The remaining function(s) are optional: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
973 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
974 ;; MODE - called in a new buffer with no arguments, should establish |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
975 ;; the proper mode for the buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
976 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
977 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
978 (defun gdb-set-buffer-rules (buffer-type &rest rules) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
979 (let ((binding (assoc buffer-type gdb-buffer-rules-assoc))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
980 (if binding |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
981 (setcdr binding rules) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
982 (push (cons buffer-type rules) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
983 gdb-buffer-rules-assoc)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
984 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
985 ;; GUD buffers are an exception to the rules |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
986 (gdb-set-buffer-rules 'gdbmi 'error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
987 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
988 ;; Partial-output buffer : This accumulates output from a command executed on |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
989 ;; behalf of emacs (rather than the user). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
990 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
991 (gdb-set-buffer-rules 'gdb-partial-output-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
992 'gdb-partial-output-name) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
993 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
994 (defun gdb-partial-output-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
995 (concat " *partial-output-" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
996 (gdb-get-target-string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
997 "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
998 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
999 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1000 (gdb-set-buffer-rules 'gdb-inferior-io |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1001 'gdb-inferior-io-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1002 'gdb-inferior-io-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1003 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1004 (defun gdb-inferior-io-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1005 (concat "*input/output of " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1006 (gdb-get-target-string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1007 "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1008 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1009 (defun gdb-display-separate-io-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1010 "Display IO of debugged program in a separate window." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1011 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1012 (if gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1013 (gdb-display-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1014 (gdb-get-buffer-create 'gdb-inferior-io) t))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1015 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1016 (defconst gdb-frame-parameters |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1017 '((height . 14) (width . 80) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1018 (unsplittable . t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1019 (tool-bar-lines . nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1020 (menu-bar-lines . nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1021 (minibuffer . nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1022 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1023 (defun gdb-frame-separate-io-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1024 "Display IO of debugged program in a new frame." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1025 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1026 (if gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1027 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1028 (special-display-frame-alist gdb-frame-parameters)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1029 (display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1030 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1031 (defvar gdb-inferior-io-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1032 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1033 (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1034 (define-key map "\C-c\C-z" 'gdb-separate-io-stop) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1035 (define-key map "\C-c\C-\\" 'gdb-separate-io-quit) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1036 (define-key map "\C-c\C-d" 'gdb-separate-io-eof) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1037 (define-key map "\C-d" 'gdb-separate-io-eof) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1038 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1039 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1040 (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1041 "Major mode for gdb inferior-io." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1042 :syntax-table nil :abbrev-table nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1043 ;; We want to use comint because it has various nifty and familiar |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1044 ;; features. We don't need a process, but comint wants one, so create |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1045 ;; a dummy one. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1046 (make-comint-in-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1047 "gdb-inferior" (current-buffer) "sleep" nil "1000000000")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1048 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1049 (defun gdb-inferior-filter (proc string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1050 (unless (string-equal string "") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1051 (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1052 (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1053 (insert-before-markers string))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1054 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1055 (defun gdb-separate-io-interrupt () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1056 "Interrupt the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1057 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1058 (interrupt-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1059 (get-buffer-process gud-comint-buffer) comint-ptyp)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1060 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1061 (defun gdb-separate-io-quit () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1062 "Send quit signal to the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1063 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1064 (quit-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1065 (get-buffer-process gud-comint-buffer) comint-ptyp)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1066 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1067 (defun gdb-separate-io-stop () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1068 "Stop the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1069 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1070 (stop-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1071 (get-buffer-process gud-comint-buffer) comint-ptyp)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1072 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1073 (defun gdb-separate-io-eof () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1074 "Send end-of-file to the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1075 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1076 (process-send-eof |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1077 (get-buffer-process gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1078 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1079 (defun gdb-clear-inferior-io () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1080 (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1081 (erase-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1082 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1083 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1084 (defconst breakpoint-xpm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1085 "/* XPM */ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1086 static char *magick[] = { |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1087 /* columns rows colors chars-per-pixel */ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1088 \"10 10 2 1\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1089 \" c red\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1090 \"+ c None\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1091 /* pixels */ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1092 \"+++ +++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1093 \"++ ++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1094 \"+ +\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1095 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1096 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1097 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1098 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1099 \"+ +\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1100 \"++ ++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1101 \"+++ +++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1102 };" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1103 "XPM data used for breakpoint icon.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1104 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1105 (defconst breakpoint-enabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1106 "P1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1107 10 10\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1108 0 0 0 0 1 1 1 1 0 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1109 0 0 0 1 1 1 1 1 1 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1110 0 0 1 1 1 1 1 1 1 1 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1111 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1112 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1113 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1114 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1115 0 0 1 1 1 1 1 1 1 1 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1116 0 0 0 1 1 1 1 1 1 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1117 0 0 0 0 1 1 1 1 0 0 0 0" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1118 "PBM data used for enabled breakpoint icon.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1119 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1120 (defconst breakpoint-disabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1121 "P1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1122 10 10\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1123 0 0 1 0 1 0 1 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1124 0 1 0 1 0 1 0 1 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1125 1 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1126 0 1 0 1 0 1 0 1 0 1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1127 1 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1128 0 1 0 1 0 1 0 1 0 1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1129 1 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1130 0 1 0 1 0 1 0 1 0 1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1131 0 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1132 0 0 0 1 0 1 0 1 0 0" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1133 "PBM data used for disabled breakpoint icon.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1134 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1135 (defvar breakpoint-enabled-icon nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1136 "Icon for enabled breakpoint in display margin.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1137 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1138 (defvar breakpoint-disabled-icon nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1139 "Icon for disabled breakpoint in display margin.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1140 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1141 (declare-function define-fringe-bitmap "fringe.c" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1142 (bitmap bits &optional height width align)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1143 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1144 (and (display-images-p) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1145 ;; Bitmap for breakpoint in fringe |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1146 (define-fringe-bitmap 'breakpoint |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1147 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1148 ;; Bitmap for gud-overlay-arrow in fringe |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1149 (define-fringe-bitmap 'hollow-right-triangle |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1150 "\xe0\x90\x88\x84\x84\x88\x90\xe0")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1151 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1152 (defface breakpoint-enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1153 '((t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1154 :foreground "red1" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1155 :weight bold)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1156 "Face for enabled breakpoint icon in fringe." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1157 :group 'gdb) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1158 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1159 (defface breakpoint-disabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1160 '((((class color) (min-colors 88)) :foreground "grey70") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1161 ;; Ensure that on low-color displays that we end up something visible. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1162 (((class color) (min-colors 8) (background light)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1163 :foreground "black") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1164 (((class color) (min-colors 8) (background dark)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1165 :foreground "white") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1166 (((type tty) (class mono)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1167 :inverse-video t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1168 (t :background "gray")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1169 "Face for disabled breakpoint icon in fringe." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1170 :group 'gdb) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1171 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1172 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1173 (defun gdb-send (proc string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1174 "A comint send filter for gdb." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1175 (with-current-buffer gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1176 (let ((inhibit-read-only t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1177 (remove-text-properties (point-min) (point-max) '(face)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1178 ;; mimic <RET> key to repeat previous command in GDB |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1179 (if (not (string-match "^\\s+$" string)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1180 (setq gdb-last-command string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1181 (if gdb-last-command (setq string gdb-last-command))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1182 (if gdb-enable-debug |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1183 (push (cons 'mi-send (concat string "\n")) gdb-debug-log)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1184 (if (string-match "^-" string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1185 ;; MI command |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1186 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1187 (setq gdb-first-done-or-error t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1188 (process-send-string proc (concat string "\n"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1189 ;; CLI command |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1190 (if (string-match "\\\\$" string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1191 (setq gdb-continuation (concat gdb-continuation string "\n")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1192 (setq gdb-first-done-or-error t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1193 (process-send-string proc (concat "-interpreter-exec console \"" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1194 gdb-continuation string "\"\n")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1195 (setq gdb-continuation nil)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1196 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1197 (defun gdb-input (item) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1198 (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1199 (setq gdb-token-number (1+ gdb-token-number)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1200 (setcar item (concat (number-to-string gdb-token-number) (car item))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1201 (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1202 (process-send-string (get-buffer-process gud-comint-buffer) |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1203 (concat (car item) "\n"))) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1204 |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1205 (defmacro gdb-current-context-command (command) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1206 "Add --thread option to gdb COMMAND. |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1207 |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1208 Option value is taken from `gdb-thread-number'." |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1209 (concat command " --thread " gdb-thread-number)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1210 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1211 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1212 (defcustom gud-gdb-command-name "gdb -i=mi" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1213 "Default command to execute an executable under the GDB debugger." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1214 :type 'string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1215 :group 'gdb) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1216 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1217 (defun gdb-resync() |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1218 (setq gud-running nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1219 (setq gdb-output-sink 'user) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1220 (setq gdb-pending-triggers nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1221 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1222 (defun gdb-update () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1223 "Update buffers showing status of debug session." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1224 (when gdb-first-prompt |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1225 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1226 (propertize "initializing..." 'face font-lock-variable-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1227 (gdb-init-1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1228 (setq gdb-first-prompt nil)) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1229 ;; We may need to update gdb-thread-number, so we call threads buffer |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1230 (gdb-get-buffer-create 'gdb-threads-buffer) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1231 (gdb-invalidate-threads) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1232 (gdb-get-selected-frame) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1233 (gdb-invalidate-frames) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1234 ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1235 (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1236 (gdb-invalidate-breakpoints) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1237 (gdb-get-changed-registers) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1238 (gdb-invalidate-registers) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1239 (gdb-invalidate-locals) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1240 (gdb-invalidate-memory) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1241 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1242 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1243 (setcar (nthcdr 5 var) nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1244 (gdb-var-update))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1245 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1246 ;; GUD displays the selected GDB frame. This might might not be the current |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1247 ;; GDB frame (after up, down etc). If no GDB frame is visible but the last |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1248 ;; visited breakpoint is, use that window. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1249 (defun gdb-display-source-buffer (buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1250 (let* ((last-window (if gud-last-last-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1251 (get-buffer-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1252 (gud-find-file (car gud-last-last-frame))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1253 (source-window (or last-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1254 (if (and gdb-source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1255 (window-live-p gdb-source-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1256 gdb-source-window)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1257 (when source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1258 (setq gdb-source-window source-window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1259 (set-window-buffer source-window buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1260 source-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1261 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1262 (defun gdb-car< (a b) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1263 (< (car a) (car b))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1264 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1265 (defvar gdbmi-record-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1266 '((gdb-gdb . "(gdb) \n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1267 (gdb-done . "\\([0-9]*\\)\\^done,?\\(.*?\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1268 (gdb-starting . "\\([0-9]*\\)\\^running\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1269 (gdb-error . "\\([0-9]*\\)\\^error,\\(.*?\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1270 (gdb-console . "~\\(\".*?\"\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1271 (gdb-internals . "&\\(\".*?\"\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1272 (gdb-stopped . "\\*stopped,?\\(.*?\n\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1273 (gdb-running . "\\*running,\\(.*?\n\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1274 (gdb-thread-created . "=thread-created,\\(.*?\n\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1275 (gdb-thread-exited . "=thread-exited,\\(.*?\n\\)"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1276 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1277 (defun gud-gdbmi-marker-filter (string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1278 "Filter GDB/MI output." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1279 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1280 ;; Record transactions if logging is enabled. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1281 (when gdb-enable-debug |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1282 (push (cons 'recv string) gdb-debug-log) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1283 (if (and gdb-debug-log-max |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1284 (> (length gdb-debug-log) gdb-debug-log-max)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1285 (setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1286 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1287 ;; Recall the left over gud-marker-acc from last time |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1288 (setq gud-marker-acc (concat gud-marker-acc string)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1289 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1290 ;; Start accumulating output for the GUD buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1291 (setq gdb-filter-output "") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1292 (let ((output-record) (output-record-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1293 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1294 ;; Process all the complete markers in this chunk. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1295 (dolist (gdbmi-record gdbmi-record-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1296 (while (string-match (cdr gdbmi-record) gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1297 (push (list (match-beginning 0) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1298 (car gdbmi-record) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1299 (match-string 1 gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1300 (match-string 2 gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1301 (match-end 0)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1302 output-record-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1303 (setq gud-marker-acc |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1304 (concat (substring gud-marker-acc 0 (match-beginning 0)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1305 ;; Pad with spaces to preserve position. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1306 (make-string (length (match-string 0 gud-marker-acc)) 32) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1307 (substring gud-marker-acc (match-end 0)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1308 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1309 (setq output-record-list (sort output-record-list 'gdb-car<)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1310 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1311 (dolist (output-record output-record-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1312 (let ((record-type (cadr output-record)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1313 (arg1 (nth 2 output-record)) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1314 (arg2 (nth 3 output-record))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1315 (if (eq record-type 'gdb-error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1316 (gdb-done-or-error arg2 arg1 'error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1317 (if (eq record-type 'gdb-done) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1318 (gdb-done-or-error arg2 arg1 'done) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1319 ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1320 ;; error message on internal stream. Don't print to GUD buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1321 (unless (and (eq record-type 'gdb-internals) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1322 (string-equal (read arg1) "No registers.\n")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1323 (funcall record-type arg1)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1324 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1325 (setq gdb-output-sink 'user) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1326 ;; Remove padding. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1327 (string-match "^ *" gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1328 (setq gud-marker-acc (substring gud-marker-acc (match-end 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1329 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1330 gdb-filter-output)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1331 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1332 (defun gdb-gdb (output-field)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1333 (defun gdb-thread-created (output-field)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1334 (defun gdb-thread-exited (output-field)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1335 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1336 (defun gdb-running (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1337 (setq gdb-inferior-status "running") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1338 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1339 (propertize gdb-inferior-status 'face font-lock-type-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1340 (setq gdb-active-process t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1341 (setq gud-running t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1342 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1343 (defun gdb-starting (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1344 ;; CLI commands don't emit ^running at the moment so use gdb-running too. |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1345 (gdb-input |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1346 (list "-data-list-register-names" 'gdb-get-register-names)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1347 (setq gdb-inferior-status "running") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1348 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1349 (propertize gdb-inferior-status 'face font-lock-type-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1350 (setq gdb-active-process t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1351 (setq gud-running t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1352 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1353 ;; -break-insert -t didn't give a reason before gdb 6.9 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1354 (defconst gdb-stopped-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1355 "\\(reason=\"\\(.*?\\)\"\\)?\\(\\(,exit-code=.*?\\)*\n\\|.*?,file=\".*?\".*?,fullname=\"\\(.*?\\)\".*?,line=\"\\(.*?\\)\".*?\n\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1356 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1357 (defun gdb-stopped (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1358 (setq gud-running nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1359 (string-match gdb-stopped-regexp output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1360 (let ((reason (match-string 2 output-field)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1361 (file (match-string 5 output-field))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1362 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1363 ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1364 ;;; because synchronous GDB doesn't give these fields with CLI. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1365 ;;; (when file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1366 ;;; (setq |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1367 ;;; ;; Extract the frame position from the marker. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1368 ;;; gud-last-frame (cons file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1369 ;;; (string-to-number |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1370 ;;; (match-string 6 gud-marker-acc))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1371 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1372 (setq gdb-inferior-status (if reason reason "unknown")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1373 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1374 (propertize gdb-inferior-status 'face font-lock-warning-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1375 (if (string-equal reason "exited-normally") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1376 (setq gdb-active-process nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1377 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1378 (when gdb-first-done-or-error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1379 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1380 (gdb-update) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1381 (setq gdb-first-done-or-error nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1382 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1383 ;; Remove the trimmings from log stream containing debugging messages |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1384 ;; being produced by GDB's internals, use warning face and send to GUD |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1385 ;; buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1386 (defun gdb-internals (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1387 (setq gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1388 (gdb-concat-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1389 gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1390 (let ((error-message |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1391 (read output-field))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1392 (put-text-property |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1393 0 (length error-message) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1394 'face font-lock-warning-face |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1395 error-message) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1396 error-message)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1397 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1398 ;; Remove the trimmings from the console stream and send to GUD buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1399 ;; (frontend MI commands should not print to this stream) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1400 (defun gdb-console (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1401 (setq gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1402 (gdb-concat-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1403 gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1404 (read output-field)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1405 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1406 (defun gdb-done-or-error (output-field token-number type) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1407 (if (string-equal token-number "") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1408 ;; Output from command entered by user |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1409 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1410 (setq gdb-output-sink 'user) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1411 (setq token-number nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1412 ;; MI error - send to minibuffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1413 (when (eq type 'error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1414 ;; Skip "msg=" from `output-field' |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1415 (message (read (substring output-field 4))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1416 ;; Don't send to the console twice. (If it is a console error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1417 ;; it is also in the console stream.) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1418 (setq output-field nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1419 ;; Output from command from frontend. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1420 (setq gdb-output-sink 'emacs)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1421 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1422 (gdb-clear-partial-output) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1423 (when gdb-first-done-or-error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1424 (unless (or token-number gud-running) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1425 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1426 (gdb-update) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1427 (setq gdb-first-done-or-error nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1428 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1429 (setq gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1430 (gdb-concat-output gdb-filter-output output-field)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1431 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1432 (if token-number |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1433 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1434 (with-current-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1435 (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1436 (funcall |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1437 (cdr (assoc (string-to-number token-number) gdb-handler-alist)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1438 (setq gdb-handler-alist |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1439 (assq-delete-all token-number gdb-handler-alist))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1440 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1441 (defun gdb-concat-output (so-far new) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1442 (let ((sink gdb-output-sink)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1443 (cond |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1444 ((eq sink 'user) (concat so-far new)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1445 ((eq sink 'emacs) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1446 (gdb-append-to-partial-output new) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1447 so-far)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1448 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1449 (defun gdb-append-to-partial-output (string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1450 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1451 (goto-char (point-max)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1452 (insert string))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1453 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1454 (defun gdb-clear-partial-output () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1455 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1456 (erase-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1457 |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1458 (defun json-partial-output (&optional fix-key fix-list) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1459 "Parse gdb-partial-output-buffer with `json-read'. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1460 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1461 If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurences from |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1462 partial output. This is used to get rid of useless keys in lists |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1463 in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1464 -break-info are examples of MI commands which issue such |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1465 responses. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1466 |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1467 If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1468 \"FIX-LIST=[..]\" prior to parsing. This is used to fix broken |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1469 -break-info output when it contains breakpoint script field |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1470 incompatible with GDB/MI output syntax. |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1471 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1472 Note that GDB/MI output syntax is different from JSON both |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1473 cosmetically and (in some cases) structurally, so correct results |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1474 are not guaranteed." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1475 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1476 (goto-char (point-min)) |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1477 (when fix-key |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1478 (save-excursion |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1479 (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1480 (replace-match "" nil nil nil 1)))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1481 (when fix-list |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1482 (save-excursion |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1483 ;; Find positions of brackets which enclose broken list |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1484 (while (re-search-forward (concat fix-list "={\"") nil t) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1485 (let ((p1 (goto-char (- (point) 2))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1486 (p2 (progn (forward-sexp) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1487 (1- (point))))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1488 ;; Replace braces with brackets |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1489 (save-excursion |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1490 (goto-char p1) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1491 (delete-char 1) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1492 (insert "[") |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1493 (goto-char p2) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1494 (delete-char 1) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1495 (insert "]")))))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1496 (goto-char (point-min)) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1497 (insert "{") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1498 ;; Wrap field names in double quotes and replace equal sign with |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1499 ;; semicolon. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1500 ;; TODO: This breaks badly with foo= inside constants |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1501 (while (re-search-forward "\\([[:alpha:]-_]+\\)=" nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1502 (replace-match "\"\\1\":" nil nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1503 (goto-char (point-max)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1504 (insert "}") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1505 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1506 (let ((json-array-type 'list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1507 (json-read)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1508 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
1509 (defun gdb-pad-string (string padding) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
1510 (format (concat "%" (number-to-string padding) "s") string)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
1511 |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1512 (defalias 'gdb-get-field 'bindat-get-field) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1513 |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1514 (defun gdb-get-many-fields (struct &rest fields) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1515 "Return a list of FIELDS values from STRUCT." |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1516 (let ((values)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1517 (dolist (field fields values) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1518 (setq values (append values (list (gdb-get-field struct field))))))) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1519 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1520 ;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1521 ;; GDB-COMMAND is a string of such. OUTPUT-HANDLER is the function bound to the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1522 ;; current input. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1523 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1524 (defmacro def-gdb-auto-update-trigger (name demand-predicate gdb-command |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1525 output-handler) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1526 `(defun ,name (&optional ignored) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1527 (if (and ,demand-predicate |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1528 (not (member ',name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1529 gdb-pending-triggers))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1530 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1531 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1532 (list ,gdb-command ',output-handler)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1533 (push ',name gdb-pending-triggers))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1534 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1535 (defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1536 "Define a handler NAME for TRIGGER acting in BUF-KEY with CUSTOM-DEFUN. |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1537 |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1538 Delete TRIGGER from `gdb-pending-triggers', switch to gdb BUF-KEY |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1539 buffer using `gdb-get-buffer', erase it and evalueat |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1540 CUSTOM-DEFUN." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1541 `(defun ,name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1542 (setq gdb-pending-triggers |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1543 (delq ',trigger |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1544 gdb-pending-triggers)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1545 (let ((buf (gdb-get-buffer ',buf-key))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1546 (and buf |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1547 (with-current-buffer buf |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
1548 (let*((buffer-read-only nil)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1549 (erase-buffer) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1550 (,custom-defun))))))) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1551 |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1552 (defmacro def-gdb-auto-updated-buffer (buf-key |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1553 trigger-name gdb-command |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1554 output-handler-name custom-defun) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1555 "Define a trigger and its handler for buffers of type BUF-KEY. |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1556 |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1557 TRIGGER-NAME trigger is defined to send GDB-COMMAND if BUF-KEY |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1558 exists. |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1559 |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1560 OUTPUT-HANDLER-NAME handler uses customization of CUSTOM-DEFUN." |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1561 `(progn |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1562 (def-gdb-auto-update-trigger ,trigger-name |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1563 ;; The demand predicate: |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1564 (gdb-get-buffer ',buf-key) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1565 ,gdb-command |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1566 ,output-handler-name) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1567 (def-gdb-auto-update-handler ,output-handler-name |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1568 ,trigger-name ,buf-key ,custom-defun))) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1569 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1570 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1571 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1572 ;; Breakpoint buffer : This displays the output of `-break-list'. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1573 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1574 (gdb-set-buffer-rules 'gdb-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1575 'gdb-breakpoints-buffer-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1576 'gdb-breakpoints-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1577 |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1578 (def-gdb-auto-updated-buffer gdb-breakpoints-buffer |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1579 gdb-invalidate-breakpoints "-break-list" |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1580 gdb-breakpoints-list-handler gdb-breakpoints-list-handler-custom) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1581 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1582 (defun gdb-breakpoints-list-handler-custom () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1583 (setq gdb-pending-triggers (delq 'gdb-invalidate-breakpoints |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1584 gdb-pending-triggers)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1585 (let ((breakpoints-list (gdb-get-field |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
1586 (json-partial-output "bkpt" "script") |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1587 'BreakpointTable 'body))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1588 (setq gdb-breakpoints-list breakpoints-list) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1589 (insert "Num\tType\t\tDisp\tEnb\tHits\tAddr What\n") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1590 (dolist (breakpoint breakpoints-list) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1591 (insert |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1592 (concat |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1593 (gdb-get-field breakpoint 'number) "\t" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1594 (gdb-get-field breakpoint 'type) "\t" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1595 (gdb-get-field breakpoint 'disp) "\t" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1596 (let ((flag (gdb-get-field breakpoint 'enabled))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1597 (if (string-equal flag "y") |
103754
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1598 (propertize "y" 'face font-lock-warning-face) |
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1599 (propertize "n" 'face font-lock-type-face))) "\t" |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1600 (gdb-get-field breakpoint 'times) "\t" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1601 (gdb-get-field breakpoint 'addr))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1602 (let ((at (gdb-get-field breakpoint 'at))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1603 (cond ((not at) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1604 (progn |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1605 (insert |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1606 (concat " in " |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1607 (propertize (gdb-get-field breakpoint 'func) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1608 'face font-lock-function-name-face))) |
103754
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1609 (gdb-insert-frame-location breakpoint) |
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1610 (add-text-properties (line-beginning-position) |
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1611 (line-end-position) |
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1612 '(mouse-face highlight |
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1613 help-echo "mouse-2, RET: visit breakpoint")))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
1614 (at (insert (concat " " at))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1615 (t (insert (gdb-get-field breakpoint 'original-location))))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1616 (add-text-properties (line-beginning-position) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1617 (line-end-position) |
103754
b186b013ff68
* progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): y/n
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103753
diff
changeset
|
1618 `(gdb-breakpoint ,breakpoint)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1619 (newline)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1620 (gdb-place-breakpoints))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1621 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1622 ;; Put breakpoint icons in relevant margins (even those set in the GUD buffer). |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1623 (defun gdb-place-breakpoints () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1624 (let ((flag) (bptno)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1625 ;; Remove all breakpoint-icons in source buffers but not assembler buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1626 (dolist (buffer (buffer-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1627 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1628 (if (and (eq gud-minor-mode 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1629 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1630 (gdb-remove-breakpoint-icons (point-min) (point-max))))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1631 (dolist (breakpoint gdb-breakpoints-list) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1632 (let ((line (gdb-get-field breakpoint 'line))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1633 (when line |
104115
335df621bc5c
(gdb-place-breakpoints): Use full path when setting breakpoints.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104104
diff
changeset
|
1634 (let ((file (gdb-get-field breakpoint 'fullname)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1635 (flag (gdb-get-field breakpoint 'enabled)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1636 (bptno (gdb-get-field breakpoint 'number))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1637 (unless (file-exists-p file) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1638 (setq file (cdr (assoc bptno gdb-location-alist)))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1639 (if (and file |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1640 (not (string-equal file "File not found"))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1641 (with-current-buffer |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1642 (find-file-noselect file 'nowarn) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1643 (gdb-init-buffer) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1644 ;; Only want one breakpoint icon at each location. |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1645 (save-excursion |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1646 (goto-line (string-to-number line)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1647 (gdb-put-breakpoint-icon (string-equal flag "y") bptno))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1648 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1649 (list (concat "list " file ":1") |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1650 'ignore)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1651 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1652 (list "-file-list-exec-source-file" |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1653 `(lambda () (gdb-get-location |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1654 ,bptno ,line ,flag))))))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1655 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1656 (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1657 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1658 (defun gdb-get-location (bptno line flag) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1659 "Find the directory containing the relevant source file. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1660 Put in buffer and place breakpoint icon." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1661 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1662 (catch 'file-not-found |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1663 (if (re-search-forward gdb-source-file-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1664 (delete (cons bptno "File not found") gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1665 (push (cons bptno (match-string 1)) gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1666 (gdb-resync) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1667 (unless (assoc bptno gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1668 (push (cons bptno "File not found") gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1669 (message-box "Cannot find source file for breakpoint location. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1670 Add directory to search path for source files using the GDB command, dir.")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1671 (throw 'file-not-found nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1672 (with-current-buffer (find-file-noselect (match-string 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1673 (gdb-init-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1674 ;; only want one breakpoint icon at each location |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1675 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1676 (goto-line (string-to-number line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1677 (gdb-put-breakpoint-icon (eq flag ?y) bptno))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1678 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1679 (add-hook 'find-file-hook 'gdb-find-file-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1680 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1681 (defun gdb-find-file-hook () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1682 "Set up buffer for debugging if file is part of the source code |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1683 of the current session." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1684 (if (and (buffer-name gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1685 ;; in case gud or gdb-ui is just loaded |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1686 gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1687 (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1688 'gdbmi)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1689 (if (member buffer-file-name gdb-source-file-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1690 (with-current-buffer (find-buffer-visiting buffer-file-name) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1691 (gdb-init-buffer))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1692 |
103563 | 1693 (declare-function gud-remove "gdb-mi" t t) ; gud-def |
1694 (declare-function gud-break "gdb-mi" t t) ; gud-def | |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1695 (declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1696 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1697 (defun gdb-mouse-set-clear-breakpoint (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1698 "Set/clear breakpoint in left fringe/margin at mouse click. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1699 If not in a source or disassembly buffer just set point." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1700 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1701 (mouse-minibuffer-check event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1702 (let ((posn (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1703 (with-selected-window (posn-window posn) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
1704 (if (or (buffer-file-name) (eq major-mode 'gdb-disassembly-mode)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1705 (if (numberp (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1706 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1707 (goto-char (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1708 (if (or (posn-object posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1709 (eq (car (fringe-bitmaps-at-pos (posn-point posn))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1710 'breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1711 (gud-remove nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1712 (gud-break nil))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1713 (posn-set-point posn)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1714 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1715 (defun gdb-mouse-toggle-breakpoint-margin (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1716 "Enable/disable breakpoint in left margin with mouse click." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1717 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1718 (mouse-minibuffer-check event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1719 (let ((posn (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1720 (if (numberp (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1721 (with-selected-window (posn-window posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1722 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1723 (goto-char (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1724 (if (posn-object posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1725 (gud-basic-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1726 (let ((bptno (get-text-property |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1727 0 'gdb-bptno (car (posn-string posn))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1728 (concat |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1729 (if (get-text-property |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1730 0 'gdb-enabled (car (posn-string posn))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1731 "-break-disable " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1732 "-break-enable ") |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1733 bptno))))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1734 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1735 (defun gdb-mouse-toggle-breakpoint-fringe (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1736 "Enable/disable breakpoint in left fringe with mouse click." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1737 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1738 (mouse-minibuffer-check event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1739 (let* ((posn (event-end event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1740 (pos (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1741 obj) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1742 (when (numberp pos) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1743 (with-selected-window (posn-window posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1744 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1745 (set-buffer (window-buffer (selected-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1746 (goto-char pos) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1747 (dolist (overlay (overlays-in pos pos)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1748 (when (overlay-get overlay 'put-break) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1749 (setq obj (overlay-get overlay 'before-string)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1750 (when (stringp obj) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1751 (gud-basic-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1752 (concat |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1753 (if (get-text-property 0 'gdb-enabled obj) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1754 "-break-disable " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1755 "-break-enable ") |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1756 (get-text-property 0 'gdb-bptno obj))))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1757 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1758 (defun gdb-breakpoints-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
1759 (concat "*breakpoints of " (gdb-get-target-string) "*")) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1760 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1761 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1762 gdb-display-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1763 'gdb-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1764 "Display status of user-settable breakpoints.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1765 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1766 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1767 gdb-frame-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1768 'gdb-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1769 "Display status of user-settable breakpoints in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1770 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1771 (defvar gdb-breakpoints-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1772 (let ((map (make-sparse-keymap)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1773 (menu (make-sparse-keymap "Breakpoints"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1774 (define-key menu [quit] '("Quit" . gdb-delete-frame-or-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1775 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1776 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1777 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1778 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1779 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1780 (define-key map " " 'gdb-toggle-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1781 (define-key map "D" 'gdb-delete-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1782 ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1783 (define-key map "q" 'gdb-delete-frame-or-window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1784 (define-key map "\r" 'gdb-goto-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1785 (define-key map [mouse-2] 'gdb-goto-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1786 (define-key map [follow-link] 'mouse-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1787 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1788 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1789 (defun gdb-delete-frame-or-window () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1790 "Delete frame if there is only one window. Otherwise delete the window." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1791 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1792 (if (one-window-p) (delete-frame) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1793 (delete-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1794 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1795 ;;from make-mode-line-mouse-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1796 (defun gdb-make-header-line-mouse-map (mouse function) "\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1797 Return a keymap with single entry for mouse key MOUSE on the header line. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1798 MOUSE is defined to run function FUNCTION with no args in the buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1799 corresponding to the mode line clicked." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1800 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1801 (define-key map (vector 'header-line mouse) function) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1802 (define-key map (vector 'header-line 'down-mouse-1) 'ignore) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1803 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1804 |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1805 (defmacro gdb-propertize-header (name buffer help-echo mouse-face face) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1806 `(propertize ,name |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1807 'help-echo ,help-echo |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1808 'mouse-face ',mouse-face |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1809 'face ',face |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1810 'local-map |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1811 (gdb-make-header-line-mouse-map |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1812 'mouse-1 |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1813 (lambda (event) (interactive "e") |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1814 (save-selected-window |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1815 (select-window (posn-window (event-start event))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1816 (set-window-dedicated-p (selected-window) nil) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1817 (switch-to-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1818 (gdb-get-buffer-create ',buffer)) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1819 (setq header-line-format(gdb-set-header ',buffer)) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1820 (set-window-dedicated-p (selected-window) t)))))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1821 |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1822 (defun gdb-set-header (buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1823 (cond ((eq buffer 'gdb-locals-buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1824 (list |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1825 (gdb-propertize-header "Locals" gdb-locals-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1826 nil nil mode-line) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1827 " " |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1828 (gdb-propertize-header "Registers" gdb-registers-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1829 "mouse-1: select" mode-line-highlight mode-line-inactive))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1830 ((eq buffer 'gdb-registers-buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1831 (list |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1832 (gdb-propertize-header "Locals" gdb-locals-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1833 "mouse-1: select" mode-line-highlight mode-line-inactive) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1834 " " |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1835 (gdb-propertize-header "Registers" gdb-registers-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1836 nil nil mode-line))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1837 ((eq buffer 'gdb-breakpoints-buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1838 (list |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1839 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1840 nil nil mode-line) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1841 " " |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1842 (gdb-propertize-header "Threads" gdb-threads-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1843 "mouse-1: select" mode-line-highlight mode-line-inactive))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1844 ((eq buffer 'gdb-threads-buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1845 (list |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1846 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1847 "mouse-1: select" mode-line-highlight mode-line-inactive) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1848 " " |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1849 (gdb-propertize-header "Threads" gdb-threads-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1850 nil nil mode-line))))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
1851 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1852 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1853 ;; uses "-thread-info". Needs GDB 7.0 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1854 ;;; Threads view |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1855 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1856 (defun gdb-jump-to (file line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1857 (find-file-other-window file) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1858 (goto-line line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1859 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1860 (define-button-type 'gdb-file-button |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1861 'help-echo "Push to jump to source code" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1862 ; 'face 'bold |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1863 'action |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1864 (lambda (b) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1865 (gdb-jump-to (button-get b 'file) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1866 (button-get b 'line)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1867 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1868 (defun gdb-insert-file-location-button (file line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1869 "Insert text button which allows jumping to FILE:LINE. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1870 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1871 FILE is a full path." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1872 (insert-text-button |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1873 (format "%s:%d" (file-name-nondirectory file) line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1874 :type 'gdb-file-button |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1875 'file file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1876 'line line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1877 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1878 (defun gdb-threads-buffer-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1879 (concat "*threads of " (gdb-get-target-string) "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1880 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1881 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1882 gdb-display-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1883 'gdb-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1884 "Display GDB threads.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1885 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1886 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1887 gdb-frame-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1888 'gdb-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1889 "Display GDB threads in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1890 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1891 (gdb-set-buffer-rules 'gdb-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1892 'gdb-threads-buffer-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1893 'gdb-threads-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1894 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1895 (def-gdb-auto-updated-buffer gdb-threads-buffer |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1896 gdb-invalidate-threads "-thread-info" |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1897 gdb-thread-list-handler gdb-thread-list-handler-custom) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1898 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1899 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1900 (defvar gdb-threads-font-lock-keywords |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1901 '(("in \\([^ ]+\\) (" (1 font-lock-function-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1902 (" \\(stopped\\) in " (1 font-lock-warning-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1903 ("\\(\\(\\sw\\|[_.]\\)+\\)=" (1 font-lock-variable-name-face))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1904 "Font lock keywords used in `gdb-threads-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1905 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1906 (defvar gdb-threads-mode-map |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1907 (let ((map (make-sparse-keymap))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1908 (define-key map " " 'gdb-select-thread) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1909 map)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1910 |
103955
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1911 (defvar gdb-breakpoints-header |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1912 (list |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1913 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1914 nil nil mode-line) |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1915 " " |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1916 (gdb-propertize-header "Threads" gdb-threads-buffer |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1917 "mouse-1: select" mode-line-highlight mode-line-inactive))) |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
1918 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1919 (defun gdb-threads-mode () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1920 "Major mode for GDB threads. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1921 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1922 \\{gdb-threads-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1923 (kill-all-local-variables) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1924 (setq major-mode 'gdb-threads-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1925 (setq mode-name "Threads") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1926 (use-local-map gdb-threads-mode-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1927 (setq buffer-read-only t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1928 (buffer-disable-undo) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1929 (setq gdb-thread-position (make-marker)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1930 (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1931 (setq header-line-format gdb-breakpoints-header) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1932 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1933 '(gdb-threads-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1934 (run-mode-hooks 'gdb-threads-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1935 'gdb-invalidate-threads) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1936 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1937 (defun gdb-thread-list-handler-custom () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1938 (let* ((res (json-partial-output)) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1939 (threads-list (gdb-get-field res 'threads)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1940 (current-thread (gdb-get-field res 'current-thread-id))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1941 (when (and current-thread |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1942 (not (string-equal current-thread gdb-thread-number))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1943 ;; Implicitly switch thread (in case previous one dies) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1944 (message (concat "GDB switched to another thread: " current-thread)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1945 (setq gdb-thread-number current-thread)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1946 (set-marker gdb-thread-position nil) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1947 (dolist (thread threads-list) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1948 (insert (apply 'format `("%s (%s) %s in %s " |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1949 ,@(gdb-get-many-fields thread 'id 'target-id 'state) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1950 ,(gdb-get-field thread 'frame 'func)))) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1951 ;; Arguments |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1952 (insert "(") |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1953 (let ((args (gdb-get-field thread 'frame 'args))) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1954 (dolist (arg args) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1955 (insert (apply 'format `("%s=%s" ,@(gdb-get-many-fields arg 'name 'value))))) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1956 (when args (kill-backward-chars 1))) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1957 (insert ")") |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
1958 (gdb-insert-frame-location (gdb-get-field thread 'frame)) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1959 (insert (format " at %s" (gdb-get-field thread 'frame 'addr))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1960 (add-text-properties (line-beginning-position) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1961 (line-end-position) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1962 `(gdb-thread ,thread)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1963 (when (string-equal gdb-thread-number |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1964 (gdb-get-field thread 'id)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1965 (set-marker gdb-thread-position (line-beginning-position))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1966 (newline)))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1967 |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1968 (defun gdb-select-thread () |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1969 "Select the thread at current line of threads buffer." |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1970 (interactive) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1971 (save-excursion |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1972 (beginning-of-line) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1973 (let ((thread (get-text-property (point) 'gdb-thread))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1974 (if thread |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1975 (if (string-equal (gdb-get-field thread 'state) "running") |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1976 (error "Cannot select running thread") |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1977 (let ((new-id (gdb-get-field thread 'id))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1978 (setq gdb-thread-number new-id) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1979 (gud-basic-call (concat "-thread-select " new-id)))) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1980 (error "Not recognized as thread line"))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1981 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1982 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1983 ;;; Memory view |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1984 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1985 (defcustom gdb-memory-rows 8 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1986 "Number of data rows in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1987 :type 'integer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1988 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1989 :version "23.2") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1990 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1991 (defcustom gdb-memory-columns 4 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1992 "Number of data columns in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1993 :type 'integer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1994 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1995 :version "23.2") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1996 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1997 (defcustom gdb-memory-format "x" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1998 "Display format of data items in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
1999 :type '(choice (const :tag "Hexadecimal" "x") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2000 (const :tag "Signed decimal" "d") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2001 (const :tag "Unsigned decimal" "u") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2002 (const :tag "Octal" "o") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2003 (const :tag "Binary" "t")) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2004 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2005 :version "22.1") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2006 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2007 (defcustom gdb-memory-unit 4 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2008 "Unit size of data items in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2009 :type '(choice (const :tag "Byte" 1) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2010 (const :tag "Halfword" 2) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2011 (const :tag "Word" 4) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2012 (const :tag "Giant word" 8)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2013 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2014 :version "23.2") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2015 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2016 (gdb-set-buffer-rules 'gdb-memory-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2017 'gdb-memory-buffer-name |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2018 'gdb-memory-mode) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2019 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2020 (def-gdb-auto-updated-buffer gdb-memory-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2021 gdb-invalidate-memory |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2022 (format "-data-read-memory %s %s %d %d %d" |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2023 gdb-memory-address |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2024 gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2025 gdb-memory-unit |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2026 gdb-memory-rows |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2027 gdb-memory-columns) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2028 gdb-read-memory-handler |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2029 gdb-read-memory-custom) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2030 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2031 (defun gdb-memory-column-width (size format) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2032 "Return length of string with memory unit of SIZE in FORMAT. |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2033 |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2034 SIZE is in bytes, as in `gdb-memory-unit'. FORMAT is a string as |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2035 in `gdb-memory-format'." |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2036 (let ((format-base (cdr (assoc format |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2037 '(("x" . 16) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2038 ("d" . 10) ("u" . 10) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2039 ("o" . 8) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2040 ("t" . 2)))))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2041 (if format-base |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2042 (let ((res (ceiling (log (expt 2.0 (* size 8)) format-base)))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2043 (cond ((string-equal format "x") |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2044 (+ 2 res)) ; hexadecimal numbers have 0x in front |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2045 ((or (string-equal format "d") |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2046 (string-equal format "o")) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2047 (1+ res)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2048 (t res))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2049 (error "Unknown format")))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2050 |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2051 (defun gdb-read-memory-custom () |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2052 (let* ((res (json-partial-output)) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2053 (err-msg (gdb-get-field res 'msg))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2054 (if (not err-msg) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2055 (let ((memory (gdb-get-field res 'memory))) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2056 (setq gdb-memory-address (gdb-get-field res 'addr)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2057 (setq gdb-memory-next-page (gdb-get-field res 'next-page)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2058 (setq gdb-memory-prev-page (gdb-get-field res 'prev-page)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2059 (setq gdb-memory-last-address gdb-memory-address) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2060 (dolist (row memory) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2061 (insert (concat (gdb-get-field row 'addr) ":")) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2062 (dolist (column (gdb-get-field row 'data)) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2063 (insert (gdb-pad-string column |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2064 (+ 2 (gdb-memory-column-width |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2065 gdb-memory-unit |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2066 gdb-memory-format))))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2067 (newline))) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2068 ;; Show last page instead of empty buffer when out of bounds |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2069 (progn |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2070 (let ((gdb-memory-address gdb-memory-last-address)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2071 (gdb-invalidate-memory) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2072 (error err-msg)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2073 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2074 (defvar gdb-memory-mode-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2075 (let ((map (make-sparse-keymap))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2076 (suppress-keymap map t) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2077 (define-key map "q" 'kill-this-buffer) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2078 (define-key map "n" 'gdb-memory-show-next-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2079 (define-key map "p" 'gdb-memory-show-previous-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2080 (define-key map "a" 'gdb-memory-set-address) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2081 (define-key map "t" 'gdb-memory-format-binary) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2082 (define-key map "o" 'gdb-memory-format-octal) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2083 (define-key map "u" 'gdb-memory-format-unsigned) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2084 (define-key map "d" 'gdb-memory-format-signed) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2085 (define-key map "x" 'gdb-memory-format-hexadecimal) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2086 (define-key map "b" 'gdb-memory-unit-byte) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2087 (define-key map "h" 'gdb-memory-unit-halfword) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2088 (define-key map "w" 'gdb-memory-unit-word) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2089 (define-key map "g" 'gdb-memory-unit-giant) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2090 (define-key map "R" 'gdb-memory-set-rows) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2091 (define-key map "C" 'gdb-memory-set-columns) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2092 map)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2093 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2094 (defun gdb-memory-set-address-event (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2095 "Handle a click on address field in memory buffer header." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2096 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2097 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2098 (select-window (posn-window (event-start event))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2099 (gdb-memory-set-address))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2100 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2101 ;; Non-event version for use within keymap |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2102 (defun gdb-memory-set-address () |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2103 "Set the start memory address." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2104 (interactive) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2105 (let ((arg (read-from-minibuffer "Memory address: "))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2106 (setq gdb-memory-address arg)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2107 (gdb-invalidate-memory)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2108 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2109 (defmacro def-gdb-set-positive-number (name variable echo-string &optional doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2110 "Define a function NAME which reads new VAR value from minibuffer." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2111 `(defun ,name (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2112 ,(when doc doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2113 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2114 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2115 (select-window (posn-window (event-start event))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2116 (let* ((arg (read-from-minibuffer ,echo-string)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2117 (count (string-to-number arg))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2118 (if (<= count 0) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2119 (error "Positive number only") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2120 (customize-set-variable ',variable count) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2121 (gdb-invalidate-memory)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2122 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2123 (def-gdb-set-positive-number |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2124 gdb-memory-set-rows |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2125 gdb-memory-rows |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2126 "Rows: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2127 "Set the number of data rows in memory window.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2128 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2129 (def-gdb-set-positive-number |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2130 gdb-memory-set-columns |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2131 gdb-memory-columns |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2132 "Columns: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2133 "Set the number of data columns in memory window.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2134 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2135 (defmacro def-gdb-memory-format (name format doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2136 "Define a function NAME to switch memory buffer to use FORMAT. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2137 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2138 DOC is an optional documentation string." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2139 `(defun ,name () ,(when doc doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2140 (interactive) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2141 (customize-set-variable 'gdb-memory-format ,format) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2142 (gdb-invalidate-memory))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2143 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2144 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2145 gdb-memory-format-binary "t" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2146 "Set the display format to binary.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2147 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2148 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2149 gdb-memory-format-octal "o" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2150 "Set the display format to octal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2151 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2152 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2153 gdb-memory-format-unsigned "u" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2154 "Set the display format to unsigned decimal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2155 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2156 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2157 gdb-memory-format-signed "d" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2158 "Set the display format to decimal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2159 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2160 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2161 gdb-memory-format-hexadecimal "x" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2162 "Set the display format to hexadecimal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2163 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2164 (defvar gdb-memory-format-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2165 (let ((map (make-sparse-keymap))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2166 (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2167 map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2168 "Keymap to select format in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2169 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2170 (defvar gdb-memory-format-menu (make-sparse-keymap "Format") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2171 "Menu of display formats in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2172 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2173 (define-key gdb-memory-format-menu [binary] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2174 '(menu-item "Binary" gdb-memory-format-binary |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2175 :button (:radio . (equal gdb-memory-format "t")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2176 (define-key gdb-memory-format-menu [octal] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2177 '(menu-item "Octal" gdb-memory-format-octal |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2178 :button (:radio . (equal gdb-memory-format "o")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2179 (define-key gdb-memory-format-menu [unsigned] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2180 '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2181 :button (:radio . (equal gdb-memory-format "u")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2182 (define-key gdb-memory-format-menu [signed] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2183 '(menu-item "Signed Decimal" gdb-memory-format-signed |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2184 :button (:radio . (equal gdb-memory-format "d")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2185 (define-key gdb-memory-format-menu [hexadecimal] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2186 '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2187 :button (:radio . (equal gdb-memory-format "x")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2188 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2189 (defun gdb-memory-format-menu (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2190 (interactive "@e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2191 (x-popup-menu event gdb-memory-format-menu)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2192 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2193 (defun gdb-memory-format-menu-1 (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2194 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2195 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2196 (select-window (posn-window (event-start event))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2197 (let* ((selection (gdb-memory-format-menu event)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2198 (binding (and selection (lookup-key gdb-memory-format-menu |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2199 (vector (car selection)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2200 (if binding (call-interactively binding))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2201 |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2202 (defmacro def-gdb-memory-unit (name unit-size doc) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2203 "Define a function NAME to switch memory unit size to UNIT-SIZE. |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2204 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2205 DOC is an optional documentation string." |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2206 `(defun ,name () ,(when doc doc) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2207 (interactive) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2208 (customize-set-variable 'gdb-memory-unit ,unit-size) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2209 (gdb-invalidate-memory))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2210 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2211 (def-gdb-memory-unit gdb-memory-unit-giant 8 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2212 "Set the unit size to giant words (eight bytes).") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2213 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2214 (def-gdb-memory-unit gdb-memory-unit-word 4 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2215 "Set the unit size to words (four bytes).") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2216 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2217 (def-gdb-memory-unit gdb-memory-unit-halfword 2 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2218 "Set the unit size to halfwords (two bytes).") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2219 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2220 (def-gdb-memory-unit gdb-memory-unit-byte 1 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2221 "Set the unit size to bytes.") |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2222 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2223 (defmacro def-gdb-memory-show-page (name address-var &optional doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2224 "Define a function NAME which show new address in memory buffer. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2225 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2226 The defined function switches Memory buffer to show address |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2227 stored in ADDRESS-VAR variable. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2228 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2229 DOC is an optional documentation string." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2230 `(defun ,name |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2231 ,(when doc doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2232 (interactive) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2233 (let ((gdb-memory-address ,address-var)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2234 (gdb-invalidate-memory)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2235 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2236 (def-gdb-memory-show-page gdb-memory-show-previous-page |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2237 gdb-memory-prev-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2238 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2239 (def-gdb-memory-show-page gdb-memory-show-next-page |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2240 gdb-memory-next-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2241 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2242 (defvar gdb-memory-unit-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2243 (let ((map (make-sparse-keymap))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2244 (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2245 map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2246 "Keymap to select units in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2247 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2248 (defvar gdb-memory-unit-menu (make-sparse-keymap "Unit") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2249 "Menu of units in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2250 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2251 (define-key gdb-memory-unit-menu [giantwords] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2252 '(menu-item "Giant words" gdb-memory-unit-giant |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2253 :button (:radio . (equal gdb-memory-unit 8)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2254 (define-key gdb-memory-unit-menu [words] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2255 '(menu-item "Words" gdb-memory-unit-word |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2256 :button (:radio . (equal gdb-memory-unit 4)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2257 (define-key gdb-memory-unit-menu [halfwords] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2258 '(menu-item "Halfwords" gdb-memory-unit-halfword |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2259 :button (:radio . (equal gdb-memory-unit 2)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2260 (define-key gdb-memory-unit-menu [bytes] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2261 '(menu-item "Bytes" gdb-memory-unit-byte |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2262 :button (:radio . (equal gdb-memory-unit 1)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2263 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2264 (defun gdb-memory-unit-menu (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2265 (interactive "@e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2266 (x-popup-menu event gdb-memory-unit-menu)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2267 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2268 (defun gdb-memory-unit-menu-1 (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2269 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2270 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2271 (select-window (posn-window (event-start event))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2272 (let* ((selection (gdb-memory-unit-menu event)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2273 (binding (and selection (lookup-key gdb-memory-unit-menu |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2274 (vector (car selection)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2275 (if binding (call-interactively binding))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2276 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2277 (defvar gdb-memory-font-lock-keywords |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2278 '(;; <__function.name+n> |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2279 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2280 ) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2281 "Font lock keywords used in `gdb-memory-mode'.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2282 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2283 (defvar gdb-memory-header |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2284 '(:eval |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2285 (concat |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2286 "Start address[" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2287 (propertize "-" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2288 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2289 'help-echo "mouse-1: decrement address" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2290 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2291 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2292 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2293 #'gdb-memory-show-previous-page)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2294 "|" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2295 (propertize "+" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2296 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2297 'help-echo "mouse-1: increment address" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2298 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2299 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2300 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2301 #'gdb-memory-show-next-page)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2302 "]: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2303 (propertize gdb-memory-address |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2304 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2305 'help-echo "mouse-1: set start address" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2306 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2307 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2308 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2309 #'gdb-memory-set-address-event)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2310 " Rows: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2311 (propertize (number-to-string gdb-memory-rows) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2312 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2313 'help-echo "mouse-1: set number of columns" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2314 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2315 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2316 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2317 #'gdb-memory-set-rows)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2318 " Columns: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2319 (propertize (number-to-string gdb-memory-columns) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2320 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2321 'help-echo "mouse-1: set number of columns" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2322 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2323 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2324 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2325 #'gdb-memory-set-columns)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2326 " Display Format: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2327 (propertize gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2328 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2329 'help-echo "mouse-3: select display format" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2330 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2331 'local-map gdb-memory-format-map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2332 " Unit Size: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2333 (propertize (number-to-string gdb-memory-unit) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2334 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2335 'help-echo "mouse-3: select unit size" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2336 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2337 'local-map gdb-memory-unit-map))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2338 "Header line used in `gdb-memory-mode'.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2339 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2340 (defun gdb-memory-mode () |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2341 "Major mode for examining memory. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2342 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2343 \\{gdb-memory-mode-map}" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2344 (kill-all-local-variables) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2345 (setq major-mode 'gdb-memory-mode) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2346 (setq mode-name "Memory") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2347 (use-local-map gdb-memory-mode-map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2348 (setq buffer-read-only t) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2349 (setq header-line-format gdb-memory-header) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2350 (set (make-local-variable 'font-lock-defaults) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2351 '(gdb-memory-font-lock-keywords)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2352 (run-mode-hooks 'gdb-memory-mode-hook) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2353 'gdb-invalidate-memory) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2354 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2355 (defun gdb-memory-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2356 (concat "*memory of " (gdb-get-target-string) "*")) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2357 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2358 (def-gdb-display-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2359 gdb-display-memory-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2360 'gdb-memory-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2361 "Display memory contents.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2362 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2363 (defun gdb-frame-memory-buffer () |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2364 "Display memory contents in a new frame." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2365 (interactive) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2366 (let* ((special-display-regexps (append special-display-regexps '(".*"))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2367 (special-display-frame-alist |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2368 `((left-fringe . 0) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2369 (right-fringe . 0) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2370 (width . 83) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2371 ,@gdb-frame-parameters))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2372 (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2373 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2374 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2375 ;;; Disassembly view |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2376 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2377 (defun gdb-disassembly-buffer-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2378 (concat "*disassembly of " (gdb-get-target-string) "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2379 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2380 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2381 gdb-display-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2382 'gdb-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2383 "Display disassembly for current stack frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2384 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2385 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2386 gdb-frame-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2387 'gdb-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2388 "Display disassembly in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2389 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2390 (gdb-set-buffer-rules 'gdb-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2391 'gdb-disassembly-buffer-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2392 'gdb-disassembly-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2393 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2394 (def-gdb-auto-update-trigger gdb-invalidate-disassembly |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2395 (gdb-get-buffer 'gdb-disassembly-buffer) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2396 (let ((file (or gdb-selected-file gdb-main-file)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2397 (line (or gdb-selected-line 1))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2398 (if (not file) (error "Disassembly invalidated with no file selected.") |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2399 (format "-data-disassemble -f %s -l %d -n -1 -- 0" file line))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2400 gdb-disassembly-handler) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2401 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2402 (def-gdb-auto-update-handler |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2403 gdb-disassembly-handler |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2404 gdb-invalidate-disassembly |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2405 gdb-disassembly-buffer |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2406 gdb-disassembly-handler-custom) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2407 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2408 (defvar gdb-disassembly-font-lock-keywords |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2409 '(;; <__function.name+n> |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2410 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2411 (1 font-lock-function-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2412 ;; 0xNNNNNNNN <__function.name+n>: opcode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2413 ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2414 (4 font-lock-keyword-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2415 ;; %register(at least i386) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2416 ("%\\sw+" . font-lock-variable-name-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2417 ("^\\(Dump of assembler code for function\\) \\(.+\\):" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2418 (1 font-lock-comment-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2419 (2 font-lock-function-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2420 ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2421 "Font lock keywords used in `gdb-disassembly-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2422 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2423 (defvar gdb-disassembly-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2424 ;; TODO |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2425 (let ((map (make-sparse-keymap))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2426 (suppress-keymap map) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2427 (define-key map "q" 'kill-this-buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2428 map)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2429 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2430 (defun gdb-disassembly-mode () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2431 "Major mode for GDB disassembly information. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2432 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2433 \\{gdb-disassembly-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2434 (kill-all-local-variables) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2435 (setq major-mode 'gdb-disassembly-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2436 (setq mode-name "Disassembly") |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2437 (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2438 (setq fringes-outside-margins t) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2439 (setq gdb-overlay-arrow-position (make-marker)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2440 (use-local-map gdb-disassembly-mode-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2441 (setq buffer-read-only t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2442 (buffer-disable-undo) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2443 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2444 '(gdb-disassembly-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2445 (run-mode-hooks 'gdb-disassembly-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2446 'gdb-invalidate-disassembly) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2447 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2448 (defun gdb-disassembly-handler-custom () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2449 (let* ((res (json-partial-output)) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2450 (instructions (gdb-get-field res 'asm_insns)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2451 (pos 1)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2452 (let* ((last-instr (car (last instructions))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2453 (column-padding (+ 2 (string-width |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2454 (apply 'format |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2455 `("<%s+%s>:" |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2456 ,@(gdb-get-many-fields last-instr 'func-name 'offset))))))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2457 (dolist (instr instructions) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2458 ;; Put overlay arrow |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2459 (when (string-equal (gdb-get-field instr 'address) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2460 gdb-pc-address) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2461 (progn |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2462 (setq pos (point)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2463 (setq fringe-indicator-alist |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2464 (if (string-equal gdb-frame-number "0") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2465 nil |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2466 '((overlay-arrow . hollow-right-triangle)))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2467 (set-marker gdb-overlay-arrow-position (point)))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2468 (insert |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2469 (concat |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2470 (gdb-get-field instr 'address) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2471 " " |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2472 (gdb-pad-string (apply 'format `("<%s+%s>:" ,@(gdb-get-many-fields instr 'func-name 'offset))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2473 (- column-padding)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2474 (gdb-get-field instr 'inst) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2475 "\n"))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2476 (gdb-disassembly-place-breakpoints) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2477 (let ((window (get-buffer-window (current-buffer) 0))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2478 (set-window-point window pos))))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2479 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2480 (defun gdb-disassembly-place-breakpoints () |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2481 (gdb-remove-breakpoint-icons (point-min) (point-max)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2482 (dolist (breakpoint gdb-breakpoints-list) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2483 (let ((bptno (gdb-get-field breakpoint 'number)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2484 (flag (gdb-get-field breakpoint 'enabled)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2485 (address (gdb-get-field breakpoint 'addr))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2486 (save-excursion |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2487 (goto-char (point-min)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2488 (if (re-search-forward (concat "^" address) nil t) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2489 (gdb-put-breakpoint-icon (string-equal flag "y") bptno)))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2490 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2491 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2492 ;;; Breakpoints view |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2493 (defun gdb-breakpoints-mode () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2494 "Major mode for gdb breakpoints. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2495 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2496 \\{gdb-breakpoints-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2497 (kill-all-local-variables) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2498 (setq major-mode 'gdb-breakpoints-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2499 (setq mode-name "Breakpoints") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2500 (use-local-map gdb-breakpoints-mode-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2501 (setq buffer-read-only t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2502 (buffer-disable-undo) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2503 (setq header-line-format gdb-breakpoints-header) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2504 (run-mode-hooks 'gdb-breakpoints-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2505 'gdb-invalidate-breakpoints) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2506 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2507 (defun gdb-toggle-breakpoint () |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2508 "Enable/disable breakpoint at current line of breakpoints buffer." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2509 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2510 (save-excursion |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2511 (beginning-of-line) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2512 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2513 (if breakpoint |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2514 (gud-basic-call |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2515 (concat (if (string-equal "y" (gdb-get-field breakpoint 'enabled)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2516 "-break-disable " |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2517 "-break-enable ") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2518 (gdb-get-field breakpoint 'number))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2519 (error "Not recognized as break/watchpoint line"))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2520 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2521 (defun gdb-delete-breakpoint () |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2522 "Delete the breakpoint at current line of breakpoints buffer." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2523 (interactive) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2524 (save-excursion |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2525 (beginning-of-line) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2526 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2527 (if breakpoint |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2528 (gud-basic-call (concat "-break-delete " (gdb-get-field breakpoint 'number))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2529 (error "Not recognized as break/watchpoint line"))))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2530 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2531 (defun gdb-goto-breakpoint (&optional event) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2532 "Go to the location of breakpoint at current line of |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2533 breakpoints buffer." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2534 (interactive (list last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2535 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2536 ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2537 (let ((window (get-buffer-window gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2538 (if window (save-selected-window (select-window window)))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2539 (save-excursion |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2540 (beginning-of-line) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2541 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2542 (if breakpoint |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2543 (let ((bptno (gdb-get-field breakpoint 'number)) |
104104
757c30ed402e
(gdb-goto-breakpoint): Use full path when setting breakpoints.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103955
diff
changeset
|
2544 (file (gdb-get-field breakpoint 'fullname)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2545 (line (gdb-get-field breakpoint 'line))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2546 (save-selected-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2547 (let* ((buffer (find-file-noselect |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2548 (if (file-exists-p file) file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2549 (cdr (assoc bptno gdb-location-alist))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2550 (window (or (gdb-display-source-buffer buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2551 (display-buffer buffer)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2552 (setq gdb-source-window window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2553 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2554 (goto-line (string-to-number line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2555 (set-window-point window (point)))))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2556 (error "Not recognized as break/watchpoint line"))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2557 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2558 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2559 ;; Frames buffer. This displays a perpetually correct bactrack trace. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2560 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2561 (gdb-set-buffer-rules 'gdb-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2562 'gdb-stack-buffer-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2563 'gdb-frames-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2564 |
103753
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2565 (def-gdb-auto-updated-buffer gdb-stack-buffer |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2566 gdb-invalidate-frames |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2567 (gdb-current-context-command "-stack-list-frames") |
103753
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2568 gdb-stack-list-frames-handler |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2569 gdb-stack-list-frames-custom) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2570 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2571 (defun gdb-insert-frame-location (frame) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2572 "Insert \"of file:line\" button or library name for structure FRAME. |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2573 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2574 FRAME must have either \"file\" and \"line\" members or \"from\" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2575 member." |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2576 (let ((file (gdb-get-field frame 'fullname)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2577 (line (gdb-get-field frame 'line)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2578 (from (gdb-get-field frame 'from))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2579 (cond (file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2580 ;; Filename with line number |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2581 (insert " of ") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2582 (gdb-insert-file-location-button |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2583 file (string-to-number line))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2584 ;; Library |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2585 (from (insert (format " of %s" from)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2586 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2587 (defun gdb-stack-list-frames-custom () |
103753
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2588 (let* ((res (json-partial-output "frame")) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2589 (stack (gdb-get-field res 'stack))) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2590 (dolist (frame (nreverse stack)) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2591 (insert (apply 'format `("%s in %s" ,@(gdb-get-many-fields frame 'level 'func)))) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2592 (gdb-insert-frame-location frame) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2593 (newline)) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2594 (save-excursion |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2595 (goto-char (point-min)) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2596 (forward-line 1) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2597 (while (< (point) (point-max)) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2598 (add-text-properties (point-at-bol) (1+ (point-at-bol)) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2599 '(mouse-face highlight |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2600 help-echo "mouse-2, RET: Select frame")) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2601 (beginning-of-line) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2602 (when (and (looking-at "^[0-9]+\\s-+\\S-+\\s-+\\(\\S-+\\)") |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2603 (equal (match-string 1) gdb-selected-frame)) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2604 (if (> (car (window-fringes)) 0) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2605 (progn |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2606 (or gdb-stack-position |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2607 (setq gdb-stack-position (make-marker))) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2608 (set-marker gdb-stack-position (point))) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2609 (let ((bl (point-at-bol))) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2610 (put-text-property bl (+ bl 4) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2611 'face '(:inverse-video t))))) |
bd7c204d425b
* progmodes/gdb-mi.el (gdb-stack-list-frames-handler): Rewritten
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103752
diff
changeset
|
2612 (forward-line 1))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2613 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2614 (defun gdb-stack-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2615 (concat "*stack frames of " (gdb-get-target-string) "*")) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2616 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2617 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2618 gdb-display-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2619 'gdb-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2620 "Display backtrace of current stack.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2621 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2622 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2623 gdb-frame-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2624 'gdb-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2625 "Display backtrace of current stack in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2626 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2627 (defvar gdb-frames-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2628 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2629 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2630 (define-key map "q" 'kill-this-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2631 (define-key map "\r" 'gdb-frames-select) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2632 (define-key map [mouse-2] 'gdb-frames-select) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2633 (define-key map [follow-link] 'mouse-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2634 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2635 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2636 (defvar gdb-frames-font-lock-keywords |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2637 '(("in \\([^ ]+\\) of " (1 font-lock-function-name-face))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2638 "Font lock keywords used in `gdb-frames-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2639 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2640 (defun gdb-frames-mode () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2641 "Major mode for gdb call stack. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2642 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2643 \\{gdb-frames-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2644 (kill-all-local-variables) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2645 (setq major-mode 'gdb-frames-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2646 (setq mode-name "Frames") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2647 (setq gdb-stack-position nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2648 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2649 (setq truncate-lines t) ;; Make it easier to see overlay arrow. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2650 (setq buffer-read-only t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2651 (buffer-disable-undo) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2652 (use-local-map gdb-frames-mode-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2653 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2654 '(gdb-frames-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2655 (run-mode-hooks 'gdb-frames-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2656 'gdb-invalidate-frames) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2657 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2658 (defun gdb-get-frame-number () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2659 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2660 (end-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2661 (let* ((pos (re-search-backward "^\\([0-9]+\\)" nil t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2662 (n (or (and pos (match-string-no-properties 1)) "0"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2663 n))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2664 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2665 (defun gdb-frames-select (&optional event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2666 "Select the frame and display the relevant source." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2667 (interactive (list last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2668 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2669 (gud-basic-call (concat "-stack-select-frame " (gdb-get-frame-number)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2670 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2671 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2672 ;; Locals buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2673 ;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2674 (gdb-set-buffer-rules 'gdb-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2675 'gdb-locals-buffer-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2676 'gdb-locals-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2677 |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2678 (def-gdb-auto-updated-buffer gdb-locals-buffer |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2679 gdb-invalidate-locals |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2680 (concat (gdb-current-context-command "-stack-list-locals") " --simple-values") |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2681 gdb-locals-handler gdb-locals-handler-custom) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2682 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2683 (defconst gdb-stack-list-locals-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2684 (concat "name=\"\\(.*?\\)\",type=\"\\(.*?\\)\"")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2685 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2686 (defvar gdb-locals-watch-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2687 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2688 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2689 (define-key map "\r" 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2690 (define-key map [mouse-2] 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2691 map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2692 "Keymap to create watch expression of a complex data type local variable.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2693 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2694 (defvar gdb-edit-locals-map-1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2695 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2696 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2697 (define-key map "\r" 'gdb-edit-locals-value) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2698 (define-key map [mouse-2] 'gdb-edit-locals-value) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2699 map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2700 "Keymap to edit value of a simple data type local variable.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2701 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2702 (defun gdb-edit-locals-value (&optional event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2703 "Assign a value to a variable displayed in the locals buffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2704 (interactive (list last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2705 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2706 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2707 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2708 (let* ((var (current-word)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2709 (value (read-string (format "New value (%s): " var)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2710 (gud-basic-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2711 (concat "-gdb-set variable " var " = " value))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2712 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2713 ;; Dont display values of arrays or structures. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2714 ;; These can be expanded using gud-watch. |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2715 (defun gdb-locals-handler-custom () |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2716 (let ((locals-list (gdb-get-field (json-partial-output) 'locals))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2717 (dolist (local locals-list) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2718 (let ((name (gdb-get-field local 'name)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2719 (value (gdb-get-field local 'value)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2720 (type (gdb-get-field local 'type))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2721 (if (or (not value) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2722 (string-match "\\0x" value)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2723 (add-text-properties 0 (length name) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2724 `(mouse-face highlight |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2725 help-echo "mouse-2: create watch expression" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2726 local-map ,gdb-locals-watch-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2727 name) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2728 (add-text-properties 0 (length value) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2729 `(mouse-face highlight |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2730 help-echo "mouse-2: edit value" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2731 local-map ,gdb-edit-locals-map-1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2732 value)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2733 (insert |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2734 (concat name "\t" type |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2735 "\t" value "\n")))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2736 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2737 (defvar gdb-locals-header |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2738 (list |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2739 (gdb-propertize-header "Locals" gdb-locals-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2740 nil nil mode-line) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2741 " " |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2742 (gdb-propertize-header "Registers" gdb-registers-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
2743 "mouse-1: select" mode-line-highlight mode-line-inactive))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2744 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2745 (defvar gdb-locals-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2746 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2747 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2748 (define-key map "q" 'kill-this-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2749 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2750 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2751 (defun gdb-locals-mode () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2752 "Major mode for gdb locals. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2753 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2754 \\{gdb-locals-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2755 (kill-all-local-variables) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2756 (setq major-mode 'gdb-locals-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2757 (setq mode-name (concat "Locals:" gdb-selected-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2758 (setq buffer-read-only t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2759 (buffer-disable-undo) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2760 (setq header-line-format gdb-locals-header) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2761 (use-local-map gdb-locals-mode-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2762 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2763 '(gdb-locals-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2764 (run-mode-hooks 'gdb-locals-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2765 'gdb-invalidate-locals) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2766 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2767 (defun gdb-locals-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2768 (concat "*locals of " (gdb-get-target-string) "*")) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2769 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2770 (def-gdb-display-buffer |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2771 gdb-display-locals-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2772 'gdb-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2773 "Display local variables of current stack and their values.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2774 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2775 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2776 gdb-frame-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2777 'gdb-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2778 "Display local variables of current stack and their values in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2779 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2780 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2781 ;; Registers buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2782 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2783 (gdb-set-buffer-rules 'gdb-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2784 'gdb-registers-buffer-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2785 'gdb-registers-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2786 |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2787 (def-gdb-auto-updated-buffer gdb-registers-buffer |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2788 gdb-invalidate-registers |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2789 (concat (gdb-current-context-command "-data-list-register-values") " x") |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2790 gdb-registers-handler |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2791 gdb-registers-handler-custom) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2792 |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2793 (defun gdb-registers-handler-custom () |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2794 (let ((register-values (gdb-get-field (json-partial-output) 'register-values)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2795 (register-names-list (reverse gdb-register-names))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2796 (dolist (register register-values) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2797 (let* ((register-number (gdb-get-field register 'number)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2798 (value (gdb-get-field register 'value)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2799 (register-name (nth (string-to-number register-number) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2800 register-names-list))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2801 (insert |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2802 (concat |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2803 (propertize register-name 'face font-lock-variable-name-face) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2804 "\t" |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2805 (if (member register-number gdb-changed-registers) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2806 (propertize value 'face font-lock-warning-face) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2807 value) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2808 "\n")))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2809 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2810 (defvar gdb-registers-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2811 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2812 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2813 (define-key map "q" 'kill-this-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2814 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2815 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2816 (defun gdb-registers-mode () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2817 "Major mode for gdb registers. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2818 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2819 \\{gdb-registers-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2820 (kill-all-local-variables) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2821 (setq major-mode 'gdb-registers-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2822 (setq mode-name "Registers") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2823 (setq header-line-format gdb-locals-header) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2824 (setq buffer-read-only t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2825 (buffer-disable-undo) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2826 (use-local-map gdb-registers-mode-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2827 (run-mode-hooks 'gdb-registers-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2828 'gdb-invalidate-registers) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2829 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2830 (defun gdb-registers-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2831 (concat "*registers of " (gdb-get-target-string) "*")) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2832 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2833 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2834 gdb-display-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2835 'gdb-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2836 "Display integer register contents.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2837 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2838 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2839 gdb-frame-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2840 'gdb-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2841 "Display integer register contents in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2842 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2843 ;; Needs GDB 6.4 onwards (used to fail with no stack). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2844 (defun gdb-get-changed-registers () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2845 (if (and (gdb-get-buffer 'gdb-registers-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2846 (not (member 'gdb-get-changed-registers gdb-pending-triggers))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2847 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2848 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2849 (list |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2850 "-data-list-changed-registers" |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2851 'gdb-changed-registers-handler)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2852 (push 'gdb-get-changed-registers gdb-pending-triggers)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2853 |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2854 (defun gdb-changed-registers-handler () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2855 (setq gdb-pending-triggers |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2856 (delq 'gdb-get-changed-registers gdb-pending-triggers)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2857 (setq gdb-changed-registers nil) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2858 (dolist (register-number (gdb-get-field (json-partial-output) 'changed-registers)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2859 (push register-number gdb-changed-registers))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2860 |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2861 (defun gdb-register-names-handler () |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2862 ;; Don't use gdb-pending-triggers because this handler is called |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2863 ;; only once (in gdb-init-1) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2864 (setq gdb-register-names nil) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2865 (dolist (register-name (gdb-get-field (json-partial-output) 'register-names)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2866 (push register-name gdb-register-names)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2867 (setq gdb-register-names (reverse gdb-register-names))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2868 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2869 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2870 (defun gdb-get-source-file-list () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2871 "Create list of source files for current GDB session. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2872 If buffers already exist for any of these files, gud-minor-mode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2873 is set in them." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2874 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2875 (while (re-search-forward gdb-source-file-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2876 (push (match-string 1) gdb-source-file-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2877 (dolist (buffer (buffer-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2878 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2879 (when (member buffer-file-name gdb-source-file-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2880 (gdb-init-buffer)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2881 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2882 (propertize "ready" 'face font-lock-variable-name-face))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2883 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2884 (defun gdb-get-selected-frame () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2885 (if (not (member 'gdb-get-selected-frame gdb-pending-triggers)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2886 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2887 (gdb-input |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2888 (list (gdb-current-context-command "-stack-info-frame") 'gdb-frame-handler)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2889 (push 'gdb-get-selected-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2890 gdb-pending-triggers)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2891 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2892 (defun gdb-frame-handler () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2893 (setq gdb-pending-triggers |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2894 (delq 'gdb-get-selected-frame gdb-pending-triggers)) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2895 (let ((frame (gdb-get-field (json-partial-output) 'frame))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2896 (when frame |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2897 (setq gdb-frame-number (gdb-get-field frame 'level)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2898 (setq gdb-pc-address (gdb-get-field frame 'addr)) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2899 (setq gdb-selected-frame (gdb-get-field frame 'func)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2900 (setq gdb-selected-file (gdb-get-field frame 'fullname)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2901 (let ((line (gdb-get-field frame 'line))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2902 (setq gdb-selected-line (or (and line (string-to-number line)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2903 nil)) ; don't fail if line is nil |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2904 (when line ; obey the current file only if we have line info |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2905 (setq gud-last-frame (cons gdb-selected-file gdb-selected-line)) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2906 (gud-display-frame))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2907 (if (gdb-get-buffer 'gdb-locals-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2908 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2909 (setq mode-name (concat "Locals:" gdb-selected-frame)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2910 (if (gdb-get-buffer 'gdb-disassembly-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2911 (with-current-buffer (gdb-get-buffer 'gdb-disassembly-buffer) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2912 (setq mode-name (concat "Disassembly:" gdb-selected-frame)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2913 (if gud-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2914 (let ((buffer (marker-buffer gud-overlay-arrow-position)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2915 (position (marker-position gud-overlay-arrow-position))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2916 (when buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2917 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2918 (setq fringe-indicator-alist |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2919 (if (string-equal gdb-frame-number "0") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2920 nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2921 '((overlay-arrow . hollow-right-triangle)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2922 (setq gud-overlay-arrow-position (make-marker)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2923 (set-marker gud-overlay-arrow-position position))))) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2924 (when gdb-selected-line |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2925 (gdb-invalidate-disassembly))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2926 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2927 (defvar gdb-prompt-name-regexp "value=\"\\(.*?\\)\"") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2928 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2929 (defun gdb-get-prompt () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2930 "Find prompt for GDB session." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2931 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2932 (setq gdb-prompt-name nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2933 (re-search-forward gdb-prompt-name-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2934 (setq gdb-prompt-name (match-string 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2935 ;; Insert first prompt. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2936 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2937 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2938 ;;;; Window management |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2939 (defun gdb-display-buffer (buf dedicated &optional frame) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2940 (let ((answer (get-buffer-window buf (or frame 0)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2941 (if answer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2942 (display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2943 (let ((window (get-lru-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2944 (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2945 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2946 (let* ((largest (get-largest-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2947 (cur-size (window-height largest))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2948 (setq answer (split-window largest)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2949 (set-window-buffer answer buf) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2950 (set-window-dedicated-p answer dedicated) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2951 answer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2952 (set-window-buffer window buf) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2953 window))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2954 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2955 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2956 ;;; Shared keymap initialization: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2957 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2958 (let ((menu (make-sparse-keymap "GDB-Windows"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2959 (define-key gud-menu-map [displays] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2960 `(menu-item "GDB-Windows" ,menu |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2961 :visible (eq gud-minor-mode 'gdbmi))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2962 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2963 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2964 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2965 (define-key menu [disassembly] |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2966 '("Disassembly" . gdb-display-disassembly-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2967 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2968 (define-key menu [inferior] |
103779
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
2969 '("Separate IO" . gdb-display-separate-io-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2970 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2971 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2972 (define-key menu [breakpoints] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2973 '("Breakpoints" . gdb-display-breakpoints-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2974 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2975 (let ((menu (make-sparse-keymap "GDB-Frames"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2976 (define-key gud-menu-map [frames] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2977 `(menu-item "GDB-Frames" ,menu |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2978 :visible (eq gud-minor-mode 'gdbmi))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2979 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2980 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2981 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2982 (define-key menu [disassembly] '("Disassembly" . gdb-frame-disassembly-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2983 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2984 (define-key menu [inferior] |
103779
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
2985 '("Separate IO" . gdb-frame-separate-io-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2986 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2987 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2988 (define-key menu [breakpoints] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2989 '("Breakpoints" . gdb-frame-breakpoints-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2990 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2991 (let ((menu (make-sparse-keymap "GDB-MI"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2992 (define-key gud-menu-map [mi] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2993 `(menu-item "GDB-MI" ,menu :visible (eq gud-minor-mode 'gdbmi))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2994 (define-key menu [gdb-customize] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2995 '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2996 :help "Customize Gdb Graphical Mode options.")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2997 (define-key menu [gdb-many-windows] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2998 '(menu-item "Display Other Windows" gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2999 :help "Toggle display of locals, stack and breakpoint information" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3000 :button (:toggle . gdb-many-windows))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3001 (define-key menu [gdb-restore-windows] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3002 '(menu-item "Restore Window Layout" gdb-restore-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3003 :help "Restore standard layout for debug session."))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3004 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3005 (defun gdb-frame-gdb-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3006 "Display GUD buffer in a new frame." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3007 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3008 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3009 (special-display-frame-alist |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3010 (remove '(menu-bar-lines) (remove '(tool-bar-lines) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3011 gdb-frame-parameters))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3012 (same-window-regexps nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3013 (display-buffer gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3014 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3015 (defun gdb-display-gdb-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3016 "Display GUD buffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3017 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3018 (let ((same-window-regexps nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3019 (select-window (display-buffer gud-comint-buffer nil 0)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3020 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3021 (defun gdb-set-window-buffer (name) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3022 (set-window-buffer (selected-window) (get-buffer name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3023 (set-window-dedicated-p (selected-window) t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3024 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3025 (defun gdb-setup-windows () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3026 "Layout the window pattern for `gdb-many-windows'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3027 (gdb-display-locals-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3028 (gdb-display-stack-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3029 (delete-other-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3030 (gdb-display-breakpoints-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3031 (delete-other-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3032 ; Don't dedicate. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3033 (pop-to-buffer gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3034 (split-window nil ( / ( * (window-height) 3) 4)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3035 (split-window nil ( / (window-height) 3)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3036 (split-window-horizontally) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3037 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3038 (gdb-set-window-buffer (gdb-locals-buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3039 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3040 (switch-to-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3041 (if gud-last-last-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3042 (gud-find-file (car gud-last-last-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3043 (if gdb-main-file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3044 (gud-find-file gdb-main-file) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3045 ;; Put buffer list in window if we |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3046 ;; can't find a source file. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3047 (list-buffers-noselect)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3048 (setq gdb-source-window (selected-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3049 (when gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3050 (split-window-horizontally) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3051 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3052 (gdb-set-window-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3053 (gdb-get-buffer-create 'gdb-inferior-io))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3054 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3055 (gdb-set-window-buffer (gdb-stack-buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3056 (split-window-horizontally) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3057 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3058 (gdb-set-window-buffer (gdb-breakpoints-buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3059 (other-window 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3060 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3061 (defcustom gdb-many-windows nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3062 "If nil just pop up the GUD buffer unless `gdb-show-main' is t. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3063 In this case it starts with two windows: one displaying the GUD |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3064 buffer and the other with the source file with the main routine |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3065 of the debugged program. Non-nil means display the layout shown for |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3066 `gdb'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3067 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3068 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3069 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3070 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3071 (defun gdb-many-windows (arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3072 "Toggle the number of windows in the basic arrangement. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3073 With arg, display additional buffers iff arg is positive." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3074 (interactive "P") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3075 (setq gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3076 (if (null arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3077 (not gdb-many-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3078 (> (prefix-numeric-value arg) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3079 (message (format "Display of other windows %sabled" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3080 (if gdb-many-windows "en" "dis"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3081 (if (and gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3082 (buffer-name gud-comint-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3083 (condition-case nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3084 (gdb-restore-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3085 (error nil)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3086 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3087 (defun gdb-restore-windows () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3088 "Restore the basic arrangement of windows used by gdb. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3089 This arrangement depends on the value of `gdb-many-windows'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3090 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3091 (pop-to-buffer gud-comint-buffer) ;Select the right window and frame. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3092 (delete-other-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3093 (if gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3094 (gdb-setup-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3095 (when (or gud-last-last-frame gdb-show-main) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3096 (split-window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3097 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3098 (switch-to-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3099 (if gud-last-last-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3100 (gud-find-file (car gud-last-last-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3101 (gud-find-file gdb-main-file))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3102 (setq gdb-source-window (selected-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3103 (other-window 1)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3104 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3105 (defun gdb-reset () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3106 "Exit a debugging session cleanly. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3107 Kills the gdb buffers, and resets variables and the source buffers." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3108 (dolist (buffer (buffer-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3109 (unless (eq buffer gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3110 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3111 (if (eq gud-minor-mode 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3112 (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3113 (kill-buffer nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3114 (gdb-remove-breakpoint-icons (point-min) (point-max) t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3115 (setq gud-minor-mode nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3116 (kill-local-variable 'tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3117 (kill-local-variable 'gdb-define-alist)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3118 (setq gdb-overlay-arrow-position nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3119 (setq overlay-arrow-variable-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3120 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3121 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3122 (setq gdb-stack-position nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3123 (setq overlay-arrow-variable-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3124 (delq 'gdb-stack-position overlay-arrow-variable-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3125 (if (boundp 'speedbar-frame) (speedbar-timer-fn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3126 (setq gud-running nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3127 (setq gdb-active-process nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3128 (remove-hook 'after-save-hook 'gdb-create-define-alist t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3129 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3130 (defun gdb-get-source-file () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3131 "Find the source file where the program starts and display it with related |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3132 buffers, if required." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3133 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3134 (if (re-search-forward gdb-source-file-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3135 (setq gdb-main-file (match-string 1))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3136 (if gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3137 (gdb-setup-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3138 (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3139 (if gdb-show-main |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3140 (let ((pop-up-windows t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3141 (display-buffer (gud-find-file gdb-main-file)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3142 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3143 ;;from put-image |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3144 (defun gdb-put-string (putstring pos &optional dprop &rest sprops) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3145 "Put string PUTSTRING in front of POS in the current buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3146 PUTSTRING is displayed by putting an overlay into the current buffer with a |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3147 `before-string' string that has a `display' property whose value is |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3148 PUTSTRING." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3149 (let ((string (make-string 1 ?x)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3150 (buffer (current-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3151 (setq putstring (copy-sequence putstring)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3152 (let ((overlay (make-overlay pos pos buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3153 (prop (or dprop |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3154 (list (list 'margin 'left-margin) putstring)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3155 (put-text-property 0 1 'display prop string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3156 (if sprops |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3157 (add-text-properties 0 1 sprops string)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3158 (overlay-put overlay 'put-break t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3159 (overlay-put overlay 'before-string string)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3160 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3161 ;;from remove-images |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3162 (defun gdb-remove-strings (start end &optional buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3163 "Remove strings between START and END in BUFFER. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3164 Remove only strings that were put in BUFFER with calls to `gdb-put-string'. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3165 BUFFER nil or omitted means use the current buffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3166 (unless buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3167 (setq buffer (current-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3168 (dolist (overlay (overlays-in start end)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3169 (when (overlay-get overlay 'put-break) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3170 (delete-overlay overlay)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3171 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3172 (defun gdb-put-breakpoint-icon (enabled bptno) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3173 (let ((start (- (line-beginning-position) 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3174 (end (+ (line-end-position) 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3175 (putstring (if enabled "B" "b")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3176 (source-window (get-buffer-window (current-buffer) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3177 (add-text-properties |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3178 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3179 putstring) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3180 (if enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3181 (add-text-properties |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3182 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3183 (add-text-properties |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3184 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3185 (gdb-remove-breakpoint-icons start end) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3186 (if (display-images-p) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3187 (if (>= (or left-fringe-width |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3188 (if source-window (car (window-fringes source-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3189 gdb-buffer-fringe-width) 8) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3190 (gdb-put-string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3191 nil (1+ start) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3192 `(left-fringe breakpoint |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3193 ,(if enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3194 'breakpoint-enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3195 'breakpoint-disabled)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3196 'gdb-bptno bptno |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3197 'gdb-enabled enabled) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3198 (when (< left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3199 (save-current-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3200 (setq left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3201 (if source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3202 (set-window-margins |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3203 source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3204 left-margin-width right-margin-width)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3205 (put-image |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3206 (if enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3207 (or breakpoint-enabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3208 (setq breakpoint-enabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3209 (find-image `((:type xpm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3210 ,breakpoint-xpm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3211 :ascent 100 :pointer hand) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3212 (:type pbm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3213 ,breakpoint-enabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3214 :ascent 100 :pointer hand))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3215 (or breakpoint-disabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3216 (setq breakpoint-disabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3217 (find-image `((:type xpm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3218 ,breakpoint-xpm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3219 :conversion disabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3220 :ascent 100 :pointer hand) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3221 (:type pbm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3222 ,breakpoint-disabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3223 :ascent 100 :pointer hand)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3224 (+ start 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3225 putstring |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3226 'left-margin)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3227 (when (< left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3228 (save-current-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3229 (setq left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3230 (let ((window (get-buffer-window (current-buffer) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3231 (if window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3232 (set-window-margins |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3233 window left-margin-width right-margin-width))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3234 (gdb-put-string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3235 (propertize putstring |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3236 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3237 (1+ start))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3238 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3239 (defun gdb-remove-breakpoint-icons (start end &optional remove-margin) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3240 (gdb-remove-strings start end) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3241 (if (display-images-p) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3242 (remove-images start end)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3243 (when remove-margin |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3244 (setq left-margin-width 0) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3245 (let ((window (get-buffer-window (current-buffer) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3246 (if window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3247 (set-window-margins |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3248 window left-margin-width right-margin-width))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3249 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3250 (provide 'gdb-mi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3251 |
103554 | 3252 ;; arch-tag: 1b41ea2b-f364-4cec-8f35-e02e4fe01912 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3253 ;;; gdb-mi.el ends here |