From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1704 invoked by alias); 10 Jan 2007 23:11:06 -0000 Received: (qmail 1691 invoked by uid 22791); 10 Jan 2007 23:11:05 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 Jan 2007 23:10:58 +0000 Received: from kahikatea.snap.net.nz (p202-124-124-225.snap.net.nz [202.124.124.225]) by viper.snap.net.nz (Postfix) with ESMTP id 007113D82FB for ; Thu, 11 Jan 2007 12:10:50 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id B79974F6EB; Thu, 11 Jan 2007 12:10:50 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17829.29304.465815.173045@kahikatea.snap.net.nz> Date: Wed, 10 Jan 2007 23:11:00 -0000 To: gdb-patches@sources.redhat.com Subject: [PATCH] Fix mi-basics.exp X-Mailer: VM 7.19 under Emacs 22.0.92.8 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-01/txt/msg00297.txt.bz2 [2nd attempt, I'm not sure where the first post ended up] This is to fix the annoying fails that occur in mi-basics.exp when srcdir is a relative pathname in site.exp. It uses objdir instead of srcdir for the tests which always seems to be an absolute filename, although I don't know where runtest gets its value. If approved, I'll make the same change for mi2-basics.exp. -- Nick http://www.inet.net.nz/~nickrob 2007-01-10 Nick Roberts * gdb.mi/mi-basics.exp (test_dir_specification) (test_path_specification): Use objdir instead of srcdir to always get an absolute filename. *** mi-basics.exp 10 Jan 2007 11:57:17 +1300 1.16 --- mi-basics.exp 10 Jan 2007 23:09:08 +1300 *************** set testfile "basics" *** 42,48 **** set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} set escapedobjdir [string_to_regexp ${objdir}] ! set escapedsrcdir [string_to_regexp ${srcdir}] if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { untested mi-basics.exp --- 42,48 ---- set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} set escapedobjdir [string_to_regexp ${objdir}] ! set envirodir [string_to_regexp ${objdir}/${subdir}] if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { untested mi-basics.exp *************** proc test_breakpoints_deletion {} { *** 150,157 **** proc test_dir_specification {} { global mi_gdb_prompt ! global srcdir global subdir # Add to the search directories, display, then reset back to default # Tests: --- 150,159 ---- proc test_dir_specification {} { global mi_gdb_prompt ! global objdir global subdir + global envirodir + # Add to the search directories, display, then reset back to default # Tests: *************** proc test_dir_specification {} { *** 159,167 **** # -environment-directory # -environment-directory -r ! set envirodir [string_to_regexp ${srcdir}/${subdir}] ! ! mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \ "environment-directory arg operation" --- 161,167 ---- # -environment-directory # -environment-directory -r ! mi_gdb_test "202-environment-directory ${objdir}/${subdir}" \ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \ "environment-directory arg operation" *************** proc test_path_specification {} { *** 198,206 **** global mi_gdb_prompt global orig_path global objdir ! global srcdir global escapedobjdir ! global escapedsrcdir # Add to the path, display, then reset # Tests: --- 198,206 ---- global mi_gdb_prompt global orig_path global objdir ! global subdir global escapedobjdir ! global envirodir # Add to the path, display, then reset # Tests: *************** proc test_path_specification {} { *** 221,233 **** } set orig_path [string_to_regexp ${orig_path}] mi_gdb_test "207-environment-path" \ "207\\\^done,path=\"$orig_path\"" \ "environment-path no-args operation" ! mi_gdb_test "208-environment-path $srcdir $objdir" \ ! "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \ "environment-path dir1 dir2 operation" mi_gdb_test "209-environment-path -r $objdir" \ --- 221,234 ---- } set orig_path [string_to_regexp ${orig_path}] + set pathdir [string_to_regexp ${objdir}/${subdir}] mi_gdb_test "207-environment-path" \ "207\\\^done,path=\"$orig_path\"" \ "environment-path no-args operation" ! mi_gdb_test "208-environment-path $objdir ${objdir}/${subdir}" \ ! "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \ "environment-path dir1 dir2 operation" mi_gdb_test "209-environment-path -r $objdir" \