[Lldb-commits] [lldb] r167167 - in /lldb/trunk: include/lldb/Expression/ClangUserExpression.h source/Target/Process.cpp source/Target/StopInfo.cpp

Greg Clayton gclayton at apple.com
Wed Oct 31 13:49:05 PDT 2012


Author: gclayton
Date: Wed Oct 31 15:49:04 2012
New Revision: 167167

URL: http://llvm.org/viewvc/llvm-project?rev=167167&view=rev
Log:
Carlo Kok found an issue where default parameters were causing the wrong argument to be passed. I got rid of the default args so we don't run into this.


Modified:
    lldb/trunk/include/lldb/Expression/ClangUserExpression.h
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/StopInfo.cpp

Modified: lldb/trunk/include/lldb/Expression/ClangUserExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangUserExpression.h?rev=167167&r1=167166&r2=167167&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangUserExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangUserExpression.h Wed Oct 31 15:49:04 2012
@@ -49,6 +49,7 @@
 public:
     typedef STD_SHARED_PTR(ClangUserExpression) ClangUserExpressionSP;
     
+    enum { kDefaultTimeout = 500000u };
     //------------------------------------------------------------------
     /// Constructor
     ///
@@ -152,8 +153,8 @@
              bool discard_on_error,
              ClangUserExpressionSP &shared_ptr_to_me,
              lldb::ClangExpressionVariableSP &result,
-             bool try_all_threads = true,
-             uint32_t timeout_usec = 500000);
+             bool try_all_threads,
+             uint32_t timeout_usec);
              
     ThreadPlan *
     GetThreadPlanToExecuteJITExpression (Stream &error_stream,
@@ -344,8 +345,8 @@
               const char *expr_cstr,
               const char *expr_prefix,
               lldb::ValueObjectSP &result_valobj_sp,
-              bool try_all_threads = true,
-              uint32_t timeout_usec = 500000);
+              bool try_all_threads,
+              uint32_t timeout_usec);
               
     static ExecutionResults
     EvaluateWithError (ExecutionContext &exe_ctx,
@@ -357,8 +358,8 @@
                        const char *expr_prefix,
                        lldb::ValueObjectSP &result_valobj_sp,
                        Error &error,
-                       bool try_all_threads = true,
-                       uint32_t timeout_usec = 500000);
+                       bool try_all_threads,
+                       uint32_t timeout_usec);
     
     static const Error::ValueType kNoResult = 0x1001; ///< ValueObject::GetError() returns this if there is no result from the expression.
 private:

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=167167&r1=167166&r2=167167&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Oct 31 15:49:04 2012
@@ -1630,7 +1630,16 @@
                 expr.Printf("dlopen (\"%s\", 2)", path);
                 const char *prefix = "extern \"C\" void* dlopen (const char *path, int mode);\n";
                 lldb::ValueObjectSP result_valobj_sp;
-                ClangUserExpression::Evaluate (exe_ctx, eExecutionPolicyAlways, lldb::eLanguageTypeUnknown, ClangUserExpression::eResultTypeAny, unwind_on_error, expr.GetData(), prefix, result_valobj_sp);
+                ClangUserExpression::Evaluate (exe_ctx,
+                                               eExecutionPolicyAlways,
+                                               lldb::eLanguageTypeUnknown,
+                                               ClangUserExpression::eResultTypeAny,
+                                               unwind_on_error,
+                                               expr.GetData(),
+                                               prefix,
+                                               result_valobj_sp,
+                                               true,
+                                               ClangUserExpression::kDefaultTimeout);
                 error = result_valobj_sp->GetError();
                 if (error.Success())
                 {
@@ -1696,7 +1705,16 @@
                         expr.Printf("dlclose ((void *)0x%llx)", image_addr);
                         const char *prefix = "extern \"C\" int dlclose(void* handle);\n";
                         lldb::ValueObjectSP result_valobj_sp;
-                        ClangUserExpression::Evaluate (exe_ctx, eExecutionPolicyAlways, lldb::eLanguageTypeUnknown, ClangUserExpression::eResultTypeAny, unwind_on_error, expr.GetData(), prefix, result_valobj_sp);
+                        ClangUserExpression::Evaluate (exe_ctx,
+                                                       eExecutionPolicyAlways,
+                                                       lldb::eLanguageTypeUnknown,
+                                                       ClangUserExpression::eResultTypeAny,
+                                                       unwind_on_error,
+                                                       expr.GetData(),
+                                                       prefix,
+                                                       result_valobj_sp,
+                                                       true,
+                                                       ClangUserExpression::kDefaultTimeout);
                         if (result_valobj_sp->GetError().Success())
                         {
                             Scalar scalar;

Modified: lldb/trunk/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StopInfo.cpp?rev=167167&r1=167166&r2=167167&view=diff
==============================================================================
--- lldb/trunk/source/Target/StopInfo.cpp (original)
+++ lldb/trunk/source/Target/StopInfo.cpp Wed Oct 31 15:49:04 2012
@@ -246,7 +246,9 @@
                                                                               bp_loc_sp->GetConditionText(),
                                                                               NULL,
                                                                               result_value_sp,
-                                                                              error);
+                                                                              error,
+                                                                              true,
+                                                                              ClangUserExpression::kDefaultTimeout);
                         if (result_code == eExecutionCompleted)
                         {
                             if (result_value_sp)
@@ -567,7 +569,8 @@
                                                                       NULL,
                                                                       result_value_sp,
                                                                       error,
-                                                                      500000);
+                                                                      true,
+                                                                      ClangUserExpression::kDefaultTimeout);
                 if (result_code == eExecutionCompleted)
                 {
                     if (result_value_sp)





More information about the lldb-commits mailing list