MT#55283 adjust diagnostic line/file information

For source files generated from the "strhash" helper script, output line
and file number information into the generated .c source to help gdb and
other tools correspond the compiled code with the correct source code.

Change-Id: Ieddc86ab59b41ab26942e8a7d3c24e7800e9936f
pull/1611/head
Richard Fuchs 2 years ago
parent ab8c4b16fd
commit 407bf36985

@ -44,7 +44,7 @@ endif
t38.c: spandsp_logging.h
%.strhash.c: %.c ../utils/const_str_hash
../utils/const_str_hash < "$<" > "$@"
../utils/const_str_hash "$<" < "$<" > "$@"
$(BUILD_TEST_ALTS): ../lib/$(@:.h=-*)
../utils/build_test_wrapper "$@"

@ -78,4 +78,6 @@ static int __csh_lookup(const str *s) {
return h->num;
}
END
# adjust diagnostic line numbers and originating file
print $ARGV[0] ? "#line 1 \"$ARGV[0]\"\n" : "#line 1\n";
print $rewritten_input;

Loading…
Cancel
Save