GDB (xrefs)

Classes | Functions
/tmp/gdb-8.1/gdb/ppc-sysv-tdep.c File Reference
`#include "defs.h"`
`#include "gdbcore.h"`
`#include "inferior.h"`
`#include "regcache.h"`
`#include "value.h"`
`#include "ppc-tdep.h"`
`#include "target.h"`
`#include "objfiles.h"`
`#include "infcall.h"`
`#include "dwarf2.h"`
`#include "target-float.h"`
`#include <algorithm>`

Go to the source code of this file.

## Classes
struct | ppc64_sysv_argpos

## Functions
static int | ppc_sysv_use_opencl_abi (struct type *ftype)
CORE_ADDR | ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static enum return_value_convention | get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static enum return_value_convention | do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf, int broken_gcc)
enum return_value_convention | ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
enum return_value_convention | ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
static int | convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
static LONGEST | ppc64_aggregate_candidate (struct type *type, struct type **field_type)
static int | ppc64_elfv2_abi_homogeneous_aggregate (struct type *type, struct type **elt_type, int *n_elts)
static void | ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, const bfd_byte *val, int len, int align, struct ppc64_sysv_argpos *argpos)
static void | ppc64_sysv_abi_push_integer (struct gdbarch *gdbarch, ULONGEST val, struct ppc64_sysv_argpos *argpos)
static void | ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch, struct type *type, const bfd_byte *val, struct ppc64_sysv_argpos *argpos)
static void | ppc64_sysv_abi_push_vreg (struct gdbarch *gdbarch, const bfd_byte *val, struct ppc64_sysv_argpos *argpos)
static void | ppc64_sysv_abi_push_param (struct gdbarch *gdbarch, struct type *type, const bfd_byte *val, struct ppc64_sysv_argpos *argpos)
CORE_ADDR | ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
static int | ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf, int index)
enum return_value_convention | ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)

## Function Documentation

## ◆ convert_code_addr_to_desc_addr()

static int convert_code_addr_to_desc_addr | ( | CORE_ADDR | code_addr,
|  | CORE_ADDR * | desc_addr
| ) |  |
| static

Definition at line 1075 of file ppc-sysv-tdep.c.

References BMSYMBOL_VALUE_ADDRESS, find_pc_section(), lookup_minimal_symbol(), lookup_minimal_symbol_by_pc(), bound_minimal_symbol::minsym, MSYMBOL_LINKAGE_NAME, and obj_section::objfile.

Referenced by ppc64_sysv_abi_push_dummy_call(), and ppc64_sysv_abi_push_param().

## ◆ do_ppc_sysv_return_value()

static enum return_value_convention do_ppc_sysv_return_value | ( | struct gdbarch * | gdbarch,
|  | struct type * | func_type,
|  | struct type * | type,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf,
|  | int | broken_gcc
| ) |  |
| static

Definition at line 691 of file ppc-sysv-tdep.c.

References check_typedef(), floatformats_ibm_long_double, gdb_assert, gdbarch_byte_order(), gdbarch_long_double_format(), gdbarch_tdep(), get_decimal_float_return_value(), if(), memset(), offset, POWERPC_VEC_ALTIVEC, POWERPC_VEC_GENERIC, POWERPC_VEC_SPE, gdbarch_tdep::ppc_ev0_regnum, gdbarch_tdep::ppc_fp0_regnum, gdbarch_tdep::ppc_gp0_regnum, PPC_MAX_REGISTER_SIZE, ppc_sysv_use_opencl_abi(), gdbarch_tdep::ppc_vr0_regnum, regcache_cooked_read(), regcache_cooked_read_unsigned(), regcache_cooked_write(), regcache_cooked_write_unsigned(), register_type(), regnum, RETURN_VALUE_REGISTER_CONVENTION, RETURN_VALUE_STRUCT_CONVENTION, gdbarch_tdep::soft_float, store_unsigned_integer(), target_float_convert(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_DECFLOAT, TYPE_CODE_ENUM, TYPE_CODE_FLT, TYPE_CODE_INT, TYPE_CODE_PTR, TYPE_IS_REFERENCE, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, unpack_long(), gdbarch_tdep::vector_abi, and gdbarch_tdep::wordsize.

Referenced by ppc_sysv_abi_broken_return_value(), and ppc_sysv_abi_return_value().

## ◆ get_decimal_float_return_value()

static enum return_value_convention get_decimal_float_return_value | ( | struct gdbarch * | gdbarch,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf
| ) |  |
| static

Definition at line 614 of file ppc-sysv-tdep.c.

References _, gdb_assert, gdbarch_tdep(), internal_error(), gdbarch_tdep::ppc_fp0_regnum, PPC_MAX_REGISTER_SIZE, regcache_cooked_read(), regcache_cooked_write(), RETURN_VALUE_REGISTER_CONVENTION, TYPE_CODE, TYPE_CODE_DECFLOAT, and TYPE_LENGTH.

Referenced by do_ppc_sysv_return_value().

## ◆ ppc64_aggregate_candidate()

static LONGEST ppc64_aggregate_candidate | ( | struct type * | type,
|  | struct type ** | field_type
| ) |  |
| static

Definition at line 1112 of file ppc-sysv-tdep.c.

References check_typedef(), field_is_static(), get_array_bounds(), type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_COMPLEX, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_FIELD, TYPE_FIELD_TYPE, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TARGET_TYPE, and TYPE_VECTOR.

Referenced by ppc64_elfv2_abi_homogeneous_aggregate().

## ◆ ppc64_elfv2_abi_homogeneous_aggregate()

static int ppc64_elfv2_abi_homogeneous_aggregate | ( | struct type * | type,
|  | struct type ** | elt_type,
|  | int * | n_elts
| ) |  |
| static

Definition at line 1220 of file ppc-sysv-tdep.c.

References ppc64_aggregate_candidate(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_LENGTH, and TYPE_VECTOR.

Referenced by ppc64_sysv_abi_push_param(), and ppc64_sysv_abi_return_value().

## ◆ ppc64_sysv_abi_push_dummy_call()

CORE_ADDR ppc64_sysv_abi_push_dummy_call | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct regcache * | regcache,
|  | CORE_ADDR | bp_addr,
|  | int | nargs,
|  | struct value ** | args,
|  | CORE_ADDR | sp,
|  | int | struct_return,
|  | CORE_ADDR | struct_addr
| ) |  |

Definition at line 1580 of file ppc-sysv-tdep.c.

References align_down(), check_typedef(), convert_code_addr_to_desc_addr(), gdbarch_tdep::elf_abi, find_function_addr(), ppc64_sysv_argpos::freg, gdb_assert, gdbarch_byte_order(), gdbarch_sp_regnum(), gdbarch_tdep(), ppc64_sysv_argpos::gparam, ppc64_sysv_argpos::greg, POWERPC_ELF_V1, POWERPC_ELF_V2, ppc64_sysv_abi_push_integer(), ppc64_sysv_abi_push_param(), ppc_floating_point_unit_p(), gdbarch_tdep::ppc_gp0_regnum, gdbarch_tdep::ppc_lr_regnum, ppc_sysv_use_opencl_abi(), gdbarch_tdep::ppc_vr0_regnum, read_memory_unsigned_integer(), ppc64_sysv_argpos::refparam, ppc64_sysv_argpos::regcache, regcache_cooked_read_unsigned(), regcache_cooked_write_signed(), regcache_cooked_write_unsigned(), register_type(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_COMPLEX, TYPE_CODE_PTR, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, value_as_address(), value_contents(), value_type(), ppc64_sysv_argpos::vreg, gdbarch_tdep::wordsize, and write_memory_signed_integer().

Referenced by rs6000_gdbarch_init().

## ◆ ppc64_sysv_abi_push_freg()

static void ppc64_sysv_abi_push_freg | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | const bfd_byte * | val,
|  | struct ppc64_sysv_argpos * | argpos
| ) |  |
| static

Definition at line 1356 of file ppc-sysv-tdep.c.

References floatformats_ibm_long_double, ppc64_sysv_argpos::freg, gdbarch_byte_order(), gdbarch_long_double_format(), gdbarch_tdep(), offset, gdbarch_tdep::ppc_fp0_regnum, PPC_MAX_REGISTER_SIZE, ppc64_sysv_argpos::regcache, regcache_cooked_write(), regcache_cooked_write_part(), register_type(), regnum, gdbarch_tdep::soft_float, target_float_convert(), TYPE_CODE, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, and TYPE_LENGTH.

Referenced by ppc64_sysv_abi_push_param().

## ◆ ppc64_sysv_abi_push_integer()

static void ppc64_sysv_abi_push_integer | ( | struct gdbarch * | gdbarch,
|  | ULONGEST | val,
|  | struct ppc64_sysv_argpos * | argpos
| ) |  |
| static

Definition at line 1339 of file ppc-sysv-tdep.c.

References gdbarch_byte_order(), gdbarch_tdep(), ppc64_sysv_abi_push_val(), PPC_MAX_REGISTER_SIZE, ppc64_sysv_argpos::regcache, store_unsigned_integer(), and gdbarch_tdep::wordsize.

Referenced by ppc64_sysv_abi_push_dummy_call(), and ppc64_sysv_abi_push_param().

## ◆ ppc64_sysv_abi_push_param()

static void ppc64_sysv_abi_push_param | ( | struct gdbarch * | gdbarch,
|  | struct type * | type,
|  | const bfd_byte * | val,
|  | struct ppc64_sysv_argpos * | argpos
| ) |  |
| static

Definition at line 1458 of file ppc-sysv-tdep.c.

References align_up(), check_typedef(), convert_code_addr_to_desc_addr(), gdbarch_tdep::elf_abi, gdbarch_tdep(), POWERPC_ELF_V1, POWERPC_ELF_V2, POWERPC_VEC_ALTIVEC, ppc64_elfv2_abi_homogeneous_aggregate(), ppc64_sysv_abi_push_freg(), ppc64_sysv_abi_push_integer(), ppc64_sysv_abi_push_val(), ppc64_sysv_abi_push_vreg(), ppc64_sysv_argpos::refparam, ppc64_sysv_argpos::regcache, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_DECFLOAT, TYPE_CODE_ENUM, TYPE_CODE_FLT, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_METHOD, TYPE_CODE_PTR, TYPE_CODE_REF, TYPE_CODE_STRUCT, TYPE_FIELD_TYPE, TYPE_IS_REFERENCE, TYPE_LENGTH, TYPE_NFIELDS, TYPE_TARGET_TYPE, TYPE_VECTOR, unpack_long(), gdbarch_tdep::vector_abi, gdbarch_tdep::wordsize, and write_memory().

Referenced by ppc64_sysv_abi_push_dummy_call().

## ◆ ppc64_sysv_abi_push_val()

static void ppc64_sysv_abi_push_val | ( | struct gdbarch * | gdbarch,
|  | const bfd_byte * | val,
|  | int | len,
|  | int | align,
|  | struct ppc64_sysv_argpos * | argpos
| ) |  |
| static

Definition at line 1287 of file ppc-sysv-tdep.c.

References align_up(), gdbarch_byte_order(), gdbarch_tdep(), ppc64_sysv_argpos::gparam, ppc64_sysv_argpos::greg, if(), offset, gdbarch_tdep::ppc_gp0_regnum, ppc64_sysv_argpos::regcache, regcache_cooked_write(), regcache_cooked_write_part(), gdbarch_tdep::wordsize, wordsize, and write_memory().

Referenced by ppc64_sysv_abi_push_integer(), and ppc64_sysv_abi_push_param().

## ◆ ppc64_sysv_abi_push_vreg()

static void ppc64_sysv_abi_push_vreg | ( | struct gdbarch * | gdbarch,
|  | const bfd_byte * | val,
|  | struct ppc64_sysv_argpos * | argpos
| ) |  |
| static

Definition at line 1442 of file ppc-sysv-tdep.c.

References gdbarch_tdep(), gdbarch_tdep::ppc_vr0_regnum, ppc64_sysv_argpos::regcache, regcache_cooked_write(), and ppc64_sysv_argpos::vreg.

Referenced by ppc64_sysv_abi_push_param().

## ◆ ppc64_sysv_abi_return_value()

enum return_value_convention ppc64_sysv_abi_return_value | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf
| ) |  |

Definition at line 1943 of file ppc-sysv-tdep.c.

References check_typedef(), gdbarch_tdep::elf_abi, gdb_assert, gdbarch_byte_order(), gdbarch_tdep(), memset(), offset, POWERPC_ELF_V2, POWERPC_VEC_ALTIVEC, ppc64_elfv2_abi_homogeneous_aggregate(), ppc64_sysv_abi_return_value_base(), ppc_floating_point_unit_p(), gdbarch_tdep::ppc_gp0_regnum, PPC_MAX_REGISTER_SIZE, ppc_sysv_use_opencl_abi(), gdbarch_tdep::ppc_vr0_regnum, regcache_cooked_read(), regcache_cooked_read_part(), regcache_cooked_write(), regcache_cooked_write_part(), register_size(), register_type(), regnum, RETURN_VALUE_REGISTER_CONVENTION, RETURN_VALUE_STRUCT_CONVENTION, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_COMPLEX, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_INT, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_IS_REFERENCE, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, value_type(), gdbarch_tdep::vector_abi, and gdbarch_tdep::wordsize.

Referenced by rs6000_gdbarch_init().

## ◆ ppc64_sysv_abi_return_value_base()

static int ppc64_sysv_abi_return_value_base | ( | struct gdbarch * | gdbarch,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf,
|  | int | index
| ) |  |
| static

Definition at line 1777 of file ppc-sysv-tdep.c.

References floatformats_ibm_long_double, gdbarch_byte_order(), gdbarch_long_double_format(), gdbarch_tdep(), offset, POWERPC_VEC_ALTIVEC, gdbarch_tdep::ppc_fp0_regnum, gdbarch_tdep::ppc_gp0_regnum, PPC_MAX_REGISTER_SIZE, gdbarch_tdep::ppc_vr0_regnum, regcache_cooked_read(), regcache_cooked_read_part(), regcache_cooked_read_unsigned(), regcache_cooked_write(), regcache_cooked_write_part(), regcache_cooked_write_unsigned(), register_type(), regnum, store_unsigned_integer(), target_float_convert(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_BOOL, TYPE_CODE_CHAR, TYPE_CODE_DECFLOAT, TYPE_CODE_ENUM, TYPE_CODE_FLT, TYPE_CODE_INT, TYPE_LENGTH, TYPE_VECTOR, unpack_long(), and gdbarch_tdep::vector_abi.

Referenced by ppc64_sysv_abi_return_value().

## ◆ ppc_sysv_abi_broken_return_value()

enum return_value_convention ppc_sysv_abi_broken_return_value | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf
| ) |  |

Definition at line 1052 of file ppc-sysv-tdep.c.

References do_ppc_sysv_return_value(), and value_type().

Referenced by ppcfbsd_return_value(), ppcnbsd_return_value(), and ppcobsd_init_abi().

## ◆ ppc_sysv_abi_push_dummy_call()

CORE_ADDR ppc_sysv_abi_push_dummy_call | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct regcache * | regcache,
|  | CORE_ADDR | bp_addr,
|  | int | nargs,
|  | struct value ** | args,
|  | CORE_ADDR | sp,
|  | int | struct_return,
|  | CORE_ADDR | struct_addr
| ) |  |

Definition at line 62 of file ppc-sysv-tdep.c.

References align_down(), align_up(), check_typedef(), floatformats_ibm_long_double, gdb_assert, gdbarch_byte_order(), gdbarch_long_double_format(), gdbarch_sp_regnum(), gdbarch_tdep(), memset(), POWERPC_VEC_ALTIVEC, POWERPC_VEC_SPE, gdbarch_tdep::ppc_cr_regnum, gdbarch_tdep::ppc_ev0_regnum, gdbarch_tdep::ppc_fp0_regnum, gdbarch_tdep::ppc_gp0_regnum, gdbarch_tdep::ppc_lr_regnum, PPC_MAX_REGISTER_SIZE, ppc_sysv_use_opencl_abi(), gdbarch_tdep::ppc_vr0_regnum, regcache_cooked_read_unsigned(), regcache_cooked_write(), regcache_cooked_write_signed(), regcache_cooked_write_unsigned(), register_type(), regnum, gdbarch_tdep::soft_float, store_unsigned_integer(), target_float_convert(), TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_DECFLOAT, TYPE_CODE_FLT, TYPE_CODE_INT, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_LENGTH, TYPE_TARGET_TYPE, TYPE_VECTOR, unpack_long(), value_contents(), value_type(), gdbarch_tdep::vector_abi, gdbarch_tdep::wordsize, write_memory(), and write_memory_signed_integer().

Referenced by rs6000_gdbarch_init().

## ◆ ppc_sysv_abi_return_value()

enum return_value_convention ppc_sysv_abi_return_value | ( | struct gdbarch * | gdbarch,
|  | struct value * | function,
|  | struct type * | valtype,
|  | struct regcache * | regcache,
|  | gdb_byte * | readbuf,
|  | const gdb_byte * | writebuf
| ) |  |

Definition at line 1042 of file ppc-sysv-tdep.c.

References do_ppc_sysv_return_value(), and value_type().

Referenced by ppc_linux_return_value(), and rs6000_gdbarch_init().

## ◆ ppc_sysv_use_opencl_abi()

static int ppc_sysv_use_opencl_abi | ( | struct type * | ftype | ) |
| static

Definition at line 39 of file ppc-sysv-tdep.c.

References check_typedef(), TYPE_CALLING_CONVENTION, TYPE_CODE, TYPE_CODE_FUNC, TYPE_CODE_PTR, and TYPE_TARGET_TYPE.

Referenced by do_ppc_sysv_return_value(), ppc64_sysv_abi_push_dummy_call(), ppc64_sysv_abi_return_value(), and ppc_sysv_abi_push_dummy_call().