| # SPDX-License-Identifier: GPL-2.0-or-later |
| def writeliteral(indent, bytes): |
| sys.stdout.write(' ' * indent) |
| sys.stdout.write(' ' * indent) |
| elif c >= 32 and c < 127: |
| sys.stdout.write(c.to_bytes(1, 'big').decode()) |
| sys.stdout.write(f'\{c:03o}') |
| sys.stdout.write('#include "qemu/osdep.h"\n' \ |
| '#include "exec/gdbstub.h"\n' \ |
| 'const GDBFeature gdb_static_features[] = {\n') |
| for input in sys.argv[1:]: |
| with open(input, 'rb') as file: |
| writeliteral(8, bytes(os.path.basename(input), 'utf-8')) |
| sys.stdout.write('\n },\n') |
| sys.stdout.write(' { NULL }\n};\n') |