From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13514 invoked by alias); 14 Jul 2007 01:25:44 -0000 Received: (qmail 13505 invoked by uid 22791); 14 Jul 2007 01:25:43 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 14 Jul 2007 01:25:40 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l6E1PcdS014351 for ; Fri, 13 Jul 2007 21:25:38 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6E1PcR4010316 for ; Fri, 13 Jul 2007 21:25:38 -0400 Received: from ironwood.lan (vpn-15-55.rdu.redhat.com [10.11.15.55]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l6E1PbRw030645 for ; Fri, 13 Jul 2007 21:25:37 -0400 Date: Sat, 14 Jul 2007 01:41:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: [RFC] Add another "Are you sure..." case to gdb_unload in lib/gdb.exp Message-ID: <20070713182535.3af63443@ironwood.lan> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.10.4; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00209.txt.bz2 During my recent testing of a mep-elf toolchain, I ran across a problem in gdb.base/opaque.exp (and perhaps some other tests too) in which GDB asks "Are you sure you want to change the file?" The test machinery is not expecting this message from GDB and ends up getting hopelessly confused. Here's a bit of the log file from gdb.base/opaque.exp which demonstrates this confusion: (gdb) PASS: gdb.base/opaque.exp: ptype on opaque struct tagname (statically) dir Reinitialize source path to empty? (y or n) y Source directories searched: $cdir:$cwd (gdb) dir /ironwood1/toshmep-070403-branch/mep-elf/bld/../../devo/gdb/testsuite/ gdb.base Source directories searched: /ironwood1/toshmep-070403-branch/mep-elf/bld/../../devo/gdb/testsuite/gdb.base:$cdir:$cwd (gdb) file A program is being debugged already. Are you sure you want to change the file? (y or n) ERROR: couldn't unload file in /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/../../gdb/gdb (timed out). kill Please answer y or n. A program is being debugged already. Are you sure you want to change the file? (y or n) file /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/gdb.base/opaque Please answer y or n. A program is being debugged already. Are you sure you want to change the file? (y or n) ERROR: couldn't load /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/gdb.base/opaque into /ironwood1/toshmep-070403-branch/mep-elf/bld/gdb/testsuite/../../gdb/gdb (timed out). delete breakpoints Please answer y or n. A program is being debugged already. Are you sure you want to change the file? (y or n) ERROR: Delete all breakpoints in delete_breakpoints (timeout) break main Please answer y or n. A program is being debugged already. Are you sure you want to change the file? (y or n) UNRESOLVED: gdb.base/opaque.exp: setting breakpoint at main (timeout) ERROR: cannot run to breakpoint at main ERROR: Got interactive prompt. UNRESOLVED: gdb.base/opaque.exp: whatis on opaque struct pointer (dynamically) ERROR: Got interactive prompt. ... My patch below adds a suitable case to gdb_unload in lib/gdb.exp. Comments? * lib/gdb.exp (gdb_unload): Add case which checks for GDB's "Are you sure you want to change the file?" message. Index: ./testsuite/lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.83 diff -u -p -r1.83 gdb.exp --- ./testsuite/lib/gdb.exp 2 Jul 2007 21:29:28 -0000 1.83 +++ ./testsuite/lib/gdb.exp 14 Jul 2007 01:11:25 -0000 @@ -133,6 +133,11 @@ proc gdb_unload {} { verbose "\t\tKilling previous program being debugged" exp_continue } + -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\ + { send_gdb "y\n" + verbose "\t\tChanging the file being debugged" + exp_continue + } -re "Discard symbol table from .*y or n.*$" { send_gdb "y\n" exp_continue