[RFC PATCH] contrib/plugins: enable debug on CONFIG_DEBUG_TCG

Alex Bennée posted 1 patch 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221021155146.2729598-1-alex.bennee@linaro.org
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>
contrib/plugins/Makefile | 1 +
1 file changed, 1 insertion(+)
[RFC PATCH] contrib/plugins: enable debug on CONFIG_DEBUG_TCG
Posted by Alex Bennée 1 year, 6 months ago
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).

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
 contrib/plugins/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index df3499f4f2..23e0396687 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -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)
-- 
2.34.1


Re: [RFC PATCH] contrib/plugins: enable debug on CONFIG_DEBUG_TCG
Posted by Philippe Mathieu-Daudé 1 year, 6 months ago
On 21/10/22 17:51, Alex Bennée wrote:
> 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).
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   contrib/plugins/Makefile | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
> index df3499f4f2..23e0396687 100644
> --- a/contrib/plugins/Makefile
> +++ b/contrib/plugins/Makefile
> @@ -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)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>