diff --git a/src/pya/pya/pya.cc b/src/pya/pya/pya.cc index 53d0d9496..44f31d88a 100644 --- a/src/pya/pya/pya.cc +++ b/src/pya/pya/pya.cc @@ -34,6 +34,7 @@ #include "gsiDecl.h" #include "gsiDeclBasic.h" #include "tlLog.h" +#include "tlEnv.h" #include "tlStream.h" #include "tlTimer.h" #include "tlFileUtils.h" @@ -140,6 +141,16 @@ public: virtual size_t scope_index () const { + static int consider_scope = -1; + + // disable scoped debugging (e.g. DRC script lines) if $KLAYOUT_PYA_DEBUG_SCOPE is set. + if (consider_scope < 0) { + consider_scope = tl::app_flag ("pya-debug-scope") ? 0 : 1; + } + if (! consider_scope) { + return 0; + } + if (! m_scope.empty ()) { for (size_t i = 0; i < m_stack_trace.size (); ++i) { if (m_stack_trace [i].file == m_scope) { diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index 27af10ed0..00826361c 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -111,7 +111,7 @@ RubyStackTraceProvider::scope_index (const std::vector &bt // disable scoped debugging (e.g. DRC script lines) if $KLAYOUT_RBA_DEBUG_SCOPE is set. if (consider_scope < 0) { - consider_scope = tl::has_env ("KLAYOUT_RBA_DEBUG_SCOPE") ? 0 : 1; + consider_scope = tl::app_flag ("rba-debug-scope") ? 0 : 1; } if (! consider_scope) { return 0;