GDBserver
linux-s390-low.c
Go to the documentation of this file.
1 /* GNU/Linux S/390 specific low level interface, for the remote server
2  for GDB.
3  Copyright (C) 2001-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* This file is used for both 31-bit and 64-bit S/390 systems. */
21 
22 #include "server.h"
23 #include "linux-low.h"
24 #include "elf/common.h"
25 
26 #include <asm/ptrace.h>
27 #include <sys/ptrace.h>
28 #include <sys/uio.h>
29 #include <elf.h>
30 
31 #ifndef HWCAP_S390_HIGH_GPRS
32 #define HWCAP_S390_HIGH_GPRS 512
33 #endif
34 
35 #ifndef HWCAP_S390_TE
36 #define HWCAP_S390_TE 1024
37 #endif
38 
39 #ifndef HWCAP_S390_VX
40 #define HWCAP_S390_VX 2048
41 #endif
42 
43 /* Defined in auto-generated file s390-linux32.c. */
44 void init_registers_s390_linux32 (void);
45 extern const struct target_desc *tdesc_s390_linux32;
46 
47 /* Defined in auto-generated file s390-linux32v1.c. */
49 extern const struct target_desc *tdesc_s390_linux32v1;
50 
51 /* Defined in auto-generated file s390-linux32v2.c. */
53 extern const struct target_desc *tdesc_s390_linux32v2;
54 
55 /* Defined in auto-generated file s390-linux64.c. */
56 void init_registers_s390_linux64 (void);
57 extern const struct target_desc *tdesc_s390_linux64;
58 
59 /* Defined in auto-generated file s390-linux64v1.c. */
61 extern const struct target_desc *tdesc_s390_linux64v1;
62 
63 /* Defined in auto-generated file s390-linux64v2.c. */
65 extern const struct target_desc *tdesc_s390_linux64v2;
66 
67 /* Defined in auto-generated file s390-te-linux64.c. */
69 extern const struct target_desc *tdesc_s390_te_linux64;
70 
71 /* Defined in auto-generated file s390-vx-linux64.c. */
73 extern const struct target_desc *tdesc_s390_vx_linux64;
74 
75 /* Defined in auto-generated file s390-tevx-linux64.c. */
77 extern const struct target_desc *tdesc_s390_tevx_linux64;
78 
79 /* Defined in auto-generated file s390x-linux64.c. */
81 extern const struct target_desc *tdesc_s390x_linux64;
82 
83 /* Defined in auto-generated file s390x-linux64v1.c. */
85 extern const struct target_desc *tdesc_s390x_linux64v1;
86 
87 /* Defined in auto-generated file s390x-linux64v2.c. */
89 extern const struct target_desc *tdesc_s390x_linux64v2;
90 
91 /* Defined in auto-generated file s390x-te-linux64.c. */
93 extern const struct target_desc *tdesc_s390x_te_linux64;
94 
95 /* Defined in auto-generated file s390x-vx-linux64.c. */
97 extern const struct target_desc *tdesc_s390x_vx_linux64;
98 
99 /* Defined in auto-generated file s390x-tevx-linux64.c. */
101 extern const struct target_desc *tdesc_s390x_tevx_linux64;
102 
103 #define s390_num_regs 52
104 
105 static int s390_regmap[] = {
106  PT_PSWMASK, PT_PSWADDR,
107 
108  PT_GPR0, PT_GPR1, PT_GPR2, PT_GPR3,
109  PT_GPR4, PT_GPR5, PT_GPR6, PT_GPR7,
110  PT_GPR8, PT_GPR9, PT_GPR10, PT_GPR11,
111  PT_GPR12, PT_GPR13, PT_GPR14, PT_GPR15,
112 
113  PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3,
114  PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7,
115  PT_ACR8, PT_ACR9, PT_ACR10, PT_ACR11,
116  PT_ACR12, PT_ACR13, PT_ACR14, PT_ACR15,
117 
118  PT_FPC,
119 
120 #ifndef __s390x__
121  PT_FPR0_HI, PT_FPR1_HI, PT_FPR2_HI, PT_FPR3_HI,
122  PT_FPR4_HI, PT_FPR5_HI, PT_FPR6_HI, PT_FPR7_HI,
123  PT_FPR8_HI, PT_FPR9_HI, PT_FPR10_HI, PT_FPR11_HI,
124  PT_FPR12_HI, PT_FPR13_HI, PT_FPR14_HI, PT_FPR15_HI,
125 #else
126  PT_FPR0, PT_FPR1, PT_FPR2, PT_FPR3,
127  PT_FPR4, PT_FPR5, PT_FPR6, PT_FPR7,
128  PT_FPR8, PT_FPR9, PT_FPR10, PT_FPR11,
129  PT_FPR12, PT_FPR13, PT_FPR14, PT_FPR15,
130 #endif
131 
132  PT_ORIGGPR2,
133 };
134 
135 #ifdef __s390x__
136 #define s390_num_regs_3264 68
137 
138 static int s390_regmap_3264[] = {
139  PT_PSWMASK, PT_PSWADDR,
140 
141  PT_GPR0, PT_GPR0, PT_GPR1, PT_GPR1,
142  PT_GPR2, PT_GPR2, PT_GPR3, PT_GPR3,
143  PT_GPR4, PT_GPR4, PT_GPR5, PT_GPR5,
144  PT_GPR6, PT_GPR6, PT_GPR7, PT_GPR7,
145  PT_GPR8, PT_GPR8, PT_GPR9, PT_GPR9,
146  PT_GPR10, PT_GPR10, PT_GPR11, PT_GPR11,
147  PT_GPR12, PT_GPR12, PT_GPR13, PT_GPR13,
148  PT_GPR14, PT_GPR14, PT_GPR15, PT_GPR15,
149 
150  PT_ACR0, PT_ACR1, PT_ACR2, PT_ACR3,
151  PT_ACR4, PT_ACR5, PT_ACR6, PT_ACR7,
152  PT_ACR8, PT_ACR9, PT_ACR10, PT_ACR11,
153  PT_ACR12, PT_ACR13, PT_ACR14, PT_ACR15,
154 
155  PT_FPC,
156 
157  PT_FPR0, PT_FPR1, PT_FPR2, PT_FPR3,
158  PT_FPR4, PT_FPR5, PT_FPR6, PT_FPR7,
159  PT_FPR8, PT_FPR9, PT_FPR10, PT_FPR11,
160  PT_FPR12, PT_FPR13, PT_FPR14, PT_FPR15,
161 
162  PT_ORIGGPR2,
163 };
164 #endif
165 
166 
167 static int
169 {
170  return 0;
171 }
172 
173 static int
175 {
176  return 0;
177 }
178 
179 static void
180 s390_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
181 {
182  int size = register_size (regcache->tdesc, regno);
183  if (size < sizeof (long))
184  {
185  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
186  struct usrregs_info *usr = regs_info->usrregs;
187  int regaddr = usr->regmap[regno];
188 
189  memset (buf, 0, sizeof (long));
190 
191  if ((regno ^ 1) < usr->num_regs
192  && usr->regmap[regno ^ 1] == regaddr)
193  {
194  collect_register (regcache, regno & ~1, buf);
195  collect_register (regcache, (regno & ~1) + 1,
196  buf + sizeof (long) - size);
197  }
198  else if (regaddr == PT_PSWMASK)
199  {
200  /* Convert 4-byte PSW mask to 8 bytes by clearing bit 12 and copying
201  the basic addressing mode bit from the PSW address. */
202  char *addr = alloca (register_size (regcache->tdesc, regno ^ 1));
203  collect_register (regcache, regno, buf);
204  collect_register (regcache, regno ^ 1, addr);
205  buf[1] &= ~0x8;
206  buf[size] |= (addr[0] & 0x80);
207  }
208  else if (regaddr == PT_PSWADDR)
209  {
210  /* Convert 4-byte PSW address to 8 bytes by clearing the addressing
211  mode bit (which gets copied to the PSW mask instead). */
212  collect_register (regcache, regno, buf + sizeof (long) - size);
213  buf[sizeof (long) - size] &= ~0x80;
214  }
215  else if ((regaddr >= PT_GPR0 && regaddr <= PT_GPR15)
216  || regaddr == PT_ORIGGPR2)
217  collect_register (regcache, regno, buf + sizeof (long) - size);
218  else
219  collect_register (regcache, regno, buf);
220  }
221  else
222  collect_register (regcache, regno, buf);
223 }
224 
225 static void
227  int regno, const char *buf)
228 {
229  int size = register_size (regcache->tdesc, regno);
230  if (size < sizeof (long))
231  {
232  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
233  struct usrregs_info *usr = regs_info->usrregs;
234  int regaddr = usr->regmap[regno];
235 
236  if ((regno ^ 1) < usr->num_regs
237  && usr->regmap[regno ^ 1] == regaddr)
238  {
239  supply_register (regcache, regno & ~1, buf);
240  supply_register (regcache, (regno & ~1) + 1,
241  buf + sizeof (long) - size);
242  }
243  else if (regaddr == PT_PSWMASK)
244  {
245  /* Convert 8-byte PSW mask to 4 bytes by setting bit 12 and copying
246  the basic addressing mode into the PSW address. */
247  char *mask = alloca (size);
248  char *addr = alloca (register_size (regcache->tdesc, regno ^ 1));
249  memcpy (mask, buf, size);
250  mask[1] |= 0x8;
251  supply_register (regcache, regno, mask);
252 
253  collect_register (regcache, regno ^ 1, addr);
254  addr[0] &= ~0x80;
255  addr[0] |= (buf[size] & 0x80);
256  supply_register (regcache, regno ^ 1, addr);
257  }
258  else if (regaddr == PT_PSWADDR)
259  {
260  /* Convert 8-byte PSW address to 4 bytes by truncating, but
261  keeping the addressing mode bit (which was set from the mask). */
262  char *addr = alloca (size);
263  char amode;
264  collect_register (regcache, regno, addr);
265  amode = addr[0] & 0x80;
266  memcpy (addr, buf + sizeof (long) - size, size);
267  addr[0] &= ~0x80;
268  addr[0] |= amode;
269  supply_register (regcache, regno, addr);
270  }
271  else if ((regaddr >= PT_GPR0 && regaddr <= PT_GPR15)
272  || regaddr == PT_ORIGGPR2)
273  supply_register (regcache, regno, buf + sizeof (long) - size);
274  else
275  supply_register (regcache, regno, buf);
276  }
277  else
278  supply_register (regcache, regno, buf);
279 }
280 
281 /* Provide only a fill function for the general register set. ps_lgetregs
282  will use this for NPTL support. */
283 
284 static void
285 s390_fill_gregset (struct regcache *regcache, void *buf)
286 {
287  int i;
288  const struct regs_info *regs_info = (*the_low_target.regs_info) ();
289  struct usrregs_info *usr = regs_info->usrregs;
290 
291  for (i = 0; i < usr->num_regs; i++)
292  {
293  if (usr->regmap[i] < PT_PSWMASK
294  || usr->regmap[i] > PT_ACR15)
295  continue;
296 
297  s390_collect_ptrace_register (regcache, i,
298  (char *) buf + usr->regmap[i]);
299  }
300 }
301 
302 /* Fill and store functions for extended register sets. */
303 
304 static void
305 s390_store_last_break (struct regcache *regcache, const void *buf)
306 {
307  const char *p;
308 
309  p = (const char *) buf + 8 - register_size (regcache->tdesc, 0);
310  supply_register_by_name (regcache, "last_break", p);
311 }
312 
313 static void
315 {
316  collect_register_by_name (regcache, "system_call", buf);
317 }
318 
319 static void
320 s390_store_system_call (struct regcache *regcache, const void *buf)
321 {
322  supply_register_by_name (regcache, "system_call", buf);
323 }
324 
325 static void
326 s390_store_tdb (struct regcache *regcache, const void *buf)
327 {
328  int tdb0 = find_regno (regcache->tdesc, "tdb0");
329  int tr0 = find_regno (regcache->tdesc, "tr0");
330  int i;
331 
332  for (i = 0; i < 4; i++)
333  supply_register (regcache, tdb0 + i, (const char *) buf + 8 * i);
334 
335  for (i = 0; i < 16; i++)
336  supply_register (regcache, tr0 + i, (const char *) buf + 8 * (16 + i));
337 }
338 
339 static void
341 {
342  int v0 = find_regno (regcache->tdesc, "v0l");
343  int i;
344 
345  for (i = 0; i < 16; i++)
346  collect_register (regcache, v0 + i, (char *) buf + 8 * i);
347 }
348 
349 static void
350 s390_store_vxrs_low (struct regcache *regcache, const void *buf)
351 {
352  int v0 = find_regno (regcache->tdesc, "v0l");
353  int i;
354 
355  for (i = 0; i < 16; i++)
356  supply_register (regcache, v0 + i, (const char *) buf + 8 * i);
357 }
358 
359 static void
361 {
362  int v16 = find_regno (regcache->tdesc, "v16");
363  int i;
364 
365  for (i = 0; i < 16; i++)
366  collect_register (regcache, v16 + i, (char *) buf + 16 * i);
367 }
368 
369 static void
370 s390_store_vxrs_high (struct regcache *regcache, const void *buf)
371 {
372  int v16 = find_regno (regcache->tdesc, "v16");
373  int i;
374 
375  for (i = 0; i < 16; i++)
376  supply_register (regcache, v16 + i, (const char *) buf + 16 * i);
377 }
378 
379 static struct regset_info s390_regsets[] = {
380  { 0, 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL },
381  /* Last break address is read-only; no fill function. */
382  { PTRACE_GETREGSET, -1, NT_S390_LAST_BREAK, 0, EXTENDED_REGS,
383  NULL, s390_store_last_break },
384  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_SYSTEM_CALL, 0,
386  /* TDB is read-only. */
387  { PTRACE_GETREGSET, -1, NT_S390_TDB, 0, EXTENDED_REGS,
388  NULL, s390_store_tdb },
389  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_LOW, 0,
390  EXTENDED_REGS, s390_fill_vxrs_low, s390_store_vxrs_low },
391  { PTRACE_GETREGSET, PTRACE_SETREGSET, NT_S390_VXRS_HIGH, 0,
392  EXTENDED_REGS, s390_fill_vxrs_high, s390_store_vxrs_high },
393  { 0, 0, 0, -1, -1, NULL, NULL }
394 };
395 
396 
397 static const unsigned char s390_breakpoint[] = { 0, 1 };
398 #define s390_breakpoint_len 2
399 
400 static CORE_ADDR
402 {
403  if (register_size (regcache->tdesc, 0) == 4)
404  {
405  unsigned int pswa;
406  collect_register_by_name (regcache, "pswa", &pswa);
407  return pswa & 0x7fffffff;
408  }
409  else
410  {
411  unsigned long pc;
412  collect_register_by_name (regcache, "pswa", &pc);
413  return pc;
414  }
415 }
416 
417 static void
419 {
420  if (register_size (regcache->tdesc, 0) == 4)
421  {
422  unsigned int pswa;
423  collect_register_by_name (regcache, "pswa", &pswa);
424  pswa = (pswa & 0x80000000) | (newpc & 0x7fffffff);
425  supply_register_by_name (regcache, "pswa", &pswa);
426  }
427  else
428  {
429  unsigned long pc = newpc;
430  supply_register_by_name (regcache, "pswa", &pc);
431  }
432 }
433 
434 #ifdef __s390x__
435 static unsigned long
436 s390_get_hwcap (const struct target_desc *tdesc)
437 {
438  int wordsize = register_size (tdesc, 0);
439  unsigned char *data = alloca (2 * wordsize);
440  int offset = 0;
441 
442  while ((*the_target->read_auxv) (offset, data, 2 * wordsize) == 2 * wordsize)
443  {
444  if (wordsize == 4)
445  {
446  unsigned int *data_p = (unsigned int *)data;
447  if (data_p[0] == AT_HWCAP)
448  return data_p[1];
449  }
450  else
451  {
452  unsigned long *data_p = (unsigned long *)data;
453  if (data_p[0] == AT_HWCAP)
454  return data_p[1];
455  }
456 
457  offset += 2 * wordsize;
458  }
459 
460  return 0;
461 }
462 #endif
463 
464 static int
465 s390_check_regset (int pid, int regset, int regsize)
466 {
467  gdb_byte *buf = alloca (regsize);
468  struct iovec iov;
469 
470  iov.iov_base = buf;
471  iov.iov_len = regsize;
472 
473  if (ptrace (PTRACE_GETREGSET, pid, (long) regset, (long) &iov) >= 0
474  || errno == ENODATA)
475  return 1;
476  return 0;
477 }
478 
479 #ifdef __s390x__
480 /* For a 31-bit inferior, whether the kernel supports using the full
481  64-bit GPRs. */
482 static int have_hwcap_s390_high_gprs = 0;
483 #endif
484 
485 static void
487 {
488  const struct target_desc *tdesc;
489  struct regset_info *regset;
490 
491  /* Check whether the kernel supports extra register sets. */
492  int pid = pid_of (current_thread);
493  int have_regset_last_break
494  = s390_check_regset (pid, NT_S390_LAST_BREAK, 8);
495  int have_regset_system_call
496  = s390_check_regset (pid, NT_S390_SYSTEM_CALL, 4);
497  int have_regset_tdb = s390_check_regset (pid, NT_S390_TDB, 256);
498  int have_regset_vxrs = s390_check_regset (pid, NT_S390_VXRS_LOW, 128)
499  && s390_check_regset (pid, NT_S390_VXRS_HIGH, 256);
500 
501  /* Assume 31-bit inferior process. */
502  if (have_regset_system_call)
503  tdesc = tdesc_s390_linux32v2;
504  else if (have_regset_last_break)
505  tdesc = tdesc_s390_linux32v1;
506  else
507  tdesc = tdesc_s390_linux32;
508 
509  /* On a 64-bit host, check the low bit of the (31-bit) PSWM
510  -- if this is one, we actually have a 64-bit inferior. */
511 #ifdef __s390x__
512  {
513  unsigned int pswm;
514  struct regcache *regcache = new_register_cache (tdesc);
515 
516  fetch_inferior_registers (regcache, find_regno (tdesc, "pswm"));
517  collect_register_by_name (regcache, "pswm", &pswm);
518  free_register_cache (regcache);
519 
520  if (pswm & 1)
521  {
522  if (have_regset_tdb)
523  have_regset_tdb =
524  (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_TE) != 0;
525  if (have_regset_vxrs)
526  have_regset_vxrs =
527  (s390_get_hwcap (tdesc_s390x_linux64v2) & HWCAP_S390_VX) != 0;
528 
529  if (have_regset_vxrs)
530  tdesc = (have_regset_tdb ? tdesc_s390x_tevx_linux64 :
532  else if (have_regset_tdb)
533  tdesc = tdesc_s390x_te_linux64;
534  else if (have_regset_system_call)
535  tdesc = tdesc_s390x_linux64v2;
536  else if (have_regset_last_break)
537  tdesc = tdesc_s390x_linux64v1;
538  else
539  tdesc = tdesc_s390x_linux64;
540  }
541 
542  /* For a 31-bit inferior, check whether the kernel supports
543  using the full 64-bit GPRs. */
544  else if (s390_get_hwcap (tdesc) & HWCAP_S390_HIGH_GPRS)
545  {
546  have_hwcap_s390_high_gprs = 1;
547  if (have_regset_tdb)
548  have_regset_tdb = (s390_get_hwcap (tdesc) & HWCAP_S390_TE) != 0;
549  if (have_regset_vxrs)
550  have_regset_vxrs = (s390_get_hwcap (tdesc) & HWCAP_S390_VX) != 0;
551 
552  if (have_regset_vxrs)
553  tdesc = (have_regset_tdb ? tdesc_s390_tevx_linux64 :
555  else if (have_regset_tdb)
556  tdesc = tdesc_s390_te_linux64;
557  else if (have_regset_system_call)
558  tdesc = tdesc_s390_linux64v2;
559  else if (have_regset_last_break)
560  tdesc = tdesc_s390_linux64v1;
561  else
562  tdesc = tdesc_s390_linux64;
563  }
564  }
565 #endif
566 
567  /* Update target_regsets according to available register sets. */
568  for (regset = s390_regsets; regset->size >= 0; regset++)
569  if (regset->get_request == PTRACE_GETREGSET)
570  switch (regset->nt_type)
571  {
572  case NT_S390_LAST_BREAK:
573  regset->size = have_regset_last_break? 8 : 0;
574  break;
575  case NT_S390_SYSTEM_CALL:
576  regset->size = have_regset_system_call? 4 : 0;
577  break;
578  case NT_S390_TDB:
579  regset->size = have_regset_tdb ? 256 : 0;
580  break;
581  case NT_S390_VXRS_LOW:
582  regset->size = have_regset_vxrs ? 128 : 0;
583  break;
584  case NT_S390_VXRS_HIGH:
585  regset->size = have_regset_vxrs ? 256 : 0;
586  break;
587  default:
588  break;
589  }
590 
592 }
593 
594 
595 static int
597 {
598  unsigned char c[s390_breakpoint_len];
600  return memcmp (c, s390_breakpoint, s390_breakpoint_len) == 0;
601 }
602 
603 static struct usrregs_info s390_usrregs_info =
604  {
606  s390_regmap,
607  };
608 
609 static struct regsets_info s390_regsets_info =
610  {
611  s390_regsets, /* regsets */
612  0, /* num_regsets */
613  NULL, /* disabled_regsets */
614  };
615 
616 static struct regs_info regs_info =
617  {
618  NULL, /* regset_bitmap */
620  &s390_regsets_info
621  };
622 
623 #ifdef __s390x__
624 static struct usrregs_info s390_usrregs_info_3264 =
625  {
626  s390_num_regs_3264,
627  s390_regmap_3264
628  };
629 
630 static struct regsets_info s390_regsets_info_3264 =
631  {
632  s390_regsets, /* regsets */
633  0, /* num_regsets */
634  NULL, /* disabled_regsets */
635  };
636 
637 static struct regs_info regs_info_3264 =
638  {
639  NULL, /* regset_bitmap */
640  &s390_usrregs_info_3264,
641  &s390_regsets_info_3264
642  };
643 #endif
644 
645 static const struct regs_info *
647 {
648 #ifdef __s390x__
649  if (have_hwcap_s390_high_gprs)
650  {
651  const struct target_desc *tdesc = current_process ()->tdesc;
652 
653  if (register_size (tdesc, 0) == 4)
654  return &regs_info_3264;
655  }
656 #endif
657  return &regs_info;
658 }
659 
660 struct linux_target_ops the_low_target = {
665  NULL, /* fetch_register */
666  s390_get_pc,
667  s390_set_pc,
670  NULL,
673  NULL, /* supports_z_point_type */
674  NULL,
675  NULL,
676  NULL,
677  NULL,
680 };
681 
682 void
684 {
685  /* Initialize the Linux target descriptions. */
686 
702 
703  initialize_regsets_info (&s390_regsets_info);
704 #ifdef __s390x__
705  initialize_regsets_info (&s390_regsets_info_3264);
706 #endif
707 }
const struct target_desc * tdesc
Definition: regcache.h:41
const struct target_desc * tdesc_s390x_te_linux64
struct thread_info * current_thread
Definition: inferiors.c:28
void collect_register(struct regcache *regcache, int n, void *buf)
Definition: regcache.c:414
const struct target_desc * tdesc_s390x_vx_linux64
static void s390_store_system_call(struct regcache *regcache, const void *buf)
void init_registers_s390_linux32(void)
struct usrregs_info * usrregs
Definition: linux-low.h:99
bfd_vma CORE_ADDR
Definition: common-types.h:41
struct regcache * new_register_cache(const struct target_desc *tdesc)
Definition: regcache.c:160
void supply_register_by_name(struct regcache *regcache, const char *name, const void *buf)
Definition: regcache.c:405
const struct target_desc * tdesc_s390x_linux64
const struct target_desc * tdesc_s390_tevx_linux64
const struct target_desc * tdesc_s390x_linux64v2
const struct target_desc * tdesc_s390_linux64v2
void init_registers_s390_linux64(void)
static CORE_ADDR s390_get_pc(struct regcache *regcache)
void init_registers_s390x_tevx_linux64(void)
static int s390_check_regset(int pid, int regset, int regsize)
static int s390_regmap[]
static void s390_store_tdb(struct regcache *regcache, const void *buf)
void init_registers_s390x_linux64v1(void)
static void s390_fill_vxrs_high(struct regcache *regcache, void *buf)
const struct regs_info *(* regs_info)(void)
Definition: linux-low.h:132
void init_registers_s390x_linux64(void)
static void s390_fill_system_call(struct regcache *regcache, void *buf)
struct target_ops * the_target
Definition: target.c:24
const struct target_desc * tdesc
Definition: inferiors.h:69
const struct target_desc * tdesc_s390_linux64
void init_registers_s390x_te_linux64(void)
void init_registers_s390_vx_linux64(void)
void collect_register_by_name(struct regcache *regcache, const char *name, void *buf)
Definition: regcache.c:430
static void s390_arch_setup(void)
void init_registers_s390_linux64v2(void)
#define HWCAP_S390_VX
const struct target_desc * tdesc_s390_linux64v1
int read_inferior_memory(CORE_ADDR memaddr, unsigned char *myaddr, int len)
Definition: target.c:43
static void s390_store_vxrs_high(struct regcache *regcache, const void *buf)
const struct target_desc * tdesc_s390_te_linux64
void initialize_low_arch(void)
int register_size(const struct target_desc *tdesc, int n)
Definition: regcache.c:314
void init_registers_s390x_linux64v2(void)
#define PTRACE_SETREGSET
Definition: linux-ptrace.h:51
const struct target_desc * tdesc_s390x_tevx_linux64
static int s390_cannot_fetch_register(int regno)
struct process_info * current_process(void)
Definition: inferiors.c:356
void init_registers_s390x_vx_linux64(void)
static void s390_supply_ptrace_register(struct regcache *regcache, int regno, const char *buf)
static struct regs_info regs_info
#define PTRACE_GETREGSET
Definition: linux-ptrace.h:47
#define errno
Definition: wincecompat.h:24
const struct target_desc * tdesc_s390_linux32v2
static void s390_store_last_break(struct regcache *regcache, const void *buf)
const struct target_desc * tdesc_s390x_linux64v1
static const unsigned char s390_breakpoint[]
static struct usrregs_info s390_usrregs_info
static void s390_set_pc(struct regcache *regcache, CORE_ADDR newpc)
bfd_byte gdb_byte
Definition: common-types.h:38
static int s390_breakpoint_at(CORE_ADDR pc)
#define s390_num_regs
int find_regno(const struct target_desc *tdesc, const char *name)
Definition: regcache.c:257
const struct target_desc * tdesc_s390_vx_linux64
void * alloca(size_t)
#define fetch_inferior_registers(regcache, regno)
Definition: target.h:477
int(* read_auxv)(CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
Definition: target.h:189
int num_regs
Definition: linux-low.h:80
static void s390_store_vxrs_low(struct regcache *regcache, const void *buf)
const struct target_desc * tdesc_s390_linux32v1
static struct regset_info s390_regsets[]
#define HWCAP_S390_TE
#define pid_of(inf)
Definition: inferiors.h:76
static void s390_fill_vxrs_low(struct regcache *regcache, void *buf)
void init_registers_s390_linux64v1(void)
void free_register_cache(struct regcache *regcache)
Definition: regcache.c:171
static void s390_fill_gregset(struct regcache *regcache, void *buf)
#define HWCAP_S390_HIGH_GPRS
static const struct regs_info * s390_regs_info(void)
void init_registers_s390_tevx_linux64(void)
#define s390_breakpoint_len
const struct target_desc * tdesc_s390_linux32
void init_registers_s390_linux32v2(void)
void supply_register(struct regcache *regcache, int n, const void *buf)
Definition: regcache.c:330
int * regmap
Definition: linux-low.h:83
void init_registers_s390_linux32v1(void)
static void s390_collect_ptrace_register(struct regcache *regcache, int regno, char *buf)
void init_registers_s390_te_linux64(void)
static int s390_cannot_store_register(int regno)