[Top][All Lists]

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

Re: gdb-ui and Mac OS X

From: Stefan Monnier
Subject: Re: gdb-ui and Mac OS X
Date: 28 Mar 2004 13:25:38 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>> frames-invalid
>> DISPLAY = :0.0
>> TERM = dumb
>> Breakpoint 1 at 0x9009ec18
>> Breakpoint 2 at 0xc279c: file xterm.c, line 7781.
>> (gdb) 
>> It looks like the `frames-invalid' was not filtered.

> I've noticed this, intermittently, before. I think its depends on real time
> issues and appears when the frames-invalid annotation is in a different output
> chunk to the first prompt annotation. However, I don't think it is related to
> the problem that follows and it just makes the initial output slightly ugly.

The problem is that it appears in a block without the leading \n.

ELISP> (reverse gud-debug-log)
((gdb . "GNU gdb 5.3-20030128 (Apple version gdb-309) (Thu Dec  4 15:41:30 GMT 
2003)\nCopyright 2003 Free Software Foundation, Inc.\nGDB is free software, 
covered by the GNU General Public License, and you are\nwelcome to change it 
and/or distribute copies of it under certain conditions.\nType \"show copying\" 
to see the conditions.\nThere is absolutely no warranty for GDB.  Type \"show 
warranty\" for details.\nThis GDB was configured as 
 (gdb . "Reading symbols for shared libraries ")
 (gdb . "..")
 (gdb . ".")
 (gdb . ".")
 (gdb . ".......")
 (gdb . ".")
 (gdb . "... done\n\nbreakpoints-invalid\n")
 (gdb . "\n")
 (gdb . "frames-invalid\nDISPLAY = :0.0\nTERM = 
dumb\n\nbreakpoints-invalid\nBreakpoint 1 at 0x9009ec18\n"))

The lone "\n" in the last but one chunk was output immediately, and the
subsequent ^Z^Z doesn't match since the regexp is "\n^Z^Z.*\n" and the
leading \n is now missing.

I've appended the patch I'm currently using.


--- gud.el      -test-02 Mar 2004 22:11:12 -0500        1.17
+++ gud.el      -test-28 Mar 2004 13:24:38 -0500        
@@ -4,7 +4,8 @@
 ;; Maintainer: FSF
 ;; Keywords: unix, tools
-;; Copyright (C) 1992,93,94,95,96,1998,2000,02,2003 Free Software Foundation, 
+;; Copyright (C) 1992,93,94,95,96,1998,2000,02,03,2004
+;;           Free Software Foundation, Inc.
 ;; This file is part of GNU Emacs.
@@ -436,7 +437,9 @@
 (defvar gud-marker-acc "")
 (make-variable-buffer-local 'gud-marker-acc)
+(defvar gud-debug-log nil)
 (defun gud-gdb-marker-filter (string)
+  (push (cons 'gdb string) gud-debug-log)
   (setq gud-marker-acc (concat gud-marker-acc string))
   (let ((output ""))
@@ -477,7 +480,7 @@
     ;; gud-marker-acc until we receive the rest of it. Since we
     ;; know the full marker regexp above failed, it's pretty simple to
     ;; test for marker starts.
-    (if (string-match "\032.*\\'" gud-marker-acc)
+    (if (string-match "\n\\(\032.*\\)?\\'" gud-marker-acc)
          ;; Everything before the potential marker start can be output.
          (setq output (concat output (substring gud-marker-acc
@@ -2416,7 +2419,7 @@
   (if find-file (set (make-local-variable 'gud-find-file) find-file))
   (setq gud-running nil)
   (setq gud-last-last-frame nil)
+  (setq gud-debug-log nil)
   (set-process-filter (get-buffer-process (current-buffer)) 'gud-filter)
   (set-process-sentinel (get-buffer-process (current-buffer)) 'gud-sentinel)
@@ -2466,6 +2469,7 @@
                      (set-marker gud-delete-prompt-marker nil)))
                ;; Save the process output, checking for source file markers.
                (setq output (gud-marker-filter string))
+               (if (string-match "" output) (debug))
                ;; Check for a filename-and-line number.
                ;; Don't display the specified file
                ;; unless (1) point is at or after the position where output 

reply via email to

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