Re: NTH_INSN macro like NEXT_INSN?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Segher,

> It's not exactly the same, but debug_rtx_list (prl in our gdbinit) might
> help you?

I see, thanks. I ended up bodging it in print-rtl.c

Maxim

diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index fbb108568b3..8c1f3dbf968 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -74,6 +74,18 @@ int flag_dump_unnumbered = 0;
 int flag_dump_unnumbered_links = 0;
 #endif

+DEBUG_FUNCTION const rtx_insn *
+NTH_INSN (const rtx_insn *insn, int nth)
+{
+  int i;
+  const_rtx next = (const_rtx) insn;
+
+  for (i = 0; i < nth; ++i)
+    next = XEXP (next, 1);
+
+  return (const rtx_insn *)next;
+}
+
 /* Constructor for rtx_writer.  */

 rtx_writer::rtx_writer (FILE *outf, int ind, bool simple, bool compact,



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux