/* Target-dependent code for GNU/Linux i386.
- Copyright (C) 2000-2020 Free Software Foundation, Inc.
+ Copyright (C) 2000-2022 Free Software Foundation, Inc.
This file is part of GDB.
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
- if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
+ if (!safe_frame_unwind_memory (this_frame, pc, buf))
return 0;
if (buf[0] != LINUX_SIGTRAMP_INSN0)
pc -= adjust;
- if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
+ if (!safe_frame_unwind_memory (this_frame, pc, buf))
return 0;
}
PC is not at the start of the instruction sequence, there will be
a few trailing readable bytes on the stack. */
- if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
+ if (!safe_frame_unwind_memory (this_frame, pc, buf))
return 0;
if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
pc -= LINUX_RT_SIGTRAMP_OFFSET1;
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- LINUX_RT_SIGTRAMP_LEN))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ buf))
return 0;
}
sig_code = parse_and_eval_long ("$_siginfo.si_code\n");
lower_bound
- = parse_and_eval_long ("$_siginfo._sifields._sigfault._addr_bnd._lower");
+ = parse_and_eval_long ("$_siginfo._sifields._sigfault._addr_bnd._lower");
upper_bound
- = parse_and_eval_long ("$_siginfo._sifields._sigfault._addr_bnd._upper");
+ = parse_and_eval_long ("$_siginfo._sifields._sigfault._addr_bnd._upper");
access
- = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
+ = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
}
catch (const gdb_exception &exception)
{
if (syscall_gdb < 0)
{
- printf_unfiltered (_("Process record and replay target doesn't "
- "support syscall number %s\n"),
- plongest (syscall_native));
+ fprintf_unfiltered (gdb_stderr,
+ _("Process record and replay target doesn't "
+ "support syscall number %s\n"),
+ plongest (syscall_native));
return -1;
}
static int
i386_linux_record_signal (struct gdbarch *gdbarch,
- struct regcache *regcache,
- enum gdb_signal signal)
+ struct regcache *regcache,
+ enum gdb_signal signal)
{
ULONGEST esp;
is stored at %eax register. */
regcache->cooked_read (I386_LINUX_ORIG_EAX_REGNUM, buf);
- ret = extract_signed_integer (buf, 4, byte_order);
+ ret = extract_signed_integer (buf, byte_order);
return ret;
}
void *cb_data,
const struct regcache *regcache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = (i386_gdbarch_tdep *) gdbarch_tdep (gdbarch);
cb (".reg", 68, 68, &i386_gregset, NULL, cb_data);
PC should get relocated back to its vDSO address. Hide the 'ret'
instruction by 'nop' so that i386_displaced_step_fixup is not confused.
- It is not fully correct as the bytes in struct displaced_step_closure will
- not match the inferior code. But we would need some new flag in
- displaced_step_closure otherwise to keep the state that syscall is finishing
- for the later i386_displaced_step_fixup execution as the syscall execution
- is already no longer detectable there. The new flag field would mean
- i386-linux-tdep.c needs to wrap all the displacement methods of i386-tdep.c
- which does not seem worth it. The same effect is achieved by patching that
- 'nop' instruction there instead. */
-
-static displaced_step_closure_up
+ It is not fully correct as the bytes in struct
+ displaced_step_copy_insn_closure will not match the inferior code. But we
+ would need some new flag in displaced_step_copy_insn_closure otherwise to
+ keep the state that syscall is finishing for the later
+ i386_displaced_step_fixup execution as the syscall execution is already no
+ longer detectable there. The new flag field would mean i386-linux-tdep.c
+ needs to wrap all the displacement methods of i386-tdep.c which does not seem
+ worth it. The same effect is achieved by patching that 'nop' instruction
+ there instead. */
+
+static displaced_step_copy_insn_closure_up
i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
{
- displaced_step_closure_up closure_
+ displaced_step_copy_insn_closure_up closure_
= i386_displaced_step_copy_insn (gdbarch, from, to, regs);
if (i386_linux_get_syscall_number_from_regcache (regs) != -1)
{
/* The closure returned by i386_displaced_step_copy_insn is simply a
buffer with a copy of the instruction. */
- i386_displaced_step_closure *closure
- = (i386_displaced_step_closure *) closure_.get ();
+ i386_displaced_step_copy_insn_closure *closure
+ = (i386_displaced_step_copy_insn_closure *) closure_.get ();
/* Fake nop. */
closure->buf[0] = 0x90;
static void
i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = (i386_gdbarch_tdep *) gdbarch_tdep (gdbarch);
const struct target_desc *tdesc = info.target_desc;
struct tdesc_arch_data *tdesc_data = info.tdesc_data;
const struct tdesc_feature *feature;
gdb_assert (tdesc_data);
- linux_init_abi (info, gdbarch);
+ linux_init_abi (info, gdbarch, 1);
/* GNU/Linux uses ELF. */
i386_elf_init_abi (info, gdbarch);
/* GNU/Linux uses SVR4-style shared libraries. */
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
set_solib_svr4_fetch_link_map_offsets
- (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+ (gdbarch, linux_ilp32_fetch_link_map_offsets);
/* GNU/Linux uses the dynamic linker included in the GNU C Library. */
set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
- svr4_fetch_objfile_link_map);
+ svr4_fetch_objfile_link_map);
/* Core file support. */
set_gdbarch_iterate_over_regset_sections
/* Displaced stepping. */
set_gdbarch_displaced_step_copy_insn (gdbarch,
- i386_linux_displaced_step_copy_insn);
+ i386_linux_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, i386_displaced_step_fixup);
- set_gdbarch_displaced_step_location (gdbarch,
- linux_displaced_step_location);
/* Functions for 'catch syscall'. */
set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_I386);
set_gdbarch_get_syscall_number (gdbarch,
- i386_linux_get_syscall_number);
+ i386_linux_get_syscall_number);
set_gdbarch_get_siginfo_type (gdbarch, x86_linux_get_siginfo_type);
set_gdbarch_report_signal_info (gdbarch, i386_linux_report_signal_info);