From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 88CD7385DC30; Fri, 30 Apr 2021 13:15:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88CD7385DC30 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug testsuite/27787] FAIL: gdb.python/flexible-array-member.exp: python print(zs['items'].type.range()) Date: Fri, 30 Apr 2021 13:15:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 13:15:37 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27787 --- Comment #5 from Simon Marchi --- Ok, so we could simply fix the test to accept both values (see patch below). But do you think we should address the underlying issue and make GDB output something consistent in that case, whatever the compiler and the method use= d to specify the flexible array member? - Choose either 0 or -1 to indicate "there's no high bound" and output that consistently. It would be a user-visible behavior change for some cases but not others. - Emit "None" to indicate "there's no high bound". This is probably a more Pythonic way of doing things, but the downside is that it's a user-visible change for all cases involved. >>From 67eeb4e645c7c6d02f642bb2864ad3286665b6af Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 30 Apr 2021 09:12:35 -0400 Subject: [PATCH] fix Change-Id: Ie4e06d99fe9315527f04577888f48284d649ca4c --- gdb/testsuite/gdb.python/flexible-array-member.exp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.python/flexible-array-member.exp b/gdb/testsuite/gdb.python/flexible-array-member.exp index 349670cb7e7..38c8ee5f21f 100644 --- a/gdb/testsuite/gdb.python/flexible-array-member.exp +++ b/gdb/testsuite/gdb.python/flexible-array-member.exp @@ -76,9 +76,10 @@ gdb_test "python print(zso\['items'\] =3D=3D zso\['items'\]\[0\].address)" "True" gdb_test "python print(zso\['items'\]\[0\].address + 1 =3D=3D zso\['items'\]\[1\].address)" "True" # Verify the range attribute. It looks a bit inconsistent that the high b= ound -# is sometimes 0, sometimes -1, but that's what GDB produces today, so tha= t's -# what we test. +# is sometimes 0, sometimes -1. It depends on the way the flexible array +# member is specified and on the compiler version (the debug info is +# different). But that's what GDB produces today, so that's what we test. gdb_test "python print(ns\['items'\].type.range())" "\\(0, 0\\)" -gdb_test "python print(zs\['items'\].type.range())" "\\(0, -1\\)" -gdb_test "python print(zso\['items'\].type.range())" "\\(0, -1\\)" +gdb_test "python print(zs\['items'\].type.range())" "\\(0, (0|-1)\\)" +gdb_test "python print(zso\['items'\].type.range())" "\\(0, (0|-1)\\)" --=20 2.31.1 --=20 You are receiving this mail because: You are on the CC list for the bug.=