[PATCH] D73962: [DebugInfo] Error if unsupported address size detected in line table

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 11:32:40 PST 2020


aykevl added a comment.

I just noticed this patch from D73961 <https://reviews.llvm.org/D73961>. I am not yet familiar with the DWARF support in LLVM but just wanted to say two things:

- The address size (2) that LLVM uses for AVR might be wrong: `avr-gcc` uses 4 instead. I don't know why exactly but perhaps because there are AVR devices that have more than 64K words of flash (such as the ATmega2560).
- So far it looks like code compiled with Clang has faulty debug info. `dwarfdump` complains `ERROR:  dwarf_srcfiles:  DW_DLE_HEADER_LEN_BIGGER_THAN_SECSIZE (342) Corrupt dwarf.` while `llvm-dwarfdump` doesn't even try to print the contents of .debug-info.

To reproduce, code:

  int main(void)
  {
    while (1) {
      __asm__ __volatile__("nop");
    }
  }

Compiled with avr-gcc (the `-gdwarf-4` is important because avr-gcc on Debian defaults to stabs for some reason):

  avr-gcc -o avr-nop.elf -g -gdwarf-4 avr-nop.c

Compiled with Clang:

  clang --target=avr -c -o avr-nop.o -Os -g avr-nop.c
  avr-gcc -o avr-nop.elf avr-nop.o

Noting it here in case it is of any use, or you happen to have any hints how I could debug this further (I've already spent hours on this).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73962/new/

https://reviews.llvm.org/D73962





More information about the llvm-commits mailing list