This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

THUMB code detection for ADS 1.2 ELF emages


Hi,

I'm trying to use GDB to work with ARM ELF images produced by ADS 1.2 (ARM toolchain, a liitle bit old).
I can do almost all I want with ARM code. But GDB works incorrectly with THUMB code: I cannot disassemle the code, GDB places breakpoints at incorrect address, stepping with 'ni'.

In GDB source code I've found that it completely ignores some special symbols ($t, $a, $d ...) that ADS places to an ELF file.
I'm going to add some processing of this symbols. At first, I would like to handle $t symbols: it looks like they denote THUMB functions (ADS does not use STT_LOPROC) . So, I'm going to cycle though symbols and find a corresponding function name for each $t symbol (they should have the same value, i.e. address).

I'm wondering about the best place for this (I'm just started to learn GDB source).
On my mind it would be better to handle these symbols in elf_slurp_symbol_table() (file elfcode.h). Right now there is no symbol table post processing function (ebd->elf_backend_symbol_table_processing is NULL). So, I'm going to implement such a function. It will cycle over all the symbols and find a symbols that correspond to each $t symbol. If found, this symbol will get STT_LOPROC attribute in isym->st_info. It will replace the STT_FUNC, but I do not know the other way for this. By the time of this assignment, all these symbols will be already processed and sym->symbol.flags will be already updated with BSF_FUNCTION flag.

If you know the better approach, please let me know.

Dmitry


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]