From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26595 invoked by alias); 15 Oct 2014 07:35:23 -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 26582 invoked by uid 89); 15 Oct 2014 07:35:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN autolearn=no 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; Wed, 15 Oct 2014 07:35:21 +0000 Received: from svr-orw-fem-02x.mgc.mentorg.com ([147.34.96.206] helo=SVR-ORW-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XeJ78-0005ae-7D from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 15 Oct 2014 00:35:18 -0700 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.3.181.6; Wed, 15 Oct 2014 00:35:17 -0700 From: Yao Qi To: Subject: Re: [PATCH 2/3] Fix file name matching on remote host. References: <1410956225-12592-1-git-send-email-yao@codesourcery.com> <1410956225-12592-3-git-send-email-yao@codesourcery.com> Date: Wed, 15 Oct 2014 07:35:00 -0000 In-Reply-To: <1410956225-12592-3-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Wed, 17 Sep 2014 20:17:04 +0800") Message-ID: <871tq9okl5.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00383.txt.bz2 Yao Qi writes: > -gdb_test "python print (symtab.fullname())" "testsuite/gdb.python/py-sym= bol.c" "Test symtab.fullname" > +gdb_test "python print (symtab.fullname())" "${py_symbol_c}" "Test symta= b.fullname" I updated the patch here to match "testsuite" in the pattern for non-remote-host case. I re-tested test cases affected by this patch series on x86-linux and arm-linux-gnueabi on mingw32 host. These three patches are pushed in. --=20 Yao (=E9=BD=90=E5=B0=A7) Subject: [PATCH] Fix file name matching on remote host. I see the following fails in the remote host testing we do for mingw32 hosted GDB, python print (symtab[1][0].symtab)^M python.c^M (gdb) FAIL: gdb.python/python.exp: Test decode_line current locationn filen= ame python print (symtab[1][0].symtab)^M python.c^M (gdb) FAIL: gdb.python/python.exp: Test decode_line python.c:26 filename The test cases doesn't consider remote host and assumes that directory on build also exists on host. In this patch, we only match file base name if host is remote, otherwise, match file with dir name. gdb/testsuite: 2014-10-15 Yao Qi * gdb.python/py-symbol.exp: Match file base name if host is remote, otherwise match file name with dir name. * gdb.python/py-symtab.exp: Likewise. * gdb.python/python.exp: Likewise. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 79fc861..fd8898c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2014-10-15 Yao Qi =20 + * gdb.python/py-symbol.exp: Match file base name if host is + remote, otherwise match file name with dir name. + * gdb.python/py-symtab.exp: Likewise. + * gdb.python/python.exp: Likewise. + +2014-10-15 Yao Qi + * gdb.python/py-symbol.exp: Remove trailing ".*" in the pattern. * gdb.python/py-symtab.exp: Likewise. diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.pyt= hon/py-symbol.exp index eadbcad..2b06f06 100644 --- a/gdb/testsuite/gdb.python/py-symbol.exp +++ b/gdb/testsuite/gdb.python/py-symbol.exp @@ -117,7 +117,12 @@ gdb_test "python print (t\[0\].addr_class =3D=3D gdb.S= YMBOL_LOC_CONST)" "True" "Test gdb_test "python print (t\[0\].type)" "enum tag" "Get type" =20 # Test symtab attribute. -gdb_test "python print (t\[0\].symtab)" "gdb.python/py-symbol.c" "Get symt= ab" +if { [is_remote host] } { + set py_symbol_c [string_to_regexp $srcfile] +} else { + set py_symbol_c [string_to_regexp ${srcdir}/${subdir}/${srcfile}] +} +gdb_test "python print (t\[0\].symtab)" "${py_symbol_c}" "Get symtab" =20 # C++ tests # Recompile binary. diff --git a/gdb/testsuite/gdb.python/py-symtab.exp b/gdb/testsuite/gdb.pyt= hon/py-symtab.exp index d8f7d48..8b4bcb5 100644 --- a/gdb/testsuite/gdb.python/py-symtab.exp +++ b/gdb/testsuite/gdb.python/py-symtab.exp @@ -50,16 +50,24 @@ gdb_py_test_silent_cmd "step" "Step to the next line" 0 gdb_py_test_silent_cmd "python new_pc =3D gdb.selected_frame().find_sal().= pc" "Get new PC" 0 =20 # Test sal. -gdb_test "python print (sal.symtab)" ".*gdb.python/py-symbol.c" "Test symt= ab" +if { [is_remote host] } { + set py_symbol_c [string_to_regexp $srcfile] + set full_py_symbol_c $py_symbol_c +} else { + set py_symbol_c [string_to_regexp ${srcdir}/${subdir}/${srcfile}] + set full_py_symbol_c [string_to_regexp testsuite/${subdir}/${srcfile}] +} + +gdb_test "python print (sal.symtab)" ".*${py_symbol_c}" "Test symtab" gdb_test "python print (sal.pc)" "${decimal}" "Test sal.pc" gdb_test "python print (sal.last =3D=3D (new_pc - 1))" "True" "Test sal.la= st" gdb_test "python print (sal.line)" "$line_no" "Test sal.line" gdb_test "python print (sal.is_valid())" "True" "Test sal.is_valid" =20 # Test symbol table. -gdb_test "python print (symtab.filename)" ".*gdb.python/py-symbol.c" "Test= symtab.filename" +gdb_test "python print (symtab.filename)" ".*${py_symbol_c}" "Test symtab.= filename" gdb_test "python print (symtab.objfile)" "" = "Test symtab.objfile" -gdb_test "python print (symtab.fullname())" "testsuite/gdb.python/py-symbo= l.c" "Test symtab.fullname" +gdb_test "python print (symtab.fullname())" ".*${full_py_symbol_c}" "Test = symtab.fullname" gdb_test "python print (symtab.is_valid())" "True" "Test symtab.is_valid()" gdb_test "python print (\"qq\" in global_symbols)" "True" "Test qq in glob= al symbols" gdb_test "python print (\"func\" in global_symbols)" "True" "Test func in = global symbols" diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python= /python.exp index 748700b..3df9347 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -189,14 +189,20 @@ gdb_py_test_silent_cmd "python symtab =3D gdb.decode_= line()" "test decode_line cur gdb_test "python print (len(symtab))" "2" "Test decode_line current locati= on" gdb_test "python print (symtab\[0\])" "None" "Test decode_line expression = parse" gdb_test "python print (len(symtab\[1\]))" "1" "Test decode_line current l= ocation" -gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*gdb.python/python.c" = "Test decode_line current location filename" + +if { [is_remote host] } { + set python_c [string_to_regexp "python.c"] +} else { + set python_c [string_to_regexp "gdb.python/python.c"] +} +gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*${python_c}" "Test de= code_line current location filename" gdb_test "python print (symtab\[1\]\[0\].line)" "$lineno" "Test decode_lin= e current location line number" =20 gdb_py_test_silent_cmd "python symtab =3D gdb.decode_line(\"python.c:26 if= foo\")" "test decode_line python.c:26" 1 gdb_test "python print (len(symtab))" "2" "Test decode_line python.c:26 le= ngth" gdb_test "python print (symtab\[0\])" "if foo" "Test decode_line expressio= n parse" gdb_test "python print (len(symtab\[1\]))" "1" "Test decode_line python.c:= 26 length" -gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*gdb.python/python.c" = "Test decode_line python.c:26 filename" +gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*${python_c}" "Test de= code_line python.c:26 filename" gdb_test "python print (symtab\[1\]\[0\].line)" "26" "Test decode_line pyt= hon.c:26 line number" =20 gdb_test "python gdb.decode_line(\"randomfunc\")" \ @@ -204,7 +210,13 @@ gdb_test "python gdb.decode_line(\"randomfunc\")" \ gdb_py_test_silent_cmd "python symtab =3D gdb.decode_line(\"func1\")" "tes= t decode_line func1()" 1 gdb_test "python print (len(symtab))" "2" "Test decode_line func1 length" gdb_test "python print (len(symtab\[1\]))" "1" "Test decode_line func1 len= gth" -gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*gdb.python/python-1.c= " "Test decode_line func1 filename" + +if { [is_remote host] } { + set python_1_c [string_to_regexp "python-1.c"] +} else { + set python_1_c [string_to_regexp "gdb.python/python-1.c"] +} +gdb_test "python print (symtab\[1\]\[0\].symtab)" ".*${python_1_c}" "Test = decode_line func1 filename" gdb_test "python print (symtab\[1\]\[0\].line)" "19" "Test decode_line fun= c1 line number" gdb_py_test_silent_cmd {python symtab =3D gdb.decode_line ("func1,func2")}= \ "test decode_line func1,func2" 1