From: Kevin Buettner <kevinb@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb@sources.redhat.com
Subject: Re: set $argv = *argv@100
Date: Tue, 12 Feb 2002 08:33:00 -0000 [thread overview]
Message-ID: <1020212163153.ZM1430@localhost.localdomain> (raw)
In-Reply-To: Andrew Cagney <ac131313@cygnus.com> "Re: set $argv = *argv@100" (Feb 12, 10:32am)
On Feb 12, 10:32am, Andrew Cagney wrote:
> > I think the address is right. The problem is that $argv isn't the right
> > type. According to the above, it's ``char **'' when it should be
> > ``char *[100]''.
> >
> > Try this:
> >
> > (top-gdb) set $argva = &(*argv@100)
> > (top-gdb) print $argva
> > $23 = (char *(*)[100]) 0xbffff99c
> > (top-gdb) ptype $argva
> > type = char *(*)[100]
> > (top-gdb) ptype *$argva
> > type = char *[100]
> >
> > Kevin
>
> Yes, C strikes again. You can't copy an array, just its address :-(
I still think it'd be nice if we could somehow preserve the type
when doing set $argv = *argv@100...
(top-gdb) set $argv = *argv@100
(top-gdb) ptype $argv
type = char **
(top-gdb) ptype *argv@100
type = char *[100]
I.e, it'd be nice if the types of $argv and *argv@100 were the same.
I haven't thought this through though. It could be that a lot of other
stuff would break if we did this.
Kevin
prev parent reply other threads:[~2002-02-12 16:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-11 21:48 Andrew Cagney
2002-02-11 22:22 ` Kevin Buettner
2002-02-12 7:32 ` Andrew Cagney
2002-02-12 8:33 ` Kevin Buettner [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=1020212163153.ZM1430@localhost.localdomain \
--to=kevinb@redhat.com \
--cc=ac131313@cygnus.com \
--cc=gdb@sources.redhat.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