From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CBB973959C67; Wed, 29 Apr 2020 10:58:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBB973959C67 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/17320] printing of array in structures with "set print array on" is odd Date: Wed, 29 Apr 2020 10:58:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 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: Wed, 29 Apr 2020 10:58:54 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D17320 --- Comment #1 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Hannes Domani : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dd642b6920b1a= 697da2e8fa2326cb773612a87f3f commit d642b6920b1a697da2e8fa2326cb773612a87f3f Author: Hannes Domani Date: Sun Apr 26 15:28:46 2020 +0200 Fix array pretty formatter Currently, printing with array pretty formatting makes the output actua= lly less readable than without: (gdb) p -array on -- {{1,2,3},{4,5,6}} $1 =3D { {1, 2, 3}, {4, 5, 6}} (gdb) p -array on -array-indexes on -- {{1,2,3},{4,5,6}} $2 =3D {[0] =3D {[0] =3D 1, [1] =3D 2, [2] =3D 3}, [1] =3D {[0] =3D 4, [1] =3D 5, [2] =3D 6}} These changes now also put the first element and the array end bracket = on a new line, similar to the structure pretty formatter: (gdb) p -array on -- {{1,2,3},{4,5,6}} $1 =3D { { 1, 2, 3 }, { 4, 5, 6 } } (gdb) p -array on -array-indexes on -- {{1,2,3},{4,5,6}} $2 =3D { [0] =3D { [0] =3D 1, [1] =3D 2, [2] =3D 3 }, [1] =3D { [0] =3D 4, [1] =3D 5, [2] =3D 6 } } gdb/ChangeLog: 2020-04-29 Hannes Domani PR gdb/17320 * ada-valprint.c (val_print_packed_array_elements): Move array end bracket to new line. (ada_val_print_string): Remove extra spaces before first array element. * c-valprint.c (c_value_print_array): Likewise. * m2-valprint.c (m2_print_array_contents): Likewise. (m2_value_print_inner): Likewise. * p-valprint.c (pascal_value_print_inner): Likewise. * valprint.c (generic_val_print_array): Likewise. (value_print_array_elements): Move first array element and array end bracket to new line. gdb/testsuite/ChangeLog: 2020-04-29 Hannes Domani PR gdb/17320 * gdb.base/pretty-array.c: New test. * gdb.base/pretty-array.exp: New file. --=20 You are receiving this mail because: You are on the CC list for the bug.=