Fix dwarf2_string_attr for -gsplit-dwarf
[deliverable/binutils-gdb.git] / gdb / s390-linux-nat.c
index d1d2bf8e37e7643073832bdafb24045a1ca5bcf6..90c73c44cd8f83f809a72106179b2931caf3aee5 100644 (file)
@@ -1,5 +1,5 @@
 /* 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.
@@ -39,6 +39,8 @@
 #include <sys/procfs.h>
 #include <sys/ucontext.h>
 #include <elf.h>
+#include <algorithm>
+#include "inf-ptrace.h"
 
 /* Per-thread arch-specific data.  */
 
@@ -369,7 +371,7 @@ static void
 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);
@@ -412,7 +414,7 @@ static void
 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);
@@ -700,8 +702,8 @@ s390_prepare_to_resume (struct lwp_info *lp)
           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.  */
@@ -722,8 +724,8 @@ s390_prepare_to_resume (struct lwp_info *lp)
               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
This page took 0.025464 seconds and 4 git commands to generate.