[Lldb-commits] [PATCH] D68069: Explicitly set entry point arch when it's thumb

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 26 04:51:51 PDT 2019


labath added a comment.

This sounds like a reasonable thing to do, but it seems to me we make that more generic. Having a symbol for the entry point would help in other cases too, and we already go through a lot of trouble to track down various symbol addresses (plt parsing, eh_frame parsing, ...), so this would fit the general pattern there. So, I think we should just remove the if(arm) check and always create a "synthetic" symbol for the entry point if there is no symbol at that address already.

For the test, what would you say to writing that as a lit test instead (testing the address class deduction via the disassemble command you mentioned)? The yaml is actually fairly readable as is, but given that you felt the need to include the commands used to produce that input, it might be better to actually produce that file via the commands as a part of the test (substituting `llvm-mc` for `as` and `ld.lld` for linker).



================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2728
+              symbol_id,
+              "",              // Symbol name.
+              false,           // Is the symbol name mangled?
----------------
`GetNextSyntheticSymbolName().GetCString()`


================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2737-2738
+              0,          // Offset in section or symbol value.
+              2,          // Size.
+              true,       // Size is valid.
+              false,      // Contains linker annotations?
----------------
This is pretty arbitrary. Would it be possible to just set size_is_valid=false, and let the usual symbol size deduction logic figure out something reasonable here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68069/new/

https://reviews.llvm.org/D68069





More information about the lldb-commits mailing list