196 |
:group 'gud |
:group 'gud |
197 |
:version "22.1") |
:version "22.1") |
198 |
|
|
199 |
(defcustom gdb-cpp-define-alist-program "gcc -E -dM -" |
(defcustom gdb-cpp-define-alist-program |
200 |
|
(cond ((eq system-type 'ms-dos) "gcc -E -dM -o - -") |
201 |
|
(t "gcc -E -dM -")) |
202 |
"The program name for generating an alist of #define directives. |
"The program name for generating an alist of #define directives. |
203 |
This list is used to display the #define directive associated |
This list is used to display the #define directive associated |
204 |
with an identifier as a tooltip. It works in a debug session with |
with an identifier as a tooltip. It works in a debug session with |
207 |
:group 'gud |
:group 'gud |
208 |
:version "22.1") |
:version "22.1") |
209 |
|
|
210 |
|
(defcustom gdb-cpp-define-alist-flags "" |
211 |
|
"*Preprocessor flags used by `gdb-create-define-alist'." |
212 |
|
:type 'string |
213 |
|
:group 'gud |
214 |
|
:version "22.1") |
215 |
|
|
216 |
(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
217 |
|
|
218 |
(defun gdb-create-define-alist () |
(defun gdb-create-define-alist () |
219 |
|
"Create an alist of #define directives for GUD tooltips." |
220 |
(let* ((file (buffer-file-name)) |
(let* ((file (buffer-file-name)) |
221 |
(output |
(output |
222 |
(with-output-to-string |
(with-output-to-string |
224 |
(call-process shell-file-name |
(call-process shell-file-name |
225 |
(if (file-exists-p file) file nil) |
(if (file-exists-p file) file nil) |
226 |
(list t nil) nil "-c" |
(list t nil) nil "-c" |
227 |
gdb-cpp-define-alist-program)))) |
(concat gdb-cpp-define-alist-program " " |
228 |
|
gdb-cpp-define-alist-flags))))) |
229 |
(define-list (split-string output "\n" t)) |
(define-list (split-string output "\n" t)) |
230 |
(name)) |
(name)) |
231 |
(setq gdb-define-alist nil) |
(setq gdb-define-alist nil) |