Changes in uspace/app/taskdump/symtab.c [1d6dd2a:8e3498b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/symtab.c
r1d6dd2a r8e3498b 41 41 #include <stddef.h> 42 42 #include <errno.h> 43 #include <str.h>44 #include <str_error.h>45 43 #include <vfs/vfs.h> 46 44 47 45 #include "include/symtab.h" 48 46 49 static errno_t elf_hdr_check(elf_header_t *hdr);50 static errno_t section_hdr_load(int fd, const elf_header_t *ehdr, int idx,47 static int elf_hdr_check(elf_header_t *hdr); 48 static int section_hdr_load(int fd, const elf_header_t *ehdr, int idx, 51 49 elf_section_header_t *shdr); 52 static errno_t chunk_load(int fd, off64_t start, size_t size, void **ptr);50 static int chunk_load(int fd, off64_t start, size_t size, void **ptr); 53 51 54 52 /** Load symbol table from an ELF file. … … 60 58 * ENOTSUP if file parsing failed. 61 59 */ 62 errno_t symtab_load(const char *file_name, symtab_t **symtab)60 int symtab_load(const char *file_name, symtab_t **symtab) 63 61 { 64 62 symtab_t *stab; … … 72 70 73 71 int fd; 74 errno_t rc;72 int rc; 75 73 size_t nread; 76 74 int i; … … 84 82 return ENOMEM; 85 83 86 rc = vfs_lookup_open(file_name, WALK_REGULAR, MODE_READ, &fd);87 if ( rc != EOK) {88 printf("failed opening file '%s': %s\n", file_name, str_error(rc));84 fd = vfs_lookup_open(file_name, WALK_REGULAR, MODE_READ); 85 if (fd < 0) { 86 printf("failed opening file\n"); 89 87 free(stab); 90 88 return ENOENT; … … 205 203 * @return EOK on success, ENOENT if no such symbol was found. 206 204 */ 207 errno_t symtab_name_to_addr(symtab_t *st, const char *name, uintptr_t *addr)205 int symtab_name_to_addr(symtab_t *st, const char *name, uintptr_t *addr) 208 206 { 209 207 size_t i; … … 242 240 * @return EOK on success or ENOENT if no matching symbol was found. 243 241 */ 244 errno_t symtab_addr_to_name(symtab_t *st, uintptr_t addr, char **name,242 int symtab_addr_to_name(symtab_t *st, uintptr_t addr, char **name, 245 243 size_t *offs) 246 244 { … … 286 284 /** Check if ELF header is valid. 287 285 * 288 * @return EOK on success or anerror code.289 */ 290 static errno_t elf_hdr_check(elf_header_t *ehdr)286 * @return EOK on success or negative error code. 287 */ 288 static int elf_hdr_check(elf_header_t *ehdr) 291 289 { 292 290 /* TODO */ … … 303 301 * @return EOK on success or EIO if I/O failed. 304 302 */ 305 static errno_t section_hdr_load(int fd, const elf_header_t *elf_hdr, int idx,303 static int section_hdr_load(int fd, const elf_header_t *elf_hdr, int idx, 306 304 elf_section_header_t *sec_hdr) 307 305 { 308 errno_t rc;306 int rc; 309 307 size_t nread; 310 308 aoff64_t pos = elf_hdr->e_shoff + idx * sizeof(elf_section_header_t); … … 328 326 * @return EOK on success or EIO on failure. 329 327 */ 330 static errno_t chunk_load(int fd, off64_t start, size_t size, void **ptr)331 { 332 errno_t rc;328 static int chunk_load(int fd, off64_t start, size_t size, void **ptr) 329 { 330 int rc; 333 331 size_t nread; 334 332 aoff64_t pos = start;
Note:
See TracChangeset
for help on using the changeset viewer.