/* Target-dependent code for FreeBSD/i386.
- Copyright (C) 2003-2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2021 Free Software Foundation, Inc.
This file is part of GDB.
#include "regcache.h"
#include "regset.h"
#include "i386-fbsd-tdep.h"
-#include "common/x86-xstate.h"
+#include "gdbsupport/x86-xstate.h"
#include "i386-tdep.h"
#include "i387-tdep.h"
#include "fbsd-tdep.h"
#include "solib-svr4.h"
+#include "inferior.h"
/* Support for signal handlers. */
const gdb_byte *middle, *end;
/* Look for a matching start. */
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_start))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_start}))
return 0;
if (memcmp (buf, i386fbsd_sigtramp_start, sizeof i386fbsd_sigtramp_start)
== 0)
/* Since the end is shorter than the middle, check for a matching end
next. */
pc += sizeof i386fbsd_sigtramp_start;
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_end))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_end}))
return 0;
if (memcmp (buf, end, sizeof i386fbsd_sigtramp_end) == 0)
return 1;
/* If the end didn't match, check for a matching middle. */
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_middle))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_middle}))
return 0;
if (memcmp (buf, middle, sizeof i386fbsd_sigtramp_middle) != 0)
return 0;
/* The middle matched, check for a matching end. */
pc += sizeof i386fbsd_sigtramp_middle;
- if (!safe_frame_unwind_memory (this_frame, pc, buf,
- sizeof i386fbsd_sigtramp_end))
+ if (!safe_frame_unwind_memory (this_frame, pc,
+ {buf, sizeof i386fbsd_sigtramp_end}))
return 0;
if (memcmp (buf, end, sizeof i386fbsd_sigtramp_end) != 0)
return 0;
if (xstate)
{
- size_t size = bfd_section_size (abfd, xstate);
+ size_t size = bfd_section_size (xstate);
/* Check extended state size. */
if (size < X86_XSTATE_AVX_SIZE)
if (tdep->fsbase_regnum == -1)
error (_("Unable to fetch %%gsbase"));
- regcache = get_thread_arch_regcache (ptid, gdbarch);
+ regcache = get_thread_arch_regcache (current_inferior ()->process_target (),
+ ptid, gdbarch);
target_fetch_registers (regcache, tdep->fsbase_regnum + 1);
i386fbsd_get_thread_local_address);
}
+void _initialize_i386fbsd_tdep ();
void
-_initialize_i386fbsd_tdep (void)
+_initialize_i386fbsd_tdep ()
{
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD,
i386fbsd4_init_abi);