lldb connecting to lldb-server on ARM android was placing arm-breakpoints in a thumb function. This was fixed by marking a symbol as THUMB if its least significant bit is set while parsing symbols from the elf file.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
So are we missing the CPU map on android ELF files? The $m, $a and $t symbols should take care of this ISA mapping stuff unless they are not present.
The ISA mapping symbols are optional and they aren't present in executables where the symtab section is striped (most system library on android).
You have to add an entry to the m_address_class_map for arm symbols also because with the current change all address treated as thumb when you don't have mapping symbols.
P.S.: Next time please upload the diff with full context
Perhaps I have misunderstood your concern, but the symbol is only marked as eAddressClassCodeAlternateISA if it is THUMB since that happense inside:
if (symbol_type == eSymbolTypeCode && symbol.st_value & 1)
Are you suggesting that I need to add an 'else' to this check and mark it as eAddressClassCode? I can see that would make sense.
Yes, you have to add an entry for arm symbols also because of the way m_address_class_map is used (see ObjectFileELF::GetAddressClass). Basically an entry means that all address have the specified type until the next entry (ordered by address). The reason behind this layout is that you can query the address class of any address without have to resolve it to a symbol it belongs to.
This patch trys to address the issues raised by Tamas. Arm symbols will now also be added to the m_address_class_map too.