From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16305 invoked by alias); 31 May 2007 22:44:49 -0000 Received: (qmail 16297 invoked by uid 22791); 31 May 2007 22:44:48 -0000 X-Spam-Check-By: sourceware.org Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 May 2007 22:44:47 +0000 Received: from relay6.apple.com (relay6.apple.com [17.128.113.36]) by mail-out3.apple.com (Postfix) with ESMTP id 3CC2A78F8AC; Thu, 31 May 2007 15:43:59 -0700 (PDT) Received: from relay6.apple.com (unknown [127.0.0.1]) by relay6.apple.com (Symantec Mail Security) with ESMTP id B9022101A2; Thu, 31 May 2007 15:44:45 -0700 (PDT) X-AuditID: 11807124-a1ecabb000000801-92-465f4fdcbc2a Received: from [17.201.22.22] (moleja2.apple.com [17.201.22.22]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay6.apple.com (Apple SCV relay) with ESMTP id 386D1100F3; Thu, 31 May 2007 15:44:44 -0700 (PDT) Cc: gdb@sourceware.org Message-Id: From: Jason Molenda To: Ray Bejjani In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v888.2) Subject: Re: Turning off printing of char pointer contents Date: Thu, 31 May 2007 22:44:00 -0000 References: X-Mailer: Apple Mail (2.888.2) 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: 2007-05/txt/msg00187.txt.bz2 You can limit the amount of data printed, e.g. (gdb) set print elements 15 But you'll need to unset that limit to see the full contents of strings during your debug session. J On May 31, 2007, at 3:38 PM, Ray Bejjani wrote: > Hi, > I'm trying to turn off printing the contents of char pointers. I'm use > GDB to debug an embedded app remotely. In some instances the pointers > are left uninitialised and can point to sections of memory that cause > system crashes when accessed (or they cause external hardware to > change state when read). I am using DDD on top of GDB but I can > reproduce the issue with GDB as well. GDB seems to treat C strings in > a special manner, attempting to print the contents until it sees an > null terminator or hit the limit set by the "print elements" setting. > My system crashes when this happens. > Unfortunately, doing a set print elements 0 is interpreted as no > limit. Are there any other settings I can use to suppress this > feature? In particular, I would like it to treat char (or unsigned > char) pointers like it does other pointers where it doesn't attempt to > dereference them. I would still like to be able to display/print the > contents of strings when needed but only on demand. Failing that, > where in the code should I look to try and force this to not happen? > > Thank you, > Ray Bejjani