When calling TypeSystemMap::Clear, objects being destroyed in the process of
authorJim Ingham <jingham@apple.com>
Fri, 12 Feb 2016 00:03:19 +0000 (00:03 +0000)
committerJim Ingham <jingham@apple.com>
Fri, 12 Feb 2016 00:03:19 +0000 (00:03 +0000)
commit0ea010aecb591df0d857de32945bb4ba840a67e4
tree7777a7233cb05da94c224538d35e6f78c2cf8c9e
parente5fc9f35138bbde114cb63700a4708d4130cdcf1
When calling TypeSystemMap::Clear, objects being destroyed in the process of
clearing the map ended up calling back into the TypeSystemMap to do lookups.
Not a good idea, and in this case it would cause a deadlock.

You would only see this when replacing the target contents after an exec, and only if you
had stopped before the exec, evaluated an expression, then continued
on to the point where you did the exec.

Fixed this by making sure the TypeSystemMap::Clear tears down the TypeSystems in the map before clearing the map.
I also add an expression before exec to the TestExec.py so that we'll catch this
issue if it crops up again in the future.

<rdar://problem/24554920>

llvm-svn: 260624
lldb/include/lldb/Symbol/ClangASTContext.h
lldb/include/lldb/Symbol/TypeSystem.h
lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
lldb/source/Symbol/ClangASTContext.cpp
lldb/source/Symbol/TypeSystem.cpp