Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 660c8b71 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by Android Git Automerger
Browse files

am cbb9257a: Merge "Fix debuggerd (native crash dump)."

* commit 'cbb9257a':
  Fix debuggerd (native crash dump).
parents 44659e90 cbb9257a
Loading
Loading
Loading
Loading
+19 −10
Original line number Original line Diff line number Diff line
@@ -94,17 +94,26 @@ struct symbol_table *symbol_table_create(const char *filename)
    table->name = strdup(filename);
    table->name = strdup(filename);
    table->num_symbols = 0;
    table->num_symbols = 0;


    Elf32_Sym *dynsyms = (Elf32_Sym*)(base + shdr[dynsym_idx].sh_offset);
    Elf32_Sym *dynsyms = NULL;
    Elf32_Sym *syms = (Elf32_Sym*)(base + shdr[sym_idx].sh_offset);
    Elf32_Sym *syms = NULL;

    int dynnumsyms = 0;
    int dynnumsyms = shdr[dynsym_idx].sh_size / shdr[dynsym_idx].sh_entsize;
    int numsyms = 0;
    int numsyms = shdr[sym_idx].sh_size / shdr[sym_idx].sh_entsize;
    char *dynstr = NULL;
    char *str = NULL;


    if (dynsym_idx != -1) {
        dynsyms = (Elf32_Sym*)(base + shdr[dynsym_idx].sh_offset);
        dynnumsyms = shdr[dynsym_idx].sh_size / shdr[dynsym_idx].sh_entsize;
        int dynstr_idx = shdr[dynsym_idx].sh_link;
        int dynstr_idx = shdr[dynsym_idx].sh_link;
    int str_idx = shdr[sym_idx].sh_link;
        dynstr = base + shdr[dynstr_idx].sh_offset;
    }


    char *dynstr = base + shdr[dynstr_idx].sh_offset;
    if (sym_idx != -1) {
    char *str = base + shdr[str_idx].sh_offset;
        syms = (Elf32_Sym*)(base + shdr[sym_idx].sh_offset);
        numsyms = shdr[sym_idx].sh_size / shdr[sym_idx].sh_entsize;
        int str_idx = shdr[sym_idx].sh_link;
        str = base + shdr[str_idx].sh_offset;
    }


    int symbol_count = 0;
    int symbol_count = 0;
    int dynsymbol_count = 0;
    int dynsymbol_count = 0;
@@ -134,7 +143,7 @@ struct symbol_table *symbol_table_create(const char *filename)
    }
    }


    // Now, create an entry in our symbol table structure for each symbol...
    // Now, create an entry in our symbol table structure for each symbol...
    table->num_symbols += symbol_count + dynsymbol_count;;
    table->num_symbols += symbol_count + dynsymbol_count;
    table->symbols = malloc(table->num_symbols * sizeof(struct symbol));
    table->symbols = malloc(table->num_symbols * sizeof(struct symbol));
    if(!table->symbols) {
    if(!table->symbols) {
        free(table);
        free(table);