emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs 23.0.0.1 fails parsing gdb output


From: Stefan Monnier
Subject: Re: Emacs 23.0.0.1 fails parsing gdb output
Date: Fri, 13 Jul 2007 11:32:29 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

> How about if we modify "M-x gdb" to invoke gdb-ui if a certain option
> is set?  Whether this option should be on or off by default, is
> another matter, but at least users will be able to control what UI
> they get by flipping a single option.

Yes, I suggest the following:

- introduce a new custom var with three values (one for --fullname, one for
  --annotate=3 and one for auto-detect, this last one being the default).
- get rid of the `gdba' name.
- improve `gdb's autodetection by checking the command provided for
  "--fullname" or "--annotate=3" (this may fail if the command just runs
  a script, so we still need the current autodetection).
- change default gud-gdb-command-name depending on gud-gdb-annotations.

See below a sample patch (very much *not intended for use as is*) that
hopefully makes my suggestion more clear.


        Stefan


--- orig/lisp/progmodes/gud.el
+++ mod/lisp/progmodes/gud.el
@@ -592,7 +592,15 @@
 ;; History of argument lists passed to gdb.
 (defvar gud-gdb-history nil)
 
-(defcustom gud-gdb-command-name "gdb --annotate=3"
+(defcustom gud-gdb-annotations nil
+  "Level of sophistication of interfacing with GDB."
+  :type '(choice (const :tag "Auto-detect" nil)
+                 (const :tag "Old style" 2)
+                 (const :tag "Modern" 3)))
+
+(defcustom gud-gdb-command-name
+  (concat "gdb "
+          (if (eq gud-gdb-annotations 2) "--fullname" "--annotate=3"))
   "Default command to execute an executable under the GDB debugger."
    :type 'string
    :group 'gud)
@@ -728,6 +736,12 @@
 session."
   (interactive (list (gud-query-cmdline 'gdb)))
 
+  (if (case gud-gdb-annotations
+        (2 nil)
+        (nil (string-match "--annotate=3" command-line))
+        (t t))
+      (gdba command-line)
+
   (when (and gud-comint-buffer
           (buffer-name gud-comint-buffer)
           (get-buffer-process gud-comint-buffer)
@@ -770,7 +784,7 @@
   (setq paragraph-start comint-prompt-regexp)
   (setq gdb-first-prompt t)
   (setq gud-filter-pending-text nil)
-  (run-hooks 'gdb-mode-hook))
+  (run-hooks 'gdb-mode-hook)))
 
 ;; One of the nice features of GDB is its impressive support for
 ;; context-sensitive command completion.  We preserve that feature




reply via email to

[Prev in Thread] Current Thread [Next in Thread]