6#include "../microfmt.hpp"
24 out.write(
"<reg name=\"");
26 out.write(
"\" bitsize=\"");
27 format_to(out,
"{}", reg.bit_size);
28 out.write(
"\" regnum=\"");
29 format_to(out,
"{}", reg.gdb_index);
31 if (!reg.gdb_type.empty()) {
32 out.write(
"\" type=\"");
33 out.write(reg.gdb_type);
46 template <
typename AbiTraits>
48 string_view feature_name =
"org.gnu.gdb.custom") noexcept {
50 out.write(
"<?xml version=\"1.0\"?>\n");
51 out.write(
"<!DOCTYPE target SYSTEM \"gdb-target.dtd\">\n");
52 out.write(
"<target>\n");
55 out.write(
" <architecture>");
56 out.write(gdb_arch_name);
57 out.write(
"</architecture>\n");
60 out.write(
" <feature name=\"");
61 out.write(feature_name);
65 for (
const auto ® : AbiTraits::gdb_register_traits::layout()) {
67 format_register(out, reg);
71 out.write(
" </feature>\n");
72 out.write(
"</target>\n");
Zero-allocation printer for generating GDB target XML descriptions.
Definition register_xml_printer.hpp:14
static void format_register(sink out, const register_mapping ®) noexcept
Formats a single register as a GDB XML <reg> node.
Definition register_xml_printer.hpp:22
static void format_target_xml(sink out, string_view gdb_arch_name, string_view feature_name="org.gnu.gdb.custom") noexcept
Generates a complete GDB target.xml document for a specific architecture.
Definition register_xml_printer.hpp:47
#define MICROFMT_API_CLASS
Definition compat.hpp:181
Per-architecture ABI traits describing registers used during DWARF unwinding.
Definition gdb_decoders.hpp:15
reloco::sink sink
Type-erased, zero-allocation output sink.
Definition microfmt.hpp:46
Maps a single register between GDB and DWARF definitions.
Definition gdb_registers.hpp:15