From 8b2fe6dcbdf27b0df84ef4bdf514f9bc577c5804 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 14 Dec 2010 02:59:59 +0000 Subject: Modified LLDB expressions to not have to JIT and run code just to see variable values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior. There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions. Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions. Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values. Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread. Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else. llvm-svn: 121745 --- lldb/source/Expression/ClangFunction.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lldb/source/Expression/ClangFunction.cpp') diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp index 3eac429f5c7..e55238d0904 100644 --- a/lldb/source/Expression/ClangFunction.cpp +++ b/lldb/source/Expression/ClangFunction.cpp @@ -275,7 +275,7 @@ ClangFunction::WriteFunctionArguments (ExecutionContext &exe_ctx, Error error; using namespace clang; - Process::ExecutionResults return_value = Process::eExecutionSetupError; + lldb::ExecutionResults return_value = lldb::eExecutionSetupError; Process *process = exe_ctx.process; @@ -441,13 +441,13 @@ ClangFunction::DeallocateFunctionResults (ExecutionContext &exe_ctx, lldb::addr_ exe_ctx.process->DeallocateMemory(args_addr); } -Process::ExecutionResults +lldb::ExecutionResults ClangFunction::ExecuteFunction(ExecutionContext &exe_ctx, Stream &errors, Value &results) { return ExecuteFunction (exe_ctx, errors, 1000, true, results); } -Process::ExecutionResults +lldb::ExecutionResults ClangFunction::ExecuteFunction(ExecutionContext &exe_ctx, Stream &errors, bool stop_others, Value &results) { const bool try_all_threads = false; @@ -455,7 +455,7 @@ ClangFunction::ExecuteFunction(ExecutionContext &exe_ctx, Stream &errors, bool s return ExecuteFunction (exe_ctx, NULL, errors, stop_others, NULL, try_all_threads, discard_on_error, results); } -Process::ExecutionResults +lldb::ExecutionResults ClangFunction::ExecuteFunction( ExecutionContext &exe_ctx, Stream &errors, @@ -470,7 +470,7 @@ ClangFunction::ExecuteFunction( } // This is the static function -Process::ExecutionResults +lldb::ExecutionResults ClangFunction::ExecuteFunction ( ExecutionContext &exe_ctx, lldb::addr_t function_address, @@ -486,7 +486,7 @@ ClangFunction::ExecuteFunction ( errors, stop_others, discard_on_error, this_arg)); if (call_plan_sp == NULL) - return Process::eExecutionSetupError; + return lldb::eExecutionSetupError; call_plan_sp->SetPrivate(true); @@ -494,7 +494,7 @@ ClangFunction::ExecuteFunction ( single_thread_timeout_usec, errors); } -Process::ExecutionResults +lldb::ExecutionResults ClangFunction::ExecuteFunction( ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, @@ -506,7 +506,7 @@ ClangFunction::ExecuteFunction( Value &results) { using namespace clang; - Process::ExecutionResults return_value = Process::eExecutionSetupError; + lldb::ExecutionResults return_value = lldb::eExecutionSetupError; lldb::addr_t args_addr; @@ -516,12 +516,12 @@ ClangFunction::ExecuteFunction( args_addr = LLDB_INVALID_ADDRESS; if (CompileFunction(errors) != 0) - return Process::eExecutionSetupError; + return lldb::eExecutionSetupError; if (args_addr == LLDB_INVALID_ADDRESS) { if (!InsertFunction(exe_ctx, args_addr, errors)) - return Process::eExecutionSetupError; + return lldb::eExecutionSetupError; } return_value = ClangFunction::ExecuteFunction(exe_ctx, m_wrapper_function_addr, args_addr, stop_others, @@ -530,7 +530,7 @@ ClangFunction::ExecuteFunction( if (args_addr_ptr != NULL) *args_addr_ptr = args_addr; - if (return_value != Process::eExecutionCompleted) + if (return_value != lldb::eExecutionCompleted) return return_value; FetchFunctionResults(exe_ctx, args_addr, results); @@ -538,7 +538,7 @@ ClangFunction::ExecuteFunction( if (args_addr_ptr == NULL) DeallocateFunctionResults(exe_ctx, args_addr); - return Process::eExecutionCompleted; + return lldb::eExecutionCompleted; } clang::ASTConsumer * -- cgit v1.2.3