Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@specifix.com>
To: Chris Johns <chrisj@rtems.org>
Cc: gdb@sourceware.org
Subject: Re: Can back trace be stopped from always prints "char*" strings ?
Date: Wed, 12 Mar 2008 20:15:00 -0000	[thread overview]
Message-ID: <1205348586.19253.844.camel@localhost.localdomain> (raw)
In-Reply-To: <47D79ECF.7000900@rtems.org>

On Wed, 2008-03-12 at 20:13 +1100, Chris Johns wrote:
> Hello,
> 
> I have a union being passed to a function. The union is:
> 
> typedef union {
>    /** This is a pointer to a string name. */
>    const char *name_p;
>    /** This is the actual 32-bit "raw" integer name. */
>    uint32_t    name_u32;
> } Objects_Name;
> 
> The problem is the bt command ties to read the string pointed to by name_p 
> how-ever this can be any value if the name_u32 field has been set. This has 
> side effects on the embedded target I am using like killing the session.
> 
> Is there a way to stop the bt accessing the char* data and just printing the 
> pointer value ?

Close...

The closest we have is "set print elements", which will set a limit
on how many elements of an array (including a string) are printed
by default.  Unfortunately, zero has been used to mean "no limit", 
otherwise it would do exactly what you want.

If you "set print elements 1", it will only print the first byte
of the string -- maybe that will help?

Gosh guys, it would mean changing documented behavior, but maybe
we ought to consider making zero mean zero, and maybe making -1
mean "unlimited"...




      parent reply	other threads:[~2008-03-12 19:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 11:50 Chris Johns
2008-03-12 14:00 ` Daniel Jacobowitz
2008-03-12 14:23   ` Paul Koning
2008-03-13 18:13     ` Chris Johns
2008-03-12 15:05   ` Thiago Jung Bauermann
2008-03-12 20:15 ` Michael Snyder [this message]

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=1205348586.19253.844.camel@localhost.localdomain \
    --to=msnyder@specifix.com \
    --cc=chrisj@rtems.org \
    --cc=gdb@sourceware.org \
    /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