Skip to contentSkip to conversation

contrib/plugins: enable debug on CONFIG_DEBUG_TCG

RFC PATCH In review Alex Bennée 2 participants 2 messages Oct 21, 2022 – Oct 24, 2022

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 contrib/plugins: enable debug on CONFIG_DEBUG_TCG

We used to rely on QEMU_CFLAGS to expose the debug flags but now this is synthesised by meson and only available to the main build. Add our own flags if we detect the build has been enabled with CONFIG_DEBUG_TCG (which is the default for --enable-debug anyway).

---
 contrib/plugins/Makefile | 1 +
 1 file changed, 1 insertion(+)
contrib/plugins/Makefile +1 -0
index df3499f4f2..23e0396687 100644
@@ -29,6 +29,7 @@ SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 CFLAGS = $(GLIB_CFLAGS)
 CFLAGS += -fPIC -Wall $(filter -W%, $(QEMU_CFLAGS))
 CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
+CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)
 CFLAGS += -I$(SRC_PATH)/include/qemu
 
 all: $(SONAMES)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Alex Bennée

We used to rely on QEMU_CFLAGS to expose the debug flags but now this is synthesised by meson and only available to the main build. Add our own flags if we detect the build has been enabled with CONFIG_DEBUG_TCG (which is the default for --enable-debug anyway).

---
  contrib/plugins/Makefile | 1 +
  1 file changed, 1 insertion(+)
contrib/plugins/Makefile +0 -0
index df3499f4f2..23e0396687 100644

contrib/plugins/Makefile SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) · line 35

Quoted 7 lines
contrib/plugins/Makefile +1 -0
@@ -29,6 +29,7 @@ SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
  CFLAGS = $(GLIB_CFLAGS)
  CFLAGS += -fPIC -Wall $(filter -W%, $(QEMU_CFLAGS))
  CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi)
+CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)
  CFLAGS += -I$(SRC_PATH)/include/qemu
 
  all: $(SONAMES)