diff --git a/cmake/modules/FindLEX.cmake b/cmake/modules/FindLEX.cmake index 0008bc43dd..20caa096c8 100644 --- a/cmake/modules/FindLEX.cmake +++ b/cmake/modules/FindLEX.cmake @@ -34,7 +34,7 @@ MACRO(ADD_LEX_FILES _source _generated) ADD_CUSTOM_COMMAND( OUTPUT ${_outc} ${_outh} - COMMAND ${LEX_EXECUTABLE} -o${_outc} --header-file=${_outh} ${_in} + COMMAND ${LEX_EXECUTABLE} $<$,$>:--debug> -o${_outc} --header-file=${_outh} ${_in} DEPENDS ${_in} ) LIST(APPEND ${_source} ${_in}) diff --git a/epan/dfilter/dfilter.c b/epan/dfilter/dfilter.c index 934a8f95f2..6eab71797c 100644 --- a/epan/dfilter/dfilter.c +++ b/epan/dfilter/dfilter.c @@ -425,16 +425,16 @@ dfilter_compile_real(const gchar *text, dfilter_t **dfp, df_yyset_extra(&state, scanner); +#ifdef NDEBUG + if (flags & DF_DEBUG_FLEX || flags & DF_DEBUG_LEMON) { + ws_message("Compile Wireshark without NDEBUG to enable Flex and/or Lemon debug traces"); + } +#else /* Enable/disable debugging for Flex. */ df_yyset_debug(flags & DF_DEBUG_FLEX, scanner); -#ifndef NDEBUG /* Enable/disable debugging for Lemon. */ DfilterTrace(flags & DF_DEBUG_LEMON ? stderr : NULL, "lemon> "); -#else - if (flags & DF_DEBUG_LEMON) { - ws_message("Compile Wireshark without NDEBUG to enable Lemon debug traces"); - } #endif while (1) { diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l index 04c57de19a..cda287ef54 100644 --- a/epan/dfilter/scanner.l +++ b/epan/dfilter/scanner.l @@ -20,11 +20,6 @@ */ %option warn -/* - * Generate debug code (output is off by default for reentrant scanners). - */ -%option debug - /* * We want a reentrant scanner. */