[llvm-commits] JIT: Emitting a debug location after an instruction

Jeffrey Yasskin jyasskin at google.com
Mon Aug 23 05:13:44 PDT 2010


On Mon, Aug 23, 2010 at 12:51 PM, nicolas geoffray
<nicolas.geoffray at gmail.com> wrote:
> On Mon, Aug 23, 2010 at 1:46 PM, Jeffrey Yasskin <jyasskin at google.com>
> wrote:
>>
>> What problem are you trying to solve here? This patch looks like it'll
>> assign the wrong line number to first instruction of any line, except
>> when doing a backtrace.
>
> The backtrace is exactly what I want to solve here :). Don't think lines,
> but PC.

processDebugLoc() matches a line to a PC, so I'm not sure how to avoid
thinking about lines. What bad behavior are you seeing? The wrong line
assigned to a backtrace frame? Or something else?

>> I'm not sure how existing debuggers assign
>> line numbers to backtrace frames, but one simple fix might be to look
>> up the line of the address before the one stored as the return
>> address.
>
> This does not work if I want precise information: I don't want the PC before
> or after and then do some kind of magic computation, but the exact one.

A line number always applies to a range (or several ranges) of
addresses. You can look up any address in that range, and get the
precise line number. I guess I'm missing what information you need to
be precise.



More information about the llvm-commits mailing list