From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13892 invoked by alias); 10 Apr 2003 17:30:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13877 invoked from network); 10 Apr 2003 17:30:22 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 10 Apr 2003 17:30:22 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h3AHUMe05591 for ; Thu, 10 Apr 2003 13:30:22 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3AHUMJ11061 for ; Thu, 10 Apr 2003 13:30:22 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3AHUK626182; Thu, 10 Apr 2003 13:30:20 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id D9E572C43F; Thu, 10 Apr 2003 13:34:42 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16021.43826.706488.188589@localhost.redhat.com> Date: Thu, 10 Apr 2003 17:30:00 -0000 To: David Carlton Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA/TESTSUITE] annota1.exp fixes In-Reply-To: References: <16019.21217.67067.495012@localhost.redhat.com> X-SW-Source: 2003-04/txt/msg00205.txt.bz2 David Carlton writes: > On Tue, 8 Apr 2003 18:53:21 -0400, Elena Zannoni said: > > > The test was too eager in matching the whole path to the source file. > > What's really happening is that it wouldn't match a '+' in the > > directory name. (In RedHat gdb the source directory is named the same > > as the sourceware snapshots i.e. gdb+dejagnu, which now I know not to > > do again). > > For what it's worth, I had another problem with those regexps a while > ago: I'm getting output that included subdir but not srcdir. > (Presumably I'm the only one seeing this because I actually build in > the source directory.) I submitted a patch to allow that; Fernando's > response was that he didn't know if that was allowable output, so we > should check with annotation users to make sure. And nobody ever did > that. > > Your regexps accept the output that I'm seeing. So if we're really > nervous about not wanting to accept my output, then probably your > patches aren't a great idea, and we should instead modify them to > create new variables srcdir-regexp and subdir-regexp (or whatever) > that are regexp-protected, and use them. On the other hand, I'm > inclined to go with your patches: the regexps already accept it if > both srcdir and subdir are missing, so could it really be any worse if > just srcdir is missing? > > By the way, my original message was in a thread titled > "[rfa/testsuite] make annota1 regexps more generous"; see also a > threat titled "[RFA] annota1.exp: Don't require complete pathname in > info break test". > Hmm, I've reread the threads and I am none the wiser. We didn't ask the emacs people, like Eli suggested. I have a revised patch, which works for my problem, but doesn't help you. I was wondering if using something like matching on (${longversion}|${shortversion}) would work. Index: annota1.exp =================================================================== RCS file: /cvs/uberbaum/gdb/testsuite/gdb.base/annota1.exp,v retrieving revision 1.11 diff -u -p -r1.11 annota1.exp --- annota1.exp 28 Sep 2002 01:12:04 -0000 1.11 +++ annota1.exp 10 Apr 2003 17:27:39 -0000 @@ -87,6 +87,11 @@ gdb_test "break main" \ set old_gdb_prompt $gdb_prompt set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n" +# +# Escape all the characters in the path that need it. For instance +# the directory name could contain '+'. +# +set escapedsrcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}] # @@ -115,7 +120,7 @@ gdb_expect { # send_gdb "info break\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex +\r\n\032\032field 5\r\nin main at (${srcdir}/${subdir}/)?${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex +\r\n\032\032field 5\r\nin main at ${escapedsrcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \ {pass "breakpoint info"} -re ".*$gdb_prompt$" { fail "breakpoint info" } timeout { fail "breakpoint info (timeout)" } @@ -247,7 +252,7 @@ gdb_expect { # send_gdb "backtrace\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" \ { pass "backtrace from shlibrary" } -re ".*$gdb_prompt$" { fail "backtrace from shlibrary" } timeout { fail "backtrace from shlibrary (timeout)" } @@ -263,7 +268,7 @@ gdb_expect { # send_gdb "signal SIGUSR1\n" gdb_expect { - -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${escapedsrcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "send SIGUSR1" } -re ".*$gdb_prompt$" { fail "send SIGUSR1" } timeout { fail "send SIGUSR1 (timeout)" } @@ -322,7 +327,7 @@ gdb_expect { # send_gdb "break main\n" gdb_expect { - -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file ${srcdir}/${subdir}/${srcfile}, line $main_line.*$gdb_prompt$" \ + -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file ${escapedsrcfile}, line $main_line.*$gdb_prompt$" \ { pass "break at 28" } -re ".*$gdb_prompt$" { fail "break at 28" } timeout { fail "break at 28 (timeout)" }