use /depot as depot directory in debug info

By using GCC's --debug-prefix-map argument, we can make sure that debug
archives always refer to source files at /depot. With this change, GDB
can be pointed to the correct source-file location by using the `set
substitute-path /depot /path/to/local/depot`.

Fixes #5260
This commit is contained in:
Johannes Schlatow 2024-06-27 15:34:27 +02:00 committed by Norman Feske
parent d44ec53cd3
commit b5c9107465

View File

@ -124,6 +124,12 @@ endif
CC_OPT += -fprofile-arcs -ftest-coverage -fprofile-dir=$(PROFILE_DIR)
endif
ifneq ($(findstring /depot/,$(CURDIR)),)
DEBUG_PREFIX = $(shell echo $(CURDIR) | \
sed -e 's|/depot/.*$$|/depot/|')
CC_OPT += -fdebug-prefix-map=$(DEBUG_PREFIX)=/depot/
endif
#
# Enable the undefined behavior sanitizer if requested
#