Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jason Molenda <jmolenda@apple.com>
To: Ray Bejjani <ray.bejjani@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Turning off printing of char pointer contents
Date: Thu, 31 May 2007 22:44:00 -0000	[thread overview]
Message-ID: <D045718A-1380-49BF-9D87-D9DD893B7D37@apple.com> (raw)
In-Reply-To: <fb6fe8260705311538y4e44977bw6d590abd225c224f@mail.gmail.com>

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


  reply	other threads:[~2007-05-31 22:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 22:38 Ray Bejjani
2007-05-31 22:44 ` Jason Molenda [this message]
2007-05-31 22:48 ` Jim Blandy
2007-06-01  1:32   ` Ray Bejjani
2007-06-01 13:39     ` Daniel Jacobowitz
2007-06-01 20:07       ` Ray Bejjani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D045718A-1380-49BF-9D87-D9DD893B7D37@apple.com \
    --to=jmolenda@apple.com \
    --cc=gdb@sourceware.org \
    --cc=ray.bejjani@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox