jarin updated this revision to Diff 252276. jarin marked 2 inline comments as done. jarin added a comment.
Addressed reviewer comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76650/new/ https://reviews.llvm.org/D76650 Files: lldb/source/Core/ValueObject.cpp lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/Makefile lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/TestCstringUnicode.py lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/main.cpp Index: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/main.cpp =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/main.cpp @@ -0,0 +1,4 @@ +int main() { + const char *s = u8"🔥"; + return 0; // break here +} Index: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/TestCstringUnicode.py =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/TestCstringUnicode.py @@ -0,0 +1,18 @@ +# coding=utf8 + +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + + +class CstringUnicodeTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True + + def test_cstring_unicode(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "// break here", + lldb.SBFileSpec("main.cpp", False)) + self.expect_expr("s", result_summary='"🔥"') + self.expect_expr("(const char*)s", result_summary='"🔥"') Index: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/Makefile =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/Makefile @@ -0,0 +1,3 @@ +CXX_SOURCES := main.cpp + +include Makefile.rules Index: lldb/source/Core/ValueObject.cpp =================================================================== --- lldb/source/Core/ValueObject.cpp +++ lldb/source/Core/ValueObject.cpp @@ -764,7 +764,7 @@ return true; addr_t cstr_address = LLDB_INVALID_ADDRESS; AddressType cstr_address_type = eAddressTypeInvalid; - cstr_address = GetAddressOf(true, &cstr_address_type); + cstr_address = GetPointerValue(&cstr_address_type); return (cstr_address != LLDB_INVALID_ADDRESS); }
Index: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/main.cpp =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/main.cpp @@ -0,0 +1,4 @@ +int main() { + const char *s = u8"🔥"; + return 0; // break here +} Index: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/TestCstringUnicode.py =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/TestCstringUnicode.py @@ -0,0 +1,18 @@ +# coding=utf8 + +import lldb +from lldbsuite.test.lldbtest import * +import lldbsuite.test.lldbutil as lldbutil + + +class CstringUnicodeTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True + + def test_cstring_unicode(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "// break here", + lldb.SBFileSpec("main.cpp", False)) + self.expect_expr("s", result_summary='"🔥"') + self.expect_expr("(const char*)s", result_summary='"🔥"') Index: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/Makefile =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/Makefile @@ -0,0 +1,3 @@ +CXX_SOURCES := main.cpp + +include Makefile.rules Index: lldb/source/Core/ValueObject.cpp =================================================================== --- lldb/source/Core/ValueObject.cpp +++ lldb/source/Core/ValueObject.cpp @@ -764,7 +764,7 @@ return true; addr_t cstr_address = LLDB_INVALID_ADDRESS; AddressType cstr_address_type = eAddressTypeInvalid; - cstr_address = GetAddressOf(true, &cstr_address_type); + cstr_address = GetPointerValue(&cstr_address_type); return (cstr_address != LLDB_INVALID_ADDRESS); }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits