* [PATCH] meson.build: Add --enable-pdb option
@ 2026-03-23 22:02 Steve Aarnio
0 siblings, 0 replies; only message in thread
From: Steve Aarnio @ 2026-03-23 22:02 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, mohamed, mjt, Steve Aarnio
This option will (attempt to) modify the QEMU compile and link flags to emit
PDB symbol files rather than the standard (DWARF?) symbol output from gcc/clang.
Prerequisites for this are host_os == Windows and --enable-debug flag set.
This enables using native Windows debug tools (Windbg/Visual Studio) for
debugging QEMU.
Signed-off-by: Steve Aarnio <saarnio@qti.qualcomm.com>
---
Added Mohamed's suggested change to configure.
configure | 3 +++
meson.build | 5 +++++
meson_options.txt | 2 ++
3 files changed, 10 insertions(+)
diff --git a/configure b/configure
index 42c45fe47a..502a61412f 100755
--- a/configure
+++ b/configure
@@ -707,6 +707,9 @@ for opt do
meson_option_parse --enable-debug-mutex ""
meson_option_add -Doptimization=0
;;
+ --enable-pdb)
+ meson_option_add -Dpdb=true
+ ;;
--disable-tcg) tcg="disabled"
;;
--enable-tcg) tcg="enabled"
diff --git a/meson.build b/meson.build
index d7c4095b39..e6f17dd5f7 100644
--- a/meson.build
+++ b/meson.build
@@ -692,6 +692,11 @@ endif
qemu_common_flags += hardening_flags
+if host_os == 'windows' and get_option('debug') and get_option('pdb')
+ qemu_common_flags += cc.get_supported_arguments('-g','-gcodeview','-gcolumn-info','-fno-omit-frame-pointer')
+ qemu_ldflags += cc.get_supported_link_arguments('-g','-Wl,--pdb=')
+endif
+
# Collect warning flags we want to set, sorted alphabetically
warn_flags = [
# First enable interesting warnings
diff --git a/meson_options.txt b/meson_options.txt
index 31d5916cfc..bffbc7923d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -372,6 +372,8 @@ option('debug_stack_usage', type: 'boolean', value: false,
description: 'measure coroutine stack usage')
option('qom_cast_debug', type: 'boolean', value: true,
description: 'cast debugging support')
+option('pdb', type: 'boolean', value: false,
+ description: 'use pdb symbol format on Windows debug builds')
option('slirp_smbd', type : 'feature', value : 'auto',
description: 'use smbd (at path --smbd=*) in slirp networking')
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-23 22:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-23 22:02 [PATCH] meson.build: Add --enable-pdb option Steve Aarnio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox