39#include "gdbsupport/xml-utils.h"
57#define SIG_FRAME_PC_OFFSET 96
58#define SIG_FRAME_LR_OFFSET 108
60#define SIG_FRAME_FP_OFFSET 284
64#define SIG_FRAME_LR_OFFSET64 424
66#define SIG_FRAME_FP_OFFSET64 168
69#define AIX_TEXT_SEGMENT_BASE 0x10000000
76 CORE_ADDR base, base_orig,
func;
82 if ((*this_cache) != NULL)
86 (*this_cache) = this_trad_cache;
98 tdep->
wordsize, byte_order, &backchain);
99 base = (CORE_ADDR)backchain;
107 tdep->
wordsize, byte_order, &backchain);
108 base = (CORE_ADDR)backchain;
116 base_orig + 0x38 + 52 + 8);
119 base_orig + 0x70 + 320);
124 return this_trad_cache;
129 void **this_prologue_cache,
139 void **this_prologue_cache,
int regnum)
149 void **this_prologue_cache)
161 "rs6000 aix sighandle",
220 const void *gregs,
size_t len)
234 void *gregs,
size_t len)
291 int nargs,
struct value **args, CORE_ADDR sp,
293 CORE_ADDR struct_addr)
301 gdb_byte tmp_buffer[50];
306 struct value *arg = 0;
348 for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
368 gdb_assert (len <= 8);
380 while (argbytes < len)
383 memset (word, 0, reg_size);
386 (len - argbytes) > reg_size
387 ? reg_size : len - argbytes);
389 ++ii, argbytes += reg_size;
392 goto ran_out_of_registers_for_arguments;
402 memset (word, 0, reg_size);
417ran_out_of_registers_for_arguments:
435 if ((argno < nargs) || argbytes)
441 space += ((len - argbytes + 3) & -4);
447 for (; jj < nargs; ++jj)
449 struct value *val = args[jj];
454 space = (space + 15) & -16;
475 ii += ((len - argbytes + 3) & -4) / 4;
479 for (; argno < nargs; ++argno)
489 if (
type->
code () == TYPE_CODE_FLT && f_argno < 13)
492 gdb_assert (len <= 8);
500 ii += ((len + 3) & -4) / 4;
531 gdb_byte *readbuf,
const gdb_byte *writebuf)
543 if (valtype->
code () == TYPE_CODE_ARRAY && valtype->
is_vector ()
544 && valtype->
length () == 16)
559 if (valtype->
code () == TYPE_CODE_STRUCT
560 || valtype->
code () == TYPE_CODE_UNION
561 || valtype->
code () == TYPE_CODE_ARRAY)
568 if (valtype->
code () == TYPE_CODE_FLT
569 && (valtype->
length () == 4 || valtype->
length () == 8))
622 if (valtype->
length () == 8)
624 gdb_assert (valtype->
code () != TYPE_CODE_FLT);
633 memcpy (readbuf, regval, 8);
690 catch (
const gdb_exception_error &e)
712 CORE_ADDR pc, CORE_ADDR safety)
722 absolute = (int) ((instr >> 1) & 1);
727 immediate = ((instr & ~3) << 6) >> 6;
731 dest = pc + immediate;
735 immediate = ((instr & ~3) << 16) >> 16;
739 dest = pc + immediate;
743 ext_op = (instr >> 1) & 0x3ff;
763 else if (ext_op == 528)
765 dest = regcache_raw_get_unsigned (
regcache,
772 dest = regcache_raw_get_unsigned (
regcache,
787static std::vector<CORE_ADDR>
802 if (!next_pcs.empty ())
810 if (breaks[1] == breaks[0])
813 for (ii = 0; ii < 2; ++ii)
816 if (breaks[ii] == -1)
819 next_pcs.push_back (breaks[ii]);
845 gdb_assert (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour);
887#define __LDINFO_PTRACE32__
888#define __LDINFO_PTRACE64__
891#define pinfo(type,member) \
893 struct type ldi = {0}; \
895 printf (" {%d, %d},\t/* %s */\n", \
896 offsetof (struct type, member), \
897 sizeof (ldi.member), \
905 printf (
"static const struct ld_info_desc ld_info32_desc =\n{\n");
906 pinfo (__ld_info32, ldinfo_next);
907 pinfo (__ld_info32, ldinfo_fd);
908 pinfo (__ld_info32, ldinfo_textorg);
909 pinfo (__ld_info32, ldinfo_textsize);
910 pinfo (__ld_info32, ldinfo_dataorg);
911 pinfo (__ld_info32, ldinfo_datasize);
912 pinfo (__ld_info32, ldinfo_filename);
917 printf (
"static const struct ld_info_desc ld_info64_desc =\n{\n");
918 pinfo (__ld_info64, ldinfo_next);
919 pinfo (__ld_info64, ldinfo_fd);
920 pinfo (__ld_info64, ldinfo_textorg);
921 pinfo (__ld_info64, ldinfo_textsize);
922 pinfo (__ld_info64, ldinfo_dataorg);
923 pinfo (__ld_info64, ldinfo_datasize);
924 pinfo (__ld_info64, ldinfo_filename);
981 const gdb_byte *ldi_buf)
1009 info.member_name = info.filename + strlen (info.filename) + 1;
1020 struct obstack *obstack)
1022 obstack_grow_str (obstack,
"<library name=\"");
1023 std::string p = xml_escape_text (ldi->
filename);
1024 obstack_grow_str (obstack, p.c_str ());
1025 obstack_grow_str (obstack,
"\"");
1029 obstack_grow_str (obstack,
" member=\"");
1031 obstack_grow_str (obstack, p.c_str ());
1032 obstack_grow_str (obstack,
"\"");
1035 obstack_grow_str (obstack,
" text_addr=\"");
1036 obstack_grow_str (obstack, core_addr_to_string (ldi->
textorg));
1037 obstack_grow_str (obstack,
"\"");
1039 obstack_grow_str (obstack,
" text_size=\"");
1040 obstack_grow_str (obstack, pulongest (ldi->
textsize));
1041 obstack_grow_str (obstack,
"\"");
1043 obstack_grow_str (obstack,
" data_addr=\"");
1044 obstack_grow_str (obstack, core_addr_to_string (ldi->
dataorg));
1045 obstack_grow_str (obstack,
"\"");
1047 obstack_grow_str (obstack,
" data_size=\"");
1048 obstack_grow_str (obstack, pulongest (ldi->
datasize));
1049 obstack_grow_str (obstack,
"\"");
1051 obstack_grow_str (obstack,
"></library>");
1071 gdb_byte *readbuf, ULONGEST offset, ULONGEST len,
1072 int close_ldinfo_fd)
1074 struct obstack obstack;
1078 obstack_init (&obstack);
1079 obstack_grow_str (&obstack,
"<library-list-aix version=\"1.0\">\n");
1086 if (close_ldinfo_fd)
1091 ldi_buf = ldi_buf + ldi.
next;
1094 obstack_grow_str0 (&obstack,
"</library-list-aix>\n");
1096 buf = (
const char *) obstack_finish (&obstack);
1097 len_avail = strlen (buf);
1098 if (offset >= len_avail)
1102 if (len > len_avail - offset)
1103 len = len_avail - offset;
1104 memcpy (readbuf, buf + offset, len);
1107 obstack_free (&obstack, NULL);
1119 struct bfd_section *ldinfo_sec;
1122 ldinfo_sec = bfd_get_section_by_name (
core_bfd,
".ldinfo");
1123 if (ldinfo_sec == NULL)
1124 error (_(
"cannot find .ldinfo section from core file: %s"),
1125 bfd_errmsg (bfd_get_error ()));
1126 ldinfo_size = bfd_section_size (ldinfo_sec);
1128 gdb::byte_vector ldinfo_buf (ldinfo_size);
1130 if (! bfd_get_section_contents (
core_bfd, ldinfo_sec,
1131 ldinfo_buf.data (), 0, ldinfo_size))
1132 error (_(
"unable to read .ldinfo section from core file: %s"),
1133 bfd_errmsg (bfd_get_error ()));
1200 bfd_target_xcoff_flavour,
1203 bfd_target_xcoff_flavour,
enum register_status cooked_read(int regnum, gdb_byte *buf)
void cooked_write(int regnum, const gdb_byte *buf)
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
int safe_read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order, LONGEST *return_value)
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
CORE_ADDR extract_typed_address(const gdb_byte *buf, struct type *type)
static LONGEST extract_signed_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
enum unwind_stop_reason default_frame_unwind_stop_reason(frame_info_ptr this_frame, void **this_cache)
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
ULONGEST get_frame_register_unsigned(frame_info_ptr frame, int regnum)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
frame_info_ptr get_current_frame(void)
CORE_ADDR get_frame_base(frame_info_ptr fi)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
void set_gdbarch_auto_wide_charset(struct gdbarch *gdbarch, gdbarch_auto_wide_charset_ftype *auto_wide_charset)
void set_gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
void set_gdbarch_software_single_step(struct gdbarch *gdbarch, gdbarch_software_single_step_ftype *software_single_step)
void set_gdbarch_displaced_step_finish(struct gdbarch *gdbarch, gdbarch_displaced_step_finish_ftype *displaced_step_finish)
void set_gdbarch_displaced_step_prepare(struct gdbarch *gdbarch, gdbarch_displaced_step_prepare_ftype *displaced_step_prepare)
void set_gdbarch_core_xfer_shared_libraries_aix(struct gdbarch *gdbarch, gdbarch_core_xfer_shared_libraries_aix_ftype *core_xfer_shared_libraries_aix)
void set_gdbarch_wchar_bit(struct gdbarch *gdbarch, int wchar_bit)
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value)
void set_gdbarch_wchar_signed(struct gdbarch *gdbarch, int wchar_signed)
void set_gdbarch_displaced_step_copy_insn(struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
void set_gdbarch_frame_red_zone_size(struct gdbarch *gdbarch, int frame_red_zone_size)
void set_gdbarch_displaced_step_fixup(struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup)
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
void set_gdbarch_so_ops(struct gdbarch *gdbarch, const struct target_so_ops *so_ops)
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call)
void set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections)
void() iterate_over_regset_sections_cb(const char *sect_name, int supply_size, int collect_size, const struct regset *regset, const char *human_name, void *cb_data)
function_call_return_method
struct type * check_typedef(struct type *type)
CORE_ADDR find_function_addr(struct value *function, struct type **retval_type, struct type **function_type)
struct obj_section * find_pc_section(CORE_ADDR pc)
void gdbarch_register_osabi(enum bfd_architecture arch, unsigned long machine, enum gdb_osabi osabi, void(*init_osabi)(struct gdbarch_info, struct gdbarch *))
void gdbarch_register_osabi_sniffer(enum bfd_architecture arch, enum bfd_flavour flavour, enum gdb_osabi(*sniffer_fn)(bfd *))
void ppc_collect_gregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len)
void ppc_supply_fpregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len)
std::vector< CORE_ADDR > ppc_deal_with_atomic_sequence(struct regcache *regcache)
#define PPC_MAX_REGISTER_SIZE
int ppc_floating_point_unit_p(struct gdbarch *gdbarch)
void ppc_supply_gregset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
void ppc_collect_fpregset(const struct regset *regset, const struct regcache *regcache, int regnum, void *fpregs, size_t len)
CORE_ADDR regcache_read_pc(struct regcache *regcache)
void regcache_raw_write_signed(struct regcache *regcache, int regnum, LONGEST val)
int register_size(struct gdbarch *gdbarch, int regnum)
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
void regcache_raw_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void(* func)(remote_target *remote, char *)
static const struct regset rs6000_aix32_regset
static enum gdb_osabi rs6000_aix_osabi_sniffer(bfd *abfd)
static const struct ld_info_desc ld_info32_desc
static struct trad_frame_cache * aix_sighandle_frame_cache(frame_info_ptr this_frame, void **this_cache)
#define SIG_FRAME_FP_OFFSET64
static const char * rs6000_aix_auto_wide_charset(void)
ULONGEST rs6000_aix_ld_info_to_xml(struct gdbarch *gdbarch, const gdb_byte *ldi_buf, gdb_byte *readbuf, ULONGEST offset, ULONGEST len, int close_ldinfo_fd)
static int aix_sighandle_frame_sniffer(const struct frame_unwind *self, frame_info_ptr this_frame, void **this_prologue_cache)
static void rs6000_aix_collect_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *gregs, size_t len)
void _initialize_rs6000_aix_tdep()
static const struct ld_info_desc ld_info64_desc
static CORE_ADDR rs6000_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr)
#define SIG_FRAME_PC_OFFSET
static void rs6000_aix_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
static struct value * aix_sighandle_frame_prev_register(frame_info_ptr this_frame, void **this_prologue_cache, int regnum)
static void rs6000_aix_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
static void aix_sighandle_frame_this_id(frame_info_ptr this_frame, void **this_prologue_cache, struct frame_id *this_id)
static void rs6000_aix_shared_library_to_xml(struct ld_info *ldi, struct obstack *obstack)
#define SIG_FRAME_FP_OFFSET
static struct ppc_reg_offsets rs6000_aix32_reg_offsets
static CORE_ADDR branch_dest(struct regcache *regcache, int opcode, int instr, CORE_ADDR pc, CORE_ADDR safety)
#define AIX_TEXT_SEGMENT_BASE
static ULONGEST rs6000_aix_core_xfer_shared_libraries_aix(struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
static const struct regset rs6000_aix64_regset
static struct ppc_reg_offsets rs6000_aix64_reg_offsets
static void rs6000_aix_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len)
static std::vector< CORE_ADDR > rs6000_software_single_step(struct regcache *regcache)
static CORE_ADDR rs6000_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
#define SIG_FRAME_LR_OFFSET64
static struct ld_info rs6000_aix_extract_ld_info(struct gdbarch *gdbarch, const gdb_byte *ldi_buf)
static enum return_value_convention rs6000_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static const struct frame_unwind aix_sighandle_frame_unwind
const struct target_so_ops solib_aix_so_ops
CORE_ADDR solib_aix_get_toc_value(CORE_ADDR pc)
struct type * builtin_data_ptr
struct ldinfo_field ldinfo_textsize
struct ldinfo_field ldinfo_textorg
struct ldinfo_field ldinfo_next
struct ldinfo_field ldinfo_datasize
struct ldinfo_field ldinfo_dataorg
struct ldinfo_field ldinfo_fd
struct ldinfo_field ldinfo_filename
struct bfd_section * the_bfd_section
frame_info_ptr this_frame
void target_float_convert(const gdb_byte *from, const struct type *from_type, gdb_byte *to, const struct type *to_type)
void target_store_registers(struct regcache *regcache, int regno)
struct trad_frame_cache * trad_frame_cache_zalloc(frame_info_ptr this_frame)
void trad_frame_set_reg_addr(struct trad_frame_cache *this_trad_cache, int regnum, CORE_ADDR addr)
void trad_frame_get_id(struct trad_frame_cache *this_trad_cache, struct frame_id *this_id)
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
void trad_frame_set_this_base(struct trad_frame_cache *this_trad_cache, CORE_ADDR this_base)
void trad_frame_set_reg_value(struct trad_frame_cache *this_trad_cache, int regnum, LONGEST val)
struct value * trad_frame_get_register(struct trad_frame_cache *this_trad_cache, frame_info_ptr this_frame, int regnum)
struct type * value_type(const struct value *value)
gdb::array_view< const gdb_byte > value_contents(struct value *value)
LONGEST unpack_long(struct type *type, const gdb_byte *valaddr)
int xcoff_get_n_import_files(bfd *abfd)