32 #define insn_d(opcd, rts, ra, d) \
33 ((((opcd) & 0x3f) << 26) \
34 | (((rts) & 0x1f) << 21) \
35 | (((ra) & 0x1f) << 16) \
38 #define insn_ds(opcd, rts, ra, d, xo) \
39 ((((opcd) & 0x3f) << 26) \
40 | (((rts) & 0x1f) << 21) \
41 | (((ra) & 0x1f) << 16) \
45 #define insn_xfx(opcd, rts, spr, xo) \
46 ((((opcd) & 0x3f) << 26) \
47 | (((rts) & 0x1f) << 21) \
48 | (((spr) & 0x1f) << 16) \
49 | (((spr) & 0x3e0) << 6) \
50 | (((xo) & 0x3ff) << 1))
74 { -1,
insn_ds (62, 2, 1, 40, 0), 0 },
77 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 12, 0, 0), 0 },
83 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 2, 12, 0, 0), 0 },
92 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 12, 0, 0), 1 },
95 { -1, 0x4e800420, 0 },
110 { -1,
insn_ds (62, 2, 1, 40, 0), 1 },
116 { -1,
insn_ds (62, 2, 1, 40, 0), 1 },
119 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 12, 0, 0), 0 },
128 { -1, 0x7d6b5a78, 1 },
131 { -1, 0x7d8c5a14, 1 },
134 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 2, 12, 0, 0), 0 },
137 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 12, 0, 0), 1 },
140 { -1, 0x4e800420, 1 },
143 { -1, 0x28220000, 1 },
153 { -1,
insn_ds (62, 2, 1, 40, 0), 1 },
156 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 2, 0, 0), 0 },
165 { -1, 0x7d6b5a78, 1 },
168 { -1, 0x7c425a14, 1 },
171 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 2, 0, 0), 1 },
174 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 2, 2, 0, 0), 0 },
177 { -1, 0x4e800420, 1 },
180 { -1, 0x28220000, 1 },
192 { -1,
insn_ds (62, 2, 1, 40, 0), 1 },
198 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 12, 11, 0, 0), 0 },
207 { -1, 0x7d826278, 1 },
210 { -1, 0x7d6b1214, 1 },
213 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 2, 11, 0, 0), 0 },
216 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 11, 0, 0), 1 },
219 { -1, 0x4e800420, 1 },
222 { -1, 0x28220000, 1 },
234 { -1,
insn_ds (62, 2, 1, 40, 0), 1 },
237 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 12, 2, 0, 0), 0 },
246 { -1, 0x7d8b6278, 1 },
249 { -1, 0x7c425a14, 1 },
252 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 11, 2, 0, 0), 1 },
255 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 2, 2, 0, 0), 0 },
258 { -1, 0x4e800420, 1 },
261 { -1, 0x28220000, 1 },
271 { -1,
insn_ds (62, 2, 1, 24, 0), 1 },
277 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 12, 11, 0, 0), 0 },
283 { -1, 0x4e800420, 0 },
293 { -1,
insn_ds (62, 2, 1, 24, 0), 1 },
296 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 12, 2, 0, 0), 0 },
302 { -1, 0x4e800420, 0 },
313 { -1,
insn_ds (62, 2, 1, 24, 0), 1 },
319 {
insn_ds (-1, -1, -1, 0, -1),
insn_ds (58, 12, 12, 0, 0), 0 },
325 { -1, 0x4e800420, 0 },
460 #define MAX(a,b) ((a) > (b) ? (a) : (b))
461 unsigned int insns[
MAX (
MAX (
MAX (ARRAY_SIZE (ppc64_standard_linkage1),
462 ARRAY_SIZE (ppc64_standard_linkage2)),
463 MAX (ARRAY_SIZE (ppc64_standard_linkage3),
464 ARRAY_SIZE (ppc64_standard_linkage4))),
465 MAX (
MAX (ARRAY_SIZE (ppc64_standard_linkage5),
466 ARRAY_SIZE (ppc64_standard_linkage6)),
467 MAX (ARRAY_SIZE (ppc64_standard_linkage7),
468 ARRAY_SIZE (ppc64_standard_linkage8))))
477 scan_limit = ARRAY_SIZE (insns) - 1;
479 for (i = 0; i < scan_limit; i++)
481 if (i < ARRAY_SIZE (ppc64_standard_linkage8) - 1
484 else if (i < ARRAY_SIZE (ppc64_standard_linkage7) - 1
488 else if (i < ARRAY_SIZE (ppc64_standard_linkage6) - 1
492 else if (i < ARRAY_SIZE (ppc64_standard_linkage5) - 1
495 && (insns[8] != 0 || insns[9] != 0))
497 else if (i < ARRAY_SIZE (ppc64_standard_linkage4) - 1
500 && (insns[9] != 0 || insns[10] != 0))
502 else if (i < ARRAY_SIZE (ppc64_standard_linkage3) - 1
505 && (insns[8] != 0 || insns[9] != 0))
507 else if (i < ARRAY_SIZE (ppc64_standard_linkage2) - 1
510 && (insns[10] != 0 || insns[11] != 0))
512 else if (i < ARRAY_SIZE (ppc64_standard_linkage1) - 1
527 return target ? target :
pc;
595 &buf, addr - s->
addr, 8);
611 if ((sym->flags & BSF_SYNTHETIC) != 0 && sym->udata.p != NULL)
613 elf_symbol_type *elf_sym = (elf_symbol_type *) sym->udata.p;
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
#define insn_ds(opcd, rts, ra, d, xo)
#define insn_xfx(opcd, rts, spr, xo)
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
CORE_ADDR ppc64_skip_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
static CORE_ADDR ppc64_standard_linkage2_target(struct frame_info *frame, CORE_ADDR pc, unsigned int *insn)
CORE_ADDR find_solib_trampoline_target(struct frame_info *frame, CORE_ADDR pc)
CORE_ADDR ppc_insn_ds_field(unsigned int insn)
static CORE_ADDR ppc64_plt_entry_point(struct gdbarch *gdbarch, CORE_ADDR plt)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
CORE_ADDR ppc64_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
#define SET_MSYMBOL_SIZE(msymbol, sz)
struct bfd_section * the_bfd_section
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
int ppc_insns_match_pattern(struct frame_info *frame, CORE_ADDR pc, struct ppc_insn_pattern *pattern, unsigned int *insns)
void ppc64_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym)
static CORE_ADDR ppc64_standard_linkage1_target(struct frame_info *frame, CORE_ADDR pc, unsigned int *insn)
static CORE_ADDR ppc64_standard_linkage4_target(struct frame_info *frame, CORE_ADDR pc, unsigned int *insn)
#define insn_d(opcd, rts, ra, d)
CORE_ADDR ppc_insn_d_field(unsigned int insn)
struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
static CORE_ADDR ppc64_standard_linkage3_target(struct frame_info *frame, CORE_ADDR pc, unsigned int *insn)