public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* avoiding gdb cc1plus PACK_EXPANSION_PATTERN(result) gives 'No symbol  "__extension__"', error msg
@ 2009-07-08 21:53 Larry Evans
  2009-07-08 22:14 ` Richard Henderson
  2009-07-09 16:16 ` Tom Tromey
  0 siblings, 2 replies; 5+ messages in thread
From: Larry Evans @ 2009-07-08 21:53 UTC (permalink / raw)
  To: gcc

I compiled gcc 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__ or how can __extension__ be rm'ed from the
macros?

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-09 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-08 21:53 avoiding gdb cc1plus PACK_EXPANSION_PATTERN(result) gives 'No symbol "__extension__"', error msg Larry Evans
2009-07-08 22:14 ` Richard Henderson
2009-07-09  2:53   ` Daniel Jacobowitz
2009-07-09  4:27   ` Ian Lance Taylor
2009-07-09 16:16 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).