/* Target-dependent code for GDB, the GNU debugger.
- Copyright (C) 1986-2019 Free Software Foundation, Inc.
+ Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include "linux-record.h"
#include "record-full.h"
#include "infrun.h"
+#include "expop.h"
#include "stap-probe.h"
#include "ax.h"
struct type *valtype, struct regcache *regcache,
gdb_byte *readbuf, const gdb_byte *writebuf)
{
- if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
- || TYPE_CODE (valtype) == TYPE_CODE_UNION)
+ if ((valtype->code () == TYPE_CODE_STRUCT
+ || valtype->code () == TYPE_CODE_UNION)
&& !((TYPE_LENGTH (valtype) == 16 || TYPE_LENGTH (valtype) == 8)
- && TYPE_VECTOR (valtype)))
+ && valtype->is_vector ()))
return RETURN_VALUE_STRUCT_CONVENTION;
else
return ppc_sysv_abi_return_value (gdbarch, function, valtype, regcache,
fpregs + i * tdep->wordsize);
}
trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum,
- fpregs + 32 * tdep->wordsize);
+ fpregs + 32 * tdep->wordsize);
}
trad_frame_set_id (this_cache, frame_id_build (base, func));
}
/* If we do, then it is safe to check the size. */
return register_size (gdbarch, PPC_ORIG_R3_REGNUM) > 0
- && register_size (gdbarch, PPC_TRAP_REGNUM) > 0;
+ && register_size (gdbarch, PPC_TRAP_REGNUM) > 0;
}
/* Return the current system call's number present in the
/* Implementation of `gdbarch_stap_parse_special_token', as defined in
gdbarch.h. */
-static int
+static expr::operation_up
ppc_stap_parse_special_token (struct gdbarch *gdbarch,
struct stap_parse_info *p)
{
const char *s = p->arg;
char *regname;
int len;
- struct stoken str;
while (isdigit (*s))
++s;
{
/* It is a register displacement indeed. Returning 0 means we are
deferring the treatment of this case to the generic parser. */
- return 0;
+ return {};
}
len = s - p->arg;
error (_("Invalid register name `%s' on expression `%s'."),
regname, p->saved_arg);
- write_exp_elt_opcode (&p->pstate, OP_REGISTER);
- str.ptr = regname;
- str.length = len;
- write_exp_string (&p->pstate, str);
- write_exp_elt_opcode (&p->pstate, OP_REGISTER);
-
p->arg = s;
- }
- else
- {
- /* All the other tokens should be handled correctly by the generic
- parser. */
- return 0;
+
+ return expr::make_operation<expr::register_operation> (regname);
}
- return 1;
+ /* All the other tokens should be handled correctly by the generic
+ parser. */
+ return {};
}
/* Initialize linux_record_tdep if not initialized yet.
length LEN in bits. If non-NULL, NAME is the name of its type.
If no suitable type is found, return NULL. */
-const struct floatformat **
+static const struct floatformat **
ppc_floatformat_for_type (struct gdbarch *gdbarch,
- const char *name, int len)
+ const char *name, int len)
{
if (len == 128 && name)
{
static void
ppc_linux_init_abi (struct gdbarch_info info,
- struct gdbarch *gdbarch)
+ struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
struct tdesc_arch_data *tdesc_data = info.tdesc_data;
static const char *const stap_register_indirection_suffixes[] = { ")",
NULL };
- linux_init_abi (info, gdbarch);
+ linux_init_abi (info, gdbarch, 0);
/* PPC GNU/Linux uses either 64-bit or 128-bit long doubles; where
128-bit, they can be either IBM long double or IEEE quad long double.
set_gdbarch_return_value (gdbarch, ppc_linux_return_value);
set_gdbarch_memory_remove_breakpoint (gdbarch,
- ppc_linux_memory_remove_breakpoint);
+ ppc_linux_memory_remove_breakpoint);
/* Shared library handling. */
set_gdbarch_skip_trampoline_code (gdbarch, ppc_skip_trampoline_code);
set_solib_svr4_fetch_link_map_offsets
- (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+ (gdbarch, svr4_ilp32_fetch_link_map_offsets);
/* Setting the correct XML syscall filename. */
set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_PPC);
/* Shared library handling. */
set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code);
set_solib_svr4_fetch_link_map_offsets
- (gdbarch, svr4_lp64_fetch_link_map_offsets);
+ (gdbarch, svr4_lp64_fetch_link_map_offsets);
/* Setting the correct XML syscall filename. */
set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_PPC64);
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
- svr4_fetch_objfile_link_map);
+ svr4_fetch_objfile_link_map);
if (tdesc_data)
{
const struct tdesc_feature *feature;
/* If we have target-described registers, then we can safely
- reserve a number for PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM
+ reserve a number for PPC_ORIG_R3_REGNUM and PPC_TRAP_REGNUM
(whether they are described or not). */
gdb_assert (gdbarch_num_regs (gdbarch) <= PPC_ORIG_R3_REGNUM);
set_gdbarch_num_regs (gdbarch, PPC_TRAP_REGNUM + 1);
/* If they are present, then assign them to the reserved number. */
feature = tdesc_find_feature (info.target_desc,
- "org.gnu.gdb.power.linux");
+ "org.gnu.gdb.power.linux");
if (feature != NULL)
{
tdesc_numbered_register (feature, tdesc_data,
}
}
- set_gdbarch_displaced_step_location (gdbarch,
- linux_displaced_step_location);
-
/* Support reverse debugging. */
set_gdbarch_process_record (gdbarch, ppc_process_record);
set_gdbarch_process_record_signal (gdbarch, ppc_linux_record_signal);
ppc_init_linux_record_tdep (&ppc64_linux_record_tdep, 8);
}
+void _initialize_ppc_linux_tdep ();
void
-_initialize_ppc_linux_tdep (void)
+_initialize_ppc_linux_tdep ()
{
/* Register for all sub-families of the POWER/PowerPC: 32-bit and
64-bit PowerPC, and the older rs6k. */
gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, GDB_OSABI_LINUX,
- ppc_linux_init_abi);
+ ppc_linux_init_abi);
gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, GDB_OSABI_LINUX,
- ppc_linux_init_abi);
+ ppc_linux_init_abi);
gdbarch_register_osabi (bfd_arch_rs6000, bfd_mach_rs6k, GDB_OSABI_LINUX,
- ppc_linux_init_abi);
+ ppc_linux_init_abi);
/* Initialize the Linux target descriptions. */
initialize_tdesc_powerpc_32l ();