This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 195/236] Convert PATTERN from a macro to a pair of inline functions
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 06 Aug 2014 15:57:33 -0400
- Subject: Re: [PATCH 195/236] Convert PATTERN from a macro to a pair of inline functions
- Authentication-results: sourceware.org; auth=none
- References: <1407345815-14551-1-git-send-email-dmalcolm at redhat dot com> <1407345815-14551-196-git-send-email-dmalcolm at redhat dot com> <20140806180318 dot GJ7393 at tucnak dot redhat dot com>
On Wed, 2014-08-06 at 20:03 +0200, Jakub Jelinek wrote:
> On Wed, Aug 06, 2014 at 01:22:54PM -0400, David Malcolm wrote:
> > gcc/
> > * rtl.h (PATTERN): Convert this macro into a pair of inline
> > functions, for now, requiring const_rtx and rtx.
> > ---
> > gcc/rtl.h | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/gcc/rtl.h b/gcc/rtl.h
> > index 79cca1b..640616f 100644
> > --- a/gcc/rtl.h
> > +++ b/gcc/rtl.h
> > @@ -1226,7 +1226,15 @@ inline rtx& SET_NEXT_INSN (rtx insn)
> > #define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 2)
> >
> > /* The body of an insn. */
> > -#define PATTERN(INSN) XEXP (INSN, 3)
> > +inline rtx PATTERN (const_rtx insn)
> > +{
> > + return XEXP (insn, 3);
> > +}
> > +
> > +inline rtx& PATTERN (rtx insn)
> > +{
> > + return XEXP (insn, 3);
> > +}
>
> :(, that is going to make debugging harder. Can you make sure they are
> ignored by gdb?
> skip file rtl.h
> probably in gdbinit.in. I guess we also want skip file gimple.h and
> similarly for some other headers where we have just tiny inlines we really
> don't want to step in through.
Aha - I wasn't aware of that gdb feature. Thanks.
It can be done per-file, or per-function:
https://sourceware.org/gdb/current/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html
I tested the following, doing it on all of rtl.h, and it seems to work
well (e.g. when iterating with NEXT_INSN down a chain of insns).
We can also do gimple.h (or a more fine-grained approach there? some of
the inline fns there are non-trivial iirc) - but I'd prefer to keep that
separate from this discussion.
commit 0d12aa2b6e0533b7ac6183542338067b9ab71f66
Author: David Malcolm <dmalcolm@redhat.com>
Date: Wed Aug 6 15:58:20 2014 -0400
gdbinit.in: Skip all inline functions in rtl.h when stepping
See https://sourceware.org/gdb/current/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html
gcc/
* gdbinit.in: Skip all inline functions in rtl.h when stepping.
diff --git a/gcc/gdbinit.in b/gcc/gdbinit.in
index 25c530a..472c316 100644
--- a/gcc/gdbinit.in
+++ b/gcc/gdbinit.in
@@ -235,3 +235,6 @@ set check type off
# Note that this is added at the end because older gdb versions
# do not understand the 'skip' command.
skip file tree.h
+
+# Likewise, skip all inline functions in rtl.h.
+skip file rtl.h
\ No newline at end of file