<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 11, 2020 at 8:09 AM Luke Drummond <<a href="mailto:luke.drummond@codeplay.com">luke.drummond@codeplay.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue Mar 10, 2020 at 7:45 PM, David Blaikie wrote:<br>
> If you only want code addresses, why not use the CU's<br>
> low_pc/high_pc/ranges<br>
> - those are guaranteed to be only code addresses, I think?<br>
><br>
In the common case, for most targets LLVM supports I think you're right,<br>
but for my case, regrettably, not. Because my target is a Harvard<br>
Architecture, any code address can have the same ordinal value as any<br>
data address: the code and data reside on different buses so the whole<br>
4GiB space is available to both code, and data. `DW_AT_low_pc` and<br>
`DW_AT_high_pc` can be used to find the range of the code segment, but<br>
given an arbitrary address, cannot be used to conclusively determine<br>
whether that address belongs to code or data when both segments contain<br>
addresses in that numeric range.</blockquote><div><br></div><div>Sorry I'm not following, partly probably due to my not having worked with such machines before.<br><br>But how are the code addresses and data addresses differentiated then (eg: if you had segment selectors in debug_aranges, how would they be used? The addresses taken from the system at runtime have some kind of segment selector associated with them, that you can then use to match with the addr+segment selector in aranges?).<br><br>Actually, coming at it from a different angle: It sounds like in the original email you're suggesting if debug_aranges did not contain data addresses, this would be good/sufficient for you? So somehow you'd be ensuring you only query debug_aranges using things you know are code addresses, not data addresses? So why would the same solution/approach not hold to querying low/high/ranges on a CU that's already guaranteed not to contain data addresses?</div></div></div>