aboutsummaryrefslogtreecommitdiff
path: root/bfd/hosts
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-10-30 08:36:10 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-10-30 08:36:10 +0000
commitb1bd052dee559a2b5f09a0e8b1e4d4e45d38f39f (patch)
tree14c7f8d9fe4186487022ff4647ef1eb67e28cd55 /bfd/hosts
parentf3f8840bbd73ad7466eb9cd00756d7313dcef45a (diff)
downloadgdb-b1bd052dee559a2b5f09a0e8b1e4d4e45d38f39f.zip
gdb-b1bd052dee559a2b5f09a0e8b1e4d4e45d38f39f.tar.gz
gdb-b1bd052dee559a2b5f09a0e8b1e4d4e45d38f39f.tar.bz2
Add Linux/x86_64 core support to i[3-7]86-*-linux
* configure.in: Set CORE_HEADER to hosts/x86-64linux.h for 'i[3-7]86-*-linux-*' if x86_64-*linux is enabled. * configure: Regenerated. * elf64-x86-64.c (elf_x86_64_write_core_note): Replace type 'prpsinfo_t' and 'prstatus_t' with 'prpsinfo64_t' and 'prstatus64_t' respectively. * hosts/x86-64linux.h (a8_uint64_t): New. (user_regsx32_struct): Renamed to ... (user_regs64_struct): This. Replace uint64_t with a8_uint64_t. (elf_gregx32_t): Renamed to ... (elf_greg64_t): This. Replace uint64_t with a8_uint64_t. (ELF_NGREGX32): Removed. (ELF_NGREG64): New. (elf_gregx32_t): Removed. (elf_greg64_t): New. (struct prstatus64_timeval): New. (elf_prstatusx32): Replace elf_gregsetx32_t with elf_gregset64_t. (elf_prstatus64): New. (elf_prpsinfo64): New. (prstatus64_t, prpsinfo64_t): New typedef.
Diffstat (limited to 'bfd/hosts')
-rw-r--r--bfd/hosts/x86-64linux.h109
1 files changed, 76 insertions, 33 deletions
diff --git a/bfd/hosts/x86-64linux.h b/bfd/hosts/x86-64linux.h
index 4ffc3f2..78be09a 100644
--- a/bfd/hosts/x86-64linux.h
+++ b/bfd/hosts/x86-64linux.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2011
+/* Copyright (C) 2006, 2011, 2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -40,6 +40,9 @@ typedef unsigned int uint32_t;
typedef unsigned long long int uint64_t;
#endif
+/* Unsigned 64-bit integer aligned to 8 bytes. */
+typedef uint64_t __attribute__ ((__aligned__ (8))) a8_uint64_t;
+
#undef HAVE_PRPSINFO32_T
#define HAVE_PRPSINFO32_T
#undef HAVE_PRPSINFO32_T_PR_PID
@@ -71,40 +74,40 @@ struct user_regs32_struct
int32_t xss;
};
-struct user_regsx32_struct
+struct user_regs64_struct
{
- uint64_t r15;
- uint64_t r14;
- uint64_t r13;
- uint64_t r12;
- uint64_t rbp;
- uint64_t rbx;
- uint64_t r11;
- uint64_t r10;
- uint64_t r9;
- uint64_t r8;
- uint64_t rax;
- uint64_t rcx;
- uint64_t rdx;
- uint64_t rsi;
- uint64_t rdi;
- uint64_t orig_rax;
- uint64_t rip;
- uint64_t cs;
- uint64_t eflags;
- uint64_t rsp;
- uint64_t ss;
- uint64_t fs_base;
- uint64_t gs_base;
- uint64_t ds;
- uint64_t es;
- uint64_t fs;
- uint64_t gs;
+ a8_uint64_t r15;
+ a8_uint64_t r14;
+ a8_uint64_t r13;
+ a8_uint64_t r12;
+ a8_uint64_t rbp;
+ a8_uint64_t rbx;
+ a8_uint64_t r11;
+ a8_uint64_t r10;
+ a8_uint64_t r9;
+ a8_uint64_t r8;
+ a8_uint64_t rax;
+ a8_uint64_t rcx;
+ a8_uint64_t rdx;
+ a8_uint64_t rsi;
+ a8_uint64_t rdi;
+ a8_uint64_t orig_rax;
+ a8_uint64_t rip;
+ a8_uint64_t cs;
+ a8_uint64_t eflags;
+ a8_uint64_t rsp;
+ a8_uint64_t ss;
+ a8_uint64_t fs_base;
+ a8_uint64_t gs_base;
+ a8_uint64_t ds;
+ a8_uint64_t es;
+ a8_uint64_t fs;
+ a8_uint64_t gs;
};
/* Type for a general-purpose register. */
typedef uint32_t elf_greg32_t;
-typedef uint64_t elf_gregx32_t;
+typedef a8_uint64_t elf_greg64_t;
/* And the whole bunch of them. We could have used `struct
user_regs_struct' directly in the typedef, but tradition says that
@@ -112,8 +115,8 @@ typedef uint64_t elf_gregx32_t;
semantics, so leave it that way. */
#define ELF_NGREG32 (sizeof (struct user_regs32_struct) / sizeof(elf_greg32_t))
typedef elf_greg32_t elf_gregset32_t[ELF_NGREG32];
-#define ELF_NGREGX32 (sizeof (struct user_regsx32_struct) / sizeof(elf_gregx32_t))
-typedef elf_gregx32_t elf_gregsetx32_t[ELF_NGREGX32];
+#define ELF_NGREG64 (sizeof (struct user_regs64_struct) / sizeof(elf_greg64_t))
+typedef elf_greg64_t elf_gregset64_t[ELF_NGREG64];
/* Definitions to generate Intel SVR4-like core files. These mostly
have the same names as the SVR4 types with "elf_" tacked on the
@@ -128,6 +131,12 @@ struct prstatus32_timeval
int tv_usec;
};
+struct prstatus64_timeval
+ {
+ a8_uint64_t tv_sec;
+ a8_uint64_t tv_usec;
+ };
+
struct elf_prstatus32
{
struct elf_siginfo pr_info; /* Info associated with signal. */
@@ -160,7 +169,25 @@ struct elf_prstatusx32
struct prstatus32_timeval pr_stime; /* System time. */
struct prstatus32_timeval pr_cutime; /* Cumulative user time. */
struct prstatus32_timeval pr_cstime; /* Cumulative system time. */
- elf_gregsetx32_t pr_reg; /* GP registers. */
+ elf_gregset64_t pr_reg; /* GP registers. */
+ int pr_fpvalid; /* True if math copro being used. */
+ };
+
+struct elf_prstatus64
+ {
+ struct elf_siginfo pr_info; /* Info associated with signal. */
+ short int pr_cursig; /* Current signal. */
+ a8_uint64_t pr_sigpend; /* Set of pending signals. */
+ a8_uint64_t pr_sighold; /* Set of held signals. */
+ pid_t pr_pid;
+ pid_t pr_ppid;
+ pid_t pr_pgrp;
+ pid_t pr_sid;
+ struct prstatus64_timeval pr_utime; /* User time. */
+ struct prstatus64_timeval pr_stime; /* System time. */
+ struct prstatus64_timeval pr_cutime; /* Cumulative user time. */
+ struct prstatus64_timeval pr_cstime; /* Cumulative system time. */
+ elf_gregset64_t pr_reg; /* GP registers. */
int pr_fpvalid; /* True if math copro being used. */
};
@@ -179,6 +206,20 @@ struct elf_prpsinfo32
char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
};
+struct elf_prpsinfo64
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ a8_uint64_t pr_flag; /* Flags. */
+ unsigned int pr_uid;
+ unsigned int pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ /* Lots missing */
+ char pr_fname[16]; /* Filename of executable. */
+ char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */
+ };
/* The rest of this file provides the types for emulation of the
Solaris <proc_service.h> interfaces that should be implemented by
@@ -187,4 +228,6 @@ struct elf_prpsinfo32
/* Process status and info. In the end we do provide typedefs for them. */
typedef struct elf_prstatus32 prstatus32_t;
typedef struct elf_prstatusx32 prstatusx32_t;
+typedef struct elf_prstatus64 prstatus64_t;
typedef struct elf_prpsinfo32 prpsinfo32_t;
+typedef struct elf_prpsinfo64 prpsinfo64_t;