[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e4c05b2 208/215: Merge pull request #137 from realgud/gdb-
From: |
Rocky Bernstein |
Subject: |
[elpa] master e4c05b2 208/215: Merge pull request #137 from realgud/gdb-mi-warning |
Date: |
Sat, 30 Jul 2016 14:49:07 +0000 (UTC) |
branch: master
commit e4c05b2f0e4b2420b67974f9b747b16a49ce8570
Merge: 4118834 4862a6f
Author: R. Bernstein <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #137 from realgud/gdb-mi-warning
Warn if gdb --interpreter=mi or -i mi is used
---
realgud/debugger/gdb/core.el | 11 +++++++++--
test/test-gdb-core.el | 30 ++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/realgud/debugger/gdb/core.el b/realgud/debugger/gdb/core.el
index fc819d9..42a16cb 100644
--- a/realgud/debugger/gdb/core.el
+++ b/realgud/debugger/gdb/core.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2015 Free Software Foundation, Inc
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
@@ -54,7 +54,7 @@ ORIG_ARGS should contain a tokenized list of the command line
to run.
We return the a list containing
* the name of the debugger given (e.g. gdb) and its arguments - a list of
strings
-* nil (a placehoder in other routines of this ilk for a debugger
+* nil (a placeholder in other routines of this ilk for a debugger
* the script name and its arguments - list of strings
* whether the annotate or emacs option was given ('-A', '--annotate' or
'--emacs) - a boolean
@@ -79,6 +79,7 @@ Note that path elements have been expanded via
`expand-file-name'.
(gdb-two-args '("x" "-command" "b" "-exec"
"cd" "-pid" "-core" "-directory"
"-annotate"
+ "i" "-interpreter"
"se" "-symbols" "-tty"))
;; gdb doesn't optionsl 2-arg options.
(gdb-opt-two-args '())
@@ -119,6 +120,12 @@ Note that path elements have been expanded via
`expand-file-name'.
((string-match "^--annotate=[0-9]" arg)
(nconc debugger-args (list (pop args) (pop args)) )
(setq annotate-p t))
+ ((string-match "^--interpreter=" arg)
+ (warn "realgud doesn't support the --interpreter option; option
ignored")
+ (setq args (cdr args)))
+ ((equal "-i" arg)
+ (warn "realgud doesn't support the -i option; option ignored")
+ (setq args (cddr args)))
;; path-argument ooptions
((member arg '("-cd" ))
(setq arg (pop args))
diff --git a/test/test-gdb-core.el b/test/test-gdb-core.el
index dfc1a1a..8aabe69 100644
--- a/test/test-gdb-core.el
+++ b/test/test-gdb-core.el
@@ -33,4 +33,34 @@
(realgud:gdb-parse-cmd-args
'("gdb" "-p" "4511")))
+(eval-when-compile
+ (defvar test:warn-save)
+ (defvar last-mess)
+)
+
+(setq test:warn-save (symbol-function 'warn))
+
+(note "Stripping --interpreter=mi option")
+(defun warn (mess &optional args)
+ "Fake realgud:run-process used in testing"
+ (setq last-mess mess)
+ )
+
+(setq last-mess nil)
+(assert-equal '(("gdb" "-p") nil ("1955") nil)
+ (realgud:gdb-parse-cmd-args
+ '("gdb" "--interpreter=mi" "-p" "1955")))
+
+(assert-nil (null last-mess))
+(setq last-mess nil)
+
+(assert-equal '(("gdb" "-p") nil ("1954") nil)
+ (realgud:gdb-parse-cmd-args
+ '("gdb" "-i" "mi" "-p" "1954")))
+
+;; Restore the old value of realgud:run-process
+(assert-nil (null last-mess))
+(fset 'warn test:warn-save)
+
+
(end-tests)
- [elpa] master b71750a 193/215: Relax deleted breakpoint regexp in PDB to support Python 2 and 3, (continued)
- [elpa] master b71750a 193/215: Relax deleted breakpoint regexp in PDB to support Python 2 and 3, Rocky Bernstein, 2016/07/30
- [elpa] master 2f30f42 176/215: Merge pull request #119 from realgud/improve-break-C-u, Rocky Bernstein, 2016/07/30
- [elpa] master cbfa182 203/215: Improve realgud:run-process docstring, Rocky Bernstein, 2016/07/30
- [elpa] master 333a946 104/215: Merge pull request #74 from rocky/ipdb, Rocky Bernstein, 2016/07/30
- [elpa] master 2316417 205/215: Reassign more copyrights to FSF, Rocky Bernstein, 2016/07/30
- [elpa] master 703e087 185/215: Correct cmd capabilities for perldb and trepanjs, Rocky Bernstein, 2016/07/30
- [elpa] master d367cab 196/215: Correct python trepan enable/disable patterns, Rocky Bernstein, 2016/07/30
- [elpa] master 5a84817 178/215: Fix invalid references to realgud:loc-follow, Rocky Bernstein, 2016/07/30
- [elpa] master 8edfb04 215/215: Not needed for elpa, Rocky Bernstein, 2016/07/30
- [elpa] master d97bf08 179/215: Update doc links, Rocky Bernstein, 2016/07/30
- [elpa] master e4c05b2 208/215: Merge pull request #137 from realgud/gdb-mi-warning,
Rocky Bernstein <=
- [elpa] master 78d9901 122/215: Add a "safe mode" setting (on by default), Rocky Bernstein, 2016/07/30
- [elpa] master c49e2b3 204/215: Another small doc change, Rocky Bernstein, 2016/07/30
- [elpa] master 2f8efa3 130/215: Merge pull request #95 from rocky/revert-94-84-fix-autoloads, Rocky Bernstein, 2016/07/30
- [elpa] master 9023ed4 188/215: Confirm on debugger quit., Rocky Bernstein, 2016/07/30
- [elpa] master 703e69c 127/215: Manually generate "recursive" autoloads for subdirectories, Rocky Bernstein, 2016/07/30
- [elpa] master fb3f38b 182/215: A few more link updates (+ small edits in Commentary), Rocky Bernstein, 2016/07/30
- [elpa] master 245ca79 090/215: Redo previous commit handle base-variable determination from debugger name. We now do it via a hash table where entries are set in <debugger>/init.el Cleanup of old code is still needed., Rocky Bernstein, 2016/07/30
- [elpa] master 055dfa0 102/215: Move older, lesser-used debuggers to another repo, Rocky Bernstein, 2016/07/30
- [elpa] master 434e18c 183/215: Update Travis links, Rocky Bernstein, 2016/07/30
- [elpa] master 06ecc45 086/215: Add C-c ! d in a command buffer to get from a debugger location line in, Rocky Bernstein, 2016/07/30