[llvm-commits] [llvm] r169218 - in /llvm/trunk: include/llvm/ lib/CodeGen/AsmPrinter/ lib/VMCore/ test/CodeGen/ARM/ test/CodeGen/Thumb/ test/CodeGen/X86/ test/DebugInfo/ test/DebugInfo/X86/ test/JitListener/

David Blaikie dblaikie at gmail.com
Thu Dec 6 08:33:53 PST 2012


On Thu, Dec 6, 2012 at 2:24 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Bill,
>
>
>>> Frontends (Clang, DragonEgg, etc) know which language they're emitting
>>>
>>> debug info for & what the default is. They emit lower bounds whenever
>>> the bound is not the language-specific default.
>>> Backend (LLVM) unconditionally emits whatever the frontend gave it.
>>>
>>> & thus we get the minimum required debug info: values when they're not
>>> the default, relying on the default when it matches.
>>>
>> Here's my problem. Let's say that Ada is using an array that starts at
>> '0'. Right now, we treat a lower bound of '0' as the default for the
>> language (because we're assuming C/C++ here) and we won't emit it in the
>> DWARF.
>
>
> why don't you emit it?  If the front-end produced it, shouldn't you just
> output
> it?

Yeah, this was sort of my thinking. The issue is that there's no way
for the frontend /not/ to emit it in the current debug info LLVM
metadata schema. And no nice way to make that field alone optional.
(also: this would make frontends even more DWARF/debugger specific as
they would be encoding knowledge of the defaults that are shared with
debuggers - this could be a problem if we ever wanted to produce other
debug info formats that had different, or nonexistent, defaults)

> Or is this basically a compression scheme to reduce the size of object
> files?

Yes, that's the only reason to omit it - reducing the size of debug
info data produced in the end.

>
>
>  This is wrong for Ada, which defaults to '1' as the lower bound of an
> array.
>
> There isn't really a default specified by the Ada language itself.  However
> I
> guess what matters is what gdb/lldb thinks the lower bound is if there is no
> explicit lower bound.  Did anyone rummage around inside the debuggers to
> determine that?

Not sure - I believe the DWARF spec has some suggestions, but I'm not
sure if Bill took that or other data to make the determination.

- David

>
> Ciao, Duncan.
>
>
>  Conversely, we *will* emit a lower bound for Ada if it says that the lower
> bound is '1', since we don't expect that to be the default. Emitting a lower
> bound of '1' is not needed here, of course.
>>
>>
>> I just need a way of determining if the lower bound given to us is the
>> default for the source language or not. If it's not, then we will emit the
>> lower bound attribute. Otherwise, we won't.
>>
>> -bw
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list