[LLVMdev] DWARF location lists

Relph, Richard Richard.Relph at amd.com
Wed Mar 30 03:24:12 PDT 2011


In the version of LLVM I'm using (Apple tag 2352.1), it seems that the DWARF emitter cannot produce DWARF location lists to outline when user variables live and where. Instead it uses a crutch of DW_AT_start_scope to specify each solitary location where an assignment to a user variable does occur.

This is unsatisfactory for machines that put user variables in registers because it doesn't specify when a register is used for some other purpose, leaving the debugger no clue about when a user's variable might be "dead". Instead, the debugger will silently tell the user whatever happens to be in that register at the time.

To do the right thing, I think the register allocator needs to emit llvm.dbg.value calls to specify "undef" as the new value for a variable whenever the register a variable lives in is repurposed. And then the DWARF emitter needs to use the pair of llvm.dbg.value calls to emit a location list if necessary (ie, the variable lives in more than one register during its overall lifetime, or isn't available for its entire scope.)

Does this sound reasonable? If so, who is active in the DWARF emitter and can help or advise on any relevant changes (since 2352.1, or planned) in this area? It does seem likely to me that this deficiency might have been addressed already, or at least have plans in place.

Thanks,

Richard Relph
MTS | Stream Compute SW | AMD
o. 408.749.6659

[cid:image001.jpg at 01CBEE7E.EC3D9560]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110330/ae15533d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 6743 bytes
Desc: image001.jpg
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110330/ae15533d/attachment.jpg>


More information about the llvm-dev mailing list