[Lldb-commits] [PATCH] D12658: Search variables based on clang::DeclContext and clang::Decl tree

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 15 17:35:07 PDT 2015


clayborg added a subscriber: clayborg.
clayborg added a comment.

I am seeing line 89 fail on MacOSX from your new TestCppNsImport.py:

  test_result = frame.EvaluateExpression("imported")
  self.assertTrue(test_result.IsValid() and test_result.GetValueAsSigned() == 99, "imported = 99")

Ours is picking up the global "imported" and it is getting 89. Can you send me the log file from the following commands?:

cd lldb/test/lang/cpp/nsimport
make

Now find the LLDB that you built and use it to debug:

../...../lldb a.out
(lldb) b /break 0/
(lldb) r
(lldb) log enable -f /tmp/expr-log.txt lldb expr
(lldb) p imported
(lldb) log disable lldb expr

Then send me the "expr-log.txt".

On MacOSX, we find the global "imported" in the translation unit:

ClangExpressionDeclMap::FindExternalVisibleDecls[9] for 'imported' in a 'TranslationUnit'

  CEDM::FEVD[9] Searching the root namespace
  CEDM::FEVD[9] Found variable imported, returned static int &imported (original int)

I am wondering if this works for you because your debug info isn't correctly describing the "imported" global variable. Maybe the one in the translation unit got stripped since it wasn't used? You might need to use it with something like:

  ::imported = 123;

If you can send me the expression log and possibly your ELF a.out file, I might be able to figure out what is going on.

Greg


http://reviews.llvm.org/D12658





More information about the lldb-commits mailing list