gdbstub: Generate a single gdbstub-xml.c / gdb_static_features[]
PATCH 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]>
--- meson.build | 25 +++++++++++++++---------- stubs/gdbstub.c | 6 ------ stubs/meson.build | 2 -- 3 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 stubs/gdbstub.c
meson.build +15 -10
@@ -3867,6 +3867,21 @@ 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 +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) + ############################################## # Internal static_libraries and dependencies # ##############################################
@@ -4218,7 +4233,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 +4312,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
Quoted 19 lines · Philippe Mathieu-Daudé
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]>--- meson.build | 25 +++++++++++++++---------- stubs/gdbstub.c | 6 ------ stubs/meson.build | 2 -- 3 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 stubs/gdbstub.cmeson.build +0
-0@@ -3867,6 +3867,21 @@ subdir('linux-user') subdir('tests/qtest/libqos')
meson.build subdir('linux-user') · line 3877
Quoted 10 lines
meson.build +8
-0subdir('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
Hmm I need to check gdbstub_xml.length() > 0.
Quoted 6 lines
meson.build +6
-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)