Changeset 74e6b1f in mainline
- Timestamp:
- 2011-07-29T16:33:45Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3fab770
- Parents:
- f5d51de
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/lib/elf.h
rf5d51de r74e6b1f 327 327 elf_word type; 328 328 }; 329 /* 330 * NOTE: namesz, descsz and type should be 64-bits wide (elf_xword) 331 * per the 64-bit ELF spec. The Linux kernel however screws up and 332 * defines them as Elf64_Word, which is 32-bits wide(!). We are trying 333 * to make our core files compatible with Linux GDB target so we copy 334 * the blunder here. 335 */ 329 336 struct elf64_note { 330 elf_ xword namesz;331 elf_ xword descsz;332 elf_ xword type;337 elf_word namesz; 338 elf_word descsz; 339 elf_word type; 333 340 }; 334 341 -
uspace/app/taskdump/elf_core.c
rf5d51de r74e6b1f 106 106 #endif 107 107 #ifdef __64_BITS__ 108 word_size = 8; 108 /* 109 * This should be 8 per the 64-bit ELF spec, but the Linux kernel 110 * screws up and uses 4 anyway (and screws up elf_note_t as well) 111 * and we are trying to be compatible with Linux GDB target. Sigh. 112 */ 113 word_size = 4; 109 114 #endif 110 115 memset(&pr_status, 0, sizeof(pr_status)); -
uspace/lib/c/arch/amd64/include/elf_linux.h
rf5d51de r74e6b1f 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 /* TODO */ 43 uint64_t pad[16]; 47 uint64_t r15; 48 uint64_t r14; 49 uint64_t r13; 50 uint64_t r12; 51 uint64_t rbp; 52 uint64_t rbx; 53 uint64_t r11; 54 uint64_t r10; 55 uint64_t r9; 56 uint64_t r8; 57 uint64_t rax; 58 uint64_t rcx; 59 uint64_t rdx; 60 uint64_t rsi; 61 uint64_t rdi; 62 uint64_t old_rax; 63 uint64_t rip; 64 uint64_t cs; 65 uint64_t rflags; 66 uint64_t rsp; 67 uint64_t ss; 44 68 } elf_regs_t; 45 69 70 /** Convert istate_t to elf_regs_t. */ 46 71 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 47 72 { 48 /* TODO */ 49 (void) istate; (void) elf_regs; 73 elf_regs->r15 = istate->r15; 74 elf_regs->r14 = istate->r14; 75 elf_regs->r13 = istate->r13; 76 elf_regs->r12 = istate->r12; 77 elf_regs->rbp = istate->rbp; 78 elf_regs->rbx = istate->rbx; 79 elf_regs->r11 = istate->r11; 80 elf_regs->r10 = istate->r10; 81 elf_regs->r9 = istate->r9; 82 elf_regs->r8 = istate->r8; 83 elf_regs->rax = istate->rax; 84 elf_regs->rcx = istate->rcx; 85 elf_regs->rdx = istate->rdx; 86 elf_regs->rsi = istate->rsi; 87 elf_regs->rdi = istate->rdi; 88 elf_regs->rip = istate->rip; 89 elf_regs->cs = istate->cs; 90 elf_regs->rflags = istate->rflags; 91 elf_regs->rsp = istate->rsp; 92 elf_regs->ss = istate->ss; 50 93 } 51 94 -
uspace/lib/c/arch/ia32/include/elf_linux.h
rf5d51de r74e6b1f 30 30 * @{ 31 31 */ 32 /** @file 32 /** @file Definitions needed to write core files in Linux-ELF format. 33 33 */ 34 34 … … 39 39 #include <sys/types.h> 40 40 41 /** Linux kernel struct pt_regs structure. 42 * 43 * We need this to save register state to a core file in Linux format 44 * (readable by GDB configured for Linux target). 45 */ 41 46 typedef struct { 42 47 uint32_t ebx; … … 59 64 } elf_regs_t; 60 65 66 /** Convert istate_t to elf_regs_t. */ 61 67 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 62 68 {
Note:
See TracChangeset
for help on using the changeset viewer.