[llvm-dev] CodeView and "line 0" ?

David Majnemer via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 17 13:22:39 PDT 2016


On Wed, Aug 17, 2016 at 1:09 PM, Reid Kleckner via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I mean, we just skip over instructions without a DebugLoc:
>
> void CodeViewDebug::beginInstruction(const MachineInstr *MI) {
>   DebugHandlerBase::beginInstruction(MI);
>
>   // Ignore DBG_VALUE locations and function prologue.
>   if (!Asm || !CurFn || MI->isDebugValue() ||
>       MI->getFlag(MachineInstr::FrameSetup))
>     return;
>   DebugLoc DL = MI->getDebugLoc();
>   if (DL == PrevInstLoc || !DL)
>     return;
>   maybeRecordLocation(DL, Asm->MF);
> }
>
> Seems reasonable to extend the condition with ' || DL->getLine() == 0'.
> I'm not aware of a good way to say "this instruction is not associated with
> any line" in CodeView.
>

Perhaps we could set emit line 0 as line number 0xfeefee
(AlwaysStepIntoLineNumber).
https://blogs.msdn.microsoft.com/jmstall/2005/06/19/line-hidden-and-0xfeefee-sequence-points/


> On Wed, Aug 17, 2016 at 12:51 PM, Adrian Prantl via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Note that clang is also assigning line 0 to code that doesn't have a
>> corresponding source location. So CodeView needs to deal with this already,
>> though I don't know how it currently handles this.
>>
>> -- adrian
>>
>> > On Aug 17, 2016, at 11:43 AM, Robinson, Paul via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>> >
>> > I've been playing with Fred Riss's "line 0" patch for DWARF
>> > (https://reviews.llvm.org/D16569) but in adapting it for current trunk,
>> > I find the DwarfDebug stuff has been refactored to allow either DWARF
>> > or CodeView.  That's all good, but the question is whether the "line 0"
>> > patch should be DWARF-specific or common.  The DWARF spec explicitly
>> > states that code not associated with any particular source location
>> > should be associated with line number 0.  I don't know what CodeView
>> > (or debuggers that consume CodeView) would think of seeing "line 0" show
>> > up in the debug info.
>> >
>> > Does anybody know?
>> > Thanks,
>> > --paulr
>> >
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > llvm-dev at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160817/7f510af4/attachment.html>


More information about the llvm-dev mailing list