Changeset 0b9ac3c in mainline for uspace/app/taskdump/symtab.c


Ignore:
Timestamp:
2010-02-23T19:03:28Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c62d2e1
Parents:
1ccafee (diff), 5e50394 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskdump/symtab.c

    r1ccafee r0b9ac3c  
    4949static int section_hdr_load(int fd, const elf_header_t *ehdr, int idx,
    5050    elf_section_header_t *shdr);
    51 static int chunk_load(int fd, off_t start, off_t size, void **ptr);
     51static int chunk_load(int fd, off64_t start, size_t size, void **ptr);
    5252static int read_all(int fd, void *buf, size_t len);
    5353
     
    6565        elf_header_t elf_hdr;
    6666        elf_section_header_t sec_hdr;
    67         off_t shstrt_start, shstrt_size;
     67        off64_t shstrt_start;
     68        size_t shstrt_size;
    6869        char *shstrt, *sec_name;
    6970        void *data;
     
    206207        size_t i;
    207208        char *sname;
     209        unsigned stype;
    208210
    209211        for (i = 0; i < st->sym_size / sizeof(elf_symbol_t); ++i) {
    210212                if (st->sym[i].st_name == 0)
     213                        continue;
     214
     215                stype = ELF_ST_TYPE(st->sym[i].st_info);
     216                if (stype != STT_OBJECT && stype != STT_FUNC)
    211217                        continue;
    212218
     
    240246        uintptr_t saddr, best_addr;
    241247        char *sname, *best_name;
     248        unsigned stype;
    242249
    243250        best_name = NULL;
     
    248255                        continue;
    249256
     257                stype = ELF_ST_TYPE(st->sym[i].st_info);
     258                if (stype != STT_OBJECT && stype != STT_FUNC &&
     259                    stype != STT_NOTYPE) {
     260                        continue;
     261                }
     262
    250263                saddr = st->sym[i].st_value;
    251264                sname = st->strtab + st->sym[i].st_name;
     265
     266                /* An ugly hack to filter out some special ARM symbols. */
     267                if (sname[0] == '$')
     268                        continue;
    252269
    253270                if (best_name == NULL || (saddr <= addr && saddr > best_addr)) {
     
    291308        rc = lseek(fd, elf_hdr->e_shoff + idx * sizeof(elf_section_header_t),
    292309            SEEK_SET);
    293         if (rc == (off_t) -1)
     310        if (rc == (off64_t) -1)
    294311                return EIO;
    295312
     
    312329 * @return              EOK on success or EIO on failure.
    313330 */
    314 static int chunk_load(int fd, off_t start, off_t size, void **ptr)
     331static int chunk_load(int fd, off64_t start, size_t size, void **ptr)
    315332{
    316333        int rc;
    317334
    318335        rc = lseek(fd, start, SEEK_SET);
    319         if (rc == (off_t) -1) {
     336        if (rc == (off64_t) -1) {
    320337                printf("failed seeking chunk\n");
    321338                *ptr = NULL;
Note: See TracChangeset for help on using the changeset viewer.