From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22831 invoked by alias); 21 Nov 2008 17:27:54 -0000 Received: (qmail 22798 invoked by uid 22791); 21 Nov 2008 17:27:53 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Nov 2008 17:27:13 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 49EA510AD0; Fri, 21 Nov 2008 17:27:10 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 39AB91059C; Fri, 21 Nov 2008 17:27:10 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1L3Zmf-0002zc-Px; Fri, 21 Nov 2008 12:27:09 -0500 Date: Fri, 21 Nov 2008 17:27:00 -0000 From: Daniel Jacobowitz To: dave_rodgman@fastmail.co.uk Cc: gdb@sourceware.org Subject: Re: what does print /s do? Message-ID: <20081121172709.GA11143@caradoc.them.org> Mail-Followup-To: dave_rodgman@fastmail.co.uk, gdb@sourceware.org References: <1227287410.31127.1286073337@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1227287410.31127.1286073337@webmail.messagingengine.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00134.txt.bz2 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