public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-17320-4717-ERRmz5m7Vh@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17320-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=17320

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hannes Domani <ssbssa@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d642b6920b1a697da2e8fa2326cb773612a87f3f

commit d642b6920b1a697da2e8fa2326cb773612a87f3f
Author: Hannes Domani <ssbssa@yahoo.de>
Date:   Sun Apr 26 15:28:46 2020 +0200

    Fix array pretty formatter

    Currently, printing with array pretty formatting makes the output actually
    less readable than without:

    (gdb) p -array on -- {{1,2,3},{4,5,6}}
    $1 =   {    {1,
        2,
        3},
          {4,
        5,
        6}}
    (gdb) p -array on -array-indexes on -- {{1,2,3},{4,5,6}}
    $2 =   {[0] =     {[0] = 1,
        [1] = 2,
        [2] = 3},
      [1] =     {[0] = 4,
        [1] = 5,
        [2] = 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 = {
      {
        1,
        2,
        3
      },
      {
        4,
        5,
        6
      }
    }
    (gdb) p -array on -array-indexes on -- {{1,2,3},{4,5,6}}
    $2 = {
      [0] = {
        [0] = 1,
        [1] = 2,
        [2] = 3
      },
      [1] = {
        [0] = 4,
        [1] = 5,
        [2] = 6
      }
    }

    gdb/ChangeLog:

    2020-04-29  Hannes Domani  <ssbssa@yahoo.de>

            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  <ssbssa@yahoo.de>

            PR gdb/17320
            * gdb.base/pretty-array.c: New test.
            * gdb.base/pretty-array.exp: New file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2020-04-29 10:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 19:53 [Bug gdb/17320] New: " dje at google dot com
2020-04-29 10:58 ` cvs-commit at gcc dot gnu.org [this message]
2020-04-29 11:01 ` [Bug gdb/17320] " ssbssa at sourceware dot org
2024-01-03 14:48 ` ssbssa at sourceware dot org

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=bug-17320-4717-ERRmz5m7Vh@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).