This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug macros/9748] macros containing __extension__ won't run
- From: "pedro at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 15 Jan 2009 23:39:41 -0000
- Subject: [Bug macros/9748] macros containing __extension__ won't run
- References: <20090115210626.9748.rearnsha@gcc.gnu.org>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From pedro at codesourcery dot com 2009-01-15 23:39 -------
Subject: Re: macros containing __extension__ won't run
On Thursday 15 January 2009 21:40:25, drow at false dot org wrote:
> Also on statement expressions, which is what the __extension__ marker
> is for in the first place :-)
IIRC, the __extensions__ marker is for enabling
gnu-C-isms no matter the C dialect or e.g., if -pedantic is selected,
so it's for more things, but, yeah, missed that. :-)
> I don't think statement expressions are likely to be implemented in
> GDB. It currently has only a C expression parser, with no support for
> statements etc.
Stating the obvious, you can override the checked versions
in gdb expressions with:
(gdb) macro define TREE_CHECK(T, CODE) (T)
If wanting to retain the checking ability when called from gdb,
perhaps the best would be to still override the whole TREE_CHECK macro
with macro define, retaining close enough semantics. Say, add
something like this and similars to gcc:
const_tree
gdb_tree_check (const_tree __t, int code)
{
if (TREE_CODE (__t) != code)
tree_check_failed (__t, "<gdb>", 0, "<nofunction>", code); // or call some other variant
return __t;
}
And this in .gdbinit:
macro define TREE_CHECK(T, CODE) gdb_tree_check(T, CODE)
--
http://sourceware.org/bugzilla/show_bug.cgi?id=9748
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.