[dpdk-dev] [PATCH] mk: add support for gdb debug info generation

Ananyev, Konstantin konstantin.ananyev at intel.com
Fri Apr 4 11:57:47 CEST 2014


Hi Cyril,
We already do have 'EXTRA_CFLAGS' and 'EXTRA_LDFLAGS' that you can use to enable debug, or any other compiler/linker options you need.
Wonder, why that is not enough?
Thanks
Konstantin

-----Original Message-----
From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Cyril Chemparathy
Sent: Thursday, April 03, 2014 6:31 PM
To: dev at dpdk.org
Subject: [dpdk-dev] [PATCH] mk: add support for gdb debug info generation

It is often useful to build with debug enabled, we add a config
(CONFIG_RTE_TOOLCHAIN_DEBUG) to do so.

Note: This patch does not include corresponding changes for ICC.  The author pleads abject ignorance in this regard, and welcomes recommendations. :-)

Signed-off-by: Cyril Chemparathy <cchemparathy at tilera.com>
---
 config/defconfig_x86_64-default-linuxapp-gcc | 1 +
 mk/toolchain/gcc/rte.vars.mk                 | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/config/defconfig_x86_64-default-linuxapp-gcc b/config/defconfig_x86_64-default-linuxapp-gcc
index f11ffbf..3b36efd 100644
--- a/config/defconfig_x86_64-default-linuxapp-gcc
+++ b/config/defconfig_x86_64-default-linuxapp-gcc
@@ -67,6 +67,7 @@ CONFIG_RTE_ARCH_X86_64=y  #  CONFIG_RTE_TOOLCHAIN="gcc"
 CONFIG_RTE_TOOLCHAIN_GCC=y
+CONFIG_RTE_TOOLCHAIN_DEBUG=n
 
 #
 # Use intrinsics or assembly code for key routines diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk index 0edb93f..81ed3fa 100644
--- a/mk/toolchain/gcc/rte.vars.mk
+++ b/mk/toolchain/gcc/rte.vars.mk
@@ -68,6 +68,11 @@ ifeq (,$(findstring -O0,$(EXTRA_CFLAGS)))  endif  endif
 
+ifeq ($(CONFIG_RTE_TOOLCHAIN_DEBUG),y)
+TOOLCHAIN_CFLAGS += -g -ggdb
+TOOLCHAIN_LDFLAGS += -g -ggdb
+endif
+
 WERROR_FLAGS := -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes  WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith  WERROR_FLAGS += -Wcast-align -Wnested-externs -Wcast-qual
--
1.8.3.1



More information about the dev mailing list