1 /* Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 #include <asm/ptrace.h>
25 /* asm/ptrace.h polutes the namespace. */
28 #undef PTRACE_GETFPREGS
29 #undef PTRACE_SETFPREGS
30 #undef PTRACE_GETFDPIC
31 #undef PTRACE_GETFDPIC_EXEC
32 #undef PTRACE_GETFDPIC_INTERP
33 #undef PTRACE_GETDSPREGS
34 #undef PTRACE_SETDSPREGS
37 * Core file format: The core file is written in such a way that gdb
38 * can understand it and provide useful information to the user (under
39 * linux we use the `trad-core' bfd). The file contents are as follows:
41 * upage: 1 page consisting of a user struct that tells gdb
42 * what is present in the file. Directly after this is a
43 * copy of the task_struct, which is currently not used by gdb,
44 * but it may come in handy at some point. All of the registers
45 * are stored as part of the upage. The upage should always be
47 * data: The data segment follows next. We use current->end_text to
48 * current->brk to pick up all of the user variables, plus any memory
49 * that may have been sbrk'ed. No attempt is made to determine if a
50 * page is demand-zero or if a page is totally unused, we just cover
51 * the entire range. All of the addresses are rounded in such a way
52 * that an integral number of pages is written.
53 * stack: We need the stack information in order to get a meaningful
54 * backtrace. We need to write the data from usp to
55 * current->start_stack, so we round each of these in order to be able
56 * to write an integer number of pages.
59 struct user_fpu_struct {
60 unsigned long fp_regs[16];
61 unsigned long xfp_regs[16];
67 struct pt_regs regs; /* entire machine state */
68 struct user_fpu_struct fpu; /* Math Co-processor registers */
69 int u_fpvalid; /* True if math co-processor being used */
70 size_t u_tsize; /* text size (pages) */
71 size_t u_dsize; /* data size (pages) */
72 size_t u_ssize; /* stack size (pages) */
73 unsigned long start_code; /* text starting address */
74 unsigned long start_data; /* data starting address */
75 unsigned long start_stack; /* stack starting address */
76 long int signal; /* signal causing core dump */
77 struct regs * u_ar0; /* help gdb find registers */
78 struct user_fpu_struct* u_fpstate; /* Math Co-processor pointer */
79 unsigned long magic; /* identifies a core file */
80 char u_comm[32]; /* user command name */
83 #define NBPG getpagesize()
85 #define HOST_TEXT_START_ADDR (u.start_code)
86 #define HOST_DATA_START_ADDR (u.start_data)
87 #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
89 #endif /* sys/user.h */