public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17320] New: printing of array in structures with "set print array on" is odd
@ 2014-08-27 19:53 dje at google dot com
  2020-04-29 10:58 ` [Bug gdb/17320] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dje at google dot com @ 2014-08-27 19:53 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-03 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-27 19:53 [Bug gdb/17320] New: printing of array in structures with "set print array on" is odd dje at google dot com
2020-04-29 10:58 ` [Bug gdb/17320] " cvs-commit at gcc dot gnu.org
2020-04-29 11:01 ` ssbssa at sourceware dot org
2024-01-03 14:48 ` ssbssa at sourceware dot org

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).