Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ee1f1da9
Commit
ee1f1da9
authored
Oct 27, 2011
by
Stefan Monnier
Browse files
* lisp/progmodes/gdb-mi.el: Warn the user when -i=mi is missing.
(gdb--check-interpreter): New function. (gdb): Use it.
parent
44b0122f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
17 deletions
+35
-17
lisp/ChangeLog
lisp/ChangeLog
+8
-2
lisp/progmodes/gdb-mi.el
lisp/progmodes/gdb-mi.el
+27
-15
No files found.
lisp/ChangeLog
View file @
ee1f1da9
2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/gdb-mi.el: Warn the user when -i=mi is missing.
(gdb--check-interpreter): New function.
(gdb): Use it.
2011-10-27 Glenn Morris <rgm@gnu.org>
2011-10-27 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-extra.el (most-positive-float, most-negative-float)
* emacs-lisp/cl-extra.el (most-positive-float, most-negative-float)
...
@@ -21,8 +27,8 @@
...
@@ -21,8 +27,8 @@
* subr.el (change-major-mode-after-body-hook): New hook.
* subr.el (change-major-mode-after-body-hook): New hook.
(run-mode-hooks): Run it.
(run-mode-hooks): Run it.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Use
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
change-major-mode-before-body-hook.
Use
change-major-mode-before-body-hook.
* simple.el (fundamental-mode):
* simple.el (fundamental-mode):
* emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28
* emacs-lisp/derived.el (define-derived-mode): Revert 2010-04-28
...
...
lisp/progmodes/gdb-mi.el
View file @
ee1f1da9
...
@@ -43,21 +43,10 @@
...
@@ -43,21 +43,10 @@
;; M-x gdb will start the debugger.
;; M-x gdb will start the debugger.
;; This file uses GDB/MI as the primary interface to GDB. It is still under
;; This file uses GDB/MI as the primary interface to GDB. It runs gdb with
;; development and is part of a process to migrate Emacs from annotations (as
;; GDB/MI (-interp=mi) and access CLI using "-interpreter-exec console
;; used in gdb-ui.el) to GDB/MI. It runs gdb with GDB/MI (-interp=mi) and
;; cli-command". This code works without gdb-ui.el and uses MI tokens instead
;; access CLI using "-interpreter-exec console cli-command". This code works
;; of queues. Eventually MI should be asynchronous.
;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI
;; should be asynchronous.
;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline
;; doesn't update properly when execution commands are issued from GUD buffer)
;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on.
;;
;; You need development version of GDB 7.0 for the thread buffer to work.
;; This file replaces gdb-ui.el and is for development with GDB. Use the
;; release branch of Emacs 22 for the latest version of gdb-ui.el.
;; Windows Platforms:
;; Windows Platforms:
...
@@ -599,6 +588,22 @@ NOARG must be t when this macro is used outside `gud-def'"
...
@@ -599,6 +588,22 @@ NOARG must be t when this macro is used outside `gud-def'"
(
concat
(
gdb-gud-context-command
,
cmd1
,
noall
)
" "
,
cmd2
)
(
concat
(
gdb-gud-context-command
,
cmd1
,
noall
)
" "
,
cmd2
)
,
(
when
(
not
noarg
)
'arg
)))
,
(
when
(
not
noarg
)
'arg
)))
(
defun
gdb--check-interpreter
(
proc
string
)
(
unless
(
zerop
(
length
string
))
(
let
((
filter
(
process-get
proc
'gud-normal-filter
)))
(
set-process-filter
proc
filter
)
(
unless
(
memq
(
aref
string
0
)
'
(
?^
?~
?@
?&
?*
?=
))
;; Apparently we're not running with -i=mi.
(
let
((
msg
"Error: you did not specify -i=mi on GDB's command line!"
))
(
message
msg
)
(
setq
string
(
concat
(
propertize
msg
'font-lock-face
'error
)
"\n"
string
)))
;; Use the old gud-gbd filter, not because it works, but because it
;; will properly display GDB's answers rather than hanging waiting for
;; answers that aren't coming.
(
set
(
make-local-variable
'gud-marker-filter
)
#'
gud-gdb-marker-filter
))
(
funcall
filter
proc
string
))))
;;;###autoload
;;;###autoload
(
defun
gdb
(
command-line
)
(
defun
gdb
(
command-line
)
"Run gdb on program FILE in buffer *gud-FILE*.
"Run gdb on program FILE in buffer *gud-FILE*.
...
@@ -665,6 +670,13 @@ detailed description of this mode.
...
@@ -665,6 +670,13 @@ detailed description of this mode.
"Multiple debugging requires restarting in text command mode"
))
"Multiple debugging requires restarting in text command mode"
))
;;
;;
(
gud-common-init
command-line
nil
'gud-gdbmi-marker-filter
)
(
gud-common-init
command-line
nil
'gud-gdbmi-marker-filter
)
;; Setup a temporary process filter to warn when GDB was not started
;; with -i=mi.
(
let
((
proc
(
get-buffer-process
gud-comint-buffer
)))
(
process-put
proc
'gud-normal-filter
(
process-filter
proc
))
(
set-process-filter
proc
#'
gdb--check-interpreter
))
(
set
(
make-local-variable
'gud-minor-mode
)
'gdbmi
)
(
set
(
make-local-variable
'gud-minor-mode
)
'gdbmi
)
(
setq
comint-input-sender
'gdb-send
)
(
setq
comint-input-sender
'gdb-send
)
(
when
(
ring-empty-p
comint-input-ring
)
; cf shell-mode
(
when
(
ring-empty-p
comint-input-ring
)
; cf shell-mode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment