GDB (xrefs)
Loading...
Searching...
No Matches
/tmp/gdb-13.1/gdb/i386-linux-nat.c
Go to the documentation of this file.
1/* Native-dependent code for GNU/Linux i386.
2
3 Copyright (C) 1999-2023 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#include "defs.h"
21#include "inferior.h"
22#include "gdbcore.h"
23#include "regcache.h"
24#include "elf/common.h"
25#include "nat/gdb_ptrace.h"
26#include <sys/uio.h>
27#include "gregset.h"
28#include "gdb_proc_service.h"
29
30#include "i386-linux-nat.h"
31#include "i387-tdep.h"
32#include "i386-tdep.h"
33#include "i386-linux-tdep.h"
34#include "gdbsupport/x86-xstate.h"
35
36#include "x86-linux-nat.h"
37#include "nat/linux-ptrace.h"
38#include "inf-ptrace.h"
39
41{
42 /* Add our register access methods. */
43 void fetch_registers (struct regcache *, int) override;
44 void store_registers (struct regcache *, int) override;
45
46 /* Override the default ptrace resume method. */
47 void low_resume (ptid_t ptid, int step, enum gdb_signal sig) override;
48};
49
51
52/* The register sets used in GNU/Linux ELF core-dumps are identical to
53 the register sets in `struct user' that is used for a.out
54 core-dumps, and is also used by `ptrace'. The corresponding types
55 are `elf_gregset_t' for the general-purpose registers (with
56 `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
57 for the floating-point registers.
58
59 Those types used to be available under the names `gregset_t' and
60 `fpregset_t' too, and this file used those names in the past. But
61 those names are now used for the register sets used in the
62 `mcontext_t' type, and have a different size and layout. */
63
64/* Which ptrace request retrieves which registers?
65 These apply to the corresponding SET requests as well. */
66
67#define GETREGS_SUPPLIES(regno) \
68 ((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
69
70#define GETFPXREGS_SUPPLIES(regno) \
71 (I386_ST0_REGNUM <= (regno) && (regno) < I386_SSE_NUM_REGS)
72
73#define GETXSTATEREGS_SUPPLIES(regno) \
74 (I386_ST0_REGNUM <= (regno) && (regno) < I386_PKEYS_NUM_REGS)
75
76/* Does the current host support the GETREGS request? */
78#ifdef HAVE_PTRACE_GETREGS
79 1
80#else
81 0
82#endif
83;
84
85/* Does the current host support the GETFPXREGS request? The header
86 file may or may not define it, and even if it is defined, the
87 kernel will return EIO if it's running on a pre-SSE processor.
88
89 My instinct is to attach this to some architecture- or
90 target-specific data structure, but really, a particular GDB
91 process can only run on top of one kernel at a time. So it's okay
92 for this to be a simple variable. */
94#ifdef HAVE_PTRACE_GETFPXREGS
95 -1
96#else
97 0
98#endif
99;
100
101
102/* Accessing registers through the U area, one at a time. */
103
104/* Fetch one register. */
105
106static void
107fetch_register (struct regcache *regcache, int regno)
108{
109 pid_t tid;
110 int val;
111
112 gdb_assert (!have_ptrace_getregs);
113 if (i386_linux_gregset_reg_offset[regno] == -1)
114 {
115 regcache->raw_supply (regno, NULL);
116 return;
117 }
118
119 tid = get_ptrace_pid (regcache->ptid ());
120
121 errno = 0;
122 val = ptrace (PTRACE_PEEKUSER, tid,
124 if (errno != 0)
125 error (_("Couldn't read register %s (#%d): %s."),
127 regno, safe_strerror (errno));
128
129 regcache->raw_supply (regno, &val);
130}
131
132/* Store one register. */
133
134static void
135store_register (const struct regcache *regcache, int regno)
136{
137 pid_t tid;
138 int val;
139
140 gdb_assert (!have_ptrace_getregs);
141 if (i386_linux_gregset_reg_offset[regno] == -1)
142 return;
143
144 tid = get_ptrace_pid (regcache->ptid ());
145
146 errno = 0;
147 regcache->raw_collect (regno, &val);
148 ptrace (PTRACE_POKEUSER, tid,
150 if (errno != 0)
151 error (_("Couldn't write register %s (#%d): %s."),
153 regno, safe_strerror (errno));
154}
155
156
157/* Transfering the general-purpose registers between GDB, inferiors
158 and core files. */
159
160/* Fill GDB's register array with the general-purpose register values
161 in *GREGSETP. */
162
163void
164supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
165{
166 const gdb_byte *regp = (const gdb_byte *) gregsetp;
167 int i;
168
169 for (i = 0; i < I386_NUM_GREGS; i++)
171
177}
178
179/* Fill register REGNO (if it is a general-purpose register) in
180 *GREGSETPS with the value in GDB's register array. If REGNO is -1,
181 do this for all registers. */
182
183void
185 elf_gregset_t *gregsetp, int regno)
186{
187 gdb_byte *regp = (gdb_byte *) gregsetp;
188 int i;
189
190 for (i = 0; i < I386_NUM_GREGS; i++)
191 if (regno == -1 || regno == i)
193
194 if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
200}
201
202#ifdef HAVE_PTRACE_GETREGS
203
204/* Fetch all general-purpose registers from process/thread TID and
205 store their values in GDB's register array. */
206
207static void
208fetch_regs (struct regcache *regcache, int tid)
209{
210 elf_gregset_t regs;
211 elf_gregset_t *regs_p = &regs;
212
213 if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
214 {
215 if (errno == EIO)
216 {
217 /* The kernel we're running on doesn't support the GETREGS
218 request. Reset `have_ptrace_getregs'. */
220 return;
221 }
222
223 perror_with_name (_("Couldn't get registers"));
224 }
225
226 supply_gregset (regcache, (const elf_gregset_t *) regs_p);
227}
228
229/* Store all valid general-purpose registers in GDB's register array
230 into the process/thread specified by TID. */
231
232static void
233store_regs (const struct regcache *regcache, int tid, int regno)
234{
235 elf_gregset_t regs;
236
237 if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
238 perror_with_name (_("Couldn't get registers"));
239
240 fill_gregset (regcache, &regs, regno);
241
242 if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
243 perror_with_name (_("Couldn't write registers"));
244}
245
246#else
247
248static void fetch_regs (struct regcache *regcache, int tid) {}
249static void store_regs (const struct regcache *regcache, int tid, int regno) {}
250
251#endif
252
253
254/* Transfering floating-point registers between GDB, inferiors and cores. */
255
256/* Fill GDB's register array with the floating-point register values in
257 *FPREGSETP. */
258
259void
260supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
261{
262 i387_supply_fsave (regcache, -1, fpregsetp);
263}
264
265/* Fill register REGNO (if it is a floating-point register) in
266 *FPREGSETP with the value in GDB's register array. If REGNO is -1,
267 do this for all registers. */
268
269void
271 elf_fpregset_t *fpregsetp, int regno)
272{
273 i387_collect_fsave (regcache, regno, fpregsetp);
274}
275
276#ifdef HAVE_PTRACE_GETREGS
277
278/* Fetch all floating-point registers from process/thread TID and store
279 thier values in GDB's register array. */
280
281static void
283{
284 elf_fpregset_t fpregs;
285
286 if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
287 perror_with_name (_("Couldn't get floating point status"));
288
289 supply_fpregset (regcache, (const elf_fpregset_t *) &fpregs);
290}
291
292/* Store all valid floating-point registers in GDB's register array
293 into the process/thread specified by TID. */
294
295static void
296store_fpregs (const struct regcache *regcache, int tid, int regno)
297{
298 elf_fpregset_t fpregs;
299
300 if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
301 perror_with_name (_("Couldn't get floating point status"));
302
303 fill_fpregset (regcache, &fpregs, regno);
304
305 if (ptrace (PTRACE_SETFPREGS, tid, 0, (int) &fpregs) < 0)
306 perror_with_name (_("Couldn't write floating point status"));
307}
308
309#else
310
311static void
312fetch_fpregs (struct regcache *regcache, int tid)
313{
314}
315
316static void
317store_fpregs (const struct regcache *regcache, int tid, int regno)
318{
319}
320
321#endif
322
323
324/* Transfering floating-point and SSE registers to and from GDB. */
325
326/* Fetch all registers covered by the PTRACE_GETREGSET request from
327 process/thread TID and store their values in GDB's register array.
328 Return non-zero if successful, zero otherwise. */
329
330static int
332{
333 char xstateregs[X86_XSTATE_MAX_SIZE];
334 struct iovec iov;
335
336 if (have_ptrace_getregset != TRIBOOL_TRUE)
337 return 0;
338
339 iov.iov_base = xstateregs;
340 iov.iov_len = sizeof(xstateregs);
341 if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE,
342 &iov) < 0)
343 perror_with_name (_("Couldn't read extended state status"));
344
345 i387_supply_xsave (regcache, -1, xstateregs);
346 return 1;
347}
348
349/* Store all valid registers in GDB's register array covered by the
350 PTRACE_SETREGSET request into the process/thread specified by TID.
351 Return non-zero if successful, zero otherwise. */
352
353static int
354store_xstateregs (const struct regcache *regcache, int tid, int regno)
355{
356 char xstateregs[X86_XSTATE_MAX_SIZE];
357 struct iovec iov;
358
359 if (have_ptrace_getregset != TRIBOOL_TRUE)
360 return 0;
361
362 iov.iov_base = xstateregs;
363 iov.iov_len = sizeof(xstateregs);
364 if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE,
365 &iov) < 0)
366 perror_with_name (_("Couldn't read extended state status"));
367
368 i387_collect_xsave (regcache, regno, xstateregs, 0);
369
370 if (ptrace (PTRACE_SETREGSET, tid, (unsigned int) NT_X86_XSTATE,
371 (int) &iov) < 0)
372 perror_with_name (_("Couldn't write extended state status"));
373
374 return 1;
375}
376
377#ifdef HAVE_PTRACE_GETFPXREGS
378
379/* Fetch all registers covered by the PTRACE_GETFPXREGS request from
380 process/thread TID and store their values in GDB's register array.
381 Return non-zero if successful, zero otherwise. */
382
383static int
385{
386 elf_fpxregset_t fpxregs;
387
389 return 0;
390
391 if (ptrace (PTRACE_GETFPXREGS, tid, 0, (int) &fpxregs) < 0)
392 {
393 if (errno == EIO)
394 {
396 return 0;
397 }
398
399 perror_with_name (_("Couldn't read floating-point and SSE registers"));
400 }
401
402 i387_supply_fxsave (regcache, -1, (const elf_fpxregset_t *) &fpxregs);
403 return 1;
404}
405
406/* Store all valid registers in GDB's register array covered by the
407 PTRACE_SETFPXREGS request into the process/thread specified by TID.
408 Return non-zero if successful, zero otherwise. */
409
410static int
411store_fpxregs (const struct regcache *regcache, int tid, int regno)
412{
413 elf_fpxregset_t fpxregs;
414
416 return 0;
417
418 if (ptrace (PTRACE_GETFPXREGS, tid, 0, &fpxregs) == -1)
419 {
420 if (errno == EIO)
421 {
423 return 0;
424 }
425
426 perror_with_name (_("Couldn't read floating-point and SSE registers"));
427 }
428
429 i387_collect_fxsave (regcache, regno, &fpxregs);
430
431 if (ptrace (PTRACE_SETFPXREGS, tid, 0, &fpxregs) == -1)
432 perror_with_name (_("Couldn't write floating-point and SSE registers"));
433
434 return 1;
435}
436
437#else
438
439static int
440fetch_fpxregs (struct regcache *regcache, int tid)
441{
442 return 0;
443}
444
445static int
446store_fpxregs (const struct regcache *regcache, int tid, int regno)
447{
448 return 0;
449}
450
451#endif /* HAVE_PTRACE_GETFPXREGS */
452
453
454/* Transferring arbitrary registers between GDB and inferior. */
455
456/* Fetch register REGNO from the child process. If REGNO is -1, do
457 this for all registers (including the floating point and SSE
458 registers). */
459
460void
462{
463 pid_t tid;
464
465 /* Use the old method of peeking around in `struct user' if the
466 GETREGS request isn't available. */
468 {
469 int i;
470
471 for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
472 if (regno == -1 || regno == i)
474
475 return;
476 }
477
478 tid = get_ptrace_pid (regcache->ptid ());
479
480 /* Use the PTRACE_GETFPXREGS request whenever possible, since it
481 transfers more registers in one system call, and we'll cache the
482 results. But remember that fetch_fpxregs can fail, and return
483 zero. */
484 if (regno == -1)
485 {
486 fetch_regs (regcache, tid);
487
488 /* The call above might reset `have_ptrace_getregs'. */
490 {
491 fetch_registers (regcache, regno);
492 return;
493 }
494
495 if (fetch_xstateregs (regcache, tid))
496 return;
497 if (fetch_fpxregs (regcache, tid))
498 return;
499 fetch_fpregs (regcache, tid);
500 return;
501 }
502
503 if (GETREGS_SUPPLIES (regno))
504 {
505 fetch_regs (regcache, tid);
506 return;
507 }
508
509 if (GETXSTATEREGS_SUPPLIES (regno))
510 {
511 if (fetch_xstateregs (regcache, tid))
512 return;
513 }
514
515 if (GETFPXREGS_SUPPLIES (regno))
516 {
517 if (fetch_fpxregs (regcache, tid))
518 return;
519
520 /* Either our processor or our kernel doesn't support the SSE
521 registers, so read the FP registers in the traditional way,
522 and fill the SSE registers with dummy values. It would be
523 more graceful to handle differences in the register set using
524 gdbarch. Until then, this will at least make things work
525 plausibly. */
526 fetch_fpregs (regcache, tid);
527 return;
528 }
529
530 internal_error (_("Got request for bad register number %d."), regno);
531}
532
533/* Store register REGNO back into the child process. If REGNO is -1,
534 do this for all registers (including the floating point and SSE
535 registers). */
536void
538{
539 pid_t tid;
540
541 /* Use the old method of poking around in `struct user' if the
542 SETREGS request isn't available. */
544 {
545 int i;
546
547 for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
548 if (regno == -1 || regno == i)
550
551 return;
552 }
553
554 tid = get_ptrace_pid (regcache->ptid ());
555
556 /* Use the PTRACE_SETFPXREGS requests whenever possible, since it
557 transfers more registers in one system call. But remember that
558 store_fpxregs can fail, and return zero. */
559 if (regno == -1)
560 {
561 store_regs (regcache, tid, regno);
562 if (store_xstateregs (regcache, tid, regno))
563 return;
564 if (store_fpxregs (regcache, tid, regno))
565 return;
566 store_fpregs (regcache, tid, regno);
567 return;
568 }
569
570 if (GETREGS_SUPPLIES (regno))
571 {
572 store_regs (regcache, tid, regno);
573 return;
574 }
575
576 if (GETXSTATEREGS_SUPPLIES (regno))
577 {
578 if (store_xstateregs (regcache, tid, regno))
579 return;
580 }
581
582 if (GETFPXREGS_SUPPLIES (regno))
583 {
584 if (store_fpxregs (regcache, tid, regno))
585 return;
586
587 /* Either our processor or our kernel doesn't support the SSE
588 registers, so just write the FP registers in the traditional
589 way. */
590 store_fpregs (regcache, tid, regno);
591 return;
592 }
593
594 internal_error (_("Got request to store bad register number %d."), regno);
595}
596
597
598/* Called by libthread_db. Returns a pointer to the thread local
599 storage (or its descriptor). */
600
601ps_err_e
603 lwpid_t lwpid, int idx, void **base)
604{
605 unsigned int base_addr;
606 ps_err_e result;
607
608 result = x86_linux_get_thread_area (lwpid, (void *) idx, &base_addr);
609
610 if (result == PS_OK)
611 *(int *) base = base_addr;
612
613 return result;
614}
615
616
617/* The instruction for a GNU/Linux system call is:
618 int $0x80
619 or 0xcd 0x80. */
620
621static const unsigned char linux_syscall[] = { 0xcd, 0x80 };
622
623#define LINUX_SYSCALL_LEN (sizeof linux_syscall)
624
625/* The system call number is stored in the %eax register. */
626#define LINUX_SYSCALL_REGNUM I386_EAX_REGNUM
627
628/* We are specifically interested in the sigreturn and rt_sigreturn
629 system calls. */
630
631#ifndef SYS_sigreturn
632#define SYS_sigreturn 0x77
633#endif
634#ifndef SYS_rt_sigreturn
635#define SYS_rt_sigreturn 0xad
636#endif
637
638/* Offset to saved processor flags, from <asm/sigcontext.h>. */
639#define LINUX_SIGCONTEXT_EFLAGS_OFFSET (64)
640
641/* Resume execution of the inferior process.
642 If STEP is nonzero, single-step it.
643 If SIGNAL is nonzero, give it that signal. */
644
645void
646i386_linux_nat_target::low_resume (ptid_t ptid, int step, enum gdb_signal signal)
647{
648 int pid = ptid.lwp ();
649 int request;
650
651 if (catch_syscall_enabled () > 0)
652 request = PTRACE_SYSCALL;
653 else
654 request = PTRACE_CONT;
655
656 if (step)
657 {
658 struct regcache *regcache = get_thread_regcache (this, ptid);
659 struct gdbarch *gdbarch = regcache->arch ();
660 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
661 ULONGEST pc;
662 gdb_byte buf[LINUX_SYSCALL_LEN];
663
664 request = PTRACE_SINGLESTEP;
665
668
669 /* Returning from a signal trampoline is done by calling a
670 special system call (sigreturn or rt_sigreturn, see
671 i386-linux-tdep.c for more information). This system call
672 restores the registers that were saved when the signal was
673 raised, including %eflags. That means that single-stepping
674 won't work. Instead, we'll have to modify the signal context
675 that's about to be restored, and set the trace flag there. */
676
677 /* First check if PC is at a system call. */
678 if (target_read_memory (pc, buf, LINUX_SYSCALL_LEN) == 0
679 && memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0)
680 {
681 ULONGEST syscall;
684
685 /* Then check the system call number. */
687 {
688 ULONGEST sp, addr;
689 unsigned long int eflags;
690
693 addr = read_memory_unsigned_integer (sp + 8, 4, byte_order)
694 + 20;
695 else
696 addr = sp;
697
698 /* Set the trace flag in the context that's about to be
699 restored. */
701 read_memory (addr, (gdb_byte *) &eflags, 4);
702 eflags |= 0x0100;
703 write_memory (addr, (gdb_byte *) &eflags, 4);
704 }
705 }
706 }
707
708 if (ptrace (request, pid, 0, gdb_signal_to_host (signal)) == -1)
709 perror_with_name (("ptrace"));
710}
711
713void
715{
717
718 /* Add the target. */
720}
int catch_syscall_enabled(void)
gdbarch * arch() const
Definition: regcache.c:230
void raw_collect(int regnum, void *buf) const override
Definition: regcache.c:1118
void raw_supply(int regnum, const void *buf) override
Definition: regcache.c:1053
ptid_t ptid() const
Definition: regcache.h:407
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
Definition: corefile.c:346
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:305
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: corefile.c:237
#define ptrace(request, pid, addr, data)
Definition: gdb_ptrace.h:141
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
Definition: gdbarch.c:2023
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1370
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
Definition: gdbarch.c:2142
int gdbarch_num_regs(struct gdbarch *gdbarch)
Definition: gdbarch.c:1899
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
Definition: gnu-nat.c:1792
void fill_fpregset(const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regno)
static void fetch_register(struct regcache *regcache, int regno)
void fill_gregset(const struct regcache *regcache, elf_gregset_t *gregsetp, int regno)
#define SYS_rt_sigreturn
#define LINUX_SYSCALL_LEN
static int fetch_xstateregs(struct regcache *regcache, int tid)
static i386_linux_nat_target the_i386_linux_nat_target
static void fetch_fpregs(struct regcache *regcache, int tid)
static void fetch_regs(struct regcache *regcache, int tid)
static int store_fpxregs(const struct regcache *regcache, int tid, int regno)
static void store_regs(const struct regcache *regcache, int tid, int regno)
static void store_register(const struct regcache *regcache, int regno)
int have_ptrace_getregs
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
static int store_xstateregs(const struct regcache *regcache, int tid, int regno)
static const unsigned char linux_syscall[]
void _initialize_i386_linux_nat()
#define LINUX_SYSCALL_REGNUM
int have_ptrace_getfpxregs
void supply_gregset(struct regcache *regcache, const elf_gregset_t *gregsetp)
#define GETFPXREGS_SUPPLIES(regno)
#define LINUX_SIGCONTEXT_EFLAGS_OFFSET
static int fetch_fpxregs(struct regcache *regcache, int tid)
#define SYS_sigreturn
#define GETREGS_SUPPLIES(regno)
#define GETXSTATEREGS_SUPPLIES(regno)
static void store_fpregs(const struct regcache *regcache, int tid, int regno)
void supply_fpregset(struct regcache *regcache, const elf_fpregset_t *fpregsetp)
int i386_linux_gregset_reg_offset[]
#define I386_LINUX_ORIG_EAX_REGNUM
@ I386_ESP_REGNUM
Definition: i386-tdep.h:281
#define I386_NUM_GREGS
Definition: i386-tdep.h:340
void i387_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
Definition: i387-tdep.c:924
void i387_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
Definition: i387-tdep.c:589
void i387_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
Definition: i387-tdep.c:673
void i387_collect_xsave(const struct regcache *regcache, int regnum, void *xsave, int gcore)
Definition: i387-tdep.c:1347
void i387_supply_fsave(struct regcache *regcache, int regnum, const void *fsave)
Definition: i387-tdep.c:440
void i387_collect_fsave(const struct regcache *regcache, int regnum, void *fsave)
Definition: i387-tdep.c:495
void add_inf_child_target(inf_child_target *target)
Definition: inf-child.c:418
pid_t get_ptrace_pid(ptid_t ptid)
Definition: inf-ptrace.c:238
struct linux_nat_target * linux_target
Definition: linux-nat.c:190
enum tribool have_ptrace_getregset
Definition: linux-nat.c:193
#define PTRACE_SETREGSET
Definition: linux-ptrace.h:52
#define PTRACE_GETREGSET
Definition: linux-ptrace.h:48
#define PTRACE_GETREGS
#define PTRACE_GETFPREGS
#define PTRACE_SETREGS
#define PTRACE_SETFPREGS
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
Definition: regcache.c:790
struct regcache * get_thread_regcache(process_stratum_target *target, ptid_t ptid)
Definition: regcache.c:397
void store_registers(struct regcache *, int) override
void fetch_registers(struct regcache *, int) override
void low_resume(ptid_t ptid, int step, enum gdb_signal sig) override
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: target.c:1771
void perror_with_name(const char *string)
Definition: utils.c:643
ps_err_e x86_linux_get_thread_area(pid_t pid, void *addr, unsigned int *base_addr)