| 1 | # |
| 2 | # The main gdbstub still relies on per-build definitions of various |
| 3 | # types. The bits pushed to system/user.c try to use guest agnostic |
| 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', |
| 33 | 'syscalls.c', |
| 34 | 'user.c' |
| 35 | )) |
| 36 | |
| 37 | system_ss.add(files( |
| 38 | 'gdbstub.c', |
| 39 | 'syscalls.c', |
| 40 | 'system.c' |
| 41 | )) |
| 42 | |
| 43 | # The user-target is specialised by the guest |
| 44 | specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-target.c')) |