The hashing algorithm gives different values - at least for foobár - between 
the two implementations.  So if you build with an older clang, and test with a 
new lldb, the type lookup fails.

Were the two algorithms supposed to be identical?  It will mean that type 
lookups in the output of older clangs will start failing with the new lldb, 
which is not so great.  Though to be honest, if it's only for high bit 
characters it isn't super critical...

Jim


> On Mar 7, 2018, at 5:43 PM, Davide Italiano via lldb-commits 
> <lldb-commits@lists.llvm.org> wrote:
> 
> On Fri, Feb 23, 2018 at 9:49 AM, Pavel Labath via lldb-commits
> <lldb-commits@lists.llvm.org> wrote:
>> Author: labath
>> Date: Fri Feb 23 09:49:26 2018
>> New Revision: 325927
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=325927&view=rev
>> Log:
>> Replace HashStringUsingDJB with llvm::djbHash
>> 
>> Summary:
>> The llvm function is equivalent to this one. Where possible I tried to
>> replace const char* with llvm::StringRef to avoid extra strlen
>> computations. In most places, I was able to track the c string back to
>> the ConstString it was created from.
>> 
>> I also create a test that verifies we are able to lookup names with
>> unicode characters, as a bug in the llvm compiler (it accidentally used
>> a different hash function) meant this was not working until recently.
>> 
>> This also removes the unused ExportTable class.
>> 
>> Reviewers: aprantl, davide
>> 
> 
> The unicode test that you added fails for me (and others here) locally on 
> MacOS.
> 
> Session logs for test failures/errors/unexpected successes will go
> into directory '/Users/davide/work/llvm-monorepo/build/lldb-test-traces'
> Command invoked:
> /Users/davide/work/llvm-monorepo/llvm-project-20170507/llvm/tools/lldb/test/dotest.py
> -q --arch=x86_64 --executable
> /Users/davide/work/llvm-monorepo/build/bin/lldb -s
> /Users/davide/work/llvm-monorepo/build/lldb-test-traces --build-dir
> /Users/davide/work/llvm-monorepo/build/lldb-test-build.noindex -S nm
> -u CXXFLAGS -u CFLAGS -C
> /Users/davide/work/llvm-monorepo/build/./bin/clang --codesign-identity
> lldb_codesign --server
> /Users/davide/work/llvm-monorepo/build/bin/debugserver --results-port
> 51468 -S nm --inferior -p TestUnicodeSymbols.py
> /Users/davide/work/llvm-monorepo/llvm-project-20170507/lldb/packages/Python/lldbsuite/test/lang/c/unicode
> --event-add-entries worker_index=15:int
> FAIL: LLDB (/Users/davide/work/llvm-monorepo/build/bin/clang-7.0-x86_64)
> :: test_union_members_dsym (TestUnicodeSymbols.TestUnicodeSymbols)
> PASS: LLDB (/Users/davide/work/llvm-monorepo/build/bin/clang-7.0-x86_64)
> :: test_union_members_dwarf (TestUnicodeSymbols.TestUnicodeSymbols)
> PASS: LLDB (/Users/davide/work/llvm-monorepo/build/bin/clang-7.0-x86_64)
> :: test_union_members_gmodules (TestUnicodeSymbols.TestUnicodeSymbols)
> ======================================================================
> FAIL: test_union_members_dsym (TestUnicodeSymbols.TestUnicodeSymbols)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File 
> "/Users/davide/work/llvm-monorepo/llvm-project-20170507/lldb/packages/Python/lldbsuite/test/lldbtest.py",
> line 1769, in dsym_test_method
>   return attrvalue(self)
> File 
> "/Users/davide/work/llvm-monorepo/llvm-project-20170507/lldb/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py",
> line 18, in test_union_members
>   self.assertTrue(mytype.IsValid())
> AssertionError: False is not True
> Config=x86_64-/Users/davide/work/llvm-monorepo/build/bin/clang-7.0
> ----------------------------------------------------------------------
> Ran 3 tests in 2.715s
> 
> RESULT: FAILED (2 passes, 1 failures, 0 errors, 0 skipped, 0 expected
> failures, 0 unexpected successes)
> 
> [TestUnicodeSymbols.py FAILED]
> 
> Any chance that you can take a look?
> It's a little weird because only the dsym version is actually failing.
> 
> Thanks!
> 
> --
> Davide
> _______________________________________________
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to