From 29b0ea0af9ef1c0b3cd139738e331950fb7141f8 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 10 Apr 2010 08:20:28 -0400 Subject: [PATCH] Debug: Allow --debugi-V3PreShell to turn on flex debug --- src/V3File.cpp | 2 +- src/V3PreShell.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/V3File.cpp b/src/V3File.cpp index 1bd41944a..5e2e25e3b 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -343,7 +343,7 @@ private: ssize_t sizegot = 0; while (!m_readEof && (size<0 || size>sizegot)) { ssize_t todo = INFILTER_IPC_BUFSIZ; - if (size>0 && size0 && size0) { diff --git a/src/V3PreShell.cpp b/src/V3PreShell.cpp index a75911280..575bcba05 100644 --- a/src/V3PreShell.cpp +++ b/src/V3PreShell.cpp @@ -48,9 +48,12 @@ protected: //--------------------------------------- // METHODS - static int debug() { + static int debug(bool reset=false) { static int level = -1; - if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel(__FILE__); + if (VL_UNLIKELY(level < 0) || reset) { + level = v3Global.opt.debugSrcLevel(__FILE__); + if (s_preprocp) s_preprocp->debug(debug()); + } return level; } @@ -72,6 +75,8 @@ protected: } void preproc (FileLine* fl, const string& modname, V3InFilter* filterp, V3ParseImp* parsep) { + debug(true); // Recheck if debug on - first check was before command line passed + // Preprocess the given module, putting output in vppFilename UINFONL(1," Preprocessing "<