diff options
Diffstat (limited to 'include/lldb/Expression/ClangFunction.h')
-rw-r--r-- | include/lldb/Expression/ClangFunction.h | 227 |
1 files changed, 9 insertions, 218 deletions
diff --git a/include/lldb/Expression/ClangFunction.h b/include/lldb/Expression/ClangFunction.h index 9cb22ed15cb5..9c14ddb53230 100644 --- a/include/lldb/Expression/ClangFunction.h +++ b/include/lldb/Expression/ClangFunction.h @@ -227,143 +227,6 @@ public: Stream &errors); //------------------------------------------------------------------ - /// [Static] Execute a function, passing it a single void* parameter. - /// ClangFunction uses this to call the wrapper function. - /// - /// @param[in] exe_ctx - /// The execution context to insert the function and its arguments - /// into. - /// - /// @param[in] function_address - /// The address of the function in the target process. - /// - /// @param[in] void_arg - /// The value of the void* parameter. - /// - /// @param[in] stop_others - /// True if other threads should pause during execution. - /// - /// @param[in] try_all_threads - /// If the timeout expires, true if other threads should run. If - /// the function may try to take locks, this is useful. - /// - /// @param[in] unwind_on_error - /// If true, and the execution stops before completion, we unwind the - /// function call, and return the program state to what it was before the - /// execution. If false, we leave the program in the stopped state. - /// - /// @param[in] timeout_usec - /// Timeout value (0 for no timeout). If try_all_threads is true, then we - /// will try on one thread for the lesser of .25 sec and half the total timeout. - /// then switch to running all threads, otherwise this will be the total timeout. - /// - /// @param[in] errors - /// The stream to write errors to. - /// - /// @param[in] this_arg - /// If non-NULL, the function is invoked like a C++ method, with the - /// value pointed to by the pointer as its 'this' argument. - /// - /// @return - /// Returns one of the ExecutionResults enum indicating function call status. - //------------------------------------------------------------------ - static ExecutionResults - ExecuteFunction (ExecutionContext &exe_ctx, - lldb::addr_t function_address, - lldb::addr_t &void_arg, - bool stop_others, - bool try_all_threads, - bool unwind_on_error, - bool ignore_breakpoints, - uint32_t timeout_usec, - Stream &errors, - lldb::addr_t* this_arg = 0); - - //------------------------------------------------------------------ - /// Run the function this ClangFunction was created with. - /// - /// This simple version will run the function stopping other threads - /// for a fixed timeout period (1000 usec) and if it does not complete, - /// we halt the process and try with all threads running. - /// - /// @param[in] exe_ctx - /// The thread & process in which this function will run. - /// - /// @param[in] errors - /// Errors will be written here if there are any. - /// - /// @param[out] results - /// The result value will be put here after running the function. - /// - /// @return - /// Returns one of the ExecutionResults enum indicating function call status. - //------------------------------------------------------------------ - ExecutionResults - ExecuteFunction(ExecutionContext &exe_ctx, - Stream &errors, - Value &results); - - //------------------------------------------------------------------ - /// Run the function this ClangFunction was created with. - /// - /// This simple version will run the function obeying the stop_others - /// argument. There is no timeout. - /// - /// @param[in] exe_ctx - /// The thread & process in which this function will run. - /// - /// @param[in] errors - /// Errors will be written here if there are any. - /// - /// @param[in] stop_others - /// If \b true, run only this thread, if \b false let all threads run. - /// - /// @param[out] results - /// The result value will be put here after running the function. - /// - /// @return - /// Returns one of the ExecutionResults enum indicating function call status. - //------------------------------------------------------------------ - ExecutionResults - ExecuteFunction(ExecutionContext &exe_ctx, - Stream &errors, bool stop_others, - Value &results); - - //------------------------------------------------------------------ - /// Run the function this ClangFunction was created with. - /// - /// This simple version will run the function on one thread. If \a timeout_usec - /// is not zero, we time out after that timeout. If \a try_all_threads is true, then we will - /// resume with all threads on, otherwise we halt the process, and eExecutionInterrupted will be returned. - /// - /// @param[in] exe_ctx - /// The thread & process in which this function will run. - /// - /// @param[in] errors - /// Errors will be written here if there are any. - /// - /// @param[in] timeout_usec - /// Timeout value (0 for no timeout). If try_all_threads is true, then we - /// will try on one thread for the lesser of .25 sec and half the total timeout. - /// then switch to running all threads, otherwise this will be the total timeout. - /// - /// @param[in] try_all_threads - /// If \b true, run only this thread, if \b false let all threads run. - /// - /// @param[out] results - /// The result value will be put here after running the function. - /// - /// @return - /// Returns one of the ExecutionResults enum indicating function call status. - //------------------------------------------------------------------ - ExecutionResults - ExecuteFunction(ExecutionContext &exe_ctx, - Stream &errors, - uint32_t single_thread_timeout_usec, - bool try_all_threads, - Value &results); - - //------------------------------------------------------------------ /// Run the function this ClangFunction was created with. /// /// This is the full version. @@ -381,17 +244,8 @@ public: /// @param[in] errors /// Errors will be written here if there are any. /// - /// @param[in] stop_others - /// If \b true, run only this thread, if \b false let all threads run. - /// - /// @param[in] timeout_usec - /// Timeout value (0 for no timeout). If try_all_threads is true, then we - /// will try on one thread for the lesser of .25 sec and half the total timeout. - /// then switch to running all threads, otherwise this will be the total timeout. - /// - /// - /// @param[in] try_all_threads - /// If \b true, run only this thread, if \b false let all threads run. + /// @param[in] options + /// The options for this expression execution. /// /// @param[out] results /// The result value will be put here after running the function. @@ -402,63 +256,11 @@ public: ExecutionResults ExecuteFunction(ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, - Stream &errors, - bool stop_others, - uint32_t timeout_usec, - bool try_all_threads, - bool unwind_on_error, - bool ignore_breakpoints, + const EvaluateExpressionOptions &options, + Stream &errors, Value &results); //------------------------------------------------------------------ - /// [static] Get a thread plan to run a function. - /// - /// @param[in] exe_ctx - /// The execution context to insert the function and its arguments - /// into. - /// - /// @param[in] func_addr - /// The address of the function in the target process. - /// - /// @param[in] args_addr_ref - /// The value of the void* parameter. - /// - /// @param[in] errors - /// The stream to write errors to. - /// - /// @param[in] stop_others - /// True if other threads should pause during execution. - /// - /// @param[in] unwind_on_error - /// True if the thread plan may simply be discarded if an error occurs. - /// - /// @param[in] ignore_breakpoints - /// True if the expression execution will ignore breakpoint hits and continue executing. - /// - /// @param[in] this_arg - /// If non-NULL (and cmd_arg is NULL), the function is invoked like a C++ - /// method, with the value pointed to by the pointer as its 'this' - /// argument. - /// - /// @param[in] cmd_arg - /// If non-NULL, the function is invoked like an Objective-C method, with - /// this_arg in the 'self' slot and cmd_arg in the '_cmd' slot - /// - /// @return - /// A ThreadPlan for executing the function. - //------------------------------------------------------------------ - static ThreadPlan * - GetThreadPlanToCallFunction (ExecutionContext &exe_ctx, - lldb::addr_t func_addr, - lldb::addr_t &args_addr_ref, - Stream &errors, - bool stop_others, - bool unwind_on_error, - bool ignore_breakpoints, - lldb::addr_t *this_arg = 0, - lldb::addr_t *cmd_arg = 0); - - //------------------------------------------------------------------ /// Get a thread plan to run the function this ClangFunction was created with. /// /// @param[in] exe_ctx @@ -468,8 +270,8 @@ public: /// @param[in] func_addr /// The address of the function in the target process. /// - /// @param[in] args_addr_ref - /// The value of the void* parameter. + /// @param[in] args_addr + /// The address of the argument struct. /// /// @param[in] errors /// The stream to write errors to. @@ -485,20 +287,9 @@ public: //------------------------------------------------------------------ ThreadPlan * GetThreadPlanToCallFunction (ExecutionContext &exe_ctx, - lldb::addr_t &args_addr_ref, - Stream &errors, - bool stop_others, - bool unwind_on_error = true, - bool ignore_breakpoints = true) - { - return ClangFunction::GetThreadPlanToCallFunction (exe_ctx, - m_jit_start_addr, - args_addr_ref, - errors, - stop_others, - unwind_on_error, - ignore_breakpoints); - } + lldb::addr_t args_addr, + const EvaluateExpressionOptions &options, + Stream &errors); //------------------------------------------------------------------ /// Get the result of the function from its struct |