1 /* S390 native-dependent code for GDB, the GNU debugger.
2 Copyright (C) 2001-2016 Free Software Foundation, Inc.
4 Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
5 for IBM Deutschland Entwicklung GmbH, IBM Corporation.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #include "linux-nat.h"
30 #include "nat/linux-ptrace.h"
32 #include "s390-linux-tdep.h"
33 #include "elf/common.h"
35 #include <asm/ptrace.h>
36 #include "nat/gdb_ptrace.h"
37 #include <asm/types.h>
38 #include <sys/procfs.h>
39 #include <sys/ucontext.h>
42 /* Per-thread arch-specific data. */
46 /* Non-zero if the thread's PER info must be re-written. */
50 static int have_regset_last_break = 0;
51 static int have_regset_system_call = 0;
52 static int have_regset_tdb = 0;
53 static int have_regset_vxrs = 0;
55 /* Register map for 32-bit executables running under a 64-bit
59 static const struct regcache_map_entry s390_64_regmap_gregset[] =
61 /* Skip PSWM and PSWA, since they must be handled specially. */
62 { 2, REGCACHE_MAP_SKIP, 8 },
63 { 1, S390_R0_UPPER_REGNUM, 4 }, { 1, S390_R0_REGNUM, 4 },
64 { 1, S390_R1_UPPER_REGNUM, 4 }, { 1, S390_R1_REGNUM, 4 },
65 { 1, S390_R2_UPPER_REGNUM, 4 }, { 1, S390_R2_REGNUM, 4 },
66 { 1, S390_R3_UPPER_REGNUM, 4 }, { 1, S390_R3_REGNUM, 4 },
67 { 1, S390_R4_UPPER_REGNUM, 4 }, { 1, S390_R4_REGNUM, 4 },
68 { 1, S390_R5_UPPER_REGNUM, 4 }, { 1, S390_R5_REGNUM, 4 },
69 { 1, S390_R6_UPPER_REGNUM, 4 }, { 1, S390_R6_REGNUM, 4 },
70 { 1, S390_R7_UPPER_REGNUM, 4 }, { 1, S390_R7_REGNUM, 4 },
71 { 1, S390_R8_UPPER_REGNUM, 4 }, { 1, S390_R8_REGNUM, 4 },
72 { 1, S390_R9_UPPER_REGNUM, 4 }, { 1, S390_R9_REGNUM, 4 },
73 { 1, S390_R10_UPPER_REGNUM, 4 }, { 1, S390_R10_REGNUM, 4 },
74 { 1, S390_R11_UPPER_REGNUM, 4 }, { 1, S390_R11_REGNUM, 4 },
75 { 1, S390_R12_UPPER_REGNUM, 4 }, { 1, S390_R12_REGNUM, 4 },
76 { 1, S390_R13_UPPER_REGNUM, 4 }, { 1, S390_R13_REGNUM, 4 },
77 { 1, S390_R14_UPPER_REGNUM, 4 }, { 1, S390_R14_REGNUM, 4 },
78 { 1, S390_R15_UPPER_REGNUM, 4 }, { 1, S390_R15_REGNUM, 4 },
79 { 16, S390_A0_REGNUM, 4 },
80 { 1, REGCACHE_MAP_SKIP, 4 }, { 1, S390_ORIG_R2_REGNUM, 4 },
84 static const struct regset s390_64_gregset =
86 s390_64_regmap_gregset,
87 regcache_supply_regset,
88 regcache_collect_regset
91 #define S390_PSWM_OFFSET 0
92 #define S390_PSWA_OFFSET 8
95 /* Fill GDB's register array with the general-purpose register values
98 When debugging a 32-bit executable running under a 64-bit kernel,
99 we have to fix up the 64-bit registers we get from the kernel to
100 make them look like 32-bit registers. */
103 supply_gregset (struct regcache *regcache, const gregset_t *regp)
106 struct gdbarch *gdbarch = get_regcache_arch (regcache);
107 if (gdbarch_ptr_bit (gdbarch) == 32)
109 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
113 regcache_supply_regset (&s390_64_gregset, regcache, -1,
114 regp, sizeof (gregset_t));
115 pswm = extract_unsigned_integer ((const gdb_byte *) regp
116 + S390_PSWM_OFFSET, 8, byte_order);
117 pswa = extract_unsigned_integer ((const gdb_byte *) regp
118 + S390_PSWA_OFFSET, 8, byte_order);
119 store_unsigned_integer (buf, 4, byte_order, (pswm >> 32) | 0x80000);
120 regcache_raw_supply (regcache, S390_PSWM_REGNUM, buf);
121 store_unsigned_integer (buf, 4, byte_order,
122 (pswa & 0x7fffffff) | (pswm & 0x80000000));
123 regcache_raw_supply (regcache, S390_PSWA_REGNUM, buf);
128 regcache_supply_regset (&s390_gregset, regcache, -1, regp,
132 /* Fill register REGNO (if it is a general-purpose register) in
133 *REGP with the value in GDB's register array. If REGNO is -1,
134 do this for all registers. */
137 fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
140 struct gdbarch *gdbarch = get_regcache_arch (regcache);
141 if (gdbarch_ptr_bit (gdbarch) == 32)
143 regcache_collect_regset (&s390_64_gregset, regcache, regno,
144 regp, sizeof (gregset_t));
147 || regno == S390_PSWM_REGNUM || regno == S390_PSWA_REGNUM)
149 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
152 gdb_byte *pswm_p = (gdb_byte *) regp + S390_PSWM_OFFSET;
153 gdb_byte *pswa_p = (gdb_byte *) regp + S390_PSWA_OFFSET;
155 pswm = extract_unsigned_integer (pswm_p, 8, byte_order);
157 if (regno == -1 || regno == S390_PSWM_REGNUM)
160 regcache_raw_collect (regcache, S390_PSWM_REGNUM, buf);
161 pswm |= (extract_unsigned_integer (buf, 4, byte_order)
165 if (regno == -1 || regno == S390_PSWA_REGNUM)
167 regcache_raw_collect (regcache, S390_PSWA_REGNUM, buf);
168 pswa = extract_unsigned_integer (buf, 4, byte_order);
169 pswm ^= (pswm ^ pswa) & 0x80000000;
171 store_unsigned_integer (pswa_p, 8, byte_order, pswa);
174 store_unsigned_integer (pswm_p, 8, byte_order, pswm);
180 regcache_collect_regset (&s390_gregset, regcache, regno, regp,
184 /* Fill GDB's register array with the floating-point register values
187 supply_fpregset (struct regcache *regcache, const fpregset_t *regp)
189 regcache_supply_regset (&s390_fpregset, regcache, -1, regp,
190 sizeof (fpregset_t));
193 /* Fill register REGNO (if it is a general-purpose register) in
194 *REGP with the value in GDB's register array. If REGNO is -1,
195 do this for all registers. */
197 fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno)
199 regcache_collect_regset (&s390_fpregset, regcache, regno, regp,
200 sizeof (fpregset_t));
203 /* Find the TID for the current inferior thread to use with ptrace. */
205 s390_inferior_tid (void)
207 /* GNU/Linux LWP ID's are process ID's. */
208 int tid = ptid_get_lwp (inferior_ptid);
210 tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */
215 /* Fetch all general-purpose registers from process/thread TID and
216 store their values in GDB's register cache. */
218 fetch_regs (struct regcache *regcache, int tid)
223 parea.len = sizeof (regs);
224 parea.process_addr = (addr_t) ®s;
225 parea.kernel_addr = offsetof (struct user_regs_struct, psw);
226 if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
227 perror_with_name (_("Couldn't get registers"));
229 supply_gregset (regcache, (const gregset_t *) ®s);
232 /* Store all valid general-purpose registers in GDB's register cache
233 into the process/thread specified by TID. */
235 store_regs (const struct regcache *regcache, int tid, int regnum)
240 parea.len = sizeof (regs);
241 parea.process_addr = (addr_t) ®s;
242 parea.kernel_addr = offsetof (struct user_regs_struct, psw);
243 if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
244 perror_with_name (_("Couldn't get registers"));
246 fill_gregset (regcache, ®s, regnum);
248 if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea, 0) < 0)
249 perror_with_name (_("Couldn't write registers"));
252 /* Fetch all floating-point registers from process/thread TID and store
253 their values in GDB's register cache. */
255 fetch_fpregs (struct regcache *regcache, int tid)
260 parea.len = sizeof (fpregs);
261 parea.process_addr = (addr_t) &fpregs;
262 parea.kernel_addr = offsetof (struct user_regs_struct, fp_regs);
263 if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
264 perror_with_name (_("Couldn't get floating point status"));
266 supply_fpregset (regcache, (const fpregset_t *) &fpregs);
269 /* Store all valid floating-point registers in GDB's register cache
270 into the process/thread specified by TID. */
272 store_fpregs (const struct regcache *regcache, int tid, int regnum)
277 parea.len = sizeof (fpregs);
278 parea.process_addr = (addr_t) &fpregs;
279 parea.kernel_addr = offsetof (struct user_regs_struct, fp_regs);
280 if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
281 perror_with_name (_("Couldn't get floating point status"));
283 fill_fpregset (regcache, &fpregs, regnum);
285 if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea, 0) < 0)
286 perror_with_name (_("Couldn't write floating point status"));
289 /* Fetch all registers in the kernel's register set whose number is
290 REGSET_ID, whose size is REGSIZE, and whose layout is described by
291 REGSET, from process/thread TID and store their values in GDB's
294 fetch_regset (struct regcache *regcache, int tid,
295 int regset_id, int regsize, const struct regset *regset)
297 void *buf = alloca (regsize);
301 iov.iov_len = regsize;
303 if (ptrace (PTRACE_GETREGSET, tid, (long) regset_id, (long) &iov) < 0)
305 if (errno == ENODATA)
306 regcache_supply_regset (regset, regcache, -1, NULL, regsize);
308 perror_with_name (_("Couldn't get register set"));
311 regcache_supply_regset (regset, regcache, -1, buf, regsize);
314 /* Store all registers in the kernel's register set whose number is
315 REGSET_ID, whose size is REGSIZE, and whose layout is described by
316 REGSET, from GDB's register cache back to process/thread TID. */
318 store_regset (struct regcache *regcache, int tid,
319 int regset_id, int regsize, const struct regset *regset)
321 void *buf = alloca (regsize);
325 iov.iov_len = regsize;
327 if (ptrace (PTRACE_GETREGSET, tid, (long) regset_id, (long) &iov) < 0)
328 perror_with_name (_("Couldn't get register set"));
330 regcache_collect_regset (regset, regcache, -1, buf, regsize);
332 if (ptrace (PTRACE_SETREGSET, tid, (long) regset_id, (long) &iov) < 0)
333 perror_with_name (_("Couldn't set register set"));
336 /* Check whether the kernel provides a register set with number REGSET
337 of size REGSIZE for process/thread TID. */
339 check_regset (int tid, int regset, int regsize)
341 void *buf = alloca (regsize);
345 iov.iov_len = regsize;
347 if (ptrace (PTRACE_GETREGSET, tid, (long) regset, (long) &iov) >= 0
353 /* Fetch register REGNUM from the child process. If REGNUM is -1, do
354 this for all registers. */
356 s390_linux_fetch_inferior_registers (struct target_ops *ops,
357 struct regcache *regcache, int regnum)
359 int tid = s390_inferior_tid ();
361 if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
362 fetch_regs (regcache, tid);
364 if (regnum == -1 || S390_IS_FPREGSET_REGNUM (regnum))
365 fetch_fpregs (regcache, tid);
367 if (have_regset_last_break)
368 if (regnum == -1 || regnum == S390_LAST_BREAK_REGNUM)
369 fetch_regset (regcache, tid, NT_S390_LAST_BREAK, 8,
370 (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32
371 ? &s390_last_break_regset : &s390x_last_break_regset));
373 if (have_regset_system_call)
374 if (regnum == -1 || regnum == S390_SYSTEM_CALL_REGNUM)
375 fetch_regset (regcache, tid, NT_S390_SYSTEM_CALL, 4,
376 &s390_system_call_regset);
379 if (regnum == -1 || S390_IS_TDBREGSET_REGNUM (regnum))
380 fetch_regset (regcache, tid, NT_S390_TDB, s390_sizeof_tdbregset,
383 if (have_regset_vxrs)
385 if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
386 && regnum <= S390_V15_LOWER_REGNUM))
387 fetch_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
388 &s390_vxrs_low_regset);
389 if (regnum == -1 || (regnum >= S390_V16_REGNUM
390 && regnum <= S390_V31_REGNUM))
391 fetch_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
392 &s390_vxrs_high_regset);
396 /* Store register REGNUM back into the child process. If REGNUM is
397 -1, do this for all registers. */
399 s390_linux_store_inferior_registers (struct target_ops *ops,
400 struct regcache *regcache, int regnum)
402 int tid = s390_inferior_tid ();
404 if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
405 store_regs (regcache, tid, regnum);
407 if (regnum == -1 || S390_IS_FPREGSET_REGNUM (regnum))
408 store_fpregs (regcache, tid, regnum);
410 /* S390_LAST_BREAK_REGNUM is read-only. */
412 if (have_regset_system_call)
413 if (regnum == -1 || regnum == S390_SYSTEM_CALL_REGNUM)
414 store_regset (regcache, tid, NT_S390_SYSTEM_CALL, 4,
415 &s390_system_call_regset);
417 if (have_regset_vxrs)
419 if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
420 && regnum <= S390_V15_LOWER_REGNUM))
421 store_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
422 &s390_vxrs_low_regset);
423 if (regnum == -1 || (regnum >= S390_V16_REGNUM
424 && regnum <= S390_V31_REGNUM))
425 store_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
426 &s390_vxrs_high_regset);
431 /* Hardware-assisted watchpoint handling. */
433 /* We maintain a list of all currently active watchpoints in order
434 to properly handle watchpoint removal.
436 The only thing we actually need is the total address space area
437 spanned by the watchpoints. */
441 struct watch_area *next;
446 static struct watch_area *watch_base = NULL;
449 s390_stopped_by_watchpoint (struct target_ops *ops)
451 per_lowcore_bits per_lowcore;
455 /* Speed up common case. */
459 parea.len = sizeof (per_lowcore);
460 parea.process_addr = (addr_t) & per_lowcore;
461 parea.kernel_addr = offsetof (struct user_regs_struct, per_info.lowcore);
462 if (ptrace (PTRACE_PEEKUSR_AREA, s390_inferior_tid (), &parea, 0) < 0)
463 perror_with_name (_("Couldn't retrieve watchpoint status"));
465 result = (per_lowcore.perc_storage_alteration == 1
466 && per_lowcore.perc_store_real_address == 0);
470 /* Do not report this watchpoint again. */
471 memset (&per_lowcore, 0, sizeof (per_lowcore));
472 if (ptrace (PTRACE_POKEUSR_AREA, s390_inferior_tid (), &parea, 0) < 0)
473 perror_with_name (_("Couldn't clear watchpoint status"));
479 /* Each time before resuming a thread, update its PER info. */
482 s390_prepare_to_resume (struct lwp_info *lp)
489 CORE_ADDR watch_lo_addr = (CORE_ADDR)-1, watch_hi_addr = 0;
490 struct watch_area *area;
491 struct arch_lwp_info *lp_priv = lwp_arch_private_info (lp);
493 if (lp_priv == NULL || !lp_priv->per_info_changed)
496 lp_priv->per_info_changed = 0;
498 tid = ptid_get_lwp (ptid_of_lwp (lp));
500 tid = ptid_get_pid (ptid_of_lwp (lp));
502 for (area = watch_base; area; area = area->next)
504 watch_lo_addr = min (watch_lo_addr, area->lo_addr);
505 watch_hi_addr = max (watch_hi_addr, area->hi_addr);
508 parea.len = sizeof (per_info);
509 parea.process_addr = (addr_t) & per_info;
510 parea.kernel_addr = offsetof (struct user_regs_struct, per_info);
511 if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea, 0) < 0)
512 perror_with_name (_("Couldn't retrieve watchpoint status"));
516 per_info.control_regs.bits.em_storage_alteration = 1;
517 per_info.control_regs.bits.storage_alt_space_ctl = 1;
521 per_info.control_regs.bits.em_storage_alteration = 0;
522 per_info.control_regs.bits.storage_alt_space_ctl = 0;
524 per_info.starting_addr = watch_lo_addr;
525 per_info.ending_addr = watch_hi_addr;
527 if (ptrace (PTRACE_POKEUSR_AREA, tid, &parea, 0) < 0)
528 perror_with_name (_("Couldn't modify watchpoint status"));
531 /* Mark the PER info as changed, so the next resume will update it. */
534 s390_mark_per_info_changed (struct lwp_info *lp)
536 if (lwp_arch_private_info (lp) == NULL)
537 lwp_set_arch_private_info (lp, XCNEW (struct arch_lwp_info));
539 lwp_arch_private_info (lp)->per_info_changed = 1;
542 /* When attaching to a new thread, mark its PER info as changed. */
545 s390_new_thread (struct lwp_info *lp)
547 s390_mark_per_info_changed (lp);
550 /* Iterator callback for s390_refresh_per_info. */
553 s390_refresh_per_info_cb (struct lwp_info *lp, void *arg)
555 s390_mark_per_info_changed (lp);
557 if (!lwp_is_stopped (lp))
562 /* Make sure that threads are stopped and mark PER info as changed. */
565 s390_refresh_per_info (void)
567 ptid_t pid_ptid = pid_to_ptid (ptid_get_pid (current_lwp_ptid ()));
569 iterate_over_lwps (pid_ptid, s390_refresh_per_info_cb, NULL);
574 s390_insert_watchpoint (struct target_ops *self,
575 CORE_ADDR addr, int len, enum target_hw_bp_type type,
576 struct expression *cond)
578 struct watch_area *area = XNEW (struct watch_area);
583 area->lo_addr = addr;
584 area->hi_addr = addr + len - 1;
586 area->next = watch_base;
589 return s390_refresh_per_info ();
593 s390_remove_watchpoint (struct target_ops *self,
594 CORE_ADDR addr, int len, enum target_hw_bp_type type,
595 struct expression *cond)
597 struct watch_area *area, **parea;
599 for (parea = &watch_base; *parea; parea = &(*parea)->next)
600 if ((*parea)->lo_addr == addr
601 && (*parea)->hi_addr == addr + len - 1)
606 fprintf_unfiltered (gdb_stderr,
607 "Attempt to remove nonexistent watchpoint.\n");
615 return s390_refresh_per_info ();
619 s390_can_use_hw_breakpoint (struct target_ops *self,
620 enum bptype type, int cnt, int othertype)
622 return type == bp_hardware_watchpoint;
626 s390_region_ok_for_hw_watchpoint (struct target_ops *self,
627 CORE_ADDR addr, int cnt)
633 s390_target_wordsize (void)
637 /* Check for 64-bit inferior process. This is the case when the host is
638 64-bit, and in addition bit 32 of the PSW mask is set. */
643 pswm = (long) ptrace (PTRACE_PEEKUSER, s390_inferior_tid (), PT_PSWMASK, 0);
644 if (errno == 0 && (pswm & 0x100000000ul) != 0)
652 s390_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
653 gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
655 int sizeof_auxv_field = s390_target_wordsize ();
656 enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
657 gdb_byte *ptr = *readptr;
662 if (endptr - ptr < sizeof_auxv_field * 2)
665 *typep = extract_unsigned_integer (ptr, sizeof_auxv_field, byte_order);
666 ptr += sizeof_auxv_field;
667 *valp = extract_unsigned_integer (ptr, sizeof_auxv_field, byte_order);
668 ptr += sizeof_auxv_field;
674 static const struct target_desc *
675 s390_read_description (struct target_ops *ops)
677 int tid = s390_inferior_tid ();
679 have_regset_last_break
680 = check_regset (tid, NT_S390_LAST_BREAK, 8);
681 have_regset_system_call
682 = check_regset (tid, NT_S390_SYSTEM_CALL, 4);
684 /* If GDB itself is compiled as 64-bit, we are running on a machine in
685 z/Architecture mode. If the target is running in 64-bit addressing
686 mode, report s390x architecture. If the target is running in 31-bit
687 addressing mode, but the kernel supports using 64-bit registers in
688 that mode, report s390 architecture with 64-bit GPRs. */
693 target_auxv_search (¤t_target, AT_HWCAP, &hwcap);
694 have_regset_tdb = (hwcap & HWCAP_S390_TE)
695 && check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset);
697 have_regset_vxrs = (hwcap & HWCAP_S390_VX)
698 && check_regset (tid, NT_S390_VXRS_LOW, 16 * 8)
699 && check_regset (tid, NT_S390_VXRS_HIGH, 16 * 16);
701 if (s390_target_wordsize () == 8)
702 return (have_regset_vxrs ?
703 (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
704 tdesc_s390x_vx_linux64) :
705 have_regset_tdb ? tdesc_s390x_te_linux64 :
706 have_regset_system_call ? tdesc_s390x_linux64v2 :
707 have_regset_last_break ? tdesc_s390x_linux64v1 :
708 tdesc_s390x_linux64);
710 if (hwcap & HWCAP_S390_HIGH_GPRS)
711 return (have_regset_vxrs ?
712 (have_regset_tdb ? tdesc_s390_tevx_linux64 :
713 tdesc_s390_vx_linux64) :
714 have_regset_tdb ? tdesc_s390_te_linux64 :
715 have_regset_system_call ? tdesc_s390_linux64v2 :
716 have_regset_last_break ? tdesc_s390_linux64v1 :
721 /* If GDB itself is compiled as 31-bit, or if we're running a 31-bit inferior
722 on a 64-bit kernel that does not support using 64-bit registers in 31-bit
723 mode, report s390 architecture with 32-bit GPRs. */
724 return (have_regset_system_call? tdesc_s390_linux32v2 :
725 have_regset_last_break? tdesc_s390_linux32v1 :
729 void _initialize_s390_nat (void);
732 _initialize_s390_nat (void)
734 struct target_ops *t;
736 /* Fill in the generic GNU/Linux methods. */
739 /* Add our register access methods. */
740 t->to_fetch_registers = s390_linux_fetch_inferior_registers;
741 t->to_store_registers = s390_linux_store_inferior_registers;
743 /* Add our watchpoint methods. */
744 t->to_can_use_hw_breakpoint = s390_can_use_hw_breakpoint;
745 t->to_region_ok_for_hw_watchpoint = s390_region_ok_for_hw_watchpoint;
746 t->to_have_continuable_watchpoint = 1;
747 t->to_stopped_by_watchpoint = s390_stopped_by_watchpoint;
748 t->to_insert_watchpoint = s390_insert_watchpoint;
749 t->to_remove_watchpoint = s390_remove_watchpoint;
751 /* Detect target architecture. */
752 t->to_read_description = s390_read_description;
753 t->to_auxv_parse = s390_auxv_parse;
755 /* Register the target. */
756 linux_nat_add_target (t);
757 linux_nat_set_new_thread (t, s390_new_thread);
758 linux_nat_set_prepare_to_resume (t, s390_prepare_to_resume);