gdbstub: Generate a single gdbstub-xml.c / gdb_static_features[]
gdb_static_features[] does not depend on target-specific code. Instead of generating one file per target, generate a single file with a single gdb_static_features[] array. Co-developed-by: Chao Liu <chao.liu.zevorn@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Tested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Link: https://lore.kernel.org/qemu-devel/20260310232045.58440-17-philmd@linaro.org Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Philippe Mathieu-Daudé committed
Mar 11, 2026 at 00:20 UTC
6511d4eed79a7e59f03e661f31924277e4d6e600
4 files changed
+23
-16
gdbstub/gdb-xml-stub.c
renamed
gdbstub/meson.build
+23
@@ -4,6 +4,29 @@
4
# types such as hwaddr.
5
#
6
7
+gdbstub_xml_files = []
8
+foreach target : target_dirs
9
+ config_target = config_target_mak[target]
10
+ if 'TARGET_XML_FILES' in config_target
11
+ foreach gdbstub_xml : config_target['TARGET_XML_FILES'].split()
12
+ if not gdbstub_xml_files.contains('gdb-xml/' + gdbstub_xml)
13
+ gdbstub_xml_files += 'gdb-xml/' + gdbstub_xml
14
+ endif
15
+ endforeach
16
+ endif
17
+endforeach
18
+if gdbstub_xml_files.length() > 0
19
+ feature_to_c = find_program('../scripts/feature_to_c.py')
20
+ gdbstub_xml = custom_target('gdbstub-xml.c',
21
+ output: 'gdbstub-xml.c',
22
+ input: files(gdbstub_xml_files),
23
+ command: [feature_to_c, '@INPUT@'],
24
+ capture: true)
25
+else
26
+ gdbstub_xml = files('gdb-xml-stub.c')
27
+endif
28
+common_ss.add(gdbstub_xml)
29
+
30
# We build two versions of gdbstub, one for each mode
31
user_ss.add(files(
32
'gdbstub.c',
meson.build
-14
@@ -4248,7 +4248,6 @@ if have_rust
4248
endif
4249
4250
4251
-feature_to_c = find_program('scripts/feature_to_c.py')
4251
rust_root_crate = find_program('scripts/rust/rust_root_crate.sh')
4252
4253
if host_os == 'darwin'
@@ -4328,19 +4327,6 @@ foreach target : target_dirs
4327
endif
4328
endif
4329
4331
- if 'TARGET_XML_FILES' in config_target
4332
- gdbstub_xml_files = []
4333
- foreach gdbstub_xml : config_target['TARGET_XML_FILES'].split()
4334
- gdbstub_xml_files += 'gdbstub/gdb-xml/' + gdbstub_xml
4335
- endforeach
4336
- gdbstub_xml = custom_target(target + '-gdbstub-xml.c',
4337
- output: target + '-gdbstub-xml.c',
4338
- input: files(gdbstub_xml_files),
4339
- command: [feature_to_c, '@INPUT@'],
4340
- capture: true)
4341
- arch_srcs += gdbstub_xml
4342
- endif
4343
-
4330
if target in config_target_info
4331
arch_srcs += config_target_info[target]
4332
else
stubs/meson.build
-2
@@ -89,8 +89,6 @@ if have_system
89
endif
90
91
if have_system or have_user
92
- stub_ss.add(files('gdbstub.c'))
93
-
92
# Also included in have_system for --disable-tcg builds
93
stub_ss.add(files('replay.c'))
94