This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA/TESTSUITE] annota1.exp fixes
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: David Carlton <carlton at math dot stanford dot edu>
- Cc: Elena Zannoni <ezannoni at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Mon, 7 Jul 2003 11:44:05 -0400
- Subject: Re: [RFA/TESTSUITE] annota1.exp fixes
- References: <16019.21217.67067.495012@localhost.redhat.com><ro1wui3h8h2.fsf@jackfruit.Stanford.EDU><16021.43826.706488.188589@localhost.redhat.com><ro1of3edrbu.fsf@jackfruit.Stanford.EDU>
David Carlton writes:
> On Thu, 10 Apr 2003 13:34:42 -0400, Elena Zannoni <ezannoni@redhat.com> said:
>
> > Hmm, I've reread the threads and I am none the wiser. We didn't ask the
> > emacs people, like Eli suggested.
>
> No. :-(
>
> > 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.
>
> It's not the end of the world if my problem never gets solved: I'm
> used to seeing those failures, after all. It's a strange situation:
> my srcdir is just '.', so ${srcdir}/${subdir}/${srcfile} really is
> equivalent to ${subdir}/${srcfile}, GCC is just noticing that it can
> leave out the './' at the start when generating debug info. (I'm
> pretty sure I checked at the time and made sure that it's GCC that's
> getting rid of the './', not GDB.)
>
> So I'm happy enough with your patch; on the other hand, it will cause
> Kevin to start seeing failures with the IRIX compiler again, if I'm
> reading it right. How about this as a compromise: file a GDB external
> suspended PR mentioning that some compilers don't always put full path
> names in the debug info, have a pass branch with your new regexp, and
> have an xfail branch associated to that PR with your original more
> generous regexp? (I'm not sure we do this in the testsuite anywhere
> yet, but my understanding is that xfail takes an optional second
> argument, which is a PR number.) I think that's a good compromise:
> the test should remain useful, because if GDB ever regresses on this
> issue then presumably somebody will notice a pass->xfail transition.
> And we'll only be saying 'pass' in situations where we're sure we're
> doing the right thing.
>
> David Carlton
> carlton@math.stanford.edu
[some old mail....]
I'll commit tomorrow.
elena
2003-07-07 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/annota1.exp: Make sure that we properly escape the
full path of the source file. Xfail more permissive patterns,
due to a compiler debug info problem.
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 7 Jul 2003 15:23:25 -0000
@@ -1,4 +1,4 @@
-# Copyright 1999, 2000, 2001, 2002
+# Copyright 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -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,8 +120,11 @@ 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 "\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 .*${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \
+ { setup_xfail "*-*-*" 1270
+ fail "breakpoint info"}
-re ".*$gdb_prompt$" { fail "breakpoint info" }
timeout { fail "breakpoint info (timeout)" }
}
@@ -247,8 +255,11 @@ 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 "\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.*${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$" \
+ { setup_xfail "*-*-*" 1270
+ fail "backtrace from shlibrary" }
-re ".*$gdb_prompt$" { fail "backtrace from shlibrary" }
timeout { fail "backtrace from shlibrary (timeout)" }
}
@@ -263,8 +274,11 @@ 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 "\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.*${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$" \
+ { setup_xfail "*-*-*" 1270
+ fail "send SIGUSR1" }
-re ".*$gdb_prompt$" { fail "send SIGUSR1" }
timeout { fail "send SIGUSR1 (timeout)" }
}
@@ -322,8 +336,11 @@ 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 "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file .*${srcfile}, line $main_line.*$gdb_prompt$" \
+ { setup_xfail "*-*-*" 1270
+ fail "break at 28" }
-re ".*$gdb_prompt$" { fail "break at 28" }
timeout { fail "break at 28 (timeout)" }
}