Attention is currently required from: Yu-Ping Wu.
Hello Yu-Ping Wu,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/81112?usp=email
to review the following change.
Change subject: tests: Add `DEBUG` make commandline option to generate debug symbols ......................................................................
tests: Add `DEBUG` make commandline option to generate debug symbols
Sometimes when a test doesn't work it's convenient to run it through GDB. This patch adds a variable you can set on the make commandline to conveniently enable all the compiler flags needed to make that work.
Change-Id: I3ac80ad095e0b72cc3176cbf915d1f390cd01558 Signed-off-by: Julius Werner jwerner@chromium.org --- M payloads/libpayload/tests/Makefile.mk M tests/Makefile.common 2 files changed, 14 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/81112/1
diff --git a/payloads/libpayload/tests/Makefile.mk b/payloads/libpayload/tests/Makefile.mk index e271a7c..9bac9e6 100644 --- a/payloads/libpayload/tests/Makefile.mk +++ b/payloads/libpayload/tests/Makefile.mk @@ -47,7 +47,13 @@ TEST_CFLAGS += -Wstrict-aliasing -Wshadow -Werror TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type
-TEST_CFLAGS += -std=gnu11 -Os -ffunction-sections -fdata-sections -fno-builtin +TEST_CFLAGS += -std=gnu11 -ffunction-sections -fdata-sections -fno-builtin + +ifneq ($(filter-out 0,$(DEBUG)),) +TEST_CFLAGS += -Og -ggdb3 +else +TEST_CFLAGS += -Os +endif
# Make unit-tests detectable by the code TEST_CFLAGS += -D__TEST__ diff --git a/tests/Makefile.common b/tests/Makefile.common index 5cb7b25..ace16d2 100644 --- a/tests/Makefile.common +++ b/tests/Makefile.common @@ -51,7 +51,13 @@ TEST_CFLAGS += -Wno-array-compare -Wno-packed-not-aligned -Wno-trigraphs TEST_CFLAGS += -Wno-unused-but-set-variables
-TEST_CFLAGS += -std=gnu11 -Os -ffunction-sections -fdata-sections -fno-builtin +TEST_CFLAGS += -std=gnu11 -ffunction-sections -fdata-sections -fno-builtin + +ifneq ($(filter-out 0,$(DEBUG)),) +TEST_CFLAGS += -Og -ggdb3 +else +TEST_CFLAGS += -Os +endif
TEST_CFLAGS += -D__TEST__