[lldb-dev] [Bug 35654] LLDB Does not print the correct value for a variable (suspect NRVO alias issue)

via lldb-dev lldb-dev at lists.llvm.org
Fri Dec 15 02:54:17 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35654

labath at google.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|lldb-dev at lists.llvm.org     |jingham at apple.com

--- Comment #6 from labath at google.com ---
Thanks for the binaries.

This here seems to be the key (diff of output of llvm-dwarfdump on main.o):
 0x0000006e:     DW_TAG_variable
                   DW_AT_location       (0x00000000
-                     0x0000000000000028 - 0x0000000000000041: DW_OP_breg6
RBP-24)
+                     0x0000000000000028 - 0x0000000000000041: DW_OP_breg6
RBP-24, DW_OP_deref)
                   DW_AT_name   ("r")

(the - is your file, the + is the file generated by my clang).

It seems that the xcode clang forgot to add the OP_deref opcode to the location
of the r variable. This means lldb will go looking for in in the wrong place
and display garbage.

Since the behavior is correct on older clangs as well as on current master, I
assume that the Xcode branched clang off of some revision that had this broken.
There isn't much we can do about this from the debugger side, but I'll assign
this to our xcode folks, to see if they can do anything about the compiler
itself.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20171215/a11f2716/attachment.html>


More information about the lldb-dev mailing list