From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26873 invoked by alias); 18 Jun 2013 14:47:45 -0000 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 Received: (qmail 26833 invoked by uid 89); 18 Jun 2013 14:47:45 -0000 X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 18 Jun 2013 14:47:44 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by azsmga101.ch.intel.com with ESMTP; 18 Jun 2013 07:47:41 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 18 Jun 2013 07:48:15 -0700 Received: from ulslx001.iul.intel.com (ulslx001.iul.intel.com [172.28.207.63]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id r5IElcw8027607; Tue, 18 Jun 2013 15:47:38 +0100 Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r5IElbKK004791; Tue, 18 Jun 2013 16:47:37 +0200 Received: (from nblanc@localhost) by ulslx001.iul.intel.com with id r5IElbSD004787; Tue, 18 Jun 2013 16:47:37 +0200 From: Nicolas Blanc To: gdb-patches@sourceware.org, Hafiz_Abid@mentor.com, palves@redhat.com, tromey@redhat.com, eliz@gnu.org, yao@codesourcery.com, lgustavo@codesourcery.com, dje@google.com Cc: nicolas.blanc@intel.com Subject: [patch v9 5/5] Test 'info files' after 'add-symbol-file' and 'remove-symbol-file'. Date: Tue, 18 Jun 2013 14:47:00 -0000 Message-Id: <1371566833-4713-6-git-send-email-nicolas.blanc@intel.com> In-Reply-To: <1371566833-4713-1-git-send-email-nicolas.blanc@intel.com> References: <1371566833-4713-1-git-send-email-nicolas.blanc@intel.com> X-SW-Source: 2013-06/txt/msg00417.txt.bz2 2013-17-06 Nicolas Blanc gdb/testsuite * gdb.base/sym-file.exp: Test 'info files'. Signed-off-by: Nicolas Blanc --- gdb/testsuite/gdb.base/sym-file.exp | 44 ++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp index 873e488..9387b95 100644 --- a/gdb/testsuite/gdb.base/sym-file.exp +++ b/gdb/testsuite/gdb.base/sym-file.exp @@ -17,14 +17,16 @@ # 1) Run to gdb_add_symbol_file in $srcfile. # 2) Set a pending breakpoint at bar in $libsrc. # 3) Load $shlib_name using 'add-symbol-file'. -# 4) Continue to bar in $libsrc. -# 5) Set a breakpoint at foo in $librc. -# 6) Continue to foo in $libsrc. -# 7) Set a breakpoint at gdb_remove_symbol_file. -# 8) Continue to gdb_remove_symbol_file in $srcfile. -# 9) Remove $shlib_name using 'remove-symbol-file'. -# 10) Check that the breakpoints at foo and bar are pending. -# 11) Check that the execution can continue without error. +# 4) 'info files' must display $libname. +# 5) Continue to bar in $libsrc. +# 6) Set a breakpoint at foo in $librc. +# 7) Continue to foo in $libsrc. +# 8) Set a breakpoint at gdb_remove_symbol_file. +# 9) Continue to gdb_remove_symbol_file in $srcfile. +# 10) Remove $shlib_name using 'remove-symbol-file'. +# 11) 'info files' must not display $libname, anymore. +# 12) Check that the breakpoints at foo and bar are pending. +# 13) Check that the execution can continue without error. if [skip_shlib_tests] { return 0 @@ -91,33 +93,38 @@ if { $result != 0 } then { return } -# 4) Continue to bar in $libsrc to ensure that the breakpoint +# 4) 'info files' must display $libname. +gdb_test "info files" \ + "^(?=(.*${libname})).*" \ + "info files must display $libname" + +# 5) Continue to bar in $libsrc to ensure that the breakpoint # was bound correctly after adding $shilb_name. set lnum_bar [gdb_get_line_number "break at bar" ${libfile}.c] gdb_continue_to_breakpoint bar ".*$libfile\\.c:$lnum_bar.*" -# 5) Set a breakpoint at foo in $libsrc. +# 6) Set a breakpoint at foo in $libsrc. set result [gdb_breakpoint foo] if { !$result } then { return } -# 6) Continue to foo in $libsrc to ensure that the breakpoint +# 7) Continue to foo in $libsrc to ensure that the breakpoint # was bound correctly. set lnum_foo [gdb_get_line_number "break at foo" ${libfile}.c] gdb_continue_to_breakpoint foo ".*$libfile\\.c:$lnum_foo.*" -# 7) Set a breakpoint at gdb_remove_symbol_file in $srcfile for +# 8) Set a breakpoint at gdb_remove_symbol_file in $srcfile for # removing $shlib_name. set result [gdb_breakpoint gdb_remove_symbol_file] if { !$result } then { return } -# 8) Continue to gdb_remove_symbol_file in $srcfile. +# 9) Continue to gdb_remove_symbol_file in $srcfile. gdb_continue_to_breakpoint gdb_remove_symbol_file -# 9) Remove $shlib_name using 'remove-symbol-file'. +# 10) Remove $shlib_name using 'remove-symbol-file'. set result [gdb_test "remove-symbol-file -a addr" \ ""\ "remove-symbol-file -a addr" \ @@ -128,7 +135,12 @@ if { $result != 0 } then { return } -# 10) Check that the breakpoints at foo and bar are pending after removing +# 11) 'info files' must not display $libname, anymore. +gdb_test "info files" \ + "^(?!(.*${libname})).*" \ + "info files must not display ${libname}" + +# 12) Check that the breakpoints at foo and bar are pending after removing # $shlib_name. gdb_test "info breakpoints 2" \ ".*PENDING.*" \ @@ -138,6 +150,6 @@ gdb_test "info breakpoints 3" \ ".*PENDING.*" \ "check if Breakpoint 3 is pending." -# 11) Check that the execution can continue without error. +# 13) Check that the execution can continue without error. gdb_continue_to_end -- 1.7.6.5