labath wrote:

> > which (according to the paragraph you quote) means that the function's 
> > entry point is 0x1cfb0, which is not the lowest address in the function.
> 
> I managed to nitpick the text but then go on to assume the ranges would be 
> sorted with start address increasing. Bad idea.

Yeah. In principle, it's possible to have a sorted range list and then use 
DW_AT_low/entry_pc to denote the entry point. However, it's pretty hard to 
guarantee this in practice, since the compiler doesn't know the the final 
location of the function pieces, and the linker is limited to patching offsets.

> 
> But, if the first range was the `[0x0000000000001a0f, 0x0000000000001b07)` 
> range, then the lexical block range `[0x0000000000001ae8, 
> 0x0000000000001b07)` would not produce this error.

:+1: 

> 
> So then I think what if we used the minimum base address of the ranges, and I 
> have just reinvented what you have already done with `m_first_code_address`. 
> I think `InitializeFirstCodeAddressRecursive` is calculating exactly this.

They're similar but different. You (I think) had in mind using the minimum 
address range of the enclosing function, whereas 
`InitializeFirstCodeAddressRecursive` does it for the whole module, and it 
deliberately avoids using the debug info for this purpose (as the goal is to 
catch addresses/ranges that have been set to zero due to linker GC). So, it 
checks for blocks that are too low to be valid code, but it doesn't check for 
blocks that are "outside" of the enclosing function. For that, I have #117725, 
which I'm also trying to get reviewed (ping ping :P).

> 
> Removing this error case sounds good to me.

> It would be a good idea to quote the error message verbatim in the commit 
> message so that this change may be found that way in future.

:+1:



https://github.com/llvm/llvm-project/pull/132395
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to