Carlo Kok found an issue where default parameters were causing the wrong argument...
authorGreg Clayton <gclayton@apple.com>
Wed, 31 Oct 2012 20:49:04 +0000 (20:49 +0000)
committerGreg Clayton <gclayton@apple.com>
Wed, 31 Oct 2012 20:49:04 +0000 (20:49 +0000)
llvm-svn: 167167

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

index dc46ebe..fca26d9 100644 (file)
@@ -49,6 +49,7 @@ class ClangUserExpression : public ClangExpression
 public:
     typedef STD_SHARED_PTR(ClangUserExpression) ClangUserExpressionSP;
     
+    enum { kDefaultTimeout = 500000u };
     //------------------------------------------------------------------
     /// Constructor
     ///
@@ -152,8 +153,8 @@ public:
              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 @@ public:
               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 @@ public:
                        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:
index 7372832..cdbdec4 100644 (file)
@@ -1630,7 +1630,16 @@ Process::LoadImage (const FileSpec &image_spec, Error &error)
                 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 @@ Process::UnloadImage (uint32_t image_token)
                         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;
index 1537b4d..ea58e84 100644 (file)
@@ -246,7 +246,9 @@ public:
                                                                               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 @@ public:
                                                                       NULL,
                                                                       result_value_sp,
                                                                       error,
-                                                                      500000);
+                                                                      true,
+                                                                      ClangUserExpression::kDefaultTimeout);
                 if (result_code == eExecutionCompleted)
                 {
                     if (result_value_sp)