As was suggested in comments for D33122,
this patch reimplements .gdb_index in more natural (probably) way.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Overall, this patch is a bit too scarce of comments. You want to keep it readable for those who don't know what the code is intended to do.
ELF/GdbIndex.h | ||
---|---|---|
31–32 ↗ | (On Diff #100256) | uint64_t? |
40 ↗ | (On Diff #100256) | There seems a better name than FileGdbIndexData. This represent a chunk of data you read from a DWARF section, right? |
ELF/SyntheticSections.cpp | ||
1752 ↗ | (On Diff #100256) | getInfo -> getDebugInfo |
1766–1768 ↗ | (On Diff #100256) | Please write in a more natural way. for (InputSection *Sec : V) InputData.push_back(readDwarf(Sec)); |
1788–1789 ↗ | (On Diff #100256) | When you bitwise-or some values, you usually want to write values from MSB to LSB. |
1796 ↗ | (On Diff #100256) | This should return FileGdbIndexData. (In general, you want to avoid mutating a object passed as a reference if writing in a more functional way is doable.) |
1812 ↗ | (On Diff #100256) | This does not "find" anything. It computes. get, compute or calculate are good choices. |
1819 ↗ | (On Diff #100256) | Addr -> Address |
ELF/SyntheticSections.h | ||
514 ↗ | (On Diff #100256) | IndexData is not a good variable name. |
- Addressed review comments, added more comments.
ELF/GdbIndex.h | ||
---|---|---|
31–32 ↗ | (On Diff #100256) | Yes, fixed. |
40 ↗ | (On Diff #100256) | That is goes from few debug sections of a object, so I used "File" word. I was thinking about "all data required for bulding gdb index extracted from object file". Would you prefer something like "GdbIndexDataChunk" ? |
ELF/SyntheticSections.cpp | ||
1752 ↗ | (On Diff #100256) | Done. |
1766–1768 ↗ | (On Diff #100256) | Done. |
1788–1789 ↗ | (On Diff #100256) | Fixed in commit of D33551 patch. |
1796 ↗ | (On Diff #100256) | Done. |
1812 ↗ | (On Diff #100256) | Ok. FWIW that confusion comes from my native language. Where I can say "find dog in the garden" or "given x = 4 * t, find x if t == 3" and that word "find" would be the same. |
1819 ↗ | (On Diff #100256) | Done. |
ELF/SyntheticSections.h | ||
514 ↗ | (On Diff #100256) | Renamed. |
ELF/GdbIndex.h | ||
---|---|---|
47 ↗ | (On Diff #100408) | Let's call it GdbIndexChunk. |
ELF/SyntheticSections.h | ||
512 ↗ | (On Diff #100408) | an -> a |
512–513 ↗ | (On Diff #100408) | Do you mean that the hash table is a map from names to their types? I don't quite get what "it is a separate area ..." means. |
514 ↗ | (On Diff #100256) | Thanks. I think this is a good name. :) |
ELF/SyntheticSections.h | ||
---|---|---|
512–513 ↗ | (On Diff #100408) | I was just mean that it is also an area: "A mapped index consists of several areas, laid out in order: ... 5. The symbol table. This is an open-addressed hash table." Because "is an hash table" itself sounds like some container for something else for me. |
ELF/SyntheticSections.cpp | ||
---|---|---|
1787 ↗ | (On Diff #100422) | If CuId is actually a 32-bit type, define it as uint32_t from the beginning. |
1810 ↗ | (On Diff #100422) | Remove a blank line. |
1871–1872 ↗ | (On Diff #100422) | Be consistent -- don't mix CU and Cu. Use Cu consistently in this patch. |
- Addressed review comments.
ELF/SyntheticSections.cpp | ||
---|---|---|
1787 ↗ | (On Diff #100422) | Done. |
1810 ↗ | (On Diff #100422) | Done. |
1871–1872 ↗ | (On Diff #100422) | Done. |