Modified the host process monitor callback function Host::StartMonitoringChildProcess
to spawn a thread for each process that is being monitored. Previously
LLDB would spawn a single thread that would wait for any child process which
isn't ok to do as a shared library (LLDB.framework on Mac OSX, or lldb.so on
linux). The old single thread used to call wait4() with a pid of -1 which 
could cause it to reap child processes that it shouldn't have.

Re-wrote the way Function blocks are handles. Previously I attempted to keep
all blocks in a single memory allocation (in a std::vector). This made the
code somewhat efficient, but hard to work with. I got rid of the old BlockList
class, and went to a straight parent with children relationship. This new 
approach will allow for partial parsing of the blocks within a function.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@111706 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 8cacc1f..4464908 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -626,28 +626,21 @@
 {
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS);
 
-    Function *function(m_sym_ctx->function);
-    Block *block(m_sym_ctx->block);
-    
-    if (!function || !block)
+    if (m_sym_ctx->function == NULL || m_sym_ctx->block == NULL)
     {
         if (log)
-            log->Printf("function = %p, block = %p", function, block);
+            log->Printf("function = %p, block = %p", m_sym_ctx->function, m_sym_ctx->block);
         return NULL;
     }
     
-    BlockList& blocks(function->GetBlocks(true));
-    
     ConstString name_cs(name);
     
-    lldb::user_id_t current_block_id;
+    Block *current_block;
     
-    for (current_block_id = block->GetID();
-         current_block_id != Block::InvalidID;
-         current_block_id = blocks.GetParent(current_block_id))
-    {
-        Block *current_block(blocks.GetBlockByID(current_block_id));
-        
+    for (current_block = m_sym_ctx->block; 
+         current_block != NULL; 
+         current_block = current_block->GetParent())
+    {        
         lldb::VariableListSP var_list = current_block->GetVariableList(false, true);
         
         if (!var_list)