This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ping: [gcc patch] libcc1: '@' GDB array operator
- From: Tom Tromey <tom at tromey dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gcc-patches at gcc dot gnu dot org, Phil Muldoon <pmuldoon at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>
- Date: Wed, 03 Jun 2015 09:29:16 -0600
- Subject: Re: ping: [gcc patch] libcc1: '@' GDB array operator
- Authentication-results: sourceware.org; auth=none
- References: <20150327163646 dot GA16457 at host1 dot jankratochvil dot net> <20150417151749 dot GA13717 at host1 dot jankratochvil dot net> <55694DCB dot 1000402 at redhat dot com> <20150530094717 dot GA1473 at host1 dot jankratochvil dot net> <556F155C dot 1030300 at redhat dot com>
>> I did not realize that myself before. I do not think there is an
>> easy fix for the GCC patch, is it?
It seems like a VLA would work.
Jeff> 99% of the time I've used a constant with the @ syntax in gdb.
I use a non-constant argument to @ quite a bit.
It's common to have something like the struct hack where the length of
the array is stored in the struct. Then when scripting gdb one can
write:
print s.array[0] @ s.length
Tom