1 /* Native-dependent code for GNU/Linux i386.
3 Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4 2009 Free Software Foundation, Inc.
6 This file is part of GDB.
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.
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.
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/>. */
27 #include "linux-nat.h"
29 #include "gdb_assert.h"
30 #include "gdb_string.h"
31 #include <sys/ptrace.h>
33 #include <sys/procfs.h>
43 #ifdef HAVE_SYS_DEBUGREG_H
44 #include <sys/debugreg.h>
48 #define DR_FIRSTADDR 0
63 /* Prototypes for supply_gregset etc. */
66 #include "i387-tdep.h"
67 #include "i386-tdep.h"
68 #include "i386-linux-tdep.h"
70 /* Defines ps_err_e, struct ps_prochandle. */
71 #include "gdb_proc_service.h"
74 /* The register sets used in GNU/Linux ELF core-dumps are identical to
75 the register sets in `struct user' that is used for a.out
76 core-dumps, and is also used by `ptrace'. The corresponding types
77 are `elf_gregset_t' for the general-purpose registers (with
78 `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
79 for the floating-point registers.
81 Those types used to be available under the names `gregset_t' and
82 `fpregset_t' too, and this file used those names in the past. But
83 those names are now used for the register sets used in the
84 `mcontext_t' type, and have a different size and layout. */
86 /* Mapping between the general-purpose registers in `struct user'
87 format and GDB's register array layout. */
94 -1, -1, -1, -1, /* st0, st1, st2, st3 */
95 -1, -1, -1, -1, /* st4, st5, st6, st7 */
96 -1, -1, -1, -1, /* fctrl, fstat, ftag, fiseg */
97 -1, -1, -1, -1, /* fioff, foseg, fooff, fop */
98 -1, -1, -1, -1, /* xmm0, xmm1, xmm2, xmm3 */
99 -1, -1, -1, -1, /* xmm4, xmm5, xmm6, xmm6 */
104 /* Which ptrace request retrieves which registers?
105 These apply to the corresponding SET requests as well. */
107 #define GETREGS_SUPPLIES(regno) \
108 ((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
110 #define GETFPXREGS_SUPPLIES(regno) \
111 (I386_ST0_REGNUM <= (regno) && (regno) < I386_SSE_NUM_REGS)
113 /* Does the current host support the GETREGS request? */
114 int have_ptrace_getregs
=
115 #ifdef HAVE_PTRACE_GETREGS
122 /* Does the current host support the GETFPXREGS request? The header
123 file may or may not define it, and even if it is defined, the
124 kernel will return EIO if it's running on a pre-SSE processor.
126 My instinct is to attach this to some architecture- or
127 target-specific data structure, but really, a particular GDB
128 process can only run on top of one kernel at a time. So it's okay
129 for this to be a simple variable. */
130 int have_ptrace_getfpxregs
=
131 #ifdef HAVE_PTRACE_GETFPXREGS
139 /* Accessing registers through the U area, one at a time. */
141 /* Fetch one register. */
144 fetch_register (struct regcache
*regcache
, int regno
)
149 gdb_assert (!have_ptrace_getregs
);
150 if (regmap
[regno
] == -1)
152 regcache_raw_supply (regcache
, regno
, NULL
);
156 /* GNU/Linux LWP ID's are process ID's. */
157 tid
= TIDGET (inferior_ptid
);
159 tid
= PIDGET (inferior_ptid
); /* Not a threaded program. */
162 val
= ptrace (PTRACE_PEEKUSER
, tid
, 4 * regmap
[regno
], 0);
164 error (_("Couldn't read register %s (#%d): %s."),
165 gdbarch_register_name (get_regcache_arch (regcache
), regno
),
166 regno
, safe_strerror (errno
));
168 regcache_raw_supply (regcache
, regno
, &val
);
171 /* Store one register. */
174 store_register (const struct regcache
*regcache
, int regno
)
179 gdb_assert (!have_ptrace_getregs
);
180 if (regmap
[regno
] == -1)
183 /* GNU/Linux LWP ID's are process ID's. */
184 tid
= TIDGET (inferior_ptid
);
186 tid
= PIDGET (inferior_ptid
); /* Not a threaded program. */
189 regcache_raw_collect (regcache
, regno
, &val
);
190 ptrace (PTRACE_POKEUSER
, tid
, 4 * regmap
[regno
], val
);
192 error (_("Couldn't write register %s (#%d): %s."),
193 gdbarch_register_name (get_regcache_arch (regcache
), regno
),
194 regno
, safe_strerror (errno
));
198 /* Transfering the general-purpose registers between GDB, inferiors
201 /* Fill GDB's register array with the general-purpose register values
205 supply_gregset (struct regcache
*regcache
, const elf_gregset_t
*gregsetp
)
207 const elf_greg_t
*regp
= (const elf_greg_t
*) gregsetp
;
210 for (i
= 0; i
< I386_NUM_GREGS
; i
++)
211 regcache_raw_supply (regcache
, i
, regp
+ regmap
[i
]);
213 if (I386_LINUX_ORIG_EAX_REGNUM
214 < gdbarch_num_regs (get_regcache_arch (regcache
)))
215 regcache_raw_supply (regcache
, I386_LINUX_ORIG_EAX_REGNUM
,
219 /* Fill register REGNO (if it is a general-purpose register) in
220 *GREGSETPS with the value in GDB's register array. If REGNO is -1,
221 do this for all registers. */
224 fill_gregset (const struct regcache
*regcache
,
225 elf_gregset_t
*gregsetp
, int regno
)
227 elf_greg_t
*regp
= (elf_greg_t
*) gregsetp
;
230 for (i
= 0; i
< I386_NUM_GREGS
; i
++)
231 if (regno
== -1 || regno
== i
)
232 regcache_raw_collect (regcache
, i
, regp
+ regmap
[i
]);
234 if ((regno
== -1 || regno
== I386_LINUX_ORIG_EAX_REGNUM
)
235 && I386_LINUX_ORIG_EAX_REGNUM
236 < gdbarch_num_regs (get_regcache_arch (regcache
)))
237 regcache_raw_collect (regcache
, I386_LINUX_ORIG_EAX_REGNUM
,
241 #ifdef HAVE_PTRACE_GETREGS
243 /* Fetch all general-purpose registers from process/thread TID and
244 store their values in GDB's register array. */
247 fetch_regs (struct regcache
*regcache
, int tid
)
250 elf_gregset_t
*regs_p
= ®s
;
252 if (ptrace (PTRACE_GETREGS
, tid
, 0, (int) ®s
) < 0)
256 /* The kernel we're running on doesn't support the GETREGS
257 request. Reset `have_ptrace_getregs'. */
258 have_ptrace_getregs
= 0;
262 perror_with_name (_("Couldn't get registers"));
265 supply_gregset (regcache
, (const elf_gregset_t
*) regs_p
);
268 /* Store all valid general-purpose registers in GDB's register array
269 into the process/thread specified by TID. */
272 store_regs (const struct regcache
*regcache
, int tid
, int regno
)
276 if (ptrace (PTRACE_GETREGS
, tid
, 0, (int) ®s
) < 0)
277 perror_with_name (_("Couldn't get registers"));
279 fill_gregset (regcache
, ®s
, regno
);
281 if (ptrace (PTRACE_SETREGS
, tid
, 0, (int) ®s
) < 0)
282 perror_with_name (_("Couldn't write registers"));
287 static void fetch_regs (struct regcache
*regcache
, int tid
) {}
288 static void store_regs (const struct regcache
*regcache
, int tid
, int regno
) {}
293 /* Transfering floating-point registers between GDB, inferiors and cores. */
295 /* Fill GDB's register array with the floating-point register values in
299 supply_fpregset (struct regcache
*regcache
, const elf_fpregset_t
*fpregsetp
)
301 i387_supply_fsave (regcache
, -1, fpregsetp
);
304 /* Fill register REGNO (if it is a floating-point register) in
305 *FPREGSETP with the value in GDB's register array. If REGNO is -1,
306 do this for all registers. */
309 fill_fpregset (const struct regcache
*regcache
,
310 elf_fpregset_t
*fpregsetp
, int regno
)
312 i387_collect_fsave (regcache
, regno
, fpregsetp
);
315 #ifdef HAVE_PTRACE_GETREGS
317 /* Fetch all floating-point registers from process/thread TID and store
318 thier values in GDB's register array. */
321 fetch_fpregs (struct regcache
*regcache
, int tid
)
323 elf_fpregset_t fpregs
;
325 if (ptrace (PTRACE_GETFPREGS
, tid
, 0, (int) &fpregs
) < 0)
326 perror_with_name (_("Couldn't get floating point status"));
328 supply_fpregset (regcache
, (const elf_fpregset_t
*) &fpregs
);
331 /* Store all valid floating-point registers in GDB's register array
332 into the process/thread specified by TID. */
335 store_fpregs (const struct regcache
*regcache
, int tid
, int regno
)
337 elf_fpregset_t fpregs
;
339 if (ptrace (PTRACE_GETFPREGS
, tid
, 0, (int) &fpregs
) < 0)
340 perror_with_name (_("Couldn't get floating point status"));
342 fill_fpregset (regcache
, &fpregs
, regno
);
344 if (ptrace (PTRACE_SETFPREGS
, tid
, 0, (int) &fpregs
) < 0)
345 perror_with_name (_("Couldn't write floating point status"));
350 static void fetch_fpregs (struct regcache
*regcache
, int tid
) {}
351 static void store_fpregs (const struct regcache
*regcache
, int tid
, int regno
) {}
356 /* Transfering floating-point and SSE registers to and from GDB. */
358 #ifdef HAVE_PTRACE_GETFPXREGS
360 /* Fill GDB's register array with the floating-point and SSE register
361 values in *FPXREGSETP. */
364 supply_fpxregset (struct regcache
*regcache
,
365 const elf_fpxregset_t
*fpxregsetp
)
367 i387_supply_fxsave (regcache
, -1, fpxregsetp
);
370 /* Fill register REGNO (if it is a floating-point or SSE register) in
371 *FPXREGSETP with the value in GDB's register array. If REGNO is
372 -1, do this for all registers. */
375 fill_fpxregset (const struct regcache
*regcache
,
376 elf_fpxregset_t
*fpxregsetp
, int regno
)
378 i387_collect_fxsave (regcache
, regno
, fpxregsetp
);
381 /* Fetch all registers covered by the PTRACE_GETFPXREGS request from
382 process/thread TID and store their values in GDB's register array.
383 Return non-zero if successful, zero otherwise. */
386 fetch_fpxregs (struct regcache
*regcache
, int tid
)
388 elf_fpxregset_t fpxregs
;
390 if (! have_ptrace_getfpxregs
)
393 if (ptrace (PTRACE_GETFPXREGS
, tid
, 0, (int) &fpxregs
) < 0)
397 have_ptrace_getfpxregs
= 0;
401 perror_with_name (_("Couldn't read floating-point and SSE registers"));
404 supply_fpxregset (regcache
, (const elf_fpxregset_t
*) &fpxregs
);
408 /* Store all valid registers in GDB's register array covered by the
409 PTRACE_SETFPXREGS request into the process/thread specified by TID.
410 Return non-zero if successful, zero otherwise. */
413 store_fpxregs (const struct regcache
*regcache
, int tid
, int regno
)
415 elf_fpxregset_t fpxregs
;
417 if (! have_ptrace_getfpxregs
)
420 if (ptrace (PTRACE_GETFPXREGS
, tid
, 0, &fpxregs
) == -1)
424 have_ptrace_getfpxregs
= 0;
428 perror_with_name (_("Couldn't read floating-point and SSE registers"));
431 fill_fpxregset (regcache
, &fpxregs
, regno
);
433 if (ptrace (PTRACE_SETFPXREGS
, tid
, 0, &fpxregs
) == -1)
434 perror_with_name (_("Couldn't write floating-point and SSE registers"));
441 static int fetch_fpxregs (struct regcache
*regcache
, int tid
) { return 0; }
442 static int store_fpxregs (const struct regcache
*regcache
, int tid
, int regno
) { return 0; }
444 #endif /* HAVE_PTRACE_GETFPXREGS */
447 /* Transferring arbitrary registers between GDB and inferior. */
449 /* Fetch register REGNO from the child process. If REGNO is -1, do
450 this for all registers (including the floating point and SSE
454 i386_linux_fetch_inferior_registers (struct target_ops
*ops
,
455 struct regcache
*regcache
, int regno
)
459 /* Use the old method of peeking around in `struct user' if the
460 GETREGS request isn't available. */
461 if (!have_ptrace_getregs
)
465 for (i
= 0; i
< gdbarch_num_regs (get_regcache_arch (regcache
)); i
++)
466 if (regno
== -1 || regno
== i
)
467 fetch_register (regcache
, i
);
472 /* GNU/Linux LWP ID's are process ID's. */
473 tid
= TIDGET (inferior_ptid
);
475 tid
= PIDGET (inferior_ptid
); /* Not a threaded program. */
477 /* Use the PTRACE_GETFPXREGS request whenever possible, since it
478 transfers more registers in one system call, and we'll cache the
479 results. But remember that fetch_fpxregs can fail, and return
483 fetch_regs (regcache
, tid
);
485 /* The call above might reset `have_ptrace_getregs'. */
486 if (!have_ptrace_getregs
)
488 i386_linux_fetch_inferior_registers (ops
, regcache
, regno
);
492 if (fetch_fpxregs (regcache
, tid
))
494 fetch_fpregs (regcache
, tid
);
498 if (GETREGS_SUPPLIES (regno
))
500 fetch_regs (regcache
, tid
);
504 if (GETFPXREGS_SUPPLIES (regno
))
506 if (fetch_fpxregs (regcache
, tid
))
509 /* Either our processor or our kernel doesn't support the SSE
510 registers, so read the FP registers in the traditional way,
511 and fill the SSE registers with dummy values. It would be
512 more graceful to handle differences in the register set using
513 gdbarch. Until then, this will at least make things work
515 fetch_fpregs (regcache
, tid
);
519 internal_error (__FILE__
, __LINE__
,
520 _("Got request for bad register number %d."), regno
);
523 /* Store register REGNO back into the child process. If REGNO is -1,
524 do this for all registers (including the floating point and SSE
527 i386_linux_store_inferior_registers (struct target_ops
*ops
,
528 struct regcache
*regcache
, int regno
)
532 /* Use the old method of poking around in `struct user' if the
533 SETREGS request isn't available. */
534 if (!have_ptrace_getregs
)
538 for (i
= 0; i
< gdbarch_num_regs (get_regcache_arch (regcache
)); i
++)
539 if (regno
== -1 || regno
== i
)
540 store_register (regcache
, i
);
545 /* GNU/Linux LWP ID's are process ID's. */
546 tid
= TIDGET (inferior_ptid
);
548 tid
= PIDGET (inferior_ptid
); /* Not a threaded program. */
550 /* Use the PTRACE_SETFPXREGS requests whenever possible, since it
551 transfers more registers in one system call. But remember that
552 store_fpxregs can fail, and return zero. */
555 store_regs (regcache
, tid
, regno
);
556 if (store_fpxregs (regcache
, tid
, regno
))
558 store_fpregs (regcache
, tid
, regno
);
562 if (GETREGS_SUPPLIES (regno
))
564 store_regs (regcache
, tid
, regno
);
568 if (GETFPXREGS_SUPPLIES (regno
))
570 if (store_fpxregs (regcache
, tid
, regno
))
573 /* Either our processor or our kernel doesn't support the SSE
574 registers, so just write the FP registers in the traditional
576 store_fpregs (regcache
, tid
, regno
);
580 internal_error (__FILE__
, __LINE__
,
581 _("Got request to store bad register number %d."), regno
);
585 /* Support for debug registers. */
587 static unsigned long i386_linux_dr
[DR_CONTROL
+ 1];
589 /* Get debug register REGNUM value from only the one LWP of PTID. */
592 i386_linux_dr_get (ptid_t ptid
, int regnum
)
601 /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
602 ptrace call fails breaks debugging remote targets. The correct
603 way to fix this is to add the hardware breakpoint and watchpoint
604 stuff to the target vector. For now, just return zero if the
605 ptrace call fails. */
607 value
= ptrace (PTRACE_PEEKUSER
, tid
,
608 offsetof (struct user
, u_debugreg
[regnum
]), 0);
611 perror_with_name (_("Couldn't read debug register"));
619 /* Set debug register REGNUM to VALUE in only the one LWP of PTID. */
622 i386_linux_dr_set (ptid_t ptid
, int regnum
, unsigned long value
)
631 ptrace (PTRACE_POKEUSER
, tid
,
632 offsetof (struct user
, u_debugreg
[regnum
]), value
);
634 perror_with_name (_("Couldn't write debug register"));
637 /* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST. */
640 i386_linux_dr_set_control (unsigned long control
)
645 i386_linux_dr
[DR_CONTROL
] = control
;
647 i386_linux_dr_set (ptid
, DR_CONTROL
, control
);
650 /* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST. */
653 i386_linux_dr_set_addr (int regnum
, CORE_ADDR addr
)
658 gdb_assert (regnum
>= 0 && regnum
<= DR_LASTADDR
- DR_FIRSTADDR
);
660 i386_linux_dr
[DR_FIRSTADDR
+ regnum
] = addr
;
662 i386_linux_dr_set (ptid
, DR_FIRSTADDR
+ regnum
, addr
);
665 /* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST. */
668 i386_linux_dr_reset_addr (int regnum
)
670 i386_linux_dr_set_addr (regnum
, 0);
673 /* Get DR_STATUS from only the one LWP of INFERIOR_PTID. */
676 i386_linux_dr_get_status (void)
678 return i386_linux_dr_get (inferior_ptid
, DR_STATUS
);
681 /* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST. */
684 i386_linux_dr_unset_status (unsigned long mask
)
693 value
= i386_linux_dr_get (ptid
, DR_STATUS
);
695 i386_linux_dr_set (ptid
, DR_STATUS
, value
);
700 i386_linux_new_thread (ptid_t ptid
)
704 for (i
= DR_FIRSTADDR
; i
<= DR_LASTADDR
; i
++)
705 i386_linux_dr_set (ptid
, i
, i386_linux_dr
[i
]);
707 i386_linux_dr_set (ptid
, DR_CONTROL
, i386_linux_dr
[DR_CONTROL
]);
711 /* Called by libthread_db. Returns a pointer to the thread local
712 storage (or its descriptor). */
715 ps_get_thread_area (const struct ps_prochandle
*ph
,
716 lwpid_t lwpid
, int idx
, void **base
)
718 /* NOTE: cagney/2003-08-26: The definition of this buffer is found
719 in the kernel header <asm-i386/ldt.h>. It, after padding, is 4 x
720 4 byte integers in size: `entry_number', `base_addr', `limit',
721 and a bunch of status bits.
723 The values returned by this ptrace call should be part of the
724 regcache buffer, and ps_get_thread_area should channel its
725 request through the regcache. That way remote targets could
726 provide the value using the remote protocol and not this direct
729 Is this function needed? I'm guessing that the `base' is the
730 address of a a descriptor that libthread_db uses to find the
731 thread local address base that GDB needs. Perhaps that
732 descriptor is defined by the ABI. Anyway, given that
733 libthread_db calls this function without prompting (gdb
734 requesting tls base) I guess it needs info in there anyway. */
735 unsigned int desc
[4];
736 gdb_assert (sizeof (int) == 4);
738 #ifndef PTRACE_GET_THREAD_AREA
739 #define PTRACE_GET_THREAD_AREA 25
742 if (ptrace (PTRACE_GET_THREAD_AREA
, lwpid
,
743 (void *) idx
, (unsigned long) &desc
) < 0)
746 *(int *)base
= desc
[1];
751 /* The instruction for a GNU/Linux system call is:
755 static const unsigned char linux_syscall
[] = { 0xcd, 0x80 };
757 #define LINUX_SYSCALL_LEN (sizeof linux_syscall)
759 /* The system call number is stored in the %eax register. */
760 #define LINUX_SYSCALL_REGNUM I386_EAX_REGNUM
762 /* We are specifically interested in the sigreturn and rt_sigreturn
765 #ifndef SYS_sigreturn
766 #define SYS_sigreturn 0x77
768 #ifndef SYS_rt_sigreturn
769 #define SYS_rt_sigreturn 0xad
772 /* Offset to saved processor flags, from <asm/sigcontext.h>. */
773 #define LINUX_SIGCONTEXT_EFLAGS_OFFSET (64)
775 /* Resume execution of the inferior process.
776 If STEP is nonzero, single-step it.
777 If SIGNAL is nonzero, give it that signal. */
780 i386_linux_resume (struct target_ops
*ops
,
781 ptid_t ptid
, int step
, enum target_signal signal
)
783 int pid
= PIDGET (ptid
);
787 if (catch_syscall_enabled () > 0)
788 request
= PTRACE_SYSCALL
;
790 request
= PTRACE_CONT
;
794 struct regcache
*regcache
= get_thread_regcache (pid_to_ptid (pid
));
795 struct gdbarch
*gdbarch
= get_regcache_arch (regcache
);
796 enum bfd_endian byte_order
= gdbarch_byte_order (gdbarch
);
798 gdb_byte buf
[LINUX_SYSCALL_LEN
];
800 request
= PTRACE_SINGLESTEP
;
802 regcache_cooked_read_unsigned (regcache
,
803 gdbarch_pc_regnum (gdbarch
), &pc
);
805 /* Returning from a signal trampoline is done by calling a
806 special system call (sigreturn or rt_sigreturn, see
807 i386-linux-tdep.c for more information). This system call
808 restores the registers that were saved when the signal was
809 raised, including %eflags. That means that single-stepping
810 won't work. Instead, we'll have to modify the signal context
811 that's about to be restored, and set the trace flag there. */
813 /* First check if PC is at a system call. */
814 if (target_read_memory (pc
, buf
, LINUX_SYSCALL_LEN
) == 0
815 && memcmp (buf
, linux_syscall
, LINUX_SYSCALL_LEN
) == 0)
818 regcache_cooked_read_unsigned (regcache
,
819 LINUX_SYSCALL_REGNUM
, &syscall
);
821 /* Then check the system call number. */
822 if (syscall
== SYS_sigreturn
|| syscall
== SYS_rt_sigreturn
)
825 unsigned long int eflags
;
827 regcache_cooked_read_unsigned (regcache
, I386_ESP_REGNUM
, &sp
);
828 if (syscall
== SYS_rt_sigreturn
)
829 addr
= read_memory_integer (sp
+ 8, 4, byte_order
) + 20;
833 /* Set the trace flag in the context that's about to be
835 addr
+= LINUX_SIGCONTEXT_EFLAGS_OFFSET
;
836 read_memory (addr
, (gdb_byte
*) &eflags
, 4);
838 write_memory (addr
, (gdb_byte
*) &eflags
, 4);
843 if (ptrace (request
, pid
, 0, target_signal_to_host (signal
)) == -1)
844 perror_with_name (("ptrace"));
847 static void (*super_post_startup_inferior
) (ptid_t ptid
);
850 i386_linux_child_post_startup_inferior (ptid_t ptid
)
852 i386_cleanup_dregs ();
853 super_post_startup_inferior (ptid
);
857 _initialize_i386_linux_nat (void)
859 struct target_ops
*t
;
861 /* Fill in the generic GNU/Linux methods. */
864 i386_use_watchpoints (t
);
866 i386_dr_low
.set_control
= i386_linux_dr_set_control
;
867 i386_dr_low
.set_addr
= i386_linux_dr_set_addr
;
868 i386_dr_low
.reset_addr
= i386_linux_dr_reset_addr
;
869 i386_dr_low
.get_status
= i386_linux_dr_get_status
;
870 i386_dr_low
.unset_status
= i386_linux_dr_unset_status
;
871 i386_set_debug_register_length (4);
873 /* Override the default ptrace resume method. */
874 t
->to_resume
= i386_linux_resume
;
876 /* Override the GNU/Linux inferior startup hook. */
877 super_post_startup_inferior
= t
->to_post_startup_inferior
;
878 t
->to_post_startup_inferior
= i386_linux_child_post_startup_inferior
;
880 /* Add our register access methods. */
881 t
->to_fetch_registers
= i386_linux_fetch_inferior_registers
;
882 t
->to_store_registers
= i386_linux_store_inferior_registers
;
884 /* Register the target. */
885 linux_nat_add_target (t
);
886 linux_nat_set_new_thread (t
, i386_linux_new_thread
);