public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "f.heckenbach@fh-soft.de" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/16933] p omits trailing 0 when printing a range of chars
Date: Mon, 12 May 2014 16:38:00 -0000	[thread overview]
Message-ID: <bug-16933-4717-DvpbDJPV6u@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-16933-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Frank Heckenbach <f.heckenbach@fh-soft.de> ---
> https://sourceware.org/bugzilla/show_bug.cgi?id=16933
> 
> --- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
> "\001\002\000\004\000" would be wrong because that has 6 elements and implies
> that there is another zero following.

I see. But for the same reason this is then also wrong:

# echo 'char foo[5] = { 1, 2, 0, 4 };' > foo.c
# gcc -c -g foo.c
# gdb foo.o
(gdb) p foo[0]@4
$1 = "\001\002\000\004"

So AIUI gdb must not print a range of chars as a string at all and
should really print "{1, 2, 0, 4, 0}" or "{1, 2, 0, 4}", resp., as
I'd actually prefer anyway.

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


  parent reply	other threads:[~2014-05-12 16:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12  8:00 [Bug gdb/16933] New: " f.heckenbach@fh-soft.de
2014-05-12 16:29 ` [Bug gdb/16933] " schwab@linux-m68k.org
2014-05-12 16:38 ` f.heckenbach@fh-soft.de [this message]
2024-01-01 23:43 ` ssbssa at sourceware dot org
2024-01-10 16:26 ` ssbssa at sourceware dot org
2024-01-10 16:28 ` 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-16933-4717-DvpbDJPV6u@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).