[PATCH] Support DWARF discriminators in object streamer.

Rafael Espíndola rafael.espindola at gmail.com
Thu Feb 13 19:01:15 PST 2014


On 13 February 2014 21:35, Diego Novillo <dnovillo at google.com> wrote:
>
> On Feb 13, 2014 7:23 PM, "Rafael Ávila de Espíndola"
> <rafael.espindola at gmail.com> wrote:
>>
>>
>>
>> ================
>> Comment at: test/MC/ELF/discriminator.s:2
>> @@ +1,3 @@
>> +# RUN: llvm-mc -g -triple i386-unknown-unknown %s -filetype=obj -o - |
>> llvm-readobj -r | FileCheck %s
>> +# RUN: llvm-mc -g -triple i386-unknown-unknown %s -filetype=obj -o - |
>> llvm-dwarfdump -debug-dump=line - | FileCheck %s -check-prefix=DWARF-DUMP
>> +
>> ----------------
>> I don't think -g is what you want in here. That will produce debug info
>> for the assembly file.
>
> Right. Which is exactly what i want for dwarfdump. Otherwise, i have to
> generate all the dwarf directives myself.

When I say that -g generates debug "for the assembly", I mean that
running gdb on it should show the source file as being foo.s.

Your patch only changes how we handle discriminators, so in addition to

 .loc 1 2 discriminator 1

all that you should need is a

.file 1 bar.c

With that, the test should pass if you remove the -g, no?

Cheers,
Rafael




More information about the llvm-commits mailing list