/* S390 native-dependent code for GDB, the GNU debugger.
- Copyright (C) 2001-2016 Free Software Foundation, Inc.
+ Copyright (C) 2001-2017 Free Software Foundation, Inc.
Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
for IBM Deutschland Entwicklung GmbH, IBM Corporation.
#include <sys/procfs.h>
#include <sys/ucontext.h>
#include <elf.h>
+#include <algorithm>
+#include "inf-ptrace.h"
/* Per-thread arch-specific data. */
s390_linux_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
- int tid = s390_inferior_tid ();
+ pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
fetch_regs (regcache, tid);
s390_linux_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
- int tid = s390_inferior_tid ();
+ pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
store_regs (regcache, tid, regnum);
VEC_iterate (s390_watch_area, state->watch_areas, ix, area);
ix++)
{
- watch_lo_addr = min (watch_lo_addr, area->lo_addr);
- watch_hi_addr = max (watch_hi_addr, area->hi_addr);
+ watch_lo_addr = std::min (watch_lo_addr, area->lo_addr);
+ watch_hi_addr = std::max (watch_hi_addr, area->hi_addr);
}
/* Enable storage-alteration events. */
VEC_iterate (s390_watch_area, state->break_areas, ix, area);
ix++)
{
- watch_lo_addr = min (watch_lo_addr, area->lo_addr);
- watch_hi_addr = max (watch_hi_addr, area->hi_addr);
+ watch_lo_addr = std::min (watch_lo_addr, area->lo_addr);
+ watch_hi_addr = std::max (watch_hi_addr, area->hi_addr);
}
/* If there's just one breakpoint, enable instruction-fetching