Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: dave_rodgman@fastmail.co.uk
Cc: gdb@sourceware.org
Subject: Re: what does print /s do?
Date: Fri, 21 Nov 2008 17:27:00 -0000	[thread overview]
Message-ID: <20081121172709.GA11143@caradoc.them.org> (raw)
In-Reply-To: <1227287410.31127.1286073337@webmail.messagingengine.com>

On Fri, Nov 21, 2008 at 05:10:10PM +0000, dave_rodgman@fastmail.co.uk wrote:
> I have two questions:
> 
> 1. What is the distinction between "pointer to single-byte data" and
> "pointers to and arrays of char, unsigned char, and signed char"?
> Or is this just poorly worded?

char, unsigned char, and signed char are examples of single byte data.
Members of a vector are also examples of single byte data.  For
instance, the contents of an AltiVec or SSE vector register can be
interpreted as strings using print /s.

> 2. Under what circumstances does supplying or not supplying /s make a
> difference to the output? I can't find a case where it makes a
> difference. For example, when printing a pointer-to-char (here, "string"
> is a char array)

Try it with a vector type.  /s only affects single byte data,
and (int *) in your example is four-byte data.

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2008-11-21 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 17:11 dave_rodgman
2008-11-21 17:27 ` Daniel Jacobowitz [this message]

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=20081121172709.GA11143@caradoc.them.org \
    --to=drow@false.org \
    --cc=dave_rodgman@fastmail.co.uk \
    --cc=gdb@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