+#if SU_HAS_PERL(5, 8, 9)
+# define SU_SKIP_DB_MAX 2
+#else
+# define SU_SKIP_DB_MAX 3
+#endif
+
+/* Skip context sequences of 1 to SU_SKIP_DB_MAX (included) block contexts
+ * followed by a DB sub */
+
+#define SU_SKIP_DB(C) \
+ STMT_START { \
+ I32 i = 1; \
+ PERL_CONTEXT *cx = cxstack + (C); \
+ do { \
+ if (CxTYPE(cx) == CXt_BLOCK && (C) >= i) { \
+ --cx; \
+ if (CxTYPE(cx) == CXt_SUB && cx->blk_sub.cv == GvCV(PL_DBsub)) { \
+ (C) -= i + 1; \
+ break; \
+ } \
+ } else \
+ break; \
+ } while (++i <= SU_SKIP_DB_MAX); \
+ } STMT_END
+