2022-09-29 12:42:24 +01:00
|
|
|
#
|
|
|
|
|
# The main gdbstub still relies on per-build definitions of various
|
2023-10-04 11:06:22 +02:00
|
|
|
# types. The bits pushed to system/user.c try to use guest agnostic
|
2022-09-29 12:42:24 +01:00
|
|
|
# types such as hwaddr.
|
|
|
|
|
#
|
|
|
|
|
|
2026-03-11 00:20:44 +01:00
|
|
|
gdbstub_xml_files = []
|
|
|
|
|
foreach target : target_dirs
|
|
|
|
|
config_target = config_target_mak[target]
|
|
|
|
|
if 'TARGET_XML_FILES' in config_target
|
|
|
|
|
foreach gdbstub_xml : config_target['TARGET_XML_FILES'].split()
|
|
|
|
|
if not gdbstub_xml_files.contains('gdb-xml/' + gdbstub_xml)
|
|
|
|
|
gdbstub_xml_files += 'gdb-xml/' + gdbstub_xml
|
|
|
|
|
endif
|
|
|
|
|
endforeach
|
|
|
|
|
endif
|
|
|
|
|
endforeach
|
|
|
|
|
if gdbstub_xml_files.length() > 0
|
|
|
|
|
feature_to_c = find_program('../scripts/feature_to_c.py')
|
|
|
|
|
gdbstub_xml = custom_target('gdbstub-xml.c',
|
|
|
|
|
output: 'gdbstub-xml.c',
|
|
|
|
|
input: files(gdbstub_xml_files),
|
|
|
|
|
command: [feature_to_c, '@INPUT@'],
|
|
|
|
|
capture: true)
|
|
|
|
|
else
|
|
|
|
|
gdbstub_xml = files('gdb-xml-stub.c')
|
|
|
|
|
endif
|
|
|
|
|
common_ss.add(gdbstub_xml)
|
|
|
|
|
|
2023-03-02 18:57:58 -08:00
|
|
|
# We build two versions of gdbstub, one for each mode
|
2025-05-21 15:34:13 -07:00
|
|
|
user_ss.add(files(
|
2025-03-12 14:33:07 -07:00
|
|
|
'gdbstub.c',
|
2025-03-12 14:37:07 -07:00
|
|
|
'syscalls.c',
|
2025-03-12 14:33:07 -07:00
|
|
|
'user.c'
|
|
|
|
|
))
|
|
|
|
|
|
2025-05-21 15:34:13 -07:00
|
|
|
system_ss.add(files(
|
2025-03-12 14:33:07 -07:00
|
|
|
'gdbstub.c',
|
2025-03-12 14:37:07 -07:00
|
|
|
'syscalls.c',
|
2025-03-12 14:33:07 -07:00
|
|
|
'system.c'
|
|
|
|
|
))
|
2023-03-02 18:57:57 -08:00
|
|
|
|
2023-03-02 18:57:47 -08:00
|
|
|
# The user-target is specialised by the guest
|
|
|
|
|
specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-target.c'))
|