[lldb-dev] [Bug 44155] New: LLDB doesn't preserve values of strings

via lldb-dev lldb-dev at lists.llvm.org
Tue Nov 26 23:46:55 PST 2019


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

            Bug ID: 44155
           Summary: LLDB doesn't preserve values of strings
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: teemperor at gmail.com
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

(lldb) expr "foo"
(const char [4]) $0 = "foo"
(lldb) expr "bar"
(const char [4]) $1 = "bar"
(lldb) expr $0
(const char [4]) $0 = “bar”
^ Should have printed "foo"

This however works just fine:

(lldb) expr char c[] = "foo"; c
(char [4]) $0 = "foo"
(lldb) expr char c[] = "bar"; c
(char [4]) $1 = "bar"
(lldb) expr $0
(char [4]) $0 = “foo”

We either need to keep the sections for the strings around or support copying
the related memory to our storage for persistent variable values.

-- 
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/20191127/bca8df15/attachment.html>


More information about the lldb-dev mailing list