gdb cc1plus PACK_EXPANSION_PATTERN(result) gives 'No symbol "__extension__"' error msg

Larry Evans <[email protected]> Wed, 08 Jul 2009 15:35:03 -0500
Newsgroups gmane.comp.gdb.general
Message-ID <[email protected]>
The gcc compiler was compiled with -g3 -O0' compiler flags to enable 
invocation of macros during a gdb session; however, the
macro,  PACK_EXPANSION_PATTERN, apparently uses a symbol:

   __extension__

not understood by gdb.  How can gdb be made to understand
__extension__?

More specifically, while in pt.c:

http://gcc.gnu.org/viewcvs/trunk/gcc/cp/pt.c?revision=149351&view=markup

at around line 2671, I got:

(gdb) p PACK_EXPANSION_PATTERN(result)
No symbol "__extension__" in current context.
(gdb)

Now, I could use 'macro exp' as follows:

(gdb) macro exp PACK_EXPANSION_PATTERN(result)
expands to: (((enum tree_code) (result)->base.code) == 
TYPE_PACK_EXPANSION? __extension__ (*({__typeof (result) const __t = 
(result); &__t->common.type; })) : __extension__ (*({__typeof (result) 
const __t = __extension__ ({ __typeof (result) const __t = (result); 
char const __c = tree_code_type[(int) (((enum tree_code) 
(__t)->base.code))]; if (!((__c) >= tcc_reference && (__c) <= 
tcc_expression)) tree_class_check_failed (__t, tcc_expression, __FILE__, 
__LINE__, __FUNCTION__); __t; }); const int __i = (0); if (__i < 0 || 
__i >= tree_operand_length (__t)) tree_operand_check_failed (__i, __t, 
__FILE__, __LINE__, __FUNCTION__); &__t->exp.operands[__i]; })))
(gdb)

However, that's very hard to parse (FWIW, the result I was looking
for was result->common.type; however, my first guess was 
result->exp.operands[0], and that was wrong :( )

It would be much easier if gdb understood __extension__. Is there a way?

TIA.

-regards,
Larry