Mercurial > emacs
annotate lisp/progmodes/gdb-mi.el @ 104247:9caaade61f03
* progmodes/compile.el (compilation-goto-locus): Use next-error-move-function.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 13 Aug 2009 00:58:54 +0000 |
parents | e2940cb3d84e |
children | fdb28981838b |
rev | line source |
---|---|
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1 ;;; gdb-mi.el --- User Interface for running GDB |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2 |
103563 | 3 ;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. |
4 | |
5 ;; Author: Nick Roberts <nickrob@gnu.org> | |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
6 ;; Maintainer: FSF |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
7 ;; Keywords: unix, tools |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
8 |
103563 | 9 ;; This file is part of GNU Emacs. |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
10 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
11 ;; Homepage: http://www.emacswiki.org/emacs/GDB-MI |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
12 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
16 ;; (at your option) any later version. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
17 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
18 ;; GNU Emacs is distributed in the hope that it will be useful, |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
21 ;; GNU General Public License for more details. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
22 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
25 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
26 ;;; Credits: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
27 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
28 ;; This file was written by by Nick Roberts following the general design |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
29 ;; used in gdb-ui.el for Emacs 22.1 - 23.1. It is currently being developed |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
30 ;; by Dmitry Dzhus <dima@sphinx.net.ru> as part of the Google Summer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
31 ;; of Code 2009 Project "Emacs GDB/MI migration". |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
32 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
33 ;;; Commentary: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
34 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
35 ;; This mode acts as a graphical user interface to GDB. You can interact with |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
36 ;; GDB through the GUD buffer in the usual way, but there are also further |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
37 ;; buffers which control the execution and describe the state of your program. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
38 ;; It separates the input/output of your program from that of GDB and displays |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
39 ;; expressions and their current values in their own buffers. It also uses |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
40 ;; features of Emacs 21 such as the fringe/display margin for breakpoints, and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
41 ;; the toolbar (see the GDB Graphical Interface section in the Emacs info |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
42 ;; manual). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
43 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
44 ;; M-x gdb will start the debugger. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
45 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
46 ;; This file uses GDB/MI as the primary interface to GDB. It is still under |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
47 ;; development and is part of a process to migrate Emacs from annotations (as |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
48 ;; used in gdb-ui.el) to GDB/MI. It runs gdb with GDB/MI (-interp=mi) and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
49 ;; access CLI using "-interpreter-exec console cli-command". This code works |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
50 ;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
51 ;; should be asynchronous. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
52 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
53 ;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
54 ;; doesn't update properly when execution commands are issued from GUD buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
55 ;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
56 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
57 ;; You need development version of GDB 7.0 for the thread buffer to work. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
58 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
59 ;; This file replaces gdb-ui.el and is for development with GDB. Use the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
60 ;; release branch of Emacs 22 for the latest version of gdb-ui.el. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
61 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
62 ;; Windows Platforms: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
63 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
64 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
65 ;; explicitly in your program if you want timely display of I/O in Emacs. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
66 ;; Alternatively you can make the output stream unbuffered, for example, by |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
67 ;; using a macro: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
68 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
69 ;; #ifdef UNBUFFERED |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
70 ;; setvbuf (stdout, (char *) NULL, _IONBF, 0); |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
71 ;; #endif |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
72 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
73 ;; and compiling with -DUNBUFFERED while debugging. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
74 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
75 ;; If you are using Cygwin GDB and find that the source is not being displayed |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
76 ;; in Emacs when you step through it, possible solutions are to: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
77 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
78 ;; 1) Use Cygwin X Windows and Cygwin Emacs. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
79 ;; (Since 22.1 Emacs builds under Cygwin.) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
80 ;; 2) Use MinGW GDB instead. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
81 ;; 3) Use cygwin-mount.el |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
82 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
83 ;;; Mac OSX: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
84 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
85 ;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
86 ;; some changes to the version that they include as part of Mac OSX. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
87 ;; This requires GDB version 7.0 or later (estimated release date Aug 2009) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
88 ;; as earlier versions don not compile on Mac OSX. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
89 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
90 ;;; Known Bugs: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
91 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
92 ;; 1) Stack buffer doesn't parse MI output if you stop in a routine without |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
93 ;; line information, e.g., a routine in libc (just a TODO item). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
94 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
95 ;; TODO: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
96 ;; 2) Watch windows to work with threads. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
97 ;; 3) Use treebuffer.el instead of the speedbar for watch-expressions? |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
98 ;; 4) Mark breakpoint locations on scroll-bar of source buffer? |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
99 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
100 ;;; Code: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
101 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
102 (require 'gud) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
103 (require 'json) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
104 (require 'bindat) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
105 (require 'speedbar) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
106 (eval-when-compile |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
107 (require 'cl)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
108 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
109 (defvar tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
110 (defvar speedbar-initial-expansion-list-name) |
103955
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
111 (defvar speedbar-frame) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
112 |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
113 (defvar gdb-memory-address "main") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
114 (defvar gdb-memory-last-address nil |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
115 "Last successfully accessed memory address.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
116 (defvar gdb-memory-next-page nil |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
117 "Address of next memory page for program memory buffer.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
118 (defvar gdb-memory-prev-page nil |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
119 "Address of previous memory page for program memory buffer.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
120 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
121 (defvar gdb-thread-number nil |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
122 "Main current thread. |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
123 |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
124 Invalidation triggers use this variable to query GDB for |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
125 information on the specified thread by wrapping GDB/MI commands |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
126 in `gdb-current-context-command'. |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
127 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
128 This variable may be updated implicitly by GDB via `gdb-stopped' |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
129 or explicitly by `gdb-select-thread'. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
130 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
131 Only `gdb-setq-thread-number' should be used to change this |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
132 value.") |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
133 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
134 (defvar gdb-frame-number nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
135 "Selected frame level for main current thread. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
136 |
104232
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
137 Updated according to the following rules: |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
138 |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
139 When a thread is selected or current thread stops, set to \"0\". |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
140 |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
141 When current thread goes running (and possibly exits eventually), |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
142 set to nil. |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
143 |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
144 May be manually changed by user with `gdb-select-frame'.") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
145 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
146 ;; Used to show overlay arrow in source buffer. All set in |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
147 ;; gdb-get-main-selected-frame. Disassembly buffer should not use |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
148 ;; these but rely on buffer-local thread information instead. |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
149 (defvar gdb-selected-frame nil |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
150 "Name of selected function for main current thread.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
151 (defvar gdb-selected-file nil |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
152 "Name of selected file for main current thread.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
153 (defvar gdb-selected-line nil |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
154 "Number of selected line for main current thread.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
155 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
156 (defvar gdb-threads-list nil |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
157 "Associative list of threads provided by \"-thread-info\" MI command. |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
158 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
159 Keys are thread numbers (in strings) and values are structures as |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
160 returned from -thread-info by `gdb-json-partial-output'. Updated in |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
161 `gdb-thread-list-handler-custom'.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
162 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
163 (defvar gdb-running-threads-count nil |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
164 "Number of currently running threads. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
165 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
166 Nil means that no information is available. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
167 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
168 Updated in `gdb-thread-list-handler-custom'.") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
169 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
170 (defvar gdb-stopped-threads-count nil |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
171 "Number of currently stopped threads. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
172 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
173 See also `gdb-running-threads-count'.") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
174 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
175 (defvar gdb-breakpoints-list nil |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
176 "Associative list of breakpoints provided by \"-break-list\" MI command. |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
177 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
178 Keys are breakpoint numbers (in string) and values are structures |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
179 as returned from \"-break-list\" by `gdb-json-partial-output' |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
180 \(\"body\" field is used). Updated in |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
181 `gdb-breakpoints-list-handler-custom'.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
182 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
183 (defvar gdb-current-language nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
184 (defvar gdb-var-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
185 "List of variables in watch window. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
186 Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS) where |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
187 STATUS is nil (unchanged), `changed' or `out-of-scope'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
188 (defvar gdb-main-file nil "Source file from which program execution begins.") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
189 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
190 ;; Overlay arrow markers |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
191 (defvar gdb-stack-position nil) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
192 (defvar gdb-thread-position nil) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
193 (defvar gdb-disassembly-position nil) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
194 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
195 (defvar gdb-location-alist nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
196 "Alist of breakpoint numbers and full filenames. Only used for files that |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
197 Emacs can't find.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
198 (defvar gdb-active-process nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
199 "GUD tooltips display variable values when t, and macro definitions otherwise.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
200 (defvar gdb-error "Non-nil when GDB is reporting an error.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
201 (defvar gdb-macro-info nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
202 "Non-nil if GDB knows that the inferior includes preprocessor macro info.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
203 (defvar gdb-register-names nil "List of register names.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
204 (defvar gdb-changed-registers nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
205 "List of changed register numbers (strings).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
206 (defvar gdb-buffer-fringe-width nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
207 (defvar gdb-last-command nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
208 (defvar gdb-prompt-name nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
209 (defvar gdb-token-number 0) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
210 (defvar gdb-handler-alist '()) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
211 (defvar gdb-handler-number nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
212 (defvar gdb-source-file-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
213 "List of source files for the current executable.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
214 (defvar gdb-first-done-or-error t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
215 (defvar gdb-source-window nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
216 (defvar gdb-inferior-status nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
217 (defvar gdb-continuation nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
218 (defvar gdb-filter-output nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
219 "Message to be shown in GUD console. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
220 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
221 This variable is updated in `gdb-done-or-error' and returned by |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
222 `gud-gdbmi-marker-filter'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
223 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
224 (defvar gdb-non-stop nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
225 "Indicates whether current GDB session is using non-stop mode. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
226 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
227 It is initialized to `gdb-non-stop-setting' at the beginning of |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
228 every GDB session.") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
229 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
230 (defvar gdb-buffer-type nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
231 "One of the symbols bound in `gdb-buffer-rules'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
232 (make-variable-buffer-local 'gdb-buffer-type) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
233 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
234 (defvar gdb-output-sink 'nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
235 "The disposition of the output of the current gdb command. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
236 Possible values are these symbols: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
237 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
238 `user' -- gdb output should be copied to the GUD buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
239 for the user to see. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
240 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
241 `emacs' -- output should be collected in the partial-output-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
242 for subsequent processing by a command. This is the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
243 disposition of output generated by commands that |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
244 gdb mode sends to gdb on its own behalf.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
245 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
246 ;; Pending triggers prevent congestion: Emacs won't send two similar |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
247 ;; consecutive requests. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
248 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
249 (defvar gdb-pending-triggers '() |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
250 "A list of trigger functions which have not yet been handled. |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
251 |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
252 Elements are either function names or pairs (buffer . function)") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
253 |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
254 (defmacro gdb-add-pending (item) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
255 `(push ,item gdb-pending-triggers)) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
256 (defmacro gdb-pending-p (item) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
257 `(member ,item gdb-pending-triggers)) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
258 (defmacro gdb-delete-pending (item) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
259 `(setq gdb-pending-triggers |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
260 (delete ,item gdb-pending-triggers))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
261 |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
262 (defmacro gdb-wait-for-pending (&rest body) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
263 "Wait until `gdb-pending-triggers' is empty and evaluate FORM. |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
264 |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
265 This function checks `gdb-pending-triggers' value every |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
266 `gdb-wait-for-pending' seconds." |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
267 (run-with-timer |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
268 0.5 nil |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
269 `(lambda () |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
270 (if (not gdb-pending-triggers) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
271 (progn ,@body) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
272 (gdb-wait-for-pending ,@body))))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
273 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
274 ;; Publish-subscribe |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
275 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
276 (defmacro gdb-add-subscriber (publisher subscriber) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
277 "Register new PUBLISHER's SUBSCRIBER. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
278 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
279 SUBSCRIBER must be a pair, where cdr is a function of one |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
280 argument (see `gdb-emit-signal')." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
281 `(add-to-list ',publisher ,subscriber t)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
282 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
283 (defmacro gdb-delete-subscriber (publisher subscriber) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
284 "Unregister SUBSCRIBER from PUBLISHER." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
285 `(setq ,publisher (delete ,subscriber |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
286 ,publisher))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
287 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
288 (defun gdb-get-subscribers (publisher) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
289 publisher) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
290 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
291 (defun gdb-emit-signal (publisher &optional signal) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
292 "Call cdr for each subscriber of PUBLISHER with SIGNAL as argument." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
293 (dolist (subscriber (gdb-get-subscribers publisher)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
294 (funcall (cdr subscriber) signal))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
295 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
296 (defvar gdb-buf-publisher '() |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
297 "Used to invalidate GDB buffers by emitting a signal in |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
298 `gdb-update'. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
299 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
300 Must be a list of pairs with cars being buffers and cdr's being |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
301 valid signal handlers.") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
302 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
303 (defgroup gdb nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
304 "GDB graphical interface" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
305 :group 'tools |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
306 :link '(info-link "(emacs)GDB Graphical Interface") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
307 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
308 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
309 (defgroup gdb-non-stop nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
310 "GDB non-stop debugging settings" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
311 :group 'gdb |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
312 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
313 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
314 (defgroup gdb-buffers nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
315 "GDB buffers" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
316 :group 'gdb |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
317 :version "23.2") |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
318 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
319 (defcustom gdb-debug-log-max 128 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
320 "Maximum size of `gdb-debug-log'. If nil, size is unlimited." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
321 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
322 :type '(choice (integer :tag "Number of elements") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
323 (const :tag "Unlimited" nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
324 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
325 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
326 (defcustom gdb-non-stop-setting t |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
327 "When in non-stop mode, stopped threads can be examined while |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
328 other threads continue to execute. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
329 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
330 GDB session needs to be restarted for this setting to take |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
331 effect." |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
332 :type 'boolean |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
333 :group 'gdb-non-stop |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
334 :version "23.2") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
335 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
336 ;; TODO Some commands can't be called with --all (give a notice about |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
337 ;; it in setting doc) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
338 (defcustom gdb-gud-control-all-threads t |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
339 "When enabled, GUD execution commands affect all threads when |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
340 in non-stop mode. Otherwise, only current thread is affected." |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
341 :type 'boolean |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
342 :group 'gdb-non-stop |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
343 :version "23.2") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
344 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
345 (defcustom gdb-switch-reasons t |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
346 "List of stop reasons which cause Emacs to switch to the thread |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
347 which caused the stop. When t, switch to stopped thread no matter |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
348 what the reason was. When nil, never switch to stopped thread |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
349 automatically. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
350 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
351 This setting is used in non-stop mode only. In all-stop mode, |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
352 Emacs always switches to the thread which caused the stop." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
353 ;; exited, exited-normally and exited-signalled are not |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
354 ;; thread-specific stop reasons and therefore are not included in |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
355 ;; this list |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
356 :type '(choice |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
357 (const :tag "All reasons" t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
358 (set :tag "Selection of reasons..." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
359 (const :tag "A breakpoint was reached." "breakpoint-hit") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
360 (const :tag "A watchpoint was triggered." "watchpoint-trigger") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
361 (const :tag "A read watchpoint was triggered." "read-watchpoint-trigger") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
362 (const :tag "An access watchpoint was triggered." "access-watchpoint-trigger") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
363 (const :tag "Function finished execution." "function-finished") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
364 (const :tag "Location reached." "location-reached") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
365 (const :tag "Watchpoint has gone out of scope" "watchpoint-scope") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
366 (const :tag "End of stepping range reached." "end-stepping-range") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
367 (const :tag "Signal received (like interruption)." "signal-received")) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
368 (const :tag "None" nil)) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
369 :group 'gdb-non-stop |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
370 :version "23.2" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
371 :link '(info-link "(gdb)GDB/MI Async Records")) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
372 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
373 (defcustom gdb-stopped-hooks nil |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
374 "This variable holds a list of functions to be called whenever |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
375 GDB stops. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
376 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
377 Each function takes one argument, a parsed MI response, which |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
378 contains fields of corresponding MI *stopped async record: |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
379 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
380 ((stopped-threads . \"all\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
381 (thread-id . \"1\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
382 (frame (line . \"38\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
383 (fullname . \"/home/sphinx/projects/gsoc/server.c\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
384 (file . \"server.c\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
385 (args ((value . \"0x804b038\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
386 (name . \"arg\"))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
387 (func . \"hello\") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
388 (addr . \"0x0804869e\")) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
389 (reason . \"end-stepping-range\")) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
390 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
391 Note that \"reason\" is only present in non-stop debugging mode. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
392 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
393 `gdb-get-field' may be used to access the fields of response. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
394 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
395 Each function is called after the new current thread was selected |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
396 and GDB buffers were updated in `gdb-stopped'." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
397 :type '(repeat function) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
398 :group 'gdb |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
399 :version "23.2" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
400 :link '(info-link "(gdb)GDB/MI Async Records")) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
401 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
402 (defcustom gdb-switch-when-another-stopped t |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
403 "When nil, Emacs won't switch to stopped thread if some other |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
404 stopped thread is already selected." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
405 :type 'boolean |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
406 :group 'gdb-non-stop |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
407 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
408 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
409 (defcustom gdb-stack-buffer-locations t |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
410 "Show file information or library names in stack buffers." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
411 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
412 :group 'gdb-buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
413 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
414 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
415 (defcustom gdb-stack-buffer-addresses nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
416 "Show frame addresses in stack buffers." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
417 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
418 :group 'gdb-buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
419 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
420 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
421 (defcustom gdb-thread-buffer-verbose-names t |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
422 "Show long thread names in threads buffer." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
423 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
424 :group 'gdb-buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
425 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
426 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
427 (defcustom gdb-thread-buffer-arguments t |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
428 "Show function arguments in threads buffer." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
429 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
430 :group 'gdb-buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
431 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
432 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
433 (defcustom gdb-thread-buffer-locations t |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
434 "Show file information or library names in threads buffer." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
435 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
436 :group 'gdb-buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
437 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
438 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
439 (defcustom gdb-thread-buffer-addresses nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
440 "Show addresses for thread frames in threads buffer." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
441 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
442 :group 'gdb-buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
443 :version "23.2") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
444 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
445 (defcustom gdb-show-threads-by-default nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
446 "Show threads list buffer instead of breakpoints list by |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
447 default." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
448 :type 'boolean |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
449 :group 'gdb-buffers |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
450 :version "23.2") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
451 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
452 (defvar gdb-debug-log nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
453 "List of commands sent to and replies received from GDB. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
454 Most recent commands are listed first. This list stores only the last |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
455 `gdb-debug-log-max' values. This variable is used to debug GDB-MI.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
456 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
457 ;;;###autoload |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
458 (defcustom gdb-enable-debug nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
459 "Non-nil means record the process input and output in `gdb-debug-log'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
460 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
461 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
462 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
463 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
464 (defcustom gdb-cpp-define-alist-program "gcc -E -dM -" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
465 "Shell command for generating a list of defined macros in a source file. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
466 This list is used to display the #define directive associated |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
467 with an identifier as a tooltip. It works in a debug session with |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
468 GDB, when `gud-tooltip-mode' is t. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
469 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
470 Set `gdb-cpp-define-alist-flags' for any include paths or |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
471 predefined macros." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
472 :type 'string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
473 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
474 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
475 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
476 (defcustom gdb-cpp-define-alist-flags "" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
477 "Preprocessor flags for `gdb-cpp-define-alist-program'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
478 :type 'string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
479 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
480 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
481 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
482 (defcustom gdb-create-source-file-list t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
483 "Non-nil means create a list of files from which the executable was built. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
484 Set this to nil if the GUD buffer displays \"initializing...\" in the mode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
485 line for a long time when starting, possibly because your executable was |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
486 built from a large number of files. This allows quicker initialization |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
487 but means that these files are not automatically enabled for debugging, |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
488 e.g., you won't be able to click in the fringe to set a breakpoint until |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
489 execution has already stopped there." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
490 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
491 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
492 :version "23.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
493 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
494 (defcustom gdb-show-main nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
495 "Non-nil means display source file containing the main routine at startup. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
496 Also display the main routine in the disassembly buffer if present." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
497 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
498 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
499 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
500 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
501 ; Note: This mode requires a separate buffer for inferior IO. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
502 (defconst gdb-use-separate-io-buffer t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
503 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
504 (defun gdb-force-mode-line-update (status) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
505 (let ((buffer gud-comint-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
506 (if (and buffer (buffer-name buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
507 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
508 (setq mode-line-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
509 (format ":%s [%s]" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
510 (process-status (get-buffer-process buffer)) status)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
511 ;; Force mode line redisplay soon. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
512 (force-mode-line-update))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
513 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
514 (defun gdb-enable-debug (arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
515 "Toggle logging of transaction between Emacs and Gdb. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
516 The log is stored in `gdb-debug-log' as an alist with elements |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
517 whose cons is send, send-item or recv and whose cdr is the string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
518 being transferred. This list may grow up to a size of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
519 `gdb-debug-log-max' after which the oldest element (at the end of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
520 the list) is deleted every time a new one is added (at the front)." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
521 (interactive "P") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
522 (setq gdb-enable-debug |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
523 (if (null arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
524 (not gdb-enable-debug) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
525 (> (prefix-numeric-value arg) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
526 (message (format "Logging of transaction %sabled" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
527 (if gdb-enable-debug "en" "dis")))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
528 |
104211
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
529 ;; These two are used for menu and toolbar |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
530 (defun gdb-control-all-threads () |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
531 "Switch to non-stop/A mode." |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
532 (interactive) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
533 (setq gdb-gud-control-all-threads t) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
534 (message "Now in non-stop/A mode.")) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
535 |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
536 (defun gdb-control-current-thread () |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
537 "Switch to non-stop/T mode." |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
538 (interactive) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
539 (setq gdb-gud-control-all-threads nil) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
540 (message "Now in non-stop/T mode.")) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
541 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
542 (defun gdb-find-watch-expression () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
543 (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
544 (varnum (car var)) expr array) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
545 (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
546 (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
547 (component-list (split-string (match-string 2 varnum) "\\." t))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
548 (setq expr (nth 1 var1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
549 (setq varnumlet (car var1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
550 (dolist (component component-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
551 (setq var2 (assoc varnumlet gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
552 (setq expr (concat expr |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
553 (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
554 (concat "[" component "]") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
555 (concat "." component)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
556 (setq varnumlet (concat varnumlet "." component))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
557 expr))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
558 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
559 ;; noall is used for commands which don't take --all, but only |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
560 ;; --thread. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
561 (defun gdb-gud-context-command (command &optional noall) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
562 "When `gdb-non-stop' is t, add --thread option to COMMAND if |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
563 `gdb-gud-control-all-threads' is nil and --all option otherwise. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
564 If NOALL is t, always add --thread option no matter what |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
565 `gdb-gud-control-all-threads' value is. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
566 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
567 When `gdb-non-stop' is nil, return COMMAND unchanged." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
568 (if gdb-non-stop |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
569 (if (and gdb-gud-control-all-threads |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
570 (not noall)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
571 (concat command " --all ") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
572 (gdb-current-context-command command t)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
573 command)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
574 |
104232
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
575 (defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg) |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
576 "`gud-call' wrapper which adds --thread/--all options between |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
577 CMD1 and CMD2. NOALL is the same as in `gdb-gud-context-command'. |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
578 |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
579 NOARG must be t when this macro is used outside `gud-def'" |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
580 `(gud-call |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
581 (concat |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
582 (gdb-gud-context-command ,cmd1 ,noall) |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
583 ,cmd2) ,(when (not noarg) 'arg))) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
584 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
585 ;;;###autoload |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
586 (defun gdb (command-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
587 "Run gdb on program FILE in buffer *gud-FILE*. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
588 The directory containing FILE becomes the initial working directory |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
589 and source-file directory for your debugger. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
590 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
591 If `gdb-many-windows' is nil (the default value) then gdb just |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
592 pops up the GUD buffer unless `gdb-show-main' is t. In this case |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
593 it starts with two windows: one displaying the GUD buffer and the |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
594 other with the source file with the main routine of the inferior. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
595 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
596 If `gdb-many-windows' is t, regardless of the value of |
103779
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
597 `gdb-show-main', the layout below will appear. Keybindings are |
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
598 shown in some of the buffers. |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
599 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
600 Watch expressions appear in the speedbar/slowbar. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
601 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
602 The following commands help control operation : |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
603 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
604 `gdb-many-windows' - Toggle the number of windows gdb uses. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
605 `gdb-restore-windows' - To restore the window layout. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
606 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
607 See Info node `(emacs)GDB Graphical Interface' for a more |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
608 detailed description of this mode. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
609 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
610 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
611 +----------------------------------------------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
612 | GDB Toolbar | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
613 +-----------------------------------+----------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
614 | GUD buffer (I/O of GDB) | Locals buffer | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
615 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
616 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
617 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
618 +-----------------------------------+----------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
619 | Source buffer | I/O buffer (of debugged program) | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
620 | | (comint-mode) | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
621 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
622 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
623 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
624 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
625 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
626 | | | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
627 +-----------------------------------+----------------------------------+ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
628 | Stack buffer | Breakpoints buffer | |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
629 | RET gdb-select-frame | SPC gdb-toggle-breakpoint | |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
630 | | RET gdb-goto-breakpoint | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
631 | | D gdb-delete-breakpoint | |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
632 +-----------------------------------+----------------------------------+" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
633 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
634 (interactive (list (gud-query-cmdline 'gdb))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
635 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
636 (when (and gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
637 (buffer-name gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
638 (get-buffer-process gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
639 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
640 (gdb-restore-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
641 (error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
642 "Multiple debugging requires restarting in text command mode")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
643 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
644 (gud-common-init command-line nil 'gud-gdbmi-marker-filter) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
645 (set (make-local-variable 'gud-minor-mode) 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
646 (setq comint-input-sender 'gdb-send) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
647 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
648 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
649 "Set temporary breakpoint at current line.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
650 (gud-def gud-jump |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
651 (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
652 "\C-j" "Set execution address to current line.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
653 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
654 (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
655 (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
656 (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
657 (gud-def gud-pstar "print* %e" nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
658 "Evaluate C dereferenced pointer expression at point.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
659 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
660 (gud-def gud-step (gdb-gud-context-call "-exec-step" "%p" t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
661 "\C-s" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
662 "Step one source line with display.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
663 (gud-def gud-stepi (gdb-gud-context-call "-exec-step-instruction" "%p" t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
664 "\C-i" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
665 "Step one instruction with display.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
666 (gud-def gud-next (gdb-gud-context-call "-exec-next" "%p" t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
667 "\C-n" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
668 "Step one line (skip functions).") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
669 (gud-def gud-nexti (gdb-gud-context-call "-exec-next-instruction" "%p" t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
670 nil |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
671 "Step one instruction (skip functions).") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
672 (gud-def gud-cont (gdb-gud-context-call "-exec-continue") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
673 "\C-r" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
674 "Continue with display.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
675 (gud-def gud-finish (gdb-gud-context-call "-exec-finish" nil t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
676 "\C-f" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
677 "Finish executing current function.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
678 (gud-def gud-run "-exec-run" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
679 nil |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
680 "Run the program.") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
681 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
682 (gud-def gud-break (if (not (string-match "Disassembly" mode-name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
683 (gud-call "break %f:%l" arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
684 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
685 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
686 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
687 (gud-call "break *%a" arg))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
688 "\C-b" "Set breakpoint at current line or address.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
689 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
690 (gud-def gud-remove (if (not (string-match "Disassembly" mode-name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
691 (gud-call "clear %f:%l" arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
692 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
693 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
694 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
695 (gud-call "clear *%a" arg))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
696 "\C-d" "Remove breakpoint at current line or address.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
697 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
698 ;; -exec-until doesn't support --all yet |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
699 (gud-def gud-until (if (not (string-match "Disassembly" mode-name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
700 (gud-call "-exec-until %f:%l" arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
701 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
702 (beginning-of-line) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
703 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
704 (gud-call "-exec-until *%a" arg))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
705 "\C-u" "Continue to current line or address.") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
706 ;; TODO Why arg here? |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
707 (gud-def |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
708 gud-go (gud-call (if gdb-active-process |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
709 (gdb-gud-context-command "-exec-continue") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
710 "-exec-run") arg) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
711 nil "Start or continue execution.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
712 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
713 ;; For debugging Emacs only. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
714 (gud-def gud-pp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
715 (gud-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
716 (concat |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
717 "pp1 " (if (eq (buffer-local-value |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
718 'major-mode (window-buffer)) 'speedbar-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
719 (gdb-find-watch-expression) "%e")) arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
720 nil "Print the Emacs s-expression.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
721 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
722 (define-key gud-minor-mode-map [left-margin mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
723 'gdb-mouse-set-clear-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
724 (define-key gud-minor-mode-map [left-fringe mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
725 'gdb-mouse-set-clear-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
726 (define-key gud-minor-mode-map [left-margin C-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
727 'gdb-mouse-toggle-breakpoint-margin) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
728 (define-key gud-minor-mode-map [left-fringe C-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
729 'gdb-mouse-toggle-breakpoint-fringe) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
730 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
731 (define-key gud-minor-mode-map [left-margin drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
732 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
733 (define-key gud-minor-mode-map [left-fringe drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
734 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
735 (define-key gud-minor-mode-map [left-margin mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
736 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
737 (define-key gud-minor-mode-map [left-fringe mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
738 'gdb-mouse-until) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
739 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
740 (define-key gud-minor-mode-map [left-margin C-drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
741 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
742 (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
743 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
744 (define-key gud-minor-mode-map [left-fringe C-mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
745 'gdb-mouse-jump) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
746 (define-key gud-minor-mode-map [left-margin C-mouse-3] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
747 'gdb-mouse-jump) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
748 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
749 (local-set-key "\C-i" 'gud-gdb-complete-command) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
750 (setq gdb-first-prompt t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
751 (setq gud-running nil) |
104234
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
752 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
753 (gdb-update) |
104234
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
754 |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
755 (add-hook |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
756 'kill-buffer-hook |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
757 (function |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
758 (lambda () |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
759 (gdb-input (list "-target-detach" 'ignore)))) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
760 nil t) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
761 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
762 (run-hooks 'gdb-mode-hook)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
763 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
764 (defun gdb-init-1 () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
765 ;; (re-)initialise |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
766 (setq gdb-selected-frame nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
767 gdb-frame-number nil |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
768 gdb-thread-number nil |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
769 gdb-var-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
770 gdb-pending-triggers nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
771 gdb-output-sink 'user |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
772 gdb-location-alist nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
773 gdb-source-file-list nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
774 gdb-last-command nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
775 gdb-token-number 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
776 gdb-handler-alist '() |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
777 gdb-handler-number nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
778 gdb-prompt-name nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
779 gdb-first-done-or-error t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
780 gdb-buffer-fringe-width (car (window-fringes)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
781 gdb-debug-log nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
782 gdb-source-window nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
783 gdb-inferior-status nil |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
784 gdb-continuation nil |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
785 gdb-buf-publisher '() |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
786 gdb-threads-list '() |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
787 gdb-breakpoints-list '() |
104234
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
788 gdb-register-names '() |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
789 gdb-non-stop gdb-non-stop-setting) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
790 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
791 (setq gdb-buffer-type 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
792 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
793 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
794 (propertize "initializing..." 'face font-lock-variable-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
795 (when gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
796 (gdb-get-buffer-create 'gdb-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
797 (gdb-clear-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
798 (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
799 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
800 ;; Needs GDB 6.4 onwards |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
801 (list (concat "-inferior-tty-set " |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
802 (process-tty-name (get-process "gdb-inferior"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
803 'ignore))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
804 (if (eq window-system 'w32) |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
805 (gdb-input (list "-gdb-set new-console off" 'ignore))) |
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
806 (gdb-input (list "-gdb-set height 0" 'ignore)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
807 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
808 (when gdb-non-stop |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
809 (gdb-input (list "-gdb-set non-stop 1" 'ignore)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
810 (gdb-input (list "-gdb-set target-async 1" 'ignore))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
811 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
812 ;; find source file and compilation directory here |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
813 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
814 ; Needs GDB 6.2 onwards. |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
815 (list "-file-list-exec-source-files" 'gdb-get-source-file-list)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
816 (if gdb-create-source-file-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
817 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
818 ; Needs GDB 6.0 onwards. |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
819 (list "-file-list-exec-source-file" 'gdb-get-source-file))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
820 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
821 (list "-gdb-show prompt" 'gdb-get-prompt))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
822 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
823 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
824 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
825 (defun gdb-create-define-alist () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
826 "Create an alist of #define directives for GUD tooltips." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
827 (let* ((file (buffer-file-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
828 (output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
829 (with-output-to-string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
830 (with-current-buffer standard-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
831 (and file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
832 (file-exists-p file) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
833 ;; call-process doesn't work with remote file names. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
834 (not (file-remote-p default-directory)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
835 (call-process shell-file-name file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
836 (list t nil) nil "-c" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
837 (concat gdb-cpp-define-alist-program " " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
838 gdb-cpp-define-alist-flags)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
839 (define-list (split-string output "\n" t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
840 (name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
841 (setq gdb-define-alist nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
842 (dolist (define define-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
843 (setq name (nth 1 (split-string define "[( ]"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
844 (push (cons name define) gdb-define-alist)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
845 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
846 (declare-function tooltip-show "tooltip" (text &optional use-echo-area)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
847 (defvar tooltip-use-echo-area) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
848 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
849 (defun gdb-tooltip-print (expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
850 (tooltip-show |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
851 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
852 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
853 (let ((string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
854 (if (search-forward "=" nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
855 (concat expr (buffer-substring (- (point) 2) (point-max))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
856 (buffer-string)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
857 ;; remove newline for gud-tooltip-echo-area |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
858 (substring string 0 (- (length string) 1)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
859 (or gud-tooltip-echo-area tooltip-use-echo-area |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
860 (not (display-graphic-p))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
861 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
862 ;; If expr is a macro for a function don't print because of possible dangerous |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
863 ;; side-effects. Also printing a function within a tooltip generates an |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
864 ;; unexpected starting annotation (phase error). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
865 (defun gdb-tooltip-print-1 (expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
866 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
867 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
868 (if (search-forward "expands to: " nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
869 (unless (looking-at "\\S-+.*(.*).*") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
870 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
871 (list (concat "print " expr) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
872 `(lambda () (gdb-tooltip-print ,expr)))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
873 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
874 (defun gdb-init-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
875 (set (make-local-variable 'gud-minor-mode) 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
876 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
877 (when gud-tooltip-mode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
878 (make-local-variable 'gdb-define-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
879 (gdb-create-define-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
880 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
881 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
882 (defmacro gdb-if-arrow (arrow-position &rest body) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
883 `(if ,arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
884 (let ((buffer (marker-buffer ,arrow-position)) (line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
885 (if (equal buffer (window-buffer (posn-window end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
886 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
887 (when (or (equal start end) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
888 (equal (posn-point start) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
889 (marker-position ,arrow-position))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
890 ,@body)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
891 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
892 (defun gdb-mouse-until (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
893 "Continue running until a source line past the current line. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
894 The destination source line can be selected either by clicking |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
895 with mouse-3 on the fringe/margin or dragging the arrow |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
896 with mouse-1 (default bindings)." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
897 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
898 (let ((start (event-start event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
899 (end (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
900 (gdb-if-arrow gud-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
901 (setq line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
902 (gud-call (concat "until " (number-to-string line)))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
903 (gdb-if-arrow gdb-disassembly-position |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
904 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
905 (goto-line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
906 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
907 (gud-call (concat "until *%a")))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
908 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
909 (defun gdb-mouse-jump (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
910 "Set execution address/line. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
911 The destination source line can be selected either by clicking with C-mouse-3 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
912 on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
913 Unlike `gdb-mouse-until' the destination address can be before the current |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
914 line, and no execution takes place." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
915 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
916 (let ((start (event-start event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
917 (end (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
918 (gdb-if-arrow gud-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
919 (setq line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
920 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
921 (gud-call (concat "tbreak " (number-to-string line))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
922 (gud-call (concat "jump " (number-to-string line))))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
923 (gdb-if-arrow gdb-disassembly-position |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
924 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
925 (goto-line (line-number-at-pos (posn-point end))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
926 (forward-char 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
927 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
928 (gud-call (concat "tbreak *%a")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
929 (gud-call (concat "jump *%a"))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
930 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
931 (defcustom gdb-show-changed-values t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
932 "If non-nil change the face of out of scope variables and changed values. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
933 Out of scope variables are suppressed with `shadow' face. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
934 Changed values are highlighted with the face `font-lock-warning-face'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
935 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
936 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
937 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
938 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
939 (defcustom gdb-max-children 40 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
940 "Maximum number of children before expansion requires confirmation." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
941 :type 'integer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
942 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
943 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
944 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
945 (defcustom gdb-delete-out-of-scope t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
946 "If non-nil delete watch expressions automatically when they go out of scope." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
947 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
948 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
949 :version "22.2") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
950 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
951 (defcustom gdb-speedbar-auto-raise nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
952 "If non-nil raise speedbar every time display of watch expressions is\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
953 updated." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
954 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
955 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
956 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
957 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
958 (defcustom gdb-use-colon-colon-notation nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
959 "If non-nil use FUN::VAR format to display variables in the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
960 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
961 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
962 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
963 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
964 (defun gdb-speedbar-auto-raise (arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
965 "Toggle automatic raising of the speedbar for watch expressions. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
966 With prefix argument ARG, automatically raise speedbar if ARG is |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
967 positive, otherwise don't automatically raise it." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
968 (interactive "P") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
969 (setq gdb-speedbar-auto-raise |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
970 (if (null arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
971 (not gdb-speedbar-auto-raise) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
972 (> (prefix-numeric-value arg) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
973 (message (format "Auto raising %sabled" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
974 (if gdb-speedbar-auto-raise "en" "dis")))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
975 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
976 (define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
977 (define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
978 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
979 (declare-function tooltip-identifier-from-point "tooltip" (point)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
980 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
981 (defun gud-watch (&optional arg event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
982 "Watch expression at point. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
983 With arg, enter name of variable to be watched in the minibuffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
984 (interactive (list current-prefix-arg last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
985 (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
986 (if (eq minor-mode 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
987 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
988 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
989 (require 'tooltip) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
990 (save-selected-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
991 (let ((expr |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
992 (if arg |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
993 (completing-read "Name of variable: " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
994 'gud-gdb-complete-command) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
995 (if (and transient-mark-mode mark-active) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
996 (buffer-substring (region-beginning) (region-end)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
997 (concat (if (eq major-mode 'gdb-registers-mode) "$") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
998 (tooltip-identifier-from-point (point))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
999 (set-text-properties 0 (length expr) nil expr) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1000 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1001 (list (concat"-var-create - * " expr "") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1002 `(lambda () (gdb-var-create-handler ,expr))))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1003 (message "gud-watch is a no-op in this mode.")))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1004 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1005 (defun gdb-var-create-handler (expr) |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1006 (let* ((result (gdb-json-partial-output))) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1007 (if (not (gdb-get-field result 'msg)) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1008 (let |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1009 ((var |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1010 (list |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1011 (gdb-get-field result 'name) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1012 (if (and (string-equal gdb-current-language "c") |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1013 gdb-use-colon-colon-notation gdb-selected-frame) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1014 (setq expr (concat gdb-selected-frame "::" expr)) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1015 expr) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1016 (gdb-get-field result 'numchild) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1017 (gdb-get-field result 'type) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1018 (gdb-get-field result 'value) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1019 nil))) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1020 (push var gdb-var-list) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1021 (speedbar 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1022 (unless (string-equal |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1023 speedbar-initial-expansion-list-name "GUD") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1024 (speedbar-change-initial-expansion-list "GUD")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1025 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1026 (list |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1027 (concat "-var-evaluate-expression " (car var)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1028 `(lambda () (gdb-var-evaluate-expression-handler |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1029 ,(car var) nil))))) |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
1030 (message-box "No symbol \"%s\" in current context." expr)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1031 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1032 (defun gdb-speedbar-update () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1033 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1034 (not (gdb-pending-p 'gdb-speedbar-timer))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1035 ;; Dummy command to update speedbar even when idle. |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1036 (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1037 ;; Keep gdb-pending-triggers non-nil till end. |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1038 (gdb-add-pending 'gdb-speedbar-timer))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1039 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1040 (defun gdb-speedbar-timer-fn () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1041 (if gdb-speedbar-auto-raise |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1042 (raise-frame speedbar-frame)) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1043 (gdb-delete-pending 'gdb-speedbar-timer) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1044 (speedbar-timer-fn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1045 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1046 (defun gdb-var-evaluate-expression-handler (varnum changed) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1047 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1048 (re-search-forward ".*value=\\(\".*\"\\)" nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1049 (let ((var (assoc varnum gdb-var-list))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1050 (when var |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1051 (if changed (setcar (nthcdr 5 var) 'changed)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1052 (setcar (nthcdr 4 var) (read (match-string 1))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1053 (gdb-speedbar-update)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1054 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1055 ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1056 (defun gdb-var-list-children (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1057 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1058 (list (concat "-var-update " varnum) 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1059 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1060 (list (concat "-var-list-children --all-values " |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1061 varnum) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1062 `(lambda () (gdb-var-list-children-handler ,varnum))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1063 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1064 (defconst gdb-var-list-children-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1065 "child={.*?name=\"\\(.+?\\)\".*?,exp=\"\\(.+?\\)\".*?,\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1066 numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1067 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1068 (defun gdb-var-list-children-handler (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1069 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1070 (let ((var-list nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1071 (catch 'child-already-watched |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1072 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1073 (if (string-equal varnum (car var)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1074 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1075 (push var var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1076 (while (re-search-forward gdb-var-list-children-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1077 (let ((varchild (list (match-string 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1078 (match-string 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1079 (match-string 3) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1080 (match-string 5) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1081 (read (match-string 4)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1082 nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1083 (if (assoc (car varchild) gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1084 (throw 'child-already-watched nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1085 (push varchild var-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1086 (push var var-list))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1087 (setq gdb-var-list (nreverse var-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1088 (gdb-speedbar-update)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1089 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1090 (defun gdb-var-set-format (format) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1091 "Set the output format for a variable displayed in the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1092 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1093 (varnum (car var))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1094 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1095 (list (concat "-var-set-format " varnum " " format) 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1096 (gdb-var-update))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1097 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1098 (defun gdb-var-delete-1 (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1099 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1100 (list (concat "-var-delete " varnum) 'ignore)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1101 (setq gdb-var-list (delq var gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1102 (dolist (varchild gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1103 (if (string-match (concat (car var) "\\.") (car varchild)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1104 (setq gdb-var-list (delq varchild gdb-var-list))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1105 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1106 (defun gdb-var-delete () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1107 "Delete watch expression at point from the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1108 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1109 (let ((text (speedbar-line-text))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1110 (string-match "\\(\\S-+\\)" text) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1111 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1112 (varnum (car var))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1113 (if (string-match "\\." (car var)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1114 (message-box "Can only delete a root expression") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1115 (gdb-var-delete-1 varnum))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1116 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1117 (defun gdb-var-delete-children (varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1118 "Delete children of variable object at point from the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1119 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1120 (list (concat "-var-delete -c " varnum) 'ignore))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1121 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1122 (defun gdb-edit-value (text token indent) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1123 "Assign a value to a variable displayed in the speedbar." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1124 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1125 (varnum (car var)) (value)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1126 (setq value (read-string "New value: ")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1127 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1128 (list (concat "-var-assign " varnum " " value) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1129 `(lambda () (gdb-edit-value-handler ,value)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1130 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1131 (defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1132 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1133 (defun gdb-edit-value-handler (value) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1134 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1135 (if (re-search-forward gdb-error-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1136 (message-box "Invalid number or expression (%s)" value))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1137 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1138 ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1139 (defun gdb-var-update () |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1140 (if (not (gdb-pending-p 'gdb-var-update)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1141 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1142 (list "-var-update --all-values *" 'gdb-var-update-handler))) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1143 (gdb-add-pending 'gdb-var-update)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1144 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1145 (defconst gdb-var-update-regexp |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1146 "{.*?name=\"\\(.*?\\)\".*?,\\(?:value=\\(\".*?\"\\),\\)?.*?\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1147 in_scope=\"\\(.*?\\)\".*?}") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1148 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1149 (defun gdb-var-update-handler () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1150 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1151 (setcar (nthcdr 5 var) nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1152 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1153 (while (re-search-forward gdb-var-update-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1154 (let* ((varnum (match-string 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1155 (var (assoc varnum gdb-var-list))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1156 (when var |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1157 (let ((match (match-string 3))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1158 (cond ((string-equal match "false") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1159 (if gdb-delete-out-of-scope |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1160 (gdb-var-delete-1 varnum) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1161 (setcar (nthcdr 5 var) 'out-of-scope))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1162 ((string-equal match "true") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1163 (setcar (nthcdr 5 var) 'changed) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1164 (setcar (nthcdr 4 var) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1165 (read (match-string 2)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1166 ((string-equal match "invalid") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1167 (gdb-var-delete-1 varnum))))))) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1168 (gdb-delete-pending 'gdb-var-update) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1169 (gdb-speedbar-update)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1170 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1171 (defun gdb-speedbar-expand-node (text token indent) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1172 "Expand the node the user clicked on. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1173 TEXT is the text of the button we clicked on, a + or - item. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1174 TOKEN is data related to this node. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1175 INDENT is the current indentation depth." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1176 (cond ((string-match "+" text) ;expand this node |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1177 (let* ((var (assoc token gdb-var-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1178 (expr (nth 1 var)) (children (nth 2 var))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1179 (if (or (<= (string-to-number children) gdb-max-children) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1180 (y-or-n-p |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1181 (format "%s has %s children. Continue? " expr children))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1182 (gdb-var-list-children token)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1183 ((string-match "-" text) ;contract this node |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1184 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1185 (if (string-match (concat token "\\.") (car var)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1186 (setq gdb-var-list (delq var gdb-var-list)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1187 (gdb-var-delete-children token) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1188 (speedbar-change-expand-button-char ?+) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1189 (speedbar-delete-subblock indent)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1190 (t (error "Ooops... not sure what to do"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1191 (speedbar-center-buffer-smartly)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1192 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1193 (defun gdb-get-target-string () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1194 (with-current-buffer gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1195 gud-target-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1196 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1197 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1198 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1199 ;; gdb buffers. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1200 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1201 ;; Each buffer has a TYPE -- a symbol that identifies the function |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1202 ;; of that particular buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1203 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1204 ;; The usual gdb interaction buffer is given the type `gdbmi' and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1205 ;; is constructed specially. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1206 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1207 ;; Others are constructed by gdb-get-buffer-create and |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1208 ;; named according to the rules set forth in the gdb-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1209 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1210 (defvar gdb-buffer-rules '()) |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1211 |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1212 (defun gdb-rules-name-maker (rules-entry) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1213 (cadr rules-entry)) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1214 (defun gdb-rules-buffer-mode (rules-entry) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1215 (nth 2 rules-entry)) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1216 (defun gdb-rules-update-trigger (rules-entry) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1217 (nth 3 rules-entry)) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1218 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1219 (defun gdb-update-buffer-name () |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1220 "Rename current buffer according to name-maker associated with |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1221 it in `gdb-buffer-rules'." |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1222 (let ((f (gdb-rules-name-maker (assoc gdb-buffer-type |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1223 gdb-buffer-rules)))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1224 (when f (rename-buffer (funcall f))))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1225 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1226 (defun gdb-current-buffer-rules () |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1227 "Get `gdb-buffer-rules' entry for current buffer type." |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1228 (assoc gdb-buffer-type gdb-buffer-rules)) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1229 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1230 (defun gdb-current-buffer-thread () |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1231 "Get thread object of current buffer from `gdb-threads-list'. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1232 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1233 When current buffer is not bound to any thread, return main |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1234 thread." |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1235 (cdr (assoc gdb-thread-number gdb-threads-list))) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1236 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1237 (defun gdb-current-buffer-frame () |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1238 "Get current stack frame object for thread of current buffer." |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1239 (gdb-get-field (gdb-current-buffer-thread) 'frame)) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1240 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1241 (defun gdb-buffer-type (buffer) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1242 "Get value of `gdb-buffer-type' for BUFFER." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1243 (with-current-buffer buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1244 gdb-buffer-type)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1245 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1246 (defun gdb-buffer-shows-main-thread-p () |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1247 "Return t if current GDB buffer shows main selected thread and |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1248 is not bound to it." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1249 (current-buffer) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1250 (not (local-variable-p 'gdb-thread-number))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1251 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1252 (defun gdb-get-buffer (buffer-type &optional thread) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1253 "Get a specific GDB buffer. |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1254 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1255 In that buffer, `gdb-buffer-type' must be equal to BUFFER-TYPE |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1256 and `gdb-thread-number' (if provided) must be equal to THREAD." |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1257 (catch 'found |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1258 (dolist (buffer (buffer-list) nil) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1259 (with-current-buffer buffer |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1260 (when (and (eq gdb-buffer-type buffer-type) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1261 (or (not thread) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1262 (equal gdb-thread-number thread))) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1263 (throw 'found buffer)))))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1264 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1265 (defun gdb-get-buffer-create (buffer-type &optional thread) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1266 "Create a new GDB buffer of the type specified by BUFFER-TYPE. |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1267 The buffer-type should be one of the cars in `gdb-buffer-rules'. |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1268 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1269 If THREAD is non-nil, it is assigned to `gdb-thread-number' |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1270 buffer-local variable of the new buffer. |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1271 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1272 Buffer mode and name are selected according to buffer type. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1273 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1274 If buffer has trigger associated with it in `gdb-buffer-rules', |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1275 this trigger is subscribed to `gdb-buf-publisher' and called with |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1276 'update argument." |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1277 (or (gdb-get-buffer buffer-type thread) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1278 (let ((rules (assoc buffer-type gdb-buffer-rules)) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1279 (new (generate-new-buffer "limbo"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1280 (with-current-buffer new |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1281 (let ((mode (gdb-rules-buffer-mode rules)) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1282 (trigger (gdb-rules-update-trigger rules))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1283 (when mode (funcall mode)) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1284 (setq gdb-buffer-type buffer-type) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1285 (when thread |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1286 (set (make-local-variable 'gdb-thread-number) thread)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1287 (set (make-local-variable 'gud-minor-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1288 (buffer-local-value 'gud-minor-mode gud-comint-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1289 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1290 (rename-buffer (funcall (gdb-rules-name-maker rules))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1291 (when trigger |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1292 (gdb-add-subscriber gdb-buf-publisher |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1293 (cons (current-buffer) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1294 (gdb-bind-function-to-buffer trigger (current-buffer)))) |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
1295 (funcall trigger 'start)) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1296 (current-buffer)))))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1297 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1298 (defun gdb-bind-function-to-buffer (expr buffer) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1299 "Return a function which will evaluate EXPR in BUFFER." |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1300 `(lambda (&rest args) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1301 (with-current-buffer ,buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1302 (apply ',expr args)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1303 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1304 ;; Used to define all gdb-frame-*-buffer functions except |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1305 ;; `gdb-frame-separate-io-buffer' |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1306 (defmacro def-gdb-frame-for-buffer (name buffer &optional doc) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1307 "Define a function NAME which shows gdb BUFFER in a separate frame. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1308 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1309 DOC is an optional documentation string." |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1310 `(defun ,name (&optional thread) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1311 ,(when doc doc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1312 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1313 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1314 (special-display-frame-alist gdb-frame-parameters)) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1315 (display-buffer (gdb-get-buffer-create ,buffer thread))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1316 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1317 (defmacro def-gdb-display-buffer (name buffer &optional doc) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1318 "Define a function NAME which shows gdb BUFFER. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1319 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1320 DOC is an optional documentation string." |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1321 `(defun ,name (&optional thread) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1322 ,(when doc doc) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1323 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1324 (gdb-display-buffer |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1325 (gdb-get-buffer-create ,buffer thread) t))) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1326 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1327 ;; Used to display windows with thread-bound buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1328 (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc split-horizontal) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1329 `(defun ,name (&optional thread) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1330 ,(when doc doc) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1331 (message thread) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1332 (gdb-preempt-existing-or-display-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1333 (gdb-get-buffer-create ,buffer thread) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1334 ,split-horizontal))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1335 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1336 ;; This assoc maps buffer type symbols to rules. Each rule is a list of |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1337 ;; at least one and possible more functions. The functions have these |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1338 ;; roles in defining a buffer type: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1339 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1340 ;; NAME - Return a name for this buffer type. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1341 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1342 ;; The remaining function(s) are optional: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1343 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1344 ;; MODE - called in a new buffer with no arguments, should establish |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1345 ;; the proper mode for the buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1346 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1347 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1348 (defun gdb-set-buffer-rules (buffer-type &rest rules) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1349 (let ((binding (assoc buffer-type gdb-buffer-rules))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1350 (if binding |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1351 (setcdr binding rules) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1352 (push (cons buffer-type rules) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1353 gdb-buffer-rules)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1354 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1355 (defun gdb-parent-mode () |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1356 "Generic mode to derive all other GDB buffer modes from." |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1357 (kill-all-local-variables) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1358 (setq buffer-read-only t) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1359 (buffer-disable-undo) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1360 ;; Delete buffer from gdb-buf-publisher when it's killed |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1361 ;; (if it has an associated update trigger) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1362 (add-hook |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1363 'kill-buffer-hook |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1364 (function |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1365 (lambda () |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1366 (let ((trigger (gdb-rules-update-trigger |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1367 (gdb-current-buffer-rules)))) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1368 (when trigger |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1369 (gdb-delete-subscriber |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1370 gdb-buf-publisher |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1371 ;; This should match gdb-add-subscriber done in |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1372 ;; gdb-get-buffer-create |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1373 (cons (current-buffer) |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1374 (gdb-bind-function-to-buffer trigger (current-buffer)))))))) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
1375 nil t)) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1376 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1377 ;; GUD buffers are an exception to the rules |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1378 (gdb-set-buffer-rules 'gdbmi 'error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1379 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1380 ;; Partial-output buffer : This accumulates output from a command executed on |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1381 ;; behalf of emacs (rather than the user). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1382 ;; |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1383 (gdb-set-buffer-rules 'gdb-partial-output-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1384 'gdb-partial-output-name) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1385 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1386 (defun gdb-partial-output-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1387 (concat " *partial-output-" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1388 (gdb-get-target-string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1389 "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1390 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1391 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1392 (gdb-set-buffer-rules 'gdb-inferior-io |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1393 'gdb-inferior-io-name |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1394 'gdb-inferior-io-mode) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1395 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1396 (defun gdb-inferior-io-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1397 (concat "*input/output of " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1398 (gdb-get-target-string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1399 "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1400 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1401 (defun gdb-display-separate-io-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1402 "Display IO of debugged program in a separate window." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1403 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1404 (if gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1405 (gdb-display-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1406 (gdb-get-buffer-create 'gdb-inferior-io) t))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1407 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1408 (defconst gdb-frame-parameters |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1409 '((height . 14) (width . 80) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1410 (unsplittable . t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1411 (tool-bar-lines . nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1412 (menu-bar-lines . nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1413 (minibuffer . nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1414 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1415 (defun gdb-frame-separate-io-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1416 "Display IO of debugged program in a new frame." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1417 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1418 (if gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1419 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1420 (special-display-frame-alist gdb-frame-parameters)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1421 (display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1422 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1423 (defvar gdb-inferior-io-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1424 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1425 (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1426 (define-key map "\C-c\C-z" 'gdb-separate-io-stop) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1427 (define-key map "\C-c\C-\\" 'gdb-separate-io-quit) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1428 (define-key map "\C-c\C-d" 'gdb-separate-io-eof) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1429 (define-key map "\C-d" 'gdb-separate-io-eof) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1430 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1431 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1432 (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1433 "Major mode for gdb inferior-io." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1434 :syntax-table nil :abbrev-table nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1435 ;; We want to use comint because it has various nifty and familiar |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1436 ;; features. We don't need a process, but comint wants one, so create |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1437 ;; a dummy one. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1438 (make-comint-in-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1439 "gdb-inferior" (current-buffer) "sleep" nil "1000000000")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1440 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1441 (defun gdb-inferior-filter (proc string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1442 (unless (string-equal string "") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1443 (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1444 (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1445 (insert-before-markers string))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1446 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1447 (defun gdb-separate-io-interrupt () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1448 "Interrupt the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1449 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1450 (interrupt-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1451 (get-buffer-process gud-comint-buffer) comint-ptyp)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1452 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1453 (defun gdb-separate-io-quit () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1454 "Send quit signal to the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1455 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1456 (quit-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1457 (get-buffer-process gud-comint-buffer) comint-ptyp)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1458 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1459 (defun gdb-separate-io-stop () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1460 "Stop the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1461 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1462 (stop-process |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1463 (get-buffer-process gud-comint-buffer) comint-ptyp)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1464 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1465 (defun gdb-separate-io-eof () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1466 "Send end-of-file to the program being debugged." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1467 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1468 (process-send-eof |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1469 (get-buffer-process gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1470 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1471 (defun gdb-clear-inferior-io () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1472 (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1473 (erase-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1474 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1475 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1476 (defconst breakpoint-xpm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1477 "/* XPM */ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1478 static char *magick[] = { |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1479 /* columns rows colors chars-per-pixel */ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1480 \"10 10 2 1\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1481 \" c red\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1482 \"+ c None\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1483 /* pixels */ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1484 \"+++ +++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1485 \"++ ++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1486 \"+ +\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1487 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1488 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1489 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1490 \" \", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1491 \"+ +\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1492 \"++ ++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1493 \"+++ +++\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1494 };" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1495 "XPM data used for breakpoint icon.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1496 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1497 (defconst breakpoint-enabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1498 "P1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1499 10 10\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1500 0 0 0 0 1 1 1 1 0 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1501 0 0 0 1 1 1 1 1 1 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1502 0 0 1 1 1 1 1 1 1 1 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1503 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1504 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1505 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1506 0 1 1 1 1 1 1 1 1 1 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1507 0 0 1 1 1 1 1 1 1 1 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1508 0 0 0 1 1 1 1 1 1 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1509 0 0 0 0 1 1 1 1 0 0 0 0" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1510 "PBM data used for enabled breakpoint icon.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1511 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1512 (defconst breakpoint-disabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1513 "P1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1514 10 10\", |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1515 0 0 1 0 1 0 1 0 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1516 0 1 0 1 0 1 0 1 0 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1517 1 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1518 0 1 0 1 0 1 0 1 0 1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1519 1 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1520 0 1 0 1 0 1 0 1 0 1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1521 1 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1522 0 1 0 1 0 1 0 1 0 1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1523 0 0 1 0 1 0 1 0 1 0 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1524 0 0 0 1 0 1 0 1 0 0" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1525 "PBM data used for disabled breakpoint icon.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1526 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1527 (defvar breakpoint-enabled-icon nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1528 "Icon for enabled breakpoint in display margin.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1529 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1530 (defvar breakpoint-disabled-icon nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1531 "Icon for disabled breakpoint in display margin.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1532 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1533 (declare-function define-fringe-bitmap "fringe.c" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1534 (bitmap bits &optional height width align)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1535 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1536 (and (display-images-p) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1537 ;; Bitmap for breakpoint in fringe |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1538 (define-fringe-bitmap 'breakpoint |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1539 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1540 ;; Bitmap for gud-overlay-arrow in fringe |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1541 (define-fringe-bitmap 'hollow-right-triangle |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1542 "\xe0\x90\x88\x84\x84\x88\x90\xe0")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1543 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1544 (defface breakpoint-enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1545 '((t |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1546 :foreground "red1" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1547 :weight bold)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1548 "Face for enabled breakpoint icon in fringe." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1549 :group 'gdb) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1550 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1551 (defface breakpoint-disabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1552 '((((class color) (min-colors 88)) :foreground "grey70") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1553 ;; Ensure that on low-color displays that we end up something visible. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1554 (((class color) (min-colors 8) (background light)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1555 :foreground "black") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1556 (((class color) (min-colors 8) (background dark)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1557 :foreground "white") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1558 (((type tty) (class mono)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1559 :inverse-video t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1560 (t :background "gray")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1561 "Face for disabled breakpoint icon in fringe." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1562 :group 'gdb) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1563 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1564 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1565 (defun gdb-send (proc string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1566 "A comint send filter for gdb." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1567 (with-current-buffer gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1568 (let ((inhibit-read-only t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1569 (remove-text-properties (point-min) (point-max) '(face)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1570 ;; mimic <RET> key to repeat previous command in GDB |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1571 (if (not (string= "" string)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1572 (setq gdb-last-command string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1573 (if gdb-last-command (setq string gdb-last-command))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1574 (if gdb-enable-debug |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1575 (push (cons 'mi-send (concat string "\n")) gdb-debug-log)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1576 (if (string-match "^-" string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1577 ;; MI command |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1578 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1579 (setq gdb-first-done-or-error t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1580 (process-send-string proc (concat string "\n"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1581 ;; CLI command |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1582 (if (string-match "\\\\$" string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1583 (setq gdb-continuation (concat gdb-continuation string "\n")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1584 (setq gdb-first-done-or-error t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1585 (process-send-string proc (concat "-interpreter-exec console \"" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1586 gdb-continuation string "\"\n")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1587 (setq gdb-continuation nil)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1588 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1589 (defun gdb-input (item) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1590 (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1591 (setq gdb-token-number (1+ gdb-token-number)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1592 (setcar item (concat (number-to-string gdb-token-number) (car item))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1593 (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1594 (process-send-string (get-buffer-process gud-comint-buffer) |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
1595 (concat (car item) "\n"))) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1596 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1597 ;; NOFRAME is used for gud execution control commands |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1598 (defun gdb-current-context-command (command &optional noframe) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1599 "Add --thread and --frame options to gdb COMMAND. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1600 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1601 Option values are taken from `gdb-thread-number' and |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1602 `gdb-frame-number'. If `gdb-thread-number' is nil, COMMAND is |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1603 returned unchanged. If `gdb-frame-number' is nil of NOFRAME is t, |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1604 then no --frame option is added." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1605 ;; gdb-frame-number may be nil while gdb-thread-number is non-nil |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1606 ;; (when current thread is running) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1607 (if gdb-thread-number |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1608 (concat command " --thread " gdb-thread-number |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1609 (if (not (or noframe (not gdb-frame-number))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1610 (concat " --frame " gdb-frame-number) "") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1611 " ") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1612 command)) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1613 |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1614 (defun gdb-current-context-buffer-name (name) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1615 "Add thread information and asterisks to string NAME. |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1616 |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1617 If `gdb-thread-number' is nil, just wrap NAME in asterisks." |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
1618 (concat "*" name |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1619 (if (local-variable-p 'gdb-thread-number) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1620 (format " (bound to thread %s)" gdb-thread-number) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1621 "") |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1622 "*")) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1623 |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1624 (defun gdb-current-context-mode-name (mode) |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1625 "Add thread information to MODE which is to be used as |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1626 `mode-name'." |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1627 (concat mode |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1628 (if gdb-thread-number |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1629 (format " [thread %s]" gdb-thread-number) |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1630 ""))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1631 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1632 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1633 (defcustom gud-gdb-command-name "gdb -i=mi" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1634 "Default command to execute an executable under the GDB debugger." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1635 :type 'string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1636 :group 'gdb) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1637 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1638 (defun gdb-resync() |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1639 (setq gud-running nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1640 (setq gdb-output-sink 'user) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1641 (setq gdb-pending-triggers nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1642 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1643 (defun gdb-update () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1644 "Update buffers showing status of debug session." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1645 (when gdb-first-prompt |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1646 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1647 (propertize "initializing..." 'face font-lock-variable-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1648 (gdb-init-1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1649 (setq gdb-first-prompt nil)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1650 ;; We may need to update gdb-threads-list so we can use |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
1651 (gdb-get-buffer-create 'gdb-threads-buffer) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1652 ;; gdb-break-list is maintained in breakpoints handler |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1653 (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1654 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1655 (gdb-emit-signal gdb-buf-publisher 'update) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1656 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1657 (gdb-get-main-selected-frame) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
1658 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1659 (gdb-get-changed-registers) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
1660 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1661 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1662 (dolist (var gdb-var-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1663 (setcar (nthcdr 5 var) nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1664 (gdb-var-update))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1665 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1666 ;; gdb-setq-thread-number and gdb-update-gud-running are decoupled |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1667 ;; because we may need to update current gud-running value without |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1668 ;; changing current thread (see gdb-running) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1669 (defun gdb-setq-thread-number (number) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1670 "Only this function must be used to change `gdb-thread-number' |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1671 value to NUMBER, because `gud-running' and `gdb-frame-number' |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1672 need to be updated appropriately when current thread changes." |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1673 (setq gdb-thread-number number) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1674 (setq gdb-frame-number "0") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1675 (gdb-update-gud-running)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1676 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1677 (defun gdb-update-gud-running () |
104232
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1678 "Set `gud-running' according to the state of current thread. |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1679 |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1680 `gdb-frame-number' is set to 0 if current thread is now stopped. |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1681 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1682 Note that when `gdb-gud-control-all-threads' is t, `gud-running' |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1683 cannot be reliably used to determine whether or not execution |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1684 control buttons should be shown in menu or toolbar. Use |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1685 `gdb-running-threads-count' and `gdb-stopped-threads-count' |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1686 instead. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1687 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1688 For all-stop mode, thread information is unavailable while target |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1689 is running." |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1690 (let ((old-value gud-running)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1691 (setq gud-running |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1692 (string= (gdb-get-field (gdb-current-buffer-thread) 'state) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1693 "running")) |
104232
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1694 ;; Set frame number to "0" when _current_ threads stops |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1695 (when (and (gdb-current-buffer-thread) |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1696 (not (eq gud-running old-value))) |
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1697 (setq gdb-frame-number "0")))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1698 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1699 (defun gdb-show-run-p () |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1700 "Return t if \"Run/continue\" should be shown on the toolbar." |
104211
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
1701 (or (not gdb-active-process) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
1702 (and (or |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1703 (not gdb-gud-control-all-threads) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1704 (not gdb-non-stop)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1705 (not gud-running)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1706 (and gdb-gud-control-all-threads |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1707 (> gdb-stopped-threads-count 0)))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1708 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1709 (defun gdb-show-stop-p () |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1710 "Return t if \"Stop\" should be shown on the toolbar." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1711 (or (and (or |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1712 (not gdb-gud-control-all-threads) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1713 (not gdb-non-stop)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1714 gud-running) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1715 (and gdb-gud-control-all-threads |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1716 (> gdb-running-threads-count 0)))) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1717 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1718 ;; GUD displays the selected GDB frame. This might might not be the current |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1719 ;; GDB frame (after up, down etc). If no GDB frame is visible but the last |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1720 ;; visited breakpoint is, use that window. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1721 (defun gdb-display-source-buffer (buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1722 (let* ((last-window (if gud-last-last-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1723 (get-buffer-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1724 (gud-find-file (car gud-last-last-frame))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1725 (source-window (or last-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1726 (if (and gdb-source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1727 (window-live-p gdb-source-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1728 gdb-source-window)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1729 (when source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1730 (setq gdb-source-window source-window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1731 (set-window-buffer source-window buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1732 source-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1733 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1734 (defun gdb-car< (a b) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1735 (< (car a) (car b))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1736 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1737 (defvar gdbmi-record-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1738 '((gdb-gdb . "(gdb) \n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1739 (gdb-done . "\\([0-9]*\\)\\^done,?\\(.*?\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1740 (gdb-starting . "\\([0-9]*\\)\\^running\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1741 (gdb-error . "\\([0-9]*\\)\\^error,\\(.*?\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1742 (gdb-console . "~\\(\".*?\"\\)\n") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1743 (gdb-internals . "&\\(\".*?\"\\)\n") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1744 (gdb-stopped . "\\*stopped,?\\(.*?\\)\n") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1745 (gdb-running . "\\*running,\\(.*?\n\\)") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1746 (gdb-thread-created . "=thread-created,\\(.*?\n\\)") |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1747 (gdb-thread-selected . "=thread-selected,\\(.*?\\)\n") |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1748 (gdb-thread-exited . "=thread-exited,\\(.*?\n\\)") |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1749 (gdb-ignored-notification . "=[-[:alpha:]]+,?\\(.*?\\)\n") |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1750 (gdb-shell . "\\(\\(?:^.+\n\\)+\\)"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1751 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1752 (defun gud-gdbmi-marker-filter (string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1753 "Filter GDB/MI output." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1754 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1755 ;; Record transactions if logging is enabled. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1756 (when gdb-enable-debug |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1757 (push (cons 'recv string) gdb-debug-log) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1758 (if (and gdb-debug-log-max |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1759 (> (length gdb-debug-log) gdb-debug-log-max)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1760 (setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1761 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1762 ;; Recall the left over gud-marker-acc from last time |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1763 (setq gud-marker-acc (concat gud-marker-acc string)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1764 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1765 ;; Start accumulating output for the GUD buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1766 (setq gdb-filter-output "") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1767 (let ((output-record) (output-record-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1768 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1769 ;; Process all the complete markers in this chunk. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1770 (dolist (gdbmi-record gdbmi-record-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1771 (while (string-match (cdr gdbmi-record) gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1772 (push (list (match-beginning 0) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1773 (car gdbmi-record) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1774 (match-string 1 gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1775 (match-string 2 gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1776 (match-end 0)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1777 output-record-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1778 (setq gud-marker-acc |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1779 (concat (substring gud-marker-acc 0 (match-beginning 0)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1780 ;; Pad with spaces to preserve position. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1781 (make-string (length (match-string 0 gud-marker-acc)) 32) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1782 (substring gud-marker-acc (match-end 0)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1783 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1784 (setq output-record-list (sort output-record-list 'gdb-car<)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1785 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1786 (dolist (output-record output-record-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1787 (let ((record-type (cadr output-record)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1788 (arg1 (nth 2 output-record)) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
1789 (arg2 (nth 3 output-record))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1790 (if (eq record-type 'gdb-error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1791 (gdb-done-or-error arg2 arg1 'error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1792 (if (eq record-type 'gdb-done) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1793 (gdb-done-or-error arg2 arg1 'done) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1794 ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1795 ;; error message on internal stream. Don't print to GUD buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1796 (unless (and (eq record-type 'gdb-internals) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1797 (string-equal (read arg1) "No registers.\n")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1798 (funcall record-type arg1)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1799 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1800 (setq gdb-output-sink 'user) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1801 ;; Remove padding. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1802 (string-match "^ *" gud-marker-acc) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1803 (setq gud-marker-acc (substring gud-marker-acc (match-end 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1804 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1805 gdb-filter-output)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1806 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1807 (defun gdb-gdb (output-field)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1808 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1809 (defun gdb-shell (output-field) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1810 (let ((gdb-output-sink gdb-output-sink)) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1811 (setq gdb-filter-output |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1812 (concat output-field gdb-filter-output)))) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1813 |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1814 (defun gdb-ignored-notification (output-field)) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1815 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1816 ;; gdb-invalidate-threads is defined to accept 'update-threads signal |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1817 (defun gdb-thread-created (output-field)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1818 (defun gdb-thread-exited (output-field) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1819 "Handle =thread-exited async record: unset `gdb-thread-number' |
104232
23230e6cbc19
*** empty log message ***
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104213
diff
changeset
|
1820 if current thread exited and update threads list." |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1821 (let* ((thread-id (gdb-get-field (gdb-json-string output-field) 'id))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1822 (if (string= gdb-thread-number thread-id) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1823 (gdb-setq-thread-number nil)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1824 ;; When we continue current thread and it quickly exits, |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1825 ;; gdb-pending-triggers left after gdb-running disallow us to |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1826 ;; properly call -thread-info without --thread option. Thus we |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1827 ;; need to use gdb-wait-for-pending. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1828 (gdb-wait-for-pending |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1829 (gdb-emit-signal gdb-buf-publisher 'update-threads)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1830 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1831 (defun gdb-thread-selected (output-field) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1832 "Handler for =thread-selected MI output record. |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1833 |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1834 Sets `gdb-thread-number' to new id." |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1835 (let* ((result (gdb-json-string output-field)) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1836 (thread-id (gdb-get-field result 'id))) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1837 (gdb-setq-thread-number thread-id) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1838 ;; Typing `thread N` in GUD buffer makes GDB emit `^done` followed |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1839 ;; by `=thread-selected` notification. `^done` causes `gdb-update` |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1840 ;; as usually. Things happen to fast and second call (from |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1841 ;; gdb-thread-selected handler) gets cut off by our beloved |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1842 ;; gdb-pending-triggers. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1843 ;; Solution is `gdb-wait-for-pending` macro: it guarantees that its |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1844 ;; body will get executed when `gdb-pending-triggers` is empty. |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1845 (gdb-wait-for-pending |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1846 (gdb-update)))) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
1847 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1848 (defun gdb-running (output-field) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1849 (let* ((thread-id (gdb-get-field (gdb-json-string output-field) 'thread-id))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1850 ;; We reset gdb-frame-number to nil if current thread has gone |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1851 ;; running. This can't be done in gdb-thread-list-handler-custom |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1852 ;; because we need correct gdb-frame-number by the time |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1853 ;; -thread-info command is sent. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1854 (when (or (string-equal thread-id "all") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1855 (string-equal thread-id gdb-thread-number)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1856 (setq gdb-frame-number nil))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1857 (setq gdb-inferior-status "running") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1858 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1859 (propertize gdb-inferior-status 'face font-lock-type-face)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1860 (when (not gdb-non-stop) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1861 (setq gud-running t)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1862 (setq gdb-active-process t) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1863 (gdb-emit-signal gdb-buf-publisher 'update-threads)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1864 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1865 (defun gdb-starting (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1866 ;; CLI commands don't emit ^running at the moment so use gdb-running too. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1867 (setq gdb-inferior-status "running") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1868 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1869 (propertize gdb-inferior-status 'face font-lock-type-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1870 (setq gdb-active-process t) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1871 (setq gud-running t) |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1872 ;; GDB doesn't seem to respond to -thread-info before first stop or |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1873 ;; thread exit (even in non-stop mode), so this is useless. |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1874 ;; Behaviour may change in the future. |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
1875 (gdb-emit-signal gdb-buf-publisher 'update-threads)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1876 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1877 ;; -break-insert -t didn't give a reason before gdb 6.9 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1878 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1879 (defun gdb-stopped (output-field) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1880 "Given the contents of *stopped MI async record, select new |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1881 current thread and update GDB buffers." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1882 ;; Reason is available with target-async only |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1883 (let* ((result (gdb-json-string output-field)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1884 (reason (gdb-get-field result 'reason)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1885 (thread-id (gdb-get-field result 'thread-id))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1886 |
104234
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1887 ;; -data-list-register-names needs to be issued for any stopped |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1888 ;; thread |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1889 (when (not gdb-register-names) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1890 (gdb-input |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1891 (list (concat "-data-list-register-names --thread " thread-id) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1892 'gdb-register-names-handler))) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
1893 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1894 ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1895 ;;; because synchronous GDB doesn't give these fields with CLI. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1896 ;;; (when file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1897 ;;; (setq |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1898 ;;; ;; Extract the frame position from the marker. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1899 ;;; gud-last-frame (cons file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1900 ;;; (string-to-number |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1901 ;;; (match-string 6 gud-marker-acc))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1902 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1903 (setq gdb-inferior-status (or reason "unknown")) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1904 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1905 (propertize gdb-inferior-status 'face font-lock-warning-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1906 (if (string-equal reason "exited-normally") |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1907 (setq gdb-active-process nil)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1908 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1909 ;; Select new current thread. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1910 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1911 ;; Don't switch if we have no reasons selected |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1912 (when gdb-switch-reasons |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1913 ;; Switch from another stopped thread only if we have |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1914 ;; gdb-switch-when-another-stopped: |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1915 (when (or gdb-switch-when-another-stopped |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1916 (not (string= "stopped" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1917 (gdb-get-field (gdb-current-buffer-thread) 'state)))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1918 ;; Switch if current reason has been selected or we have no |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1919 ;; reasons |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1920 (if (or (eq gdb-switch-reasons t) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1921 (member reason gdb-switch-reasons)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1922 (progn |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1923 (gdb-setq-thread-number thread-id) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1924 (message (concat "Switched to thread " thread-id))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1925 (message (format "Thread %s stopped" thread-id))))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1926 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1927 ;; Print "(gdb)" to GUD console |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1928 (when gdb-first-done-or-error |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1929 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1930 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1931 ;; In non-stop, we update information as soon as another thread gets |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1932 ;; stopped |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1933 (when (or gdb-first-done-or-error |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1934 gdb-non-stop) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1935 ;; In all-stop this updates gud-running properly as well. |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1936 (gdb-update) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
1937 (setq gdb-first-done-or-error nil)) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
1938 (run-hook-with-args 'gdb-stopped-hooks result))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1939 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1940 ;; Remove the trimmings from log stream containing debugging messages |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1941 ;; being produced by GDB's internals, use warning face and send to GUD |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1942 ;; buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1943 (defun gdb-internals (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1944 (setq gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1945 (gdb-concat-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1946 gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1947 (let ((error-message |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1948 (read output-field))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1949 (put-text-property |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1950 0 (length error-message) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1951 'face font-lock-warning-face |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1952 error-message) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1953 error-message)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1954 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1955 ;; Remove the trimmings from the console stream and send to GUD buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1956 ;; (frontend MI commands should not print to this stream) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1957 (defun gdb-console (output-field) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1958 (setq gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1959 (gdb-concat-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1960 gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1961 (read output-field)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1962 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1963 (defun gdb-done-or-error (output-field token-number type) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1964 (if (string-equal token-number "") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1965 ;; Output from command entered by user |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1966 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1967 (setq gdb-output-sink 'user) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1968 (setq token-number nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1969 ;; MI error - send to minibuffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1970 (when (eq type 'error) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1971 ;; Skip "msg=" from `output-field' |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1972 (message (read (substring output-field 4))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1973 ;; Don't send to the console twice. (If it is a console error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1974 ;; it is also in the console stream.) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1975 (setq output-field nil))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1976 ;; Output from command from frontend. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1977 (setq gdb-output-sink 'emacs)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1978 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1979 (gdb-clear-partial-output) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1980 (when gdb-first-done-or-error |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1981 (unless (or token-number gud-running) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1982 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1983 (gdb-update) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1984 (setq gdb-first-done-or-error nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1985 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1986 (setq gdb-filter-output |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1987 (gdb-concat-output gdb-filter-output output-field)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1988 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1989 (if token-number |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1990 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1991 (with-current-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1992 (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1993 (funcall |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1994 (cdr (assoc (string-to-number token-number) gdb-handler-alist)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1995 (setq gdb-handler-alist |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1996 (assq-delete-all token-number gdb-handler-alist))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1997 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1998 (defun gdb-concat-output (so-far new) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
1999 (let ((sink gdb-output-sink)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2000 (cond |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2001 ((eq sink 'user) (concat so-far new)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2002 ((eq sink 'emacs) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2003 (gdb-append-to-partial-output new) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2004 so-far)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2005 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2006 (defun gdb-append-to-partial-output (string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2007 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2008 (goto-char (point-max)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2009 (insert string))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2010 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2011 (defun gdb-clear-partial-output () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2012 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2013 (erase-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2014 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2015 (defun gdb-jsonify-buffer (&optional fix-key fix-list) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2016 "Prepare GDB/MI output in current buffer for parsing with `json-read'. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2017 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2018 Field names are wrapped in double quotes and equal signs are |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2019 replaced with semicolons. |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2020 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2021 If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurences from |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2022 partial output. This is used to get rid of useless keys in lists |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2023 in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2024 -break-info are examples of MI commands which issue such |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2025 responses. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2026 |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2027 If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2028 \"FIX-LIST=[..]\" prior to parsing. This is used to fix broken |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2029 -break-info output when it contains breakpoint script field |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2030 incompatible with GDB/MI output syntax." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2031 (save-excursion |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2032 (goto-char (point-min)) |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2033 (when fix-key |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2034 (save-excursion |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2035 (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2036 (replace-match "" nil nil nil 1)))) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2037 ;; Emacs bug #3794 |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2038 (when fix-list |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2039 (save-excursion |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2040 ;; Find positions of braces which enclose broken list |
103886
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2041 (while (re-search-forward (concat fix-list "={\"") nil t) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2042 (let ((p1 (goto-char (- (point) 2))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2043 (p2 (progn (forward-sexp) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2044 (1- (point))))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2045 ;; Replace braces with brackets |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2046 (save-excursion |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2047 (goto-char p1) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2048 (delete-char 1) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2049 (insert "[") |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2050 (goto-char p2) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2051 (delete-char 1) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2052 (insert "]")))))) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2053 (goto-char (point-min)) |
d9b3b49cf6d3
(json-partial-output): Fix broken GDB/MI output in -break-info command
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103779
diff
changeset
|
2054 (insert "{") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2055 ;; TODO: This breaks badly with foo= inside constants |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2056 (while (re-search-forward "\\([[:alpha:]-_]+\\)=" nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2057 (replace-match "\"\\1\":" nil nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2058 (goto-char (point-max)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2059 (insert "}"))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2060 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2061 (defun gdb-json-read-buffer (&optional fix-key fix-list) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2062 "Prepare and parse GDB/MI output in current buffer with `json-read'. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2063 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2064 FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2065 (gdb-jsonify-buffer fix-key fix-list) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2066 (save-excursion |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2067 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2068 (let ((json-array-type 'list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2069 (json-read)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2070 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2071 (defun gdb-json-string (string &optional fix-key fix-list) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2072 "Prepare and parse STRING containing GDB/MI output with `json-read'. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2073 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2074 FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2075 (with-temp-buffer |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2076 (insert string) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2077 (gdb-json-read-buffer fix-key fix-list))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2078 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2079 (defun gdb-json-partial-output (&optional fix-key fix-list) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2080 "Prepare and parse gdb-partial-output-buffer with `json-read'. |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2081 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2082 FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2083 (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2084 (gdb-json-read-buffer fix-key fix-list))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2085 |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2086 (defun gdb-line-posns (line) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2087 "Return a pair of LINE beginning and end positions." |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2088 (let ((offset (1+ (- line (line-number-at-pos))))) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2089 (cons |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2090 (line-beginning-position offset) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2091 (line-end-position offset)))) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2092 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2093 (defmacro gdb-mark-line (line variable) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2094 "Set VARIABLE marker to point at beginning of LINE. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2095 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2096 If current window has no fringes, inverse colors on LINE. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2097 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2098 Return position where LINE begins." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2099 `(save-excursion |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2100 (let* ((posns (gdb-line-posns ,line)) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2101 (start-posn (car posns)) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2102 (end-posn (cdr posns))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2103 (set-marker ,variable (copy-marker start-posn)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2104 (when (not (> (car (window-fringes)) 0)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2105 (put-text-property start-posn end-posn |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2106 'font-lock-face '(:inverse-video t))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2107 start-posn))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2108 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2109 (defun gdb-pad-string (string padding) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2110 (format (concat "%" (number-to-string padding) "s") string)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2111 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2112 ;; gdb-table struct is a way to programmatically construct simple |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2113 ;; tables. It help to reliably align columns of data in GDB buffers |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2114 ;; and provides |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2115 (defstruct |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2116 gdb-table |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2117 (column-sizes nil) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2118 (rows nil) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2119 (row-properties nil) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2120 (right-align nil)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2121 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2122 (defun gdb-table-add-row (table row &optional properties) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2123 "Add ROW of string to TABLE and recalculate column sizes. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2124 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2125 When non-nil, PROPERTIES will be added to the whole row when |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2126 calling `gdb-table-string'." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2127 (let ((rows (gdb-table-rows table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2128 (row-properties (gdb-table-row-properties table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2129 (column-sizes (gdb-table-column-sizes table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2130 (right-align (gdb-table-right-align table))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2131 (when (not column-sizes) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2132 (setf (gdb-table-column-sizes table) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2133 (make-list (length row) 0))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2134 (setf (gdb-table-rows table) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2135 (append rows (list row))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2136 (setf (gdb-table-row-properties table) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2137 (append row-properties (list properties))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2138 (setf (gdb-table-column-sizes table) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2139 (mapcar* (lambda (x s) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2140 (let ((new-x |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2141 (max (abs x) (string-width (or s ""))))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2142 (if right-align new-x (- new-x)))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2143 (gdb-table-column-sizes table) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2144 row)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2145 ;; Avoid trailing whitespace at eol |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2146 (if (not (gdb-table-right-align table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2147 (setcar (last (gdb-table-column-sizes table)) 0)))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2148 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2149 (defun gdb-table-string (table &optional sep) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2150 "Return TABLE as a string with columns separated with SEP." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2151 (let ((column-sizes (gdb-table-column-sizes table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2152 (res "")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2153 (mapconcat |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2154 'identity |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2155 (mapcar* |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2156 (lambda (row properties) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2157 (apply 'propertize |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2158 (mapconcat 'identity |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2159 (mapcar* (lambda (s x) (gdb-pad-string s x)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2160 row column-sizes) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2161 sep) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2162 properties)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2163 (gdb-table-rows table) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2164 (gdb-table-row-properties table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2165 "\n"))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2166 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2167 ;; gdb-get-field goes deep, gdb-get-many-fields goes wide |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2168 (defalias 'gdb-get-field 'bindat-get-field) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2169 |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2170 (defun gdb-get-many-fields (struct &rest fields) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2171 "Return a list of FIELDS values from STRUCT." |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2172 (let ((values)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2173 (dolist (field fields values) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2174 (setq values (append values (list (gdb-get-field struct field))))))) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2175 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2176 (defmacro def-gdb-auto-update-trigger (trigger-name gdb-command |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2177 handler-name |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2178 &optional signal-list) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2179 "Define a trigger TRIGGER-NAME which sends GDB-COMMAND and sets |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2180 HANDLER-NAME as its handler. HANDLER-NAME is bound to current |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2181 buffer with `gdb-bind-function-to-buffer'. |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2182 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2183 If SIGNAL-LIST is non-nil, GDB-COMMAND is sent only when the |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2184 defined trigger is called with an argument from SIGNAL-LIST. It's |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2185 not recommended to define triggers with empty SIGNAL-LIST. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2186 Normally triggers should respond at least to 'update signal. |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2187 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2188 Normally the trigger defined by this command must be called from |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2189 the buffer where HANDLER-NAME must work. This should be done so |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2190 that buffer-local thread number may be used in GDB-COMMAND (by |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2191 calling `gdb-current-context-command'). |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2192 `gdb-bind-function-to-buffer' is used to achieve this, see |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2193 `gdb-get-buffer-create'. |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2194 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2195 Triggers defined by this command are meant to be used as a |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2196 trigger argument when describing buffer types with |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2197 `gdb-set-buffer-rules'." |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2198 `(defun ,trigger-name (&optional signal) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2199 (when |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2200 (or (not ,signal-list) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2201 (memq signal ,signal-list)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2202 (when (not (gdb-pending-p |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2203 (cons (current-buffer) ',trigger-name))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2204 (gdb-input |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2205 (list ,gdb-command |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2206 (gdb-bind-function-to-buffer ',handler-name (current-buffer)))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2207 (gdb-add-pending (cons (current-buffer) ',trigger-name)))))) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2208 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2209 ;; Used by disassembly buffer only, the rest use |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2210 ;; def-gdb-trigger-and-handler |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2211 (defmacro def-gdb-auto-update-handler (handler-name trigger-name custom-defun |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2212 &optional nopreserve) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2213 "Define a handler HANDLER-NAME for TRIGGER-NAME with CUSTOM-DEFUN. |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2214 |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2215 Handlers are normally called from the buffers they put output in. |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2216 |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2217 Delete ((current-buffer) . TRIGGER-NAME) from |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2218 `gdb-pending-triggers', erase current buffer and evaluate |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2219 CUSTOM-DEFUN. Then `gdb-update-buffer-name' is called. |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2220 |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2221 If NOPRESERVE is non-nil, window point is not restored after CUSTOM-DEFUN." |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2222 `(defun ,handler-name () |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2223 (gdb-delete-pending (cons (current-buffer) ',trigger-name)) |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2224 (let* ((buffer-read-only nil) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2225 (window (get-buffer-window (current-buffer) 0)) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2226 (start (window-start window)) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2227 (p (window-point window))) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2228 (erase-buffer) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2229 (,custom-defun) |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2230 (gdb-update-buffer-name) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2231 ,(when (not nopreserve) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2232 '(set-window-start window start) |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2233 '(set-window-point window p))))) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2234 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2235 (defmacro def-gdb-trigger-and-handler (trigger-name gdb-command |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2236 handler-name custom-defun |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2237 &optional signal-list) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2238 "Define trigger and handler. |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2239 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2240 TRIGGER-NAME trigger is defined to send GDB-COMMAND. See |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2241 `def-gdb-auto-update-trigger'. |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2242 |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2243 HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2244 `def-gdb-auto-update-handler'." |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2245 `(progn |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2246 (def-gdb-auto-update-trigger ,trigger-name |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2247 ,gdb-command |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2248 ,handler-name ,signal-list) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2249 (def-gdb-auto-update-handler ,handler-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2250 ,trigger-name ,custom-defun))) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2251 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2252 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2253 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2254 ;; Breakpoint buffer : This displays the output of `-break-list'. |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2255 (def-gdb-trigger-and-handler |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2256 gdb-invalidate-breakpoints "-break-list" |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2257 gdb-breakpoints-list-handler gdb-breakpoints-list-handler-custom |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2258 '(start update)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2259 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2260 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2261 'gdb-breakpoints-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2262 'gdb-breakpoints-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2263 'gdb-breakpoints-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2264 'gdb-invalidate-breakpoints) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2265 |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2266 (defun gdb-breakpoints-list-handler-custom () |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2267 (let ((breakpoints-list (gdb-get-field |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2268 (gdb-json-partial-output "bkpt" "script") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2269 'BreakpointTable 'body)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2270 (table (make-gdb-table))) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2271 (setq gdb-breakpoints-list nil) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2272 (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Hits" "Addr" "What")) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2273 (dolist (breakpoint breakpoints-list) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2274 (add-to-list 'gdb-breakpoints-list |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2275 (cons (gdb-get-field breakpoint 'number) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2276 breakpoint)) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2277 (let ((at (gdb-get-field breakpoint 'at)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2278 (pending (gdb-get-field breakpoint 'pending)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2279 (func (gdb-get-field breakpoint 'func))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2280 (gdb-table-add-row table |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2281 (list |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2282 (gdb-get-field breakpoint 'number) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2283 (gdb-get-field breakpoint 'type) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2284 (gdb-get-field breakpoint 'disp) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2285 (let ((flag (gdb-get-field breakpoint 'enabled))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2286 (if (string-equal flag "y") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2287 (propertize "y" 'font-lock-face font-lock-warning-face) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2288 (propertize "n" 'font-lock-face font-lock-comment-face))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2289 (gdb-get-field breakpoint 'times) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2290 (gdb-get-field breakpoint 'addr) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2291 (or pending at |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2292 (concat "in " |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2293 (propertize func 'font-lock-face font-lock-function-name-face) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2294 (gdb-frame-location breakpoint)))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2295 ;; Add clickable properties only for breakpoints with file:line |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2296 ;; information |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2297 (append (list 'gdb-breakpoint breakpoint) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2298 (when func '(help-echo "mouse-2, RET: visit breakpoint" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2299 mouse-face highlight)))))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2300 (insert (gdb-table-string table " ")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2301 (gdb-place-breakpoints))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2302 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2303 ;; Put breakpoint icons in relevant margins (even those set in the GUD buffer). |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2304 (defun gdb-place-breakpoints () |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2305 (let ((flag) (bptno)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2306 ;; Remove all breakpoint-icons in source buffers but not assembler buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2307 (dolist (buffer (buffer-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2308 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2309 (if (and (eq gud-minor-mode 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2310 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2311 (gdb-remove-breakpoint-icons (point-min) (point-max))))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2312 (dolist (breakpoint gdb-breakpoints-list) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2313 (let* ((breakpoint (cdr breakpoint)) ; gdb-breakpoints-list is |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2314 ; an associative list |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2315 (line (gdb-get-field breakpoint 'line))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2316 (when line |
104115
335df621bc5c
(gdb-place-breakpoints): Use full path when setting breakpoints.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104104
diff
changeset
|
2317 (let ((file (gdb-get-field breakpoint 'fullname)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2318 (flag (gdb-get-field breakpoint 'enabled)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2319 (bptno (gdb-get-field breakpoint 'number))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2320 (unless (file-exists-p file) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2321 (setq file (cdr (assoc bptno gdb-location-alist)))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2322 (if (and file |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2323 (not (string-equal file "File not found"))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2324 (with-current-buffer |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2325 (find-file-noselect file 'nowarn) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2326 (gdb-init-buffer) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2327 ;; Only want one breakpoint icon at each location. |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2328 (gdb-put-breakpoint-icon (string-equal flag "y") bptno |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2329 (string-to-number line))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2330 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2331 (list (concat "list " file ":1") |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2332 'ignore)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2333 (gdb-input |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2334 (list "-file-list-exec-source-file" |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2335 `(lambda () (gdb-get-location |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2336 ,bptno ,line ,flag))))))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2337 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2338 (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2339 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2340 (defun gdb-get-location (bptno line flag) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2341 "Find the directory containing the relevant source file. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2342 Put in buffer and place breakpoint icon." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2343 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2344 (catch 'file-not-found |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2345 (if (re-search-forward gdb-source-file-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2346 (delete (cons bptno "File not found") gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2347 (push (cons bptno (match-string 1)) gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2348 (gdb-resync) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2349 (unless (assoc bptno gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2350 (push (cons bptno "File not found") gdb-location-alist) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2351 (message-box "Cannot find source file for breakpoint location. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2352 Add directory to search path for source files using the GDB command, dir.")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2353 (throw 'file-not-found nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2354 (with-current-buffer (find-file-noselect (match-string 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2355 (gdb-init-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2356 ;; only want one breakpoint icon at each location |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2357 (gdb-put-breakpoint-icon (eq flag ?y) bptno (string-to-number line))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2358 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2359 (add-hook 'find-file-hook 'gdb-find-file-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2360 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2361 (defun gdb-find-file-hook () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2362 "Set up buffer for debugging if file is part of the source code |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2363 of the current session." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2364 (if (and (buffer-name gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2365 ;; in case gud or gdb-ui is just loaded |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2366 gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2367 (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2368 'gdbmi)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2369 (if (member buffer-file-name gdb-source-file-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2370 (with-current-buffer (find-buffer-visiting buffer-file-name) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2371 (gdb-init-buffer))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2372 |
103563 | 2373 (declare-function gud-remove "gdb-mi" t t) ; gud-def |
2374 (declare-function gud-break "gdb-mi" t t) ; gud-def | |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2375 (declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2376 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2377 (defun gdb-mouse-set-clear-breakpoint (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2378 "Set/clear breakpoint in left fringe/margin at mouse click. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2379 If not in a source or disassembly buffer just set point." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2380 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2381 (mouse-minibuffer-check event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2382 (let ((posn (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2383 (with-selected-window (posn-window posn) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2384 (if (or (buffer-file-name) (eq major-mode 'gdb-disassembly-mode)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2385 (if (numberp (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2386 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2387 (goto-char (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2388 (if (or (posn-object posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2389 (eq (car (fringe-bitmaps-at-pos (posn-point posn))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2390 'breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2391 (gud-remove nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2392 (gud-break nil))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2393 (posn-set-point posn)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2394 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2395 (defun gdb-mouse-toggle-breakpoint-margin (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2396 "Enable/disable breakpoint in left margin with mouse click." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2397 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2398 (mouse-minibuffer-check event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2399 (let ((posn (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2400 (if (numberp (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2401 (with-selected-window (posn-window posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2402 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2403 (goto-char (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2404 (if (posn-object posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2405 (gud-basic-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2406 (let ((bptno (get-text-property |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2407 0 'gdb-bptno (car (posn-string posn))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2408 (concat |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2409 (if (get-text-property |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2410 0 'gdb-enabled (car (posn-string posn))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2411 "-break-disable " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2412 "-break-enable ") |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2413 bptno))))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2414 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2415 (defun gdb-mouse-toggle-breakpoint-fringe (event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2416 "Enable/disable breakpoint in left fringe with mouse click." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2417 (interactive "e") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2418 (mouse-minibuffer-check event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2419 (let* ((posn (event-end event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2420 (pos (posn-point posn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2421 obj) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2422 (when (numberp pos) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2423 (with-selected-window (posn-window posn) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2424 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2425 (set-buffer (window-buffer (selected-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2426 (goto-char pos) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2427 (dolist (overlay (overlays-in pos pos)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2428 (when (overlay-get overlay 'put-break) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2429 (setq obj (overlay-get overlay 'before-string)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2430 (when (stringp obj) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2431 (gud-basic-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2432 (concat |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2433 (if (get-text-property 0 'gdb-enabled obj) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2434 "-break-disable " |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2435 "-break-enable ") |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2436 (get-text-property 0 'gdb-bptno obj))))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2437 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2438 (defun gdb-breakpoints-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
2439 (concat "*breakpoints of " (gdb-get-target-string) "*")) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2440 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2441 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2442 gdb-display-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2443 'gdb-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2444 "Display status of user-settable breakpoints.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2445 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2446 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2447 gdb-frame-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2448 'gdb-breakpoints-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2449 "Display status of user-settable breakpoints in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2450 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2451 (defvar gdb-breakpoints-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2452 (let ((map (make-sparse-keymap)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2453 (menu (make-sparse-keymap "Breakpoints"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2454 (define-key menu [quit] '("Quit" . gdb-delete-frame-or-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2455 (define-key menu [goto] '("Goto" . gdb-goto-breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2456 (define-key menu [delete] '("Delete" . gdb-delete-breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2457 (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2458 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2459 (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2460 (define-key map " " 'gdb-toggle-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2461 (define-key map "D" 'gdb-delete-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2462 ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2463 (define-key map "q" 'gdb-delete-frame-or-window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2464 (define-key map "\r" 'gdb-goto-breakpoint) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2465 (define-key map "\t" '(lambda () |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2466 (interactive) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
2467 (gdb-set-window-buffer |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
2468 (gdb-get-buffer-create 'gdb-threads-buffer) t))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2469 (define-key map [mouse-2] 'gdb-goto-breakpoint) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2470 (define-key map [follow-link] 'mouse-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2471 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2472 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2473 (defun gdb-delete-frame-or-window () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2474 "Delete frame if there is only one window. Otherwise delete the window." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2475 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2476 (if (one-window-p) (delete-frame) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2477 (delete-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2478 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2479 ;;from make-mode-line-mouse-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2480 (defun gdb-make-header-line-mouse-map (mouse function) "\ |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2481 Return a keymap with single entry for mouse key MOUSE on the header line. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2482 MOUSE is defined to run function FUNCTION with no args in the buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2483 corresponding to the mode line clicked." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2484 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2485 (define-key map (vector 'header-line mouse) function) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2486 (define-key map (vector 'header-line 'down-mouse-1) 'ignore) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2487 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2488 |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2489 (defmacro gdb-propertize-header (name buffer help-echo mouse-face face) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2490 `(propertize ,name |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2491 'help-echo ,help-echo |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2492 'mouse-face ',mouse-face |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2493 'face ',face |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2494 'local-map |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2495 (gdb-make-header-line-mouse-map |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2496 'mouse-1 |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2497 (lambda (event) (interactive "e") |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2498 (save-selected-window |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2499 (select-window (posn-window (event-start event))) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2500 (gdb-set-window-buffer |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2501 (gdb-get-buffer-create ',buffer) t) ))))) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2502 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2503 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2504 ;; uses "-thread-info". Needs GDB 7.0 onwards. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2505 ;;; Threads view |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2506 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2507 (defun gdb-threads-buffer-name () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2508 (concat "*threads of " (gdb-get-target-string) "*")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2509 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2510 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2511 gdb-display-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2512 'gdb-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2513 "Display GDB threads.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2514 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2515 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2516 gdb-frame-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2517 'gdb-threads-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2518 "Display GDB threads in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2519 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2520 (def-gdb-trigger-and-handler |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2521 gdb-invalidate-threads (gdb-current-context-command "-thread-info" gud-running) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2522 gdb-thread-list-handler gdb-thread-list-handler-custom |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2523 '(start update update-threads)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2524 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2525 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2526 'gdb-threads-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2527 'gdb-threads-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2528 'gdb-threads-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2529 'gdb-invalidate-threads) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2530 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2531 (defvar gdb-threads-font-lock-keywords |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2532 '(("in \\([^ ]+\\)" (1 font-lock-function-name-face)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2533 (" \\(stopped\\)" (1 font-lock-warning-face)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2534 (" \\(running\\)" (1 font-lock-string-face)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2535 ("\\(\\(\\sw\\|[_.]\\)+\\)=" (1 font-lock-variable-name-face))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2536 "Font lock keywords used in `gdb-threads-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2537 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2538 (defvar gdb-threads-mode-map |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2539 (let ((map (make-sparse-keymap))) |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
2540 (define-key map "\r" 'gdb-select-thread) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2541 (define-key map "f" 'gdb-display-stack-for-thread) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2542 (define-key map "F" 'gdb-frame-stack-for-thread) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2543 (define-key map "l" 'gdb-display-locals-for-thread) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2544 (define-key map "L" 'gdb-frame-locals-for-thread) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2545 (define-key map "r" 'gdb-display-registers-for-thread) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2546 (define-key map "R" 'gdb-frame-registers-for-thread) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2547 (define-key map "d" 'gdb-display-disassembly-for-thread) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2548 (define-key map "D" 'gdb-frame-disassembly-for-thread) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2549 (define-key map "i" 'gdb-interrupt-thread) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2550 (define-key map "c" 'gdb-continue-thread) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2551 (define-key map "s" 'gdb-step-thread) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2552 (define-key map "\t" '(lambda () |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2553 (interactive) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
2554 (gdb-set-window-buffer |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
2555 (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2556 (define-key map [mouse-2] 'gdb-select-thread) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2557 (define-key map [follow-link] 'mouse-face) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2558 map)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2559 |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2560 (defvar gdb-threads-header |
103955
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
2561 (list |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
2562 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2563 "mouse-1: select" mode-line-highlight mode-line-inactive) |
103955
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
2564 " " |
67efbd930fef
(speedbar-frame): Declare to avoid compiler
Nick Roberts <nickrob@snap.net.nz>
parents:
103886
diff
changeset
|
2565 (gdb-propertize-header "Threads" gdb-threads-buffer |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2566 nil nil mode-line))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2567 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2568 (define-derived-mode gdb-threads-mode gdb-parent-mode "Threads" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2569 "Major mode for GDB threads. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2570 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2571 \\{gdb-threads-mode-map}" |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2572 (setq gdb-thread-position (make-marker)) |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2573 (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position) |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2574 (setq header-line-format gdb-threads-header) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2575 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2576 '(gdb-threads-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2577 (run-mode-hooks 'gdb-threads-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2578 'gdb-invalidate-threads) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2579 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
2580 (defun gdb-thread-list-handler-custom () |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2581 (let ((threads-list (gdb-get-field (gdb-json-partial-output) 'threads)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2582 (table (make-gdb-table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2583 (marked-line nil)) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2584 (setq gdb-threads-list nil) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2585 (setq gdb-running-threads-count 0) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2586 (setq gdb-stopped-threads-count 0) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2587 (set-marker gdb-thread-position nil) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2588 |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2589 (dolist (thread (reverse threads-list)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2590 (let ((running (string-equal (gdb-get-field thread 'state) "running"))) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2591 (add-to-list 'gdb-threads-list |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2592 (cons (gdb-get-field thread 'id) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2593 thread)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2594 (if running |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2595 (incf gdb-running-threads-count) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2596 (incf gdb-stopped-threads-count)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2597 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2598 (gdb-table-add-row table |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2599 (list |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2600 (gdb-get-field thread 'id) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2601 (concat |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2602 (if gdb-thread-buffer-verbose-names |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2603 (concat (gdb-get-field thread 'target-id) " ") "") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2604 (gdb-get-field thread 'state) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2605 ;; Include frame information for stopped threads |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2606 (if (not running) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2607 (concat |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2608 " in " (gdb-get-field thread 'frame 'func) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2609 (if gdb-thread-buffer-arguments |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2610 (concat |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2611 " (" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2612 (let ((args (gdb-get-field thread 'frame 'args))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2613 (mapconcat |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2614 (lambda (arg) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2615 (apply 'format `("%s=%s" ,@(gdb-get-many-fields arg 'name 'value)))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2616 args ",")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2617 ")") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2618 "") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2619 (if gdb-thread-buffer-locations |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2620 (gdb-frame-location (gdb-get-field thread 'frame)) "") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2621 (if gdb-thread-buffer-addresses |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2622 (concat " at " (gdb-get-field thread 'frame 'addr)) "")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2623 ""))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2624 (list |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2625 'gdb-thread thread |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2626 'mouse-face 'highlight |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2627 'help-echo "mouse-2, RET: select thread"))) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2628 (when (string-equal gdb-thread-number |
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2629 (gdb-get-field thread 'id)) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2630 (setq marked-line (length gdb-threads-list)))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2631 (insert (gdb-table-string table " ")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2632 (when marked-line |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2633 (gdb-mark-line marked-line gdb-thread-position))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2634 ;; We update gud-running here because we need to make sure that |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2635 ;; gdb-threads-list is up-to-date |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2636 (gdb-update-gud-running) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
2637 (gdb-emit-signal gdb-buf-publisher 'update-disassembly)) |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
2638 |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2639 (defmacro def-gdb-thread-buffer-command (name custom-defun &optional doc) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2640 "Define a NAME command which will act upon thread on the current line. |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2641 |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2642 CUSTOM-DEFUN may use locally bound `thread' variable, which will |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2643 be the value of 'gdb-thread property of the current line. If |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2644 'gdb-thread is nil, error is signaled." |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2645 `(defun ,name (&optional event) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2646 ,(when doc doc) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2647 (interactive) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2648 (if event (posn-set-point (event-end event))) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2649 (save-excursion |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2650 (beginning-of-line) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2651 (let ((thread (get-text-property (point) 'gdb-thread))) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2652 (if thread |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2653 ,custom-defun |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2654 (error "Not recognized as thread line")))))) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2655 |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2656 (defmacro def-gdb-thread-buffer-simple-command (name buffer-command &optional doc) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2657 "Define a NAME which will call BUFFER-COMMAND with id of thread |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2658 on the current line." |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2659 `(def-gdb-thread-buffer-command ,name |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2660 (,buffer-command (gdb-get-field thread 'id)) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2661 ,doc)) |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2662 |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2663 (def-gdb-thread-buffer-command gdb-select-thread |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2664 (let ((new-id (gdb-get-field thread 'id))) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2665 (gdb-setq-thread-number new-id) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2666 (gdb-input (list (concat "-thread-select " new-id) 'ignore)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2667 (gdb-update)) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2668 "Select the thread at current line of threads buffer.") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2669 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2670 (def-gdb-thread-buffer-simple-command |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2671 gdb-display-stack-for-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2672 gdb-preemptively-display-stack-buffer |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2673 "Display stack buffer for the thread at current line.") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2674 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2675 (def-gdb-thread-buffer-simple-command |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2676 gdb-display-locals-for-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2677 gdb-preemptively-display-locals-buffer |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2678 "Display locals buffer for the thread at current line.") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2679 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2680 (def-gdb-thread-buffer-simple-command |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2681 gdb-display-registers-for-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2682 gdb-preemptively-display-registers-buffer |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2683 "Display registers buffer for the thread at current line.") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2684 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2685 (def-gdb-thread-buffer-simple-command |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2686 gdb-display-disassembly-for-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2687 gdb-preemptively-display-disassembly-buffer |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2688 "Display disassembly buffer for the thread at current line.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2689 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2690 (def-gdb-thread-buffer-simple-command |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2691 gdb-frame-stack-for-thread |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2692 gdb-frame-stack-buffer |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2693 "Display a new frame with stack buffer for the thread at |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2694 current line.") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2695 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2696 (def-gdb-thread-buffer-simple-command |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2697 gdb-frame-locals-for-thread |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2698 gdb-frame-locals-buffer |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2699 "Display a new frame with locals buffer for the thread at |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2700 current line.") |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2701 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2702 (def-gdb-thread-buffer-simple-command |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2703 gdb-frame-registers-for-thread |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2704 gdb-frame-registers-buffer |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2705 "Display a new frame with registers buffer for the thread at |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
2706 current line.") |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2707 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2708 (def-gdb-thread-buffer-simple-command |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2709 gdb-frame-disassembly-for-thread |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2710 gdb-frame-disassembly-buffer |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2711 "Display a new frame with disassembly buffer for the thread at |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2712 current line.") |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
2713 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2714 (defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2715 "Define a NAME which will execute GUD-COMMAND with |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2716 `gdb-thread-number' locally bound to id of thread on the current |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2717 line." |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2718 `(def-gdb-thread-buffer-command ,name |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2719 (if gdb-non-stop |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2720 (let ((gdb-thread-number (gdb-get-field thread 'id)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2721 (gdb-gud-control-all-threads nil)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2722 (call-interactively #',gud-command)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2723 (error "Available in non-stop mode only, customize gdb-non-stop-setting.")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2724 ,doc)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2725 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2726 (def-gdb-thread-buffer-gud-command |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2727 gdb-interrupt-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2728 gud-stop-subjob |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2729 "Interrupt thread at current line.") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2730 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2731 (def-gdb-thread-buffer-gud-command |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2732 gdb-continue-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2733 gud-cont |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2734 "Continue thread at current line.") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2735 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2736 (def-gdb-thread-buffer-gud-command |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2737 gdb-step-thread |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2738 gud-step |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2739 "Step thread at current line.") |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2740 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2741 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2742 ;;; Memory view |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2743 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2744 (defcustom gdb-memory-rows 8 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2745 "Number of data rows in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2746 :type 'integer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2747 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2748 :version "23.2") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2749 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2750 (defcustom gdb-memory-columns 4 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2751 "Number of data columns in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2752 :type 'integer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2753 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2754 :version "23.2") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2755 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2756 (defcustom gdb-memory-format "x" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2757 "Display format of data items in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2758 :type '(choice (const :tag "Hexadecimal" "x") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2759 (const :tag "Signed decimal" "d") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2760 (const :tag "Unsigned decimal" "u") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2761 (const :tag "Octal" "o") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2762 (const :tag "Binary" "t")) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2763 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2764 :version "22.1") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2765 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2766 (defcustom gdb-memory-unit 4 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2767 "Unit size of data items in memory window." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2768 :type '(choice (const :tag "Byte" 1) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2769 (const :tag "Halfword" 2) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2770 (const :tag "Word" 4) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2771 (const :tag "Giant word" 8)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2772 :group 'gud |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2773 :version "23.2") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2774 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2775 (def-gdb-trigger-and-handler |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2776 gdb-invalidate-memory |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
2777 (format "-data-read-memory %s %s %d %d %d" |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2778 gdb-memory-address |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2779 gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2780 gdb-memory-unit |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2781 gdb-memory-rows |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2782 gdb-memory-columns) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2783 gdb-read-memory-handler |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
2784 gdb-read-memory-custom |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
2785 '(start update)) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2786 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2787 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2788 'gdb-memory-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2789 'gdb-memory-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2790 'gdb-memory-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2791 'gdb-invalidate-memory) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
2792 |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2793 (defun gdb-memory-column-width (size format) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2794 "Return length of string with memory unit of SIZE in FORMAT. |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2795 |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2796 SIZE is in bytes, as in `gdb-memory-unit'. FORMAT is a string as |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2797 in `gdb-memory-format'." |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2798 (let ((format-base (cdr (assoc format |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2799 '(("x" . 16) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2800 ("d" . 10) ("u" . 10) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2801 ("o" . 8) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2802 ("t" . 2)))))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2803 (if format-base |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2804 (let ((res (ceiling (log (expt 2.0 (* size 8)) format-base)))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2805 (cond ((string-equal format "x") |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2806 (+ 2 res)) ; hexadecimal numbers have 0x in front |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2807 ((or (string-equal format "d") |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2808 (string-equal format "o")) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2809 (1+ res)) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2810 (t res))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2811 (error "Unknown format")))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2812 |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2813 (defun gdb-read-memory-custom () |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
2814 (let* ((res (gdb-json-partial-output)) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2815 (err-msg (gdb-get-field res 'msg))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2816 (if (not err-msg) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2817 (let ((memory (gdb-get-field res 'memory))) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2818 (setq gdb-memory-address (gdb-get-field res 'addr)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2819 (setq gdb-memory-next-page (gdb-get-field res 'next-page)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2820 (setq gdb-memory-prev-page (gdb-get-field res 'prev-page)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2821 (setq gdb-memory-last-address gdb-memory-address) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2822 (dolist (row memory) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2823 (insert (concat (gdb-get-field row 'addr) ":")) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2824 (dolist (column (gdb-get-field row 'data)) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2825 (insert (gdb-pad-string column |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2826 (+ 2 (gdb-memory-column-width |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2827 gdb-memory-unit |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
2828 gdb-memory-format))))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2829 (newline))) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
2830 ;; Show last page instead of empty buffer when out of bounds |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2831 (progn |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2832 (let ((gdb-memory-address gdb-memory-last-address)) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
2833 (gdb-invalidate-memory 'update) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2834 (error err-msg)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2835 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2836 (defvar gdb-memory-mode-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2837 (let ((map (make-sparse-keymap))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2838 (suppress-keymap map t) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2839 (define-key map "q" 'kill-this-buffer) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2840 (define-key map "n" 'gdb-memory-show-next-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2841 (define-key map "p" 'gdb-memory-show-previous-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2842 (define-key map "a" 'gdb-memory-set-address) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2843 (define-key map "t" 'gdb-memory-format-binary) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2844 (define-key map "o" 'gdb-memory-format-octal) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2845 (define-key map "u" 'gdb-memory-format-unsigned) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2846 (define-key map "d" 'gdb-memory-format-signed) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2847 (define-key map "x" 'gdb-memory-format-hexadecimal) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2848 (define-key map "b" 'gdb-memory-unit-byte) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2849 (define-key map "h" 'gdb-memory-unit-halfword) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2850 (define-key map "w" 'gdb-memory-unit-word) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2851 (define-key map "g" 'gdb-memory-unit-giant) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2852 (define-key map "R" 'gdb-memory-set-rows) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2853 (define-key map "C" 'gdb-memory-set-columns) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2854 map)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2855 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2856 (defun gdb-memory-set-address-event (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2857 "Handle a click on address field in memory buffer header." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2858 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2859 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2860 (select-window (posn-window (event-start event))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2861 (gdb-memory-set-address))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2862 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2863 ;; Non-event version for use within keymap |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2864 (defun gdb-memory-set-address () |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2865 "Set the start memory address." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
2866 (interactive) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2867 (let ((arg (read-from-minibuffer "Memory address: "))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2868 (setq gdb-memory-address arg)) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
2869 (gdb-invalidate-memory 'update)) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2870 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2871 (defmacro def-gdb-set-positive-number (name variable echo-string &optional doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2872 "Define a function NAME which reads new VAR value from minibuffer." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2873 `(defun ,name (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2874 ,(when doc doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2875 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2876 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2877 (select-window (posn-window (event-start event))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2878 (let* ((arg (read-from-minibuffer ,echo-string)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2879 (count (string-to-number arg))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2880 (if (<= count 0) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2881 (error "Positive number only") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2882 (customize-set-variable ',variable count) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
2883 (gdb-invalidate-memory 'update)))))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2884 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2885 (def-gdb-set-positive-number |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2886 gdb-memory-set-rows |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2887 gdb-memory-rows |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2888 "Rows: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2889 "Set the number of data rows in memory window.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2890 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2891 (def-gdb-set-positive-number |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2892 gdb-memory-set-columns |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2893 gdb-memory-columns |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2894 "Columns: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2895 "Set the number of data columns in memory window.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2896 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2897 (defmacro def-gdb-memory-format (name format doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2898 "Define a function NAME to switch memory buffer to use FORMAT. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2899 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2900 DOC is an optional documentation string." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2901 `(defun ,name () ,(when doc doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2902 (interactive) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2903 (customize-set-variable 'gdb-memory-format ,format) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
2904 (gdb-invalidate-memory 'update))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2905 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2906 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2907 gdb-memory-format-binary "t" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2908 "Set the display format to binary.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2909 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2910 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2911 gdb-memory-format-octal "o" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2912 "Set the display format to octal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2913 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2914 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2915 gdb-memory-format-unsigned "u" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2916 "Set the display format to unsigned decimal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2917 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2918 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2919 gdb-memory-format-signed "d" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2920 "Set the display format to decimal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2921 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2922 (def-gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2923 gdb-memory-format-hexadecimal "x" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2924 "Set the display format to hexadecimal.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2925 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2926 (defvar gdb-memory-format-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2927 (let ((map (make-sparse-keymap))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2928 (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2929 map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2930 "Keymap to select format in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2931 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2932 (defvar gdb-memory-format-menu (make-sparse-keymap "Format") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2933 "Menu of display formats in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2934 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2935 (define-key gdb-memory-format-menu [binary] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2936 '(menu-item "Binary" gdb-memory-format-binary |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2937 :button (:radio . (equal gdb-memory-format "t")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2938 (define-key gdb-memory-format-menu [octal] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2939 '(menu-item "Octal" gdb-memory-format-octal |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2940 :button (:radio . (equal gdb-memory-format "o")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2941 (define-key gdb-memory-format-menu [unsigned] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2942 '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2943 :button (:radio . (equal gdb-memory-format "u")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2944 (define-key gdb-memory-format-menu [signed] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2945 '(menu-item "Signed Decimal" gdb-memory-format-signed |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2946 :button (:radio . (equal gdb-memory-format "d")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2947 (define-key gdb-memory-format-menu [hexadecimal] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2948 '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2949 :button (:radio . (equal gdb-memory-format "x")))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2950 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2951 (defun gdb-memory-format-menu (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2952 (interactive "@e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2953 (x-popup-menu event gdb-memory-format-menu)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2954 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2955 (defun gdb-memory-format-menu-1 (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2956 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2957 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2958 (select-window (posn-window (event-start event))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2959 (let* ((selection (gdb-memory-format-menu event)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2960 (binding (and selection (lookup-key gdb-memory-format-menu |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2961 (vector (car selection)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2962 (if binding (call-interactively binding))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2963 |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2964 (defmacro def-gdb-memory-unit (name unit-size doc) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2965 "Define a function NAME to switch memory unit size to UNIT-SIZE. |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2966 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2967 DOC is an optional documentation string." |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2968 `(defun ,name () ,(when doc doc) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2969 (interactive) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2970 (customize-set-variable 'gdb-memory-unit ,unit-size) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
2971 (gdb-invalidate-memory 'update))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2972 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2973 (def-gdb-memory-unit gdb-memory-unit-giant 8 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2974 "Set the unit size to giant words (eight bytes).") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2975 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2976 (def-gdb-memory-unit gdb-memory-unit-word 4 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2977 "Set the unit size to words (four bytes).") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2978 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2979 (def-gdb-memory-unit gdb-memory-unit-halfword 2 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2980 "Set the unit size to halfwords (two bytes).") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2981 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2982 (def-gdb-memory-unit gdb-memory-unit-byte 1 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
2983 "Set the unit size to bytes.") |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2984 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2985 (defmacro def-gdb-memory-show-page (name address-var &optional doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2986 "Define a function NAME which show new address in memory buffer. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2987 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2988 The defined function switches Memory buffer to show address |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2989 stored in ADDRESS-VAR variable. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2990 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2991 DOC is an optional documentation string." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2992 `(defun ,name |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2993 ,(when doc doc) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2994 (interactive) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2995 (let ((gdb-memory-address ,address-var)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2996 (gdb-invalidate-memory)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2997 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2998 (def-gdb-memory-show-page gdb-memory-show-previous-page |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
2999 gdb-memory-prev-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3000 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3001 (def-gdb-memory-show-page gdb-memory-show-next-page |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3002 gdb-memory-next-page) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3003 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3004 (defvar gdb-memory-unit-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3005 (let ((map (make-sparse-keymap))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3006 (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3007 map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3008 "Keymap to select units in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3009 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3010 (defvar gdb-memory-unit-menu (make-sparse-keymap "Unit") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3011 "Menu of units in the header line.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3012 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3013 (define-key gdb-memory-unit-menu [giantwords] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3014 '(menu-item "Giant words" gdb-memory-unit-giant |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3015 :button (:radio . (equal gdb-memory-unit 8)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3016 (define-key gdb-memory-unit-menu [words] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3017 '(menu-item "Words" gdb-memory-unit-word |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3018 :button (:radio . (equal gdb-memory-unit 4)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3019 (define-key gdb-memory-unit-menu [halfwords] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3020 '(menu-item "Halfwords" gdb-memory-unit-halfword |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3021 :button (:radio . (equal gdb-memory-unit 2)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3022 (define-key gdb-memory-unit-menu [bytes] |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3023 '(menu-item "Bytes" gdb-memory-unit-byte |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3024 :button (:radio . (equal gdb-memory-unit 1)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3025 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3026 (defun gdb-memory-unit-menu (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3027 (interactive "@e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3028 (x-popup-menu event gdb-memory-unit-menu)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3029 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3030 (defun gdb-memory-unit-menu-1 (event) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3031 (interactive "e") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3032 (save-selected-window |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3033 (select-window (posn-window (event-start event))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3034 (let* ((selection (gdb-memory-unit-menu event)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3035 (binding (and selection (lookup-key gdb-memory-unit-menu |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3036 (vector (car selection)))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3037 (if binding (call-interactively binding))))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3038 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3039 (defvar gdb-memory-font-lock-keywords |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3040 '(;; <__function.name+n> |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3041 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3042 ) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3043 "Font lock keywords used in `gdb-memory-mode'.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3044 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3045 (defvar gdb-memory-header |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3046 '(:eval |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3047 (concat |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3048 "Start address[" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3049 (propertize "-" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3050 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3051 'help-echo "mouse-1: decrement address" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3052 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3053 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3054 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3055 #'gdb-memory-show-previous-page)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3056 "|" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3057 (propertize "+" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3058 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3059 'help-echo "mouse-1: increment address" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3060 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3061 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3062 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3063 #'gdb-memory-show-next-page)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3064 "]: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3065 (propertize gdb-memory-address |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3066 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3067 'help-echo "mouse-1: set start address" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3068 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3069 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3070 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3071 #'gdb-memory-set-address-event)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3072 " Rows: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3073 (propertize (number-to-string gdb-memory-rows) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3074 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3075 'help-echo "mouse-1: set number of columns" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3076 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3077 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3078 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3079 #'gdb-memory-set-rows)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3080 " Columns: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3081 (propertize (number-to-string gdb-memory-columns) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3082 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3083 'help-echo "mouse-1: set number of columns" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3084 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3085 'local-map (gdb-make-header-line-mouse-map |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3086 'mouse-1 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3087 #'gdb-memory-set-columns)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3088 " Display Format: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3089 (propertize gdb-memory-format |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3090 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3091 'help-echo "mouse-3: select display format" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3092 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3093 'local-map gdb-memory-format-map) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3094 " Unit Size: " |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3095 (propertize (number-to-string gdb-memory-unit) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3096 'face font-lock-warning-face |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3097 'help-echo "mouse-3: select unit size" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3098 'mouse-face 'mode-line-highlight |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3099 'local-map gdb-memory-unit-map))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3100 "Header line used in `gdb-memory-mode'.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3101 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3102 (define-derived-mode gdb-memory-mode gdb-parent-mode "Memory" |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3103 "Major mode for examining memory. |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3104 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3105 \\{gdb-memory-mode-map}" |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3106 (setq header-line-format gdb-memory-header) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3107 (set (make-local-variable 'font-lock-defaults) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3108 '(gdb-memory-font-lock-keywords)) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3109 (run-mode-hooks 'gdb-memory-mode-hook) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3110 'gdb-invalidate-memory) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3111 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3112 (defun gdb-memory-buffer-name () |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3113 (concat "*memory of " (gdb-get-target-string) "*")) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3114 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3115 (def-gdb-display-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3116 gdb-display-memory-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3117 'gdb-memory-buffer |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3118 "Display memory contents.") |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3119 |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3120 (defun gdb-frame-memory-buffer () |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3121 "Display memory contents in a new frame." |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3122 (interactive) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3123 (let* ((special-display-regexps (append special-display-regexps '(".*"))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3124 (special-display-frame-alist |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3125 `((left-fringe . 0) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3126 (right-fringe . 0) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3127 (width . 83) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3128 ,@gdb-frame-parameters))) |
103748
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3129 (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) |
5a1769adb8af
Port memory buffer from gdb-ui.el
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103563
diff
changeset
|
3130 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3131 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3132 ;;; Disassembly view |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3133 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3134 (defun gdb-disassembly-buffer-name () |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3135 (gdb-current-context-buffer-name |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3136 (concat "disassembly of " (gdb-get-target-string)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3137 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3138 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3139 gdb-display-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3140 'gdb-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3141 "Display disassembly for current stack frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3142 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3143 (def-gdb-preempt-display-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3144 gdb-preemptively-display-disassembly-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3145 'gdb-disassembly-buffer) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3146 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3147 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3148 gdb-frame-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3149 'gdb-disassembly-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3150 "Display disassembly in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3151 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3152 (def-gdb-auto-update-trigger gdb-invalidate-disassembly |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3153 (let* ((frame (gdb-current-buffer-frame)) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3154 (file (gdb-get-field frame 'fullname)) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3155 (line (gdb-get-field frame 'line))) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3156 (when file |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3157 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3158 gdb-disassembly-handler |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3159 ;; We update disassembly only after we have actual frame information |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
3160 ;; about all threads, so no there's `update' signal in this list |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
3161 '(start update-disassembly)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3162 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3163 (def-gdb-auto-update-handler |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3164 gdb-disassembly-handler |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3165 gdb-invalidate-disassembly |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
3166 gdb-disassembly-handler-custom |
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
3167 t) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3168 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3169 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3170 'gdb-disassembly-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3171 'gdb-disassembly-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3172 'gdb-disassembly-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3173 'gdb-invalidate-disassembly) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3174 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3175 (defvar gdb-disassembly-font-lock-keywords |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3176 '(;; <__function.name+n> |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3177 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3178 (1 font-lock-function-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3179 ;; 0xNNNNNNNN <__function.name+n>: opcode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3180 ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3181 (4 font-lock-keyword-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3182 ;; %register(at least i386) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3183 ("%\\sw+" . font-lock-variable-name-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3184 ("^\\(Dump of assembler code for function\\) \\(.+\\):" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3185 (1 font-lock-comment-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3186 (2 font-lock-function-name-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3187 ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3188 "Font lock keywords used in `gdb-disassembly-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3189 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3190 (defvar gdb-disassembly-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3191 ;; TODO |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3192 (let ((map (make-sparse-keymap))) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3193 (suppress-keymap map) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3194 (define-key map "q" 'kill-this-buffer) |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3195 map)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3196 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3197 (define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3198 "Major mode for GDB disassembly information. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3199 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3200 \\{gdb-disassembly-mode-map}" |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3201 ;; TODO Rename overlay variable for disassembly mode |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3202 (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3203 (setq fringes-outside-margins t) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3204 (set (make-local-variable 'gdb-disassembly-position) (make-marker)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3205 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3206 '(gdb-disassembly-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3207 (run-mode-hooks 'gdb-disassembly-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3208 'gdb-invalidate-disassembly) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3209 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3210 (defun gdb-disassembly-handler-custom () |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3211 (let* ((instructions (gdb-get-field (gdb-json-partial-output) 'asm_insns)) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3212 (address (gdb-get-field (gdb-current-buffer-frame) 'addr)) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3213 (pos 1) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3214 (table (make-gdb-table)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3215 (marked-line nil)) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3216 (dolist (instr instructions) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3217 (gdb-table-add-row table |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3218 (list |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3219 (gdb-get-field instr 'address) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3220 (apply 'format `("<%s+%s>:" ,@(gdb-get-many-fields instr 'func-name 'offset))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3221 (gdb-get-field instr 'inst))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3222 (when (string-equal (gdb-get-field instr 'address) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3223 address) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3224 (progn |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3225 (setq marked-line (length (gdb-table-rows table))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3226 (setq fringe-indicator-alist |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3227 (if (string-equal gdb-frame-number "0") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3228 nil |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3229 '((overlay-arrow . hollow-right-triangle))))))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3230 (insert (gdb-table-string table " ")) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3231 (gdb-disassembly-place-breakpoints) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3232 ;; Mark current position with overlay arrow and scroll window to |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3233 ;; that point |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3234 (when marked-line |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3235 (let ((window (get-buffer-window (current-buffer) 0))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3236 (set-window-point window (gdb-mark-line marked-line gdb-disassembly-position)))) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3237 (setq mode-name |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3238 (gdb-current-context-mode-name |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3239 (concat "Disassembly: " |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3240 (gdb-get-field (gdb-current-buffer-frame) 'func)))))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3241 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3242 (defun gdb-disassembly-place-breakpoints () |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3243 (gdb-remove-breakpoint-icons (point-min) (point-max)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3244 (dolist (breakpoint gdb-breakpoints-list) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3245 (let* ((breakpoint (cdr breakpoint)) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3246 (bptno (gdb-get-field breakpoint 'number)) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3247 (flag (gdb-get-field breakpoint 'enabled)) |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3248 (address (gdb-get-field breakpoint 'addr))) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3249 (save-excursion |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3250 (goto-char (point-min)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3251 (if (re-search-forward (concat "^" address) nil t) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3252 (gdb-put-breakpoint-icon (string-equal flag "y") bptno)))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3253 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3254 |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3255 (defvar gdb-breakpoints-header |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3256 (list |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3257 (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3258 nil nil mode-line) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3259 " " |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3260 (gdb-propertize-header "Threads" gdb-threads-buffer |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3261 "mouse-1: select" mode-line-highlight mode-line-inactive))) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3262 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3263 ;;; Breakpoints view |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3264 (define-derived-mode gdb-breakpoints-mode gdb-parent-mode "Breakpoints" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3265 "Major mode for gdb breakpoints. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3266 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3267 \\{gdb-breakpoints-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3268 (setq header-line-format gdb-breakpoints-header) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3269 (run-mode-hooks 'gdb-breakpoints-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3270 'gdb-invalidate-breakpoints) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3271 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3272 (defun gdb-toggle-breakpoint () |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3273 "Enable/disable breakpoint at current line of breakpoints buffer." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3274 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3275 (save-excursion |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3276 (beginning-of-line) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3277 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3278 (if breakpoint |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3279 (gud-basic-call |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3280 (concat (if (string-equal "y" (gdb-get-field breakpoint 'enabled)) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3281 "-break-disable " |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3282 "-break-enable ") |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3283 (gdb-get-field breakpoint 'number))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3284 (error "Not recognized as break/watchpoint line"))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3285 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3286 (defun gdb-delete-breakpoint () |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3287 "Delete the breakpoint at current line of breakpoints buffer." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3288 (interactive) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3289 (save-excursion |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3290 (beginning-of-line) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3291 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3292 (if breakpoint |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3293 (gud-basic-call (concat "-break-delete " (gdb-get-field breakpoint 'number))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3294 (error "Not recognized as break/watchpoint line"))))) |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3295 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3296 (defun gdb-goto-breakpoint (&optional event) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3297 "Go to the location of breakpoint at current line of |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3298 breakpoints buffer." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3299 (interactive (list last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3300 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3301 ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3302 (let ((window (get-buffer-window gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3303 (if window (save-selected-window (select-window window)))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3304 (save-excursion |
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3305 (beginning-of-line) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3306 (let ((breakpoint (get-text-property (point) 'gdb-breakpoint))) |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3307 (if breakpoint |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3308 (let ((bptno (gdb-get-field breakpoint 'number)) |
104104
757c30ed402e
(gdb-goto-breakpoint): Use full path when setting breakpoints.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103955
diff
changeset
|
3309 (file (gdb-get-field breakpoint 'fullname)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3310 (line (gdb-get-field breakpoint 'line))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3311 (save-selected-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3312 (let* ((buffer (find-file-noselect |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3313 (if (file-exists-p file) file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3314 (cdr (assoc bptno gdb-location-alist))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3315 (window (or (gdb-display-source-buffer buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3316 (display-buffer buffer)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3317 (setq gdb-source-window window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3318 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3319 (goto-line (string-to-number line)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3320 (set-window-point window (point)))))) |
103752
dcd3d86fcf81
* progmodes/gdb-mi.el (gdb-init-1): Disassembly buffer mode name
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103751
diff
changeset
|
3321 (error "Not recognized as break/watchpoint line"))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3322 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3323 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3324 ;; Frames buffer. This displays a perpetually correct bactrack trace. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3325 ;; |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3326 (def-gdb-trigger-and-handler |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3327 gdb-invalidate-frames (gdb-current-context-command "-stack-list-frames") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3328 gdb-stack-list-frames-handler gdb-stack-list-frames-custom |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
3329 '(start update)) |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3330 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3331 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3332 'gdb-stack-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3333 'gdb-stack-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3334 'gdb-frames-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3335 'gdb-invalidate-frames) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3336 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3337 (defun gdb-frame-location (frame) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3338 "Return \" of file:line\" or \" of library\" for structure FRAME. |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3339 |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3340 FRAME must have either \"file\" and \"line\" members or \"from\" |
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3341 member." |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3342 (let ((file (gdb-get-field frame 'file)) |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
3343 (line (gdb-get-field frame 'line)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
3344 (from (gdb-get-field frame 'from))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3345 (let ((res (or (and file line (concat file ":" line)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3346 from))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3347 (if res (concat " of " res) "")))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3348 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3349 (defun gdb-stack-list-frames-custom () |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3350 (let ((stack (gdb-get-field (gdb-json-partial-output "frame") 'stack)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3351 (table (make-gdb-table))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3352 (set-marker gdb-stack-position nil) |
104150
925e1efc6761
(gdb-rules-name-maker, gdb-rules-buffer-mode)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104149
diff
changeset
|
3353 (dolist (frame stack) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3354 (gdb-table-add-row table |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3355 (list |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3356 (gdb-get-field frame 'level) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3357 "in" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3358 (concat |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3359 (gdb-get-field frame 'func) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3360 (if gdb-stack-buffer-locations |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3361 (gdb-frame-location frame) "") |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3362 (if gdb-stack-buffer-addresses |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3363 (concat " at " (gdb-get-field frame 'addr)) ""))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3364 `(mouse-face highlight |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3365 help-echo "mouse-2, RET: Select frame" |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3366 gdb-frame ,frame))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3367 (insert (gdb-table-string table " "))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3368 (when (and gdb-frame-number |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3369 (gdb-buffer-shows-main-thread-p)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3370 (gdb-mark-line (1+ (string-to-number gdb-frame-number)) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3371 gdb-stack-position)) |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3372 (setq mode-name |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3373 (gdb-current-context-mode-name "Frames"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3374 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3375 (defun gdb-stack-buffer-name () |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3376 (gdb-current-context-buffer-name |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3377 (concat "stack frames of " (gdb-get-target-string)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3378 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3379 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3380 gdb-display-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3381 'gdb-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3382 "Display backtrace of current stack.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3383 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3384 (def-gdb-preempt-display-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3385 gdb-preemptively-display-stack-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3386 'gdb-stack-buffer nil t) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3387 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3388 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3389 gdb-frame-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3390 'gdb-stack-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3391 "Display backtrace of current stack in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3392 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3393 (defvar gdb-frames-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3394 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3395 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3396 (define-key map "q" 'kill-this-buffer) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3397 (define-key map "\r" 'gdb-select-frame) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3398 (define-key map [mouse-2] 'gdb-select-frame) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3399 (define-key map [follow-link] 'mouse-face) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3400 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3401 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3402 (defvar gdb-frames-font-lock-keywords |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3403 '(("in \\([^ ]+\\)" (1 font-lock-function-name-face))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3404 "Font lock keywords used in `gdb-frames-mode'.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3405 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3406 (define-derived-mode gdb-frames-mode gdb-parent-mode "Frames" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3407 "Major mode for gdb call stack. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3408 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3409 \\{gdb-frames-mode-map}" |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3410 (setq gdb-stack-position (make-marker)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3411 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3412 (setq truncate-lines t) ;; Make it easier to see overlay arrow. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3413 (set (make-local-variable 'font-lock-defaults) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3414 '(gdb-frames-font-lock-keywords)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3415 (run-mode-hooks 'gdb-frames-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3416 'gdb-invalidate-frames) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3417 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3418 (defun gdb-select-frame (&optional event) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3419 "Select the frame and display the relevant source." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3420 (interactive (list last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3421 (if event (posn-set-point (event-end event))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3422 (let ((frame (get-text-property (point) 'gdb-frame))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3423 (if frame |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3424 (if (gdb-buffer-shows-main-thread-p) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3425 (let ((new-level (gdb-get-field frame 'level))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3426 (setq gdb-frame-number new-level) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3427 (gdb-input (list (concat "-stack-select-frame " new-level) 'ignore)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3428 (gdb-update)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3429 (error "Could not select frame for non-current thread.")) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3430 (error "Not recognized as frame line")))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3431 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3432 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3433 ;; Locals buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3434 ;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards. |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3435 (def-gdb-trigger-and-handler |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3436 gdb-invalidate-locals |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
3437 (concat (gdb-current-context-command "-stack-list-locals") " --simple-values") |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3438 gdb-locals-handler gdb-locals-handler-custom |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
3439 '(start update)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3440 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3441 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3442 'gdb-locals-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3443 'gdb-locals-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3444 'gdb-locals-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3445 'gdb-invalidate-locals) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3446 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3447 (defvar gdb-locals-watch-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3448 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3449 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3450 (define-key map "\r" 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3451 (define-key map [mouse-2] 'gud-watch) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3452 map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3453 "Keymap to create watch expression of a complex data type local variable.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3454 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3455 (defvar gdb-edit-locals-map-1 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3456 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3457 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3458 (define-key map "\r" 'gdb-edit-locals-value) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3459 (define-key map [mouse-2] 'gdb-edit-locals-value) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3460 map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3461 "Keymap to edit value of a simple data type local variable.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3462 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3463 (defun gdb-edit-locals-value (&optional event) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3464 "Assign a value to a variable displayed in the locals buffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3465 (interactive (list last-input-event)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3466 (save-excursion |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3467 (if event (posn-set-point (event-end event))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3468 (beginning-of-line) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3469 (let* ((var (gdb-get-field |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3470 (get-text-property (point) 'gdb-local-variable) 'name)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3471 (value (read-string (format "New value (%s): " var)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3472 (gud-basic-call |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3473 (concat "-gdb-set variable " var " = " value))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3474 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3475 ;; Dont display values of arrays or structures. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3476 ;; These can be expanded using gud-watch. |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3477 (defun gdb-locals-handler-custom () |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3478 (let ((locals-list (gdb-get-field (gdb-json-partial-output) 'locals)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3479 (table (make-gdb-table))) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3480 (dolist (local locals-list) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3481 (let ((name (gdb-get-field local 'name)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3482 (value (gdb-get-field local 'value)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3483 (type (gdb-get-field local 'type))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3484 (if (or (not value) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3485 (string-match "\\0x" value)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3486 (add-text-properties 0 (length name) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3487 `(mouse-face highlight |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3488 help-echo "mouse-2: create watch expression" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3489 local-map ,gdb-locals-watch-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3490 name) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3491 (add-text-properties 0 (length value) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3492 `(mouse-face highlight |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3493 help-echo "mouse-2: edit value" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3494 local-map ,gdb-edit-locals-map-1) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3495 value)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3496 (gdb-table-add-row |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3497 table |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3498 (list |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3499 (propertize type 'font-lock-face font-lock-type-face) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3500 (propertize name 'font-lock-face font-lock-variable-name-face) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3501 value) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3502 `(gdb-local-variable ,local)))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3503 (insert (gdb-table-string table " ")) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3504 (setq mode-name |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3505 (gdb-current-context-mode-name |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3506 (concat "Locals: " (gdb-get-field (gdb-current-buffer-frame) 'func)))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3507 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3508 (defvar gdb-locals-header |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3509 (list |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3510 (gdb-propertize-header "Locals" gdb-locals-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3511 nil nil mode-line) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3512 " " |
103759
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3513 (gdb-propertize-header "Registers" gdb-registers-buffer |
b4080ae429fb
(gdb-init-1): Move sending
Nick Roberts <nickrob@snap.net.nz>
parents:
103755
diff
changeset
|
3514 "mouse-1: select" mode-line-highlight mode-line-inactive))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3515 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3516 (defvar gdb-locals-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3517 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3518 (suppress-keymap map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3519 (define-key map "q" 'kill-this-buffer) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3520 (define-key map "\t" '(lambda () |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3521 (interactive) |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3522 (gdb-set-window-buffer |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3523 (gdb-get-buffer-create |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3524 'gdb-registers-buffer |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3525 gdb-thread-number) t))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3526 map)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3527 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3528 (define-derived-mode gdb-locals-mode gdb-parent-mode "Locals" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3529 "Major mode for gdb locals. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3530 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3531 \\{gdb-locals-mode-map}" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3532 (setq header-line-format gdb-locals-header) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3533 (run-mode-hooks 'gdb-locals-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3534 'gdb-invalidate-locals) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3535 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3536 (defun gdb-locals-buffer-name () |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3537 (gdb-current-context-buffer-name |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3538 (concat "locals of " (gdb-get-target-string)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3539 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3540 (def-gdb-display-buffer |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3541 gdb-display-locals-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3542 'gdb-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3543 "Display local variables of current stack and their values.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3544 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3545 (def-gdb-preempt-display-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3546 gdb-preemptively-display-locals-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3547 'gdb-locals-buffer nil t) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3548 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3549 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3550 gdb-frame-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3551 'gdb-locals-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3552 "Display local variables of current stack and their values in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3553 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3554 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3555 ;; Registers buffer. |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3556 |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3557 (def-gdb-trigger-and-handler |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3558 gdb-invalidate-registers |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
3559 (concat (gdb-current-context-command "-data-list-register-values") " x") |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3560 gdb-registers-handler |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3561 gdb-registers-handler-custom |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
3562 '(start update)) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3563 |
104147
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3564 (gdb-set-buffer-rules |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3565 'gdb-registers-buffer |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3566 'gdb-registers-buffer-name |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3567 'gdb-registers-mode |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3568 'gdb-invalidate-registers) |
9629847b09ed
(gdb-get-buffer, gdb-get-buffer-create, gdb-init-1)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104146
diff
changeset
|
3569 |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3570 (defun gdb-registers-handler-custom () |
104234
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3571 (when gdb-register-names |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3572 (let ((register-values (gdb-get-field (gdb-json-partial-output) 'register-values)) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3573 (table (make-gdb-table))) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3574 (dolist (register register-values) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3575 (let* ((register-number (gdb-get-field register 'number)) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3576 (value (gdb-get-field register 'value)) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3577 (register-name (nth (string-to-number register-number) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3578 gdb-register-names))) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3579 (gdb-table-add-row |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3580 table |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3581 (list |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3582 (propertize register-name 'font-lock-face font-lock-variable-name-face) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3583 (if (member register-number gdb-changed-registers) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3584 (propertize value 'font-lock-face font-lock-warning-face) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3585 value)) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3586 `(mouse-face highlight |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3587 help-echo "mouse-2: edit value" |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3588 gdb-register-name ,register-name)))) |
e2940cb3d84e
(gdb): Send -target-detach when buffer is killed (#3794).
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104233
diff
changeset
|
3589 (insert (gdb-table-string table " "))) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3590 (setq mode-name |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3591 (gdb-current-context-mode-name "Registers")))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3592 |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3593 (defun gdb-edit-register-value (&optional event) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3594 "Assign a value to a register displayed in the registers buffer." |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3595 (interactive (list last-input-event)) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3596 (save-excursion |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3597 (if event (posn-set-point (event-end event))) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3598 (beginning-of-line) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3599 (let* ((var (gdb-get-field |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3600 (get-text-property (point) 'gdb-register-name))) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3601 (value (read-string (format "New value (%s): " var)))) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3602 (gud-basic-call |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3603 (concat "-gdb-set variable $" var " = " value))))) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3604 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3605 (defvar gdb-registers-mode-map |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3606 (let ((map (make-sparse-keymap))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3607 (suppress-keymap map) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3608 (define-key map "\r" 'gdb-edit-register-value) |
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3609 (define-key map [mouse-2] 'gdb-edit-register-value) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3610 (define-key map "q" 'kill-this-buffer) |
104205
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3611 (define-key map "\t" '(lambda () |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3612 (interactive) |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3613 (gdb-set-window-buffer |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3614 (gdb-get-buffer-create |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3615 'gdb-locals-buffer |
a67a0dcd448d
(gdb-breakpoints-mode-map): Don't assume threads buffer is present.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104203
diff
changeset
|
3616 gdb-thread-number) t))) |
104203
6deae7f783dc
(gdb-read-memory-custom)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104166
diff
changeset
|
3617 map)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3618 |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3619 (defvar gdb-registers-header |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3620 (list |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3621 (gdb-propertize-header "Locals" gdb-locals-buffer |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3622 "mouse-1: select" mode-line-highlight mode-line-inactive) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3623 " " |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3624 (gdb-propertize-header "Registers" gdb-registers-buffer |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3625 nil nil mode-line))) |
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3626 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3627 (define-derived-mode gdb-registers-mode gdb-parent-mode "Registers" |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3628 "Major mode for gdb registers. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3629 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3630 \\{gdb-registers-mode-map}" |
104166
71fb0a824791
(gdb-var-create-regexp): Removed.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104155
diff
changeset
|
3631 (setq header-line-format gdb-registers-header) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3632 (run-mode-hooks 'gdb-registers-mode-hook) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3633 'gdb-invalidate-registers) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3634 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3635 (defun gdb-registers-buffer-name () |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3636 (gdb-current-context-buffer-name |
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3637 (concat "registers of " (gdb-get-target-string)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3638 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3639 (def-gdb-display-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3640 gdb-display-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3641 'gdb-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3642 "Display integer register contents.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3643 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3644 (def-gdb-preempt-display-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3645 gdb-preemptively-display-registers-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3646 'gdb-registers-buffer nil t) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3647 |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3648 (def-gdb-frame-for-buffer |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3649 gdb-frame-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3650 'gdb-registers-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3651 "Display integer register contents in a new frame.") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3652 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3653 ;; Needs GDB 6.4 onwards (used to fail with no stack). |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3654 (defun gdb-get-changed-registers () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3655 (if (and (gdb-get-buffer 'gdb-registers-buffer) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3656 (not (gdb-pending-p 'gdb-get-changed-registers))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3657 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3658 (gdb-input |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3659 (list |
103755
a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103754
diff
changeset
|
3660 "-data-list-changed-registers" |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3661 'gdb-changed-registers-handler)) |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3662 (gdb-add-pending 'gdb-get-changed-registers)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3663 |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3664 (defun gdb-changed-registers-handler () |
104148
3bbb840267e1
(gdb-add-pending, gdb-pending-p, gdb-delete-pending): Macros to
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104147
diff
changeset
|
3665 (gdb-delete-pending 'gdb-get-changed-registers) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3666 (setq gdb-changed-registers nil) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3667 (dolist (register-number (gdb-get-field (gdb-json-partial-output) 'changed-registers)) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3668 (push register-number gdb-changed-registers))) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3669 |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3670 (defun gdb-register-names-handler () |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3671 ;; Don't use gdb-pending-triggers because this handler is called |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3672 ;; only once (in gdb-init-1) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3673 (setq gdb-register-names nil) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3674 (dolist (register-name (gdb-get-field (gdb-json-partial-output) 'register-names)) |
104146
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3675 (push register-name gdb-register-names)) |
907e635649e5
* progmodes/gdb-mi.el (gdb-breakpoints-buffer-name)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104145
diff
changeset
|
3676 (setq gdb-register-names (reverse gdb-register-names))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3677 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3678 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3679 (defun gdb-get-source-file-list () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3680 "Create list of source files for current GDB session. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3681 If buffers already exist for any of these files, gud-minor-mode |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3682 is set in them." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3683 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3684 (while (re-search-forward gdb-source-file-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3685 (push (match-string 1) gdb-source-file-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3686 (dolist (buffer (buffer-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3687 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3688 (when (member buffer-file-name gdb-source-file-list) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3689 (gdb-init-buffer)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3690 (gdb-force-mode-line-update |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3691 (propertize "ready" 'face font-lock-variable-name-face))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3692 |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3693 (defun gdb-get-main-selected-frame () |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3694 "Trigger for `gdb-frame-handler' which uses main current |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3695 thread. Called from `gdb-update'." |
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3696 (if (not (gdb-pending-p 'gdb-get-main-selected-frame)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3697 (progn |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3698 (gdb-input |
104145
ff7110a449a4
(gdb-thread-number): New variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104115
diff
changeset
|
3699 (list (gdb-current-context-command "-stack-info-frame") 'gdb-frame-handler)) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3700 (gdb-add-pending 'gdb-get-main-selected-frame)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3701 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3702 (defun gdb-frame-handler () |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3703 "Sets `gdb-selected-frame' and `gdb-selected-file' to show |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3704 overlay arrow in source buffer." |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3705 (gdb-delete-pending 'gdb-get-main-selected-frame) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3706 (let ((frame (gdb-get-field (gdb-json-partial-output) 'frame))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3707 (when frame |
103749
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
3708 (setq gdb-selected-frame (gdb-get-field frame 'func)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
3709 (setq gdb-selected-file (gdb-get-field frame 'fullname)) |
f3eef698a354
gdb-mi.el: Now using bindat-get-field instead of fadr functions.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103748
diff
changeset
|
3710 (let ((line (gdb-get-field frame 'line))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3711 (setq gdb-selected-line (or (and line (string-to-number line)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3712 nil)) ; don't fail if line is nil |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3713 (when line ; obey the current file only if we have line info |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3714 (setq gud-last-frame (cons gdb-selected-file gdb-selected-line)) |
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3715 (gud-display-frame))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3716 (if gud-overlay-arrow-position |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3717 (let ((buffer (marker-buffer gud-overlay-arrow-position)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3718 (position (marker-position gud-overlay-arrow-position))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3719 (when buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3720 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3721 (setq fringe-indicator-alist |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3722 (if (string-equal gdb-frame-number "0") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3723 nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3724 '((overlay-arrow . hollow-right-triangle)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3725 (setq gud-overlay-arrow-position (make-marker)) |
104149
da5e764f0af8
(gdb-pc-address): Removed unused variable.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104148
diff
changeset
|
3726 (set-marker gud-overlay-arrow-position position)))))))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3727 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3728 (defvar gdb-prompt-name-regexp "value=\"\\(.*?\\)\"") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3729 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3730 (defun gdb-get-prompt () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3731 "Find prompt for GDB session." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3732 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3733 (setq gdb-prompt-name nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3734 (re-search-forward gdb-prompt-name-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3735 (setq gdb-prompt-name (match-string 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3736 ;; Insert first prompt. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3737 (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3738 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3739 ;;;; Window management |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3740 (defun gdb-display-buffer (buf dedicated &optional frame) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3741 "Show buffer BUF. |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3742 |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3743 If BUF is already displayed in some window, show it, deiconifying |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3744 the frame if necessary. Otherwise, find least recently used |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3745 window and show BUF there, if the window is not used for GDB |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3746 already, in which case that window is splitted first." |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3747 (let ((answer (get-buffer-window buf (or frame 0)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3748 (if answer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3749 (display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3750 (let ((window (get-lru-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3751 (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3752 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3753 (let* ((largest (get-largest-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3754 (cur-size (window-height largest))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3755 (setq answer (split-window largest)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3756 (set-window-buffer answer buf) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3757 (set-window-dedicated-p answer dedicated) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3758 answer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3759 (set-window-buffer window buf) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3760 window))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3761 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3762 (defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3763 "Find window displaying a buffer with the same |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3764 `gdb-buffer-type' as BUF and show BUF there. If no such window |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3765 exists, just call `gdb-display-buffer' for BUF. If the window |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3766 found is already dedicated, split window according to |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3767 SPLIT-HORIZONTAL and show BUF in the new window." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3768 (if buf |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3769 (when (not (get-buffer-window buf)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3770 (let* ((buf-type (gdb-buffer-type buf)) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3771 (existing-window |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3772 (get-window-with-predicate |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3773 #'(lambda (w) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3774 (and (eq buf-type |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3775 (gdb-buffer-type (window-buffer w))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3776 (not (window-dedicated-p w))))))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3777 (if existing-window |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3778 (set-window-buffer existing-window buf) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3779 (let ((dedicated-window |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3780 (get-window-with-predicate |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3781 #'(lambda (w) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3782 (eq buf-type |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3783 (gdb-buffer-type (window-buffer w))))))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3784 (if dedicated-window |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3785 (set-window-buffer |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3786 (split-window dedicated-window nil split-horizontal) buf) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3787 (gdb-display-buffer buf t)))))) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3788 (error "Null buffer"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3789 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3790 ;;; Shared keymap initialization: |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3791 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3792 (let ((menu (make-sparse-keymap "GDB-Windows"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3793 (define-key gud-menu-map [displays] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3794 `(menu-item "GDB-Windows" ,menu |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3795 :visible (eq gud-minor-mode 'gdbmi))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3796 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3797 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3798 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3799 (define-key menu [disassembly] |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3800 '("Disassembly" . gdb-display-disassembly-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3801 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3802 (define-key menu [inferior] |
103779
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
3803 '("Separate IO" . gdb-display-separate-io-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3804 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3805 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3806 (define-key menu [breakpoints] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3807 '("Breakpoints" . gdb-display-breakpoints-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3808 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3809 (let ((menu (make-sparse-keymap "GDB-Frames"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3810 (define-key gud-menu-map [frames] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3811 `(menu-item "GDB-Frames" ,menu |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3812 :visible (eq gud-minor-mode 'gdbmi))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3813 (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3814 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) |
103751
47e338b0e07b
* progmodes/gdb-mi.el (gdb-init-1): Set correct mode name for
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
103749
diff
changeset
|
3815 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) |
103522
b9003818f4a3
Pull further modified changes from Dmitry's repository (http://sphinx.net.ru/hg/gdb-mi/).
Nick Roberts <nickrob@snap.net.nz>
parents:
103504
diff
changeset
|
3816 (define-key menu [disassembly] '("Disassembly" . gdb-frame-disassembly-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3817 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3818 (define-key menu [inferior] |
103779
d8f620ade0dc
(gdb): Remove description of
Nick Roberts <nickrob@snap.net.nz>
parents:
103759
diff
changeset
|
3819 '("Separate IO" . gdb-frame-separate-io-buffer)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3820 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3821 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3822 (define-key menu [breakpoints] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3823 '("Breakpoints" . gdb-frame-breakpoints-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3824 |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3825 (let ((menu (make-sparse-keymap "GDB-MI"))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3826 (define-key menu [gdb-customize] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3827 '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3828 :help "Customize Gdb Graphical Mode options.")) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3829 (define-key menu [gdb-many-windows] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3830 '(menu-item "Display Other Windows" gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3831 :help "Toggle display of locals, stack and breakpoint information" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3832 :button (:toggle . gdb-many-windows))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3833 (define-key menu [gdb-restore-windows] |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3834 '(menu-item "Restore Window Layout" gdb-restore-windows |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3835 :help "Restore standard layout for debug session.")) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3836 (define-key menu [sep1] |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3837 '(menu-item "--")) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3838 (define-key menu [all-threads] |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3839 '(menu-item "GUD controls all threads" |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3840 (lambda () |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3841 (interactive) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3842 (setq gdb-gud-control-all-threads t)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3843 :help "GUD start/stop commands apply to all threads" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3844 :button (:radio . gdb-gud-control-all-threads))) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3845 (define-key menu [current-thread] |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3846 '(menu-item "GUD controls current thread" |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3847 (lambda () |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3848 (interactive) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3849 (setq gdb-gud-control-all-threads nil)) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3850 :help "GUD start/stop commands apply to current thread only" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3851 :button (:radio . (not gdb-gud-control-all-threads)))) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3852 (define-key menu [sep2] |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3853 '(menu-item "--")) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3854 (define-key menu [gdb-customize-reasons] |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3855 '(menu-item "Customize switching..." |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3856 (lambda () |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3857 (interactive) |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3858 (customize-option 'gdb-switch-reasons)))) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3859 (define-key menu [gdb-switch-when-another-stopped] |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3860 (menu-bar-make-toggle gdb-toggle-switch-when-another-stopped gdb-switch-when-another-stopped |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3861 "Automatically switch to stopped thread" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3862 "GDB thread switching %s" |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
3863 "Switch to stopped thread")) |
104153
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3864 (define-key gud-menu-map [mi] |
957779ca8cea
* progmodes/gdb-mi.el (gdb-get-buffer, gdb-get-buffer-create):
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104151
diff
changeset
|
3865 `(menu-item "GDB-MI" ,menu :visible (eq gud-minor-mode 'gdbmi)))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3866 |
104211
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3867 ;; TODO Fit these into tool-bar-local-item-from-menu call in gud.el. |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3868 ;; GDB-MI menu will need to be moved to gud.el. We can't use |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3869 ;; tool-bar-local-item-from-menu here because it appends new buttons |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3870 ;; to toolbar from right to left while we want our A/T throttle to |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3871 ;; show up right before Run button. |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3872 (define-key-after gud-tool-bar-map [all-threads] |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3873 '(menu-item "Switch to non-stop/A mode" gdb-control-all-threads |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3874 :image (find-image '((:type xpm :file "gud/thread.xpm"))) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3875 :visible (and (eq gud-minor-mode 'gdbmi) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3876 gdb-non-stop |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3877 (not gdb-gud-control-all-threads))) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3878 'run) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3879 |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3880 (define-key-after gud-tool-bar-map [current-thread] |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3881 '(menu-item "Switch to non-stop/T mode" gdb-control-current-thread |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3882 :image (find-image '((:type xpm :file "gud/all.xpm"))) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3883 :visible (and (eq gud-minor-mode 'gdbmi) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3884 gdb-non-stop |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3885 gdb-gud-control-all-threads)) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3886 'all-threads) |
c911628739b9
(gdb-control-all-threads)
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104205
diff
changeset
|
3887 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3888 (defun gdb-frame-gdb-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3889 "Display GUD buffer in a new frame." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3890 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3891 (let ((special-display-regexps (append special-display-regexps '(".*"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3892 (special-display-frame-alist |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3893 (remove '(menu-bar-lines) (remove '(tool-bar-lines) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3894 gdb-frame-parameters))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3895 (same-window-regexps nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3896 (display-buffer gud-comint-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3897 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3898 (defun gdb-display-gdb-buffer () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3899 "Display GUD buffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3900 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3901 (let ((same-window-regexps nil)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3902 (select-window (display-buffer gud-comint-buffer nil 0)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3903 |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3904 (defun gdb-set-window-buffer (name &optional ignore-dedicated) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3905 "Set buffer of selected window to NAME and dedicate window. |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3906 |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3907 When IGNORE-DEDICATED is non-nil, buffer is set even if selected |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3908 window is dedicated." |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3909 (when ignore-dedicated |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3910 (set-window-dedicated-p (selected-window) nil)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3911 (set-window-buffer (selected-window) (get-buffer name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3912 (set-window-dedicated-p (selected-window) t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3913 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3914 (defun gdb-setup-windows () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3915 "Layout the window pattern for `gdb-many-windows'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3916 (gdb-display-locals-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3917 (gdb-display-stack-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3918 (delete-other-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3919 (gdb-display-breakpoints-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3920 (delete-other-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3921 ; Don't dedicate. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3922 (pop-to-buffer gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3923 (split-window nil ( / ( * (window-height) 3) 4)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3924 (split-window nil ( / (window-height) 3)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3925 (split-window-horizontally) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3926 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3927 (gdb-set-window-buffer (gdb-locals-buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3928 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3929 (switch-to-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3930 (if gud-last-last-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3931 (gud-find-file (car gud-last-last-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3932 (if gdb-main-file |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3933 (gud-find-file gdb-main-file) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3934 ;; Put buffer list in window if we |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3935 ;; can't find a source file. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3936 (list-buffers-noselect)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3937 (setq gdb-source-window (selected-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3938 (when gdb-use-separate-io-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3939 (split-window-horizontally) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3940 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3941 (gdb-set-window-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3942 (gdb-get-buffer-create 'gdb-inferior-io))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3943 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3944 (gdb-set-window-buffer (gdb-stack-buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3945 (split-window-horizontally) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3946 (other-window 1) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3947 (gdb-set-window-buffer (if gdb-show-threads-by-default |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3948 (gdb-threads-buffer-name) |
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
3949 (gdb-breakpoints-buffer-name))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3950 (other-window 1)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3951 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3952 (defcustom gdb-many-windows nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3953 "If nil just pop up the GUD buffer unless `gdb-show-main' is t. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3954 In this case it starts with two windows: one displaying the GUD |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3955 buffer and the other with the source file with the main routine |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3956 of the debugged program. Non-nil means display the layout shown for |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3957 `gdb'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3958 :type 'boolean |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3959 :group 'gdb |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3960 :version "22.1") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3961 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3962 (defun gdb-many-windows (arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3963 "Toggle the number of windows in the basic arrangement. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3964 With arg, display additional buffers iff arg is positive." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3965 (interactive "P") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3966 (setq gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3967 (if (null arg) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3968 (not gdb-many-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3969 (> (prefix-numeric-value arg) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3970 (message (format "Display of other windows %sabled" |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3971 (if gdb-many-windows "en" "dis"))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3972 (if (and gud-comint-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3973 (buffer-name gud-comint-buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3974 (condition-case nil |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3975 (gdb-restore-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3976 (error nil)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3977 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3978 (defun gdb-restore-windows () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3979 "Restore the basic arrangement of windows used by gdb. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3980 This arrangement depends on the value of `gdb-many-windows'." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3981 (interactive) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3982 (pop-to-buffer gud-comint-buffer) ;Select the right window and frame. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3983 (delete-other-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3984 (if gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3985 (gdb-setup-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3986 (when (or gud-last-last-frame gdb-show-main) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3987 (split-window) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3988 (other-window 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3989 (switch-to-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3990 (if gud-last-last-frame |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3991 (gud-find-file (car gud-last-last-frame)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3992 (gud-find-file gdb-main-file))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3993 (setq gdb-source-window (selected-window)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3994 (other-window 1)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3995 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3996 (defun gdb-reset () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3997 "Exit a debugging session cleanly. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3998 Kills the gdb buffers, and resets variables and the source buffers." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
3999 (dolist (buffer (buffer-list)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4000 (unless (eq buffer gud-comint-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4001 (with-current-buffer buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4002 (if (eq gud-minor-mode 'gdbmi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4003 (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4004 (kill-buffer nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4005 (gdb-remove-breakpoint-icons (point-min) (point-max) t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4006 (setq gud-minor-mode nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4007 (kill-local-variable 'tool-bar-map) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4008 (kill-local-variable 'gdb-define-alist)))))) |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
4009 (setq gdb-disassembly-position nil) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4010 (setq overlay-arrow-variable-list |
104155
87373993f3bd
* progmodes/gdb-mi.el (gdb-frame-number): Initialize with nil.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104153
diff
changeset
|
4011 (delq 'gdb-disassembly-position overlay-arrow-variable-list)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4012 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4013 (setq gdb-stack-position nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4014 (setq overlay-arrow-variable-list |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4015 (delq 'gdb-stack-position overlay-arrow-variable-list)) |
104151
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
4016 (setq gdb-thread-position nil) |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
4017 (setq overlay-arrow-variable-list |
22070e4cdf2a
* progmodes/gud.el (gud-stop-subjob, gud-menu-map): Respect GDB
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104150
diff
changeset
|
4018 (delq 'gdb-thread-position overlay-arrow-variable-list)) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4019 (if (boundp 'speedbar-frame) (speedbar-timer-fn)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4020 (setq gud-running nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4021 (setq gdb-active-process nil) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4022 (remove-hook 'after-save-hook 'gdb-create-define-alist t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4023 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4024 (defun gdb-get-source-file () |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4025 "Find the source file where the program starts and display it with related |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4026 buffers, if required." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4027 (goto-char (point-min)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4028 (if (re-search-forward gdb-source-file-regexp nil t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4029 (setq gdb-main-file (match-string 1))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4030 (if gdb-many-windows |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4031 (gdb-setup-windows) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4032 (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4033 (if gdb-show-main |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4034 (let ((pop-up-windows t)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4035 (display-buffer (gud-find-file gdb-main-file)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4036 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4037 ;;from put-image |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4038 (defun gdb-put-string (putstring pos &optional dprop &rest sprops) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4039 "Put string PUTSTRING in front of POS in the current buffer. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4040 PUTSTRING is displayed by putting an overlay into the current buffer with a |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4041 `before-string' string that has a `display' property whose value is |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4042 PUTSTRING." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4043 (let ((string (make-string 1 ?x)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4044 (buffer (current-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4045 (setq putstring (copy-sequence putstring)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4046 (let ((overlay (make-overlay pos pos buffer)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4047 (prop (or dprop |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4048 (list (list 'margin 'left-margin) putstring)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4049 (put-text-property 0 1 'display prop string) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4050 (if sprops |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4051 (add-text-properties 0 1 sprops string)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4052 (overlay-put overlay 'put-break t) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4053 (overlay-put overlay 'before-string string)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4054 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4055 ;;from remove-images |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4056 (defun gdb-remove-strings (start end &optional buffer) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4057 "Remove strings between START and END in BUFFER. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4058 Remove only strings that were put in BUFFER with calls to `gdb-put-string'. |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4059 BUFFER nil or omitted means use the current buffer." |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4060 (unless buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4061 (setq buffer (current-buffer))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4062 (dolist (overlay (overlays-in start end)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4063 (when (overlay-get overlay 'put-break) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4064 (delete-overlay overlay)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4065 |
104233
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
4066 (defun gdb-put-breakpoint-icon (enabled bptno &optional line) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
4067 (let* ((posns (gdb-line-posns (or line (line-number-at-pos)))) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
4068 (start (- (car posns) 1)) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
4069 (end (+ (cdr posns) 1)) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
4070 (putstring (if enabled "B" "b")) |
fbce43fef5e3
(gdb-line-posns): New helper which helps not to use `goto-line'.
Dmitry Dzhus <dima@sphinx.net.ru>
parents:
104232
diff
changeset
|
4071 (source-window (get-buffer-window (current-buffer) 0))) |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4072 (add-text-properties |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4073 0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt") |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4074 putstring) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4075 (if enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4076 (add-text-properties |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4077 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4078 (add-text-properties |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4079 0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4080 (gdb-remove-breakpoint-icons start end) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4081 (if (display-images-p) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4082 (if (>= (or left-fringe-width |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4083 (if source-window (car (window-fringes source-window))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4084 gdb-buffer-fringe-width) 8) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4085 (gdb-put-string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4086 nil (1+ start) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4087 `(left-fringe breakpoint |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4088 ,(if enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4089 'breakpoint-enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4090 'breakpoint-disabled)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4091 'gdb-bptno bptno |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4092 'gdb-enabled enabled) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4093 (when (< left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4094 (save-current-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4095 (setq left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4096 (if source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4097 (set-window-margins |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4098 source-window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4099 left-margin-width right-margin-width)))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4100 (put-image |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4101 (if enabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4102 (or breakpoint-enabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4103 (setq breakpoint-enabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4104 (find-image `((:type xpm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4105 ,breakpoint-xpm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4106 :ascent 100 :pointer hand) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4107 (:type pbm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4108 ,breakpoint-enabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4109 :ascent 100 :pointer hand))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4110 (or breakpoint-disabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4111 (setq breakpoint-disabled-icon |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4112 (find-image `((:type xpm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4113 ,breakpoint-xpm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4114 :conversion disabled |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4115 :ascent 100 :pointer hand) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4116 (:type pbm :data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4117 ,breakpoint-disabled-pbm-data |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4118 :ascent 100 :pointer hand)))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4119 (+ start 1) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4120 putstring |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4121 'left-margin)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4122 (when (< left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4123 (save-current-buffer |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4124 (setq left-margin-width 2) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4125 (let ((window (get-buffer-window (current-buffer) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4126 (if window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4127 (set-window-margins |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4128 window left-margin-width right-margin-width))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4129 (gdb-put-string |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4130 (propertize putstring |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4131 'face (if enabled 'breakpoint-enabled 'breakpoint-disabled)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4132 (1+ start))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4133 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4134 (defun gdb-remove-breakpoint-icons (start end &optional remove-margin) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4135 (gdb-remove-strings start end) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4136 (if (display-images-p) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4137 (remove-images start end)) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4138 (when remove-margin |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4139 (setq left-margin-width 0) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4140 (let ((window (get-buffer-window (current-buffer) 0))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4141 (if window |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4142 (set-window-margins |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4143 window left-margin-width right-margin-width))))) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4144 |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4145 (provide 'gdb-mi) |
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4146 |
103554 | 4147 ;; arch-tag: 1b41ea2b-f364-4cec-8f35-e02e4fe01912 |
103504
b2b747edcf7e
* progmodes/gdb-ui.el: Replace with ...
Nick Roberts <nickrob@snap.net.nz>
parents:
diff
changeset
|
4148 ;;; gdb-mi.el ends here |