GDB (xrefs)
Loading...
Searching...
No Matches
aarch64-linux-tdep.c
Go to the documentation of this file.
1/* Target-dependent code for GNU/Linux AArch64.
2
3 Copyright (C) 2009-2023 Free Software Foundation, Inc.
4 Contributed by ARM Ltd.
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20
21#include "defs.h"
22
23#include "gdbarch.h"
24#include "glibc-tdep.h"
25#include "linux-tdep.h"
26#include "aarch64-tdep.h"
27#include "aarch64-linux-tdep.h"
28#include "osabi.h"
29#include "solib-svr4.h"
30#include "symtab.h"
31#include "tramp-frame.h"
32#include "trad-frame.h"
33#include "target.h"
34#include "target/target.h"
35#include "expop.h"
36#include "auxv.h"
37
38#include "regcache.h"
39#include "regset.h"
40
41#include "stap-probe.h"
42#include "parser-defs.h"
43#include "user-regs.h"
44#include "xml-syscall.h"
45#include <ctype.h>
46
47#include "record-full.h"
48#include "linux-record.h"
49
51
52#include "arch-utils.h"
53#include "value.h"
54
55#include "gdbsupport/selftest.h"
56
57#include "elf/common.h"
58#include "elf/aarch64.h"
59
60/* For inferior_ptid and current_inferior (). */
61#include "inferior.h"
62
63/* Signal frame handling.
64
65 +------------+ ^
66 | saved lr | |
67 +->| saved fp |--+
68 | | |
69 | | |
70 | +------------+
71 | | saved lr |
72 +--| saved fp |
73 ^ | |
74 | | |
75 | +------------+
76 ^ | |
77 | | signal |
78 | | | SIGTRAMP_FRAME (struct rt_sigframe)
79 | | saved regs |
80 +--| saved sp |--> interrupted_sp
81 | | saved pc |--> interrupted_pc
82 | | |
83 | +------------+
84 | | saved lr |--> default_restorer (movz x8, NR_sys_rt_sigreturn; svc 0)
85 +--| saved fp |<- FP
86 | | NORMAL_FRAME
87 | |<- SP
88 +------------+
89
90 On signal delivery, the kernel will create a signal handler stack
91 frame and setup the return address in LR to point at restorer stub.
92 The signal stack frame is defined by:
93
94 struct rt_sigframe
95 {
96 siginfo_t info;
97 struct ucontext uc;
98 };
99
100 The ucontext has the following form:
101 struct ucontext
102 {
103 unsigned long uc_flags;
104 struct ucontext *uc_link;
105 stack_t uc_stack;
106 sigset_t uc_sigmask;
107 struct sigcontext uc_mcontext;
108 };
109
110 struct sigcontext
111 {
112 unsigned long fault_address;
113 unsigned long regs[31];
114 unsigned long sp; / * 31 * /
115 unsigned long pc; / * 32 * /
116 unsigned long pstate; / * 33 * /
117 __u8 __reserved[4096]
118 };
119
120 The reserved space in sigcontext contains additional structures, each starting
121 with a aarch64_ctx, which specifies a unique identifier and the total size of
122 the structure. The final structure in reserved will start will a null
123 aarch64_ctx. The penultimate entry in reserved may be a extra_context which
124 then points to a further block of reserved space.
125
126 struct aarch64_ctx {
127 u32 magic;
128 u32 size;
129 };
130
131 The restorer stub will always have the form:
132
133 d28015a8 movz x8, #0xad
134 d4000001 svc #0x0
135
136 This is a system call sys_rt_sigreturn.
137
138 We detect signal frames by snooping the return code for the restorer
139 instruction sequence.
140
141 The handler then needs to recover the saved register set from
142 ucontext.uc_mcontext. */
143
144/* These magic numbers need to reflect the layout of the kernel
145 defined struct rt_sigframe and ucontext. */
146#define AARCH64_SIGCONTEXT_REG_SIZE 8
147#define AARCH64_RT_SIGFRAME_UCONTEXT_OFFSET 128
148#define AARCH64_UCONTEXT_SIGCONTEXT_OFFSET 176
149#define AARCH64_SIGCONTEXT_XO_OFFSET 8
150#define AARCH64_SIGCONTEXT_RESERVED_OFFSET 288
151
152#define AARCH64_SIGCONTEXT_RESERVED_SIZE 4096
153
154/* Unique identifiers that may be used for aarch64_ctx.magic. */
155#define AARCH64_EXTRA_MAGIC 0x45585401
156#define AARCH64_FPSIMD_MAGIC 0x46508001
157#define AARCH64_SVE_MAGIC 0x53564501
158
159/* Defines for the extra_context that follows an AARCH64_EXTRA_MAGIC. */
160#define AARCH64_EXTRA_DATAP_OFFSET 8
161
162/* Defines for the fpsimd that follows an AARCH64_FPSIMD_MAGIC. */
163#define AARCH64_FPSIMD_FPSR_OFFSET 8
164#define AARCH64_FPSIMD_FPCR_OFFSET 12
165#define AARCH64_FPSIMD_V0_OFFSET 16
166#define AARCH64_FPSIMD_VREG_SIZE 16
167
168/* Defines for the sve structure that follows an AARCH64_SVE_MAGIC. */
169#define AARCH64_SVE_CONTEXT_VL_OFFSET 8
170#define AARCH64_SVE_CONTEXT_REGS_OFFSET 16
171#define AARCH64_SVE_CONTEXT_P_REGS_OFFSET(vq) (32 * vq * 16)
172#define AARCH64_SVE_CONTEXT_FFR_OFFSET(vq) \
173 (AARCH64_SVE_CONTEXT_P_REGS_OFFSET (vq) + (16 * vq * 2))
174#define AARCH64_SVE_CONTEXT_SIZE(vq) \
175 (AARCH64_SVE_CONTEXT_FFR_OFFSET (vq) + (vq * 2))
176
177
178/* Read an aarch64_ctx, returning the magic value, and setting *SIZE to the
179 size, or return 0 on error. */
180
181static uint32_t
182read_aarch64_ctx (CORE_ADDR ctx_addr, enum bfd_endian byte_order,
183 uint32_t *size)
184{
185 uint32_t magic = 0;
186 gdb_byte buf[4];
187
188 if (target_read_memory (ctx_addr, buf, 4) != 0)
189 return 0;
190 magic = extract_unsigned_integer (buf, 4, byte_order);
191
192 if (target_read_memory (ctx_addr + 4, buf, 4) != 0)
193 return 0;
194 *size = extract_unsigned_integer (buf, 4, byte_order);
195
196 return magic;
197}
198
199/* Given CACHE, use the trad_frame* functions to restore the FPSIMD
200 registers from a signal frame.
201
202 VREG_NUM is the number of the V register being restored, OFFSET is the
203 address containing the register value, BYTE_ORDER is the endianness and
204 HAS_SVE tells us if we have a valid SVE context or not. */
205
206static void
207aarch64_linux_restore_vreg (struct trad_frame_cache *cache, int num_regs,
208 int vreg_num, CORE_ADDR offset,
209 enum bfd_endian byte_order, bool has_sve)
210{
211 /* WARNING: SIMD state is laid out in memory in target-endian format.
212
213 So we have a couple cases to consider:
214
215 1 - If the target is big endian, then SIMD state is big endian,
216 requiring a byteswap.
217
218 2 - If the target is little endian, then SIMD state is little endian, so
219 no byteswap is needed. */
220
221 if (byte_order == BFD_ENDIAN_BIG)
222 {
223 gdb_byte buf[V_REGISTER_SIZE];
224
225 if (target_read_memory (offset, buf, V_REGISTER_SIZE) != 0)
226 {
227 size_t size = V_REGISTER_SIZE/2;
228
229 /* Read the two halves of the V register in reverse byte order. */
230 CORE_ADDR u64 = extract_unsigned_integer (buf, size,
231 byte_order);
232 CORE_ADDR l64 = extract_unsigned_integer (buf + size, size,
233 byte_order);
234
235 /* Copy the reversed bytes to the buffer. */
236 store_unsigned_integer (buf, size, BFD_ENDIAN_LITTLE, l64);
237 store_unsigned_integer (buf + size , size, BFD_ENDIAN_LITTLE, u64);
238
239 /* Now we can store the correct bytes for the V register. */
241 {buf, V_REGISTER_SIZE});
243 num_regs + AARCH64_Q0_REGNUM
244 + vreg_num, {buf, Q_REGISTER_SIZE});
246 num_regs + AARCH64_D0_REGNUM
247 + vreg_num, {buf, D_REGISTER_SIZE});
249 num_regs + AARCH64_S0_REGNUM
250 + vreg_num, {buf, S_REGISTER_SIZE});
252 num_regs + AARCH64_H0_REGNUM
253 + vreg_num, {buf, H_REGISTER_SIZE});
255 num_regs + AARCH64_B0_REGNUM
256 + vreg_num, {buf, B_REGISTER_SIZE});
257
258 if (has_sve)
260 num_regs + AARCH64_SVE_V0_REGNUM
261 + vreg_num, {buf, V_REGISTER_SIZE});
262 }
263 return;
264 }
265
266 /* Little endian, just point at the address containing the register
267 value. */
268 trad_frame_set_reg_addr (cache, AARCH64_V0_REGNUM + vreg_num, offset);
269 trad_frame_set_reg_addr (cache, num_regs + AARCH64_Q0_REGNUM + vreg_num,
270 offset);
271 trad_frame_set_reg_addr (cache, num_regs + AARCH64_D0_REGNUM + vreg_num,
272 offset);
273 trad_frame_set_reg_addr (cache, num_regs + AARCH64_S0_REGNUM + vreg_num,
274 offset);
275 trad_frame_set_reg_addr (cache, num_regs + AARCH64_H0_REGNUM + vreg_num,
276 offset);
277 trad_frame_set_reg_addr (cache, num_regs + AARCH64_B0_REGNUM + vreg_num,
278 offset);
279
280 if (has_sve)
282 + vreg_num, offset);
283
284}
285
286/* Implement the "init" method of struct tramp_frame. */
287
288static void
290 frame_info_ptr this_frame,
291 struct trad_frame_cache *this_cache,
292 CORE_ADDR func)
293{
294 struct gdbarch *gdbarch = get_frame_arch (this_frame);
295 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
296 aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
297 CORE_ADDR sp = get_frame_register_unsigned (this_frame, AARCH64_SP_REGNUM);
298 CORE_ADDR sigcontext_addr = (sp + AARCH64_RT_SIGFRAME_UCONTEXT_OFFSET
300 CORE_ADDR section = sigcontext_addr + AARCH64_SIGCONTEXT_RESERVED_OFFSET;
301 CORE_ADDR section_end = section + AARCH64_SIGCONTEXT_RESERVED_SIZE;
302 CORE_ADDR fpsimd = 0;
303 CORE_ADDR sve_regs = 0;
304 uint32_t size, magic;
305 bool extra_found = false;
306 int num_regs = gdbarch_num_regs (gdbarch);
307
308 /* Read in the integer registers. */
309
310 for (int i = 0; i < 31; i++)
311 {
312 trad_frame_set_reg_addr (this_cache,
314 sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET
316 }
318 sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET
321 sigcontext_addr + AARCH64_SIGCONTEXT_XO_OFFSET
323
324 /* Search for the FP and SVE sections, stopping at null. */
325 while ((magic = read_aarch64_ctx (section, byte_order, &size)) != 0
326 && size != 0)
327 {
328 switch (magic)
329 {
331 fpsimd = section;
332 section += size;
333 break;
334
336 {
337 /* Check if the section is followed by a full SVE dump, and set
338 sve_regs if it is. */
339 gdb_byte buf[4];
340 uint16_t vq;
341
342 if (!tdep->has_sve ())
343 break;
344
346 buf, 2) != 0)
347 {
348 section += size;
349 break;
350 }
351 vq = sve_vq_from_vl (extract_unsigned_integer (buf, 2, byte_order));
352
353 if (vq != tdep->vq)
354 error (_("Invalid vector length in signal frame %d vs %s."), vq,
355 pulongest (tdep->vq));
356
357 if (size >= AARCH64_SVE_CONTEXT_SIZE (vq))
358 sve_regs = section + AARCH64_SVE_CONTEXT_REGS_OFFSET;
359
360 section += size;
361 break;
362 }
363
365 {
366 /* Extra is always the last valid section in reserved and points to
367 an additional block of memory filled with more sections. Reset
368 the address to the extra section and continue looking for more
369 structures. */
370 gdb_byte buf[8];
371
373 buf, 8) != 0)
374 {
375 section += size;
376 break;
377 }
378
379 section = extract_unsigned_integer (buf, 8, byte_order);
380 extra_found = true;
381 break;
382 }
383
384 default:
385 section += size;
386 break;
387 }
388
389 /* Prevent searching past the end of the reserved section. The extra
390 section does not have a hard coded limit - we have to rely on it ending
391 with nulls. */
392 if (!extra_found && section > section_end)
393 break;
394 }
395
396 if (sve_regs != 0)
397 {
398 CORE_ADDR offset;
399
400 for (int i = 0; i < 32; i++)
401 {
402 offset = sve_regs + (i * tdep->vq * 16);
404 offset);
405 trad_frame_set_reg_addr (this_cache,
406 num_regs + AARCH64_SVE_V0_REGNUM + i,
407 offset);
408 trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_Q0_REGNUM + i,
409 offset);
410 trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_D0_REGNUM + i,
411 offset);
412 trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_S0_REGNUM + i,
413 offset);
414 trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_H0_REGNUM + i,
415 offset);
416 trad_frame_set_reg_addr (this_cache, num_regs + AARCH64_B0_REGNUM + i,
417 offset);
418 }
419
420 offset = sve_regs + AARCH64_SVE_CONTEXT_P_REGS_OFFSET (tdep->vq);
421 for (int i = 0; i < 16; i++)
423 offset + (i * tdep->vq * 2));
424
425 offset = sve_regs + AARCH64_SVE_CONTEXT_FFR_OFFSET (tdep->vq);
427 }
428
429 if (fpsimd != 0)
430 {
435
436 /* If there was no SVE section then set up the V registers. */
437 if (sve_regs == 0)
438 {
439 for (int i = 0; i < 32; i++)
440 {
441 CORE_ADDR offset = (fpsimd + AARCH64_FPSIMD_V0_OFFSET
443
444 aarch64_linux_restore_vreg (this_cache, num_regs, i, offset,
445 byte_order, tdep->has_sve ());
446 }
447 }
448 }
449
450 trad_frame_set_id (this_cache, frame_id_build (sp, func));
451}
452
454{
456 4,
457 {
458 /* movz x8, 0x8b (S=1,o=10,h=0,i=0x8b,r=8)
459 Soo1 0010 1hhi iiii iiii iiii iiir rrrr */
460 {0xd2801168, ULONGEST_MAX},
461
462 /* svc 0x0 (o=0, l=1)
463 1101 0100 oooi iiii iiii iiii iii0 00ll */
464 {0xd4000001, ULONGEST_MAX},
466 },
468};
469
470/* Register maps. */
471
473 {
474 { 31, AARCH64_X0_REGNUM, 8 }, /* x0 ... x30 */
475 { 1, AARCH64_SP_REGNUM, 8 },
476 { 1, AARCH64_PC_REGNUM, 8 },
477 { 1, AARCH64_CPSR_REGNUM, 8 },
478 { 0 }
479 };
480
482 {
483 { 32, AARCH64_V0_REGNUM, 16 }, /* v0 ... v31 */
484 { 1, AARCH64_FPSR_REGNUM, 4 },
485 { 1, AARCH64_FPCR_REGNUM, 4 },
486 { 0 }
487 };
488
489/* Register set definitions. */
490
496
502
503/* The fields in an SVE header at the start of a SVE regset. */
504
505#define SVE_HEADER_SIZE_LENGTH 4
506#define SVE_HEADER_MAX_SIZE_LENGTH 4
507#define SVE_HEADER_VL_LENGTH 2
508#define SVE_HEADER_MAX_VL_LENGTH 2
509#define SVE_HEADER_FLAGS_LENGTH 2
510#define SVE_HEADER_RESERVED_LENGTH 2
511
512#define SVE_HEADER_SIZE_OFFSET 0
513#define SVE_HEADER_MAX_SIZE_OFFSET \
514 (SVE_HEADER_SIZE_OFFSET + SVE_HEADER_SIZE_LENGTH)
515#define SVE_HEADER_VL_OFFSET \
516 (SVE_HEADER_MAX_SIZE_OFFSET + SVE_HEADER_MAX_SIZE_LENGTH)
517#define SVE_HEADER_MAX_VL_OFFSET \
518 (SVE_HEADER_VL_OFFSET + SVE_HEADER_VL_LENGTH)
519#define SVE_HEADER_FLAGS_OFFSET \
520 (SVE_HEADER_MAX_VL_OFFSET + SVE_HEADER_MAX_VL_LENGTH)
521#define SVE_HEADER_RESERVED_OFFSET \
522 (SVE_HEADER_FLAGS_OFFSET + SVE_HEADER_FLAGS_LENGTH)
523#define SVE_HEADER_SIZE \
524 (SVE_HEADER_RESERVED_OFFSET + SVE_HEADER_RESERVED_LENGTH)
525
526#define SVE_HEADER_FLAG_SVE 1
527
528/* Get VQ value from SVE section in the core dump. */
529
530static uint64_t
532{
533 gdb_byte header[SVE_HEADER_SIZE];
534 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
535 asection *sve_section = bfd_get_section_by_name (abfd, ".reg-aarch-sve");
536
537 if (sve_section == nullptr)
538 {
539 /* No SVE state. */
540 return 0;
541 }
542
543 size_t size = bfd_section_size (sve_section);
544
545 /* Check extended state size. */
546 if (size < SVE_HEADER_SIZE)
547 {
548 warning (_("'.reg-aarch-sve' section in core file too small."));
549 return 0;
550 }
551
552 if (!bfd_get_section_contents (abfd, sve_section, header, 0, SVE_HEADER_SIZE))
553 {
554 warning (_("Couldn't read sve header from "
555 "'.reg-aarch-sve' section in core file."));
556 return 0;
557 }
558
559 uint64_t vl = extract_unsigned_integer (header + SVE_HEADER_VL_OFFSET,
560 SVE_HEADER_VL_LENGTH, byte_order);
561 uint64_t vq = sve_vq_from_vl (vl);
562
563 if (vq > AARCH64_MAX_SVE_VQ)
564 {
565 warning (_("SVE Vector length in core file not supported by this version"
566 " of GDB. (VQ=%s)"), pulongest (vq));
567 return 0;
568 }
569 else if (vq == 0)
570 {
571 warning (_("SVE Vector length in core file is invalid. (VQ=%s"),
572 pulongest (vq));
573 return 0;
574 }
575
576 return vq;
577}
578
579/* Supply register REGNUM from BUF to REGCACHE, using the register map
580 in REGSET. If REGNUM is -1, do this for all registers in REGSET.
581 If BUF is NULL, set the registers to "unavailable" status. */
582
583static void
585 struct regcache *regcache,
586 int regnum, const void *buf, size_t size)
587{
588 gdb_byte *header = (gdb_byte *) buf;
589 struct gdbarch *gdbarch = regcache->arch ();
590 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
591
592 if (buf == nullptr)
593 return regcache->supply_regset (regset, regnum, nullptr, size);
594 gdb_assert (size > SVE_HEADER_SIZE);
595
596 /* BUF contains an SVE header followed by a register dump of either the
597 passed in SVE regset or a NEON fpregset. */
598
599 /* Extract required fields from the header. */
600 ULONGEST vl = extract_unsigned_integer (header + SVE_HEADER_VL_OFFSET,
601 SVE_HEADER_VL_LENGTH, byte_order);
604 byte_order);
605
606 if (regnum == -1 || regnum == AARCH64_SVE_VG_REGNUM)
607 {
608 gdb_byte vg_target[8];
609 store_integer ((gdb_byte *)&vg_target, sizeof (uint64_t), byte_order,
610 sve_vg_from_vl (vl));
612 }
613
615 {
616 /* Register dump is a SVE structure. */
618 (gdb_byte *) buf + SVE_HEADER_SIZE,
620 }
621 else
622 {
623 /* Register dump is a fpsimd structure. First clear the SVE
624 registers. */
625 for (int i = 0; i < AARCH64_SVE_Z_REGS_NUM; i++)
627 for (int i = 0; i < AARCH64_SVE_P_REGS_NUM; i++)
630
631 /* Then supply the fpsimd registers. */
633 (gdb_byte *) buf + SVE_HEADER_SIZE,
635 }
636}
637
638/* Collect register REGNUM from REGCACHE to BUF, using the register
639 map in REGSET. If REGNUM is -1, do this for all registers in
640 REGSET. */
641
642static void
644 const struct regcache *regcache,
645 int regnum, void *buf, size_t size)
646{
647 gdb_byte *header = (gdb_byte *) buf;
648 struct gdbarch *gdbarch = regcache->arch ();
649 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
650 aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
651 uint64_t vq = tdep->vq;
652
653 gdb_assert (buf != NULL);
654 gdb_assert (size > SVE_HEADER_SIZE);
655
656 /* BUF starts with a SVE header prior to the register dump. */
657
659 SVE_HEADER_SIZE_LENGTH, byte_order, size);
661 SVE_HEADER_MAX_SIZE_LENGTH, byte_order, size);
663 byte_order, sve_vl_from_vq (vq));
665 SVE_HEADER_MAX_VL_LENGTH, byte_order,
666 sve_vl_from_vq (vq));
668 SVE_HEADER_FLAGS_LENGTH, byte_order,
671 SVE_HEADER_RESERVED_LENGTH, byte_order, 0);
672
673 /* The SVE register dump follows. */
674 regcache->collect_regset (regset, regnum, (gdb_byte *) buf + SVE_HEADER_SIZE,
676}
677
678/* Implement the "iterate_over_regset_sections" gdbarch method. */
679
680static void
683 void *cb_data,
684 const struct regcache *regcache)
685{
686 aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
687
689 &aarch64_linux_gregset, NULL, cb_data);
690
691 if (tdep->has_sve ())
692 {
693 /* Create this on the fly in order to handle vector register sizes. */
694 const struct regcache_map_entry sve_regmap[] =
695 {
696 { 32, AARCH64_SVE_Z0_REGNUM, (int) (tdep->vq * 16) },
697 { 16, AARCH64_SVE_P0_REGNUM, (int) (tdep->vq * 16 / 8) },
698 { 1, AARCH64_SVE_FFR_REGNUM, (int) (tdep->vq * 16 / 8) },
699 { 1, AARCH64_FPSR_REGNUM, 4 },
700 { 1, AARCH64_FPCR_REGNUM, 4 },
701 { 0 }
702 };
703
704 const struct regset aarch64_linux_sve_regset =
705 {
706 sve_regmap,
709 };
710
711 cb (".reg-aarch-sve",
714 &aarch64_linux_sve_regset, "SVE registers", cb_data);
715 }
716 else
718 &aarch64_linux_fpregset, NULL, cb_data);
719
720
721 if (tdep->has_pauth ())
722 {
723 /* Create this on the fly in order to handle the variable location. */
724 const struct regcache_map_entry pauth_regmap[] =
725 {
727 { 0 }
728 };
729
730 const struct regset aarch64_linux_pauth_regset =
731 {
733 };
734
735 cb (".reg-aarch-pauth", AARCH64_LINUX_SIZEOF_PAUTH,
736 AARCH64_LINUX_SIZEOF_PAUTH, &aarch64_linux_pauth_regset,
737 "pauth registers", cb_data);
738 }
739
740 /* Handle MTE registers. */
741 if (tdep->has_mte ())
742 {
743 /* Create this on the fly in order to handle the variable location. */
744 const struct regcache_map_entry mte_regmap[] =
745 {
746 { 1, tdep->mte_reg_base, 8},
747 { 0 }
748 };
749
750 const struct regset aarch64_linux_mte_regset =
751 {
753 };
754
755 cb (".reg-aarch-mte", AARCH64_LINUX_SIZEOF_MTE_REGSET,
756 AARCH64_LINUX_SIZEOF_MTE_REGSET, &aarch64_linux_mte_regset,
757 "MTE registers", cb_data);
758 }
759
760 /* Handle the TLS registers. */
761 if (tdep->has_tls ())
762 {
763 gdb_assert (tdep->tls_regnum_base != -1);
764 gdb_assert (tdep->tls_register_count > 0);
765
766 int sizeof_tls_regset
768
769 const struct regcache_map_entry tls_regmap[] =
770 {
771 { tdep->tls_register_count, tdep->tls_regnum_base,
773 { 0 }
774 };
775
776 const struct regset aarch64_linux_tls_regset =
777 {
780 };
781
782 cb (".reg-aarch-tls", sizeof_tls_regset, sizeof_tls_regset,
783 &aarch64_linux_tls_regset, "TLS register", cb_data);
784 }
785}
786
787/* Implement the "core_read_description" gdbarch method. */
788
789static const struct target_desc *
791 struct target_ops *target, bfd *abfd)
792{
793 gdb::optional<gdb::byte_vector> auxv = target_read_auxv_raw (target);
794 CORE_ADDR hwcap = linux_get_hwcap (auxv, target, gdbarch);
795 CORE_ADDR hwcap2 = linux_get_hwcap2 (auxv, target, gdbarch);
796
799 features.pauth = hwcap & AARCH64_HWCAP_PACA;
800 features.mte = hwcap2 & HWCAP2_MTE;
801
802 /* Handle the TLS section. */
803 asection *tls = bfd_get_section_by_name (abfd, ".reg-aarch-tls");
804 if (tls != nullptr)
805 {
806 size_t size = bfd_section_size (tls);
807 /* Convert the size to the number of actual registers, by
808 dividing by 8. */
810 }
811
813}
814
815/* Implementation of `gdbarch_stap_is_single_operand', as defined in
816 gdbarch.h. */
817
818static int
820{
821 return (*s == '#' || isdigit (*s) /* Literal number. */
822 || *s == '[' /* Register indirection. */
823 || isalpha (*s)); /* Register value. */
824}
825
826/* This routine is used to parse a special token in AArch64's assembly.
827
828 The special tokens parsed by it are:
829
830 - Register displacement (e.g, [fp, #-8])
831
832 It returns one if the special token has been parsed successfully,
833 or zero if the current token is not considered special. */
834
837 struct stap_parse_info *p)
838{
839 if (*p->arg == '[')
840 {
841 /* Temporary holder for lookahead. */
842 const char *tmp = p->arg;
843 char *endp;
844 /* Used to save the register name. */
845 const char *start;
846 int len;
847 int got_minus = 0;
848 long displacement;
849
850 ++tmp;
851 start = tmp;
852
853 /* Register name. */
854 while (isalnum (*tmp))
855 ++tmp;
856
857 if (*tmp != ',')
858 return {};
859
860 len = tmp - start;
861 std::string regname (start, len);
862
863 if (user_reg_map_name_to_regnum (gdbarch, regname.c_str (), len) == -1)
864 error (_("Invalid register name `%s' on expression `%s'."),
865 regname.c_str (), p->saved_arg);
866
867 ++tmp;
868 tmp = skip_spaces (tmp);
869 /* Now we expect a number. It can begin with '#' or simply
870 a digit. */
871 if (*tmp == '#')
872 ++tmp;
873
874 if (*tmp == '-')
875 {
876 ++tmp;
877 got_minus = 1;
878 }
879 else if (*tmp == '+')
880 ++tmp;
881
882 if (!isdigit (*tmp))
883 return {};
884
885 displacement = strtol (tmp, &endp, 10);
886 tmp = endp;
887
888 /* Skipping last `]'. */
889 if (*tmp++ != ']')
890 return {};
891 p->arg = tmp;
892
893 using namespace expr;
894
895 /* The displacement. */
896 struct type *long_type = builtin_type (gdbarch)->builtin_long;
897 if (got_minus)
898 displacement = -displacement;
899 operation_up disp = make_operation<long_const_operation> (long_type,
900 displacement);
901
902 /* The register name. */
903 operation_up reg
904 = make_operation<register_operation> (std::move (regname));
905
906 operation_up sum
907 = make_operation<add_operation> (std::move (reg), std::move (disp));
908
909 /* Casting to the expected type. */
910 struct type *arg_ptr_type = lookup_pointer_type (p->arg_type);
911 sum = make_operation<unop_cast_operation> (std::move (sum),
912 arg_ptr_type);
913 return make_operation<unop_ind_operation> (std::move (sum));
914 }
915 return {};
916}
917
918/* AArch64 process record-replay constructs: syscall, signal etc. */
919
921
922/* Enum that defines the AArch64 linux specific syscall identifiers used for
923 process record/replay. */
924
1188
1189/* aarch64_canonicalize_syscall maps syscall ids from the native AArch64
1190 linux set of syscall ids into a canonical set of syscall ids used by
1191 process record. */
1192
1193static enum gdb_syscall
1195{
1196#define SYSCALL_MAP(SYSCALL) case aarch64_sys_##SYSCALL: \
1197 return gdb_sys_##SYSCALL
1198
1199#define UNSUPPORTED_SYSCALL_MAP(SYSCALL) case aarch64_sys_##SYSCALL: \
1200 return gdb_sys_no_syscall
1201
1202 switch (syscall_number)
1203 {
1204 SYSCALL_MAP (io_setup);
1205 SYSCALL_MAP (io_destroy);
1206 SYSCALL_MAP (io_submit);
1207 SYSCALL_MAP (io_cancel);
1208 SYSCALL_MAP (io_getevents);
1209
1210 SYSCALL_MAP (setxattr);
1211 SYSCALL_MAP (lsetxattr);
1212 SYSCALL_MAP (fsetxattr);
1213 SYSCALL_MAP (getxattr);
1214 SYSCALL_MAP (lgetxattr);
1215 SYSCALL_MAP (fgetxattr);
1216 SYSCALL_MAP (listxattr);
1217 SYSCALL_MAP (llistxattr);
1218 SYSCALL_MAP (flistxattr);
1219 SYSCALL_MAP (removexattr);
1220 SYSCALL_MAP (lremovexattr);
1221 SYSCALL_MAP (fremovexattr);
1222 SYSCALL_MAP (getcwd);
1223 SYSCALL_MAP (lookup_dcookie);
1224 SYSCALL_MAP (eventfd2);
1225 SYSCALL_MAP (epoll_create1);
1226 SYSCALL_MAP (epoll_ctl);
1227 SYSCALL_MAP (epoll_pwait);
1228 SYSCALL_MAP (dup);
1229 SYSCALL_MAP (dup3);
1230 SYSCALL_MAP (fcntl);
1231 SYSCALL_MAP (inotify_init1);
1232 SYSCALL_MAP (inotify_add_watch);
1233 SYSCALL_MAP (inotify_rm_watch);
1234 SYSCALL_MAP (ioctl);
1235 SYSCALL_MAP (ioprio_set);
1236 SYSCALL_MAP (ioprio_get);
1237 SYSCALL_MAP (flock);
1238 SYSCALL_MAP (mknodat);
1239 SYSCALL_MAP (mkdirat);
1240 SYSCALL_MAP (unlinkat);
1241 SYSCALL_MAP (symlinkat);
1242 SYSCALL_MAP (linkat);
1243 SYSCALL_MAP (renameat);
1244 UNSUPPORTED_SYSCALL_MAP (umount2);
1245 SYSCALL_MAP (mount);
1246 SYSCALL_MAP (pivot_root);
1247 SYSCALL_MAP (nfsservctl);
1248 SYSCALL_MAP (statfs);
1249 SYSCALL_MAP (truncate);
1250 SYSCALL_MAP (ftruncate);
1251 SYSCALL_MAP (fallocate);
1252 SYSCALL_MAP (faccessat);
1253 SYSCALL_MAP (fchdir);
1254 SYSCALL_MAP (chroot);
1255 SYSCALL_MAP (fchmod);
1256 SYSCALL_MAP (fchmodat);
1257 SYSCALL_MAP (fchownat);
1258 SYSCALL_MAP (fchown);
1259 SYSCALL_MAP (openat);
1260 SYSCALL_MAP (close);
1261 SYSCALL_MAP (vhangup);
1262 SYSCALL_MAP (pipe2);
1263 SYSCALL_MAP (quotactl);
1264 SYSCALL_MAP (getdents64);
1265 SYSCALL_MAP (lseek);
1266 SYSCALL_MAP (read);
1267 SYSCALL_MAP (write);
1268 SYSCALL_MAP (readv);
1269 SYSCALL_MAP (writev);
1270 SYSCALL_MAP (pread64);
1271 SYSCALL_MAP (pwrite64);
1272 UNSUPPORTED_SYSCALL_MAP (preadv);
1273 UNSUPPORTED_SYSCALL_MAP (pwritev);
1274 SYSCALL_MAP (sendfile);
1275 SYSCALL_MAP (pselect6);
1276 SYSCALL_MAP (ppoll);
1277 UNSUPPORTED_SYSCALL_MAP (signalfd4);
1278 SYSCALL_MAP (vmsplice);
1279 SYSCALL_MAP (splice);
1280 SYSCALL_MAP (tee);
1281 SYSCALL_MAP (readlinkat);
1282 SYSCALL_MAP (newfstatat);
1283
1284 SYSCALL_MAP (fstat);
1285 SYSCALL_MAP (sync);
1286 SYSCALL_MAP (fsync);
1287 SYSCALL_MAP (fdatasync);
1288 SYSCALL_MAP (sync_file_range);
1289 UNSUPPORTED_SYSCALL_MAP (timerfd_create);
1290 UNSUPPORTED_SYSCALL_MAP (timerfd_settime);
1291 UNSUPPORTED_SYSCALL_MAP (timerfd_gettime);
1292 UNSUPPORTED_SYSCALL_MAP (utimensat);
1293 SYSCALL_MAP (acct);
1294 SYSCALL_MAP (capget);
1295 SYSCALL_MAP (capset);
1296 SYSCALL_MAP (personality);
1297 SYSCALL_MAP (exit);
1298 SYSCALL_MAP (exit_group);
1299 SYSCALL_MAP (waitid);
1300 SYSCALL_MAP (set_tid_address);
1301 SYSCALL_MAP (unshare);
1302 SYSCALL_MAP (futex);
1303 SYSCALL_MAP (set_robust_list);
1304 SYSCALL_MAP (get_robust_list);
1305 SYSCALL_MAP (nanosleep);
1306
1307 SYSCALL_MAP (getitimer);
1308 SYSCALL_MAP (setitimer);
1309 SYSCALL_MAP (kexec_load);
1310 SYSCALL_MAP (init_module);
1311 SYSCALL_MAP (delete_module);
1312 SYSCALL_MAP (timer_create);
1313 SYSCALL_MAP (timer_settime);
1314 SYSCALL_MAP (timer_gettime);
1315 SYSCALL_MAP (timer_getoverrun);
1316 SYSCALL_MAP (timer_delete);
1317 SYSCALL_MAP (clock_settime);
1318 SYSCALL_MAP (clock_gettime);
1319 SYSCALL_MAP (clock_getres);
1320 SYSCALL_MAP (clock_nanosleep);
1321 SYSCALL_MAP (syslog);
1323 SYSCALL_MAP (sched_setparam);
1324 SYSCALL_MAP (sched_setscheduler);
1325 SYSCALL_MAP (sched_getscheduler);
1326 SYSCALL_MAP (sched_getparam);
1327 SYSCALL_MAP (sched_setaffinity);
1328 SYSCALL_MAP (sched_getaffinity);
1329 SYSCALL_MAP (sched_yield);
1330 SYSCALL_MAP (sched_get_priority_max);
1331 SYSCALL_MAP (sched_get_priority_min);
1332 SYSCALL_MAP (sched_rr_get_interval);
1333 SYSCALL_MAP (kill);
1334 SYSCALL_MAP (tkill);
1335 SYSCALL_MAP (tgkill);
1336 SYSCALL_MAP (sigaltstack);
1337 SYSCALL_MAP (rt_sigsuspend);
1338 SYSCALL_MAP (rt_sigaction);
1339 SYSCALL_MAP (rt_sigprocmask);
1340 SYSCALL_MAP (rt_sigpending);
1341 SYSCALL_MAP (rt_sigtimedwait);
1342 SYSCALL_MAP (rt_sigqueueinfo);
1343 SYSCALL_MAP (rt_sigreturn);
1344 SYSCALL_MAP (setpriority);
1345 SYSCALL_MAP (getpriority);
1346 SYSCALL_MAP (reboot);
1347 SYSCALL_MAP (setregid);
1348 SYSCALL_MAP (setgid);
1349 SYSCALL_MAP (setreuid);
1350 SYSCALL_MAP (setuid);
1351 SYSCALL_MAP (setresuid);
1352 SYSCALL_MAP (getresuid);
1353 SYSCALL_MAP (setresgid);
1354 SYSCALL_MAP (getresgid);
1355 SYSCALL_MAP (setfsuid);
1356 SYSCALL_MAP (setfsgid);
1357 SYSCALL_MAP (times);
1358 SYSCALL_MAP (setpgid);
1359 SYSCALL_MAP (getpgid);
1360 SYSCALL_MAP (getsid);
1361 SYSCALL_MAP (setsid);
1362 SYSCALL_MAP (getgroups);
1363 SYSCALL_MAP (setgroups);
1364 SYSCALL_MAP (uname);
1365 SYSCALL_MAP (sethostname);
1366 SYSCALL_MAP (setdomainname);
1367 SYSCALL_MAP (getrlimit);
1368 SYSCALL_MAP (setrlimit);
1369 SYSCALL_MAP (getrusage);
1370 SYSCALL_MAP (umask);
1371 SYSCALL_MAP (prctl);
1372 SYSCALL_MAP (getcpu);
1373 SYSCALL_MAP (gettimeofday);
1374 SYSCALL_MAP (settimeofday);
1375 SYSCALL_MAP (adjtimex);
1376 SYSCALL_MAP (getpid);
1377 SYSCALL_MAP (getppid);
1378 SYSCALL_MAP (getuid);
1379 SYSCALL_MAP (geteuid);
1380 SYSCALL_MAP (getgid);
1381 SYSCALL_MAP (getegid);
1382 SYSCALL_MAP (gettid);
1383 SYSCALL_MAP (sysinfo);
1384 SYSCALL_MAP (mq_open);
1385 SYSCALL_MAP (mq_unlink);
1386 SYSCALL_MAP (mq_timedsend);
1387 SYSCALL_MAP (mq_timedreceive);
1388 SYSCALL_MAP (mq_notify);
1389 SYSCALL_MAP (mq_getsetattr);
1390 SYSCALL_MAP (msgget);
1391 SYSCALL_MAP (msgctl);
1392 SYSCALL_MAP (msgrcv);
1393 SYSCALL_MAP (msgsnd);
1394 SYSCALL_MAP (semget);
1395 SYSCALL_MAP (semctl);
1396 SYSCALL_MAP (semtimedop);
1397 SYSCALL_MAP (semop);
1398 SYSCALL_MAP (shmget);
1399 SYSCALL_MAP (shmctl);
1400 SYSCALL_MAP (shmat);
1401 SYSCALL_MAP (shmdt);
1402 SYSCALL_MAP (socket);
1403 SYSCALL_MAP (socketpair);
1404 SYSCALL_MAP (bind);
1405 SYSCALL_MAP (listen);
1406 SYSCALL_MAP (accept);
1407 SYSCALL_MAP (connect);
1408 SYSCALL_MAP (getsockname);
1409 SYSCALL_MAP (getpeername);
1410 SYSCALL_MAP (sendto);
1411 SYSCALL_MAP (recvfrom);
1412 SYSCALL_MAP (setsockopt);
1413 SYSCALL_MAP (getsockopt);
1414 SYSCALL_MAP (shutdown);
1415 SYSCALL_MAP (sendmsg);
1416 SYSCALL_MAP (recvmsg);
1417 SYSCALL_MAP (readahead);
1418 SYSCALL_MAP (brk);
1419 SYSCALL_MAP (munmap);
1420 SYSCALL_MAP (mremap);
1421 SYSCALL_MAP (add_key);
1422 SYSCALL_MAP (request_key);
1423 SYSCALL_MAP (keyctl);
1424 SYSCALL_MAP (clone);
1425 SYSCALL_MAP (execve);
1426
1427 case aarch64_sys_mmap:
1428 return gdb_sys_mmap2;
1429
1430 SYSCALL_MAP (fadvise64);
1431 SYSCALL_MAP (swapon);
1432 SYSCALL_MAP (swapoff);
1433 SYSCALL_MAP (mprotect);
1434 SYSCALL_MAP (msync);
1435 SYSCALL_MAP (mlock);
1436 SYSCALL_MAP (munlock);
1437 SYSCALL_MAP (mlockall);
1438 SYSCALL_MAP (munlockall);
1439 SYSCALL_MAP (mincore);
1440 SYSCALL_MAP (madvise);
1441 SYSCALL_MAP (remap_file_pages);
1442 SYSCALL_MAP (mbind);
1443 SYSCALL_MAP (get_mempolicy);
1444 SYSCALL_MAP (set_mempolicy);
1445 SYSCALL_MAP (migrate_pages);
1446 SYSCALL_MAP (move_pages);
1447 UNSUPPORTED_SYSCALL_MAP (rt_tgsigqueueinfo);
1448 UNSUPPORTED_SYSCALL_MAP (perf_event_open);
1449 UNSUPPORTED_SYSCALL_MAP (accept4);
1450 UNSUPPORTED_SYSCALL_MAP (recvmmsg);
1451
1452 SYSCALL_MAP (wait4);
1453
1454 UNSUPPORTED_SYSCALL_MAP (prlimit64);
1455 UNSUPPORTED_SYSCALL_MAP (fanotify_init);
1456 UNSUPPORTED_SYSCALL_MAP (fanotify_mark);
1457 UNSUPPORTED_SYSCALL_MAP (name_to_handle_at);
1458 UNSUPPORTED_SYSCALL_MAP (open_by_handle_at);
1459 UNSUPPORTED_SYSCALL_MAP (clock_adjtime);
1460 UNSUPPORTED_SYSCALL_MAP (syncfs);
1462 UNSUPPORTED_SYSCALL_MAP (sendmmsg);
1463 UNSUPPORTED_SYSCALL_MAP (process_vm_readv);
1464 UNSUPPORTED_SYSCALL_MAP (process_vm_writev);
1466 UNSUPPORTED_SYSCALL_MAP (finit_module);
1467 UNSUPPORTED_SYSCALL_MAP (sched_setattr);
1468 UNSUPPORTED_SYSCALL_MAP (sched_getattr);
1469 SYSCALL_MAP (getrandom);
1470 default:
1471 return gdb_sys_no_syscall;
1472 }
1473}
1474
1475/* Retrieve the syscall number at a ptrace syscall-stop, either on syscall entry
1476 or exit. Return -1 upon error. */
1477
1478static LONGEST
1480{
1481 struct regcache *regs = get_thread_regcache (thread);
1482 LONGEST ret;
1483
1484 /* Get the system call number from register x8. */
1485 regs->cooked_read (AARCH64_X0_REGNUM + 8, &ret);
1486
1487 /* On exit from a successful execve, we will be in a new process and all the
1488 registers will be cleared - x0 to x30 will be 0, except for a 1 in x7.
1489 This function will only ever get called when stopped at the entry or exit
1490 of a syscall, so by checking for 0 in x0 (arg0/retval), x1 (arg1), x8
1491 (syscall), x29 (FP) and x30 (LR) we can infer:
1492 1) Either inferior is at exit from successful execve.
1493 2) Or inferior is at entry to a call to io_setup with invalid arguments and
1494 a corrupted FP and LR.
1495 It should be safe enough to assume case 1. */
1496 if (ret == 0)
1497 {
1498 LONGEST x1 = -1, fp = -1, lr = -1;
1499 regs->cooked_read (AARCH64_X0_REGNUM + 1, &x1);
1500 regs->cooked_read (AARCH64_FP_REGNUM, &fp);
1501 regs->cooked_read (AARCH64_LR_REGNUM, &lr);
1502 if (x1 == 0 && fp ==0 && lr == 0)
1503 return aarch64_sys_execve;
1504 }
1505
1506 return ret;
1507}
1508
1509/* Record all registers but PC register for process-record. */
1510
1511static int
1513{
1514 int i;
1515
1516 for (i = AARCH64_X0_REGNUM; i < AARCH64_PC_REGNUM; i++)
1518 return -1;
1519
1521 return -1;
1522
1523 return 0;
1524}
1525
1526/* Handler for aarch64 system call instruction recording. */
1527
1528static int
1530 unsigned long svc_number)
1531{
1532 int ret = 0;
1533 enum gdb_syscall syscall_gdb;
1534
1535 syscall_gdb =
1537
1538 if (syscall_gdb < 0)
1539 {
1541 _("Process record and replay target doesn't "
1542 "support syscall number %s\n"),
1543 plongest (svc_number));
1544 return -1;
1545 }
1546
1547 if (syscall_gdb == gdb_sys_sigreturn
1548 || syscall_gdb == gdb_sys_rt_sigreturn)
1549 {
1551 return -1;
1552 return 0;
1553 }
1554
1555 ret = record_linux_system_call (syscall_gdb, regcache,
1557 if (ret != 0)
1558 return ret;
1559
1560 /* Record the return value of the system call. */
1562 return -1;
1563 /* Record LR. */
1565 return -1;
1566 /* Record CPSR. */
1568 return -1;
1569
1570 return 0;
1571}
1572
1573/* Implement the "gcc_target_options" gdbarch method. */
1574
1575static std::string
1577{
1578 /* GCC doesn't know "-m64". */
1579 return {};
1580}
1581
1582/* Helper to get the allocation tag from a 64-bit ADDRESS.
1583
1584 Return the allocation tag if successful and nullopt otherwise. */
1585
1586static gdb::optional<CORE_ADDR>
1587aarch64_mte_get_atag (CORE_ADDR address)
1588{
1589 gdb::byte_vector tags;
1590
1591 /* Attempt to fetch the allocation tag. */
1592 if (!target_fetch_memtags (address, 1, tags,
1593 static_cast<int> (memtag_type::allocation)))
1594 return {};
1595
1596 /* Only one tag should've been returned. Make sure we got exactly that. */
1597 if (tags.size () != 1)
1598 error (_("Target returned an unexpected number of tags."));
1599
1600 /* Although our tags are 4 bits in size, they are stored in a
1601 byte. */
1602 return tags[0];
1603}
1604
1605/* Implement the tagged_address_p gdbarch method. */
1606
1607static bool
1609{
1610 gdb_assert (address != nullptr);
1611
1612 CORE_ADDR addr = value_as_address (address);
1613
1614 /* Remove the top byte for the memory range check. */
1616
1617 /* Check if the page that contains ADDRESS is mapped with PROT_MTE. */
1618 if (!linux_address_in_memtag_page (addr))
1619 return false;
1620
1621 /* We have a valid tag in the top byte of the 64-bit address. */
1622 return true;
1623}
1624
1625/* Implement the memtag_matches_p gdbarch method. */
1626
1627static bool
1629 struct value *address)
1630{
1631 gdb_assert (address != nullptr);
1632
1633 /* Make sure we are dealing with a tagged address to begin with. */
1635 return true;
1636
1637 CORE_ADDR addr = value_as_address (address);
1638
1639 /* Fetch the allocation tag for ADDRESS. */
1640 gdb::optional<CORE_ADDR> atag
1642
1643 if (!atag.has_value ())
1644 return true;
1645
1646 /* Fetch the logical tag for ADDRESS. */
1647 gdb_byte ltag = aarch64_mte_get_ltag (addr);
1648
1649 /* Are the tags the same? */
1650 return ltag == *atag;
1651}
1652
1653/* Implement the set_memtags gdbarch method. */
1654
1655static bool
1657 size_t length, const gdb::byte_vector &tags,
1658 memtag_type tag_type)
1659{
1660 gdb_assert (!tags.empty ());
1661 gdb_assert (address != nullptr);
1662
1663 CORE_ADDR addr = value_as_address (address);
1664
1665 /* Set the logical tag or the allocation tag. */
1666 if (tag_type == memtag_type::logical)
1667 {
1668 /* When setting logical tags, we don't care about the length, since
1669 we are only setting a single logical tag. */
1670 addr = aarch64_mte_set_ltag (addr, tags[0]);
1671
1672 /* Update the value's content with the tag. */
1673 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
1674 gdb_byte *srcbuf = value_contents_raw (address).data ();
1675 store_unsigned_integer (srcbuf, sizeof (addr), byte_order, addr);
1676 }
1677 else
1678 {
1679 /* Remove the top byte. */
1681
1682 /* Make sure we are dealing with a tagged address to begin with. */
1684 return false;
1685
1686 /* With G being the number of tag granules and N the number of tags
1687 passed in, we can have the following cases:
1688
1689 1 - G == N: Store all the N tags to memory.
1690
1691 2 - G < N : Warn about having more tags than granules, but write G
1692 tags.
1693
1694 3 - G > N : This is a "fill tags" operation. We should use the tags
1695 as a pattern to fill the granules repeatedly until we have
1696 written G tags to memory.
1697 */
1698
1699 size_t g = aarch64_mte_get_tag_granules (addr, length,
1701 size_t n = tags.size ();
1702
1703 if (g < n)
1704 warning (_("Got more tags than memory granules. Tags will be "
1705 "truncated."));
1706 else if (g > n)
1707 warning (_("Using tag pattern to fill memory range."));
1708
1709 if (!target_store_memtags (addr, length, tags,
1710 static_cast<int> (memtag_type::allocation)))
1711 return false;
1712 }
1713 return true;
1714}
1715
1716/* Implement the get_memtag gdbarch method. */
1717
1718static struct value *
1720 memtag_type tag_type)
1721{
1722 gdb_assert (address != nullptr);
1723
1724 CORE_ADDR addr = value_as_address (address);
1725 CORE_ADDR tag = 0;
1726
1727 /* Get the logical tag or the allocation tag. */
1728 if (tag_type == memtag_type::logical)
1729 tag = aarch64_mte_get_ltag (addr);
1730 else
1731 {
1732 /* Make sure we are dealing with a tagged address to begin with. */
1734 return nullptr;
1735
1736 /* Remove the top byte. */
1738 gdb::optional<CORE_ADDR> atag = aarch64_mte_get_atag (addr);
1739
1740 if (!atag.has_value ())
1741 return nullptr;
1742
1743 tag = *atag;
1744 }
1745
1746 /* Convert the tag to a value. */
1747 return value_from_ulongest (builtin_type (gdbarch)->builtin_unsigned_int,
1748 tag);
1749}
1750
1751/* Implement the memtag_to_string gdbarch method. */
1752
1753static std::string
1755{
1756 if (tag_value == nullptr)
1757 return "";
1758
1759 CORE_ADDR tag = value_as_address (tag_value);
1760
1761 return string_printf ("0x%s", phex_nz (tag, sizeof (tag)));
1762}
1763
1764/* AArch64 Linux implementation of the report_signal_info gdbarch
1765 hook. Displays information about possible memory tag violations. */
1766
1767static void
1769 struct ui_out *uiout,
1770 enum gdb_signal siggnal)
1771{
1772 aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
1773
1774 if (!tdep->has_mte () || siggnal != GDB_SIGNAL_SEGV)
1775 return;
1776
1777 CORE_ADDR fault_addr = 0;
1778 long si_code = 0;
1779
1780 try
1781 {
1782 /* Sigcode tells us if the segfault is actually a memory tag
1783 violation. */
1784 si_code = parse_and_eval_long ("$_siginfo.si_code");
1785
1786 fault_addr
1787 = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
1788 }
1789 catch (const gdb_exception_error &exception)
1790 {
1791 exception_print (gdb_stderr, exception);
1792 return;
1793 }
1794
1795 /* If this is not a memory tag violation, just return. */
1796 if (si_code != SEGV_MTEAERR && si_code != SEGV_MTESERR)
1797 return;
1798
1799 uiout->text ("\n");
1800
1801 uiout->field_string ("sigcode-meaning", _("Memory tag violation"));
1802
1803 /* For synchronous faults, show additional information. */
1804 if (si_code == SEGV_MTESERR)
1805 {
1806 uiout->text (_(" while accessing address "));
1807 uiout->field_core_addr ("fault-addr", gdbarch, fault_addr);
1808 uiout->text ("\n");
1809
1810 gdb::optional<CORE_ADDR> atag
1812 fault_addr));
1813 gdb_byte ltag = aarch64_mte_get_ltag (fault_addr);
1814
1815 if (!atag.has_value ())
1816 uiout->text (_("Allocation tag unavailable"));
1817 else
1818 {
1819 uiout->text (_("Allocation tag "));
1820 uiout->field_string ("allocation-tag", hex_string (*atag));
1821 uiout->text ("\n");
1822 uiout->text (_("Logical tag "));
1823 uiout->field_string ("logical-tag", hex_string (ltag));
1824 }
1825 }
1826 else
1827 {
1828 uiout->text ("\n");
1829 uiout->text (_("Fault address unavailable"));
1830 }
1831}
1832
1833/* AArch64 Linux implementation of the gdbarch_create_memtag_section hook. */
1834
1835static asection *
1837 CORE_ADDR address, size_t size)
1838{
1839 gdb_assert (obfd != nullptr);
1840 gdb_assert (size > 0);
1841
1842 /* Create the section and associated program header.
1843
1844 Make sure the section's flags has SEC_HAS_CONTENTS, otherwise BFD will
1845 refuse to write data to this section. */
1846 asection *mte_section
1847 = bfd_make_section_anyway_with_flags (obfd, "memtag", SEC_HAS_CONTENTS);
1848
1849 if (mte_section == nullptr)
1850 return nullptr;
1851
1852 bfd_set_section_vma (mte_section, address);
1853 /* The size of the memory range covered by the memory tags. We reuse the
1854 section's rawsize field for this purpose. */
1855 mte_section->rawsize = size;
1856
1857 /* Fetch the number of tags we need to save. */
1858 size_t tags_count
1860 /* Tags are stored packed as 2 tags per byte. */
1861 bfd_set_section_size (mte_section, (tags_count + 1) >> 1);
1862 /* Store program header information. */
1863 bfd_record_phdr (obfd, PT_AARCH64_MEMTAG_MTE, 1, 0, 0, 0, 0, 0, 1,
1864 &mte_section);
1865
1866 return mte_section;
1867}
1868
1869/* Maximum number of tags to request. */
1870#define MAX_TAGS_TO_TRANSFER 1024
1871
1872/* AArch64 Linux implementation of the gdbarch_fill_memtag_section hook. */
1873
1874static bool
1876{
1877 /* We only handle MTE tags for now. */
1878
1879 size_t segment_size = osec->rawsize;
1880 CORE_ADDR start_address = bfd_section_vma (osec);
1881 CORE_ADDR end_address = start_address + segment_size;
1882
1883 /* Figure out how many tags we need to store in this memory range. */
1884 size_t granules = aarch64_mte_get_tag_granules (start_address, segment_size,
1886
1887 /* If there are no tag granules to fetch, just return. */
1888 if (granules == 0)
1889 return true;
1890
1891 CORE_ADDR address = start_address;
1892
1893 /* Vector of tags. */
1894 gdb::byte_vector tags;
1895
1896 while (granules > 0)
1897 {
1898 /* Transfer tags in chunks. */
1899 gdb::byte_vector tags_read;
1900 size_t xfer_len
1901 = ((granules >= MAX_TAGS_TO_TRANSFER)
1903 : granules * AARCH64_MTE_GRANULE_SIZE);
1904
1905 if (!target_fetch_memtags (address, xfer_len, tags_read,
1906 static_cast<int> (memtag_type::allocation)))
1907 {
1908 warning (_("Failed to read MTE tags from memory range [%s,%s)."),
1909 phex_nz (start_address, sizeof (start_address)),
1910 phex_nz (end_address, sizeof (end_address)));
1911 return false;
1912 }
1913
1914 /* Transfer over the tags that have been read. */
1915 tags.insert (tags.end (), tags_read.begin (), tags_read.end ());
1916
1917 /* Adjust the remaining granules and starting address. */
1918 granules -= tags_read.size ();
1919 address += tags_read.size () * AARCH64_MTE_GRANULE_SIZE;
1920 }
1921
1922 /* Pack the MTE tag bits. */
1923 aarch64_mte_pack_tags (tags);
1924
1925 if (!bfd_set_section_contents (osec->owner, osec, tags.data (),
1926 0, tags.size ()))
1927 {
1928 warning (_("Failed to write %s bytes of corefile memory "
1929 "tag content (%s)."),
1930 pulongest (tags.size ()),
1931 bfd_errmsg (bfd_get_error ()));
1932 }
1933 return true;
1934}
1935
1936/* AArch64 Linux implementation of the gdbarch_decode_memtag_section
1937 hook. Decode a memory tag section and return the requested tags.
1938
1939 The section is guaranteed to cover the [ADDRESS, ADDRESS + length)
1940 range. */
1941
1942static gdb::byte_vector
1944 bfd_section *section,
1945 int type,
1946 CORE_ADDR address, size_t length)
1947{
1948 gdb_assert (section != nullptr);
1949
1950 /* The requested address must not be less than section->vma. */
1951 gdb_assert (section->vma <= address);
1952
1953 /* Figure out how many tags we need to fetch in this memory range. */
1954 size_t granules = aarch64_mte_get_tag_granules (address, length,
1956 /* Sanity check. */
1957 gdb_assert (granules > 0);
1958
1959 /* Fetch the total number of tags in the range [VMA, address + length). */
1960 size_t granules_from_vma
1961 = aarch64_mte_get_tag_granules (section->vma,
1962 address - section->vma + length,
1964
1965 /* Adjust the tags vector to contain the exact number of packed bytes. */
1966 gdb::byte_vector tags (((granules - 1) >> 1) + 1);
1967
1968 /* Figure out the starting offset into the packed tags data. */
1969 file_ptr offset = ((granules_from_vma - granules) >> 1);
1970
1971 if (!bfd_get_section_contents (section->owner, section, tags.data (),
1972 offset, tags.size ()))
1973 error (_("Couldn't read contents from memtag section."));
1974
1975 /* At this point, the tags are packed 2 per byte. Unpack them before
1976 returning. */
1977 bool skip_first = ((granules_from_vma - granules) % 2) != 0;
1978 aarch64_mte_unpack_tags (tags, skip_first);
1979
1980 /* Resize to the exact number of tags that was requested. */
1981 tags.resize (granules);
1982
1983 return tags;
1984}
1985
1986/* AArch64 implementation of the remove_non_address_bits gdbarch hook. Remove
1987 non address bits from a pointer value. */
1988
1989static CORE_ADDR
1991{
1992 /* By default, we assume TBI and discard the top 8 bits plus the VA range
1993 select bit (55). Below we try to fetch information about pointer
1994 authentication masks in order to make non-address removal more
1995 precise. */
1996 CORE_ADDR mask = AARCH64_TOP_BITS_MASK;
1997
1998 /* Check if we have an inferior first. If not, just use the default
1999 mask.
2000
2001 We use the inferior_ptid here because the pointer authentication masks
2002 should be the same across threads of a process. Since we may not have
2003 access to the current thread (gdb may have switched to no inferiors
2004 momentarily), we use the inferior ptid. */
2005 if (inferior_ptid != null_ptid)
2006 {
2007 /* If we do have an inferior, attempt to fetch its thread's thread_info
2008 struct. */
2009 thread_info *thread
2010 = find_thread_ptid (current_inferior ()->process_target (),
2012
2013 /* If the thread is running, we will not be able to fetch the mask
2014 registers. */
2015 if (thread != nullptr && thread->state != THREAD_RUNNING)
2016 {
2017 /* Otherwise, fetch the register cache and the masks. */
2018 struct regcache *regs
2019 = get_thread_regcache (current_inferior ()->process_target (),
2021
2022 /* Use the gdbarch from the register cache to check for pointer
2023 authentication support, as it matches the features found in
2024 that particular thread. */
2026 = gdbarch_tdep<aarch64_gdbarch_tdep> (regs->arch ());
2027
2028 /* Is there pointer authentication support? */
2029 if (tdep->has_pauth ())
2030 {
2031 /* We have both a code mask and a data mask. For now they are
2032 the same, but this may change in the future. */
2033 CORE_ADDR cmask, dmask;
2034
2035 if (regs->cooked_read (tdep->pauth_reg_base, &dmask)
2036 != REG_VALID)
2037 dmask = mask;
2038
2039 if (regs->cooked_read (tdep->pauth_reg_base + 1, &cmask)
2040 != REG_VALID)
2041 cmask = mask;
2042
2043 mask |= aarch64_mask_from_pac_registers (cmask, dmask);
2044 }
2045 }
2046 }
2047
2048 return aarch64_remove_top_bits (pointer, mask);
2049}
2050
2051static void
2053{
2054 static const char *const stap_integer_prefixes[] = { "#", "", NULL };
2055 static const char *const stap_register_prefixes[] = { "", NULL };
2056 static const char *const stap_register_indirection_prefixes[] = { "[",
2057 NULL };
2058 static const char *const stap_register_indirection_suffixes[] = { "]",
2059 NULL };
2060 aarch64_gdbarch_tdep *tdep = gdbarch_tdep<aarch64_gdbarch_tdep> (gdbarch);
2061
2062 tdep->lowest_pc = 0x8000;
2063
2064 linux_init_abi (info, gdbarch, 1);
2065
2068
2069 /* Enable TLS support. */
2072
2073 /* Shared library handling. */
2076
2078
2079 /* Enable longjmp. */
2080 tdep->jb_pc = 11;
2081
2086
2087 /* SystemTap related. */
2088 set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes);
2089 set_gdbarch_stap_register_prefixes (gdbarch, stap_register_prefixes);
2091 stap_register_indirection_prefixes);
2093 stap_register_indirection_suffixes);
2097
2098 /* Reversible debugging, process record. */
2100 /* Syscall record. */
2102
2103 /* The top byte of a user space address known as the "tag",
2104 is ignored by the kernel and can be regarded as additional
2105 data associated with the address. */
2108
2109 /* MTE-specific settings and hooks. */
2110 if (tdep->has_mte ())
2111 {
2112 /* Register a hook for checking if an address is tagged or not. */
2114
2115 /* Register a hook for checking if there is a memory tag match. */
2118
2119 /* Register a hook for setting the logical/allocation tags for
2120 a range of addresses. */
2122
2123 /* Register a hook for extracting the logical/allocation tag from an
2124 address. */
2126
2127 /* Set the allocation tag granule size to 16 bytes. */
2129
2130 /* Register a hook for converting a memory tag to a string. */
2132
2135
2136 /* Core file helpers. */
2137
2138 /* Core file helper to create a memory tag section for a particular
2139 PT_LOAD segment. */
2142
2143 /* Core file helper to fill a memory tag section with tag data. */
2146
2147 /* Core file helper to decode a memory tag section. */
2150 }
2151
2152 /* Initialize the aarch64_linux_record_tdep. */
2153 /* These values are the size of the type that will be used in a system
2154 call. They are obtained from Linux Kernel source. */
2156 = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
2177 = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
2179 = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
2181 = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
2226
2227 /* These values are the second argument of system call "sys_ioctl".
2228 They are obtained from Linux Kernel source. */
2294
2295 /* These values are the second argument of system call "sys_fcntl"
2296 and "sys_fcntl64". They are obtained from Linux Kernel source. */
2301
2302 /* The AArch64 syscall calling convention: reg x0-x6 for arguments,
2303 reg x8 for syscall number and return value in reg x0. */
2311
2312 /* `catch syscall' */
2313 set_xml_syscall_file_name (gdbarch, "syscalls/aarch64-linux.xml");
2315
2316 /* Displaced stepping. */
2323
2325}
2326
2327#if GDB_SELF_TEST
2328
2329namespace selftests {
2330
2331/* Verify functions to read and write logical tags. */
2332
2333static void
2334aarch64_linux_ltag_tests (void)
2335{
2336 /* We have 4 bits of tags, but we test writing all the bits of the top
2337 byte of address. */
2338 for (int i = 0; i < 1 << 8; i++)
2339 {
2340 CORE_ADDR addr = ((CORE_ADDR) i << 56) | 0xdeadbeef;
2341 SELF_CHECK (aarch64_mte_get_ltag (addr) == (i & 0xf));
2342
2343 addr = aarch64_mte_set_ltag (0xdeadbeef, i);
2344 SELF_CHECK (addr = ((CORE_ADDR) (i & 0xf) << 56) | 0xdeadbeef);
2345 }
2346}
2347
2348} // namespace selftests
2349#endif /* GDB_SELF_TEST */
2350
2352void
2354{
2355 gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_LINUX,
2357
2358#if GDB_SELF_TEST
2359 selftests::register_test ("aarch64-linux-tagged-address",
2360 selftests::aarch64_linux_ltag_tests);
2361#endif
2362}
#define AARCH64_EXTRA_DATAP_OFFSET
aarch64_syscall
@ aarch64_sys_sync_file_range
@ aarch64_sys_accept
@ aarch64_sys_ioprio_get
@ aarch64_sys_mq_getsetattr
@ aarch64_sys_fchown
@ aarch64_sys_msgrcv
@ aarch64_sys_getsockopt
@ aarch64_sys_setregid
@ aarch64_sys_close
@ aarch64_sys_openat
@ aarch64_sys_fgetxattr
@ aarch64_sys_lseek
@ aarch64_sys_accept4
@ aarch64_sys_mincore
@ aarch64_sys_ppoll
@ aarch64_sys_fadvise64
@ aarch64_sys_sched_setaffinity
@ aarch64_sys_getrlimit
@ aarch64_sys_execve
@ aarch64_sys_io_setup
@ aarch64_sys_migrate_pages
@ aarch64_sys_mprotect
@ aarch64_sys_setgid
@ aarch64_sys_gettid
@ aarch64_sys_signalfd4
@ aarch64_sys_timer_create
@ aarch64_sys_fanotify_mark
@ aarch64_sys_recvfrom
@ aarch64_sys_chdir
@ aarch64_sys_ftruncate
@ aarch64_sys_msync
@ aarch64_sys_io_destroy
@ aarch64_sys_sync_file_range2
@ aarch64_sys_pwrite64
@ aarch64_sys_setitimer
@ aarch64_sys_setdomainname
@ aarch64_sys_remap_file_pages
@ aarch64_sys_sched_getaffinity
@ aarch64_sys_timer_settime
@ aarch64_sys_getppid
@ aarch64_sys_timer_getoverrun
@ aarch64_sys_sched_setscheduler
@ aarch64_sys_adjtimex
@ aarch64_sys_read
@ aarch64_sys_keyctl
@ aarch64_sys_vmsplice
@ aarch64_sys_swapon
@ aarch64_sys_fremovexattr
@ aarch64_sys_settimeofday
@ aarch64_sys_rt_sigpending
@ aarch64_sys_exit
@ aarch64_sys_setxattr
@ aarch64_sys_mount
@ aarch64_sys_inotify_add_watch
@ aarch64_sys_timerfd_gettime
@ aarch64_sys_tkill
@ aarch64_sys_pselect6
@ aarch64_sys_fchmodat
@ aarch64_sys_getresgid
@ aarch64_sys_sendmsg
@ aarch64_sys_shmat
@ aarch64_sys_mq_unlink
@ aarch64_sys_recvmsg
@ aarch64_sys_mlockall
@ aarch64_sys_preadv
@ aarch64_sys_setresuid
@ aarch64_sys_inotify_init1
@ aarch64_sys_tgkill
@ aarch64_sys_setrlimit
@ aarch64_sys_setresgid
@ aarch64_sys_semop
@ aarch64_sys_symlinkat
@ aarch64_sys_lsetxattr
@ aarch64_sys_mq_timedsend
@ aarch64_sys_getpid
@ aarch64_sys_sethostname
@ aarch64_sys_mremap
@ aarch64_sys_shmctl
@ aarch64_sys_sched_getparam
@ aarch64_sys_fallocate
@ aarch64_sys_sched_get_priority_max
@ aarch64_sys_umount2
@ aarch64_sys_mbind
@ aarch64_sys_sendto
@ aarch64_sys_readv
@ aarch64_sys_setsid
@ aarch64_sys_fcntl
@ aarch64_sys_sched_get_priority_min
@ aarch64_sys_fchownat
@ aarch64_sys_process_vm_readv
@ aarch64_sys_acct
@ aarch64_sys_flistxattr
@ aarch64_sys_msgctl
@ aarch64_sys_newfstatat
@ aarch64_sys_uname
@ aarch64_sys_listen
@ aarch64_sys_faccessat
@ aarch64_sys_madvise
@ aarch64_sys_clock_settime
@ aarch64_sys_timer_delete
@ aarch64_sys_epoll_create1
@ aarch64_sys_setsockopt
@ aarch64_sys_sendmmsg
@ aarch64_sys_mq_open
@ aarch64_sys_nfsservctl
@ aarch64_sys_mknodat
@ aarch64_sys_pwritev
@ aarch64_sys_removexattr
@ aarch64_sys_msgsnd
@ aarch64_sys_getrusage
@ aarch64_sys_munlockall
@ aarch64_sys_io_cancel
@ aarch64_sys_add_key
@ aarch64_sys_sync
@ aarch64_sys_mlock
@ aarch64_sys_finit_module
@ aarch64_sys_getuid
@ aarch64_sys_get_mempolicy
@ aarch64_sys_epoll_ctl
@ aarch64_sys_mq_notify
@ aarch64_sys_capset
@ aarch64_sys_getpriority
@ aarch64_sys_socketpair
@ aarch64_sys_mmap
@ aarch64_sys_wait4
@ aarch64_sys_set_mempolicy
@ aarch64_sys_set_robust_list
@ aarch64_sys_fanotify_init
@ aarch64_sys_getgid
@ aarch64_sys_getcpu
@ aarch64_sys_readlinkat
@ aarch64_sys_getpgid
@ aarch64_sys_semget
@ aarch64_sys_msgget
@ aarch64_sys_exit_group
@ aarch64_sys_getsockname
@ aarch64_sys_nanosleep
@ aarch64_sys_timerfd_create
@ aarch64_sys_io_getevents
@ aarch64_sys_getdents64
@ aarch64_sys_rt_sigqueueinfo
@ aarch64_sys_pipe2
@ aarch64_sys_sigaltstack
@ aarch64_sys_shutdown
@ aarch64_sys_rt_sigprocmask
@ aarch64_sys_fdatasync
@ aarch64_sys_setreuid
@ aarch64_sys_fchmod
@ aarch64_sys_epoll_pwait
@ aarch64_sys_renameat
@ aarch64_sys_mkdirat
@ aarch64_sys_sched_getattr
@ aarch64_sys_llistxattr
@ aarch64_sys_tee
@ aarch64_sys_open_by_handle_at
@ aarch64_sys_fstatfs
@ aarch64_sys_getegid
@ aarch64_sys_clock_gettime
@ aarch64_sys_inotify_rm_watch
@ aarch64_sys_fstat
@ aarch64_sys_clock_adjtime
@ aarch64_sys_setgroups
@ aarch64_sys_chroot
@ aarch64_sys_getrandom
@ aarch64_sys_write
@ aarch64_sys_sched_getscheduler
@ aarch64_sys_setpriority
@ aarch64_sys_lookup_dcookie
@ aarch64_sys_dup
@ aarch64_sys_dup3
@ aarch64_sys_capget
@ aarch64_sys_swapoff
@ aarch64_sys_lremovexattr
@ aarch64_sys_fsetxattr
@ aarch64_sys_setuid
@ aarch64_sys_flock
@ aarch64_sys_kill
@ aarch64_sys_linkat
@ aarch64_sys_setfsgid
@ aarch64_sys_brk
@ aarch64_sys_eventfd2
@ aarch64_sys_reboot
@ aarch64_sys_set_tid_address
@ aarch64_sys_truncate
@ aarch64_sys_umask
@ aarch64_sys_mq_timedreceive
@ aarch64_sys_setfsuid
@ aarch64_sys_semctl
@ aarch64_sys_syslog
@ aarch64_sys_pivot_root
@ aarch64_sys_writev
@ aarch64_sys_name_to_handle_at
@ aarch64_sys_rt_sigtimedwait
@ aarch64_sys_gettimeofday
@ aarch64_sys_munlock
@ aarch64_sys_delete_module
@ aarch64_sys_pread64
@ aarch64_sys_clone
@ aarch64_sys_munmap
@ aarch64_sys_readahead
@ aarch64_sys_rt_sigreturn
@ aarch64_sys_getpeername
@ aarch64_sys_times
@ aarch64_sys_getxattr
@ aarch64_sys_ioprio_set
@ aarch64_sys_io_submit
@ aarch64_sys_sched_setparam
@ aarch64_sys_getresuid
@ aarch64_sys_recvmmsg
@ aarch64_sys_vhangup
@ aarch64_sys_request_key
@ aarch64_sys_sched_rr_get_interval
@ aarch64_sys_getgroups
@ aarch64_sys_syncfs
@ aarch64_sys_ptrace
@ aarch64_sys_setpgid
@ aarch64_sys_semtimedop
@ aarch64_sys_clock_nanosleep
@ aarch64_sys_process_vm_writev
@ aarch64_sys_lgetxattr
@ aarch64_sys_shmdt
@ aarch64_sys_clock_getres
@ aarch64_sys_unshare
@ aarch64_sys_fsync
@ aarch64_sys_prctl
@ aarch64_sys_ioctl
@ aarch64_sys_socket
@ aarch64_sys_statfs
@ aarch64_sys_init_module
@ aarch64_sys_timerfd_settime
@ aarch64_sys_bind
@ aarch64_sys_rt_tgsigqueueinfo
@ aarch64_sys_sysinfo
@ aarch64_sys_sendfile
@ aarch64_sys_geteuid
@ aarch64_sys_setns
@ aarch64_sys_unlinkat
@ aarch64_sys_futex
@ aarch64_sys_get_robust_list
@ aarch64_sys_listxattr
@ aarch64_sys_rt_sigaction
@ aarch64_sys_sched_setattr
@ aarch64_sys_prlimit64
@ aarch64_sys_waitid
@ aarch64_sys_splice
@ aarch64_sys_rt_sigsuspend
@ aarch64_sys_connect
@ aarch64_sys_timer_gettime
@ aarch64_sys_fchdir
@ aarch64_sys_perf_event_open
@ aarch64_sys_sched_yield
@ aarch64_sys_shmget
@ aarch64_sys_personality
@ aarch64_sys_getitimer
@ aarch64_sys_kcmp
@ aarch64_sys_getsid
@ aarch64_sys_utimensat
@ aarch64_sys_quotactl
@ aarch64_sys_move_pages
@ aarch64_sys_kexec_load
@ aarch64_sys_getcwd
#define MAX_TAGS_TO_TRANSFER
static linux_record_tdep aarch64_linux_record_tdep
static int aarch64_all_but_pc_registers_record(struct regcache *regcache)
static expr::operation_up aarch64_stap_parse_special_token(struct gdbarch *gdbarch, struct stap_parse_info *p)
#define SVE_HEADER_SIZE
#define SVE_HEADER_RESERVED_LENGTH
#define SVE_HEADER_MAX_VL_LENGTH
#define SVE_HEADER_RESERVED_OFFSET
#define SVE_HEADER_FLAGS_LENGTH
#define AARCH64_SIGCONTEXT_REG_SIZE
#define SVE_HEADER_SIZE_LENGTH
#define AARCH64_SVE_CONTEXT_VL_OFFSET
#define SVE_HEADER_FLAG_SVE
static std::string aarch64_linux_gcc_target_options(struct gdbarch *gdbarch)
static void aarch64_linux_collect_sve_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *buf, size_t size)
static int aarch64_linux_syscall_record(struct regcache *regcache, unsigned long svc_number)
static uint64_t aarch64_linux_core_read_vq(struct gdbarch *gdbarch, bfd *abfd)
static gdb::optional< CORE_ADDR > aarch64_mte_get_atag(CORE_ADDR address)
#define AARCH64_UCONTEXT_SIGCONTEXT_OFFSET
#define AARCH64_FPSIMD_VREG_SIZE
#define AARCH64_SVE_CONTEXT_P_REGS_OFFSET(vq)
#define SVE_HEADER_FLAGS_OFFSET
static const struct regcache_map_entry aarch64_linux_fpregmap[]
static bool aarch64_linux_set_memtags(struct gdbarch *gdbarch, struct value *address, size_t length, const gdb::byte_vector &tags, memtag_type tag_type)
static struct value * aarch64_linux_get_memtag(struct gdbarch *gdbarch, struct value *address, memtag_type tag_type)
static const struct tramp_frame aarch64_linux_rt_sigframe
static void aarch64_linux_iterate_over_regset_sections(struct gdbarch *gdbarch, iterate_over_regset_sections_cb *cb, void *cb_data, const struct regcache *regcache)
static const struct regcache_map_entry aarch64_linux_gregmap[]
#define AARCH64_SIGCONTEXT_RESERVED_SIZE
#define AARCH64_SVE_CONTEXT_FFR_OFFSET(vq)
static bool aarch64_linux_fill_memtag_section(struct gdbarch *gdbarch, asection *osec)
const struct regset aarch64_linux_fpregset
static void aarch64_linux_report_signal_info(struct gdbarch *gdbarch, struct ui_out *uiout, enum gdb_signal siggnal)
#define AARCH64_FPSIMD_FPCR_OFFSET
#define AARCH64_SVE_CONTEXT_REGS_OFFSET
#define SVE_HEADER_MAX_SIZE_OFFSET
static enum gdb_syscall aarch64_canonicalize_syscall(enum aarch64_syscall syscall_number)
static gdb::byte_vector aarch64_linux_decode_memtag_section(struct gdbarch *gdbarch, bfd_section *section, int type, CORE_ADDR address, size_t length)
#define AARCH64_FPSIMD_FPSR_OFFSET
#define AARCH64_SIGCONTEXT_XO_OFFSET
#define SVE_HEADER_VL_LENGTH
static CORE_ADDR aarch64_remove_non_address_bits(struct gdbarch *gdbarch, CORE_ADDR pointer)
#define AARCH64_RT_SIGFRAME_UCONTEXT_OFFSET
static uint32_t read_aarch64_ctx(CORE_ADDR ctx_addr, enum bfd_endian byte_order, uint32_t *size)
static void aarch64_linux_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch)
static void aarch64_linux_sigframe_init(const struct tramp_frame *self, frame_info_ptr this_frame, struct trad_frame_cache *this_cache, CORE_ADDR func)
void _initialize_aarch64_linux_tdep()
#define SYSCALL_MAP(SYSCALL)
static bool aarch64_linux_tagged_address_p(struct gdbarch *gdbarch, struct value *address)
#define AARCH64_FPSIMD_MAGIC
#define UNSUPPORTED_SYSCALL_MAP(SYSCALL)
#define AARCH64_SVE_CONTEXT_SIZE(vq)
static LONGEST aarch64_linux_get_syscall_number(struct gdbarch *gdbarch, thread_info *thread)
#define AARCH64_FPSIMD_V0_OFFSET
#define SVE_HEADER_SIZE_OFFSET
#define AARCH64_EXTRA_MAGIC
static int aarch64_stap_is_single_operand(struct gdbarch *gdbarch, const char *s)
static void aarch64_linux_supply_sve_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *buf, size_t size)
static const struct target_desc * aarch64_linux_core_read_description(struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd)
#define AARCH64_SVE_MAGIC
#define SVE_HEADER_MAX_VL_OFFSET
static asection * aarch64_linux_create_memtag_section(struct gdbarch *gdbarch, bfd *obfd, CORE_ADDR address, size_t size)
static std::string aarch64_linux_memtag_to_string(struct gdbarch *gdbarch, struct value *tag_value)
static void aarch64_linux_restore_vreg(struct trad_frame_cache *cache, int num_regs, int vreg_num, CORE_ADDR offset, enum bfd_endian byte_order, bool has_sve)
static bool aarch64_linux_memtag_matches_p(struct gdbarch *gdbarch, struct value *address)
#define SVE_HEADER_VL_OFFSET
const struct regset aarch64_linux_gregset
#define SVE_HEADER_MAX_SIZE_LENGTH
#define AARCH64_SIGCONTEXT_RESERVED_OFFSET
#define AARCH64_LINUX_SIZEOF_GREGSET
#define AARCH64_LINUX_SIZEOF_MTE_REGSET
#define AARCH64_HWCAP_PACA
#define AARCH64_LINUX_SIZEOF_FPREGSET
#define AARCH64_LINUX_SIZEOF_PAUTH
CORE_ADDR aarch64_mte_get_ltag(CORE_ADDR address)
size_t aarch64_mte_get_tag_granules(CORE_ADDR addr, size_t len, size_t granule_size)
void aarch64_mte_unpack_tags(gdb::byte_vector &tags, bool skip_first)
CORE_ADDR aarch64_mte_set_ltag(CORE_ADDR address, CORE_ADDR tag)
void aarch64_mte_pack_tags(gdb::byte_vector &tags)
#define SEGV_MTESERR
#define HWCAP2_MTE
#define AARCH64_MTE_GRANULE_SIZE
#define SEGV_MTEAERR
displaced_step_copy_insn_closure_up aarch64_displaced_step_copy_insn(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
int regnum
bool aarch64_displaced_step_hw_singlestep(struct gdbarch *gdbarch)
const target_desc * aarch64_read_description(const aarch64_features &features)
int aarch64_process_record(struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR insn_addr)
void aarch64_displaced_step_fixup(struct gdbarch *gdbarch, struct displaced_step_copy_insn_closure *dsc_, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
#define B_REGISTER_SIZE
#define AARCH64_DISPLACED_MODIFIED_INSNS
#define D_REGISTER_SIZE
#define Q_REGISTER_SIZE
#define H_REGISTER_SIZE
#define S_REGISTER_SIZE
CORE_ADDR aarch64_remove_top_bits(CORE_ADDR pointer, CORE_ADDR mask)
Definition aarch64.c:66
CORE_ADDR aarch64_mask_from_pac_registers(const CORE_ADDR cmask, const CORE_ADDR dmask)
Definition aarch64.c:85
#define AARCH64_Q0_REGNUM
Definition aarch64.h:126
#define AARCH64_H0_REGNUM
Definition aarch64.h:129
#define AARCH64_SVE_P_REGS_NUM
Definition aarch64.h:140
#define sve_vq_from_vl(vl)
Definition aarch64.h:156
#define sve_vl_from_vq(vq)
Definition aarch64.h:159
#define AARCH64_TOP_BITS_MASK
Definition aarch64.h:123
#define AARCH64_SVE_V0_REGNUM
Definition aarch64.h:131
@ AARCH64_SVE_FFR_REGNUM
Definition aarch64.h:105
@ AARCH64_FP_REGNUM
Definition aarch64.h:91
@ AARCH64_PC_REGNUM
Definition aarch64.h:94
@ AARCH64_CPSR_REGNUM
Definition aarch64.h:95
@ AARCH64_SP_REGNUM
Definition aarch64.h:93
@ AARCH64_SVE_VG_REGNUM
Definition aarch64.h:106
@ AARCH64_SVE_Z0_REGNUM
Definition aarch64.h:98
@ AARCH64_FPSR_REGNUM
Definition aarch64.h:100
@ AARCH64_SVE_P0_REGNUM
Definition aarch64.h:102
@ AARCH64_FPCR_REGNUM
Definition aarch64.h:101
@ AARCH64_LR_REGNUM
Definition aarch64.h:92
@ AARCH64_X0_REGNUM
Definition aarch64.h:90
@ AARCH64_V0_REGNUM
Definition aarch64.h:96
#define AARCH64_B0_REGNUM
Definition aarch64.h:130
#define V_REGISTER_SIZE
Definition aarch64.h:116
#define AARCH64_TLS_REGISTER_SIZE
Definition aarch64.h:115
#define sve_vg_from_vl(vl)
Definition aarch64.h:153
#define AARCH64_S0_REGNUM
Definition aarch64.h:128
#define AARCH64_SVE_Z_REGS_NUM
Definition aarch64.h:139
#define AARCH64_MAX_SVE_VQ
Definition aarch64.h:166
#define AARCH64_D0_REGNUM
Definition aarch64.h:127
#define AARCH64_PAUTH_DMASK_REGNUM(pauth_reg_base)
Definition aarch64.h:133
gdb::optional< gdb::byte_vector > target_read_auxv_raw(target_ops *ops)
Definition auxv.c:375
enum register_status cooked_read(int regnum, gdb_byte *buf)
Definition regcache.c:692
gdbarch * arch() const
Definition regcache.c:230
void raw_supply(int regnum, const void *buf) override
Definition regcache.c:1053
void raw_supply_zeroed(int regnum)
Definition regcache.c:1101
void collect_regset(const struct regset *regset, int regbase, int regnum, void *buf, size_t size) const
Definition regcache.c:1274
void supply_regset(const struct regset *regset, int regbase, int regnum, const void *buf, size_t size)
Definition regcache.c:1252
enum thread_state state
Definition gdbthread.h:336
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
Definition ui-out.c:478
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
Definition ui-out.c:511
void text(const char *string)
Definition ui-out.c:566
#define ULONGEST_MAX
Definition defs.h:473
void store_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, T val)
Definition findvar.c:163
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
Definition defs.h:561
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
Definition defs.h:526
LONGEST parse_and_eval_long(const char *exp)
Definition eval.c:62
void exception_print(struct ui_file *file, const struct gdb_exception &e)
Definition exceptions.c:105
ssize_t read(int fd, void *buf, size_t count)
ULONGEST get_frame_register_unsigned(frame_info_ptr frame, int regnum)
Definition frame.c:1351
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition frame.c:713
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
Definition frame.c:2915
@ SIGTRAMP_FRAME
Definition frame.h:190
#define ptrace(request, pid, addr, data)
Definition gdb_ptrace.h:141
void set_gdbarch_process_record(struct gdbarch *gdbarch, gdbarch_process_record_ftype *process_record)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition gdbarch.c:1370
void set_gdbarch_stap_parse_special_token(struct gdbarch *gdbarch, gdbarch_stap_parse_special_token_ftype *stap_parse_special_token)
void set_gdbarch_stap_integer_prefixes(struct gdbarch *gdbarch, const char *const *stap_integer_prefixes)
Definition gdbarch.c:4460
void set_gdbarch_max_insn_length(struct gdbarch *gdbarch, ULONGEST max_insn_length)
Definition gdbarch.c:4003
void set_gdbarch_core_read_description(struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description)
void set_gdbarch_create_memtag_section(struct gdbarch *gdbarch, gdbarch_create_memtag_section_ftype *create_memtag_section)
void set_gdbarch_memtag_granule_size(struct gdbarch *gdbarch, CORE_ADDR memtag_granule_size)
Definition gdbarch.c:3216
void set_gdbarch_skip_trampoline_code(struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype *skip_trampoline_code)
void set_gdbarch_stap_is_single_operand(struct gdbarch *gdbarch, gdbarch_stap_is_single_operand_ftype *stap_is_single_operand)
void set_gdbarch_tagged_address_p(struct gdbarch *gdbarch, gdbarch_tagged_address_p_ftype *tagged_address_p)
void set_gdbarch_get_syscall_number(struct gdbarch *gdbarch, gdbarch_get_syscall_number_ftype *get_syscall_number)
int gdbarch_num_regs(struct gdbarch *gdbarch)
Definition gdbarch.c:1899
bfd * obfd
void set_gdbarch_get_memtag(struct gdbarch *gdbarch, gdbarch_get_memtag_ftype *get_memtag)
int gdbarch_int_bit(struct gdbarch *gdbarch)
Definition gdbarch.c:1423
void set_gdbarch_memtag_matches_p(struct gdbarch *gdbarch, gdbarch_memtag_matches_p_ftype *memtag_matches_p)
void set_gdbarch_displaced_step_copy_insn(struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn)
void set_gdbarch_stap_register_indirection_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_prefixes)
Definition gdbarch.c:4528
void set_gdbarch_gcc_target_options(struct gdbarch *gdbarch, gdbarch_gcc_target_options_ftype *gcc_target_options)
void set_gdbarch_displaced_step_fixup(struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup)
CORE_ADDR gdbarch_remove_non_address_bits(struct gdbarch *gdbarch, CORE_ADDR pointer)
Definition gdbarch.c:3104
void set_gdbarch_memtag_to_string(struct gdbarch *gdbarch, gdbarch_memtag_to_string_ftype *memtag_to_string)
void set_gdbarch_remove_non_address_bits(struct gdbarch *gdbarch, gdbarch_remove_non_address_bits_ftype *remove_non_address_bits)
void set_gdbarch_report_signal_info(struct gdbarch *gdbarch, gdbarch_report_signal_info_ftype *report_signal_info)
void set_gdbarch_fetch_tls_load_module_address(struct gdbarch *gdbarch, gdbarch_fetch_tls_load_module_address_ftype *fetch_tls_load_module_address)
void set_gdbarch_displaced_step_hw_singlestep(struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep)
int gdbarch_long_bit(struct gdbarch *gdbarch)
Definition gdbarch.c:1440
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
Definition gdbarch.c:1691
void set_gdbarch_fill_memtag_section(struct gdbarch *gdbarch, gdbarch_fill_memtag_section_ftype *fill_memtag_section)
void set_gdbarch_stap_register_prefixes(struct gdbarch *gdbarch, const char *const *stap_register_prefixes)
Definition gdbarch.c:4494
void set_gdbarch_stap_register_indirection_suffixes(struct gdbarch *gdbarch, const char *const *stap_register_indirection_suffixes)
Definition gdbarch.c:4545
void set_gdbarch_set_memtags(struct gdbarch *gdbarch, gdbarch_set_memtags_ftype *set_memtags)
void set_gdbarch_skip_solib_resolver(struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype *skip_solib_resolver)
void set_gdbarch_decode_memtag_section(struct gdbarch *gdbarch, gdbarch_decode_memtag_section_ftype *decode_memtag_section)
void set_gdbarch_iterate_over_regset_sections(struct gdbarch *gdbarch, gdbarch_iterate_over_regset_sections_ftype *iterate_over_regset_sections)
memtag_type
Definition gdbarch.h:128
void() iterate_over_regset_sections_cb(const char *sect_name, int supply_size, int collect_size, const struct regset *regset, const char *human_name, void *cb_data)
Definition gdbarch.h:102
thread_info * find_thread_ptid(inferior *inf, ptid_t ptid)
Definition thread.c:528
@ THREAD_RUNNING
Definition gdbthread.h:75
struct type * lookup_pointer_type(struct type *type)
Definition gdbtypes.c:402
CORE_ADDR glibc_skip_solib_resolver(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition glibc-tdep.c:38
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
Definition gnu-nat.c:1862
size_t size
Definition go32-nat.c:241
ptid_t inferior_ptid
Definition infcmd.c:91
struct inferior * current_inferior(void)
Definition inferior.c:54
int record_linux_system_call(enum gdb_syscall syscall, struct regcache *regcache, struct linux_record_tdep *tdep)
gdb_syscall
@ gdb_sys_sigreturn
@ gdb_sys_no_syscall
@ gdb_sys_rt_sigreturn
@ gdb_sys_mmap2
link_map_offsets * linux_lp64_fetch_link_map_offsets()
CORE_ADDR linux_get_hwcap2()
void linux_init_abi(struct gdbarch_info info, struct gdbarch *gdbarch, int num_disp_step_buffers)
bool linux_address_in_memtag_page(CORE_ADDR address)
CORE_ADDR linux_get_hwcap()
CORE_ADDR find_solib_trampoline_target(frame_info_ptr frame, CORE_ADDR pc)
Definition minsyms.c:1534
Definition ada-exp.h:80
std::unique_ptr< operation > operation_up
Definition expression.h:81
void gdbarch_register_osabi(enum bfd_architecture arch, unsigned long machine, enum gdb_osabi osabi, void(*init_osabi)(struct gdbarch_info, struct gdbarch *))
Definition osabi.c:146
@ GDB_OSABI_LINUX
Definition osabi.h:32
int record_full_arch_list_add_reg(struct regcache *regcache, int regnum)
void regcache_collect_regset(const struct regset *regset, const struct regcache *regcache, int regnum, void *buf, size_t size)
Definition regcache.c:1264
struct regcache * get_thread_regcache(process_stratum_target *target, ptid_t ptid)
Definition regcache.c:397
void regcache_supply_regset(const struct regset *regset, struct regcache *regcache, int regnum, const void *buf, size_t size)
Definition regcache.c:1242
static int regcache_map_entry_size(const struct regcache_map_entry *map)
Definition regcache.h:127
#define REGSET_VARIABLE_SIZE
Definition regset.h:52
void(* func)(remote_target *remote, char *)
void set_solib_svr4_fetch_link_map_offsets(struct gdbarch *gdbarch, struct link_map_offsets *(*flmo)(void))
CORE_ADDR svr4_fetch_objfile_link_map(struct objfile *objfile)
uint64_t vq
Definition aarch64.h:32
int(* aarch64_syscall_record)(struct regcache *regcache, unsigned long svc_number)
bool has_sve() const
bool has_pauth() const
struct type * builtin_long
Definition gdbtypes.h:2249
ULONGEST ioctl_TIOCGLCKTRMIOS
ULONGEST ioctl_TIOCMIWAIT
ULONGEST ioctl_TCGETA
ULONGEST ioctl_TIOCGICOUNT
ULONGEST ioctl_TIOCMBIC
ULONGEST ioctl_TIOCMBIS
ULONGEST ioctl_TCSETSW2
ULONGEST ioctl_TIOCSERGSTRUCT
ULONGEST ioctl_TIOCGPTN
ULONGEST ioctl_TIOCSERGETMULTI
ULONGEST ioctl_TIOCGSID
ULONGEST ioctl_FIOQSIZE
ULONGEST ioctl_TIOCSERCONFIG
ULONGEST ioctl_FIONCLEX
ULONGEST ioctl_TIOCSSOFTCAR
ULONGEST ioctl_TIOCSWINSZ
ULONGEST ioctl_TCSETSF
ULONGEST ioctl_TIOCLINUX
ULONGEST ioctl_TIOCTTYGSTRUCT
ULONGEST ioctl_TIOCSBRK
ULONGEST ioctl_TIOCGPGRP
ULONGEST ioctl_TIOCSERSETMULTI
ULONGEST ioctl_TCSETS
ULONGEST ioctl_TIOCSSERIAL
int size_serial_icounter_struct
ULONGEST ioctl_TIOCSPTLCK
ULONGEST ioctl_TIOCGETD
ULONGEST ioctl_FIONREAD
ULONGEST ioctl_TIOCCBRK
ULONGEST ioctl_TCGETS
ULONGEST ioctl_TIOCGSOFTCAR
ULONGEST ioctl_TIOCNOTTY
ULONGEST ioctl_TIOCSPGRP
ULONGEST ioctl_TIOCGSERIAL
ULONGEST ioctl_FIOASYNC
ULONGEST ioctl_TIOCSERGETLSR
ULONGEST ioctl_TIOCOUTQ
ULONGEST ioctl_TIOCMGET
ULONGEST ioctl_TIOCGWINSZ
ULONGEST ioctl_TIOCSERGWILD
ULONGEST ioctl_TIOCCONS
ULONGEST ioctl_TCSETSF2
ULONGEST ioctl_TIOCSCTTY
ULONGEST ioctl_TIOCSETD
ULONGEST ioctl_TIOCSLCKTRMIOS
ULONGEST ioctl_TIOCSHAYESESP
ULONGEST ioctl_TIOCGHAYESESP
ULONGEST ioctl_TIOCEXCL
ULONGEST ioctl_TIOCNXCL
ULONGEST ioctl_TCSETSW
ULONGEST ioctl_TIOCMSET
ULONGEST ioctl_TIOCSERSWILD
Definition regcache.h:110
const char * arg
Definition stap-probe.h:45
const char * saved_arg
Definition stap-probe.h:53
struct type * arg_type
Definition stap-probe.h:59
std::vector< tdesc_feature_up > features
Definition value.c:181
LONGEST offset
Definition value.c:281
CORE_ADDR address
Definition value.c:246
bool target_store_memtags(CORE_ADDR address, size_t len, const gdb::byte_vector &tags, int type)
Definition target.c:829
bool target_fetch_memtags(CORE_ADDR address, size_t len, gdb::byte_vector &tags, int type)
Definition target.c:822
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition target.c:1771
void trad_frame_set_reg_value_bytes(struct trad_frame_cache *this_trad_cache, int regnum, gdb::array_view< const gdb_byte > bytes)
Definition trad-frame.c:175
void trad_frame_set_reg_addr(struct trad_frame_cache *this_trad_cache, int regnum, CORE_ADDR addr)
Definition trad-frame.c:110
void trad_frame_set_id(struct trad_frame_cache *this_trad_cache, struct frame_id this_id)
Definition trad-frame.c:220
void tramp_frame_prepend_unwinder(struct gdbarch *gdbarch, const struct tramp_frame *tramp_frame)
#define TRAMP_SENTINEL_INSN
Definition tramp-frame.h:44
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
Definition user-regs.c:132
void gdb_printf(struct ui_file *stream, const char *format,...)
Definition utils.c:1865
#define gdb_stderr
Definition utils.h:193
CORE_ADDR value_as_address(struct value *val)
Definition value.c:2804
struct value * value_from_ulongest(struct type *type, ULONGEST num)
Definition value.c:3637
gdb::array_view< gdb_byte > value_contents_raw(struct value *value)
Definition value.c:1167
void set_xml_syscall_file_name(struct gdbarch *gdbarch, const char *name)
Definition xml-syscall.c:50