Debug: Allow --debugi-V3PreShell to turn on flex debug

This commit is contained in:
Wilson Snyder 2010-04-10 08:20:28 -04:00
parent 57d00946be
commit 29b0ea0af9
2 changed files with 8 additions and 3 deletions

View File

@ -343,7 +343,7 @@ private:
ssize_t sizegot = 0; ssize_t sizegot = 0;
while (!m_readEof && (size<0 || size>sizegot)) { while (!m_readEof && (size<0 || size>sizegot)) {
ssize_t todo = INFILTER_IPC_BUFSIZ; ssize_t todo = INFILTER_IPC_BUFSIZ;
if (size>0 && size<INFILTER_IPC_BUFSIZ) todo = size; if (size>0 && size<todo) todo = size;
ssize_t got = read (fd, buf, todo); ssize_t got = read (fd, buf, todo);
//UINFO(9,"RD GOT g "<< got<<" e "<<errno<<" "<<strerror(errno)<<endl); usleep(50*1000); //UINFO(9,"RD GOT g "<< got<<" e "<<errno<<" "<<strerror(errno)<<endl); usleep(50*1000);
if (got>0) { if (got>0) {

View File

@ -48,9 +48,12 @@ protected:
//--------------------------------------- //---------------------------------------
// METHODS // METHODS
static int debug() { static int debug(bool reset=false) {
static int level = -1; 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; return level;
} }
@ -72,6 +75,8 @@ protected:
} }
void preproc (FileLine* fl, const string& modname, V3InFilter* filterp, V3ParseImp* parsep) { 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 // Preprocess the given module, putting output in vppFilename
UINFONL(1," Preprocessing "<<modname<<endl); UINFONL(1," Preprocessing "<<modname<<endl);