From patchwork Tue Jun 10 12:13:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 1414 Received: (qmail 32261 invoked by alias); 10 Jun 2014 12:13:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32251 invoked by uid 89); 10 Jun 2014 12:13:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Jun 2014 12:13:55 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WuKw4-0004EI-EZ from Luis_Gustavo@mentor.com for gdb-patches@sourceware.org; Tue, 10 Jun 2014 05:13:52 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 10 Jun 2014 05:13:52 -0700 Received: from [172.30.5.156] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Tue, 10 Jun 2014 05:13:51 -0700 Message-ID: <5396F67D.9080203@codesourcery.com> Date: Tue, 10 Jun 2014 13:13:49 +0100 From: Luis Machado Reply-To: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "'gdb-patches@sourceware.org'" Subject: [PATCH, testsuite] Adjust gdb.base/maint.exp for Windows hosts X-IsSubscribed: yes Hi, Last year changes to gdb.base/maint.exp seem to have caused a few failures for Windows testing. The first issue is the output of "maint set per-command". On Linux hosts, it looks like this: (top-gdb) maint set per-command off Command execution time: 0.000000 (cpu), 0.000070 (wall) Space used: 10321920 (+0 for this command) #symtabs: 492 (+0), #primary symtabs: 3 (+0), #blocks: 253 (+0) On Windows hosts, it looks like this: (gdb) maint set per-command off Command execution time: 0.000000 (cpu), 0.000000 (wall) #symtabs: 0 (+0), #primary symtabs: 0 (+0), #blocks: 0 (+0) The space summary isn't displayed because Windows hosts don't have HAVE_SBRK defined. Other systems that don't define the same constant will also run into pattern matching problems here. That pattern needs to be optional then. The second problem is the attempt to use GDB's 'shell' command to invoke various tools that may not be available on Windows hosts, like 'grep', 'ls' and 'rm'. Skipping those file-checking tests seems to be a reasonable solution, since those tests are likely not run on Windows anyway. The following patch accomplishes both of the above solutions. Most of it is identation changes, so i attached a -w version of the patch as well. With the patch applied, i have full passes on both Windows (less tests) and Linux. Thoughts? Does it look OK? Luis 2014-06-10 Luis Machado gdb/testsuite * gdb.base/maint.exp: Prevent testing operations that involve linux tools on targets that do not support them. Make used space pattern optional. diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 64753b7..b588c69 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -46,6 +46,13 @@ # +# Some targets do not support 'ls', 'grep' and 'rm', like Windows. +# Set the flag here so we don't attempt to test things using those tools +# later on. +set linux_tools_supported 1 +if { [ishost *-*-*mingw*] } { + set linux_tools_supported 0 +} standard_testfile break.c break1.c @@ -132,8 +139,11 @@ gdb_test_no_output "maint check-symtabs" gdb_test_no_output "maint set per-command on" +# Information about space used is not available on some targets, like +# Windows. Therefore that pattern is optional in the following regular +# expression. gdb_test "maint set per-command off" \ - "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+#symtabs: $decimal \\(\\+$decimal\\), #primary symtabs: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)" + "Command execution time: \[0-9.\]+ \\(cpu\\), \[0-9.\]+ \\(wall\\)\[\r\n\]+(Space used: $decimal \\(\\+$decimal for this command\\)\[\r\n\]+)?#symtabs: $decimal \\(\\+$decimal\\), #primary symtabs: $decimal \\(\\+$decimal\\), #blocks: $decimal \\(\\+$decimal\\)" gdb_test "maint demangle" \ "\"maintenance demangle\" takes an argument to demangle\\." @@ -218,7 +228,7 @@ gdb_test "maint print psymbols" \ "print-psymbols takes an output file name and optional symbol file name" \ "maint print psymbols w/o args" -if { ! $have_gdb_index } { +if { ! $have_gdb_index && $linux_tools_supported } { set psymbols_output [standard_output_file psymbols_output] send_gdb "maint print psymbols $psymbols_output ${srcdir}/${subdir}/${srcfile}\n" gdb_expect { @@ -259,6 +269,7 @@ gdb_test "maint print msymbols" \ "maint print msymbols w/o args" +if { $linux_tools_supported } { set msymbols_output [standard_output_file msymbols_output] send_gdb "maint print msymbols $msymbols_output ${binfile}\n" gdb_expect { @@ -327,6 +338,7 @@ gdb_test_multiple "maint print msymbols msymbols_output2 ${testfile}" "maint pri gdb_test "cd ${mydir}" \ "Working directory [string_to_regexp ${mydir}]\..*" \ "cd to mydir" +} gdb_test "maint print symbols" \ "Arguments missing: an output file name and an optional symbol file name" \ @@ -337,6 +349,7 @@ gdb_test "maint print symbols" \ # dump the symbol information for the entire C library - over 500MB nowadays # for GNU libc. +if { $linux_tools_supported } { set symbols_output [standard_output_file symbols_output] send_gdb "maint print symbols $symbols_output ${srcdir}/${subdir}/${srcfile}\n" gdb_expect { @@ -363,6 +376,7 @@ gdb_expect { -re ".*$gdb_prompt $" { fail "maint print symbols" } timeout { fail "(timeout) maint print symbols" } } +} set msg "maint print type" gdb_test_multiple "maint print type argc" $msg {