Page MenuHomePhabricator

[DebugInfo] Explicitly permit addr_size = 0x02 when parsing DWARF data
ClosedPublic

Authored by atrosinenko on Jun 17 2020, 2:17 PM.

Details

Summary

Current LLVM implementation uses MCAsmInfo::CodePointerSize as addr_size when emitting the DWARF data. llvm-dwarfdump, on the other hand, handles addr_sizes of 4 and 8 properly and considers all other sizes as an error. This works for most of mainline targets except for MSP430 and AVR.

msp430-gcc v8.3.1 emits DWARF32 with addr_size = 4 (DWARF32 does not imply addr_size = 4, 32 refers to internal offset width of 4 bytes) that is handled by llvm-dwarfdump already. Still, emitting 2-byte target pointers on MSP430 seems correct as well (but not for MSP430X that is supported by msp430-gcc but not by LLVM and has 20-bit address space).

This patch make it possible for MSP430 debug info support to be tested with llvm-dwarfdump.

Diff Detail

Event Timeline

atrosinenko created this revision.Jun 17 2020, 2:17 PM
Herald added a project: Restricted Project. · View Herald Transcript

Unit test: fix backslash on Windows

probinson accepted this revision.Jun 18 2020, 9:22 AM
probinson added subscribers: debug-info, probinson.

LGTM

In a .test file, you don't actually need the comment markers. They're not harmful either, so up to you whether to leave them in.
Some people prefer that commentary and action lines (REQUIRES, CHECK, etc) have different comment markings, just for readability.

This revision is now accepted and ready to land.Jun 18 2020, 9:22 AM
This revision was automatically updated to reflect the committed changes.