/* Low level interface to i386 running the GNU Hurd.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2018 Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* Mach/Hurd headers are not yet ready for C++ compilation. */
+extern "C"
+{
+#include <mach.h>
+#include <mach_error.h>
+#include <mach/message.h>
+#include <mach/exception.h>
+}
+
#include "defs.h"
#include "x86-nat.h"
#include "inferior.h"
#include "floatformat.h"
#include "regcache.h"
-#include <mach.h>
-#include <mach_error.h>
-#include <mach/message.h>
-#include <mach/exception.h>
-
#include "i386-tdep.h"
#include "gnu-nat.h"
struct regcache *regcache, int regno)
{
struct proc *thread;
+ ptid_t ptid = regcache_get_ptid (regcache);
/* Make sure we know about new threads. */
inf_update_procs (gnu_current_inf);
- thread = inf_tid_to_thread (gnu_current_inf,
- ptid_get_lwp (inferior_ptid));
+ thread = inf_tid_to_thread (gnu_current_inf, ptid_get_lwp (ptid));
if (!thread)
error (_("Can't fetch registers from thread %s: No such thread"),
- target_pid_to_str (inferior_ptid));
+ target_pid_to_str (ptid));
if (regno < I386_NUM_GREGS || regno == -1)
{
else
{
proc_debug (thread, "fetching register %s",
- gdbarch_register_name (get_regcache_arch (regcache),
+ gdbarch_register_name (regcache->arch (),
regno));
regcache_raw_supply (regcache, regno,
struct regcache *regcache, int regno)
{
struct proc *thread;
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
+ ptid_t ptid = regcache_get_ptid (regcache);
/* Make sure we know about new threads. */
inf_update_procs (gnu_current_inf);
- thread = inf_tid_to_thread (gnu_current_inf,
- ptid_get_lwp (inferior_ptid));
+ thread = inf_tid_to_thread (gnu_current_inf, ptid_get_lwp (ptid));
if (!thread)
error (_("Couldn't store registers into thread %s: No such thread"),
- target_pid_to_str (inferior_ptid));
+ target_pid_to_str (ptid));
if (regno < I386_NUM_GREGS || regno == -1)
{
}
#endif /* i386_DEBUG_STATE */
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_i386gnu_nat;
-
void
_initialize_i386gnu_nat (void)
{