/* Target-dependent code for GDB, the GNU debugger.
- Copyright (C) 1986-2020 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"
/* 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.
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_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);