From: Christoph Bartoschek <bartoschek@or.uni-bonn.de>
To: gdb@sourceware.org
Subject: Re: Array of short values
Date: Wed, 14 Feb 2007 17:47:00 -0000 [thread overview]
Message-ID: <200702141706.04815.bartoschek@or.uni-bonn.de> (raw)
In-Reply-To: <20070214154222.GA6588@caradoc.them.org>
Am Mittwoch, 14. Februar 2007 schrieb Daniel Jacobowitz:
> On Wed, Feb 14, 2007 at 04:32:08PM +0100, Christoph Bartoschek wrote:
> > Hi,
> >
> > is it possible to easily set an array of short as a convenience variable?
> >
> > set $arr = (short *) {1, 2, 3}
> >
> > Currently I have to use:
> >
> > set $arr = (short *) {0x00020001, 0x00000003}
>
> I don't think so. { (short) 1, (short) 2 } should work, though.
> Maybe someone will add C99 support to the C parser some day, and
> improve this along the way.
>
> Just so you know: this is probably not doing what you expect. Try
> "print $arr". In fact it's probably calling malloc() in the program,
> allocating memory, and stuffing your shorts there. I did some
> experimenting with this but got too confused by the parser - I'll be
> back to it, since it's related to my recent Python project.
I would not expect that it calls malloc within the program, because malloc
could be broken during a debugging session. But I guess there are not many
other possibilities left.
Thanks to you and Frederic.
Christoph
next prev parent reply other threads:[~2007-02-14 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-14 15:41 Christoph Bartoschek
2007-02-14 15:43 ` Frederic RISS
2007-02-14 15:51 ` Daniel Jacobowitz
2007-02-14 17:47 ` Christoph Bartoschek [this message]
2007-02-15 8:53 ` Michael Snyder
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=200702141706.04815.bartoschek@or.uni-bonn.de \
--to=bartoschek@or.uni-bonn.de \
--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