From: Ian Campbell Subject: Re: [PATCH v2 03/12] xenctx: Output ascii version of stack also. Date: Thu, 7 Nov 2013 12:43:14 +0000 Message-ID: <1383828194.32399.25.camel@kazak.uk.xensource.com> References: <1383768500-4245-1-git-send-email-dslutz@terremark.com> <1383768500-4245-4-git-send-email-dslutz@terremark.com> <527B58E60200007800100787@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VeOvg-00064X-Of for xen-devel@lists.xenproject.org; Thu, 07 Nov 2013 12:43:20 +0000 In-Reply-To: <527B58E60200007800100787@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Stefano Stabellini , George Dunlap , Don Slutz , Ian Jackson , Don Slutz , xen-devel List-Id: xen-devel@lists.xenproject.org On Thu, 2013-11-07 at 08:09 +0000, Jan Beulich wrote: > >>> On 06.11.13 at 21:08, Don Slutz wrote: > > Why? I personally don't see a need - there's rarely much useful > ASCII data on the stack. This is true IME > So afaic: If at all, then only via command > line option defaulting to off. Well, assuming it doesn't make the output >80 columns (which I can't tell from here) it seems harmless enough? > "); > > + for (k = 0; k < j; k++) { > > + int l; > > + > > + bytep = (unsigned char*)&ascii[k]; > > + for (l = 0; l < width; l++) { > > + if ((*bytep < 127) && (*bytep >= 32)) is there not a ctype.h function which deals with this? isprint seems like a good candidate... > > + printf("%c", *bytep); > > + else > > + printf("."); > > + bytep++; > > + } > > + } > > printf("\n"); > > } > > printf("\n"); > > -- > > 1.7.1 > > >