dfilter: Disable flex debug trace for release builds
This omits the flex debug code in the binary if the build type is RelMinSize or Release. It replaces the "%option debug" stanza with the -d command line option, to be able to configure the flex behaviour.
This commit is contained in:
parent
65ce33b5d7
commit
613331f07b
|
@ -34,7 +34,7 @@ MACRO(ADD_LEX_FILES _source _generated)
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${_outc} ${_outh}
|
OUTPUT ${_outc} ${_outh}
|
||||||
COMMAND ${LEX_EXECUTABLE} -o${_outc} --header-file=${_outh} ${_in}
|
COMMAND ${LEX_EXECUTABLE} $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:--debug> -o${_outc} --header-file=${_outh} ${_in}
|
||||||
DEPENDS ${_in}
|
DEPENDS ${_in}
|
||||||
)
|
)
|
||||||
LIST(APPEND ${_source} ${_in})
|
LIST(APPEND ${_source} ${_in})
|
||||||
|
|
|
@ -425,16 +425,16 @@ dfilter_compile_real(const gchar *text, dfilter_t **dfp,
|
||||||
|
|
||||||
df_yyset_extra(&state, scanner);
|
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. */
|
/* Enable/disable debugging for Flex. */
|
||||||
df_yyset_debug(flags & DF_DEBUG_FLEX, scanner);
|
df_yyset_debug(flags & DF_DEBUG_FLEX, scanner);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
/* Enable/disable debugging for Lemon. */
|
/* Enable/disable debugging for Lemon. */
|
||||||
DfilterTrace(flags & DF_DEBUG_LEMON ? stderr : NULL, "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
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -20,11 +20,6 @@
|
||||||
*/
|
*/
|
||||||
%option warn
|
%option warn
|
||||||
|
|
||||||
/*
|
|
||||||
* Generate debug code (output is off by default for reentrant scanners).
|
|
||||||
*/
|
|
||||||
%option debug
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We want a reentrant scanner.
|
* We want a reentrant scanner.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue