Skip to content

Commit 1a683c1

Browse files
committed
Improve flex/bison debuggability with gdb
This changes "#line" in generated C++ source: #line 26 "doctokenizer.l" to: #line 26 "/absolute/path/to/doctokenizer.l" so that gdb can recognize the original .l .y source locations and step into them.
1 parent ff5ba4a commit 1a683c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ foreach(lex_file ${LEX_FILES})
129129
)
130130
set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1)
131131

132-
FLEX_TARGET(${lex_file} ${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}")
132+
FLEX_TARGET(${lex_file} ${CMAKE_CURRENT_LIST_DIR}/${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}")
133133
endforeach()
134134

135135

136-
BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS}")
136+
BISON_TARGET(constexp ${CMAKE_CURRENT_LIST_DIR}/constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS}")
137137

138138
add_library(doxycfg STATIC
139139
${GENERATED_SRC}/lang_cfg.h

0 commit comments

Comments
 (0)