From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: gdba probs Date: Wed, 11 Dec 2002 17:48:27 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200212112248.gBBMmR406249@rum.cs.yale.edu> References: <15855.47556.171128.631234@nick.uklinux.net> <200212052149.gB5LnZ504967@rum.cs.yale.edu> <15857.24365.637778.876009@nick.uklinux.net> <200212101419.gBAEJnf31571@rum.cs.yale.edu> <15862.30022.647969.267154@nick.uklinux.net> <200212111411.gBBEBUn03805@rum.cs.yale.edu> <15863.48069.658013.465668@nick.uklinux.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1039648179 10231 80.91.224.249 (11 Dec 2002 23:09:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2002 23:09:39 +0000 (UTC) Cc: Stefan Monnier Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18MFyy-0002ej-00 for ; Thu, 12 Dec 2002 00:09:36 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18MGAE-0001e4-00 for ; Thu, 12 Dec 2002 00:21:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18MFtg-000121-04 for emacs-devel@quimby.gnus.org; Wed, 11 Dec 2002 18:04:08 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18MFtE-0000xA-00 for emacs-devel@gnu.org; Wed, 11 Dec 2002 18:03:40 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18MFtB-0000vm-00 for emacs-devel@gnu.org; Wed, 11 Dec 2002 18:03:38 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18MFeX-0005fA-00 for emacs-devel@gnu.org; Wed, 11 Dec 2002 17:48:29 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id gBBMmR406249; Wed, 11 Dec 2002 17:48:27 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Nick Roberts Original-cc: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10074 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10074 > > > I feel like it must be possible to have a single filter deal with both cases. > > The worst case would be to have a `gud-gdb-undecided-marker-filer' which > > would call either one of the two filters or could even replace itself with > > the appropriate filter once it has determined which case it's dealing with. > > How about : > > --- gud.el.~1.169.~ Wed Dec 11 18:41:06 2002 > +++ gud.el Wed Dec 11 22:16:45 2002 > @@ -85,6 +85,8 @@ > (let ((sym (gud-symbol sym t minor-mode))) > (if (boundp sym) (symbol-value sym)))) > > +(defvar gud-first-time) This construction is probably better left for the dynamic-binding and the defined-elsewhere cases. Just use (defvar gud-first-time nil) instead. > (defvar gud-running nil > "Non-nil if debuggee is running. > Used to grey out relevant toolbar icons.") > @@ -453,6 +455,7 @@ > and source-file directory for your debugger." > (interactive (list (gud-query-cmdline 'gdb))) > > + (setq gud-first-time t) > (gud-common-init command-line nil 'gud-gdb-marker-filter) > (set (make-local-variable 'gud-minor-mode) 'gdb) I don't see why we need to change something to the generic part of GUD. > @@ -2344,6 +2347,42 @@ > > (defun gud-filter (proc string) > ;; Here's where the actual buffer insertion is done > + (when (and gud-first-time (string-match > + "\n\032\032[a-z]" string)) What if DBX outputs this same sequence? Clearly, we want this hack to be GDB-specific and should thus put it in GDB's filter. Stefan