From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25134 invoked by alias); 27 Aug 2014 19:53:41 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 25015 invoked by uid 48); 27 Aug 2014 19:53:40 -0000 From: "dje at google dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/17320] New: printing of array in structures with "set print array on" is odd Date: Wed, 27 Aug 2014 19:53:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: dje at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q3/txt/msg00363.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17320 Bug ID: 17320 Summary: printing of array in structures with "set print array on" is odd Product: gdb Version: HEAD Status: NEW Severity: minor Priority: P3 Component: gdb Assignee: unassigned at sourceware dot org Reporter: dje at google dot com The printing of an array in a structure if oddly formatted if "set print array on" is set. ---array.c--- int foo[3] = { 1, 2, 3 }; struct s { int a[3]; }; struct s bar = { { 1, 2, 3 } }; int main () { return 0; } --- bash$ ./gdb -D ./data-directory -nx (gdb) file array.x64 (gdb) start (gdb) p bar $1 = {a = {1, 2, 3}} (gdb) set print pretty on (gdb) p bar $2 = { a = {1, 2, 3} } (gdb) set print array on (gdb) p bar $3 = { a = {1, 2, 3} } (gdb) set print array-indexes on (gdb) p bar $4 = { a = {[0] = 1, [1] = 2, [2] = 3} } (gdb) set print pretty off (gdb) p bar $5 = {a = {[0] = 1, [1] = 2, [2] = 3}} (gdb) set print array-indexes off (gdb) p bar $6 = {a = {1, 2, 3}} (gdb) The output for $3,4,5,6 is oddly formatted. -- You are receiving this mail because: You are on the CC list for the bug.