Addresses are usually two bytes in size on AVR, so make sure LLDB deals with that.
I'm not sure I caught all cases. In particular, lldb/include/lldb/DataFormatters/FormattersHelpers.h might be related but I've left it alone as it didn't seem to be necessary.
Honestly I think LLDB would become a lot more forgiving to uncommon architectures when these asserts are removed and avoids assumptions based on the address size. When the address size is relevant (for example, to read a value from memory), it should have an exhaustive test with a default case that does an assert (for easy debugging). For example:
switch (addr_size) { case 4: // do one thing case 8: // do something else default: assert(false && "unknown addr_size"); }
This way, it's easy to find the places that make these assumptions just by following the asserts.
I'm not sure how to add a test for this. I can test it locally by connecting to a remote debugger (simavr). However, I don't know how to do something like that in the LLDB testing framework. Additionally, for that to work I only needed the change in DumpDataExtractor.cpp so I'm not sure how to exhaustively test this.
I don't believe this will cause any failures, but it will stop lldb from using the debug_aranges section (and fall back to other, potentially slower, alternatives).