[Lldb-commits] [lldb] [lldb] Do not use LC_FUNCTION_STARTS data to determine symbol size as symbols are created (PR #106791)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 3 20:38:45 PDT 2024


https://github.com/clayborg commented:

All symbol sizes are zero for mach-o symbols unless they come from the debug map as there is no size field in nlist entries. This PR seems to just not do the work of setting the symbol size at all. Does something try to set the symbol sizes later? Does the code still try to create symbols from the LC_FUNCTION_STARTS later in this function?

I worry about not setting the function sizes for symbols as we use this information for back tracing when we lookup a symbol by address. Now if we don't have debug symbols, we won't get any sizes for symbols and I am not sure how much that affects the unwinder. I believe it is pretty important. @jasonmolenda let me know if you agree? 

Can we possibly find a way to calculate a symbol size on demand when we access the address range from a `lldb_private::Symbol`? The idea would be we could mark certain symbols as `can_synthesize_size = true` and then any accessor to a symbol's address range would need to see if this is true and call some function that could calculate this on the fly on demand.


https://github.com/llvm/llvm-project/pull/106791


More information about the lldb-commits mailing list