GDB (xrefs)
/tmp/gdb-8.1/gdb/s390-linux-nat.c
Go to the documentation of this file.
1 /* S390 native-dependent code for GDB, the GNU debugger.
2  Copyright (C) 2001-2018 Free Software Foundation, Inc.
3 
4  Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
5  for IBM Deutschland Entwicklung GmbH, IBM Corporation.
6 
7  This file is part of GDB.
8 
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.
13 
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.
18 
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/>. */
21 
22 #include "defs.h"
23 #include "regcache.h"
24 #include "inferior.h"
25 #include "target.h"
26 #include "linux-nat.h"
27 #include "auxv.h"
28 #include "gregset.h"
29 #include "regset.h"
30 #include "nat/linux-ptrace.h"
31 #include "gdbcmd.h"
32 
33 #include "s390-linux-tdep.h"
34 #include "elf/common.h"
35 
36 #include <asm/ptrace.h>
37 #include "nat/gdb_ptrace.h"
38 #include <asm/types.h>
39 #include <sys/procfs.h>
40 #include <sys/ucontext.h>
41 #include <elf.h>
42 #include <algorithm>
43 #include "inf-ptrace.h"
44 
45 /* Per-thread arch-specific data. */
46 
47 struct arch_lwp_info
48 {
49  /* Non-zero if the thread's PER info must be re-written. */
51 };
52 
53 static int have_regset_last_break = 0;
54 static int have_regset_system_call = 0;
55 static int have_regset_tdb = 0;
56 static int have_regset_vxrs = 0;
57 static int have_regset_gs = 0;
58 
59 /* Register map for 32-bit executables running under a 64-bit
60  kernel. */
61 
62 #ifdef __s390x__
63 static const struct regcache_map_entry s390_64_regmap_gregset[] =
64  {
65  /* Skip PSWM and PSWA, since they must be handled specially. */
66  { 2, REGCACHE_MAP_SKIP, 8 },
67  { 1, S390_R0_UPPER_REGNUM, 4 }, { 1, S390_R0_REGNUM, 4 },
68  { 1, S390_R1_UPPER_REGNUM, 4 }, { 1, S390_R1_REGNUM, 4 },
69  { 1, S390_R2_UPPER_REGNUM, 4 }, { 1, S390_R2_REGNUM, 4 },
70  { 1, S390_R3_UPPER_REGNUM, 4 }, { 1, S390_R3_REGNUM, 4 },
71  { 1, S390_R4_UPPER_REGNUM, 4 }, { 1, S390_R4_REGNUM, 4 },
72  { 1, S390_R5_UPPER_REGNUM, 4 }, { 1, S390_R5_REGNUM, 4 },
73  { 1, S390_R6_UPPER_REGNUM, 4 }, { 1, S390_R6_REGNUM, 4 },
74  { 1, S390_R7_UPPER_REGNUM, 4 }, { 1, S390_R7_REGNUM, 4 },
75  { 1, S390_R8_UPPER_REGNUM, 4 }, { 1, S390_R8_REGNUM, 4 },
76  { 1, S390_R9_UPPER_REGNUM, 4 }, { 1, S390_R9_REGNUM, 4 },
77  { 1, S390_R10_UPPER_REGNUM, 4 }, { 1, S390_R10_REGNUM, 4 },
78  { 1, S390_R11_UPPER_REGNUM, 4 }, { 1, S390_R11_REGNUM, 4 },
79  { 1, S390_R12_UPPER_REGNUM, 4 }, { 1, S390_R12_REGNUM, 4 },
80  { 1, S390_R13_UPPER_REGNUM, 4 }, { 1, S390_R13_REGNUM, 4 },
81  { 1, S390_R14_UPPER_REGNUM, 4 }, { 1, S390_R14_REGNUM, 4 },
82  { 1, S390_R15_UPPER_REGNUM, 4 }, { 1, S390_R15_REGNUM, 4 },
83  { 16, S390_A0_REGNUM, 4 },
84  { 1, REGCACHE_MAP_SKIP, 4 }, { 1, S390_ORIG_R2_REGNUM, 4 },
85  { 0 }
86  };
87 
88 static const struct regset s390_64_gregset =
89  {
90  s390_64_regmap_gregset,
93  };
94 
95 #define S390_PSWM_OFFSET 0
96 #define S390_PSWA_OFFSET 8
97 #endif
98 
99 /* PER-event mask bits and PER control bits (CR9). */
100 
101 #define PER_BIT(n) (1UL << (63 - (n)))
102 #define PER_EVENT_BRANCH PER_BIT (32)
103 #define PER_EVENT_IFETCH PER_BIT (33)
104 #define PER_EVENT_STORE PER_BIT (34)
105 #define PER_EVENT_NULLIFICATION PER_BIT (39)
106 #define PER_CONTROL_BRANCH_ADDRESS PER_BIT (40)
107 #define PER_CONTROL_SUSPENSION PER_BIT (41)
108 #define PER_CONTROL_ALTERATION PER_BIT (42)
109 
110 
111 /* Fill GDB's register array with the general-purpose register values
112  in *REGP.
113 
114  When debugging a 32-bit executable running under a 64-bit kernel,
115  we have to fix up the 64-bit registers we get from the kernel to
116  make them look like 32-bit registers. */
117 
118 void
120 {
121 #ifdef __s390x__
122  struct gdbarch *gdbarch = regcache->arch ();
123  if (gdbarch_ptr_bit (gdbarch) == 32)
124  {
125  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
126  ULONGEST pswm, pswa;
127  gdb_byte buf[4];
128 
129  regcache_supply_regset (&s390_64_gregset, regcache, -1,
130  regp, sizeof (gregset_t));
131  pswm = extract_unsigned_integer ((const gdb_byte *) regp
132  + S390_PSWM_OFFSET, 8, byte_order);
133  pswa = extract_unsigned_integer ((const gdb_byte *) regp
134  + S390_PSWA_OFFSET, 8, byte_order);
135  store_unsigned_integer (buf, 4, byte_order, (pswm >> 32) | 0x80000);
138  (pswa & 0x7fffffff) | (pswm & 0x80000000));
140  return;
141  }
142 #endif
143 
145  sizeof (gregset_t));
146 }
147 
148 /* Fill register REGNO (if it is a general-purpose register) in
149  *REGP with the value in GDB's register array. If REGNO is -1,
150  do this for all registers. */
151 
152 void
153 fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
154 {
155 #ifdef __s390x__
156  struct gdbarch *gdbarch = regcache->arch ();
157  if (gdbarch_ptr_bit (gdbarch) == 32)
158  {
159  regcache_collect_regset (&s390_64_gregset, regcache, regno,
160  regp, sizeof (gregset_t));
161 
162  if (regno == -1
163  || regno == S390_PSWM_REGNUM || regno == S390_PSWA_REGNUM)
164  {
165  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
166  ULONGEST pswa, pswm;
167  gdb_byte buf[4];
168  gdb_byte *pswm_p = (gdb_byte *) regp + S390_PSWM_OFFSET;
169  gdb_byte *pswa_p = (gdb_byte *) regp + S390_PSWA_OFFSET;
170 
171  pswm = extract_unsigned_integer (pswm_p, 8, byte_order);
172 
173  if (regno == -1 || regno == S390_PSWM_REGNUM)
174  {
175  pswm &= 0x80000000;
177  pswm |= (extract_unsigned_integer (buf, 4, byte_order)
178  & 0xfff7ffff) << 32;
179  }
180 
181  if (regno == -1 || regno == S390_PSWA_REGNUM)
182  {
184  pswa = extract_unsigned_integer (buf, 4, byte_order);
185  pswm ^= (pswm ^ pswa) & 0x80000000;
186  pswa &= 0x7fffffff;
187  store_unsigned_integer (pswa_p, 8, byte_order, pswa);
188  }
189 
190  store_unsigned_integer (pswm_p, 8, byte_order, pswm);
191  }
192  return;
193  }
194 #endif
195 
197  sizeof (gregset_t));
198 }
199 
200 /* Fill GDB's register array with the floating-point register values
201  in *REGP. */
202 void
204 {
206  sizeof (fpregset_t));
207 }
208 
209 /* Fill register REGNO (if it is a general-purpose register) in
210  *REGP with the value in GDB's register array. If REGNO is -1,
211  do this for all registers. */
212 void
213 fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno)
214 {
216  sizeof (fpregset_t));
217 }
218 
219 /* Find the TID for the current inferior thread to use with ptrace. */
220 static int
222 {
223  /* GNU/Linux LWP ID's are process ID's. */
225  if (tid == 0)
226  tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */
227 
228  return tid;
229 }
230 
231 /* Fetch all general-purpose registers from process/thread TID and
232  store their values in GDB's register cache. */
233 static void
235 {
236  gregset_t regs;
237  ptrace_area parea;
238 
239  parea.len = sizeof (regs);
240  parea.process_addr = (addr_t) &regs;
241  parea.kernel_addr = offsetof (struct user_regs_struct, psw);
242  if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
243  perror_with_name (_("Couldn't get registers"));
244 
245  supply_gregset (regcache, (const gregset_t *) &regs);
246 }
247 
248 /* Store all valid general-purpose registers in GDB's register cache
249  into the process/thread specified by TID. */
250 static void
251 store_regs (const struct regcache *regcache, int tid, int regnum)
252 {
253  gregset_t regs;
254  ptrace_area parea;
255 
256  parea.len = sizeof (regs);
257  parea.process_addr = (addr_t) &regs;
258  parea.kernel_addr = offsetof (struct user_regs_struct, psw);
259  if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
260  perror_with_name (_("Couldn't get registers"));
261 
262  fill_gregset (regcache, &regs, regnum);
263 
264  if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea, 0) < 0)
265  perror_with_name (_("Couldn't write registers"));
266 }
267 
268 /* Fetch all floating-point registers from process/thread TID and store
269  their values in GDB's register cache. */
270 static void
272 {
273  fpregset_t fpregs;
274  ptrace_area parea;
275 
276  parea.len = sizeof (fpregs);
277  parea.process_addr = (addr_t) &fpregs;
278  parea.kernel_addr = offsetof (struct user_regs_struct, fp_regs);
279  if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
280  perror_with_name (_("Couldn't get floating point status"));
281 
282  supply_fpregset (regcache, (const fpregset_t *) &fpregs);
283 }
284 
285 /* Store all valid floating-point registers in GDB's register cache
286  into the process/thread specified by TID. */
287 static void
288 store_fpregs (const struct regcache *regcache, int tid, int regnum)
289 {
290  fpregset_t fpregs;
291  ptrace_area parea;
292 
293  parea.len = sizeof (fpregs);
294  parea.process_addr = (addr_t) &fpregs;
295  parea.kernel_addr = offsetof (struct user_regs_struct, fp_regs);
296  if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
297  perror_with_name (_("Couldn't get floating point status"));
298 
299  fill_fpregset (regcache, &fpregs, regnum);
300 
301  if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea, 0) < 0)
302  perror_with_name (_("Couldn't write floating point status"));
303 }
304 
305 /* Fetch all registers in the kernel's register set whose number is
306  REGSET_ID, whose size is REGSIZE, and whose layout is described by
307  REGSET, from process/thread TID and store their values in GDB's
308  register cache. */
309 static void
311  int regset_id, int regsize, const struct regset *regset)
312 {
313  void *buf = alloca (regsize);
314  struct iovec iov;
315 
316  iov.iov_base = buf;
317  iov.iov_len = regsize;
318 
319  if (ptrace (PTRACE_GETREGSET, tid, (long) regset_id, (long) &iov) < 0)
320  {
321  if (errno == ENODATA)
322  regcache_supply_regset (regset, regcache, -1, NULL, regsize);
323  else
324  perror_with_name (_("Couldn't get register set"));
325  }
326  else
327  regcache_supply_regset (regset, regcache, -1, buf, regsize);
328 }
329 
330 /* Store all registers in the kernel's register set whose number is
331  REGSET_ID, whose size is REGSIZE, and whose layout is described by
332  REGSET, from GDB's register cache back to process/thread TID. */
333 static void
335  int regset_id, int regsize, const struct regset *regset)
336 {
337  void *buf = alloca (regsize);
338  struct iovec iov;
339 
340  iov.iov_base = buf;
341  iov.iov_len = regsize;
342 
343  if (ptrace (PTRACE_GETREGSET, tid, (long) regset_id, (long) &iov) < 0)
344  perror_with_name (_("Couldn't get register set"));
345 
346  regcache_collect_regset (regset, regcache, -1, buf, regsize);
347 
348  if (ptrace (PTRACE_SETREGSET, tid, (long) regset_id, (long) &iov) < 0)
349  perror_with_name (_("Couldn't set register set"));
350 }
351 
352 /* Check whether the kernel provides a register set with number REGSET
353  of size REGSIZE for process/thread TID. */
354 static int
355 check_regset (int tid, int regset, int regsize)
356 {
357  void *buf = alloca (regsize);
358  struct iovec iov;
359 
360  iov.iov_base = buf;
361  iov.iov_len = regsize;
362 
363  if (ptrace (PTRACE_GETREGSET, tid, (long) regset, (long) &iov) >= 0
364  || errno == ENODATA)
365  return 1;
366  return 0;
367 }
368 
369 /* Fetch register REGNUM from the child process. If REGNUM is -1, do
370  this for all registers. */
371 static void
373  struct regcache *regcache, int regnum)
374 {
376 
377  if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
379 
380  if (regnum == -1 || S390_IS_FPREGSET_REGNUM (regnum))
382 
384  if (regnum == -1 || regnum == S390_LAST_BREAK_REGNUM)
385  fetch_regset (regcache, tid, NT_S390_LAST_BREAK, 8,
386  (gdbarch_ptr_bit (regcache->arch ()) == 32
388 
390  if (regnum == -1 || regnum == S390_SYSTEM_CALL_REGNUM)
391  fetch_regset (regcache, tid, NT_S390_SYSTEM_CALL, 4,
393 
394  if (have_regset_tdb)
395  if (regnum == -1 || S390_IS_TDBREGSET_REGNUM (regnum))
397  &s390_tdb_regset);
398 
399  if (have_regset_vxrs)
400  {
401  if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
403  fetch_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
405  if (regnum == -1 || (regnum >= S390_V16_REGNUM
406  && regnum <= S390_V31_REGNUM))
407  fetch_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
409  }
410 
411  if (have_regset_gs)
412  {
413  if (regnum == -1 || (regnum >= S390_GSD_REGNUM
414  && regnum <= S390_GSEPLA_REGNUM))
415  fetch_regset (regcache, tid, NT_S390_GS_CB, 4 * 8,
416  &s390_gs_regset);
417  if (regnum == -1 || (regnum >= S390_BC_GSD_REGNUM
419  fetch_regset (regcache, tid, NT_S390_GS_BC, 4 * 8,
421  }
422 }
423 
424 /* Store register REGNUM back into the child process. If REGNUM is
425  -1, do this for all registers. */
426 static void
428  struct regcache *regcache, int regnum)
429 {
431 
432  if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
434 
435  if (regnum == -1 || S390_IS_FPREGSET_REGNUM (regnum))
437 
438  /* S390_LAST_BREAK_REGNUM is read-only. */
439 
441  if (regnum == -1 || regnum == S390_SYSTEM_CALL_REGNUM)
442  store_regset (regcache, tid, NT_S390_SYSTEM_CALL, 4,
444 
445  if (have_regset_vxrs)
446  {
447  if (regnum == -1 || (regnum >= S390_V0_LOWER_REGNUM
449  store_regset (regcache, tid, NT_S390_VXRS_LOW, 16 * 8,
451  if (regnum == -1 || (regnum >= S390_V16_REGNUM
452  && regnum <= S390_V31_REGNUM))
453  store_regset (regcache, tid, NT_S390_VXRS_HIGH, 16 * 16,
455  }
456 }
457 
458 
459 /* Hardware-assisted watchpoint handling. */
460 
461 /* For each process we maintain a list of all currently active
462  watchpoints, in order to properly handle watchpoint removal.
463 
464  The only thing we actually need is the total address space area
465  spanned by the watchpoints. */
466 
467 typedef struct watch_area
468 {
472 
474 
475 /* Hardware debug state. */
476 
478 {
479  VEC_s390_watch_area *watch_areas;
480  VEC_s390_watch_area *break_areas;
481 };
482 
483 /* Per-process data. */
484 
486 {
488  pid_t pid;
490 };
491 
492 static struct s390_process_info *s390_process_list = NULL;
493 
494 /* Find process data for process PID. */
495 
496 static struct s390_process_info *
498 {
499  struct s390_process_info *proc;
500 
501  for (proc = s390_process_list; proc; proc = proc->next)
502  if (proc->pid == pid)
503  return proc;
504 
505  return NULL;
506 }
507 
508 /* Add process data for process PID. Returns newly allocated info
509  object. */
510 
511 static struct s390_process_info *
513 {
514  struct s390_process_info *proc = XCNEW (struct s390_process_info);
515 
516  proc->pid = pid;
519 
520  return proc;
521 }
522 
523 /* Get data specific info for process PID, creating it if necessary.
524  Never returns NULL. */
525 
526 static struct s390_process_info *
528 {
529  struct s390_process_info *proc;
530 
532  if (proc == NULL)
534 
535  return proc;
536 }
537 
538 /* Get hardware debug state for process PID. */
539 
540 static struct s390_debug_reg_state *
542 {
543  return &s390_process_info_get (pid)->state;
544 }
545 
546 /* Called whenever GDB is no longer debugging process PID. It deletes
547  data structures that keep track of hardware debug state. */
548 
549 static void
551 {
552  struct s390_process_info *proc, **proc_link;
553 
555  proc_link = &s390_process_list;
556 
557  while (proc != NULL)
558  {
559  if (proc->pid == pid)
560  {
561  VEC_free (s390_watch_area, proc->state.watch_areas);
562  VEC_free (s390_watch_area, proc->state.break_areas);
563  *proc_link = proc->next;
564  xfree (proc);
565  return;
566  }
567 
568  proc_link = &proc->next;
569  proc = *proc_link;
570  }
571 }
572 
573 /* linux_nat_new_fork hook. */
574 
575 static void
576 s390_linux_new_fork (struct lwp_info *parent, pid_t child_pid)
577 {
578  pid_t parent_pid;
579  struct s390_debug_reg_state *parent_state;
580  struct s390_debug_reg_state *child_state;
581 
582  /* NULL means no watchpoint has ever been set in the parent. In
583  that case, there's nothing to do. */
584  if (lwp_arch_private_info (parent) == NULL)
585  return;
586 
587  /* GDB core assumes the child inherits the watchpoints/hw breakpoints of
588  the parent. So copy the debug state from parent to child. */
589 
590  parent_pid = ptid_get_pid (parent->ptid);
591  parent_state = s390_get_debug_reg_state (parent_pid);
592  child_state = s390_get_debug_reg_state (child_pid);
593 
594  child_state->watch_areas = VEC_copy (s390_watch_area,
595  parent_state->watch_areas);
596  child_state->break_areas = VEC_copy (s390_watch_area,
597  parent_state->break_areas);
598 }
599 
600 /* Dump PER state. */
601 
602 static void
603 s390_show_debug_regs (int tid, const char *where)
604 {
605  per_struct per_info;
606  ptrace_area parea;
607 
608  parea.len = sizeof (per_info);
609  parea.process_addr = (addr_t) &per_info;
610  parea.kernel_addr = offsetof (struct user_regs_struct, per_info);
611 
612  if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea, 0) < 0)
613  perror_with_name (_("Couldn't retrieve debug regs"));
614 
615  debug_printf ("PER (debug) state for %d -- %s\n"
616  " cr9-11: %lx %lx %lx\n"
617  " start, end: %lx %lx\n"
618  " code/ATMID: %x address: %lx PAID: %x\n",
619  tid,
620  where,
621  per_info.control_regs.words.cr[0],
622  per_info.control_regs.words.cr[1],
623  per_info.control_regs.words.cr[2],
624  per_info.starting_addr,
625  per_info.ending_addr,
626  per_info.lowcore.words.perc_atmid,
627  per_info.lowcore.words.address,
628  per_info.lowcore.words.access_id);
629 }
630 
631 static int
633 {
634  struct s390_debug_reg_state *state
636  per_lowcore_bits per_lowcore;
637  ptrace_area parea;
638  int result;
639 
640  if (show_debug_regs)
642 
643  /* Speed up common case. */
644  if (VEC_empty (s390_watch_area, state->watch_areas))
645  return 0;
646 
647  parea.len = sizeof (per_lowcore);
648  parea.process_addr = (addr_t) & per_lowcore;
649  parea.kernel_addr = offsetof (struct user_regs_struct, per_info.lowcore);
650  if (ptrace (PTRACE_PEEKUSR_AREA, s390_inferior_tid (), &parea, 0) < 0)
651  perror_with_name (_("Couldn't retrieve watchpoint status"));
652 
653  result = (per_lowcore.perc_storage_alteration == 1
654  && per_lowcore.perc_store_real_address == 0);
655 
656  if (result)
657  {
658  /* Do not report this watchpoint again. */
659  memset (&per_lowcore, 0, sizeof (per_lowcore));
660  if (ptrace (PTRACE_POKEUSR_AREA, s390_inferior_tid (), &parea, 0) < 0)
661  perror_with_name (_("Couldn't clear watchpoint status"));
662  }
663 
664  return result;
665 }
666 
667 /* Each time before resuming a thread, update its PER info. */
668 
669 static void
671 {
672  int tid;
673  pid_t pid = ptid_get_pid (ptid_of_lwp (lp));
674 
675  per_struct per_info;
676  ptrace_area parea;
677 
678  CORE_ADDR watch_lo_addr = (CORE_ADDR)-1, watch_hi_addr = 0;
679  unsigned ix;
680  s390_watch_area *area;
681  struct arch_lwp_info *lp_priv = lwp_arch_private_info (lp);
683  int step = lwp_is_stepping (lp);
684 
685  /* Nothing to do if there was never any PER info for this thread. */
686  if (lp_priv == NULL)
687  return;
688 
689  /* If PER info has changed, update it. When single-stepping, disable
690  hardware breakpoints (if any). Otherwise we're done. */
691  if (!lp_priv->per_info_changed)
692  {
693  if (!step || VEC_empty (s390_watch_area, state->break_areas))
694  return;
695  }
696 
697  lp_priv->per_info_changed = 0;
698 
699  tid = ptid_get_lwp (ptid_of_lwp (lp));
700  if (tid == 0)
701  tid = pid;
702 
703  parea.len = sizeof (per_info);
704  parea.process_addr = (addr_t) & per_info;
705  parea.kernel_addr = offsetof (struct user_regs_struct, per_info);
706 
707  /* Clear PER info, but adjust the single_step field (used by older
708  kernels only). */
709  memset (&per_info, 0, sizeof (per_info));
710  per_info.single_step = (step != 0);
711 
712  if (!VEC_empty (s390_watch_area, state->watch_areas))
713  {
714  for (ix = 0;
715  VEC_iterate (s390_watch_area, state->watch_areas, ix, area);
716  ix++)
717  {
718  watch_lo_addr = std::min (watch_lo_addr, area->lo_addr);
719  watch_hi_addr = std::max (watch_hi_addr, area->hi_addr);
720  }
721 
722  /* Enable storage-alteration events. */
723  per_info.control_regs.words.cr[0] |= (PER_EVENT_STORE
725  }
726 
727  if (!VEC_empty (s390_watch_area, state->break_areas))
728  {
729  /* Don't install hardware breakpoints while single-stepping, since
730  our PER settings (e.g. the nullification bit) might then conflict
731  with the kernel's. But re-install them afterwards. */
732  if (step)
733  lp_priv->per_info_changed = 1;
734  else
735  {
736  for (ix = 0;
737  VEC_iterate (s390_watch_area, state->break_areas, ix, area);
738  ix++)
739  {
740  watch_lo_addr = std::min (watch_lo_addr, area->lo_addr);
741  watch_hi_addr = std::max (watch_hi_addr, area->hi_addr);
742  }
743 
744  /* If there's just one breakpoint, enable instruction-fetching
745  nullification events for the breakpoint address (fast).
746  Otherwise stop after any instruction within the PER area and
747  after any branch into it (slow). */
748  if (watch_hi_addr == watch_lo_addr)
749  per_info.control_regs.words.cr[0] |= (PER_EVENT_NULLIFICATION
750  | PER_EVENT_IFETCH);
751  else
752  {
753  /* The PER area must include the instruction before the
754  first breakpoint address. */
755  watch_lo_addr = watch_lo_addr > 6 ? watch_lo_addr - 6 : 0;
756  per_info.control_regs.words.cr[0]
757  |= (PER_EVENT_BRANCH
760  }
761  }
762  }
763  per_info.starting_addr = watch_lo_addr;
764  per_info.ending_addr = watch_hi_addr;
765 
766  if (ptrace (PTRACE_POKEUSR_AREA, tid, &parea, 0) < 0)
767  perror_with_name (_("Couldn't modify watchpoint status"));
768 
769  if (show_debug_regs)
770  s390_show_debug_regs (tid, "resume");
771 }
772 
773 /* Mark the PER info as changed, so the next resume will update it. */
774 
775 static void
777 {
778  if (lwp_arch_private_info (lp) == NULL)
780 
782 }
783 
784 /* When attaching to a new thread, mark its PER info as changed. */
785 
786 static void
788 {
790 }
791 
792 /* Function to call when a thread is being deleted. */
793 
794 static void
796 {
797  xfree (arch_lwp);
798 }
799 
800 /* Iterator callback for s390_refresh_per_info. */
801 
802 static int
803 s390_refresh_per_info_cb (struct lwp_info *lp, void *arg)
804 {
806 
807  if (!lwp_is_stopped (lp))
808  linux_stop_lwp (lp);
809  return 0;
810 }
811 
812 /* Make sure that threads are stopped and mark PER info as changed. */
813 
814 static int
816 {
818 
820  return 0;
821 }
822 
823 static int
825  CORE_ADDR addr, int len, enum target_hw_bp_type type,
826  struct expression *cond)
827 {
828  s390_watch_area area;
829  struct s390_debug_reg_state *state
831 
832  area.lo_addr = addr;
833  area.hi_addr = addr + len - 1;
834  VEC_safe_push (s390_watch_area, state->watch_areas, &area);
835 
836  return s390_refresh_per_info ();
837 }
838 
839 static int
841  CORE_ADDR addr, int len, enum target_hw_bp_type type,
842  struct expression *cond)
843 {
844  unsigned ix;
845  s390_watch_area *area;
846  struct s390_debug_reg_state *state
848 
849  for (ix = 0;
850  VEC_iterate (s390_watch_area, state->watch_areas, ix, area);
851  ix++)
852  {
853  if (area->lo_addr == addr && area->hi_addr == addr + len - 1)
854  {
856  return s390_refresh_per_info ();
857  }
858  }
859 
861  "Attempt to remove nonexistent watchpoint.\n");
862  return -1;
863 }
864 
865 /* Implement the "can_use_hw_breakpoint" target_ops method. */
866 
867 static int
869  enum bptype type, int cnt, int othertype)
870 {
872  return 1;
873  return 0;
874 }
875 
876 /* Implement the "insert_hw_breakpoint" target_ops method. */
877 
878 static int
880  struct gdbarch *gdbarch,
881  struct bp_target_info *bp_tgt)
882 {
883  s390_watch_area area;
884  struct s390_debug_reg_state *state;
885 
886  area.lo_addr = bp_tgt->placed_address = bp_tgt->reqstd_address;
887  area.hi_addr = area.lo_addr;
889  VEC_safe_push (s390_watch_area, state->break_areas, &area);
890 
891  return s390_refresh_per_info ();
892 }
893 
894 /* Implement the "remove_hw_breakpoint" target_ops method. */
895 
896 static int
898  struct gdbarch *gdbarch,
899  struct bp_target_info *bp_tgt)
900 {
901  unsigned ix;
902  struct watch_area *area;
903  struct s390_debug_reg_state *state;
904 
906  for (ix = 0;
907  VEC_iterate (s390_watch_area, state->break_areas, ix, area);
908  ix++)
909  {
910  if (area->lo_addr == bp_tgt->placed_address)
911  {
913  return s390_refresh_per_info ();
914  }
915  }
916 
918  "Attempt to remove nonexistent breakpoint.\n");
919  return -1;
920 }
921 
922 static int
924  CORE_ADDR addr, int cnt)
925 {
926  return 1;
927 }
928 
929 static int
931 {
932  int wordsize = 4;
933 
934  /* Check for 64-bit inferior process. This is the case when the host is
935  64-bit, and in addition bit 32 of the PSW mask is set. */
936 #ifdef __s390x__
937  long pswm;
938 
939  errno = 0;
940  pswm = (long) ptrace (PTRACE_PEEKUSER, s390_inferior_tid (), PT_PSWMASK, 0);
941  if (errno == 0 && (pswm & 0x100000000ul) != 0)
942  wordsize = 8;
943 #endif
944 
945  return wordsize;
946 }
947 
948 static int
949 s390_auxv_parse (struct target_ops *ops, gdb_byte **readptr,
950  gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
951 {
952  int sizeof_auxv_field = s390_target_wordsize ();
953  enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
954  gdb_byte *ptr = *readptr;
955 
956  if (endptr == ptr)
957  return 0;
958 
959  if (endptr - ptr < sizeof_auxv_field * 2)
960  return -1;
961 
962  *typep = extract_unsigned_integer (ptr, sizeof_auxv_field, byte_order);
963  ptr += sizeof_auxv_field;
964  *valp = extract_unsigned_integer (ptr, sizeof_auxv_field, byte_order);
965  ptr += sizeof_auxv_field;
966 
967  *readptr = ptr;
968  return 1;
969 }
970 
971 static const struct target_desc *
973 {
974  int tid = s390_inferior_tid ();
975 
977  = check_regset (tid, NT_S390_LAST_BREAK, 8);
979  = check_regset (tid, NT_S390_SYSTEM_CALL, 4);
980 
981  /* If GDB itself is compiled as 64-bit, we are running on a machine in
982  z/Architecture mode. If the target is running in 64-bit addressing
983  mode, report s390x architecture. If the target is running in 31-bit
984  addressing mode, but the kernel supports using 64-bit registers in
985  that mode, report s390 architecture with 64-bit GPRs. */
986 #ifdef __s390x__
987  {
988  CORE_ADDR hwcap = 0;
989 
990  target_auxv_search (&current_target, AT_HWCAP, &hwcap);
991  have_regset_tdb = (hwcap & HWCAP_S390_TE)
992  && check_regset (tid, NT_S390_TDB, s390_sizeof_tdbregset);
993 
994  have_regset_vxrs = (hwcap & HWCAP_S390_VX)
995  && check_regset (tid, NT_S390_VXRS_LOW, 16 * 8)
996  && check_regset (tid, NT_S390_VXRS_HIGH, 16 * 16);
997 
998  have_regset_gs = (hwcap & HWCAP_S390_GS)
999  && check_regset (tid, NT_S390_GS_CB, 4 * 8)
1000  && check_regset (tid, NT_S390_GS_BC, 4 * 8);
1001 
1002  if (s390_target_wordsize () == 8)
1011 
1012  if (hwcap & HWCAP_S390_HIGH_GPRS)
1021  }
1022 #endif
1023 
1024  /* If GDB itself is compiled as 31-bit, or if we're running a 31-bit inferior
1025  on a 64-bit kernel that does not support using 64-bit registers in 31-bit
1026  mode, report s390 architecture with 32-bit GPRs. */
1030 }
1031 
1032 void
1034 {
1035  struct target_ops *t;
1036 
1037  /* Fill in the generic GNU/Linux methods. */
1038  t = linux_target ();
1039 
1040  /* Add our register access methods. */
1043 
1044  /* Add our watchpoint methods. */
1053 
1054  /* Detect target architecture. */
1057 
1058  /* Register the target. */
1065 
1066  /* A maintenance command to enable showing the PER state. */
1067  add_setshow_boolean_cmd ("show-debug-regs", class_maintenance,
1068  &show_debug_regs, _("\
1069 Set whether to show the PER (debug) hardware state."), _("\
1070 Show whether to show the PER (debug) hardware state."), _("\
1071 Use \"on\" to enable, \"off\" to disable.\n\
1072 If enabled, the PER state is shown after it is changed by GDB,\n\
1073 and when the inferior triggers a breakpoint or watchpoint."),
1074  NULL,
1075  NULL,
1078 }
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5467
#define S390_V15_LOWER_REGNUM
void supply_fpregset(struct regcache *regcache, const fpregset_t *regp)
static int s390_target_wordsize(void)
CORE_ADDR reqstd_address
Definition: breakpoint.h:251
static void fetch_fpregs(struct regcache *regcache, int tid)
#define PER_CONTROL_ALTERATION
static int s390_refresh_per_info_cb(struct lwp_info *lp, void *arg)
static void fetch_regs(struct regcache *regcache, int tid)
static int have_regset_tdb
static constexpr ptid_t tid
struct target_desc * tdesc_s390_vx_linux64
const struct target_desc *(* to_read_description)(struct target_ops *ops) TARGET_DEFAULT_RETURN(NULL)
Definition: target.h:790
struct target_desc * tdesc_s390x_gs_linux64
#define S390_SYSTEM_CALL_REGNUM
struct target_desc * tdesc_s390_te_linux64
struct arch_lwp_info * lwp_arch_private_info(struct lwp_info *lwp)
Definition: linux-nat.c:340
void fill_gregset(const struct regcache *regcache, gregset_t *regp, int regno)
bfd_vma CORE_ADDR
Definition: common-types.h:41
struct target_desc * tdesc_s390_linux32v1
Definition: s390-linux32v1.c:8
#define HWCAP_S390_TE
int ptid_get_pid(const ptid_t &ptid)
Definition: ptid.c:47
void linux_stop_lwp(struct lwp_info *lwp)
Definition: linux-nat.c:2370
static int s390_refresh_per_info(void)
void xfree(void *)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
Definition: gnu-nat.c:1824
static void s390_delete_thread(struct arch_lwp_info *arch_lwp)
static const struct target_desc * s390_read_description(struct target_ops *ops)
void linux_nat_set_new_thread(struct target_ops *t, void(*new_thread)(struct lwp_info *))
Definition: linux-nat.c:4873
VEC_s390_watch_area * watch_areas
struct target_desc * tdesc_s390x_tevx_linux64
static int have_regset_gs
#define PER_EVENT_STORE
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1831
ptid_t ptid
Definition: linux-nat.h:34
static int have_regset_system_call
VEC_s390_watch_area * break_areas
#define S390_R6_UPPER_REGNUM
#define S390_R6_REGNUM
ptid_t regcache_get_ptid(const struct regcache *regcache)
Definition: regcache.c:229
#define S390_R9_REGNUM
void * memset(T *s, int c, size_t n)=delete
static struct s390_process_info * s390_add_process(pid_t pid)
static void s390_prepare_to_resume(struct lwp_info *lp)
#define S390_V31_REGNUM
void regcache_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *buf, size_t size)
Definition: regcache.c:1192
#define VEC_unordered_remove(T, V, I)
Definition: vec.h:367
#define S390_R2_UPPER_REGNUM
static void s390_linux_new_fork(struct lwp_info *parent, pid_t child_pid)
const struct regset s390_gregset
#define S390_V16_REGNUM
static struct s390_process_info * s390_find_process_pid(pid_t pid)
static int have_regset_last_break
#define VEC_safe_push(T, V, O)
Definition: vec.h:276
struct target_desc * tdesc_s390_linux64v2
Definition: s390-linux64v2.c:8
struct target_desc * tdesc_s390_linux32v2
Definition: s390-linux32v2.c:8
static void s390_mark_per_info_changed(struct lwp_info *lp)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
Definition: target.h:516
int(* to_region_ok_for_hw_watchpoint)(struct target_ops *, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_region_ok_for_hw_watchpoint)
Definition: target.h:543
const struct regset s390_fpregset
int(* to_can_use_hw_breakpoint)(struct target_ops *, enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
Definition: target.h:502
#define _(String)
Definition: gdb_locale.h:35
#define S390_IS_GREGSET_REGNUM(i)
struct target_desc * tdesc_s390_tevx_linux64
void linux_nat_set_new_fork(struct target_ops *t, linux_nat_new_fork_ftype *new_fork)
Definition: linux-nat.c:4896
static struct s390_debug_reg_state * s390_get_debug_reg_state(pid_t pid)
#define S390_R11_UPPER_REGNUM
struct cmd_list_element * maintenance_set_cmdlist
Definition: maint.c:634
#define S390_R4_UPPER_REGNUM
void supply_gregset(struct regcache *regcache, const gregset_t *regp)
struct s390_process_info * next
PTRACE_TYPE_RET ptrace()
ptid_t ptid_of_lwp(struct lwp_info *lwp)
Definition: linux-nat.c:323
static int s390_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
#define S390_GSD_REGNUM
Definition: regset.h:34
#define HWCAP_S390_GS
#define S390_R7_UPPER_REGNUM
#define S390_R11_REGNUM
static void store_regset(struct regcache *regcache, int tid, int regset_id, int regsize, const struct regset *regset)
#define VEC_iterate(T, V, I, P)
Definition: vec.h:181
#define S390_R2_REGNUM
const struct regset s390_vxrs_low_regset
Definition: gnu-nat.h:42
static int s390_inferior_tid(void)
#define S390_R4_REGNUM
struct target_ops current_target
thread_state_data_t state
Definition: gnu-nat.h:59
CORE_ADDR lo_addr
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
Definition: defs.h:577
const struct regset s390_last_break_regset
Definition: ptid.h:35
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2018
int target_auxv_search(struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp)
Definition: auxv.c:375
struct fpreg fpregset_t
Definition: alpha-bsd-nat.c:41
int show_debug_regs
Definition: common-debug.c:25
ptid_t pid_to_ptid(int pid)
Definition: ptid.c:39
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1509
void linux_nat_set_prepare_to_resume(struct target_ops *t, void(*prepare_to_resume)(struct lwp_info *))
Definition: linux-nat.c:4938
#define S390_R1_REGNUM
ptid_t current_lwp_ptid(void)
Definition: linux-nat.c:4969
#define S390_R0_UPPER_REGNUM
#define PER_EVENT_IFETCH
#define S390_LAST_BREAK_REGNUM
Definition: gdbtypes.h:749
void regcache_collect_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *buf, size_t size)
Definition: regcache.c:1211
static int s390_auxv_parse(struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp)
#define S390_R13_UPPER_REGNUM
#define PER_CONTROL_BRANCH_ADDRESS
#define S390_R0_REGNUM
#define S390_R7_REGNUM
struct proc * next
Definition: gnu-nat.h:73
#define S390_R14_REGNUM
struct target_desc * tdesc_s390_linux64v1
Definition: s390-linux64v1.c:8
#define PER_EVENT_NULLIFICATION
void linux_nat_add_target(struct target_ops *t)
Definition: linux-nat.c:4804
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
Definition: target.h:519
static int s390_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
#define PTRACE_SETREGSET
Definition: linux-ptrace.h:51
struct target_desc * tdesc_s390x_vx_linux64
#define S390_R3_REGNUM
const struct regset s390x_last_break_regset
int regnum
Definition: aarch64-tdep.c:77
static void s390_linux_store_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
#define S390_R10_REGNUM
CORE_ADDR placed_address
Definition: breakpoint.h:248
const struct regset s390_system_call_regset
struct target_ops * linux_target(void)
Definition: linux-nat.c:4377
long ptid_get_lwp(const ptid_t &ptid)
Definition: ptid.c:55
struct target_desc * tdesc_s390_gs_linux64
#define S390_PSWM_REGNUM
int(* to_insert_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
Definition: target.h:507
bptype
Definition: breakpoint.h:67
int lwp_is_stopped(struct lwp_info *lwp)
Definition: linux-nat.c:348
const struct regset s390_vxrs_high_regset
static void s390_forget_process(pid_t pid)
#define PTRACE_GETREGSET
Definition: linux-ptrace.h:47
Definition: regdef.h:22
void fill_fpregset(const struct regcache *regcache, fpregset_t *regp, int regno)
#define S390_A0_REGNUM
static int s390_remove_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
#define VEC_empty(T, V)
Definition: vec.h:148
#define S390_ORIG_R2_REGNUM
int(* to_auxv_parse)(struct target_ops *ops, gdb_byte **readptr, gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) TARGET_DEFAULT_FUNC(default_auxv_parse)
Definition: target.h:805
#define S390_R3_UPPER_REGNUM
static void s390_new_thread(struct lwp_info *lp)
int(* to_remove_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
Definition: target.h:510
bfd_byte gdb_byte
Definition: common-types.h:38
static int have_regset_vxrs
static struct s390_process_info * s390_process_info_get(pid_t pid)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
Definition: target.h:457
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
Definition: utils.c:692
#define VEC_copy(T, V)
Definition: vec.h:222
struct target_desc * tdesc_s390x_linux64v2
DEF_VEC_O(s390_watch_area)
#define gdb_stderr
Definition: utils.h:344
#define XCNEW(T)
Definition: poison.h:121
static void fetch_regset(struct regcache *regcache, int tid, int regset_id, int regsize, const struct regset *regset)
#define S390_GSEPLA_REGNUM
#define S390_PSWA_REGNUM
struct target_desc * tdesc_s390x_linux64v1
#define S390_IS_FPREGSET_REGNUM(i)
ptid_t inferior_ptid
Definition: infcmd.c:94
const struct regset s390_tdb_regset
#define S390_BC_GSD_REGNUM
static int check_regset(int tid, int regset, int regsize)
#define S390_R10_UPPER_REGNUM
CORE_ADDR hi_addr
#define S390_IS_TDBREGSET_REGNUM(i)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
Definition: cli-decode.c:569
static struct s390_process_info * s390_process_list
#define VEC_free(T, V)
Definition: vec.h:196
struct target_desc * tdesc_s390_linux32
Definition: s390-linux32.c:8
gdbarch * arch() const
Definition: regcache.c:221
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
Definition: target.h:531
#define S390_R5_UPPER_REGNUM
#define S390_R12_REGNUM
target_hw_bp_type
Definition: break-common.h:22
struct target_desc * tdesc_s390x_linux64
Definition: s390x-linux64.c:8
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
Definition: regcache.c:1004
struct watch_area s390_watch_area
int to_have_continuable_watchpoint
Definition: target.h:534
static void s390_show_debug_regs(int tid, const char *where)
#define S390_R15_UPPER_REGNUM
void _initialize_s390_nat(void)
unsigned long long ULONGEST
Definition: common-types.h:53
#define S390_R12_UPPER_REGNUM
static void store_fpregs(const struct regcache *regcache, int tid, int regnum)
static int s390_insert_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
#define S390_V0_LOWER_REGNUM
#define S390_R8_UPPER_REGNUM
void lwp_set_arch_private_info(struct lwp_info *lwp, struct arch_lwp_info *info)
Definition: linux-nat.c:331
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
Definition: regcache.c:1085
int lwp_is_stepping(struct lwp_info *lwp)
Definition: linux-nat.c:364
#define S390_R13_REGNUM
static int s390_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int cnt)
pid_t get_ptrace_pid(ptid_t ptid)
Definition: inf-ptrace.c:320
void debug_printf(const char *fmt,...)
Definition: common-debug.c:30
void linux_nat_set_forget_process(struct target_ops *t, linux_nat_forget_process_ftype *fn)
Definition: linux-nat.c:4906
#define S390_R14_UPPER_REGNUM
const struct regset s390_gsbc_regset
#define S390_R5_REGNUM
#define PER_EVENT_BRANCH
struct target_desc * tdesc_s390x_te_linux64
struct s390_debug_reg_state state
#define S390_R8_REGNUM
struct target_desc * tdesc_s390_linux64
Definition: s390-linux64.c:8
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
Definition: target.h:459
#define s390_sizeof_tdbregset
struct lwp_info * iterate_over_lwps(ptid_t filter, iterate_over_lwps_ftype callback, void *data)
Definition: linux-nat.c:990
struct cmd_list_element * maintenance_show_cmdlist
Definition: maint.c:635
void linux_nat_set_delete_thread(struct target_ops *t, void(*delete_thread)(struct arch_lwp_info *))
Definition: linux-nat.c:4884
enum bfd_endian byte_order
Definition: gdbarch.c:137
static int s390_can_use_hw_breakpoint(struct target_ops *self, enum bptype type, int cnt, int othertype)
#define HWCAP_S390_HIGH_GPRS
#define S390_R1_UPPER_REGNUM
#define S390_R15_REGNUM
static void s390_linux_fetch_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
const struct regset s390_gs_regset
#define wordsize
Definition: regcache.h:157
static int s390_stopped_by_watchpoint(struct target_ops *ops)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
Definition: defs.h:604
#define HWCAP_S390_VX
#define S390_R9_UPPER_REGNUM
#define S390_BC_GSEPLA_REGNUM
static void store_regs(const struct regcache *regcache, int tid, int regnum)