set $argv = *argv@100

Andrew Cagney ac131313@cygnus.com
Tue Feb 12 07:32:00 GMT 2002


> 
> 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 :-(

sigh,
Andrew




More information about the Gdb mailing list