gdbstub: Generate a single gdbstub-xml.c / gdb_static_features[]
PATCH v2 1/1 gdbstub: Generate a single gdbstub-xml.c / gdb_static_features[]
gdb_static_features[] only contains strings, nothing target-specific. Instead of generating one file per target, generate a single file with a single gdb_static_features[] array. Remove the stub.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
---
v2: Check array length
--- meson.build | 27 +++++++++++++++++---------- stubs/gdbstub.c | 6 ------ stubs/meson.build | 2 -- 3 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 stubs/gdbstub.c
meson.build +17 -10
@@ -3867,6 +3867,23 @@ subdir('linux-user') subdir('tests/qtest/libqos') subdir('tests/qtest/fuzz') +feature_to_c = find_program('scripts/feature_to_c.py') +gdbstub_xml = [] +foreach target : target_dirs + config_target = config_target_mak[target] + if 'TARGET_XML_FILES' in config_target + gdbstub_xml += config_target['TARGET_XML_FILES'].split() + endif +endforeach +if gdbstub_xml.length() > 0 + gdbstub_xml = custom_target('gdbstub-xml.c', + output: 'gdbstub-xml.c', + input: files(gdbstub_xml), + command: [feature_to_c, '@INPUT@'], + capture: true) + common_ss.add(gdbstub_xml) +endif + ############################################## # Internal static_libraries and dependencies # ##############################################
@@ -4218,7 +4235,6 @@ if have_rust endif -feature_to_c = find_program('scripts/feature_to_c.py') rust_root_crate = find_program('scripts/rust/rust_root_crate.sh') if host_os == 'darwin'
@@ -4298,15 +4314,6 @@ foreach target : target_dirs endif endif - if 'TARGET_XML_FILES' in config_target - gdbstub_xml = custom_target(target + '-gdbstub-xml.c', - output: target + '-gdbstub-xml.c', - input: files(config_target['TARGET_XML_FILES'].split()), - command: [feature_to_c, '@INPUT@'], - capture: true) - arch_srcs += gdbstub_xml - endif - if target in config_target_info arch_srcs += config_target_info[target] else
stubs/gdbstub.c deleted +0 -6
@@ -1,6 +0,0 @@ -#include "qemu/osdep.h" -#include "exec/gdbstub.h" /* gdb_static_features */ - -const GDBFeature gdb_static_features[] = { - {NULL } -};
stubs/meson.build +0 -2
@@ -89,8 +89,6 @@ if have_system endif if have_system or have_user - stub_ss.add(files('gdbstub.c')) - # Also included in have_system for --disable-tcg builds stub_ss.add(files('replay.c'))
Signature · 1 line
2.52.0