1 /* Native-dependent code for Linux/x86.
2 Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
26 #include "gdb_assert.h"
27 #include <sys/ptrace.h>
29 #include <sys/procfs.h>
35 #ifdef HAVE_SYS_DEBUGREG_H
36 #include <sys/debugreg.h>
40 #define DR_FIRSTADDR 0
55 /* Prototypes for supply_gregset etc. */
58 /* Prototypes for i387_supply_fsave etc. */
61 /* Prototypes for local functions. */
62 static void dummy_sse_values (void);
64 /* On Linux, threads are implemented as pseudo-processes, in which
65 case we may be tracing more than one process at a time. In that
66 case, inferior_pid will contain the main process ID and the
67 individual thread (process) ID mashed together. These macros are
68 used to separate them out. These definitions should be overridden
69 if thread support is included. */
71 #if !defined (PIDGET) /* Default definition for PIDGET/TIDGET. */
72 #define PIDGET(PID) PID
77 /* The register sets used in Linux ELF core-dumps are identical to the
78 register sets in `struct user' that is used for a.out core-dumps,
79 and is also used by `ptrace'. The corresponding types are
80 `elf_gregset_t' for the general-purpose registers (with
81 `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
82 for the floating-point registers.
84 Those types used to be available under the names `gregset_t' and
85 `fpregset_t' too, and this file used those names in the past. But
86 those names are now used for the register sets used in the
87 `mcontext_t' type, and have a different size and layout. */
89 /* Mapping between the general-purpose registers in `struct user'
90 format and GDB's register array layout. */
99 /* Which ptrace request retrieves which registers?
100 These apply to the corresponding SET requests as well. */
101 #define GETREGS_SUPPLIES(regno) \
102 (0 <= (regno) && (regno) <= 15)
103 #define GETFPREGS_SUPPLIES(regno) \
104 (FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
105 #define GETFPXREGS_SUPPLIES(regno) \
106 (FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
108 /* Does the current host support the GETREGS request? */
109 int have_ptrace_getregs
=
110 #ifdef HAVE_PTRACE_GETREGS
117 /* Does the current host support the GETFPXREGS request? The header
118 file may or may not define it, and even if it is defined, the
119 kernel will return EIO if it's running on a pre-SSE processor.
121 My instinct is to attach this to some architecture- or
122 target-specific data structure, but really, a particular GDB
123 process can only run on top of one kernel at a time. So it's okay
124 for this to be a simple variable. */
125 int have_ptrace_getfpxregs
=
126 #ifdef HAVE_PTRACE_GETFPXREGS
134 /* Support for the user struct. */
136 /* Return the address of register REGNUM. BLOCKEND is the value of
137 u.u_ar0, which should point to the registers. */
140 register_u_addr (CORE_ADDR blockend
, int regnum
)
142 return (blockend
+ 4 * regmap
[regnum
]);
145 /* Return the size of the user struct. */
150 return (sizeof (struct user
));
154 /* Fetching registers directly from the U area, one at a time. */
156 /* FIXME: kettenis/2000-03-05: This duplicates code from `inptrace.c'.
157 The problem is that we define FETCH_INFERIOR_REGISTERS since we
158 want to use our own versions of {fetch,store}_inferior_registers
159 that use the GETREGS request. This means that the code in
160 `infptrace.c' is #ifdef'd out. But we need to fall back on that
161 code when GDB is running on top of a kernel that doesn't support
162 the GETREGS request. I want to avoid changing `infptrace.c' right
166 #define PT_READ_U PTRACE_PEEKUSR
169 #define PT_WRITE_U PTRACE_POKEUSR
172 /* Default the type of the ptrace transfer to int. */
173 #ifndef PTRACE_XFER_TYPE
174 #define PTRACE_XFER_TYPE int
177 /* Registers we shouldn't try to fetch. */
178 #define OLD_CANNOT_FETCH_REGISTER(regno) ((regno) >= NUM_GREGS)
180 /* Fetch one register. */
183 fetch_register (int regno
)
185 /* This isn't really an address. But ptrace thinks of it as one. */
187 char mess
[128]; /* For messages */
189 unsigned int offset
; /* Offset of registers within the u area. */
190 char buf
[MAX_REGISTER_RAW_SIZE
];
193 if (OLD_CANNOT_FETCH_REGISTER (regno
))
195 memset (buf
, '\0', REGISTER_RAW_SIZE (regno
)); /* Supply zeroes */
196 supply_register (regno
, buf
);
200 /* Overload thread id onto process id */
201 if ((tid
= TIDGET (inferior_pid
)) == 0)
202 tid
= inferior_pid
; /* no thread id, just use process id */
204 offset
= U_REGS_OFFSET
;
206 regaddr
= register_addr (regno
, offset
);
207 for (i
= 0; i
< REGISTER_RAW_SIZE (regno
); i
+= sizeof (PTRACE_XFER_TYPE
))
210 *(PTRACE_XFER_TYPE
*) & buf
[i
] = ptrace (PT_READ_U
, tid
,
211 (PTRACE_ARG3_TYPE
) regaddr
, 0);
212 regaddr
+= sizeof (PTRACE_XFER_TYPE
);
215 sprintf (mess
, "reading register %s (#%d)",
216 REGISTER_NAME (regno
), regno
);
217 perror_with_name (mess
);
220 supply_register (regno
, buf
);
223 /* Fetch register values from the inferior.
224 If REGNO is negative, do this for all registers.
225 Otherwise, REGNO specifies which register (so we can save time). */
228 old_fetch_inferior_registers (int regno
)
232 fetch_register (regno
);
236 for (regno
= 0; regno
< NUM_REGS
; regno
++)
238 fetch_register (regno
);
243 /* Registers we shouldn't try to store. */
244 #define OLD_CANNOT_STORE_REGISTER(regno) ((regno) >= NUM_GREGS)
246 /* Store one register. */
249 store_register (int regno
)
251 /* This isn't really an address. But ptrace thinks of it as one. */
253 char mess
[128]; /* For messages */
255 unsigned int offset
; /* Offset of registers within the u area. */
258 if (OLD_CANNOT_STORE_REGISTER (regno
))
263 /* Overload thread id onto process id */
264 if ((tid
= TIDGET (inferior_pid
)) == 0)
265 tid
= inferior_pid
; /* no thread id, just use process id */
267 offset
= U_REGS_OFFSET
;
269 regaddr
= register_addr (regno
, offset
);
270 for (i
= 0; i
< REGISTER_RAW_SIZE (regno
); i
+= sizeof (PTRACE_XFER_TYPE
))
273 ptrace (PT_WRITE_U
, tid
, (PTRACE_ARG3_TYPE
) regaddr
,
274 *(PTRACE_XFER_TYPE
*) & registers
[REGISTER_BYTE (regno
) + i
]);
275 regaddr
+= sizeof (PTRACE_XFER_TYPE
);
278 sprintf (mess
, "writing register %s (#%d)",
279 REGISTER_NAME (regno
), regno
);
280 perror_with_name (mess
);
285 /* Store our register values back into the inferior.
286 If REGNO is negative, do this for all registers.
287 Otherwise, REGNO specifies which register (so we can save time). */
290 old_store_inferior_registers (int regno
)
294 store_register (regno
);
298 for (regno
= 0; regno
< NUM_REGS
; regno
++)
300 store_register (regno
);
306 /* Transfering the general-purpose registers between GDB, inferiors
309 /* Fill GDB's register array with the general-purpose register values
313 supply_gregset (elf_gregset_t
*gregsetp
)
315 elf_greg_t
*regp
= (elf_greg_t
*) gregsetp
;
318 for (i
= 0; i
< NUM_GREGS
; i
++)
319 supply_register (i
, (char *) (regp
+ regmap
[i
]));
322 /* Fill register REGNO (if it is a general-purpose register) in
323 *GREGSETPS with the value in GDB's register array. If REGNO is -1,
324 do this for all registers. */
327 fill_gregset (elf_gregset_t
*gregsetp
, int regno
)
329 elf_greg_t
*regp
= (elf_greg_t
*) gregsetp
;
332 for (i
= 0; i
< NUM_GREGS
; i
++)
333 if ((regno
== -1 || regno
== i
))
334 *(regp
+ regmap
[i
]) = *(elf_greg_t
*) ®isters
[REGISTER_BYTE (i
)];
337 #ifdef HAVE_PTRACE_GETREGS
339 /* Fetch all general-purpose registers from process/thread TID and
340 store their values in GDB's register array. */
347 if (ptrace (PTRACE_GETREGS
, tid
, 0, (int) ®s
) < 0)
351 /* The kernel we're running on doesn't support the GETREGS
352 request. Reset `have_ptrace_getregs'. */
353 have_ptrace_getregs
= 0;
357 perror_with_name ("Couldn't get registers");
360 supply_gregset (®s
);
363 /* Store all valid general-purpose registers in GDB's register array
364 into the process/thread specified by TID. */
367 store_regs (int tid
, int regno
)
371 if (ptrace (PTRACE_GETREGS
, tid
, 0, (int) ®s
) < 0)
372 perror_with_name ("Couldn't get registers");
374 fill_gregset (®s
, regno
);
376 if (ptrace (PTRACE_SETREGS
, tid
, 0, (int) ®s
) < 0)
377 perror_with_name ("Couldn't write registers");
382 static void fetch_regs (int tid
) {}
383 static void store_regs (int tid
, int regno
) {}
388 /* Transfering floating-point registers between GDB, inferiors and cores. */
390 /* Fill GDB's register array with the floating-point register values in
394 supply_fpregset (elf_fpregset_t
*fpregsetp
)
396 i387_supply_fsave ((char *) fpregsetp
);
400 /* Fill register REGNO (if it is a floating-point register) in
401 *FPREGSETP with the value in GDB's register array. If REGNO is -1,
402 do this for all registers. */
405 fill_fpregset (elf_fpregset_t
*fpregsetp
, int regno
)
407 i387_fill_fsave ((char *) fpregsetp
, regno
);
410 #ifdef HAVE_PTRACE_GETREGS
412 /* Fetch all floating-point registers from process/thread TID and store
413 thier values in GDB's register array. */
416 fetch_fpregs (int tid
)
418 elf_fpregset_t fpregs
;
420 if (ptrace (PTRACE_GETFPREGS
, tid
, 0, (int) &fpregs
) < 0)
421 perror_with_name ("Couldn't get floating point status");
423 supply_fpregset (&fpregs
);
426 /* Store all valid floating-point registers in GDB's register array
427 into the process/thread specified by TID. */
430 store_fpregs (int tid
, int regno
)
432 elf_fpregset_t fpregs
;
434 if (ptrace (PTRACE_GETFPREGS
, tid
, 0, (int) &fpregs
) < 0)
435 perror_with_name ("Couldn't get floating point status");
437 fill_fpregset (&fpregs
, regno
);
439 if (ptrace (PTRACE_SETFPREGS
, tid
, 0, (int) &fpregs
) < 0)
440 perror_with_name ("Couldn't write floating point status");
445 static void fetch_fpregs (int tid
) {}
446 static void store_fpregs (int tid
, int regno
) {}
451 /* Transfering floating-point and SSE registers to and from GDB. */
453 #ifdef HAVE_PTRACE_GETFPXREGS
455 /* Fill GDB's register array with the floating-point and SSE register
456 values in *FPXREGSETP. */
459 supply_fpxregset (elf_fpxregset_t
*fpxregsetp
)
461 i387_supply_fxsave ((char *) fpxregsetp
);
464 /* Fill register REGNO (if it is a floating-point or SSE register) in
465 *FPXREGSETP with the value in GDB's register array. If REGNO is
466 -1, do this for all registers. */
469 fill_fpxregset (elf_fpxregset_t
*fpxregsetp
, int regno
)
471 i387_fill_fxsave ((char *) fpxregsetp
, regno
);
474 /* Fetch all registers covered by the PTRACE_GETFPXREGS request from
475 process/thread TID and store their values in GDB's register array.
476 Return non-zero if successful, zero otherwise. */
479 fetch_fpxregs (int tid
)
481 elf_fpxregset_t fpxregs
;
483 if (! have_ptrace_getfpxregs
)
486 if (ptrace (PTRACE_GETFPXREGS
, tid
, 0, (int) &fpxregs
) < 0)
490 have_ptrace_getfpxregs
= 0;
494 perror_with_name ("Couldn't read floating-point and SSE registers");
497 supply_fpxregset (&fpxregs
);
501 /* Store all valid registers in GDB's register array covered by the
502 PTRACE_SETFPXREGS request into the process/thread specified by TID.
503 Return non-zero if successful, zero otherwise. */
506 store_fpxregs (int tid
, int regno
)
508 elf_fpxregset_t fpxregs
;
510 if (! have_ptrace_getfpxregs
)
513 if (ptrace (PTRACE_GETFPXREGS
, tid
, 0, &fpxregs
) == -1)
517 have_ptrace_getfpxregs
= 0;
521 perror_with_name ("Couldn't read floating-point and SSE registers");
524 fill_fpxregset (&fpxregs
, regno
);
526 if (ptrace (PTRACE_SETFPXREGS
, tid
, 0, &fpxregs
) == -1)
527 perror_with_name ("Couldn't write floating-point and SSE registers");
532 /* Fill the XMM registers in the register array with dummy values. For
533 cases where we don't have access to the XMM registers. I think
534 this is cleaner than printing a warning. For a cleaner solution,
535 we should gdbarchify the i386 family. */
538 dummy_sse_values (void)
540 /* C doesn't have a syntax for NaN's, so write it out as an array of
542 static long dummy
[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff };
543 static long mxcsr
= 0x1f80;
546 for (reg
= 0; reg
< 8; reg
++)
547 supply_register (XMM0_REGNUM
+ reg
, (char *) dummy
);
548 supply_register (MXCSR_REGNUM
, (char *) &mxcsr
);
553 static int fetch_fpxregs (int tid
) { return 0; }
554 static int store_fpxregs (int tid
, int regno
) { return 0; }
555 static void dummy_sse_values (void) {}
557 #endif /* HAVE_PTRACE_GETFPXREGS */
560 /* Transferring arbitrary registers between GDB and inferior. */
562 /* Check if register REGNO in the child process is accessible.
563 If we are accessing registers directly via the U area, only the
564 general-purpose registers are available.
565 All registers should be accessible if we have GETREGS support. */
568 cannot_fetch_register (int regno
)
570 if (! have_ptrace_getregs
)
571 return OLD_CANNOT_FETCH_REGISTER (regno
);
575 cannot_store_register (int regno
)
577 if (! have_ptrace_getregs
)
578 return OLD_CANNOT_STORE_REGISTER (regno
);
582 /* Fetch register REGNO from the child process. If REGNO is -1, do
583 this for all registers (including the floating point and SSE
587 fetch_inferior_registers (int regno
)
591 /* Use the old method of peeking around in `struct user' if the
592 GETREGS request isn't available. */
593 if (! have_ptrace_getregs
)
595 old_fetch_inferior_registers (regno
);
599 /* Linux LWP ID's are process ID's. */
600 if ((tid
= TIDGET (inferior_pid
)) == 0)
601 tid
= inferior_pid
; /* Not a threaded program. */
603 /* Use the PTRACE_GETFPXREGS request whenever possible, since it
604 transfers more registers in one system call, and we'll cache the
605 results. But remember that fetch_fpxregs can fail, and return
611 /* The call above might reset `have_ptrace_getregs'. */
612 if (! have_ptrace_getregs
)
614 old_fetch_inferior_registers (-1);
618 if (fetch_fpxregs (tid
))
624 if (GETREGS_SUPPLIES (regno
))
630 if (GETFPXREGS_SUPPLIES (regno
))
632 if (fetch_fpxregs (tid
))
635 /* Either our processor or our kernel doesn't support the SSE
636 registers, so read the FP registers in the traditional way,
637 and fill the SSE registers with dummy values. It would be
638 more graceful to handle differences in the register set using
639 gdbarch. Until then, this will at least make things work
645 internal_error (__FILE__
, __LINE__
,
646 "Got request for bad register number %d.", regno
);
649 /* Store register REGNO back into the child process. If REGNO is -1,
650 do this for all registers (including the floating point and SSE
653 store_inferior_registers (int regno
)
657 /* Use the old method of poking around in `struct user' if the
658 SETREGS request isn't available. */
659 if (! have_ptrace_getregs
)
661 old_store_inferior_registers (regno
);
665 /* Linux LWP ID's are process ID's. */
666 if ((tid
= TIDGET (inferior_pid
)) == 0)
667 tid
= inferior_pid
; /* Not a threaded program. */
669 /* Use the PTRACE_SETFPXREGS requests whenever possible, since it
670 transfers more registers in one system call. But remember that
671 store_fpxregs can fail, and return zero. */
674 store_regs (tid
, regno
);
675 if (store_fpxregs (tid
, regno
))
677 store_fpregs (tid
, regno
);
681 if (GETREGS_SUPPLIES (regno
))
683 store_regs (tid
, regno
);
687 if (GETFPXREGS_SUPPLIES (regno
))
689 if (store_fpxregs (tid
, regno
))
692 /* Either our processor or our kernel doesn't support the SSE
693 registers, so just write the FP registers in the traditional
695 store_fpregs (tid
, regno
);
699 internal_error (__FILE__
, __LINE__
,
700 "Got request to store bad register number %d.", regno
);
705 i386_linux_dr_get (int regnum
)
710 /* FIXME: kettenis/2001-01-29: It's not clear what we should do with
711 multi-threaded processes here. For now, pretend there is just
713 tid
= PIDGET (inferior_pid
);
715 /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the
716 ptrace call fails breaks debugging remote targets. The correct
717 way to fix this is to add the hardware breakpoint and watchpoint
718 stuff to the target vectore. For now, just return zero if the
719 ptrace call fails. */
721 value
= ptrace (PT_READ_U
, tid
,
722 offsetof (struct user
, u_debugreg
[regnum
]), 0);
725 perror_with_name ("Couldn't read debug register");
734 i386_linux_dr_set (int regnum
, unsigned long value
)
738 /* FIXME: kettenis/2001-01-29: It's not clear what we should do with
739 multi-threaded processes here. For now, pretend there is just
741 tid
= PIDGET (inferior_pid
);
744 ptrace (PT_WRITE_U
, tid
,
745 offsetof (struct user
, u_debugreg
[regnum
]), value
);
747 perror_with_name ("Couldn't write debug register");
751 i386_linux_dr_set_control (unsigned long control
)
753 i386_linux_dr_set (DR_CONTROL
, control
);
757 i386_linux_dr_set_addr (int regnum
, CORE_ADDR addr
)
759 gdb_assert (regnum
>= 0 && regnum
<= DR_LASTADDR
- DR_FIRSTADDR
);
761 i386_linux_dr_set (DR_FIRSTADDR
+ regnum
, addr
);
765 i386_linux_dr_reset_addr (int regnum
)
767 gdb_assert (regnum
>= 0 && regnum
<= DR_LASTADDR
- DR_FIRSTADDR
);
769 i386_linux_dr_set (DR_FIRSTADDR
+ regnum
, 0L);
773 i386_linux_dr_get_status (void)
775 return i386_linux_dr_get (DR_STATUS
);
779 /* Interpreting register set info found in core files. */
781 /* Provide registers to GDB from a core file.
783 (We can't use the generic version of this function in
784 core-regset.c, because Linux has *three* different kinds of
785 register set notes. core-regset.c would have to call
786 supply_fpxregset, which most platforms don't have.)
788 CORE_REG_SECT points to an array of bytes, which are the contents
789 of a `note' from a core file which BFD thinks might contain
790 register contents. CORE_REG_SIZE is its size.
792 WHICH says which register set corelow suspects this is:
793 0 --- the general-purpose register set, in elf_gregset_t format
794 2 --- the floating-point register set, in elf_fpregset_t format
795 3 --- the extended floating-point register set, in elf_fpxregset_t format
797 REG_ADDR isn't used on Linux. */
800 fetch_core_registers (char *core_reg_sect
, unsigned core_reg_size
,
801 int which
, CORE_ADDR reg_addr
)
803 elf_gregset_t gregset
;
804 elf_fpregset_t fpregset
;
809 if (core_reg_size
!= sizeof (gregset
))
810 warning ("Wrong size gregset in core file.");
813 memcpy (&gregset
, core_reg_sect
, sizeof (gregset
));
814 supply_gregset (&gregset
);
819 if (core_reg_size
!= sizeof (fpregset
))
820 warning ("Wrong size fpregset in core file.");
823 memcpy (&fpregset
, core_reg_sect
, sizeof (fpregset
));
824 supply_fpregset (&fpregset
);
828 #ifdef HAVE_PTRACE_GETFPXREGS
830 elf_fpxregset_t fpxregset
;
833 if (core_reg_size
!= sizeof (fpxregset
))
834 warning ("Wrong size fpxregset in core file.");
837 memcpy (&fpxregset
, core_reg_sect
, sizeof (fpxregset
));
838 supply_fpxregset (&fpxregset
);
845 /* We've covered all the kinds of registers we know about here,
846 so this must be something we wouldn't know what to do with
847 anyway. Just ignore it. */
853 /* The instruction for a Linux system call is:
857 static const unsigned char linux_syscall
[] = { 0xcd, 0x80 };
859 #define LINUX_SYSCALL_LEN (sizeof linux_syscall)
861 /* The system call number is stored in the %eax register. */
862 #define LINUX_SYSCALL_REGNUM 0 /* %eax */
864 /* We are specifically interested in the sigreturn and rt_sigreturn
867 #ifndef SYS_sigreturn
868 #define SYS_sigreturn 0x77
870 #ifndef SYS_rt_sigreturn
871 #define SYS_rt_sigreturn 0xad
874 /* Offset to saved processor flags, from <asm/sigcontext.h>. */
875 #define LINUX_SIGCONTEXT_EFLAGS_OFFSET (64)
877 /* Resume execution of the inferior process.
878 If STEP is nonzero, single-step it.
879 If SIGNAL is nonzero, give it that signal. */
882 child_resume (int pid
, int step
, enum target_signal signal
)
884 int request
= PTRACE_CONT
;
887 /* Resume all threads. */
888 /* I think this only gets used in the non-threaded case, where "resume
889 all threads" and "resume inferior_pid" are the same. */
894 CORE_ADDR pc
= read_pc_pid (pid
);
895 unsigned char buf
[LINUX_SYSCALL_LEN
];
897 request
= PTRACE_SINGLESTEP
;
899 /* Returning from a signal trampoline is done by calling a
900 special system call (sigreturn or rt_sigreturn, see
901 i386-linux-tdep.c for more information). This system call
902 restores the registers that were saved when the signal was
903 raised, including %eflags. That means that single-stepping
904 won't work. Instead, we'll have to modify the signal context
905 that's about to be restored, and set the trace flag there. */
907 /* First check if PC is at a system call. */
908 if (read_memory_nobpt (pc
, (char *) buf
, LINUX_SYSCALL_LEN
) == 0
909 && memcmp (buf
, linux_syscall
, LINUX_SYSCALL_LEN
) == 0)
911 int syscall
= read_register_pid (LINUX_SYSCALL_REGNUM
, pid
);
913 /* Then check the system call number. */
914 if (syscall
== SYS_sigreturn
|| syscall
== SYS_rt_sigreturn
)
916 CORE_ADDR sp
= read_register (SP_REGNUM
);
918 unsigned long int eflags
;
920 if (syscall
== SYS_rt_sigreturn
)
921 addr
= read_memory_integer (sp
+ 8, 4) + 20;
923 /* Set the trace flag in the context that's about to be
925 addr
+= LINUX_SIGCONTEXT_EFLAGS_OFFSET
;
926 read_memory (addr
, (char *) &eflags
, 4);
928 write_memory (addr
, (char *) &eflags
, 4);
933 if (ptrace (request
, pid
, 0, target_signal_to_host (signal
)) == -1)
934 perror_with_name ("ptrace");
938 /* Register that we are able to handle Linux ELF core file formats. */
940 static struct core_fns linux_elf_core_fns
=
942 bfd_target_elf_flavour
, /* core_flavour */
943 default_check_format
, /* check_format */
944 default_core_sniffer
, /* core_sniffer */
945 fetch_core_registers
, /* core_read_registers */
950 _initialize_i386_linux_nat (void)
952 add_core_fns (&linux_elf_core_fns
);