From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27891 invoked by alias); 10 Jan 2008 10:49:54 -0000 Received: (qmail 27883 invoked by uid 22791); 10 Jan 2008 10:49:53 -0000 X-Spam-Check-By: sourceware.org Received: from s200aog14.obsmtp.com (HELO s200aog14.obsmtp.com) (207.126.144.128) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jan 2008 10:49:27 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob014.postini.com ([207.126.147.11]) with SMTP; Thu, 10 Jan 2008 10:49:21 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C7EF5DB1A; Thu, 10 Jan 2008 10:49:20 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7BC484BEC6; Thu, 10 Jan 2008 10:49:20 +0000 (GMT) Received: from [164.129.12.194] (bri0669.bri.st.com [164.129.12.194]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CJO63901 (AUTH stubbsa); Thu, 10 Jan 2008 10:49:18 GMT Message-ID: <4785F82C.1010408@st.com> Date: Thu, 10 Jan 2008 10:49:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jim Blandy Cc: "'ranjith kumar'" , gdb@sourceware.org Subject: Re: printing a string References: <509320.35245.qm@web27407.mail.ukl.yahoo.com> <003701c8520c$2842c9d0$2e08a8c0@CAM.ARTIMI.COM> <4784A6E8.7090209@st.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-01/txt/msg00063.txt.bz2 Jim Blandy wrote: > Andrew STUBBS writes: >> printf "%s\n", mystring > > (Not 'set print elements'?) Well, 'set print elements 0' and 'set print repeats 0' gets you some of the way there, but line-feeds still get converted to '\n', and if you want to print shorter strings with x/s then you'll also need 'set print null-stop on' ..... Basically, if you want to see a string as nature intended then printf seems to be the easiest way, plus x/s remains useful for viewing the contents of the string a different way. Andrew