From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: archer@sourceware.org
Subject: [python] [approval request] Re: FYI a testcase FAIL: test Frame.read_var_value - error
Date: Fri, 06 Mar 2009 13:25:00 -0000 [thread overview]
Message-ID: <20090306132509.GA32564@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <1236310518.4870.5.camel@localhost.localdomain>
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"
next prev parent reply other threads:[~2009-03-06 13:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 19:48 [python] " Jan Kratochvil
2009-03-04 17:02 ` Thiago Jung Bauermann
2009-03-05 22:58 ` Jan Kratochvil
2009-03-06 3:35 ` Thiago Jung Bauermann
2009-03-06 13:25 ` Jan Kratochvil [this message]
2009-03-06 14:22 ` [python] [approval request] " Thiago Jung Bauermann
2009-03-06 14:28 ` Thiago Jung Bauermann
2009-03-06 14:31 ` Jan Kratochvil
2009-03-06 15:04 ` Thiago Jung Bauermann
2009-03-06 23:41 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090306132509.GA32564@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=archer@sourceware.org \
--cc=bauerman@br.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).