projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdb: testsuite: fix failed testcases in gdb.base/gdb-caching-proc.exp
[binutils-gdb.git]
/
gdb
/
arm-linux-tdep.c
diff --git
a/gdb/arm-linux-tdep.c
b/gdb/arm-linux-tdep.c
index 2d563c2b024f0a36431d1724affab3e58ed90509..6aac016afb91291b0c86dfef6ac54d4c4ed827e4 100644
(file)
--- a/
gdb/arm-linux-tdep.c
+++ b/
gdb/arm-linux-tdep.c
@@
-1,6
+1,6
@@
/* GNU/Linux on ARM target support.
/* GNU/Linux on ARM target support.
- Copyright (C) 1999-202
0
Free Software Foundation, Inc.
+ Copyright (C) 1999-202
2
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-32,6
+32,7
@@
#include "breakpoint.h"
#include "auxv.h"
#include "xml-syscall.h"
#include "breakpoint.h"
#include "auxv.h"
#include "xml-syscall.h"
+#include "expop.h"
#include "aarch32-tdep.h"
#include "arch/arm.h"
#include "aarch32-tdep.h"
#include "arch/arm.h"
@@
-711,7
+712,7
@@
arm_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
void *cb_data,
const struct regcache *regcache)
{
void *cb_data,
const struct regcache *regcache)
{
-
struct gdbarch_tdep *tdep =
gdbarch_tdep (gdbarch);
+
arm_gdbarch_tdep *tdep = (arm_gdbarch_tdep *)
gdbarch_tdep (gdbarch);
cb (".reg", ARM_LINUX_SIZEOF_GREGSET, ARM_LINUX_SIZEOF_GREGSET,
&arm_linux_gregset, NULL, cb_data);
cb (".reg", ARM_LINUX_SIZEOF_GREGSET, ARM_LINUX_SIZEOF_GREGSET,
&arm_linux_gregset, NULL, cb_data);
@@
-946,7
+947,7
@@
arm_linux_software_single_step (struct regcache *regcache)
static void
arm_linux_cleanup_svc (struct gdbarch *gdbarch,
struct regcache *regs,
static void
arm_linux_cleanup_svc (struct gdbarch *gdbarch,
struct regcache *regs,
- arm_displaced_step_closure *dsc)
+ arm_displaced_step_c
opy_insn_c
losure *dsc)
{
ULONGEST apparent_pc;
int within_scratch;
{
ULONGEST apparent_pc;
int within_scratch;
@@
-970,7
+971,7
@@
arm_linux_cleanup_svc (struct gdbarch *gdbarch,
static int
arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
static int
arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
- arm_displaced_step_closure *dsc)
+ arm_displaced_step_c
opy_insn_c
losure *dsc)
{
CORE_ADDR return_to = 0;
{
CORE_ADDR return_to = 0;
@@
-1056,7
+1057,7
@@
arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
static void
cleanup_kernel_helper_return (struct gdbarch *gdbarch,
struct regcache *regs,
static void
cleanup_kernel_helper_return (struct gdbarch *gdbarch,
struct regcache *regs,
- arm_displaced_step_closure *dsc)
+ arm_displaced_step_c
opy_insn_c
losure *dsc)
{
displaced_write_reg (regs, dsc, ARM_LR_REGNUM, dsc->tmp[0], CANNOT_WRITE_PC);
displaced_write_reg (regs, dsc, ARM_PC_REGNUM, dsc->tmp[0], BRANCH_WRITE_PC);
{
displaced_write_reg (regs, dsc, ARM_LR_REGNUM, dsc->tmp[0], CANNOT_WRITE_PC);
displaced_write_reg (regs, dsc, ARM_PC_REGNUM, dsc->tmp[0], BRANCH_WRITE_PC);
@@
-1065,7
+1066,7
@@
cleanup_kernel_helper_return (struct gdbarch *gdbarch,
static void
arm_catch_kernel_helper_return (struct gdbarch *gdbarch, CORE_ADDR from,
CORE_ADDR to, struct regcache *regs,
static void
arm_catch_kernel_helper_return (struct gdbarch *gdbarch, CORE_ADDR from,
CORE_ADDR to, struct regcache *regs,
- arm_displaced_step_closure *dsc)
+ arm_displaced_step_c
opy_insn_c
losure *dsc)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@
-1094,13
+1095,13
@@
arm_catch_kernel_helper_return (struct gdbarch *gdbarch, CORE_ADDR from,
the program has stepped into a Linux kernel helper routine (which must be
handled as a special case). */
the program has stepped into a Linux kernel helper routine (which must be
handled as a special case). */
-static displaced_step_closure_up
+static displaced_step_c
opy_insn_c
losure_up
arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
{
arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
{
- std::unique_ptr<arm_displaced_step_closure> dsc
- (new arm_displaced_step_closure);
+ std::unique_ptr<arm_displaced_step_c
opy_insn_c
losure> dsc
+ (new arm_displaced_step_c
opy_insn_c
losure);
/* Detect when we enter an (inaccessible by GDB) Linux kernel helper, and
stop at the return location. */
/* Detect when we enter an (inaccessible by GDB) Linux kernel helper, and
stop at the return location. */
@@
-1122,7
+1123,7
@@
arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
arm_displaced_init_closure (gdbarch, from, to, dsc.get ());
/* This is a work around for a problem with g++ 4.8. */
arm_displaced_init_closure (gdbarch, from, to, dsc.get ());
/* This is a work around for a problem with g++ 4.8. */
- return displaced_step_closure_up (dsc.release ());
+ return displaced_step_c
opy_insn_c
losure_up (dsc.release ());
}
/* Implementation of `gdbarch_stap_is_single_operand', as defined in
}
/* Implementation of `gdbarch_stap_is_single_operand', as defined in
@@
-1146,7
+1147,7
@@
arm_stap_is_single_operand (struct gdbarch *gdbarch, const char *s)
It returns one if the special token has been parsed successfully,
or zero if the current token is not considered special. */
It returns one if the special token has been parsed successfully,
or zero if the current token is not considered special. */
-static
int
+static
expr::operation_up
arm_stap_parse_special_token (struct gdbarch *gdbarch,
struct stap_parse_info *p)
{
arm_stap_parse_special_token (struct gdbarch *gdbarch,
struct stap_parse_info *p)
{
@@
-1161,7
+1162,6
@@
arm_stap_parse_special_token (struct gdbarch *gdbarch,
int len, offset;
int got_minus = 0;
long displacement;
int len, offset;
int got_minus = 0;
long displacement;
- struct stoken str;
++tmp;
start = tmp;
++tmp;
start = tmp;
@@
-1171,7
+1171,7
@@
arm_stap_parse_special_token (struct gdbarch *gdbarch,
++tmp;
if (*tmp != ',')
++tmp;
if (*tmp != ',')
- return
0
;
+ return
{}
;
len = tmp - start;
regname = (char *) alloca (len + 2);
len = tmp - start;
regname = (char *) alloca (len + 2);
@@
-1212,43
+1212,38
@@
arm_stap_parse_special_token (struct gdbarch *gdbarch,
/* Skipping last `]'. */
if (*tmp++ != ']')
/* Skipping last `]'. */
if (*tmp++ != ']')
- return 0;
+ return {};
+ p->arg = tmp;
+
+ using namespace expr;
/* The displacement. */
/* The displacement. */
- write_exp_elt_opcode (&p->pstate, OP_LONG);
- write_exp_elt_type (&p->pstate, builtin_type (gdbarch)->builtin_long);
- write_exp_elt_longcst (&p->pstate, displacement);
- write_exp_elt_opcode (&p->pstate, OP_LONG);
+ struct type *long_type = builtin_type (gdbarch)->builtin_long;
if (got_minus)
if (got_minus)
- write_exp_elt_opcode (&p->pstate, UNOP_NEG);
+ displacement = -displacement;
+ operation_up disp = make_operation<long_const_operation> (long_type,
+ displacement);
/* The register name. */
/* The register name. */
- 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);
+ operation_up reg
+ = make_operation<register_operation> (regname);
- write_exp_elt_opcode (&p->pstate, BINOP_ADD);
+ operation_up sum
+ = make_operation<add_operation> (std::move (reg), std::move (disp));
/* Casting to the expected type. */
/* Casting to the expected type. */
- write_exp_elt_opcode (&p->pstate, UNOP_CAST);
- write_exp_elt_type (&p->pstate, lookup_pointer_type (p->arg_type));
- write_exp_elt_opcode (&p->pstate, UNOP_CAST);
-
- write_exp_elt_opcode (&p->pstate, UNOP_IND);
-
- p->arg = tmp;
+ struct type *arg_ptr_type = lookup_pointer_type (p->arg_type);
+ sum = make_operation<unop_cast_operation> (std::move (sum),
+ arg_ptr_type);
+ return make_operation<unop_ind_operation> (std::move (sum));
}
}
- else
- return 0;
- return
1
;
+ return
{}
;
}
/* ARM process record-replay constructs: syscall, signal etc. */
}
/* ARM process record-replay constructs: syscall, signal etc. */
-st
ruct
linux_record_tdep arm_linux_record_tdep;
+st
atic
linux_record_tdep arm_linux_record_tdep;
/* arm_canonicalize_syscall maps from the native arm Linux set
of syscall ids into a canonical set of syscall ids used by
/* arm_canonicalize_syscall maps from the native arm Linux set
of syscall ids into a canonical set of syscall ids used by
@@
-1655,9
+1650,10
@@
arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
if (syscall_gdb == gdb_sys_no_syscall)
{
if (syscall_gdb == gdb_sys_no_syscall)
{
- printf_unfiltered (_("Process record and replay target doesn't "
- "support syscall number %s\n"),
- plongest (svc_number));
+ fprintf_unfiltered (gdb_stderr,
+ _("Process record and replay target doesn't "
+ "support syscall number %s\n"),
+ plongest (svc_number));
return -1;
}
return -1;
}
@@
-1719,9
+1715,9
@@
arm_linux_init_abi (struct gdbarch_info info,
NULL };
static const char *const stap_register_indirection_suffixes[] = { "]",
NULL };
NULL };
static const char *const stap_register_indirection_suffixes[] = { "]",
NULL };
-
struct gdbarch_tdep *tdep =
gdbarch_tdep (gdbarch);
+
arm_gdbarch_tdep *tdep = (arm_gdbarch_tdep *)
gdbarch_tdep (gdbarch);
- linux_init_abi (info, gdbarch);
+ linux_init_abi (info, gdbarch
, 1
);
tdep->lowest_pc = 0x8000;
if (info.byte_order_for_code == BFD_ENDIAN_BIG)
tdep->lowest_pc = 0x8000;
if (info.byte_order_for_code == BFD_ENDIAN_BIG)
@@
-1768,7
+1764,7
@@
arm_linux_init_abi (struct gdbarch_info info,
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
set_solib_svr4_fetch_link_map_offsets
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
set_solib_svr4_fetch_link_map_offsets
- (gdbarch,
svr4
_ilp32_fetch_link_map_offsets);
+ (gdbarch,
linux
_ilp32_fetch_link_map_offsets);
/* Single stepping. */
set_gdbarch_software_single_step (gdbarch, arm_linux_software_single_step);
/* Single stepping. */
set_gdbarch_software_single_step (gdbarch, arm_linux_software_single_step);
@@
-1807,7
+1803,6
@@
arm_linux_init_abi (struct gdbarch_info info,
set_gdbarch_displaced_step_copy_insn (gdbarch,
arm_linux_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, arm_displaced_step_fixup);
set_gdbarch_displaced_step_copy_insn (gdbarch,
arm_linux_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, arm_displaced_step_fixup);
- set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location);
/* Reversible debugging, process record. */
set_gdbarch_process_record (gdbarch, arm_process_record);
/* Reversible debugging, process record. */
set_gdbarch_process_record (gdbarch, arm_process_record);