27#include "gdbsupport/tdesc.h"
65 int supply_size,
int collect_size,
67 const char *human_name,
void *cb_data)
71 bool variable_size_section = (
regset !=
nullptr
74 gdb_assert (variable_size_section || supply_size == collect_size);
76 if (data->abort_iteration)
83 std::vector<gdb_byte> buf (collect_size);
89 if (strcmp (sect_name,
".reg") == 0)
90 data->note_data->reset (elfcore_write_prstatus
91 (data->obfd, data->note_data->release (),
92 data->note_size, data->lwp,
93 gdb_signal_to_host (data->stop_signal),
96 data->note_data->reset (elfcore_write_register_note
97 (data->obfd, data->note_data->release (),
98 data->note_size, sect_name, buf.data (),
101 if (*data->note_data ==
nullptr)
102 data->abort_iteration =
true;
129 bfd *
obfd, gdb::unique_xmalloc_ptr<char> *note_data,
int *
note_size)
143 gdb::unique_xmalloc_ptr<char> *note_data,
148 const char *tdesc_xml
150 if (tdesc_xml !=
nullptr && *tdesc_xml !=
'\0')
153 if (*tdesc_xml ==
'@')
157 size_t tdesc_len = strlen (tdesc_xml) + 1;
160 note_data->reset (elfcore_write_register_note (
obfd,
161 note_data->release (),
163 ".gdb-tdesc", tdesc_xml,
void gcore_elf_make_tdesc_note(struct gdbarch *gdbarch, bfd *obfd, gdb::unique_xmalloc_ptr< char > *note_data, int *note_size)
static void gcore_elf_collect_thread_registers(const struct regcache *regcache, ptid_t ptid, bfd *obfd, gdb::unique_xmalloc_ptr< char > *note_data, int *note_size, enum gdb_signal stop_signal)
static void gcore_elf_collect_regset_section_cb(const char *sect_name, int supply_size, int collect_size, const struct regset *regset, const char *human_name, void *cb_data)
void gcore_elf_build_thread_register_notes(struct gdbarch *gdbarch, struct thread_info *info, gdb_signal stop_signal, bfd *obfd, gdb::unique_xmalloc_ptr< char > *note_data, int *note_size)
void gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
struct regcache * get_thread_arch_regcache(process_stratum_target *target, ptid_t ptid, struct gdbarch *gdbarch)
#define REGSET_VARIABLE_SIZE
gdb::unique_xmalloc_ptr< char > * note_data
gcore_elf_collect_regset_section_cb_data(struct gdbarch *gdbarch, const struct regcache *regcache, bfd *obfd, ptid_t ptid, gdb_signal stop_signal, gdb::unique_xmalloc_ptr< char > *note_data, int *note_size)
enum gdb_signal stop_signal
const struct regcache * regcache
collect_regset_ftype * collect_regset
const char * tdesc_get_features_xml(const target_desc *tdesc)
void target_fetch_registers(struct regcache *regcache, int regno)