diff options
author | Greg Clayton <gclayton@apple.com> | 2011-03-24 21:19:54 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-03-24 21:19:54 +0000 |
commit | e0d378b3340c67c774b0e27593347d9c521fe86f (patch) | |
tree | 0e9feb6c8b3e8bd3179da4bc14a571fa97edd45d /lldb/source/Target | |
parent | dd9eb21c3fbbd9ffc5dc9a3598c452460b8e3c55 (diff) | |
download | bcm5719-llvm-e0d378b3340c67c774b0e27593347d9c521fe86f.tar.gz bcm5719-llvm-e0d378b3340c67c774b0e27593347d9c521fe86f.zip |
Fixed the LLDB build so that we can have private types, private enums and
public types and public enums. This was done to keep the SWIG stuff from
parsing all sorts of enums and types that weren't needed, and allows us to
abstract our API better.
llvm-svn: 128239
Diffstat (limited to 'lldb/source/Target')
-rw-r--r-- | lldb/source/Target/Process.cpp | 52 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 92 | ||||
-rw-r--r-- | lldb/source/Target/Thread.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadList.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/ThreadPlanStepOverRange.cpp | 4 |
5 files changed, 40 insertions, 112 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index c5d470d029e..54c60f55b54 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2693,7 +2693,7 @@ Process::PopProcessInputReader () void Process::SettingsInitialize () { - static std::vector<lldb::OptionEnumValueElement> g_plugins; + static std::vector<OptionEnumValueElement> g_plugins; int i=0; const char *name; @@ -2781,13 +2781,13 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, if (thread_plan_sp.get() == NULL) { errors.Printf("RunThreadPlan called with empty thread plan."); - return lldb::eExecutionSetupError; + return eExecutionSetupError; } if (m_private_state.GetValue() != eStateStopped) { errors.Printf ("RunThreadPlan called while the private state was not stopped."); - return lldb::eExecutionSetupError; + return eExecutionSetupError; } // Save this value for restoration of the execution context after we run @@ -2854,7 +2854,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, if (!resume_error.Success()) { errors.Printf("Error resuming inferior: \"%s\".\n", resume_error.AsCString()); - return_value = lldb::eExecutionSetupError; + return_value = eExecutionSetupError; break; } @@ -2869,7 +2869,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, log->Printf("Didn't get any event after initial resume, exiting."); errors.Printf("Didn't get any event after initial resume, exiting."); - return_value = lldb::eExecutionSetupError; + return_value = eExecutionSetupError; break; } @@ -2880,7 +2880,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, log->Printf("Didn't get running event after initial resume, got %s instead.", StateAsCString(stop_state)); errors.Printf("Didn't get running event after initial resume, got %s instead.", StateAsCString(stop_state)); - return_value = lldb::eExecutionSetupError; + return_value = eExecutionSetupError; break; } @@ -2930,12 +2930,12 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, // Yay, we're done. if (log) log->Printf ("Execution completed successfully."); - return_value = lldb::eExecutionCompleted; + return_value = eExecutionCompleted; break; case lldb::eStateCrashed: if (log) log->Printf ("Execution crashed."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; case lldb::eStateRunning: do_resume = false; @@ -2944,7 +2944,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, default: if (log) log->Printf("Execution stopped with unexpected state: %s.", StateAsCString(stop_state)); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } if (keep_going) @@ -2956,7 +2956,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, { if (log) log->Printf ("got_event was true, but the event pointer was null. How odd..."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } } @@ -3019,7 +3019,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, if (log) log->Printf ("Process::RunThreadPlan(): Even though we timed out, the call plan was done. " "Exiting wait loop."); - return_value = lldb::eExecutionCompleted; + return_value = eExecutionCompleted; break; } @@ -3027,7 +3027,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, { if (log) log->Printf ("try_all_threads was false, we stopped so now we're quitting."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } @@ -3046,7 +3046,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, // Running all threads failed, so return Interrupted. if (log) log->Printf("Process::RunThreadPlan(): running all threads timed out."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } } @@ -3055,7 +3055,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, { if (log) log->Printf("Process::RunThreadPlan(): halt said it succeeded, but I got no event. " "I'm getting out of here passing Interrupted."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } } @@ -3075,7 +3075,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, // This is not going anywhere, bag out. if (log) log->Printf ("Process::RunThreadPlan(): halt failed: and waiting for the stopped event failed."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } else @@ -3093,7 +3093,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, if (log) log->Printf ("Process::RunThreadPlan(): Even though we timed out, the call plan was done. " "Exiting wait loop."); - return_value = lldb::eExecutionCompleted; + return_value = eExecutionCompleted; break; } @@ -3112,7 +3112,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, // Running all threads failed, so return Interrupted. if (log) log->Printf("Process::RunThreadPlan(): running all threads timed out."); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } } @@ -3120,7 +3120,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, { log->Printf ("Process::RunThreadPlan(): halt failed, I waited and didn't get" " a stopped event, instead got %s.", StateAsCString(stop_state)); - return_value = lldb::eExecutionInterrupted; + return_value = eExecutionInterrupted; break; } } @@ -3230,13 +3230,13 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, { if (log) log->Printf("Process::RunThreadPlan(): thread plan is done"); - return_value = lldb::eExecutionCompleted; + return_value = eExecutionCompleted; } else if (exe_ctx.thread->WasThreadPlanDiscarded (thread_plan_sp.get())) { if (log) log->Printf("Process::RunThreadPlan(): thread plan was discarded"); - return_value = lldb::eExecutionDiscarded; + return_value = eExecutionDiscarded; } else { @@ -3279,19 +3279,19 @@ Process::ExecutionResultAsCString (ExecutionResults result) switch (result) { - case lldb::eExecutionCompleted: + case eExecutionCompleted: result_name = "eExecutionCompleted"; break; - case lldb::eExecutionDiscarded: + case eExecutionDiscarded: result_name = "eExecutionDiscarded"; break; - case lldb::eExecutionInterrupted: + case eExecutionInterrupted: result_name = "eExecutionInterrupted"; break; - case lldb::eExecutionSetupError: + case eExecutionSetupError: result_name = "eExecutionSetupError"; break; - case lldb::eExecutionTimedOut: + case eExecutionTimedOut: result_name = "eExecutionTimedOut"; break; } @@ -3411,7 +3411,7 @@ ProcessInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_ const char *value, const ConstString &instance_name, const SettingEntry &entry, - lldb::VarSetOperationType op, + VarSetOperationType op, Error &err, bool pending) { diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 8cc0a725125..3dc11049f6c 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -1314,7 +1314,7 @@ Target::SettingsController::SetGlobalVariable (const ConstString &var_name, const char *index_value, const char *value, const SettingEntry &entry, - const lldb::VarSetOperationType op, + const VarSetOperationType op, Error&err) { if (var_name == GetSettingNameForDefaultArch()) @@ -1357,10 +1357,7 @@ TargetInstanceSettings::TargetInstanceSettings ) : InstanceSettings (owner, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance), m_expr_prefix_path (), - m_expr_prefix_contents (), - m_execution_level (eExecutionLevelAuto), - m_execution_mode (eExecutionModeAuto), - m_execution_os_type (eExecutionOSTypeAuto) + m_expr_prefix_contents () { // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called // until the vtables for TargetInstanceSettings are properly set up, i.e. AFTER all the initializers. @@ -1412,12 +1409,10 @@ TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_n const char *value, const ConstString &instance_name, const SettingEntry &entry, - lldb::VarSetOperationType op, + VarSetOperationType op, Error &err, bool pending) { - int new_enum = -1; - if (var_name == GetSettingNameForExpressionPrefix ()) { switch (op) @@ -1426,7 +1421,7 @@ TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_n err.SetErrorToGenericError (); err.SetErrorString ("Unrecognized operation. Cannot update value.\n"); return; - case lldb::eVarSetOperationAssign: + case eVarSetOperationAssign: { FileSpec file_spec(value, true); @@ -1450,34 +1445,16 @@ TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_n m_expr_prefix_contents.assign(reinterpret_cast<const char *>(data_sp->GetBytes()), data_sp->GetByteSize()); } return; - case lldb::eVarSetOperationAppend: + case eVarSetOperationAppend: err.SetErrorToGenericError (); err.SetErrorString ("Cannot append to a path.\n"); return; - case lldb::eVarSetOperationClear: + case eVarSetOperationClear: m_expr_prefix_path.clear (); m_expr_prefix_contents.clear (); return; } } - else if (var_name == GetSettingNameForExecutionLevel ()) - { - UserSettingsController::UpdateEnumVariable (entry.enum_values, &new_enum, value, err); - if (err.Success()) - m_execution_level = (ExecutionLevel)new_enum; - } - else if (var_name == GetSettingNameForExecutionMode ()) - { - UserSettingsController::UpdateEnumVariable (entry.enum_values, &new_enum, value, err); - if (err.Success()) - m_execution_mode = (ExecutionMode)new_enum; - } - else if (var_name == GetSettingNameForExecutionOSType ()) - { - UserSettingsController::UpdateEnumVariable (entry.enum_values, &new_enum, value, err); - if (err.Success()) - m_execution_os_type = (ExecutionOSType)new_enum; - } } void @@ -1490,9 +1467,6 @@ TargetInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &ne m_expr_prefix_path = new_settings_ptr->m_expr_prefix_path; m_expr_prefix_contents = new_settings_ptr->m_expr_prefix_contents; - m_execution_level = new_settings_ptr->m_execution_level; - m_execution_mode = new_settings_ptr->m_execution_mode; - m_execution_os_type = new_settings_ptr->m_execution_os_type; } bool @@ -1505,18 +1479,6 @@ TargetInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry, { value.AppendString (m_expr_prefix_path.c_str(), m_expr_prefix_path.size()); } - else if (var_name == GetSettingNameForExecutionLevel ()) - { - value.AppendString (UserSettingsController::EnumToString (entry.enum_values, m_execution_level)); - } - else if (var_name == GetSettingNameForExecutionMode ()) - { - value.AppendString (UserSettingsController::EnumToString (entry.enum_values, m_execution_mode)); - } - else if (var_name == GetSettingNameForExecutionOSType ()) - { - value.AppendString (UserSettingsController::EnumToString (entry.enum_values, m_execution_os_type)); - } else { if (err) @@ -1553,45 +1515,11 @@ Target::SettingsController::global_settings_table[] = { NULL , eSetVarTypeNone , NULL , NULL, false, false, NULL } }; -static lldb::OptionEnumValueElement -g_execution_level_enums[] = -{ - { eExecutionLevelAuto , "auto" , "Automatically detect the execution level (user/kernel)." }, - { eExecutionLevelKernel , "kernel" , "Treat executables as kernel executables." }, - { eExecutionLevelUser , "user" , "Treat executables as user space executables." }, - { 0 , NULL , NULL } -}; - -static lldb::OptionEnumValueElement -g_execution_mode_enums[] = -{ - { eExecutionModeAuto , "auto" , "Automatically detect the execution mode (static/dynamic)." }, - { eExecutionModeStatic , "static" , "All executables are static and addresses at the virtual addresses in the object files." }, - { eExecutionModeDynamic , "dynamic" , "Executables and shared libraries are dynamically loaded.." }, - { 0 , NULL , NULL } -}; - -static lldb::OptionEnumValueElement -g_execution_os_enums[] = -{ - { eExecutionOSTypeAuto , "auto" , "Automatically detect the execution OS (none/halted/live)." }, - { eExecutionOSTypeNone , "none" , "There is no operating system available (no processes or threads)." }, - { eExecutionOSTypeHalted, "halted" , "There is an operating system, but it is halted when the debugger is halted. " - "Processes and threads must be discovered by accessing symbols and reading " - "memory." }, - { eExecutionOSTypeLive , "live" , "There is a live operating system with debug services that can be used to " - "get processes, threads and theirs states." }, - { 0, NULL, NULL } -}; - SettingEntry Target::SettingsController::instance_settings_table[] = { - // var-name var-type default enum-table init'd hidden help-text - // ================= ================== =========== ========================= ====== ====== ========================================================================= - { TSC_EXPR_PREFIX , eSetVarTypeString , NULL , NULL , false, false, "Path to a file containing expressions to be prepended to all expressions." }, - { TSC_EXEC_LEVEL , eSetVarTypeEnum , "auto" , g_execution_level_enums , false, false, "Sets the execution level for a target." }, - { TSC_EXEC_MODE , eSetVarTypeEnum , "auto" , g_execution_mode_enums , false, false, "Sets the execution mode for a target." }, - { TSC_EXEC_OS_TYPE , eSetVarTypeEnum , "auto" , g_execution_os_enums , false, false, "Sets the execution OS for a target." }, - { NULL , eSetVarTypeNone , NULL , NULL , false, false, NULL } + // var-name var-type default enum init'd hidden help-text + // ================= ================== =========== ==== ====== ====== ========================================================================= + { TSC_EXPR_PREFIX , eSetVarTypeString , NULL , NULL, false, false, "Path to a file containing expressions to be prepended to all expressions." }, + { NULL , eSetVarTypeNone , NULL , NULL, false, false, NULL } }; diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 6c1dc40a7b7..95685e961f5 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -1190,7 +1190,7 @@ ThreadInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_n const char *value, const ConstString &instance_name, const SettingEntry &entry, - lldb::VarSetOperationType op, + VarSetOperationType op, Error &err, bool pending) { diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp index 3a54c5747d5..408395a199d 100644 --- a/lldb/source/Target/ThreadList.cpp +++ b/lldb/source/Target/ThreadList.cpp @@ -263,7 +263,7 @@ ThreadList::ShouldReportStop (Event *event_ptr) ThreadSP thread_sp(*pos); if (thread_sp->ThreadStoppedForAReason() && (thread_sp->GetResumeState () != eStateSuspended)) { - const lldb::Vote vote = thread_sp->ShouldReportStop (event_ptr); + const Vote vote = thread_sp->ShouldReportStop (event_ptr); if (log) log->Printf ("%s thread 0x%4.4x: pc = 0x%16.16llx, vote = %s", __FUNCTION__, diff --git a/lldb/source/Target/ThreadPlanStepOverRange.cpp b/lldb/source/Target/ThreadPlanStepOverRange.cpp index c7bffb97e8d..adade557f7a 100644 --- a/lldb/source/Target/ThreadPlanStepOverRange.cpp +++ b/lldb/source/Target/ThreadPlanStepOverRange.cpp @@ -110,8 +110,8 @@ ThreadPlanStepOverRange::ShouldStop (Event *event_ptr) NULL, true, stop_others, - lldb::eVoteNo, - lldb::eVoteNoOpinion, + eVoteNo, + eVoteNoOpinion, 0); } else if (!InSymbol()) |