[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4862a6f 206/215: Warn if gdb --interpreter=mi or -i mi is
From: |
Rocky Bernstein |
Subject: |
[elpa] master 4862a6f 206/215: Warn if gdb --interpreter=mi or -i mi is used |
Date: |
Sat, 30 Jul 2016 14:49:06 +0000 (UTC) |
branch: master
commit 4862a6f2643a7d38dc7c777dacffd0c74ab5098f
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
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 a89d1b2 149/215: Rewrite README, (continued)
- [elpa] master a89d1b2 149/215: Rewrite README, Rocky Bernstein, 2016/07/30
- [elpa] master 90068ea 201/215: Simpler change to previous commit, Rocky Bernstein, 2016/07/30
- [elpa] master 524047e 163/215: Fix file-column-to-string in the presence of composed characters, Rocky Bernstein, 2016/07/30
- [elpa] master 4118834 207/215: Suppress irrelevant compilation warnings, Rocky Bernstein, 2016/07/30
- [elpa] master 0a17ada 079/215: Fix several issues when calling gdb, Fixes #59, Rocky Bernstein, 2016/07/30
- [elpa] master bc1f4ba 194/215: Broaden trepan breakpoint search, Rocky Bernstein, 2016/07/30
- [elpa] master 277e10c 167/215: Merge pull request #113 from rocky/logo, Rocky Bernstein, 2016/07/30
- [elpa] master 7211cc5 192/215: Restart should be a confirm command too., Rocky Bernstein, 2016/07/30
- [elpa] master 32fb382 190/215: Merge pull request #126 from realgud/103-jump, Rocky Bernstein, 2016/07/30
- [elpa] master ba2b69c 202/215: Remove code added by mistake, Rocky Bernstein, 2016/07/30
- [elpa] master 4862a6f 206/215: Warn if gdb --interpreter=mi or -i mi is used,
Rocky Bernstein <=
- [elpa] master 1e257cf 209/215: One more FSF copyright assignment, Rocky Bernstein, 2016/07/30
- [elpa] master ba3b013 103/215: Merge branch 'ipdb' of https://github.com/seanfarley/emacs-dbgr into ipdb, Rocky Bernstein, 2016/07/30
- [elpa] master b405494 191/215: Fill out pdb-remote execution, Rocky Bernstein, 2016/07/30
- [elpa] master 5cc0037 157/215: Improve visibility of breakpoints, Rocky Bernstein, 2016/07/30
- [elpa] master e5a2331 153/215: Handle enable/disable bp status messages - 1st cut, Rocky Bernstein, 2016/07/30
- [elpa] master ec23a09 164/215: Slightly shorten setup instructions in README, Rocky Bernstein, 2016/07/30
- [elpa] master f7947aa 131/215: Rename realgud:prompt-if-{prefix-or-, }safe-mode, Rocky Bernstein, 2016/07/30
- [elpa] master eaae9f1 142/215: Update commentary; e.g. link to debuggers handled, Rocky Bernstein, 2016/07/30
- [elpa] master 7c6fab2 166/215: New RealGUD logo, Rocky Bernstein, 2016/07/30
- [elpa] master cc32bab 200/215: Correct realgud:gdb-pid-associate call, Rocky Bernstein, 2016/07/30