This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what does print /s do?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]