annotate lisp/progmodes/gdb-ui.el @ 108319:c3a1d1b47790 EMACS_PRETEST_23_1_96

Bump version to 23.1.96.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 19 Apr 2010 21:29:37 -0400
parents 33d43eba45d4
children a98040347deb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1 ;;; gdb-ui.el --- User Interface for running GDB
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3 ;; Author: Nick Roberts <nickrob@gnu.org>
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4 ;; Maintainer: FSF
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
5 ;; Keywords: unix, tools
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
6
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106697
diff changeset
7 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
8 ;; Free Software Foundation, Inc.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
9
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
11
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
12 ;; GNU Emacs is free software: you can redistribute it and/or modify
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
14 ;; the Free Software Foundation, either version 3 of the License, or
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
15 ;; (at your option) any later version.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
16
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
20 ;; GNU General Public License for more details.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
21
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
24
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
25 ;;; Commentary:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
26
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
27 ;; This mode acts as a graphical user interface to GDB. You can interact with
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
28 ;; GDB through the GUD buffer in the usual way, but there are also further
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
29 ;; buffers which control the execution and describe the state of your program.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
30 ;; It separates the input/output of your program from that of GDB, if
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
31 ;; required, and watches expressions in the speedbar. It also uses features of
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
32 ;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
33 ;; (see the GDB Graphical Interface section in the Emacs info manual).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
34
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
35 ;; By default, M-x gdb will start the debugger.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
36
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
37 ;; This file has evolved from gdba.el that was included with GDB 5.0 and
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
38 ;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
39 ;; You don't need to know about annotations to use this mode as a debugger,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
40 ;; but if you are interested developing the mode itself, see the Annotations
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
41 ;; section in the GDB info manual.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
42
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
43 ;; GDB developers plan to make the annotation interface obsolete. A new
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
44 ;; interface called GDB/MI (machine interface) has been designed to replace it.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
45 ;; Some GDB/MI commands are used in this file through the CLI command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
46 ;; 'interpreter mi <mi-command>'. To help with the process of fully migrating
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
47 ;; Emacs from annotations to GDB/MI, there is an experimental package called
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
48 ;; gdb-mi in the Emacs Lisp Package Archive ("http://tromey.com/elpa/"). It
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
49 ;; comprises of modified gud.el and a file called gdb-mi.el which replaces
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
50 ;; gdb-ui.el. When installed, this overrides the current files and invoking
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
51 ;; M-x gdb will use GDB/MI directly (starts with "gdb -i=mi"). When deleted
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
52 ;; ('d' followed by 'x' in Package Menu mode), the files are deleted and old
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
53 ;; functionality restored. This provides a convenient way to review the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
54 ;; current status/contribute to its improvement. For someone who just wants to
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
55 ;; use GDB, however, the current mode in Emacs 22 is a much better option.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
56 ;; There is also a file, also called gdb-mi.el, a version of which is included
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
57 ;; the GDB distribution. This will probably only work with versions
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
58 ;; distributed with GDB 6.5 or later. Unlike the version in ELPA it works on
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
59 ;; top of gdb-ui.el and you can only start it with M-x gdbmi.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
60
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
61 ;; This mode SHOULD WORK WITH GDB 5.0 or later but you will NEED AT LEAST
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
62 ;; GDB 6.0 to use watch expressions. It works best with GDB 6.4 or later
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
63 ;; where watch expressions will update more quickly.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
64
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
65 ;;; Windows Platforms:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
66
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
67 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
68 ;; explicitly in your program if you want timely display of I/O in Emacs.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
69 ;; Alternatively you can make the output stream unbuffered, for example, by
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
70 ;; using a macro:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
71
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
72 ;; #ifdef UNBUFFERED
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
73 ;; setvbuf (stdout, (char *) NULL, _IONBF, 0);
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
74 ;; #endif
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
75
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
76 ;; and compiling with -DUNBUFFERED while debugging.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
77
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
78 ;; If you are using Cygwin GDB and find that the source is not being displayed
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
79 ;; in Emacs when you step through it, possible solutions are to:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
80
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
81 ;; 1) Use Cygwin X Windows and Cygwin Emacs.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
82 ;; (Since 22.1 Emacs builds under Cygwin.)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
83 ;; 2) Use MinGW GDB instead.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
84 ;; 3) Use cygwin-mount.el
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
85
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
86 ;;; Mac OSX:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
87
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
88 ;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
89 ;; some changes to the version that they include as part of Mac OSX.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
90 ;; This requires GDB version 7.0 or later (estimated release date June 2009)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
91 ;; as earlier versions don not compile on Mac OSX.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
92
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
93 ;;; Known Bugs:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
94
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
95 ;; 1) Cannot handle multiple debug sessions.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
96 ;; 2) If you wish to call procedures from your program in GDB
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
97 ;; e.g "call myproc ()", "p mysquare (5)" then use level 2 annotations
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
98 ;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
99 ;; 3) After detaching from a process, clicking on the "GO" icon on toolbar
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
100 ;; (gud-go) sends "continue" to GDB (should be "run").
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
101
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
102 ;;; TODO:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
103
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
104 ;; 1) Use MI command -data-read-memory for memory window.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
105 ;; 2) Use tree-buffer.el (from ECB) instead of the speedbar for
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
106 ;; watch-expressions? Handling of watch-expressions needs to be
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
107 ;; overhauled to work for large arrays/structures by creating variable
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
108 ;; objects for visible watch-expressions only.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
109 ;; 3) Mark breakpoint locations on scroll-bar of source buffer?
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
110
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
111 ;;; Code:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
112
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
113 (require 'gud)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
114 (require 'json)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
115 (require 'bindat)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
116
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
117 (defvar tool-bar-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
118 (defvar speedbar-initial-expansion-list-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
119 (defvar speedbar-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
120
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
121 (defvar gdb-pc-address nil "Initialization for Assembler buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
122 Set to \"main\" at start if `gdb-show-main' is t.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
123 (defvar gdb-frame-address nil "Identity of frame for watch expression.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
124 (defvar gdb-previous-frame-pc-address nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
125 (defvar gdb-memory-address "main")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
126 (defvar gdb-previous-frame nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
127 (defvar gdb-selected-frame nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
128 (defvar gdb-frame-number nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
129 (defvar gdb-current-language nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
130 (defvar gdb-var-list nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
131 "List of variables in watch window.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
132 Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
133 where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
134 address for root variables.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
135 (defvar gdb-main-file nil "Source file from which program execution begins.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
136 (defvar gud-old-arrow nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
137 (defvar gdb-thread-indicator nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
138 (defvar gdb-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
139 (defvar gdb-stack-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
140 (defvar gdb-server-prefix nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
141 (defvar gdb-flush-pending-output nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
142 (defvar gdb-location-alist nil
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
143 "Alist of breakpoint numbers and full filenames.
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
144 Only used for files that Emacs can't find.")
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
145 (defvar gdb-active-process nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
146 "GUD tooltips display variable values when t, and macro definitions otherwise.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
147 (defvar gdb-recording nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
148 "If t, then record session for playback and reverse execution")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
149 (defvar gdb-error "Non-nil when GDB is reporting an error.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
150 (defvar gdb-macro-info nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
151 "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
152 (defvar gdb-buffer-fringe-width nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
153 (defvar gdb-signalled nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
154 (defvar gdb-source-window nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
155 (defvar gdb-inferior-status nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
156 (defvar gdb-continuation nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
157 (defvar gdb-look-up-stack nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
158 (defvar gdb-frame-begin nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
159 "Non-nil when GDB generates frame-begin annotation.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
160 (defvar gdb-printing t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
161 (defvar gdb-parent-bptno-enabled nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
162 (defvar gdb-ready nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
163 (defvar gdb-stack-update nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
164 (defvar gdb-early-user-input nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
165
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
166 (defvar gdb-buffer-type nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
167 "One of the symbols bound in `gdb-buffer-rules'.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
168 (make-variable-buffer-local 'gdb-buffer-type)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
169
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
170 (defvar gdb-input-queue ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
171 "A list of gdb command objects.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
172
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
173 (defvar gdb-prompting nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
174 "True when gdb is idle with no pending input.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
175
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
176 (defvar gdb-output-sink nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
177 "The disposition of the output of the current gdb command.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
178 Possible values are these symbols:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
179
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
180 `user' -- gdb output should be copied to the GUD buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
181 for the user to see.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
182
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
183 `inferior' -- gdb output should be copied to the inferior-io buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
184
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
185 `pre-emacs' -- output should be ignored util the post-prompt
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
186 annotation is received. Then the output-sink
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
187 becomes:...
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
188 `emacs' -- output should be collected in the partial-output-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
189 for subsequent processing by a command. This is the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
190 disposition of output generated by commands that
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
191 gdb mode sends to gdb on its own behalf.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
192 `post-emacs' -- ignore output until the prompt annotation is
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
193 received, then go to USER disposition.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
194
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
195 gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
196 \(`user' and `emacs').")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
197
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
198 (defvar gdb-current-item nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
199 "The most recent command item sent to gdb.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
200
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
201 (defvar gdb-pending-triggers '()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
202 "A list of trigger functions that have run later than their output handlers.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
203
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
204 (defvar gdb-first-post-prompt nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
205 (defvar gdb-version nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
206 (defvar gdb-locals-font-lock-keywords nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
207 (defvar gdb-source-file-list nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
208 "List of source files for the current executable.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
209 (defconst gdb-error-regexp "\\^error,msg=\"\\(.+\\)\"")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
210
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
211 (defvar gdb-locals-font-lock-keywords-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
212 '(;; var = (struct struct_tag) value
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
213 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
214 (1 font-lock-variable-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
215 (3 font-lock-keyword-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
216 (4 font-lock-type-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
217 ;; var = (type) value
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
218 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(\\(\\sw\\|[_.]\\)+\\)"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
219 (1 font-lock-variable-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
220 (3 font-lock-type-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
221 ;; var = val
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
222 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +[^(]"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
223 (1 font-lock-variable-name-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
224 "Font lock keywords used in `gdb-local-mode'.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
225
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
226 (defvar gdb-locals-font-lock-keywords-2
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
227 '(;; var = type value
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
228 ( "\\(^\\(\\sw\\|[_.]\\)+\\)\t+\\(\\(\\sw\\|[_.]\\)+\\)"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
229 (1 font-lock-variable-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
230 (3 font-lock-type-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
231 "Font lock keywords used in `gdb-local-mode'.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
232
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
233 ;; Variables for GDB 6.4+
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
234 (defvar gdb-register-names nil "List of register names.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
235 (defvar gdb-changed-registers nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
236 "List of changed register numbers (strings).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
237
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
238 ;;;###autoload
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
239 (defun gdb (command-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
240 "Run gdb on program FILE in buffer *gud-FILE*.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
241 The directory containing FILE becomes the initial working
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
242 directory and source-file directory for your debugger.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
243
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
244 If `gdb-many-windows' is nil (the default value) then gdb just
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
245 pops up the GUD buffer unless `gdb-show-main' is t. In this case
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
246 it starts with two windows: one displaying the GUD buffer and the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
247 other with the source file with the main routine of the inferior.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
248
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
249 If `gdb-many-windows' is t, regardless of the value of
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
250 `gdb-show-main', the layout below will appear unless
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
251 `gdb-use-separate-io-buffer' is nil when the source buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
252 occupies the full width of the frame. Keybindings are shown in
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
253 some of the buffers.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
254
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
255 Watch expressions appear in the speedbar/slowbar.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
256
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
257 The following commands help control operation :
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
258
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
259 `gdb-many-windows' - Toggle the number of windows gdb uses.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
260 `gdb-restore-windows' - To restore the window layout.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
261
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
262 See Info node `(emacs)GDB Graphical Interface' for a more
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
263 detailed description of this mode.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
264
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
265 +----------------------------------------------------------------------+
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
266 | GDB Toolbar |
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
267 +-----------------------------------+----------------------------------+
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
268 | GUD buffer (I/O of GDB) | Locals buffer |
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
269 |-----------------------------------+----------------------------------+
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
270 | | |
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
271 | Source buffer | I/O buffer for debugged program |
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
272 | | |
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
273 |-----------------------------------+----------------------------------+
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
274 | Stack buffer | Breakpoints/threads buffer |
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
275 +-----------------------------------+----------------------------------+
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
276
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
277 The option \"--annotate=3\" must be included in this value. To
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
278 run GDB in text command mode, use `gud-gdb'. You need to use
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
279 text command mode to debug multiple programs within one Emacs
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
280 session."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
281 (interactive (list (gud-query-cmdline 'gdb)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
282
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
283 (when (and gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
284 (buffer-name gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
285 (get-buffer-process gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
286 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
287 (gdb-restore-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
288 (error
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
289 "Multiple debugging requires restarting in text command mode"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
290
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
291 (gud-common-init command-line nil 'gud-gdba-marker-filter)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
292 (set (make-local-variable 'gud-minor-mode) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
293 (setq comint-input-sender 'gdb-send)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
294
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
295 (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
296 (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
297 "Set temporary breakpoint at current line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
298 (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
299 (gud-def gud-step "step %p" "\C-s" "Step one source line with display.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
300 (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
301 (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
302 (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
303 (gud-def gud-cont "continue" "\C-r" "Continue with display.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
304 (gud-def gud-finish "finish" "\C-f" "Finish executing current function.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
305 (gud-def gud-jump
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
306 (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
307 "\C-j" "Set execution address to current line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
308
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
309 (gud-def gud-rstep "reverse-step %p" nil "Reverse step one source line with display.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
310 (gud-def gud-rstepi "reverse-stepi %p" nil "Reverse step one instruction with display.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
311 (gud-def gud-rnext "reverse-next %p" nil "Reverse step one line (skip functions).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
312 (gud-def gud-rnexti "reverse-nexti %p" nil "Reverse step one instruction (skip functions).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
313 (gud-def gud-rcont "reverse-continue" nil "Reverse continue with display.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
314 (gud-def gud-rfinish "reverse-finish" nil "Reverse finish executing current function.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
315
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
316 (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
317 (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
318 (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
319 (gud-def gud-pstar "print* %e" nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
320 "Evaluate C dereferenced pointer expression at point.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
321
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
322 ;; For debugging Emacs only.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
323 (gud-def gud-pv "pv1 %e" "\C-v" "Print the value of the lisp variable.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
324
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
325 (gud-def gud-until "until %l" "\C-u" "Continue to current line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
326 (gud-def gud-run "run" nil "Run the program.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
327
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
328 (local-set-key "\C-i" 'gud-gdb-complete-command)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
329 (setq comint-prompt-regexp "^(.*gdb[+]?) *")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
330 (setq paragraph-start comint-prompt-regexp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
331 (setq gdb-output-sink 'user)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
332 (setq gdb-first-prompt t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
333 (setq gud-running nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
334 (setq gdb-ready nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
335 (setq gdb-stack-update nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
336 (setq gdb-flush-pending-output nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
337 (setq gdb-early-user-input nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
338 (setq gud-filter-pending-text nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
339 (gdb-thread-identification)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
340 (run-hooks 'gdb-mode-hook))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
341
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
342 ;; Keep as an alias for compatibility with Emacs 22.1.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
343 ;;;###autoload
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
344 (defalias 'gdba 'gdb)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
345
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
346 (defgroup gdb nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
347 "Gdb Graphical Mode options specifically for running Gdb in Emacs."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
348 :group 'processes
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
349 :group 'tools)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
350
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
351 (defcustom gdb-debug-log-max 128
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
352 "Maximum size of `gdb-debug-log'. If nil, size is unlimited."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
353 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
354 :type '(choice (integer :tag "Number of elements")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
355 (const :tag "Unlimited" nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
356 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
357
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
358 (defvar gdb-debug-log nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
359 "List of commands sent to and replies received from GDB.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
360 Most recent commands are listed first. This list stores only the last
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
361 `gdb-debug-log-max' values. This variable is used to debug GDB-UI.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
362
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
363 ;;;###autoload
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
364 (defcustom gdb-enable-debug nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
365 "Non-nil means record the process input and output in `gdb-debug-log'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
366 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
367 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
368 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
369
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
370 (defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
371 "Shell command for generating a list of defined macros in a source file.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
372 This list is used to display the #define directive associated
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
373 with an identifier as a tooltip. It works in a debug session with
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
374 GDB, when `gud-tooltip-mode' is t.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
375
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
376 Set `gdb-cpp-define-alist-flags' for any include paths or
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
377 predefined macros."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
378 :type 'string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
379 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
380 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
381
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
382 (defcustom gdb-cpp-define-alist-flags ""
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
383 "Preprocessor flags for `gdb-cpp-define-alist-program'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
384 :type 'string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
385 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
386 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
387
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
388 (defcustom gdb-create-source-file-list t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
389 "Non-nil means create a list of files from which the executable was built.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
390 Set this to nil if the GUD buffer displays \"initializing...\" in the mode
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
391 line for a long time when starting, possibly because your executable was
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
392 built from a large number of files. This allows quicker initialization
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
393 but means that these files are not automatically enabled for debugging,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
394 e.g., you won't be able to click in the fringe to set a breakpoint until
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
395 execution has already stopped there."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
396 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
397 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
398 :version "23.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
399
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
400 (defcustom gdb-show-main nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
401 "Non-nil means display source file containing the main routine at startup.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
402 Also display the main routine in the disassembly buffer if present."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
403 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
404 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
405 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
406
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
407 (defcustom gdb-many-windows nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
408 "If nil, just pop up the GUD buffer unless `gdb-show-main' is t.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
409 In this case start with two windows: one displaying the GUD
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
410 buffer and the other with the source file with the main routine
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
411 of the debugged program. Non-nil means display the layout shown
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
412 for `gdba'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
413 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
414 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
415 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
416
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
417 (defcustom gdb-use-separate-io-buffer nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
418 "Non-nil means display output from the debugged program in a separate buffer."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
419 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
420 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
421 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
422
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
423 (defun gdb-force-mode-line-update (status)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
424 (let ((buffer gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
425 (if (and buffer (buffer-name buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
426 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
427 (setq mode-line-process
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
428 (format ":%s [%s]"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
429 (process-status (get-buffer-process buffer)) status))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
430 ;; Force mode line redisplay soon.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
431 (force-mode-line-update)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
432
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
433 (defun gdb-enable-debug (arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
434 "Toggle logging of transaction between Emacs and Gdb.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
435 The log is stored in `gdb-debug-log' as an alist with elements
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
436 whose cons is send, send-item or recv and whose cdr is the string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
437 being transferred. This list may grow up to a size of
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
438 `gdb-debug-log-max' after which the oldest element (at the end of
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
439 the list) is deleted every time a new one is added (at the front)."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
440 (interactive "P")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
441 (setq gdb-enable-debug
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
442 (if (null arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
443 (not gdb-enable-debug)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
444 (> (prefix-numeric-value arg) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
445 (message (format "Logging of transaction %sabled"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
446 (if gdb-enable-debug "en" "dis"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
447
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
448 (defun gdb-many-windows (arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
449 "Toggle the number of windows in the basic arrangement.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
450 With prefix argument ARG, display additional buffers if ARG is positive,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
451 otherwise use a single window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
452 (interactive "P")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
453 (setq gdb-many-windows
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
454 (if (null arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
455 (not gdb-many-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
456 (> (prefix-numeric-value arg) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
457 (message (format "Display of other windows %sabled"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
458 (if gdb-many-windows "en" "dis")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
459 (if (and gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
460 (buffer-name gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
461 (condition-case nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
462 (gdb-restore-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
463 (error nil))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
464
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
465 (defun gdb-use-separate-io-buffer (arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
466 "Toggle separate IO for debugged program.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
467 With prefix argument ARG, use separate IO if ARG is positive,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
468 otherwise do not."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
469 (interactive "P")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
470 (setq gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
471 (if (null arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
472 (not gdb-use-separate-io-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
473 (> (prefix-numeric-value arg) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
474 (message (format "Separate IO %sabled"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
475 (if gdb-use-separate-io-buffer "en" "dis")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
476 (if (and gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
477 (buffer-name gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
478 (condition-case nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
479 (if gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
480 (if gdb-many-windows (gdb-restore-windows))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
481 (kill-buffer (gdb-inferior-io-name)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
482 (error nil))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
483
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
484 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
485
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
486 (defun gdb-create-define-alist ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
487 "Create an alist of #define directives for GUD tooltips."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
488 (let* ((file (buffer-file-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
489 (output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
490 (with-output-to-string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
491 (with-current-buffer standard-output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
492 (and file
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
493 (file-exists-p file)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
494 ;; call-process doesn't work with remote file names.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
495 (not (file-remote-p default-directory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
496 (call-process shell-file-name file
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
497 (list t nil) nil "-c"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
498 (concat gdb-cpp-define-alist-program " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
499 gdb-cpp-define-alist-flags))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
500 (define-list (split-string output "\n" t)) (name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
501 (setq gdb-define-alist nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
502 (dolist (define define-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
503 (setq name (nth 1 (split-string define "[( ]")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
504 (push (cons name define) gdb-define-alist))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
505
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
506 (declare-function tooltip-show "tooltip" (text &optional use-echo-area))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
507 (defvar tooltip-use-echo-area)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
508
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
509 (defun gdb-tooltip-print (expr)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
510 (tooltip-show
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
511 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
512 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
513 (let ((string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
514 (if (search-forward "=" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
515 (concat expr (buffer-substring (- (point) 2) (point-max)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
516 (buffer-string))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
517 ;; remove newline for gud-tooltip-echo-area
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
518 (substring string 0 (- (length string) 1))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
519 (or gud-tooltip-echo-area tooltip-use-echo-area
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
520 (not (display-graphic-p)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
521
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
522 ;; If expr is a macro for a function don't print because of possible dangerous
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
523 ;; side-effects. Also printing a function within a tooltip generates an
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
524 ;; unexpected starting annotation (phase error).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
525 (defun gdb-tooltip-print-1 (expr)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
526 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
527 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
528 (if (search-forward "expands to: " nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
529 (unless (looking-at "\\S-+.*(.*).*")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
530 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
531 (list (concat gdb-server-prefix "print " expr "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
532 `(lambda () (gdb-tooltip-print ,expr))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
533
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
534 (defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
535
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
536 (defun gdb-init-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
537 (set (make-local-variable 'gud-minor-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
538 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
539 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
540 (when gud-tooltip-mode
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
541 (make-local-variable 'gdb-define-alist)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
542 (gdb-create-define-alist)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
543 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
544
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
545 (defun gdb-set-gud-minor-mode-existing-buffers ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
546 "Create list of source files for current GDB session."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
547 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
548 (when (search-forward "read in on demand:" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
549 (while (re-search-forward gdb-source-file-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
550 (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
551 gdb-source-file-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
552 (dolist (buffer (buffer-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
553 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
554 (when (and buffer-file-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
555 (member (file-name-nondirectory buffer-file-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
556 gdb-source-file-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
557 (gdb-init-buffer)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
558 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
559 (propertize "ready" 'face font-lock-variable-name-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
560
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
561 (defun gdb-find-watch-expression ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
562 (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
563 (varnum (car var)) expr array)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
564 (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
565 (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
566 (component-list (split-string (match-string 2 varnum) "\\." t)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
567 (setq expr (nth 1 var1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
568 (setq varnumlet (car var1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
569 (dolist (component component-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
570 (setq var2 (assoc varnumlet gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
571 (setq expr (concat expr
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
572 (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
573 (concat "[" component "]")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
574 (concat "." component))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
575 (setq varnumlet (concat varnumlet "." component)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
576 expr)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
577
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
578 (defun gdb-toggle-recording ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
579 "Start/stop recording of debug session."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
580 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
581 (if gud-running
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
582 (message-box "Recording cannot be started or stopped while your program is still running")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
583 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
584 (list (concat gdb-server-prefix
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
585 (if gdb-recording "record stop\n" "target record\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
586 'gdb-recording-handler))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
587
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
588 ;; Convenience function for tool bar.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
589 (defalias 'gdb-toggle-recording-1 'gdb-toggle-recording)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
590
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
591 (defun gdb-recording-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
592 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
593 (if (re-search-forward "current architecture doesn't support record function" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
594 (message-box "Not enabled. The current architecture doesn't support the process record function.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
595 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
596 (if (re-search-forward "Undefined target command" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
597 (message-box "Not enabled. Process record requires GDB 7.0 onwards.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
598 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
599 (if (re-search-forward "the program is not being run" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
600 (message-box "Not enabled. Starting process recording requires an active target (running process).")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
601 (setq gdb-recording (not gdb-recording))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
602 ;; Actually forcing the tool-bar to update.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
603 (force-mode-line-update)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
604
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
605 (defun gdb-init-1 ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
606 (gud-def gud-break (if (not (string-match "Machine" mode-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
607 (gud-call "break %f:%l" arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
608 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
609 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
610 (forward-char 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
611 (gud-call "break *%a" arg)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
612 "\C-b" "Set breakpoint at current line or address.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
613 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
614 (gud-def gud-remove (if (not (string-match "Machine" mode-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
615 (gud-call "clear %f:%l" arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
616 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
617 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
618 (forward-char 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
619 (gud-call "clear *%a" arg)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
620 "\C-d" "Remove breakpoint at current line or address.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
621 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
622 (gud-def gud-until (if (not (string-match "Machine" mode-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
623 (gud-call "until %f:%l" arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
624 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
625 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
626 (forward-char 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
627 (gud-call "until *%a" arg)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
628 "\C-u" "Continue to current line or address.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
629 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
630 (gud-def gud-go (gud-call (if gdb-active-process "continue" "run") arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
631 nil "Start or continue execution.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
632
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
633 ;; For debugging Emacs only.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
634 (gud-def gud-pp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
635 (gud-call
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
636 (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
637 "pp1 " (if (eq (buffer-local-value
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
638 'major-mode (window-buffer)) 'speedbar-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
639 (gdb-find-watch-expression) "%e")) arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
640 nil "Print the Emacs s-expression.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
641
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
642 (define-key gud-minor-mode-map [left-margin mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
643 'gdb-mouse-set-clear-breakpoint)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
644 (define-key gud-minor-mode-map [left-fringe mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
645 'gdb-mouse-set-clear-breakpoint)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
646 (define-key gud-minor-mode-map [left-margin C-mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
647 'gdb-mouse-toggle-breakpoint-margin)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
648 (define-key gud-minor-mode-map [left-fringe C-mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
649 'gdb-mouse-toggle-breakpoint-fringe)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
650
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
651 (define-key gud-minor-mode-map [left-margin drag-mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
652 'gdb-mouse-until)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
653 (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
654 'gdb-mouse-until)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
655 (define-key gud-minor-mode-map [left-margin mouse-3]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
656 'gdb-mouse-until)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
657 (define-key gud-minor-mode-map [left-fringe mouse-3]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
658 'gdb-mouse-until)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
659
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
660 (define-key gud-minor-mode-map [left-margin C-drag-mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
661 'gdb-mouse-jump)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
662 (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
663 'gdb-mouse-jump)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
664 (define-key gud-minor-mode-map [left-fringe C-mouse-3]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
665 'gdb-mouse-jump)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
666 (define-key gud-minor-mode-map [left-margin C-mouse-3]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
667 'gdb-mouse-jump)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
668
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
669 ;; (re-)initialize
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
670 (setq gdb-pc-address (if gdb-show-main "main" nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
671 (setq gdb-previous-frame-pc-address nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
672 gdb-memory-address "main"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
673 gdb-previous-frame nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
674 gdb-selected-frame nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
675 gdb-current-language nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
676 gdb-frame-number nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
677 gdb-var-list nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
678 gdb-main-file nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
679 gdb-first-post-prompt t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
680 gdb-prompting nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
681 gdb-input-queue nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
682 gdb-current-item nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
683 gdb-pending-triggers nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
684 gdb-output-sink 'user
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
685 gdb-server-prefix "server "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
686 gdb-location-alist nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
687 gdb-source-file-list nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
688 gdb-error nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
689 gdb-macro-info nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
690 gdb-buffer-fringe-width (car (window-fringes))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
691 gdb-debug-log nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
692 gdb-signalled nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
693 gdb-source-window nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
694 gdb-inferior-status nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
695 gdb-continuation nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
696 gdb-look-up-stack nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
697 gdb-frame-begin nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
698 gdb-printing t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
699 gud-old-arrow nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
700 gdb-thread-indicator nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
701 gdb-register-names nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
702 gdb-recording nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
703
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
704 (setq gdb-buffer-type 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
705
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
706 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
707
107681
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
708 (if (eq system-type 'darwin)
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
709 (gdb-enqueue-input (list "server show version\n" 'gdb-apple-test)))
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
710
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
711 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
712 (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
713 'gdb-get-version)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
714
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
715 (defun gdb-init-2 ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
716 (if (eq window-system 'w32)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
717 (gdb-enqueue-input (list "set new-console off\n" 'ignore)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
718 (gdb-enqueue-input (list "set height 0\n" 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
719 (gdb-enqueue-input (list "set width 0\n" 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
720
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
721 (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
722 (if gdb-create-source-file-list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
723 (gdb-enqueue-input (list (concat gdb-server-prefix "info sources\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
724 'gdb-set-gud-minor-mode-existing-buffers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
725 (setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
726 ; Needs GDB 6.2 onwards.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
727 (if gdb-create-source-file-list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
728 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
729 (list "server interpreter mi \"-file-list-exec-source-files\"\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
730 'gdb-set-gud-minor-mode-existing-buffers-1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
731 (setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
732 ; Needs GDB 7.0 onwards.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
733 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
734 (list "server interpreter mi -enable-pretty-printing\n" 'ignore)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
735
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
736 ;; Find source file and compilation directory here.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
737 ;; Works for C, C++, Fortran and Ada but not Java (GDB 6.4)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
738 (gdb-enqueue-input (list "server list\n" 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
739 (gdb-enqueue-input (list "server list MAIN__\n" 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
740 (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
741
107681
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
742 ;; Workaround for some Apple versions of GDB that add ^M at EOL
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
743 ;; after the command "server interpreter mi -stack-info-frame".
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
744 (defun gdb-apple-test ()
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
745 (goto-char (point-min))
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
746 (if (re-search-forward "(Apple version " nil t)
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
747 (let* ((process (get-buffer-process gud-comint-buffer))
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
748 (coding-systems (process-coding-system process)))
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
749 (set-process-coding-system process
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
750 (coding-system-change-eol-conversion
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
751 (car coding-systems) 'dos)
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
752 (cdr coding-systems)))))
33d43eba45d4 (gdb-apple-test): New function.
Nick Roberts <nickrob@snap.net.nz>
parents: 107196
diff changeset
753
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
754 (defun gdb-get-version ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
755 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
756 (if (re-search-forward "Undefined\\( mi\\)* command:" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
757 (setq gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
758 (setq gdb-version "6.4+"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
759 (gdb-init-2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
760
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
761 (defmacro gdb-if-arrow (arrow-position &rest body)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
762 `(if ,arrow-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
763 (let ((buffer (marker-buffer ,arrow-position)) (line))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
764 (if (equal buffer (window-buffer (posn-window end)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
765 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
766 (when (or (equal start end)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
767 (equal (posn-point start)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
768 (marker-position ,arrow-position)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
769 ,@body))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
770
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
771 (defun gdb-mouse-until (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
772 "Continue running until a source line past the current line.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
773 The destination source line can be selected either by clicking
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
774 with mouse-3 on the fringe/margin or dragging the arrow
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
775 with mouse-1 (default bindings)."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
776 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
777 (let ((start (event-start event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
778 (end (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
779 (gdb-if-arrow gud-overlay-arrow-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
780 (setq line (line-number-at-pos (posn-point end)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
781 (gud-call (concat "until " (number-to-string line))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
782 (gdb-if-arrow gdb-overlay-arrow-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
783 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
784 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
785 (forward-line (1- (line-number-at-pos (posn-point end))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
786 (forward-char 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
787 (gud-call (concat "until *%a"))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
788
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
789 (defun gdb-mouse-jump (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
790 "Set execution address/line.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
791 The destination source line can be selected either by clicking with C-mouse-3
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
792 on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
793 Unlike `gdb-mouse-until' the destination address can be before the current
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
794 line, and no execution takes place."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
795 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
796 (let ((start (event-start event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
797 (end (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
798 (gdb-if-arrow gud-overlay-arrow-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
799 (setq line (line-number-at-pos (posn-point end)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
800 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
801 (gud-call (concat "tbreak " (number-to-string line)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
802 (gud-call (concat "jump " (number-to-string line)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
803 (gdb-if-arrow gdb-overlay-arrow-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
804 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
805 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
806 (forward-line (1- (line-number-at-pos (posn-point end))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
807 (forward-char 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
808 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
809 (gud-call (concat "tbreak *%a"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
810 (gud-call (concat "jump *%a")))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
811
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
812 (defcustom gdb-speedbar-auto-raise nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
813 "If non-nil raise speedbar every time display of watch expressions is\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
814 updated."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
815 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
816 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
817 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
818
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
819 (defun gdb-speedbar-auto-raise (arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
820 "Toggle automatic raising of the speedbar for watch expressions.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
821 With prefix argument ARG, automatically raise speedbar if ARG is
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
822 positive, otherwise don't automatically raise it."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
823 (interactive "P")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
824 (setq gdb-speedbar-auto-raise
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
825 (if (null arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
826 (not gdb-speedbar-auto-raise)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
827 (> (prefix-numeric-value arg) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
828 (message (format "Auto raising %sabled"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
829 (if gdb-speedbar-auto-raise "en" "dis"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
830
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
831 (defcustom gdb-use-colon-colon-notation nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
832 "If non-nil use FUN::VAR format to display variables in the speedbar."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
833 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
834 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
835 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
836
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
837 (define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
838 (define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
839
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
840 (declare-function tooltip-identifier-from-point "tooltip" (point))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
841
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
842 (defun gud-watch (&optional arg event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
843 "Watch expression at point.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
844 With arg, enter name of variable to be watched in the minibuffer."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
845 (interactive (list current-prefix-arg last-input-event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
846 (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
847 (if (memq minor-mode '(gdbmi gdba))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
848 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
849 (if event (posn-set-point (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
850 (require 'tooltip)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
851 (save-selected-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
852 (let ((expr
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
853 (if arg
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
854 (completing-read "Name of variable: "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
855 'gud-gdb-complete-command)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
856 (if (and transient-mark-mode mark-active)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
857 (buffer-substring (region-beginning) (region-end))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
858 (concat (if (eq major-mode 'gdb-registers-mode) "$")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
859 (tooltip-identifier-from-point (point)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
860 (set-text-properties 0 (length expr) nil expr)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
861 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
862 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
863 (if (eq minor-mode 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
864 (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
865 "server interpreter mi \"-var-create - * " expr "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
866 (concat"-var-create - * " expr "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
867 `(lambda () (gdb-var-create-handler ,expr)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
868 (message "gud-watch is a no-op in this mode."))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
869
106680
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
870 (declare-function speedbar-change-initial-expansion-list "speedbar" (new-default))
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
871
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
872 (defun gdb-var-create-handler (expr)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
873 (let* ((result (gdb-json-partial-output)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
874 (if (not (bindat-get-field result 'msg))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
875 (let ((var
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
876 (list (bindat-get-field result 'name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
877 (if (and (string-equal gdb-current-language "c")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
878 gdb-use-colon-colon-notation gdb-selected-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
879 (setq expr (concat gdb-selected-frame "::" expr))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
880 expr)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
881 (bindat-get-field result 'numchild)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
882 (bindat-get-field result 'type)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
883 (bindat-get-field result 'value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
884 nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
885 (bindat-get-field result 'has_more)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
886 gdb-frame-address)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
887 (push var gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
888 (speedbar 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
889 (unless (string-equal
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
890 speedbar-initial-expansion-list-name "GUD")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
891 (speedbar-change-initial-expansion-list "GUD")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
892 (message-box "No symbol \"%s\" in current context." expr))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
893
106680
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
894 (declare-function speedbar-timer-fn "speedbar" ())
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
895
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
896 (defun gdb-speedbar-update ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
897 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
898 (not (member 'gdb-speedbar-timer gdb-pending-triggers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
899 ;; Dummy command to update speedbar even when idle.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
900 (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
901 ;; Keep gdb-pending-triggers non-nil till end.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
902 (push 'gdb-speedbar-timer gdb-pending-triggers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
903
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
904 (defun gdb-speedbar-timer-fn ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
905 (if gdb-speedbar-auto-raise
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
906 (raise-frame speedbar-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
907 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
908 (delq 'gdb-speedbar-timer gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
909 (speedbar-timer-fn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
910
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
911 (defun gdb-var-evaluate-expression-handler (varnum changed)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
912 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
913 (re-search-forward "\\(.+\\)\\^done,value=\\(\".*\"\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
914 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
915 (delq (string-to-number (match-string 1)) gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
916 (let ((var (assoc varnum gdb-var-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
917 (when var
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
918 (if changed (setcar (nthcdr 5 var) 'changed))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
919 (setcar (nthcdr 4 var) (read (match-string 2)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
920 (gdb-speedbar-update))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
921
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
922 (defun gdb-var-list-children (varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
923 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
924 (list (concat "server interpreter mi \"-var-list-children " varnum "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
925 `(lambda () (gdb-var-list-children-handler ,varnum)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
926
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
927 (defconst gdb-var-list-children-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
928 "child={.*?name=\"\\(.*?\\)\".*?,exp=\"\\(.*?\\)\".*?,\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
929 numchild=\"\\(.*?\\)\"\\(}\\|.*?,\\(type=\"\\(.*?\\)\"\\)?.*?}\\)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
930
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
931 (defun gdb-var-list-children-handler (varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
932 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
933 (let ((var-list nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
934 (catch 'child-already-watched
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
935 (dolist (var gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
936 (if (string-equal varnum (car var))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
937 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
938 (push var var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
939 (while (re-search-forward gdb-var-list-children-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
940 (let ((varchild (list (match-string 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
941 (match-string 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
942 (match-string 3)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
943 (match-string 6)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
944 nil nil)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
945 (if (assoc (car varchild) gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
946 (throw 'child-already-watched nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
947 (push varchild var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
948 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
949 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
950 (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
951 "server interpreter mi \"0-var-evaluate-expression "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
952 (car varchild) "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
953 `(lambda () (gdb-var-evaluate-expression-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
954 ,(car varchild) nil)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
955 (push var var-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
956 (setq gdb-var-list (nreverse var-list)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
957
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
958 (defun gdb-var-update ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
959 (when (not (member 'gdb-var-update gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
960 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
961 (list "server interpreter mi \"-var-update *\"\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
962 'gdb-var-update-handler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
963 (push 'gdb-var-update gdb-pending-triggers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
964
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
965 (defconst gdb-var-update-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
966 "{.*?name=\"\\(.*?\\)\".*?,in_scope=\"\\(.*?\\)\".*?,\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
967 type_changed=\".*?\".*?}")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
968
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
969 (defun gdb-var-update-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
970 (dolist (var gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
971 (setcar (nthcdr 5 var) nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
972 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
973 (let ((n 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
974 (while (re-search-forward gdb-var-update-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
975 (let ((varnum (match-string 1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
976 (if (string-equal (match-string 2) "false")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
977 (let ((var (assoc varnum gdb-var-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
978 (if var (setcar (nthcdr 5 var) 'out-of-scope)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
979 (setq n (1+ n))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
980 (push n gdb-pending-triggers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
981 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
982 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
983 (concat "server interpreter mi \"" (number-to-string n)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
984 "-var-evaluate-expression " varnum "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
985 `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
986 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
987 (delq 'gdb-var-update gdb-pending-triggers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
988
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
989 (defun gdb-var-set-format (format)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
990 "Set the output format for a variable displayed in the speedbar."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
991 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
992 (varnum (car var)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
993 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
994 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
995 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
996 (concat "server interpreter mi \"-var-set-format "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
997 varnum " " format "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
998 (concat "-var-set-format " varnum " " format "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
999 `(lambda () (gdb-var-set-format-handler ,varnum))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1000
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1001 (defconst gdb-var-set-format-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1002 "format=\"\\(.*?\\)\",.*value=\"\\(.*?\\)\"")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1003
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1004 (defun gdb-var-set-format-handler (varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1005 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1006 (if (re-search-forward gdb-var-set-format-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1007 (let ((var (assoc varnum gdb-var-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1008 (setcar (nthcdr 4 var) (match-string 2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1009 (gdb-var-update-1))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1010
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1011 (defun gdb-var-delete-1 (var varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1012 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1013 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1014 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1015 (concat "server interpreter mi \"-var-delete " varnum "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1016 (concat "-var-delete " varnum "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1017 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1018 (setq gdb-var-list (delq var gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1019 (dolist (varchild gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1020 (if (string-match (concat (car var) "\\.") (car varchild))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1021 (setq gdb-var-list (delq varchild gdb-var-list)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1022
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1023 (defun gdb-var-delete ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1024 "Delete watch expression at point from the speedbar."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1025 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1026 (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1027 '(gdbmi gdba))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1028 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1029 (varnum (car var)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1030 (if (string-match "\\." (car var))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1031 (message-box "Can only delete a root expression")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1032 (gdb-var-delete-1 var varnum)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1033
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1034 (defun gdb-var-delete-children (varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1035 "Delete children of variable object at point from the speedbar."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1036 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1037 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1038 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1039 (concat "server interpreter mi \"-var-delete -c " varnum "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1040 (concat "-var-delete -c " varnum "\n")) 'ignore)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1041
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1042 (defun gdb-edit-value (text token indent)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1043 "Assign a value to a variable displayed in the speedbar."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1044 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1045 (varnum (car var)) (value))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1046 (setq value (read-string "New value: "))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1047 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1048 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1049 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1050 (concat "server interpreter mi \"-var-assign "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1051 varnum " " value "\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1052 (concat "-var-assign " varnum " " value "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1053 `(lambda () (gdb-edit-value-handler ,value))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1054
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1055 (defun gdb-edit-value-handler (value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1056 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1057 (if (re-search-forward gdb-error-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1058 (message-box "Invalid number or expression (%s)" value)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1059
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1060 (defcustom gdb-show-changed-values t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1061 "If non-nil change the face of out of scope variables and changed values.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1062 Out of scope variables are suppressed with `shadow' face.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1063 Changed values are highlighted with the face `font-lock-warning-face'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1064 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1065 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1066 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1067
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1068 (defcustom gdb-max-children 40
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1069 "Maximum number of children before expansion requires confirmation."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1070 :type 'integer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1071 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1072 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1073
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1074 (defcustom gdb-delete-out-of-scope t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1075 "If non-nil delete watch expressions automatically when they go out of scope."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1076 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1077 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1078 :version "22.2")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1079
106680
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
1080 (declare-function speedbar-change-expand-button-char "speedbar" (char))
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
1081 (declare-function speedbar-delete-subblock "speedbar" (indent))
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
1082 (declare-function speedbar-center-buffer-smartly "speedbar" ())
63c5fb6b67fc Declare some functions for the byte-compiler.
Juanma Barranquero <lekktu@gmail.com>
parents: 106678
diff changeset
1083
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1084 (defun gdb-speedbar-expand-node (text token indent)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1085 "Expand the node the user clicked on.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1086 TEXT is the text of the button we clicked on, a + or - item.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1087 TOKEN is data related to this node.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1088 INDENT is the current indentation depth."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1089 (if (and gud-comint-buffer (buffer-name gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1090 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1091 (cond ((string-match "+" text) ;expand this node
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1092 (let* ((var (assoc token gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1093 (expr (nth 1 var)) (children (nth 2 var)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1094 (if (or (<= (string-to-number children) gdb-max-children)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1095 (y-or-n-p
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1096 (format
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
1097 "%s has %s children. Continue? " expr children)))
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1098 (if (and (eq (buffer-local-value
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1099 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1100 (string-equal gdb-version "pre-6.4"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1101 (gdb-var-list-children token)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1102 (gdb-var-list-children-1 token)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1103 ((string-match "-" text) ;contract this node
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1104 (dolist (var gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1105 (if (string-match (concat token "\\.") (car var))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1106 (setq gdb-var-list (delq var gdb-var-list))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1107 (gdb-var-delete-children token)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1108 (speedbar-change-expand-button-char ?+)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1109 (speedbar-delete-subblock indent))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1110 (t (error "Ooops... not sure what to do")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1111 (speedbar-center-buffer-smartly))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1112 (message-box "GUD session has been killed")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1113
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1114 (defun gdb-get-target-string ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1115 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1116 gud-target-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1117
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1118
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1119 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1120 ;; gdb buffers.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1121 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1122 ;; Each buffer has a TYPE -- a symbol that identifies the function
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1123 ;; of that particular buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1124 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1125 ;; The usual gdb interaction buffer is given the type `gdba' and
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1126 ;; is constructed specially.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1127 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1128 ;; Others are constructed by gdb-get-buffer-create and
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1129 ;; named according to the rules set forth in the gdb-buffer-rules-assoc
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1130
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1131 (defvar gdb-buffer-rules-assoc '())
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1132
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1133 (defun gdb-get-buffer (key)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1134 "Return the gdb buffer tagged with type KEY.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1135 The key should be one of the cars in `gdb-buffer-rules-assoc'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1136 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1137 (gdb-look-for-tagged-buffer key (buffer-list))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1138
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1139 (defun gdb-get-buffer-create (key)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1140 "Create a new gdb buffer of the type specified by KEY.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1141 The key should be one of the cars in `gdb-buffer-rules-assoc'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1142 (or (gdb-get-buffer key)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1143 (let* ((rules (assoc key gdb-buffer-rules-assoc))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1144 (name (funcall (gdb-rules-name-maker rules)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1145 (new (get-buffer-create name)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1146 (with-current-buffer new
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1147 (let ((trigger))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1148 (if (cdr (cdr rules))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1149 (setq trigger (funcall (car (cdr (cdr rules))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1150 (setq gdb-buffer-type key)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1151 (set (make-local-variable 'gud-minor-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1152 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1153 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1154 (if trigger (funcall trigger)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1155 new))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1156
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1157 (defun gdb-rules-name-maker (rules) (car (cdr rules)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1158
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1159 (defun gdb-look-for-tagged-buffer (key bufs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1160 (let ((retval nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1161 (while (and (not retval) bufs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1162 (set-buffer (car bufs))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1163 (if (eq gdb-buffer-type key)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1164 (setq retval (car bufs)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1165 (setq bufs (cdr bufs)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1166 retval))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1167
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1168 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1169 ;; This assoc maps buffer type symbols to rules. Each rule is a list of
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1170 ;; at least one and possible more functions. The functions have these
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1171 ;; roles in defining a buffer type:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1172 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1173 ;; NAME - Return a name for this buffer type.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1174 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1175 ;; The remaining function(s) are optional:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1176 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1177 ;; MODE - called in a new buffer with no arguments, should establish
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1178 ;; the proper mode for the buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1179 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1180
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1181 (defun gdb-set-buffer-rules (buffer-type &rest rules)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1182 (let ((binding (assoc buffer-type gdb-buffer-rules-assoc)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1183 (if binding
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1184 (setcdr binding rules)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1185 (push (cons buffer-type rules)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1186 gdb-buffer-rules-assoc))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1187
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1188 ;; GUD buffers are an exception to the rules
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1189 (gdb-set-buffer-rules 'gdba 'error)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1190
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1191 ;; Partial-output buffer : This accumulates output from a command executed on
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1192 ;; behalf of emacs (rather than the user).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1193 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1194 (gdb-set-buffer-rules 'gdb-partial-output-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1195 'gdb-partial-output-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1196
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1197 (defun gdb-partial-output-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1198 (concat " *partial-output-"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1199 (gdb-get-target-string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1200 "*"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1201
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1202
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1203 (gdb-set-buffer-rules 'gdb-inferior-io
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1204 'gdb-inferior-io-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1205 'gdb-inferior-io-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1206
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1207 (defun gdb-inferior-io-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1208 (concat "*input/output of "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1209 (gdb-get-target-string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1210 "*"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1211
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1212 (defun gdb-display-separate-io-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1213 "Display IO of debugged program in a separate window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1214 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1215 (if gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1216 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1217 (gdb-get-buffer-create 'gdb-inferior-io) t)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1218
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1219 (defconst gdb-frame-parameters
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1220 '((height . 14) (width . 80)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1221 (unsplittable . t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1222 (tool-bar-lines . nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1223 (menu-bar-lines . nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1224 (minibuffer . nil)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1225
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1226 (defun gdb-frame-separate-io-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1227 "Display IO of debugged program in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1228 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1229 (if gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1230 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1231 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1232 (display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1233
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1234 (defvar gdb-inferior-io-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1235 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1236 (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1237 (define-key map "\C-c\C-z" 'gdb-separate-io-stop)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1238 (define-key map "\C-c\C-\\" 'gdb-separate-io-quit)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1239 (define-key map "\C-c\C-d" 'gdb-separate-io-eof)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1240 (define-key map "\C-d" 'gdb-separate-io-eof)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1241 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1242
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1243 (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1244 "Major mode for gdb inferior-io."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1245 :syntax-table nil :abbrev-table nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1246 ;; We want to use comint because it has various nifty and familiar
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1247 ;; features. We don't need a process, but comint wants one, so create
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1248 ;; a dummy one.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1249 (make-comint-in-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1250 (substring (buffer-name) 1 (- (length (buffer-name)) 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1251 (current-buffer) "hexl")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1252 (setq comint-input-sender 'gdb-inferior-io-sender))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1253
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1254 (defun gdb-inferior-io-sender (proc string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1255 ;; PROC is the pseudo-process created to satisfy comint.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1256 (with-current-buffer (process-buffer proc)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1257 (setq proc (get-buffer-process gud-comint-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1258 (process-send-string proc string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1259 (process-send-string proc "\n")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1260
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1261 (defun gdb-separate-io-interrupt ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1262 "Interrupt the program being debugged."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1263 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1264 (interrupt-process
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1265 (get-buffer-process gud-comint-buffer) comint-ptyp))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1266
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1267 (defun gdb-separate-io-quit ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1268 "Send quit signal to the program being debugged."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1269 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1270 (quit-process
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1271 (get-buffer-process gud-comint-buffer) comint-ptyp))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1272
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1273 (defun gdb-separate-io-stop ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1274 "Stop the program being debugged."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1275 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1276 (stop-process
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1277 (get-buffer-process gud-comint-buffer) comint-ptyp))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1278
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1279 (defun gdb-separate-io-eof ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1280 "Send end-of-file to the program being debugged."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1281 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1282 (process-send-eof
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1283 (get-buffer-process gud-comint-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1284
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1285
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1286 ;; gdb communications
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1287 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1288
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1289 ;; INPUT: things sent to gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1290 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1291 ;; The queues are lists. Each element is either a string (indicating user or
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1292 ;; user-like input) or a list of the form:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1293 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1294 ;; (INPUT-STRING HANDLER-FN)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1295 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1296 ;; The handler function will be called from the partial-output buffer when the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1297 ;; command completes. This is the way to write commands which invoke gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1298 ;; commands autonomously.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1299 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1300 ;; These lists are consumed tail first.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1301 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1302
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1303 (defun gdb-send (proc string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1304 "A comint send filter for gdb.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1305 This filter may simply queue input for a later time."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1306 (if gdb-ready
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1307 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1308 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1309 (let ((inhibit-read-only t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1310 (remove-text-properties (point-min) (point-max) '(face))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1311 (if gud-running
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1312 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1313 (let ((item (concat string "\n")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1314 (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1315 (process-send-string proc item)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1316 (if (string-match "\\\\\\'" string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1317 (setq gdb-continuation (concat gdb-continuation string "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1318 (let ((item (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1319 gdb-continuation string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1320 (if (not comint-input-sender-no-newline) "\n"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1321 (gdb-enqueue-input item)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1322 (setq gdb-continuation nil)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1323 (push (concat string "\n") gdb-early-user-input)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1324
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1325 ;; Note: Stuff enqueued here will be sent to the next prompt, even if it
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1326 ;; is a query, or other non-top-level prompt.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1327
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1328 (defun gdb-enqueue-input (item)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1329 (if (not gud-running)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1330 (if gdb-prompting
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1331 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1332 (gdb-send-item item)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1333 (setq gdb-prompting nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1334 (push item gdb-input-queue))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1335
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1336 (defun gdb-dequeue-input ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1337 (let ((queue gdb-input-queue))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1338 (if queue
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1339 (let ((last (car (last queue))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1340 (unless (nbutlast queue) (setq gdb-input-queue '()))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1341 last)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1342 ;; This should be nil here anyway but set it just to make sure.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1343 (setq gdb-pending-triggers nil))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1344
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1345 (defun gdb-send-item (item)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1346 (setq gdb-flush-pending-output nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1347 (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1348 (setq gdb-current-item item)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1349 (let ((process (get-buffer-process gud-comint-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1350 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1351 (if (stringp item)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1352 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1353 (setq gdb-output-sink 'user)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1354 (process-send-string process item))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1355 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1356 (gdb-clear-partial-output)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1357 (setq gdb-output-sink 'pre-emacs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1358 (process-send-string process
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1359 (car item))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1360 ;; case: eq gud-minor-mode 'gdbmi
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1361 (gdb-clear-partial-output)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1362 (setq gdb-output-sink 'emacs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1363 (process-send-string process (car item)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1364
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1365 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1366 ;; output -- things gdb prints to emacs
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1367 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1368 ;; GDB output is a stream interrupted by annotations.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1369 ;; Annotations can be recognized by their beginning
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1370 ;; with \C-j\C-z\C-z<tag><opt>\C-j
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1371 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1372 ;; The tag is a string obeying symbol syntax.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1373 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1374 ;; The optional part `<opt>' can be either the empty string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1375 ;; or a space followed by more data relating to the annotation.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1376 ;; For example, the SOURCE annotation is followed by a filename,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1377 ;; line number and various useless goo. This data must not include
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1378 ;; any newlines.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1379 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1380
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1381 (defcustom gud-gdb-command-name "gdb --annotate=3"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1382 "Default command to execute an executable under the GDB debugger.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1383 The option \"--annotate=3\" must be included in this value if you
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1384 want the GDB Graphical Interface."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1385 :type 'string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1386 :group 'gud
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1387 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1388
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1389 (defvar gdb-annotation-rules
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1390 '(("pre-prompt" gdb-pre-prompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1391 ("prompt" gdb-prompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1392 ("commands" gdb-subprompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1393 ("overload-choice" gdb-subprompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1394 ("query" gdb-subprompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1395 ;; Need this prompt for GDB 6.1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1396 ("nquery" gdb-subprompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1397 ("prompt-for-continue" gdb-subprompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1398 ("post-prompt" gdb-post-prompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1399 ("source" gdb-source)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1400 ("starting" gdb-starting)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1401 ("exited" gdb-exited)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1402 ("signalled" gdb-signalled)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1403 ("signal" gdb-signal)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1404 ("breakpoint" gdb-stopping)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1405 ("watchpoint" gdb-stopping)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1406 ("frame-begin" gdb-frame-begin)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1407 ("stopped" gdb-stopped)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1408 ("error-begin" gdb-error)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1409 ("error" gdb-error)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1410 ("new-thread" (lambda (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1411 (gdb-get-buffer-create 'gdb-threads-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1412 ("thread-changed" gdb-thread-changed))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1413 "An assoc mapping annotation tags to functions which process them.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1414
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1415 (defun gdb-resync()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1416 (setq gdb-flush-pending-output t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1417 (setq gud-running nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1418 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1419 (propertize "stopped" 'face font-lock-warning-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1420 (setq gdb-output-sink 'user)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1421 (setq gdb-input-queue nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1422 (setq gdb-pending-triggers nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1423 (setq gdb-prompting t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1424
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1425 (defconst gdb-source-spec-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1426 "\\(.*\\):\\([0-9]*\\):[0-9]*:[a-z]*:0x0*\\([a-f0-9]*\\)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1427
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1428 ;; Do not use this except as an annotation handler.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1429 (defun gdb-source (args)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1430 (string-match gdb-source-spec-regexp args)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1431 ;; Extract the frame position from the marker.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1432 (setq gud-last-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1433 (cons
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1434 (match-string 1 args)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1435 (string-to-number (match-string 2 args))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1436 (setq gdb-pc-address (match-string 3 args))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1437 ;; cover for auto-display output which comes *before*
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1438 ;; stopped annotation
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1439 (if (eq gdb-output-sink 'inferior) (setq gdb-output-sink 'user)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1440
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1441 (defun gdb-pre-prompt (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1442 "An annotation handler for `pre-prompt'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1443 This terminates the collection of output from a previous command if that
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1444 happens to be in effect."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1445 (setq gdb-error nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1446 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1447 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1448 ((eq sink 'user) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1449 ((eq sink 'emacs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1450 (setq gdb-output-sink 'post-emacs))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1451 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1452 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1453 (error "Phase error in gdb-pre-prompt (got %s)" sink)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1454
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1455 (defun gdb-prompt (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1456 "An annotation handler for `prompt'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1457 This sends the next command (if any) to gdb."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1458 (when gdb-first-prompt
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1459 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1460 (propertize "initializing..." 'face font-lock-variable-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1461 (gdb-init-1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1462 (setq gdb-first-prompt nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1463 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1464 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1465 ((eq sink 'user) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1466 ((eq sink 'post-emacs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1467 (setq gdb-output-sink 'user)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1468 (let ((handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1469 (car (cdr gdb-current-item))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1470 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1471 (funcall handler))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1472 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1473 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1474 (error "Phase error in gdb-prompt (got %s)" sink))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1475 (let ((input (gdb-dequeue-input)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1476 (if input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1477 (gdb-send-item input)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1478 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1479 (setq gdb-prompting t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1480 (gud-display-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1481 (setq gdb-early-user-input (nreverse gdb-early-user-input))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1482 (while gdb-early-user-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1483 (gdb-enqueue-input (car gdb-early-user-input))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1484 (setq gdb-early-user-input (cdr gdb-early-user-input)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1485
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1486 (defun gdb-subprompt (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1487 "An annotation handler for non-top-level prompts."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1488 (setq gdb-prompting t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1489
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1490 (defun gdb-starting (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1491 "An annotation handler for `starting'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1492 This says that I/O for the subprocess is now the program being debugged,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1493 not GDB."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1494 (setq gdb-active-process t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1495 (setq gdb-printing t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1496 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1497 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1498 ((eq sink 'user)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1499 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1500 (setq gud-running t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1501 (setq gdb-stack-update t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1502 ;; Temporarily set gud-running to nil to force "info stack" onto queue.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1503 (let ((gud-running nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1504 (gdb-invalidate-frames)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1505 (unless (or gdb-register-names
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
1506 (string-equal gdb-version "pre-6.4"))
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1507 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1508 (list "server interpreter mi -data-list-register-names\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1509 'gdb-get-register-names))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1510 (setq gdb-inferior-status "running")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1511 (setq gdb-signalled nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1512 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1513 (propertize gdb-inferior-status 'face font-lock-type-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1514 (gdb-remove-text-properties)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1515 (setq gud-old-arrow gud-overlay-arrow-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1516 (setq gud-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1517 (setq gdb-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1518 (setq gdb-stack-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1519 (if gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1520 (setq gdb-output-sink 'inferior))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1521 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1522 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1523 (error "Unexpected `starting' annotation")))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1524
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1525 (defun gdb-signal (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1526 (setq gdb-inferior-status "signal")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1527 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1528 (propertize gdb-inferior-status 'face font-lock-warning-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1529 (gdb-stopping ignored))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1530
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1531 (defun gdb-stopping (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1532 "An annotation handler for `breakpoint' and other annotations.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1533 They say that I/O for the subprocess is now GDB, not the program
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1534 being debugged."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1535 (if gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1536 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1537 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1538 ((eq sink 'inferior)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1539 (setq gdb-output-sink 'user))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1540 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1541 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1542 (error "Unexpected stopping annotation"))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1543
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1544 (defun gdb-exited (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1545 "An annotation handler for `exited' and `signalled'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1546 They say that I/O for the subprocess is now GDB, not the program
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1547 being debugged and that the program is no longer running. This
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1548 function is used to change the focus of GUD tooltips to #define
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1549 directives."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1550 (setq gdb-active-process nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1551 (setq gud-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1552 (setq gdb-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1553 (setq gdb-stack-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1554 (setq gud-old-arrow nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1555 (setq gdb-inferior-status "exited")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1556 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1557 (propertize gdb-inferior-status 'face font-lock-warning-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1558 (gdb-stopping ignored))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1559
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1560 (defun gdb-signalled (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1561 (setq gdb-signalled t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1562
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1563 (defun gdb-frame-begin (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1564 (setq gdb-frame-begin t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1565 (setq gdb-printing nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1566 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1567 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1568 ((eq sink 'inferior)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1569 (setq gdb-output-sink 'user))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1570 ((eq sink 'user) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1571 ((eq sink 'emacs) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1572 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1573 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1574 (error "Unexpected frame-begin annotation (%S)" sink)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1575
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1576 (defcustom gdb-same-frame (not focus-follows-mouse)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1577 "Non-nil means pop up GUD buffer in same frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1578 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1579 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1580 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1581
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1582 (defcustom gdb-find-source-frame nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1583 "Non-nil means try to find a source frame further up stack e.g after signal."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1584 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1585 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1586 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1587
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1588 (defun gdb-find-source-frame (arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1589 "Toggle looking for a source frame further up call stack.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1590 The code associated with current (innermost) frame may not have
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1591 been compiled with debug information, e.g., C library routine.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1592 With prefix argument ARG, look for a source frame further up
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1593 stack to display in the source buffer if ARG is positive,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1594 otherwise don't look further up."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1595 (interactive "P")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1596 (setq gdb-find-source-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1597 (if (null arg)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1598 (not gdb-find-source-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1599 (> (prefix-numeric-value arg) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1600 (message (format "Looking for source frame %sabled"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1601 (if gdb-find-source-frame "en" "dis"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1602
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1603 (defun gdb-stopped (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1604 "An annotation handler for `stopped'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1605 It is just like `gdb-stopping', except that if we already set the output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1606 sink to `user' in `gdb-stopping', that is fine."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1607 (setq gud-running nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1608 (unless (or gud-overlay-arrow-position gud-last-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1609 (if (and gdb-frame-begin gdb-printing)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1610 (setq gud-overlay-arrow-position gud-old-arrow)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1611 ;;Pop up GUD buffer to display current frame when it doesn't have source
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1612 ;;information i.e if not compiled with -g as with libc routines generally.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1613 (if gdb-same-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1614 (gdb-display-gdb-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1615 (gdb-frame-gdb-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1616 (if gdb-find-source-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1617 ;;Try to find source further up stack e.g after signal.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1618 (setq gdb-look-up-stack
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1619 (if (gdb-get-buffer 'gdb-stack-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1620 'keep
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1621 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1622 (gdb-get-buffer-create 'gdb-stack-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1623 (gdb-invalidate-frames)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1624 'delete))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1625 (unless (member gdb-inferior-status '("exited" "signal"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1626 (setq gdb-active-process t) ;Just for attaching case.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1627 (setq gdb-inferior-status "stopped")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1628 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1629 (propertize gdb-inferior-status 'face font-lock-warning-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1630 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1631 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1632 ((eq sink 'inferior)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1633 (setq gdb-output-sink 'user))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1634 ((eq sink 'user) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1635 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1636 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1637 (error "Unexpected stopped annotation"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1638 (if gdb-signalled (gdb-exited ignored)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1639
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1640 (defun gdb-error (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1641 (setq gdb-error (not gdb-error)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1642
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1643 (defun gdb-thread-changed (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1644 (gdb-frames-force-update))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1645
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1646 (defun gdb-post-prompt (ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1647 "An annotation handler for `post-prompt'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1648 This begins the collection of output from the current command if that
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1649 happens to be appropriate."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1650 ;; Don't add to queue if there outstanding items or gdb-version is not known
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1651 ;; yet.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1652 (unless (or gdb-pending-triggers gdb-first-post-prompt)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1653 (gdb-get-selected-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1654 (gdb-invalidate-frames)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1655 ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1656 (gdb-get-buffer-create 'gdb-breakpoints-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1657 (gdb-invalidate-breakpoints)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1658 ;; Do this through gdb-get-selected-frame -> gdb-frame-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1659 ;; so gdb-pc-address is updated.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1660 ;; (gdb-invalidate-assembler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1661
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1662 (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1663 (gdb-invalidate-registers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1664 (gdb-get-changed-registers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1665 (gdb-invalidate-registers-1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1666
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1667 (gdb-invalidate-memory)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1668 (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1669 (gdb-invalidate-locals)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1670 (gdb-invalidate-locals-1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1671
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1672 (gdb-invalidate-threads)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1673 (unless (or (null gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1674 (eq system-type 'darwin)) ;Breaks on Darwin's GDB-5.3.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1675 ;; FIXME: with GDB-6 on Darwin, this might very well work.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1676 ;; Only needed/used with speedbar/watch expressions.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1677 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1678 (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1679 (gdb-var-update)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1680 (gdb-var-update-1)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1681 (setq gdb-first-post-prompt nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1682 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1683 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1684 ((eq sink 'user) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1685 ((eq sink 'pre-emacs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1686 (setq gdb-output-sink 'emacs))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1687 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1688 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1689 (error "Phase error in gdb-post-prompt (got %s)" sink)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1690
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1691 (defconst gdb-buffer-list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1692 '(gdb-stack-buffer gdb-locals-buffer gdb-registers-buffer gdb-threads-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1693
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1694 (defun gdb-remove-text-properties ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1695 (dolist (buffertype gdb-buffer-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1696 (let ((buffer (gdb-get-buffer buffertype)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1697 (if buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1698 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1699 (let ((inhibit-read-only t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1700 (remove-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1701 (point-min) (point-max) '(mouse-face nil help-echo nil))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1702
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1703 ;; GUD displays the selected GDB frame. This might might not be the current
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1704 ;; GDB frame (after up, down etc). If no GDB frame is visible but the last
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1705 ;; visited breakpoint is, use that window.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1706 (defun gdb-display-source-buffer (buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1707 (let* ((last-window (if gud-last-last-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1708 (get-buffer-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1709 (gud-find-file (car gud-last-last-frame)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1710 (source-window (or last-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1711 (if (and gdb-source-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1712 (window-live-p gdb-source-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1713 gdb-source-window))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1714 (when source-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1715 (setq gdb-source-window source-window)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1716 (set-window-buffer source-window buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1717 source-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1718
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1719 ;; Derived from gud-gdb-marker-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1720 (defvar gdb-fullname-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1721 (concat "\\(.:?[^" ":" "\n]*\\)" ":" "\\([0-9]*\\)" ":" ".*"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1722
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1723 (defun gud-gdba-marker-filter (string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1724 "A gud marker filter for gdb. Handle a burst of output from GDB."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1725 (if gdb-flush-pending-output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1726 nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1727 (when gdb-enable-debug
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1728 (push (cons 'recv string) gdb-debug-log)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1729 (if (and gdb-debug-log-max
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1730 (> (length gdb-debug-log) gdb-debug-log-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1731 (setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1732 ;; Recall the left over gud-marker-acc from last time.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1733 (setq gud-marker-acc (concat gud-marker-acc string))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1734 ;; Start accumulating output for the GUD buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1735 (let ((output ""))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1736 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1737 ;; Process all the complete markers in this chunk.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1738 (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1739 (let ((annotation (match-string 1 gud-marker-acc))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1740 (before (substring gud-marker-acc 0 (match-beginning 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1741 (after (substring gud-marker-acc (match-end 0))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1742 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1743 ;; Parse the tag from the annotation, and maybe its arguments.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1744 (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1745 (let* ((annotation-type (match-string 1 annotation))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1746 (annotation-arguments (match-string 2 annotation))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1747 (annotation-rule (assoc annotation-type
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1748 gdb-annotation-rules)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1749
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1750 ;; Stuff prior to the match is just ordinary output.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1751 ;; It is either concatenated to OUTPUT or directed
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1752 ;; elsewhere.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1753 (setq output (gdb-concat-output output before))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1754
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1755 ;; Take that stuff off the gud-marker-acc.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1756 (setq gud-marker-acc after)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1757
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1758 ;; Call the handler for this annotation.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1759 (if annotation-rule
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1760 (funcall (car (cdr annotation-rule))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1761 annotation-arguments))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1762
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1763 ;; Else the annotation is not recognized. Ignore it silently,
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1764 ;; so that GDB can add new annotations without causing
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1765 ;; us to blow up.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1766 )))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1767
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1768 ;; Does the remaining text end in a partial line?
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1769 ;; If it does, then keep part of the gud-marker-acc until we get more.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1770 (if (string-match "\n\\'\\|\n\032\\'\\|\n\032\032.*\\'"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1771 gud-marker-acc)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1772 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1773 ;; Everything before the potential marker start can be output.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1774 (setq output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1775 (gdb-concat-output output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1776 (substring gud-marker-acc 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1777 (match-beginning 0))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1778 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1779 ;; Everything after, we save, to combine with later input.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1780 (setq gud-marker-acc (substring gud-marker-acc
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1781 (match-beginning 0))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1782 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1783 ;; In case we know the gud-marker-acc contains no partial annotations:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1784 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1785 (setq output (gdb-concat-output output gud-marker-acc))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1786 (setq gud-marker-acc "")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1787 output)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1788
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1789 (defun gdb-concat-output (so-far new)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1790 (if gdb-error
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1791 (put-text-property 0 (length new) 'face font-lock-warning-face new))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1792 (let ((sink gdb-output-sink))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1793 (cond
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1794 ((eq sink 'user) (concat so-far new))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1795 ((or (eq sink 'pre-emacs) (eq sink 'post-emacs)) so-far)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1796 ((eq sink 'emacs)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1797 (gdb-append-to-partial-output new)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1798 so-far)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1799 ((eq sink 'inferior)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1800 (gdb-append-to-inferior-io new)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1801 so-far)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1802 (t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1803 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1804 (error "Bogon output sink %S" sink)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1805
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1806 (defun gdb-append-to-partial-output (string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1807 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1808 (goto-char (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1809 (insert string)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1810
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1811 (defun gdb-clear-partial-output ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1812 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1813 (erase-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1814
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1815 (defun gdb-append-to-inferior-io (string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1816 (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1817 (goto-char (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1818 (insert-before-markers string))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1819 (if (not (string-equal string ""))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1820 (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1821
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1822 (defun gdb-clear-inferior-io ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1823 (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1824 (erase-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1825
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1826 (defun gdb-jsonify-buffer (&optional fix-key fix-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1827 "Prepare GDB/MI output in current buffer for parsing with `json-read'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1828
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1829 Field names are wrapped in double quotes and equal signs are
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1830 replaced with semicolons.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1831
106840
5df8e547a422 Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents: 106815
diff changeset
1832 If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurrences from
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
1833 partial output. This is used to get rid of useless keys in lists
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
1834 in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1835 -break-info are examples of MI commands which issue such
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1836 responses.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1837
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1838 If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
1839 \"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1840 -break-info output when it contains breakpoint script field
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1841 incompatible with GDB/MI output syntax."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1842 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1843 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1844 ;; Sometimes missing symbol information precedes "^done" record.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1845 (re-search-forward "[[:ascii:]]*?\\^done," nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1846 (replace-match "")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1847 (re-search-forward "(gdb) \n" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1848 (replace-match "")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1849 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1850 (when fix-key
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1851 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1852 (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1853 (replace-match "" nil nil nil 1))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1854 (when fix-list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1855 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1856 ;; Find positions of braces which enclose broken list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1857 (while (re-search-forward (concat fix-list "={\"") nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1858 (let ((p1 (goto-char (- (point) 2)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1859 (p2 (progn (forward-sexp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1860 (1- (point)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1861 ;; Replace braces with brackets
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1862 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1863 (goto-char p1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1864 (delete-char 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1865 (insert "[")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1866 (goto-char p2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1867 (delete-char 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1868 (insert "]"))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1869 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1870 (insert "{")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1871 (while (re-search-forward
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1872 "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1873 (replace-match "\"\\1\":\\2" nil nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1874 (goto-char (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1875 (insert "}")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1876
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1877 (defun gdb-json-read-buffer (&optional fix-key fix-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1878 "Prepare and parse GDB/MI output in current buffer with `json-read'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1879
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1880 FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1881 (gdb-jsonify-buffer fix-key fix-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1882 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1883 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1884 (let ((json-array-type 'list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1885 (json-read))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1886
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1887 (defun gdb-json-partial-output (&optional fix-key fix-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1888 "Prepare and parse gdb-partial-output-buffer with `json-read'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1889
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1890 FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1891 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1892 (gdb-json-read-buffer fix-key fix-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1893
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1894
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1895 ;; One trick is to have a command who's output is always available in a buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1896 ;; of it's own, and is always up to date. We build several buffers of this
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1897 ;; type.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1898 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1899 ;; There are two aspects to this: gdb has to tell us when the output for that
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1900 ;; command might have changed, and we have to be able to run the command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1901 ;; behind the user's back.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1902 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1903 ;; The output phasing associated with the variable gdb-output-sink
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1904 ;; help us to run commands behind the user's back.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1905 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1906 ;; Below is the code for specificly managing buffers of output from one
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1907 ;; command.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1908 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1909
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1910 ;; The trigger function is suitable for use in the assoc GDB-ANNOTATION-RULES
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1911 ;; It adds an input for the command we are tracking. It should be the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1912 ;; annotation rule binding of whatever gdb sends to tell us this command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1913 ;; might have changed it's output.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1914 ;;
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
1915 ;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed.
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1916 ;; GDB-COMMAND is a string of such. OUTPUT-HANDLER is the function bound to the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1917 ;; input in the input queue (see comment about ``gdb communications'' above).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1918
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1919 (defmacro def-gdb-auto-update-trigger (name demand-predicate gdb-command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1920 output-handler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1921 `(defun ,name (&optional ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1922 (if (and ,demand-predicate
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1923 (not (member ',name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1924 gdb-pending-triggers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1925 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1926 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1927 (list ,gdb-command ',output-handler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1928 (push ',name gdb-pending-triggers)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1929
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1930 (defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1931 `(defun ,name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1932 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1933 (delq ',trigger
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1934 gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1935 (let ((buf (gdb-get-buffer ',buf-key)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1936 (and buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1937 (with-current-buffer buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1938 (let* ((window (get-buffer-window buf 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1939 (start (window-start window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1940 (p (if window (window-point window) (point)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1941 (buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1942 (erase-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1943 (insert-buffer-substring (gdb-get-buffer-create
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1944 'gdb-partial-output-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1945 (if window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1946 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1947 (set-window-start window start)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1948 (set-window-point window p))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1949 (goto-char p))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1950 ;; put customisation here
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1951 (,custom-defun)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1952
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1953 (defmacro def-gdb-auto-updated-buffer (buffer-key
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1954 trigger-name gdb-command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1955 output-handler-name custom-defun)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1956 `(progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1957 (def-gdb-auto-update-trigger ,trigger-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1958 ;; The demand predicate:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1959 (gdb-get-buffer ',buffer-key)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1960 ,gdb-command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1961 ,output-handler-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1962 (def-gdb-auto-update-handler ,output-handler-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1963 ,trigger-name ,buffer-key ,custom-defun)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1964
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1965
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1966 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1967 ;; Breakpoint buffer : This displays the output of `info breakpoints'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1968 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1969 (gdb-set-buffer-rules 'gdb-breakpoints-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1970 'gdb-breakpoints-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1971 'gdb-breakpoints-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1972
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1973 (def-gdb-auto-updated-buffer gdb-breakpoints-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1974 ;; This defines the auto update rule for buffers of type
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1975 ;; `gdb-breakpoints-buffer'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1976 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1977 ;; It defines a function to serve as the annotation handler that
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1978 ;; handles the `foo-invalidated' message. That function is called:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1979 gdb-invalidate-breakpoints
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1980 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1981 ;; To update the buffer, this command is sent to gdb.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1982 "server info breakpoints\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1983 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1984 ;; This also defines a function to be the handler for the output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1985 ;; from the command above. That function will copy the output into
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1986 ;; the appropriately typed buffer. That function will be called:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1987 gdb-info-breakpoints-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1988 ;; buffer specific functions
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1989 gdb-info-breakpoints-custom)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1990
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1991 (defconst breakpoint-xpm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1992 "/* XPM */
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1993 static char *magick[] = {
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1994 /* columns rows colors chars-per-pixel */
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1995 \"10 10 2 1\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1996 \" c red\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1997 \"+ c None\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1998 /* pixels */
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
1999 \"+++ +++\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2000 \"++ ++\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2001 \"+ +\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2002 \" \",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2003 \" \",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2004 \" \",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2005 \" \",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2006 \"+ +\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2007 \"++ ++\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2008 \"+++ +++\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2009 };"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2010 "XPM data used for breakpoint icon.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2011
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2012 (defconst breakpoint-enabled-pbm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2013 "P1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2014 10 10\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2015 0 0 0 0 1 1 1 1 0 0 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2016 0 0 0 1 1 1 1 1 1 0 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2017 0 0 1 1 1 1 1 1 1 1 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2018 0 1 1 1 1 1 1 1 1 1 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2019 0 1 1 1 1 1 1 1 1 1 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2020 0 1 1 1 1 1 1 1 1 1 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2021 0 1 1 1 1 1 1 1 1 1 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2022 0 0 1 1 1 1 1 1 1 1 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2023 0 0 0 1 1 1 1 1 1 0 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2024 0 0 0 0 1 1 1 1 0 0 0 0"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2025 "PBM data used for enabled breakpoint icon.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2026
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2027 (defconst breakpoint-disabled-pbm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2028 "P1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2029 10 10\",
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2030 0 0 1 0 1 0 1 0 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2031 0 1 0 1 0 1 0 1 0 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2032 1 0 1 0 1 0 1 0 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2033 0 1 0 1 0 1 0 1 0 1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2034 1 0 1 0 1 0 1 0 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2035 0 1 0 1 0 1 0 1 0 1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2036 1 0 1 0 1 0 1 0 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2037 0 1 0 1 0 1 0 1 0 1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2038 0 0 1 0 1 0 1 0 1 0
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2039 0 0 0 1 0 1 0 1 0 0"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2040 "PBM data used for disabled breakpoint icon.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2041
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2042 (defvar breakpoint-enabled-icon nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2043 "Icon for enabled breakpoint in display margin.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2044
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2045 (defvar breakpoint-disabled-icon nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2046 "Icon for disabled breakpoint in display margin.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2047
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2048 (declare-function define-fringe-bitmap "fringe.c"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2049 (bitmap bits &optional height width align))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2050
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2051 (and (display-images-p)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2052 ;; Bitmap for breakpoint in fringe
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2053 (define-fringe-bitmap 'breakpoint
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2054 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2055 ;; Bitmap for gud-overlay-arrow in fringe
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2056 (define-fringe-bitmap 'hollow-right-triangle
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2057 "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2058
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2059 (defface breakpoint-enabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2060 '((t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2061 :foreground "red1"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2062 :weight bold))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2063 "Face for enabled breakpoint icon in fringe."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2064 :group 'gdb)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2065
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2066 (defface breakpoint-disabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2067 '((((class color) (min-colors 88)) :foreground "grey70")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2068 ;; Ensure that on low-color displays that we end up something visible.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2069 (((class color) (min-colors 8) (background light))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2070 :foreground "black")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2071 (((class color) (min-colors 8) (background dark))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2072 :foreground "white")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2073 (((type tty) (class mono))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2074 :inverse-video t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2075 (t :background "gray"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2076 "Face for disabled breakpoint icon in fringe."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2077 :group 'gdb)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2078
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2079 (defconst gdb-breakpoint-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2080 "\\(?:\\([0-9]+\\).*?\\(?:point\\|catch\\s-+\\S-+\\)\\s-+\\S-+\\|\\([0-9]+\\.[0-9]+\\)\\)\\s-+\\(.\\)\\s-+")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2081
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2082 ;; Put breakpoint icons in relevant margins (even those set in the GUD buffer).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2083 (defun gdb-info-breakpoints-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2084 (let ((flag) (bptno))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2085 ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2086 (dolist (buffer (buffer-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2087 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2088 (if (and (memq gud-minor-mode '(gdba gdbmi))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2089 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2090 (gdb-remove-breakpoint-icons (point-min) (point-max)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2091 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2092 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2093 (let ((buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2094 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2095 (while (< (point) (- (point-max) 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2096 (forward-line 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2097 (if (looking-at gdb-breakpoint-regexp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2098 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2099 (setq bptno (or (match-string 1) (match-string 2)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2100 (setq flag (char-after (match-beginning 3)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2101 (if (match-string 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2102 (setq gdb-parent-bptno-enabled (eq flag ?y)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2103 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2104 (match-beginning 3) (match-end 3)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2105 (if (eq flag ?y)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2106 '(face font-lock-warning-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2107 '(face font-lock-type-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2108 (let ((bl (point))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2109 (el (line-end-position)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2110 (when (re-search-forward " in \\(.*\\) at" el t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2111 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2112 (match-beginning 1) (match-end 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2113 '(face font-lock-function-name-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2114 (if (re-search-forward
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2115 ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$" el t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2116 (let ((line (match-string 2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2117 (file (match-string 1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2118 (add-text-properties bl el
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2119 '(mouse-face highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2120 help-echo "mouse-2, RET: visit breakpoint"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2121 (unless (file-exists-p file)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2122 (setq file (cdr (assoc bptno gdb-location-alist))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2123 (if (and file
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2124 (not (string-equal file "File not found")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2125 (with-current-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2126 (find-file-noselect file 'nowarn)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2127 (gdb-init-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2128 ;; Only want one breakpoint icon at each
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2129 ;; location.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2130 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2131 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2132 (forward-line (1- (string-to-number line)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2133 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2134 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2135 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2136 (concat gdb-server-prefix "list "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2137 (match-string-no-properties 1) ":1\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2138 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2139 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2140 (list (concat gdb-server-prefix "info source\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2141 `(lambda () (gdb-get-location
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2142 ,bptno ,line ,flag))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2143 (if (re-search-forward
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2144 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2145 el t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2146 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2147 (match-beginning 1) (match-end 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2148 '(face font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2149 (end-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2150 (re-search-backward "\\s-\\(\\S-*\\)"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2151 bl t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2152 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2153 (match-beginning 1) (match-end 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2154 '(face font-lock-variable-name-face)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2155 (end-of-line))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2156 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2157
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2158 ;; Breakpoints buffer is always present. Hack to just update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2159 ;; current frame if there's been no execution.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2160 (if gdb-stack-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2161 (setq gdb-stack-update nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2162 (if (gdb-get-buffer 'gdb-stack-buffer) (gdb-info-stack-custom))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2163
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2164 (declare-function gud-remove "gdb-ui" t t) ; gud-def
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2165 (declare-function gud-break "gdb-ui" t t) ; gud-def
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2166 (declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2167
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2168 (defun gdb-mouse-set-clear-breakpoint (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2169 "Set/clear breakpoint in left fringe/margin at mouse click.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2170 If not in a source or disassembly buffer just set point."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2171 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2172 (mouse-minibuffer-check event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2173 (let ((posn (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2174 (with-selected-window (posn-window posn)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2175 (if (or (buffer-file-name) (eq major-mode 'gdb-assembler-mode))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2176 (if (numberp (posn-point posn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2177 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2178 (goto-char (posn-point posn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2179 (if (or (posn-object posn)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2180 (eq (car (fringe-bitmaps-at-pos (posn-point posn)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2181 'breakpoint))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2182 (gud-remove nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2183 (gud-break nil)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2184 (posn-set-point posn))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2185
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2186 (defun gdb-mouse-toggle-breakpoint-margin (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2187 "Enable/disable breakpoint in left margin with mouse click."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2188 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2189 (mouse-minibuffer-check event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2190 (let ((posn (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2191 (if (numberp (posn-point posn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2192 (with-selected-window (posn-window posn)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2193 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2194 (goto-char (posn-point posn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2195 (if (posn-object posn)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2196 (let* ((bptno (get-text-property
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2197 0 'gdb-bptno (car (posn-string posn)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2198 (string-match "\\([0-9+]\\)*" bptno)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2199 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2200 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2201 (concat gdb-server-prefix
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2202 (if (get-text-property
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2203 0 'gdb-enabled (car (posn-string posn)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2204 "disable "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2205 "enable ")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2206 (match-string 1 bptno) "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2207 'ignore)))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2208
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2209 (defun gdb-mouse-toggle-breakpoint-fringe (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2210 "Enable/disable breakpoint in left fringe with mouse click."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2211 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2212 (mouse-minibuffer-check event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2213 (let* ((posn (event-end event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2214 (pos (posn-point posn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2215 obj)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2216 (when (numberp pos)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2217 (with-selected-window (posn-window posn)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2218 (with-current-buffer (window-buffer (selected-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2219 (goto-char pos)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2220 (dolist (overlay (overlays-in pos pos))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2221 (when (overlay-get overlay 'put-break)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2222 (setq obj (overlay-get overlay 'before-string))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2223 (when (stringp obj)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2224 (let* ((bptno (get-text-property 0 'gdb-bptno obj)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2225 (string-match "\\([0-9+]\\)*" bptno)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2226 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2227 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2228 (concat gdb-server-prefix
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2229 (if (get-text-property 0 'gdb-enabled obj)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2230 "disable "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2231 "enable ")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2232 (match-string 1 bptno) "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2233 'ignore)))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2234
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2235 (defun gdb-breakpoints-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2236 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2237 (concat "*breakpoints of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2238
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2239 (defun gdb-display-breakpoints-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2240 "Display status of user-settable breakpoints."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2241 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2242 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2243 (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2244
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2245 (defun gdb-frame-breakpoints-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2246 "Display status of user-settable breakpoints in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2247 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2248 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2249 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2250 (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2251
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2252 (defvar gdb-breakpoints-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2253 (let ((map (make-sparse-keymap))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2254 (menu (make-sparse-keymap "Breakpoints")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2255 (define-key menu [quit] '("Quit" . gdb-delete-frame-or-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2256 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2257 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2258 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2259 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2260 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2261 (define-key map " " 'gdb-toggle-breakpoint)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2262 (define-key map "D" 'gdb-delete-breakpoint)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2263 ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2264 (define-key map "q" 'gdb-delete-frame-or-window)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2265 (define-key map "\r" 'gdb-goto-breakpoint)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2266 (define-key map [mouse-2] 'gdb-goto-breakpoint)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2267 (define-key map [follow-link] 'mouse-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2268 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2269
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2270 (defun gdb-delete-frame-or-window ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2271 "Delete frame if there is only one window. Otherwise delete the window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2272 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2273 (if (one-window-p) (delete-frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2274 (delete-window)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2275
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2276 ;;from make-mode-line-mouse-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2277 (defun gdb-make-header-line-mouse-map (mouse function) "\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2278 Return a keymap with single entry for mouse key MOUSE on the header line.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2279 MOUSE is defined to run function FUNCTION with no args in the buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2280 corresponding to the mode line clicked."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2281 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2282 (define-key map (vector 'header-line mouse) function)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2283 (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2284 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2285
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2286 (defmacro gdb-propertize-header (name buffer help-echo mouse-face face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2287 `(propertize ,name
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
2288 'help-echo ,help-echo
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2289 'mouse-face ',mouse-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2290 'face ',face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2291 'local-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2292 (gdb-make-header-line-mouse-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2293 'mouse-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2294 (lambda (event) (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2295 (save-selected-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2296 (select-window (posn-window (event-start event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2297 (set-window-dedicated-p (selected-window) nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2298 (switch-to-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2299 (gdb-get-buffer-create ',buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2300 (setq header-line-format(gdb-set-header ',buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2301 (set-window-dedicated-p (selected-window) t))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2302
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2303 (defun gdb-set-header (buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2304 (cond ((eq buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2305 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2306 (gdb-propertize-header "Locals" gdb-locals-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2307 nil nil mode-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2308 " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2309 (gdb-propertize-header "Registers" gdb-registers-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2310 "mouse-1: select" mode-line-highlight mode-line-inactive)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2311 ((eq buffer 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2312 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2313 (gdb-propertize-header "Locals" gdb-locals-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2314 "mouse-1: select" mode-line-highlight mode-line-inactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2315 " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2316 (gdb-propertize-header "Registers" gdb-registers-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2317 nil nil mode-line)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2318 ((eq buffer 'gdb-breakpoints-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2319 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2320 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2321 nil nil mode-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2322 " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2323 (gdb-propertize-header "Threads" gdb-threads-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2324 "mouse-1: select" mode-line-highlight mode-line-inactive)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2325 ((eq buffer 'gdb-threads-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2326 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2327 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2328 "mouse-1: select" mode-line-highlight mode-line-inactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2329 " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2330 (gdb-propertize-header "Threads" gdb-threads-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2331 nil nil mode-line)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2332
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2333 (defvar gdb-breakpoints-header
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2334 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2335 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2336 nil nil mode-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2337 " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2338 (gdb-propertize-header "Threads" gdb-threads-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2339 "mouse-1: select" mode-line-highlight mode-line-inactive)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2340
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2341 (defun gdb-breakpoints-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2342 "Major mode for gdb breakpoints.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2343
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2344 \\{gdb-breakpoints-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2345 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2346 (setq major-mode 'gdb-breakpoints-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2347 (setq mode-name "Breakpoints")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2348 (use-local-map gdb-breakpoints-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2349 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2350 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2351 (setq header-line-format gdb-breakpoints-header)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2352 (run-mode-hooks 'gdb-breakpoints-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2353 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2354 'gdb-invalidate-breakpoints
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2355 'gdbmi-invalidate-breakpoints))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2356
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2357 (defun gdb-toggle-breakpoint ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2358 "Enable/disable breakpoint at current line."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2359 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2360 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2361 (beginning-of-line 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2362 (if (looking-at gdb-breakpoint-regexp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2363 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2364 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2365 (concat gdb-server-prefix
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2366 (if (eq ?y (char-after (match-beginning 3)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2367 "disable "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2368 "enable ")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2369 (or (match-string 1) (match-string 2)) "\n") 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2370 (error "Not recognized as break/watchpoint line"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2371
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2372 (defun gdb-delete-breakpoint ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2373 "Delete the breakpoint at current line."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2374 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2375 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2376 (beginning-of-line 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2377 (if (looking-at gdb-breakpoint-regexp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2378 (if (match-string 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2379 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2380 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2381 (concat gdb-server-prefix "delete " (match-string 1) "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2382 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2383 (message-box "This breakpoint cannot be deleted on its own."))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2384 (error "Not recognized as break/watchpoint line"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2385
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2386 (defun gdb-goto-breakpoint (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2387 "Display the breakpoint location specified at current line."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2388 (interactive (list last-input-event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2389 (if event (posn-set-point (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2390 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2391 (beginning-of-line 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2392 (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2393 (let ((bptno (match-string 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2394 (file (match-string 2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2395 (line (match-string 3)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2396 (save-selected-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2397 (let* ((buffer (find-file-noselect
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2398 (if (file-exists-p file) file
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2399 (cdr (assoc bptno gdb-location-alist)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2400 (window (or (gdb-display-source-buffer buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2401 (display-buffer buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2402 (setq gdb-source-window window)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2403 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2404 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2405 (forward-line (1- (string-to-number line)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2406 (set-window-point window (point))))))
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
2407 (error "No location specified"))))
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2408
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2409
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2410 ;; Frames buffer. This displays a perpetually correct backtrace
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2411 ;; (from the command `where').
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2412 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2413 ;; Alas, if your stack is deep, it is costly.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2414 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2415 (defcustom gdb-max-frames 40
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2416 "Maximum number of frames displayed in call stack."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2417 :type 'integer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2418 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2419 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2420
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2421 (gdb-set-buffer-rules 'gdb-stack-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2422 'gdb-stack-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2423 'gdb-frames-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2424
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2425 (def-gdb-auto-updated-buffer gdb-stack-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2426 gdb-invalidate-frames
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2427 (concat "server info stack " (number-to-string gdb-max-frames) "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2428 gdb-info-stack-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2429 gdb-info-stack-custom)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2430
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2431 ;; This may be more important for embedded targets where unwinding the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2432 ;; stack may take a long time.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2433 (defadvice gdb-invalidate-frames (around gdb-invalidate-frames-advice
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2434 (&optional ignored) activate compile)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2435 "Only queue \"info stack\" if execution has occurred."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2436 (if gdb-stack-update ad-do-it))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2437
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2438 (defun gdb-info-stack-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2439 (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2440 (let (move-to)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2441 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2442 (unless (eq gdb-look-up-stack 'delete)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2443 (let ((buffer-read-only nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2444 bl el)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2445 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2446 (while (< (point) (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2447 (setq bl (line-beginning-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2448 el (line-end-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2449 (when (looking-at "#")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2450 (add-text-properties bl el
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2451 '(mouse-face highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2452 help-echo "mouse-2, RET: Select frame")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2453 (goto-char bl)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2454 (when (looking-at "^#\\([0-9]+\\)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2455 (when (string-equal (match-string 1) gdb-frame-number)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2456 (if (gud-tool-bar-item-visible-no-fringe)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2457 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2458 (put-text-property bl (+ bl 4)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2459 'face '(:inverse-video t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2460 (setq move-to bl))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2461 (or gdb-stack-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2462 (setq gdb-stack-position (make-marker)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2463 (set-marker gdb-stack-position (point))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2464 (setq move-to gdb-stack-position)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2465 (when (re-search-forward "\\([^ ]+\\) (" el t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2466 (put-text-property (match-beginning 1) (match-end 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2467 'face font-lock-function-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2468 (setq bl (match-end 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2469 (while (re-search-forward "<\\([^>]+\\)>" el t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2470 (put-text-property (match-beginning 1) (match-end 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2471 'face font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2472 (goto-char bl)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2473 (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2474 (put-text-property (match-beginning 1) (match-end 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2475 'face font-lock-variable-name-face))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2476 (forward-line 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2477 (forward-line -1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2478 (when (looking-at "(More stack frames follow...)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2479 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2480 (match-beginning 0) (match-end 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2481 '(mouse-face highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2482 gdb-max-frames t
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2483 help-echo
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2484 "mouse-2, RET: customize gdb-max-frames to see more frames"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2485 )))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2486 (when gdb-look-up-stack
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2487 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2488 (when (re-search-forward "\\(\\S-+?\\):\\([0-9]+\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2489 (let ((start (line-beginning-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2490 (file (match-string 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2491 (line (match-string 2)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2492 (re-search-backward "^#*\\([0-9]+\\)" start t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2493 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2494 (list (concat gdb-server-prefix "frame "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2495 (match-string 1) "\n") 'gdb-set-hollow))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2496 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2497 (list (concat gdb-server-prefix "frame 0\n") 'ignore))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2498 (when move-to
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2499 (let ((window (get-buffer-window (current-buffer) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2500 (when window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2501 (with-selected-window window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2502 (goto-char move-to)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2503 (unless (pos-visible-in-window-p)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2504 (recenter '(center)))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2505 (if (eq gdb-look-up-stack 'delete)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2506 (kill-buffer (gdb-get-buffer 'gdb-stack-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2507 (setq gdb-look-up-stack nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2508
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2509 (defun gdb-set-hollow ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2510 (if gud-last-last-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2511 (with-current-buffer (gud-find-file (car gud-last-last-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2512 (setq fringe-indicator-alist
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2513 '((overlay-arrow . hollow-right-triangle))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2514
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2515 (defun gdb-stack-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2516 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2517 (concat "*stack frames of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2518
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2519 (defun gdb-display-stack-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2520 "Display backtrace of current stack."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2521 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2522 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2523 (gdb-get-buffer-create 'gdb-stack-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2524
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2525 (defun gdb-frame-stack-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2526 "Display backtrace of current stack in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2527 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2528 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2529 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2530 (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2531
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2532 (defvar gdb-frames-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2533 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2534 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2535 (define-key map "q" 'kill-this-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2536 (define-key map "\r" 'gdb-frames-select)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2537 (define-key map "F" 'gdb-frames-force-update)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2538 (define-key map [mouse-2] 'gdb-frames-select)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2539 (define-key map [follow-link] 'mouse-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2540 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2541
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2542 (declare-function gdbmi-invalidate-frames "ext:gdb-mi" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2543
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2544 (defun gdb-frames-force-update ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2545 "Force update of call stack.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2546 Use when the displayed call stack gets out of sync with the
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2547 actual one, e.g after using the Gdb command \"return\" or setting
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2548 $pc directly from the GUD buffer. This command isn't normally needed."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2549 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2550 (setq gdb-stack-update t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2551 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2552 (gdb-invalidate-frames)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2553 (gdbmi-invalidate-frames)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2554
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2555 (defun gdb-frames-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2556 "Major mode for gdb call stack.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2557
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2558 \\{gdb-frames-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2559 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2560 (setq major-mode 'gdb-frames-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2561 (setq mode-name "Frames")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2562 (setq gdb-stack-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2563 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2564 (setq truncate-lines t) ;; Make it easier to see overlay arrow.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2565 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2566 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2567 (gdb-thread-identification)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2568 (use-local-map gdb-frames-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2569 (run-mode-hooks 'gdb-frames-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2570 (setq gdb-stack-update t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2571 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2572 'gdb-invalidate-frames
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2573 'gdbmi-invalidate-frames))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2574
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2575 (defun gdb-get-frame-number ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2576 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2577 (end-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2578 (let* ((start (line-beginning-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2579 (pos (re-search-backward "^#*\\([0-9]+\\)" start t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2580 (n (or (and pos (match-string 1)) "0")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2581 n)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2582
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2583 (defun gdb-frames-select (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2584 "Select the frame and display the relevant source."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2585 (interactive (list last-input-event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2586 (if event (posn-set-point (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2587 (if (get-text-property (point) 'gdb-max-frames)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2588 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2589 (message-box "After setting gdb-max-frames, you need to enter\n\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2590 another GDB command e.g pwd, to see new frames")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2591 (customize-variable-other-window 'gdb-max-frames))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2592 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2593 (list (concat gdb-server-prefix "frame "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2594 (gdb-get-frame-number) "\n") 'ignore))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2595
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2596
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2597 ;; Threads buffer. This displays a selectable thread list.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2598 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2599 (gdb-set-buffer-rules 'gdb-threads-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2600 'gdb-threads-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2601 'gdb-threads-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2602
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2603 (def-gdb-auto-updated-buffer gdb-threads-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2604 gdb-invalidate-threads
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2605 (concat gdb-server-prefix "info threads\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2606 gdb-info-threads-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2607 gdb-info-threads-custom)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2608
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2609 (defun gdb-info-threads-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2610 (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2611 (let ((buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2612 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2613 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2614 (if (re-search-forward "\\* \\([0-9]+\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2615 (setq gdb-thread-indicator
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2616 (propertize (concat " [" (match-string 1) "]")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2617 ; FIXME: this help-echo doesn't work
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2618 'help-echo "thread id")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2619 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2620 (while (< (point) (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2621 (unless (looking-at "No ")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2622 (add-text-properties (line-beginning-position) (line-end-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2623 '(mouse-face highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2624 help-echo "mouse-2, RET: select thread")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2625 (forward-line 1))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2626
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2627 (defun gdb-threads-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2628 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2629 (concat "*threads of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2630
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2631 (defun gdb-display-threads-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2632 "Display IDs of currently known threads."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2633 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2634 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2635 (gdb-get-buffer-create 'gdb-threads-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2636
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2637 (defun gdb-frame-threads-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2638 "Display IDs of currently known threads in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2639 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2640 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2641 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2642 (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2643
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2644 (defvar gdb-threads-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2645 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2646 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2647 (define-key map "q" 'kill-this-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2648 (define-key map "\r" 'gdb-threads-select)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2649 (define-key map [mouse-2] 'gdb-threads-select)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2650 (define-key map [follow-link] 'mouse-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2651 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2652
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2653 (defvar gdb-threads-font-lock-keywords
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2654 '((") +\\([^ ]+\\) (" (1 font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2655 ("in \\([^ ]+\\) (" (1 font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2656 ("\\(\\(\\sw\\|[_.]\\)+\\)=" (1 font-lock-variable-name-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2657 "Font lock keywords used in `gdb-threads-mode'.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2658
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2659 (defun gdb-threads-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2660 "Major mode for gdb threads.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2661
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2662 \\{gdb-threads-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2663 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2664 (setq major-mode 'gdb-threads-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2665 (setq mode-name "Threads")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2666 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2667 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2668 (setq header-line-format gdb-breakpoints-header)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2669 (use-local-map gdb-threads-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2670 (set (make-local-variable 'font-lock-defaults)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2671 '(gdb-threads-font-lock-keywords))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2672 (run-mode-hooks 'gdb-threads-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2673 ;; Force "info threads" onto queue.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2674 (lambda () (let ((gud-running nil)) (gdb-invalidate-threads))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2675
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2676 (defun gdb-get-thread-number ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2677 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2678 (re-search-backward "^\\s-*\\([0-9]*\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2679 (match-string-no-properties 1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2680
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2681 (defun gdb-threads-select (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2682 "Select the thread and display the relevant source."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2683 (interactive (list last-input-event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2684 (if event (posn-set-point (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2685 (setq gdb-stack-update t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2686 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2687 (list (concat gdb-server-prefix "thread "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2688 (gdb-get-thread-number) "\n") 'ignore))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2689 (gud-display-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2690
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2691 (defun gdb-thread-identification ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2692 (setq mode-line-buffer-identification
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2693 (list (car mode-line-buffer-identification)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2694 '(gdb-thread-indicator gdb-thread-indicator))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2695
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2696 ;; Registers buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2697 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2698 (defcustom gdb-all-registers nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2699 "Non-nil means include floating-point registers."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2700 :type 'boolean
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2701 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2702 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2703
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2704 (gdb-set-buffer-rules 'gdb-registers-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2705 'gdb-registers-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2706 'gdb-registers-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2707
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2708 (def-gdb-auto-updated-buffer gdb-registers-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2709 gdb-invalidate-registers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2710 (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2711 gdb-server-prefix "info " (if gdb-all-registers "all-") "registers\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2712 gdb-info-registers-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2713 gdb-info-registers-custom)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2714
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2715 (defun gdb-info-registers-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2716 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2717 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2718 (let ((buffer-read-only nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2719 start end)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2720 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2721 (while (< (point) (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2722 (setq start (line-beginning-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2723 (setq end (line-end-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2724 (when (looking-at "^[^ ]+")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2725 (unless (string-equal (match-string 0) "The")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2726 (put-text-property start (match-end 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2727 'face font-lock-variable-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2728 (add-text-properties start end
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2729 '(help-echo "mouse-2: edit value"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2730 mouse-face highlight))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2731 (forward-line 1))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2732
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2733 (defun gdb-edit-register-value (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2734 (interactive (list last-input-event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2735 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2736 (if event (posn-set-point (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2737 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2738 (let* ((register (current-word))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2739 (value (read-string (format "New value (%s): " register))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2740 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2741 (list (concat gdb-server-prefix "set $" register "=" value "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2742 'ignore)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2743
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2744 (defvar gdb-registers-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2745 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2746 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2747 (define-key map "\r" 'gdb-edit-register-value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2748 (define-key map [mouse-2] 'gdb-edit-register-value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2749 (define-key map " " 'gdb-all-registers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2750 (define-key map "q" 'kill-this-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2751 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2752
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2753 (defvar gdb-locals-header
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2754 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2755 (gdb-propertize-header "Locals" gdb-locals-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2756 nil nil mode-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2757 " "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2758 (gdb-propertize-header "Registers" gdb-registers-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2759 "mouse-1: select" mode-line-highlight mode-line-inactive)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2760
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2761
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2762 (defun gdb-registers-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2763 "Major mode for gdb registers.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2764
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2765 \\{gdb-registers-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2766 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2767 (setq major-mode 'gdb-registers-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2768 (setq mode-name "Registers")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2769 (setq header-line-format gdb-locals-header)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2770 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2771 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2772 (gdb-thread-identification)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2773 (use-local-map gdb-registers-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2774 (run-mode-hooks 'gdb-registers-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2775 (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2776 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2777 (if gdb-all-registers (setq mode-name "Registers:All"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2778 'gdb-invalidate-registers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2779 'gdb-invalidate-registers-1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2780
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2781 (defun gdb-registers-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2782 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2783 (concat "*registers of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2784
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2785 (defun gdb-display-registers-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2786 "Display integer register contents."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2787 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2788 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2789 (gdb-get-buffer-create 'gdb-registers-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2790
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2791 (defun gdb-frame-registers-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2792 "Display integer register contents in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2793 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2794 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2795 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2796 (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2797
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2798 (defun gdb-all-registers ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2799 "Toggle the display of floating-point registers (pre GDB 6.4 only)."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2800 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2801 (when (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2802 (if gdb-all-registers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2803 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2804 (setq gdb-all-registers nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2805 (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2806 (setq mode-name "Registers")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2807 (setq gdb-all-registers t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2808 (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2809 (setq mode-name "Registers:All")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2810 (message (format "Display of floating-point registers %sabled"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2811 (if gdb-all-registers "en" "dis")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2812 (gdb-invalidate-registers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2813
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2814
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2815 ;; Memory buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2816 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2817 (defcustom gdb-memory-repeat-count 32
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2818 "Number of data items in memory window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2819 :type 'integer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2820 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2821 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2822
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2823 (defcustom gdb-memory-format "x"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2824 "Display format of data items in memory window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2825 :type '(choice (const :tag "Hexadecimal" "x")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2826 (const :tag "Signed decimal" "d")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2827 (const :tag "Unsigned decimal" "u")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2828 (const :tag "Octal" "o")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2829 (const :tag "Binary" "t"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2830 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2831 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2832
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2833 (defcustom gdb-memory-unit "w"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2834 "Unit size of data items in memory window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2835 :type '(choice (const :tag "Byte" "b")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2836 (const :tag "Halfword" "h")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2837 (const :tag "Word" "w")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2838 (const :tag "Giant word" "g"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2839 :group 'gdb
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2840 :version "22.1")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2841
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2842 (gdb-set-buffer-rules 'gdb-memory-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2843 'gdb-memory-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2844 'gdb-memory-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2845
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2846 (def-gdb-auto-updated-buffer gdb-memory-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2847 gdb-invalidate-memory
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2848 (concat gdb-server-prefix "x/" (number-to-string gdb-memory-repeat-count)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2849 gdb-memory-format gdb-memory-unit " " gdb-memory-address "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2850 gdb-read-memory-handler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2851 gdb-read-memory-custom)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2852
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2853 (defun gdb-read-memory-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2854 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2855 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2856 (if (looking-at "0x[[:xdigit:]]+")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2857 (setq gdb-memory-address (match-string 0)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2858
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2859 (defvar gdb-memory-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2860 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2861 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2862 (define-key map "S" 'gdb-memory-set-address)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2863 (define-key map "N" 'gdb-memory-set-repeat-count)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2864 (define-key map "q" 'kill-this-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2865 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2866
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2867 (defun gdb-memory-set-address (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2868 "Set the start memory address."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2869 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2870 (let ((arg (read-from-minibuffer "Start address: ")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2871 (setq gdb-memory-address arg))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2872 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2873
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2874 (defun gdb-memory-set-repeat-count (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2875 "Set the number of data items in memory window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2876 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2877 (let* ((arg (read-from-minibuffer "Repeat count: "))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2878 (count (string-to-number arg)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2879 (if (<= count 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2880 (error "Positive numbers only")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2881 (customize-set-variable 'gdb-memory-repeat-count count)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2882 (gdb-invalidate-memory))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2883
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2884 (defun gdb-memory-format-binary ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2885 "Set the display format to binary."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2886 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2887 (customize-set-variable 'gdb-memory-format "t")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2888 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2889
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2890 (defun gdb-memory-format-octal ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2891 "Set the display format to octal."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2892 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2893 (customize-set-variable 'gdb-memory-format "o")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2894 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2895
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2896 (defun gdb-memory-format-unsigned ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2897 "Set the display format to unsigned decimal."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2898 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2899 (customize-set-variable 'gdb-memory-format "u")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2900 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2901
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2902 (defun gdb-memory-format-signed ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2903 "Set the display format to decimal."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2904 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2905 (customize-set-variable 'gdb-memory-format "d")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2906 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2907
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2908 (defun gdb-memory-format-hexadecimal ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2909 "Set the display format to hexadecimal."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2910 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2911 (customize-set-variable 'gdb-memory-format "x")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2912 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2913
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2914 (defvar gdb-memory-format-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2915 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2916 (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2917 map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2918 "Keymap to select format in the header line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2919
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2920 (defvar gdb-memory-format-menu (make-sparse-keymap "Format")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2921 "Menu of display formats in the header line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2922
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2923 (define-key gdb-memory-format-menu [binary]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2924 '(menu-item "Binary" gdb-memory-format-binary
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2925 :button (:radio . (equal gdb-memory-format "t"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2926 (define-key gdb-memory-format-menu [octal]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2927 '(menu-item "Octal" gdb-memory-format-octal
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2928 :button (:radio . (equal gdb-memory-format "o"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2929 (define-key gdb-memory-format-menu [unsigned]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2930 '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2931 :button (:radio . (equal gdb-memory-format "u"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2932 (define-key gdb-memory-format-menu [signed]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2933 '(menu-item "Signed Decimal" gdb-memory-format-signed
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2934 :button (:radio . (equal gdb-memory-format "d"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2935 (define-key gdb-memory-format-menu [hexadecimal]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2936 '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2937 :button (:radio . (equal gdb-memory-format "x"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2938
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2939 (defun gdb-memory-format-menu (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2940 (interactive "@e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2941 (x-popup-menu event gdb-memory-format-menu))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2942
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2943 (defun gdb-memory-format-menu-1 (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2944 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2945 (save-selected-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2946 (select-window (posn-window (event-start event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2947 (let* ((selection (gdb-memory-format-menu event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2948 (binding (and selection (lookup-key gdb-memory-format-menu
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2949 (vector (car selection))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2950 (if binding (call-interactively binding)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2951
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2952 (defun gdb-memory-unit-giant ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2953 "Set the unit size to giant words (eight bytes)."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2954 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2955 (customize-set-variable 'gdb-memory-unit "g")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2956 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2957
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2958 (defun gdb-memory-unit-word ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2959 "Set the unit size to words (four bytes)."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2960 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2961 (customize-set-variable 'gdb-memory-unit "w")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2962 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2963
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2964 (defun gdb-memory-unit-halfword ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2965 "Set the unit size to halfwords (two bytes)."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2966 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2967 (customize-set-variable 'gdb-memory-unit "h")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2968 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2969
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2970 (defun gdb-memory-unit-byte ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2971 "Set the unit size to bytes."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2972 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2973 (customize-set-variable 'gdb-memory-unit "b")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2974 (gdb-invalidate-memory))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2975
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2976 (defvar gdb-memory-unit-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2977 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2978 (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2979 map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2980 "Keymap to select units in the header line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2981
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2982 (defvar gdb-memory-unit-menu (make-sparse-keymap "Unit")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2983 "Menu of units in the header line.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2984
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2985 (define-key gdb-memory-unit-menu [giantwords]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2986 '(menu-item "Giant words" gdb-memory-unit-giant
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2987 :button (:radio . (equal gdb-memory-unit "g"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2988 (define-key gdb-memory-unit-menu [words]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2989 '(menu-item "Words" gdb-memory-unit-word
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2990 :button (:radio . (equal gdb-memory-unit "w"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2991 (define-key gdb-memory-unit-menu [halfwords]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2992 '(menu-item "Halfwords" gdb-memory-unit-halfword
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2993 :button (:radio . (equal gdb-memory-unit "h"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2994 (define-key gdb-memory-unit-menu [bytes]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2995 '(menu-item "Bytes" gdb-memory-unit-byte
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2996 :button (:radio . (equal gdb-memory-unit "b"))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2997
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2998 (defun gdb-memory-unit-menu (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
2999 (interactive "@e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3000 (x-popup-menu event gdb-memory-unit-menu))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3001
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3002 (defun gdb-memory-unit-menu-1 (event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3003 (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3004 (save-selected-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3005 (select-window (posn-window (event-start event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3006 (let* ((selection (gdb-memory-unit-menu event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3007 (binding (and selection (lookup-key gdb-memory-unit-menu
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3008 (vector (car selection))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3009 (if binding (call-interactively binding)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3010
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3011 (defvar gdb-memory-font-lock-keywords
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3012 '(;; <__function.name+n>
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3013 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3014 )
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3015 "Font lock keywords used in `gdb-memory-mode'.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3016
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3017 (defun gdb-memory-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3018 "Major mode for examining memory.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3019
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3020 \\{gdb-memory-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3021 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3022 (setq major-mode 'gdb-memory-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3023 (setq mode-name "Memory")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3024 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3025 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3026 (use-local-map gdb-memory-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3027 (setq header-line-format
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3028 '(:eval
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3029 (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3030 "Start address["
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3031 (propertize
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3032 "-"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3033 'face font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3034 'help-echo "mouse-1: decrement address"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3035 'mouse-face 'mode-line-highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3036 'local-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3037 (gdb-make-header-line-mouse-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3038 'mouse-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3039 (lambda () (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3040 (let ((gdb-memory-address
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3041 ;; Let GDB do the arithmetic.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3042 (concat
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3043 gdb-memory-address " - "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3044 (number-to-string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3045 (* gdb-memory-repeat-count
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3046 (cond ((string= gdb-memory-unit "b") 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3047 ((string= gdb-memory-unit "h") 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3048 ((string= gdb-memory-unit "w") 4)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3049 ((string= gdb-memory-unit "g") 8)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3050 (gdb-invalidate-memory)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3051 "|"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3052 (propertize "+"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3053 'face font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3054 'help-echo "mouse-1: increment address"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3055 'mouse-face 'mode-line-highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3056 'local-map (gdb-make-header-line-mouse-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3057 'mouse-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3058 (lambda () (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3059 (let ((gdb-memory-address nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3060 (gdb-invalidate-memory)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3061 "]: "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3062 (propertize gdb-memory-address
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3063 'face font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3064 'help-echo "mouse-1: set start address"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3065 'mouse-face 'mode-line-highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3066 'local-map (gdb-make-header-line-mouse-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3067 'mouse-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3068 #'gdb-memory-set-address))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3069 " Repeat Count: "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3070 (propertize (number-to-string gdb-memory-repeat-count)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3071 'face font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3072 'help-echo "mouse-1: set repeat count"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3073 'mouse-face 'mode-line-highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3074 'local-map (gdb-make-header-line-mouse-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3075 'mouse-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3076 #'gdb-memory-set-repeat-count))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3077 " Display Format: "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3078 (propertize gdb-memory-format
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3079 'face font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3080 'help-echo "mouse-3: select display format"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3081 'mouse-face 'mode-line-highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3082 'local-map gdb-memory-format-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3083 " Unit Size: "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3084 (propertize gdb-memory-unit
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3085 'face font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3086 'help-echo "mouse-3: select unit size"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3087 'mouse-face 'mode-line-highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3088 'local-map gdb-memory-unit-map))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3089 (set (make-local-variable 'font-lock-defaults)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3090 '(gdb-memory-font-lock-keywords))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3091 (run-mode-hooks 'gdb-memory-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3092 'gdb-invalidate-memory)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3093
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3094 (defun gdb-memory-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3095 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3096 (concat "*memory of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3097
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3098 (defun gdb-display-memory-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3099 "Display memory contents."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3100 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3101 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3102 (gdb-get-buffer-create 'gdb-memory-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3103
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3104 (defun gdb-frame-memory-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3105 "Display memory contents in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3106 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3107 (let* ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3108 (special-display-frame-alist
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3109 (cons '(left-fringe . 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3110 (cons '(right-fringe . 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3111 (cons '(width . 83) gdb-frame-parameters)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3112 (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3113
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3114
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3115 ;; Locals buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3116 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3117 (gdb-set-buffer-rules 'gdb-locals-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3118 'gdb-locals-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3119 'gdb-locals-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3120
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3121 (def-gdb-auto-update-trigger gdb-invalidate-locals
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3122 (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3123 "server info locals\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3124 gdb-info-locals-handler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3125
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3126 (defvar gdb-locals-watch-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3127 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3128 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3129 (define-key map "\r" (lambda () (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3130 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3131 (gud-watch)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3132 (define-key map [mouse-2] (lambda (event) (interactive "e")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3133 (mouse-set-point event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3134 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3135 (gud-watch)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3136 map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3137 "Keymap to create watch expression of a complex data type local variable.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3138
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3139 (defconst gdb-struct-string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3140 (concat (propertize "[struct/union]"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3141 'mouse-face 'highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3142 'help-echo "mouse-2: create watch expression"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3143 'local-map gdb-locals-watch-map) "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3144
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3145 (defconst gdb-array-string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3146 (concat " " (propertize "[array]"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3147 'mouse-face 'highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3148 'help-echo "mouse-2: create watch expression"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3149 'local-map gdb-locals-watch-map) "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3150
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3151 ;; Abbreviate for arrays and structures.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3152 ;; These can be expanded using gud-display.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3153 (defun gdb-info-locals-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3154 (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3155 gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3156 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3157 (with-current-buffer buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3158 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3159 ;; Need this in case "set print pretty" is on.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3160 (while (re-search-forward "^[ }].*\n" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3161 (replace-match "" nil nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3162 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3163 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3164 (replace-match gdb-struct-string nil nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3165 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3166 (while (re-search-forward "\\s-*{[^.].*\n" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3167 (replace-match gdb-array-string nil nil))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3168 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3169 (and buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3170 (with-current-buffer buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3171 (let* ((window (get-buffer-window buf 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3172 (start (window-start window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3173 (p (window-point window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3174 (buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3175 (erase-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3176 (insert-buffer-substring (gdb-get-buffer-create
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3177 'gdb-partial-output-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3178 (set-window-start window start)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3179 (set-window-point window p)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3180 (run-hooks 'gdb-info-locals-hook))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3181
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3182 (defvar gdb-locals-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3183 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3184 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3185 (define-key map "q" 'kill-this-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3186 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3187
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3188 (defun gdb-locals-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3189 "Major mode for gdb locals.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3190
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3191 \\{gdb-locals-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3192 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3193 (setq major-mode 'gdb-locals-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3194 (setq mode-name (concat "Locals:" gdb-selected-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3195 (use-local-map gdb-locals-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3196 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3197 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3198 (setq header-line-format gdb-locals-header)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3199 (gdb-thread-identification)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3200 (set (make-local-variable 'font-lock-defaults)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3201 '(gdb-locals-font-lock-keywords))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3202 (run-mode-hooks 'gdb-locals-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3203 (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3204 (string-equal gdb-version "pre-6.4"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3205 'gdb-invalidate-locals
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3206 'gdb-invalidate-locals-1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3207
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3208 (defun gdb-locals-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3209 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3210 (concat "*locals of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3211
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3212 (defun gdb-display-locals-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3213 "Display local variables of current stack and their values."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3214 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3215 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3216 (gdb-get-buffer-create 'gdb-locals-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3217
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3218 (defun gdb-frame-locals-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3219 "Display local variables of current stack and their values in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3220 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3221 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3222 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3223 (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3224
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3225
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3226 ;;;; Window management
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3227 (defun gdb-display-buffer (buf dedicated &optional frame)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3228 (let ((answer (get-buffer-window buf (or frame 0))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3229 (if answer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3230 (display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3231 (let ((window (get-lru-window)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3232 (if (memq (buffer-local-value 'gud-minor-mode (window-buffer window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3233 '(gdba gdbmi))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3234 (let* ((largest (get-largest-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3235 (cur-size (window-height largest)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3236 (setq answer (split-window largest))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3237 (set-window-buffer answer buf)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3238 (set-window-dedicated-p answer dedicated)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3239 answer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3240 (set-window-buffer window buf)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3241 window)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3242
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3243
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3244 ;;; Shared keymap initialization:
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3245
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3246 (let ((menu (make-sparse-keymap "GDB-Windows")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3247 (define-key gud-menu-map [displays]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3248 `(menu-item "GDB-Windows" ,menu
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3249 :help "Open a GDB-UI buffer in a new window."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3250 :visible (memq gud-minor-mode '(gdbmi gdba))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3251 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3252 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3253 (define-key menu [inferior]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3254 '(menu-item "Separate IO" gdb-display-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3255 :enable gdb-use-separate-io-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3256 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3257 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3258 (define-key menu [disassembly]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3259 '("Disassembly" . gdb-display-assembler-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3260 (define-key menu [breakpoints]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3261 '("Breakpoints" . gdb-display-breakpoints-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3262 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3263 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3264
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3265 (let ((menu (make-sparse-keymap "GDB-Frames")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3266 (define-key gud-menu-map [frames]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3267 `(menu-item "GDB-Frames" ,menu
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3268 :help "Open a GDB-UI buffer in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3269 :visible (memq gud-minor-mode '(gdbmi gdba))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3270 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3271 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3272 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3273 (define-key menu [inferior]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3274 '(menu-item "Separate IO" gdb-frame-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3275 :enable gdb-use-separate-io-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3276 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3277 (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3278 (define-key menu [breakpoints]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3279 '("Breakpoints" . gdb-frame-breakpoints-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3280 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3281 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3282
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3283 (let ((menu (make-sparse-keymap "GDB-UI/MI")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3284 (define-key gud-menu-map [ui]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3285 `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3286 ,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3287 (define-key menu [gdb-customize]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3288 '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3289 :help "Customize Gdb Graphical Mode options."))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3290 (define-key menu [gdb-find-source-frame]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3291 '(menu-item "Look For Source Frame" gdb-find-source-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3292 :visible (eq gud-minor-mode 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3293 :help "Toggle looking for source frame further up call stack."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3294 :button (:toggle . gdb-find-source-frame)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3295 (define-key menu [gdb-use-separate-io]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3296 '(menu-item "Separate IO" gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3297 :visible (eq gud-minor-mode 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3298 :help "Toggle separate IO for debugged program."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3299 :button (:toggle . gdb-use-separate-io-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3300 (define-key menu [gdb-many-windows]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3301 '(menu-item "Display Other Windows" gdb-many-windows
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
3302 :help "Toggle display of locals, stack and breakpoint information."
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3303 :button (:toggle . gdb-many-windows)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3304 (define-key menu [gdb-restore-windows]
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3305 '(menu-item "Restore Window Layout" gdb-restore-windows
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3306 :help "Restore standard layout for debug session.")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3307
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3308 (defun gdb-frame-gdb-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3309 "Display GUD buffer in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3310 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3311 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3312 (special-display-frame-alist
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3313 (remove '(menu-bar-lines) (remove '(tool-bar-lines)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3314 gdb-frame-parameters)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3315 (same-window-regexps nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3316 (display-buffer gud-comint-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3317
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3318 (defun gdb-display-gdb-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3319 "Display GUD buffer."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3320 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3321 (let ((same-window-regexps nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3322 (select-window (display-buffer gud-comint-buffer nil 0))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3323
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3324 (defun gdb-set-window-buffer (name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3325 (set-window-buffer (selected-window) (get-buffer name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3326 (set-window-dedicated-p (selected-window) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3327
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3328 (defun gdb-setup-windows ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3329 "Layout the window pattern for `gdb-many-windows'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3330 (gdb-display-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3331 (gdb-display-stack-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3332 (delete-other-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3333 (gdb-display-breakpoints-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3334 (delete-other-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3335 ; Don't dedicate.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3336 (pop-to-buffer gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3337 (split-window nil ( / ( * (window-height) 3) 4))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3338 (split-window nil ( / (window-height) 3))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3339 (split-window-horizontally)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3340 (other-window 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3341 (gdb-set-window-buffer (gdb-locals-buffer-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3342 (other-window 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3343 (switch-to-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3344 (if gud-last-last-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3345 (gud-find-file (car gud-last-last-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3346 (if gdb-main-file
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3347 (gud-find-file gdb-main-file)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3348 ;; Put buffer list in window if we
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3349 ;; can't find a source file.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3350 (list-buffers-noselect))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3351 (setq gdb-source-window (selected-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3352 (when gdb-use-separate-io-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3353 (split-window-horizontally)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3354 (other-window 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3355 (gdb-set-window-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3356 (gdb-get-buffer-create 'gdb-inferior-io)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3357 (other-window 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3358 (gdb-set-window-buffer (gdb-stack-buffer-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3359 (split-window-horizontally)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3360 (other-window 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3361 (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3362 (other-window 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3363
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3364 (defun gdb-restore-windows ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3365 "Restore the basic arrangement of windows used by gdba.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3366 This arrangement depends on the value of `gdb-many-windows'."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3367 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3368 (pop-to-buffer gud-comint-buffer) ;Select the right window and frame.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3369 (delete-other-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3370 (if gdb-many-windows
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3371 (gdb-setup-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3372 (when (or gud-last-last-frame gdb-show-main)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3373 (split-window)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3374 (other-window 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3375 (switch-to-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3376 (if gud-last-last-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3377 (gud-find-file (car gud-last-last-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3378 (gud-find-file gdb-main-file)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3379 (setq gdb-source-window (selected-window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3380 (other-window 1))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3381
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3382 (defun gdb-reset ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3383 "Exit a debugging session cleanly.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3384 Kills the gdb buffers, and resets variables and the source buffers."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3385 (dolist (buffer (buffer-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3386 (unless (eq buffer gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3387 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3388 (if (memq gud-minor-mode '(gdbmi gdba))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3389 (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3390 (kill-buffer nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3391 (gdb-remove-breakpoint-icons (point-min) (point-max) t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3392 (setq gud-minor-mode nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3393 (kill-local-variable 'tool-bar-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3394 (kill-local-variable 'gdb-define-alist))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3395 (setq gdb-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3396 (setq overlay-arrow-variable-list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3397 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3398 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3399 (setq gdb-stack-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3400 (setq overlay-arrow-variable-list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3401 (delq 'gdb-stack-position overlay-arrow-variable-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3402 (if (boundp 'speedbar-frame) (speedbar-timer-fn))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3403 (setq gud-running nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3404 (setq gdb-active-process nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3405 (setq gdb-var-list nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3406 (remove-hook 'after-save-hook 'gdb-create-define-alist t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3407
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3408 (defun gdb-source-info ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3409 "Find the source file where the program starts and display it with related
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3410 buffers."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3411 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3412 (if (and (search-forward "Located in " nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3413 (looking-at "\\S-+"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3414 (setq gdb-main-file (match-string 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3415 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3416 (if (search-forward "Includes preprocessor macro info." nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3417 (setq gdb-macro-info t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3418 (if gdb-many-windows
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3419 (gdb-setup-windows)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3420 (gdb-get-buffer-create 'gdb-breakpoints-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3421 (if (and gdb-show-main gdb-main-file)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3422 (let ((pop-up-windows t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3423 (display-buffer (gud-find-file gdb-main-file)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3424 (setq gdb-ready t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3425
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3426 (defun gdb-get-location (bptno line flag)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3427 "Find the directory containing the relevant source file.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3428 Put in buffer and place breakpoint icon."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3429 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3430 (catch 'file-not-found
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3431 (if (search-forward "Located in " nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3432 (when (looking-at "\\S-+")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3433 (delete (cons bptno "File not found") gdb-location-alist)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3434 (push (cons bptno (match-string 0)) gdb-location-alist))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3435 (gdb-resync)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3436 (unless (assoc bptno gdb-location-alist)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3437 (push (cons bptno "File not found") gdb-location-alist)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3438 (message-box "Cannot find source file for breakpoint location.\n\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3439 Add directory to search path for source files using the GDB command, dir."))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3440 (throw 'file-not-found nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3441 (with-current-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3442 (find-file-noselect (match-string 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3443 (gdb-init-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3444 ;; only want one breakpoint icon at each location
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3445 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3446 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3447 (forward-line (1- (string-to-number line)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3448 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3449
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3450 (add-hook 'find-file-hook 'gdb-find-file-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3451
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3452 (defun gdb-find-file-hook ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3453 "Set up buffer for debugging if file is part of the source code
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3454 of the current session."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3455 (if (and (buffer-name gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3456 ;; in case gud or gdb-ui is just loaded
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3457 gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3458 (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3459 '(gdba gdbmi)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3460 ;;Pre GDB 6.3 "info sources" doesn't give absolute file name.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3461 (if (member (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3462 (file-name-nondirectory buffer-file-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3463 buffer-file-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3464 gdb-source-file-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3465 (with-current-buffer (find-buffer-visiting buffer-file-name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3466 (gdb-init-buffer)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3467
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3468 ;;from put-image
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3469 (defun gdb-put-string (putstring pos &optional dprop &rest sprops)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3470 "Put string PUTSTRING in front of POS in the current buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3471 PUTSTRING is displayed by putting an overlay into the current buffer with a
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3472 `before-string' string that has a `display' property whose value is
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3473 PUTSTRING."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3474 (let ((string (make-string 1 ?x))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3475 (buffer (current-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3476 (setq putstring (copy-sequence putstring))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3477 (let ((overlay (make-overlay pos pos buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3478 (prop (or dprop
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3479 (list (list 'margin 'left-margin) putstring))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3480 (put-text-property 0 1 'display prop string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3481 (if sprops
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3482 (add-text-properties 0 1 sprops string))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3483 (overlay-put overlay 'put-break t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3484 (overlay-put overlay 'before-string string))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3485
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3486 ;;from remove-images
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3487 (defun gdb-remove-strings (start end &optional buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3488 "Remove strings between START and END in BUFFER.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3489 Remove only strings that were put in BUFFER with calls to `gdb-put-string'.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3490 BUFFER nil or omitted means use the current buffer."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3491 (unless buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3492 (setq buffer (current-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3493 (dolist (overlay (overlays-in start end))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3494 (when (overlay-get overlay 'put-break)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3495 (delete-overlay overlay))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3496
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3497 (defun gdb-put-breakpoint-icon (enabled bptno)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3498 (if (string-match "[0-9+]+\\." bptno)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3499 (setq enabled gdb-parent-bptno-enabled))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3500 (let ((start (- (line-beginning-position) 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3501 (end (+ (line-end-position) 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3502 (putstring (if enabled "B" "b"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3503 (source-window (get-buffer-window (current-buffer) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3504 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3505 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3506 putstring)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3507 (if enabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3508 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3509 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3510 (add-text-properties
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3511 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3512 (gdb-remove-breakpoint-icons start end)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3513 (if (display-images-p)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3514 (if (>= (or left-fringe-width
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3515 (if source-window (car (window-fringes source-window)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3516 gdb-buffer-fringe-width) 8)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3517 (gdb-put-string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3518 nil (1+ start)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3519 `(left-fringe breakpoint
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3520 ,(if enabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3521 'breakpoint-enabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3522 'breakpoint-disabled))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3523 'gdb-bptno bptno
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3524 'gdb-enabled enabled)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3525 (when (< left-margin-width 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3526 (save-current-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3527 (setq left-margin-width 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3528 (if source-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3529 (set-window-margins
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3530 source-window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3531 left-margin-width right-margin-width))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3532 (put-image
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3533 (if enabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3534 (or breakpoint-enabled-icon
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3535 (setq breakpoint-enabled-icon
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3536 (find-image `((:type xpm :data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3537 ,breakpoint-xpm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3538 :ascent 100 :pointer hand)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3539 (:type pbm :data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3540 ,breakpoint-enabled-pbm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3541 :ascent 100 :pointer hand)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3542 (or breakpoint-disabled-icon
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3543 (setq breakpoint-disabled-icon
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3544 (find-image `((:type xpm :data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3545 ,breakpoint-xpm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3546 :conversion disabled
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3547 :ascent 100 :pointer hand)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3548 (:type pbm :data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3549 ,breakpoint-disabled-pbm-data
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3550 :ascent 100 :pointer hand))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3551 (+ start 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3552 putstring
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3553 'left-margin))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3554 (when (< left-margin-width 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3555 (save-current-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3556 (setq left-margin-width 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3557 (let ((window (get-buffer-window (current-buffer) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3558 (if window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3559 (set-window-margins
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3560 window left-margin-width right-margin-width)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3561 (gdb-put-string
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3562 (propertize putstring
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3563 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3564 (1+ start)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3565
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3566 (defun gdb-remove-breakpoint-icons (start end &optional remove-margin)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3567 (gdb-remove-strings start end)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3568 (if (display-images-p)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3569 (remove-images start end))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3570 (when remove-margin
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3571 (setq left-margin-width 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3572 (let ((window (get-buffer-window (current-buffer) 0)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3573 (if window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3574 (set-window-margins
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3575 window left-margin-width right-margin-width)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3576
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3577
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3578 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3579 ;; Assembler buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3580 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3581 (gdb-set-buffer-rules 'gdb-assembler-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3582 'gdb-assembler-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3583 'gdb-assembler-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3584
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3585 ;; We can't use def-gdb-auto-update-handler because we don't want to use
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3586 ;; window-start but keep the overlay arrow/current line visible.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3587 (defun gdb-assembler-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3588 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3589 (delq 'gdb-invalidate-assembler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3590 gdb-pending-triggers))
107196
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3591 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3592 (with-current-buffer buf
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3593 (goto-char (point-min))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3594 ;; The disassemble command in GDB 7.1 onwards displays an overlay arrow.
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3595 (while (re-search-forward "\\(^ 0x\\|=> 0x\\)" nil t)
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3596 (replace-match "0x" nil nil))))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3597 (let ((buf (gdb-get-buffer 'gdb-assembler-buffer)))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3598 (and buf
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3599 (with-current-buffer buf
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3600 (let* ((window (get-buffer-window buf 0))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3601 (p (window-point window))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3602 (buffer-read-only nil))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3603 (erase-buffer)
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3604 (insert-buffer-substring (gdb-get-buffer-create
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3605 'gdb-partial-output-buffer))
107196
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3606 (set-window-point window p)))))
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3607 ;; put customisation here
19bad34b0d81 Accommodate change of disassemble output in GDB 7.1.
Nick Roberts <nickrob@snap.net.nz>
parents: 106840
diff changeset
3608 (gdb-assembler-custom))
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3609
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3610 (defun gdb-assembler-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3611 (let ((buffer (gdb-get-buffer 'gdb-assembler-buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3612 (pos 1) (address) (flag) (bptno))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3613 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3614 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3615 (if (not (equal gdb-pc-address "main"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3616 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3617 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3618 (if (and gdb-pc-address
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3619 (search-forward gdb-pc-address nil t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3620 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3621 (setq pos (point))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3622 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3623 (setq fringe-indicator-alist
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3624 (if (string-equal gdb-frame-number "0")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3625 nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3626 '((overlay-arrow . hollow-right-triangle))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3627 (or gdb-overlay-arrow-position
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3628 (setq gdb-overlay-arrow-position (make-marker)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3629 (set-marker gdb-overlay-arrow-position (point))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3630 ;; remove all breakpoint-icons in assembler buffer before updating.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3631 (gdb-remove-breakpoint-icons (point-min) (point-max))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3632 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3633 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3634 (while (< (point) (- (point-max) 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3635 (forward-line 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3636 (when (looking-at
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3637 "\\([0-9]+\\.?[0-9]*\\).*?\\s-+\\(.\\)\\s-+0x0*\\(\\S-+\\)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3638 (setq bptno (match-string 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3639 (setq flag (char-after (match-beginning 2)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3640 (setq address (match-string 3))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3641 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3642 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3643 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3644 (if (re-search-forward (concat "^0x0*" address) nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3645 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3646 (if (not (equal gdb-pc-address "main"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3647 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3648 (set-window-point (get-buffer-window buffer 0) pos)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3649
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3650 (defvar gdb-assembler-mode-map
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3651 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3652 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3653 (define-key map "q" 'kill-this-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3654 map))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3655
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3656 (defvar gdb-assembler-font-lock-keywords
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3657 '(;; <__function.name+n>
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3658 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3659 (1 font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3660 ;; 0xNNNNNNNN <__function.name+n>: opcode
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3661 ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3662 (4 font-lock-keyword-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3663 ;; %register(at least i386)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3664 ("%\\sw+" . font-lock-variable-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3665 ("^\\(Dump of assembler code for function\\) \\(.+\\):"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3666 (1 font-lock-comment-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3667 (2 font-lock-function-name-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3668 ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3669 "Font lock keywords used in `gdb-assembler-mode'.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3670
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3671 (defun gdb-assembler-mode ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3672 "Major mode for viewing code assembler.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3673
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3674 \\{gdb-assembler-mode-map}"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3675 (kill-all-local-variables)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3676 (setq major-mode 'gdb-assembler-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3677 (setq mode-name (concat "Machine:" gdb-selected-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3678 (setq gdb-overlay-arrow-position nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3679 (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3680 (setq fringes-outside-margins t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3681 (setq buffer-read-only t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3682 (buffer-disable-undo)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3683 (gdb-thread-identification)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3684 (use-local-map gdb-assembler-mode-map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3685 (gdb-invalidate-assembler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3686 (set (make-local-variable 'font-lock-defaults)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3687 '(gdb-assembler-font-lock-keywords))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3688 (run-mode-hooks 'gdb-assembler-mode-hook)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3689 'gdb-invalidate-assembler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3690
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3691 (defun gdb-assembler-buffer-name ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3692 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3693 (concat "*disassembly of " (gdb-get-target-string) "*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3694
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3695 (defun gdb-display-assembler-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3696 "Display disassembly view."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3697 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3698 (setq gdb-previous-frame nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3699 (gdb-display-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3700 (gdb-get-buffer-create 'gdb-assembler-buffer) t))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3701
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3702 (defun gdb-frame-assembler-buffer ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3703 "Display disassembly view in a new frame."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3704 (interactive)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3705 (setq gdb-previous-frame nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3706 (let ((special-display-regexps (append special-display-regexps '(".*")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3707 (special-display-frame-alist gdb-frame-parameters))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3708 (display-buffer (gdb-get-buffer-create 'gdb-assembler-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3709
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3710 ;; modified because if gdb-pc-address has changed value a new command
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3711 ;; must be enqueued to update the buffer with the new output
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3712 (defun gdb-invalidate-assembler (&optional ignored)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3713 (if (gdb-get-buffer 'gdb-assembler-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3714 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3715 (unless (and gdb-selected-frame
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3716 (string-equal gdb-selected-frame gdb-previous-frame))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3717 (if (or (not (member 'gdb-invalidate-assembler
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3718 gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3719 (not (equal (string-to-number gdb-pc-address)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3720 (string-to-number
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3721 gdb-previous-frame-pc-address))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3722 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3723 ;; take previous disassemble command, if any, off the queue
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3724 (with-current-buffer gud-comint-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3725 (let ((queue gdb-input-queue))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3726 (dolist (item queue)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3727 (if (equal (cdr item) '(gdb-assembler-handler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3728 (setq gdb-input-queue
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3729 (delete item gdb-input-queue))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3730 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3731 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3732 (concat gdb-server-prefix "disassemble " gdb-pc-address "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3733 'gdb-assembler-handler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3734 (push 'gdb-invalidate-assembler gdb-pending-triggers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3735 (setq gdb-previous-frame-pc-address gdb-pc-address)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3736 (setq gdb-previous-frame gdb-selected-frame)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3737
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3738 (defun gdb-get-selected-frame ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3739 (if (not (member 'gdb-get-selected-frame gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3740 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3741 (if (string-equal gdb-version "pre-6.4")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3742 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3743 (list (concat gdb-server-prefix "info frame\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3744 'gdb-frame-handler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3745 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3746 (list "server interpreter mi -stack-info-frame\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3747 'gdb-frame-handler-1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3748 (push 'gdb-get-selected-frame gdb-pending-triggers))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3749
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3750 (defun gdb-frame-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3751 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3752 (delq 'gdb-get-selected-frame gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3753 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3754 (when (re-search-forward
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3755 "Stack level \\([0-9]+\\), frame at \\(0x[[:xdigit:]]+\\)" nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3756 (setq gdb-frame-number (match-string 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3757 (setq gdb-frame-address (match-string 2)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3758 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3759 (when (re-search-forward ".*=\\s-+\\(\\S-*\\)\\s-+in\\s-+\\(.*?\\)\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3760 \\(?: (\\(\\S-+?\\):[0-9]+?)\\)*; "
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3761 nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3762 (setq gdb-selected-frame (match-string 2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3763 (if (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3764 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3765 (setq mode-name (concat "Locals:" gdb-selected-frame))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3766 (if (gdb-get-buffer 'gdb-assembler-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3767 (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3768 (setq mode-name (concat "Machine:" gdb-selected-frame))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3769 (setq gdb-pc-address (match-string 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3770 (if (and (match-string 3) gud-overlay-arrow-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3771 (let ((buffer (marker-buffer gud-overlay-arrow-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3772 (position (marker-position gud-overlay-arrow-position)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3773 (when (and buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3774 (string-equal (file-name-nondirectory
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3775 (buffer-file-name buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3776 (file-name-nondirectory (match-string 3))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3777 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3778 (setq fringe-indicator-alist
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3779 (if (string-equal gdb-frame-number "0")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3780 nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3781 '((overlay-arrow . hollow-right-triangle))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3782 (set-marker gud-overlay-arrow-position position))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3783 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3784 (if (re-search-forward " source language \\(\\S-+\\)\." nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3785 (setq gdb-current-language (match-string 1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3786 (gdb-invalidate-assembler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3787
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3788
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3789 ;; Code specific to GDB 6.4
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3790 (defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3791
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3792 (defun gdb-set-gud-minor-mode-existing-buffers-1 ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3793 "Create list of source files for current GDB session.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3794 If buffers already exist for any of these files, `gud-minor-mode'
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3795 is set in them."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3796 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3797 (while (re-search-forward gdb-source-file-regexp-1 nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3798 (push (match-string 1) gdb-source-file-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3799 (dolist (buffer (buffer-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3800 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3801 (when (member buffer-file-name gdb-source-file-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3802 (gdb-init-buffer))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3803 (gdb-force-mode-line-update
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3804 (propertize "ready" 'face font-lock-variable-name-face)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3805
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3806 ;; Used for -stack-info-frame but could be used for -stack-list-frames too.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3807 (defconst gdb-stack-list-frames-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3808 ".*?level=\"\\(.*?\\)\".*?,addr=\"\\(.*?\\)\".*?,func=\"\\(.*?\\)\",\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3809 \\(?:.*?file=\".*?\".*?,fullname=\"\\(.*?\\)\".*?,line=\"\\(.*?\\)\".*?}\\|\
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3810 from=\"\\(.*?\\)\"\\)")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3811
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3812 (defun gdb-frame-handler-1 ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3813 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3814 (delq 'gdb-get-selected-frame gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3815 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3816 (when (re-search-forward gdb-stack-list-frames-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3817 (setq gdb-frame-number (match-string 1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3818 (setq gdb-pc-address (match-string 2))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3819 (setq gdb-selected-frame (match-string 3))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3820 (if (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3821 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3822 (setq mode-name (concat "Locals:" gdb-selected-frame))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3823 (if (gdb-get-buffer 'gdb-assembler-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3824 (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3825 (setq mode-name (concat "Machine:" gdb-selected-frame)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3826 (if (and (match-string 4) (match-string 5) gud-overlay-arrow-position)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3827 (let ((buffer (marker-buffer gud-overlay-arrow-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3828 (position (marker-position gud-overlay-arrow-position)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3829 (when (and buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3830 (string-equal (file-name-nondirectory
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3831 (buffer-file-name buffer))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3832 (file-name-nondirectory (match-string 4))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3833 (with-current-buffer buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3834 (setq fringe-indicator-alist
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3835 (if (string-equal gdb-frame-number "0")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3836 nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3837 '((overlay-arrow . hollow-right-triangle))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3838 (set-marker gud-overlay-arrow-position position)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3839 (gdb-invalidate-assembler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3840
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3841 ; Uses "-var-list-children --all-values". Needs GDB 6.4 onwards.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3842 (defun gdb-var-list-children-1 (varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3843 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3844 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3845 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3846 (concat "server interpreter mi \"-var-list-children --all-values \\\""
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3847 varnum "\\\"\"\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3848 (concat "-var-list-children --all-values \"" varnum "\"\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3849 `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3850
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3851 (defun gdb-var-list-children-handler-1 (varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3852 (let* ((var-list nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3853 (output (bindat-get-field (gdb-json-partial-output "child")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3854 (children (bindat-get-field output 'children)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3855 (catch 'child-already-watched
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3856 (dolist (var gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3857 (if (string-equal varnum (car var))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3858 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3859 ;; With dynamic varobjs numchild may have increased.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3860 (setcar (nthcdr 2 var) (bindat-get-field output 'numchild))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3861 (push var var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3862 (dolist (child children)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3863 (let ((varchild (list (bindat-get-field child 'name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3864 (bindat-get-field child 'exp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3865 (bindat-get-field child 'numchild)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3866 (bindat-get-field child 'type)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3867 (bindat-get-field child 'value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3868 nil
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3869 (bindat-get-field child 'has_more))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3870 (if (assoc (car varchild) gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3871 (throw 'child-already-watched nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3872 (push varchild var-list))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3873 (push var var-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3874 (setq gdb-var-list (nreverse var-list))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3875 (gdb-speedbar-update))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3876
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3877 ; Uses "-var-update --all-values". Needs GDB 6.4 onwards.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3878 (defun gdb-var-update-1 ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3879 (if (not (member 'gdb-var-update gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3880 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3881 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3882 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3883 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3884 "server interpreter mi \"-var-update --all-values *\"\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3885 "-var-update --all-values *\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3886 'gdb-var-update-handler-1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3887 (push 'gdb-var-update gdb-pending-triggers))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3888
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3889 (defun gdb-var-update-handler-1 ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3890 (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3891 (dolist (var gdb-var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3892 (setcar (nthcdr 5 var) nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3893 (let ((temp-var-list gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3894 (dolist (change changelist)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3895 (let* ((varnum (bindat-get-field change 'name))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3896 (var (assoc varnum gdb-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3897 (new-num (bindat-get-field change 'new_num_children)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3898 (when var
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3899 (let ((scope (bindat-get-field change 'in_scope))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3900 (has-more (bindat-get-field change 'has_more)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3901 (cond ((string-equal scope "false")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3902 (if gdb-delete-out-of-scope
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3903 (gdb-var-delete-1 var varnum)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3904 (setcar (nthcdr 5 var) 'out-of-scope)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3905 ((string-equal scope "true")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3906 (setcar (nthcdr 6 var) has-more)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3907 (when (and (or (not has-more)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3908 (string-equal has-more "0"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3909 (not new-num)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3910 (string-equal (nth 2 var) "0"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3911 (setcar (nthcdr 4 var)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3912 (bindat-get-field change 'value))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3913 (setcar (nthcdr 5 var) 'changed)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3914 ((string-equal scope "invalid")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3915 (gdb-var-delete-1 var varnum)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3916 (let ((var-list nil) var1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3917 (children (bindat-get-field change 'new_children)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3918 (if new-num
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3919 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3920 (setq var1 (pop temp-var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3921 (while var1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3922 (if (string-equal varnum (car var1))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3923 (let ((new (string-to-number new-num))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3924 (previous (string-to-number (nth 2 var1))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3925 (setcar (nthcdr 2 var1) new-num)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3926 (push var1 var-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3927 (cond ((> new previous)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3928 ;; Add new children to list.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3929 (dotimes (dummy previous)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3930 (push (pop temp-var-list) var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3931 (dolist (child children)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3932 (let ((varchild
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3933 (list (bindat-get-field child 'name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3934 (bindat-get-field child 'exp)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3935 (bindat-get-field child 'numchild)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3936 (bindat-get-field child 'type)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3937 (bindat-get-field child 'value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3938 'changed
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3939 (bindat-get-field child 'has_more))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3940 (push varchild var-list))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3941 ;; Remove deleted children from list.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3942 ((< new previous)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3943 (dotimes (dummy new)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3944 (push (pop temp-var-list) var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3945 (dotimes (dummy (- previous new))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3946 (pop temp-var-list)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3947 (push var1 var-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3948 (setq var1 (pop temp-var-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3949 (setq gdb-var-list (nreverse var-list)))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3950 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3951 (delq 'gdb-var-update gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3952 (gdb-speedbar-update))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3953
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3954 ;; Registers buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3955 ;;
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3956 (gdb-set-buffer-rules 'gdb-registers-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3957 'gdb-registers-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3958 'gdb-registers-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3959
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3960 (def-gdb-auto-update-trigger gdb-invalidate-registers-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3961 (gdb-get-buffer 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3962 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3963 "server interpreter mi \"-data-list-register-values x\"\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3964 "-data-list-register-values x\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3965 gdb-data-list-register-values-handler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3966
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3967 (defconst gdb-data-list-register-values-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3968 "{.*?number=\"\\(.*?\\)\".*?,value=\"\\(.*?\\)\".*?}")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3969
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3970 (defun gdb-data-list-register-values-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3971 (setq gdb-pending-triggers (delq 'gdb-invalidate-registers-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3972 gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3973 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3974 (if (re-search-forward gdb-error-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3975 (let ((err (match-string 1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3976 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3977 (let ((buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3978 (erase-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3979 (put-text-property 0 (length err) 'face font-lock-warning-face err)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3980 (insert err)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3981 (goto-char (point-min)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3982 (let ((register-list (reverse gdb-register-names))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3983 (register nil) (register-string nil) (register-values nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3984 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3985 (while (re-search-forward gdb-data-list-register-values-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3986 (setq register (pop register-list))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3987 (setq register-string (concat register "\t" (match-string 2) "\n"))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3988 (if (member (match-string 1) gdb-changed-registers)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3989 (put-text-property 0 (length register-string)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3990 'face 'font-lock-warning-face
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3991 register-string))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3992 (setq register-values
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3993 (concat register-values register-string)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3994 (let ((buf (gdb-get-buffer 'gdb-registers-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3995 (with-current-buffer buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3996 (let* ((window (get-buffer-window buf 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3997 (start (window-start window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3998 (p (if window (window-point window) (point)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
3999 (buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4000 (erase-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4001 (insert register-values)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4002 (if window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4003 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4004 (set-window-start window start)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4005 (set-window-point window p))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4006 (goto-char p)))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4007 (gdb-data-list-register-values-custom))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4008
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4009 (defun gdb-data-list-register-values-custom ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4010 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4011 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4012 (let ((buffer-read-only nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4013 start end)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4014 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4015 (while (< (point) (point-max))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4016 (setq start (line-beginning-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4017 (setq end (line-end-position))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4018 (when (looking-at "^[^\t]+")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4019 (unless (string-equal (match-string 0) "No registers.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4020 (put-text-property start (match-end 0)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4021 'face font-lock-variable-name-face)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4022 (add-text-properties start end
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4023 '(help-echo "mouse-2: edit value"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4024 mouse-face highlight))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4025 (forward-line 1))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4026
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4027 ;; Needs GDB 6.4 onwards (used to fail with no stack).
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4028 (defun gdb-get-changed-registers ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4029 (if (and (gdb-get-buffer 'gdb-registers-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4030 (not (member 'gdb-get-changed-registers gdb-pending-triggers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4031 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4032 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4033 (list
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4034 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4035 "server interpreter mi -data-list-changed-registers\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4036 "-data-list-changed-registers\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4037 'gdb-get-changed-registers-handler))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4038 (push 'gdb-get-changed-registers gdb-pending-triggers))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4039
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4040 (defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4041
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4042 (defun gdb-get-changed-registers-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4043 (setq gdb-pending-triggers
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4044 (delq 'gdb-get-changed-registers gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4045 (setq gdb-changed-registers nil)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4046 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4047 (while (re-search-forward gdb-data-list-register-names-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4048 (push (match-string 1) gdb-changed-registers)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4049
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4050
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4051 ;; Locals buffer.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4052 ;;
106697
ac408704629c lisp/*: Fix typos in docstrings and messages.
Juanma Barranquero <lekktu@gmail.com>
parents: 106680
diff changeset
4053 ;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards.
106678
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4054 (gdb-set-buffer-rules 'gdb-locals-buffer
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4055 'gdb-locals-buffer-name
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4056 'gdb-locals-mode)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4057
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4058 (def-gdb-auto-update-trigger gdb-invalidate-locals-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4059 (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4060 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4061 "server interpreter mi -\"stack-list-locals --simple-values\"\n"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4062 "-stack-list-locals --simple-values\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4063 gdb-stack-list-locals-handler)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4064
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4065 (defconst gdb-stack-list-locals-regexp
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4066 "{.*?name=\"\\(.*?\\)\".*?,type=\"\\(.*?\\)\"")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4067
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4068 (defvar gdb-locals-watch-map-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4069 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4070 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4071 (define-key map "\r" 'gud-watch)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4072 (define-key map [mouse-2] 'gud-watch)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4073 map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4074 "Keymap to create watch expression of a complex data type local variable.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4075
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4076 (defvar gdb-edit-locals-map-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4077 (let ((map (make-sparse-keymap)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4078 (suppress-keymap map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4079 (define-key map "\r" 'gdb-edit-locals-value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4080 (define-key map [mouse-2] 'gdb-edit-locals-value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4081 map)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4082 "Keymap to edit value of a simple data type local variable.")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4083
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4084 (defun gdb-edit-locals-value (&optional event)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4085 "Assign a value to a variable displayed in the locals buffer."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4086 (interactive (list last-input-event))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4087 (save-excursion
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4088 (if event (posn-set-point (event-end event)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4089 (beginning-of-line)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4090 (let* ((var (current-word))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4091 (value (read-string (format "New value (%s): " var))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4092 (gdb-enqueue-input
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4093 (list (concat gdb-server-prefix "set variable " var " = " value "\n")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4094 'ignore)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4095
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4096 ;; Dont display values of arrays or structures.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4097 ;; These can be expanded using gud-watch.
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4098 (defun gdb-stack-list-locals-handler ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4099 (setq gdb-pending-triggers (delq 'gdb-invalidate-locals-1
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4100 gdb-pending-triggers))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4101 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4102 (if (re-search-forward gdb-error-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4103 (let ((err (match-string 1)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4104 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4105 (let ((buffer-read-only nil))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4106 (erase-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4107 (insert err)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4108 (goto-char (point-min)))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4109 (let (local locals-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4110 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4111 (while (re-search-forward gdb-stack-list-locals-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4112 (let ((local (list (match-string 1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4113 (match-string 2)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4114 nil)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4115 (if (looking-at ",value=\\(\".*\"\\).*?}")
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4116 (setcar (nthcdr 2 local) (read (match-string 1))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4117 (push local locals-list)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4118 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4119 (and buf (with-current-buffer buf
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4120 (let* ((window (get-buffer-window buf 0))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4121 (start (window-start window))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4122 (p (if window (window-point window) (point)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4123 (buffer-read-only nil) (name) (value))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4124 (erase-buffer)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4125 (dolist (local locals-list)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4126 (setq name (car local))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4127 (setq value (nth 2 local))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4128 (if (or (not value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4129 (string-match "^\\0x" value))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4130 (add-text-properties 0 (length name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4131 `(mouse-face highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4132 help-echo "mouse-2: create watch expression"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4133 local-map ,gdb-locals-watch-map-1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4134 name)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4135 (add-text-properties 0 (length value)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4136 `(mouse-face highlight
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4137 help-echo "mouse-2: edit value"
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4138 local-map ,gdb-edit-locals-map-1)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4139 value))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4140 (insert
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4141 (concat name "\t" (nth 1 local)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4142 "\t" value "\n")))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4143 (if window
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4144 (progn
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4145 (set-window-start window start)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4146 (set-window-point window p))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4147 (goto-char p)))))))))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4148
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4149 (defun gdb-get-register-names ()
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4150 "Create a list of register names."
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4151 (goto-char (point-min))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4152 (while (re-search-forward gdb-data-list-register-names-regexp nil t)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4153 (push (match-string 1) gdb-register-names)))
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4154
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4155 (provide 'gdb-ui)
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4156
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4157 ;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352
3a8fd7717b30 This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
Nick Roberts <nickrob@snap.net.nz>
parents:
diff changeset
4158 ;;; gdb-ui.el ends here