[PATCH] Initial DWARF64 support for .debug_line

David Blaikie dblaikie at gmail.com
Mon Oct 21 11:58:26 PDT 2013


On Mon, Oct 21, 2013 at 11:55 AM, Ed Maste <emaste at freebsd.org> wrote:

>
>   I compiled the existing dwarfdump-inl-test.cc for FreeBSD mips64:
>
>   % g++ --version
>   g++ (GCC) 4.2.1 20070831 patched [FreeBSD]
>   Copyright (C) 2007 Free Software Foundation, Inc.
>   This is free software; see the source for copying conditions.  There is
> NO
>   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>   % g++ -g dwarfdump-inl-test.cc -o dwarfdump-inl-test.freebsd-elf-mips64
>
>   current state:
>   ```
>   % bin/llvm-dwarfdump --debug-dump=line
> dwarfdump-inl-test.freebsd-elf-mips64
>   dwarfdump-inl-test.freebsd-elf-mips64:  file format ELF64-unknown
>
>
>   .debug_line contents:
>   %
>   ```
>   with this patch:
>   ```
>   % bin/llvm-dwarfdump --debug-dump=line
> dwarfdump-inl-test.freebsd-elf-mips64
>   dwarfdump-inl-test.freebsd-elf-mips64:  file format ELF64-unknown
>
>
>   .debug_line contents:
>   Line table prologue:
>      total_length: 0x00000212
>           version: 2
>   prologue_length: 0x000001ab
>   min_inst_length: 1
>   default_is_stmt: 1
>         line_base: -5
>        line_range: 14
>       opcode_base: 13
>   ...
>   ```
>
>   this only outputs the first CompileUnit though, perhaps because the
> parsing fails in another section in DWARFContext::parseCompileUnits().  Is
> it reasonable to add this dwarfdump-inl-test.freebsd-elf-mips64 binary and
> a basic test, fleshing it out when DWARF64 parsing for other sections is
> added?
>

One option might be to take the assembly and hand-hack it (in the simplest
case, just removing the sections dwarfdump doesn't support at the moment?)

But really it doesn't matter too much if there's buggy behavior in other
sections - assuming it was buggy without your patch, this is nothing new.
The test case only needs to test (using FileCheck to verify the parts of
the file you expect your patch to make correct) the intentional
functionality that we intend to be correct with this patch - it can
silently ignore other parts (or you can put comments in and checks that
test for the broken behavior, so the test will fail when the bugs are fixed
and the test case can be updated to test the correct behavior).


>
>   (the test file is 15638 bytes -- larger than the clang-compiled version,
> due to the lack of -gline-tables-only)
>
> http://llvm-reviews.chandlerc.com/D1988
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131021/e4a2dda4/attachment.html>


More information about the llvm-commits mailing list