/* Low level interface to i386 running the GNU Hurd.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2017 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"
{
mach_msg_type_number_t count = i386_FLOAT_STATE_COUNT;
struct i386_float_state state;
- error_t err;
+ kern_return_t err;
err = thread_get_state (thread->port, i386_FLOAT_STATE,
(thread_state_t) &state, &count);
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)
{
{
mach_msg_type_number_t count = i386_FLOAT_STATE_COUNT;
struct i386_float_state state;
- error_t err;
+ kern_return_t err;
err = thread_get_state (thread->port, i386_FLOAT_STATE,
(thread_state_t) &state, &count);
{
struct proc *thread;
struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ 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)
{
i386_gnu_dr_get (struct i386_debug_state *regs, struct proc *thread)
{
mach_msg_type_number_t count = i386_DEBUG_STATE_COUNT;
- error_t err;
+ kern_return_t err;
err = thread_get_state (thread->port, i386_DEBUG_STATE,
(thread_state_t) regs, &count);
static void
i386_gnu_dr_set (const struct i386_debug_state *regs, struct proc *thread)
{
- error_t err;
+ kern_return_t err;
err = thread_set_state (thread->port, i386_DEBUG_STATE,
(thread_state_t) regs, i386_DEBUG_STATE_COUNT);
static void
i386_gnu_dr_set_control_one (struct proc *thread, void *arg)
{
- unsigned long *control = arg;
+ unsigned long *control = (unsigned long *) arg;
struct i386_debug_state regs;
i386_gnu_dr_get (®s, thread);
static void
i386_gnu_dr_set_addr_one (struct proc *thread, void *arg)
{
- struct reg_addr *reg_addr = arg;
+ struct reg_addr *reg_addr = (struct reg_addr *) arg;
struct i386_debug_state regs;
i386_gnu_dr_get (®s, thread);