From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2532 invoked by alias); 6 Mar 2009 13:25:28 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Mail-Followup-To: archer@sourceware.org Received: (qmail 2505 invoked by uid 22791); 6 Mar 2009 13:25:26 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Date: Fri, 06 Mar 2009 13:25:00 -0000 From: Jan Kratochvil To: Thiago Jung Bauermann Cc: archer@sourceware.org Subject: [python] [approval request] Re: FYI a testcase FAIL: test Frame.read_var_value - error Message-ID: <20090306132509.GA32564@host0.dyn.jankratochvil.net> References: <20090303194756.GA8203@host0.dyn.jankratochvil.net> <1236186119.30573.69.camel@localhost.localdomain> <20090305225827.GA4161@host0.dyn.jankratochvil.net> <1236310518.4870.5.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1236310518.4870.5.camel@localhost.localdomain> User-Agent: Mutt/1.5.18 (2008-05-17) X-SW-Source: 2009-q1/txt/msg00348.txt.bz2 On Fri, 06 Mar 2009 04:35:18 +0100, Thiago Jung Bauermann wrote: > El jue, 05-03-2009 a las 23:58 +0100, Jan Kratochvil escribió: > > python print 'result =', f0.read_var ('b') > > result = {i = {0, 1068498944}, d = 0.0625} > > (gdb) FAIL: gdb.python/python-frame.exp: test Frame.read_var - error > > This is weird. python-frame.c doesn't have a b variable in f2, which is > where the testcase stops for the tests. It does have an argument named b > in f1, but it surely doesn't have such type. It's a plain int. I could have investigated it more first (and curious you do not have glibc-debuginfo installed): (gdb) info addr b Symbol "b" is static storage at address 0x33f124d198. (gdb) info sym 0x33f124d198 inv16 in section .rodata of /lib64/libm.so.6 [`inv16' is just shared common rodata with `b'] IMO GDB should be strictly following the c++ lookup scopes. This `b' lookup would therefore require to type `s_atan.c:b' or `atnat.h:b' when some current frame or current_source_symtab are in a different file. OK to checkin the patch below? glibc-20081031T2102/sysdeps/ieee754/dbl-64/atnat.h:113: static const number /**/ b = {{0x00000000, 0x3fb00000} }, /* 1/16 */ Compilation Unit @ offset 0x8ac8: Length: 0x7cb (32-bit) Version: 2 Abbrev Offset: 10308 Pointer Size: 8 <0><8ad3>: Abbrev Number: 1 (DW_TAG_compile_unit) <8ad4> DW_AT_producer : (indirect string, offset: 0x12e): GNU C 4.3.2 20081105 (Red Hat 4.3.2-7) <8ad8> DW_AT_language : 1 (ANSI C) <8ad9> DW_AT_name : (indirect string, offset: 0x13b2): ../sysdeps/ieee754/dbl-64/s_atan.c <8add> DW_AT_comp_dir : (indirect string, offset: 0x5a7): /usr/src/debug/glibc-20081113T2206/math <8ae1> DW_AT_low_pc : 0x15ee0 <8ae9> DW_AT_high_pc : 0x18725 <8af1> DW_AT_stmt_list : 0x36a2 <1><90c2>: Abbrev Number: 15 (DW_TAG_variable) <90c3> DW_AT_name : b <90c5> DW_AT_decl_file : 4 <90c6> DW_AT_decl_line : 113 <90c7> DW_AT_type : <0x8f0d> <90cb> DW_AT_location : 9 byte block: 3 98 d1 4 0 0 0 0 0 (DW_OP_addr: 4d198) Symbol table '.symtab' contains 1761 entries: Num: Value Size Type Bind Vis Ndx Name 302: 000000000004d198 8 OBJECT LOCAL DEFAULT 15 b Regards, Jan Fix false FAIL with libm.so debuginfo installed. * gdb.python/python-frame.exp (test Frame.read_var - error): Convert it to gdb_test_multiple with XFAIL on the libm instance on `b'. diff --git a/gdb/testsuite/gdb.python/python-frame.exp b/gdb/testsuite/gdb.python/python-frame.exp index 083fa90..e9e063a 100644 --- a/gdb/testsuite/gdb.python/python-frame.exp +++ b/gdb/testsuite/gdb.python/python-frame.exp @@ -81,9 +81,20 @@ gdb_test "python print 'result =', f0.pc ()" " = \[0-9\]+" "test Frame.pc" gdb_test "python print 'result =', f0.addr_in_block ()" " = \[0-9\]+" "test Frame.addr_in_block" gdb_test "python print 'result =', f0.older ().equals (f1)" " = True" "test Frame.older" gdb_test "python print 'result =', f1.newer ().equals (f0)" " = True" "test Frame.newer" -gdb_test "python print 'result =', f0.read_var ('b')" \ - "ValueError: variable 'b' not found.*Error while executing Python code." \ - "test Frame.read_var - error" + +set test "test Frame.read_var - error" +gdb_test_multiple "python print 'result =', f0.read_var ('b')" $test { + -re "ValueError: variable 'b' not found.*Error while executing Python code.\r\n$gdb_prompt $" { + pass $test + } + -re "result = \\\{i = \\\{0, \[0-9\]+\\\}, d = 0\\.\[0-9\]+\\\}\r\n$gdb_prompt $" { + # libm.so debuginfo contains file static symbol `b' from `atnat.h'. + # local `b' would be find first if it would exist so it is more a PASS. + setup_xfail *-*-* + fail $test + } +} + gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success" gdb_test "python print 'result =', gdb.newest_frame ().equals (f0)" " = True" "test gdb.newest_frame"