Skip to content

adding local types to ELF? #2

@saidelike

Description

@saidelike

Hi,

ida-syms2elf supports exporting function names, label, etc. I was able to import the symbols in gdb which is really cool. Would it be possible to add local types as well? Eg in GDB, it is then possible to import them using "add-symbol-file", the same method I use to import function names, label, etc.

For example, if we have the following type:

// sample.h
struct sample {
  int i;
  struct sample *less;
  struct sample *more;
};

In GDB, we don't have the type by default:

(gdb) p (struct sample *)0x7fffffffd6b0
No struct type named sample.

After importing the file containing the local types, we would be able to print the structure elements:

(gdb) add-symbol-file sample.o 0
add symbol table from file "sample.o" at
    .text_addr = 0x0
(gdb) p (struct sample *)0x7fffffffd6b0
$1 = (struct sample *) 0x7fffffffd6b0
(gdb) p *$1
$2 = {i = 42, less = 0x7fffffffd6b0, more = 0x7fffffffd6b0}

Regards
saidelike

[1] http://stackoverflow.com/questions/7272558/can-we-define-a-new-data-type-in-a-gdb-session

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions