41 #define LWPINFO_OFFSET 0x4 44 #define LWPINFO_PL_FLAGS 0x8 45 #define LWPINFO64_PL_SIGINFO 0x30 46 #define LWPINFO32_PL_SIGINFO 0x2c 49 #define PL_FLAG_SI 0x20 52 #define SIZE64_SIGINFO_T 80 53 #define SIZE32_SIGINFO_T 64 98 struct bfd_section *section;
112 section = bfd_get_section_by_name (
core_bfd, section_name.
c_str ());
113 if (section != NULL && bfd_section_size (
core_bfd, section) > 0)
117 if (
size >
sizeof buf - 1)
118 size =
sizeof buf - 1;
119 if (bfd_get_section_contents (
core_bfd, section, buf, (file_ptr) 0,
129 if (strcmp (buf, elf_tdata (
core_bfd)->core->program) != 0)
150 if (
offset > siginfo_size)
154 asection *section = bfd_get_section_by_name (
core_bfd, section_name.
c_str ());
159 if (!bfd_get_section_contents (
core_bfd, section, buf,
167 if (
offset + len > siginfo_size)
168 len = siginfo_size -
offset;
176 if (!bfd_get_section_contents (
core_bfd, section, readbuf,
177 siginfo_offset +
offset, len))
211 const char *human_name,
void *cb_data)
226 if (strcmp (sect_name,
".reg") == 0)
227 data->
note_data = (
char *) elfcore_write_prstatus
231 data->
note_data = (
char *) elfcore_write_register_note
233 sect_name, buf,
size);
301 Elf_Internal_Ehdr *i_ehdrp;
302 struct thread_info *curr_thr, *signalled_thr, *thr;
305 i_ehdrp = elf_elfheader (obfd);
306 i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
313 char *psargs = xstrdup (fname);
319 note_data = elfcore_write_prpsinfo (obfd, note_data, note_size,
339 if (curr_thr->suspend.stop_signal != GDB_SIGNAL_0)
340 signalled_thr = curr_thr;
344 if (signalled_thr == NULL)
345 signalled_thr = curr_thr;
349 thread_args.
obfd = obfd;
357 if (thr == signalled_thr)
377 const char *description;
382 #define _TAGNAME(tag) #tag 383 #define TAGNAME(tag) _TAGNAME(AT_##tag) 384 #define TAG(tag, text, kind) \ 385 case AT_FREEBSD_##tag: name = TAGNAME(tag); description = text; format = kind; break 411 struct type *int_type, *int32_type, *uint32_type, *long_type, *void_ptr_type;
412 struct type *uid_type, *pid_type;
413 struct type *sigval_type, *reason_type;
414 struct type *siginfo_type;
431 TYPE_NAME (sigval_type) = xstrdup (
"sigval");
481 TYPE_NAME (siginfo_type) = xstrdup (
"siginfo");
510 internal_error (__FILE__, __LINE__,
_(
"fbsd_get_sycall_number called"));
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int bit, const char *name)
void set_gdbarch_core_pid_to_str(struct gdbarch *gdbarch, gdbarch_core_pid_to_str_ftype core_pid_to_str)
void set_gdbarch_core_thread_name(struct gdbarch *gdbarch, gdbarch_core_thread_name_ftype core_thread_name)
#define LWPINFO32_PL_SIGINFO
int ptid_get_pid(const ptid_t &ptid)
char * get_inferior_args(void)
int gdbarch_int_bit(struct gdbarch *gdbarch)
regcache(gdbarch *gdbarch)
static struct gdbarch_data * fbsd_gdbarch_data_handle
#define TYPE_NAME(thistype)
void set_gdbarch_get_siginfo_type(struct gdbarch *gdbarch, gdbarch_get_siginfo_type_ftype get_siginfo_type)
char * get_exec_file(int err)
static LONGEST fbsd_get_syscall_number(struct gdbarch *gdbarch, ptid_t ptid)
void internal_error(const char *file, int line, const char *fmt,...)
struct thread_info * inferior_thread(void)
static void fbsd_corefile_thread(struct thread_info *info, struct fbsd_corefile_thread_data *args)
int gdbarch_long_bit(struct gdbarch *gdbarch)
void target_fetch_registers(struct regcache *regcache, int regno)
enum gdb_signal stop_signal
void set_gdbarch_core_xfer_siginfo(struct gdbarch *gdbarch, gdbarch_core_xfer_siginfo_ftype core_xfer_siginfo)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
void default_print_auxv_entry(struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val)
const char * normal_pid_to_str(ptid_t ptid)
struct thread_info * iterate_over_threads(thread_callback_func, void *)
void _initialize_fbsd_tdep(void)
void append_composite_type_field(struct type *t, const char *name, struct type *field)
int gdbarch_iterate_over_regset_sections_p(struct gdbarch *gdbarch)
#define CATCH(EXCEPTION, MASK)
thread_suspend_state suspend
static LONGEST fbsd_core_xfer_siginfo(struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
#define LWPINFO64_PL_SIGINFO
static struct fbsd_gdbarch_data * get_fbsd_gdbarch_data(struct gdbarch *gdbarch)
void exception_print(struct ui_file *file, struct gdb_exception e)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
int gdb_signal_to_host(enum gdb_signal)
void fbsd_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
struct type * init_vector_type(struct type *elt_type, int n)
#define TYPE_TARGET_STUB(t)
enum gdb_signal stop_signal
struct type * siginfo_type
void set_gdbarch_make_corefile_notes(struct gdbarch *gdbarch, gdbarch_make_corefile_notes_ftype make_corefile_notes)
const char * c_str() const
void set_xml_syscall_file_name(struct gdbarch *gdbarch, const char *name)
long ptid_get_lwp(const ptid_t &ptid)
static void fbsd_collect_regset_section_cb(const char *sect_name, int size, const struct regset *regset, const char *human_name, void *cb_data)
#define TYPE_TARGET_TYPE(thistype)
#define ALL_NON_EXITED_THREADS(T)
void update_thread_list(void)
int xsnprintf(char *str, size_t size, const char *format,...)
void set_gdbarch_get_syscall_number(struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype get_syscall_number)
#define TAG(tag, text, kind)
static const char * fbsd_core_thread_name(struct gdbarch *gdbarch, struct thread_info *thr)
static LONGEST extract_signed_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
void fprint_auxv_entry(struct ui_file *file, const char *name, const char *description, enum auxv_format format, CORE_ADDR type, CORE_ADDR val)
const struct regcache * regcache
static void fbsd_print_auxv_entry(struct gdbarch *gdbarch, struct ui_file *file, CORE_ADDR type, CORE_ADDR val)
static char * fbsd_collect_thread_registers(const struct regcache *regcache, ptid_t ptid, bfd *obfd, char *note_data, int *note_size, enum gdb_signal stop_signal)
void set_gdbarch_print_auxv_entry(struct gdbarch *gdbarch, gdbarch_print_auxv_entry_ftype print_auxv_entry)
unsigned long long ULONGEST
#define TYPE_LENGTH(thistype)
static const char * fbsd_core_pid_to_str(struct gdbarch *gdbarch, ptid_t ptid)
static int find_signalled_thread(struct thread_info *info, void *data)
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
struct type * lookup_pointer_type(struct type *type)
enum gdb_signal stop_signal
struct type * arch_composite_type(struct gdbarch *gdbarch, const char *name, enum type_code code)
struct regcache * get_thread_arch_regcache(ptid_t ptid, struct gdbarch *gdbarch)
static void * init_fbsd_gdbarch_data(struct gdbarch *gdbarch)
static struct type * fbsd_get_siginfo_type(struct gdbarch *gdbarch)
void gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
static char * fbsd_make_corefile_notes(struct gdbarch *gdbarch, bfd *obfd, int *note_size)
collect_regset_ftype * collect_regset