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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128239 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index aa45992..d528d38 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -470,7 +470,7 @@
SymbolContextList sc_list;
- m_parser_vars->m_exe_ctx->target->GetImages().FindSymbolsWithNameAndType(name, lldb::eSymbolTypeAny, sc_list);
+ m_parser_vars->m_exe_ctx->target->GetImages().FindSymbolsWithNameAndType(name, eSymbolTypeAny, sc_list);
if (!sc_list.GetSize())
return false;
@@ -598,7 +598,7 @@
return false;
}
- lldb::RegisterInfo *register_info = location_value->GetRegisterInfo();
+ RegisterInfo *register_info = location_value->GetRegisterInfo();
if (!register_info)
{
@@ -990,7 +990,7 @@
var_sp->GetTypeFromUser().GetOpaqueQualType(),
var_sp->GetName(),
mem,
- lldb::eAddressTypeLoad,
+ eAddressTypeLoad,
pvar_byte_size));
}
@@ -1000,7 +1000,7 @@
return false;
}
- if (var_sp->m_live_sp->GetValue().GetValueAddressType() != lldb::eAddressTypeLoad)
+ if (var_sp->m_live_sp->GetValue().GetValueAddressType() != eAddressTypeLoad)
{
err.SetErrorStringWithFormat("The address of the memory area for %s is in an incorrect format", var_sp->GetName().GetCString());
return false;
@@ -1084,7 +1084,7 @@
var_sp->GetTypeFromUser().GetOpaqueQualType(),
var_sp->GetName(),
mem,
- lldb::eAddressTypeLoad,
+ eAddressTypeLoad,
pvar_byte_size));
// Clear the flag if the variable will never be deallocated.
@@ -1221,7 +1221,7 @@
lldb::addr_t mem; // The address of a spare memory area aused to hold the variable.
- lldb::RegisterInfo *register_info = location_value->GetRegisterInfo();
+ RegisterInfo *register_info = location_value->GetRegisterInfo();
if (!register_info)
{
@@ -1250,7 +1250,7 @@
return false;
}
- if (expr_var->m_live_sp->GetValue().GetValueAddressType() != lldb::eAddressTypeLoad)
+ if (expr_var->m_live_sp->GetValue().GetValueAddressType() != eAddressTypeLoad)
{
err.SetErrorStringWithFormat("The address of the memory area for %s is in an incorrect format", name.GetCString());
return false;
@@ -1348,7 +1348,7 @@
type.GetOpaqueQualType(),
name,
mem,
- lldb::eAddressTypeLoad,
+ eAddressTypeLoad,
value_byte_size));
// Now write the location of the area into the struct.
@@ -1432,7 +1432,7 @@
bool dematerialize,
ExecutionContext &exe_ctx,
RegisterContext ®_ctx,
- const lldb::RegisterInfo ®_info,
+ const RegisterInfo ®_info,
lldb::addr_t addr,
Error &err
)
@@ -1762,7 +1762,7 @@
if (m_parser_vars->m_exe_ctx->GetRegisterContext())
{
- const lldb::RegisterInfo *reg_info(m_parser_vars->m_exe_ctx->GetRegisterContext()->GetRegisterInfoByName(reg_name));
+ const RegisterInfo *reg_info(m_parser_vars->m_exe_ctx->GetRegisterContext()->GetRegisterInfoByName(reg_name));
if (reg_info)
AddOneRegister(context, reg_info);
diff --git a/source/Expression/ClangExpressionParser.cpp b/source/Expression/ClangExpressionParser.cpp
index e228cc5..e9e49e3 100644
--- a/source/Expression/ClangExpressionParser.cpp
+++ b/source/Expression/ClangExpressionParser.cpp
@@ -214,7 +214,7 @@
{
if (process->GetObjCLanguageRuntime())
{
- if (process->GetObjCLanguageRuntime()->GetRuntimeVersion() == lldb::eAppleObjC_V2)
+ if (process->GetObjCLanguageRuntime()->GetRuntimeVersion() == eAppleObjC_V2)
{
m_compiler->getLangOpts().ObjCNonFragileABI = true; // NOT i386
m_compiler->getLangOpts().ObjCNonFragileABI2 = true; // NOT i386
diff --git a/source/Expression/ClangExpressionVariable.cpp b/source/Expression/ClangExpressionVariable.cpp
index bf1a3da..c5bc5c4 100644
--- a/source/Expression/ClangExpressionVariable.cpp
+++ b/source/Expression/ClangExpressionVariable.cpp
@@ -62,16 +62,16 @@
return m_frozen_sp;
}
-lldb::RegisterInfo *
+RegisterInfo *
ClangExpressionVariable::GetRegisterInfo()
{
return m_frozen_sp->GetValue().GetRegisterInfo();
}
void
-ClangExpressionVariable::SetRegisterInfo (const lldb::RegisterInfo *reg_info)
+ClangExpressionVariable::SetRegisterInfo (const RegisterInfo *reg_info)
{
- return m_frozen_sp->GetValue().SetContext (Value::eContextTypeRegisterInfo, const_cast<lldb::RegisterInfo *>(reg_info));
+ return m_frozen_sp->GetValue().SetContext (Value::eContextTypeRegisterInfo, const_cast<RegisterInfo *>(reg_info));
}
lldb::clang_type_t
diff --git a/source/Expression/ClangFunction.cpp b/source/Expression/ClangFunction.cpp
index c3a3657..9d7f754 100644
--- a/source/Expression/ClangFunction.cpp
+++ b/source/Expression/ClangFunction.cpp
@@ -286,7 +286,7 @@
Error error;
using namespace clang;
- lldb::ExecutionResults return_value = lldb::eExecutionSetupError;
+ ExecutionResults return_value = eExecutionSetupError;
Process *process = exe_ctx.process;
@@ -461,13 +461,13 @@
exe_ctx.process->DeallocateMemory(args_addr);
}
-lldb::ExecutionResults
+ExecutionResults
ClangFunction::ExecuteFunction(ExecutionContext &exe_ctx, Stream &errors, Value &results)
{
return ExecuteFunction (exe_ctx, errors, 1000, true, results);
}
-lldb::ExecutionResults
+ExecutionResults
ClangFunction::ExecuteFunction(ExecutionContext &exe_ctx, Stream &errors, bool stop_others, Value &results)
{
const bool try_all_threads = false;
@@ -475,7 +475,7 @@
return ExecuteFunction (exe_ctx, NULL, errors, stop_others, NULL, try_all_threads, discard_on_error, results);
}
-lldb::ExecutionResults
+ExecutionResults
ClangFunction::ExecuteFunction(
ExecutionContext &exe_ctx,
Stream &errors,
@@ -490,7 +490,7 @@
}
// This is the static function
-lldb::ExecutionResults
+ExecutionResults
ClangFunction::ExecuteFunction (
ExecutionContext &exe_ctx,
lldb::addr_t function_address,
@@ -506,7 +506,7 @@
errors, stop_others, discard_on_error,
this_arg));
if (call_plan_sp == NULL)
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
call_plan_sp->SetPrivate(true);
@@ -514,7 +514,7 @@
single_thread_timeout_usec, errors);
}
-lldb::ExecutionResults
+ExecutionResults
ClangFunction::ExecuteFunction(
ExecutionContext &exe_ctx,
lldb::addr_t *args_addr_ptr,
@@ -526,7 +526,7 @@
Value &results)
{
using namespace clang;
- lldb::ExecutionResults return_value = lldb::eExecutionSetupError;
+ ExecutionResults return_value = eExecutionSetupError;
lldb::addr_t args_addr;
@@ -536,12 +536,12 @@
args_addr = LLDB_INVALID_ADDRESS;
if (CompileFunction(errors) != 0)
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
if (args_addr == LLDB_INVALID_ADDRESS)
{
if (!InsertFunction(exe_ctx, args_addr, errors))
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
}
return_value = ClangFunction::ExecuteFunction (exe_ctx,
@@ -556,7 +556,7 @@
if (args_addr_ptr != NULL)
*args_addr_ptr = args_addr;
- if (return_value != lldb::eExecutionCompleted)
+ if (return_value != eExecutionCompleted)
return return_value;
FetchFunctionResults(exe_ctx, args_addr, results);
@@ -564,7 +564,7 @@
if (args_addr_ptr == NULL)
DeallocateFunctionResults(exe_ctx, args_addr);
- return lldb::eExecutionCompleted;
+ return eExecutionCompleted;
}
clang::ASTConsumer *
diff --git a/source/Expression/ClangUserExpression.cpp b/source/Expression/ClangUserExpression.cpp
index 715677e..dda810e 100644
--- a/source/Expression/ClangUserExpression.cpp
+++ b/source/Expression/ClangUserExpression.cpp
@@ -453,7 +453,7 @@
return true;
}
-lldb::ExecutionResults
+ExecutionResults
ClangUserExpression::Execute (Stream &error_stream,
ExecutionContext &exe_ctx,
bool discard_on_error,
@@ -471,7 +471,7 @@
error_stream.Printf("We don't currently support executing DWARF expressions");
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
}
else if (m_jit_start_addr != LLDB_INVALID_ADDRESS)
{
@@ -481,7 +481,7 @@
lldb::addr_t cmd_ptr = NULL;
if (!PrepareToExecuteJITExpression (error_stream, exe_ctx, struct_address, object_ptr, cmd_ptr))
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
const bool stop_others = true;
const bool try_all_threads = true;
@@ -497,7 +497,7 @@
shared_ptr_to_me));
if (call_plan_sp == NULL || !call_plan_sp->ValidatePlan (NULL))
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
call_plan_sp->SetPrivate(true);
@@ -506,7 +506,7 @@
if (log)
log->Printf("-- [ClangUserExpression::Execute] Execution of expression begins --");
- lldb::ExecutionResults execution_result = exe_ctx.process->RunThreadPlan (exe_ctx,
+ ExecutionResults execution_result = exe_ctx.process->RunThreadPlan (exe_ctx,
call_plan_sp,
stop_others,
try_all_threads,
@@ -517,7 +517,7 @@
if (log)
log->Printf("-- [ClangUserExpression::Execute] Execution of expression completed --");
- if (execution_result == lldb::eExecutionInterrupted)
+ if (execution_result == eExecutionInterrupted)
{
if (discard_on_error)
error_stream.Printf ("Expression execution was interrupted. The process has been returned to the state before execution.");
@@ -526,21 +526,21 @@
return execution_result;
}
- else if (execution_result != lldb::eExecutionCompleted)
+ else if (execution_result != eExecutionCompleted)
{
error_stream.Printf ("Couldn't execute function; result was %s\n", Process::ExecutionResultAsCString (execution_result));
return execution_result;
}
if (FinalizeJITExecution (error_stream, exe_ctx, result))
- return lldb::eExecutionCompleted;
+ return eExecutionCompleted;
else
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
}
else
{
error_stream.Printf("Expression can't be run; neither DWARF nor a JIT compiled function is present");
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
}
}
@@ -553,7 +553,7 @@
return *m_dwarf_opcodes.get();
}
-lldb::ExecutionResults
+ExecutionResults
ClangUserExpression::Evaluate (ExecutionContext &exe_ctx,
bool discard_on_error,
bool keep_in_memory,
@@ -564,14 +564,14 @@
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
Error error;
- lldb::ExecutionResults execution_results = lldb::eExecutionSetupError;
+ ExecutionResults execution_results = eExecutionSetupError;
if (exe_ctx.process == NULL)
{
error.SetErrorString ("Must have a process to evaluate expressions.");
result_valobj_sp.reset (new ValueObjectConstResult (error));
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
}
if (!exe_ctx.process->GetDynamicCheckers())
@@ -591,7 +591,7 @@
error.SetErrorString (install_errors.GetString().c_str());
result_valobj_sp.reset (new ValueObjectConstResult (error));
- return lldb::eExecutionSetupError;
+ return eExecutionSetupError;
}
exe_ctx.process->SetDynamicCheckers(dynamic_checkers);
@@ -641,7 +641,7 @@
user_expression_sp,
expr_result);
- if (execution_results != lldb::eExecutionCompleted)
+ if (execution_results != eExecutionCompleted)
{
if (log)
log->Printf("== [ClangUserExpression::Evaluate] Execution completed abnormally ==");
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 2b7832e..09d66fd 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -588,8 +588,8 @@
}
else
{
- if (m_data.GetAddressByteSize() == 4 && begin_addr_offset == 0xFFFFFFFFull ||
- m_data.GetAddressByteSize() == 8 && begin_addr_offset == 0xFFFFFFFFFFFFFFFFull)
+ if ((m_data.GetAddressByteSize() == 4 && (begin_addr_offset == UINT32_MAX)) ||
+ (m_data.GetAddressByteSize() == 8 && (begin_addr_offset == UINT64_MAX)))
{
curr_base_addr = end_addr_offset + location_list_base_addr;
// We have a new base address
@@ -2388,7 +2388,7 @@
case Value::eValueTypeLoadAddress:
case Value::eValueTypeHostAddress:
{
- lldb::AddressType address_type = (value_type == Value::eValueTypeLoadAddress ? eAddressTypeLoad : eAddressTypeHost);
+ AddressType address_type = (value_type == Value::eValueTypeLoadAddress ? eAddressTypeLoad : eAddressTypeHost);
lldb::addr_t addr = stack.back().GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
if (!ClangASTType::WriteToMemory (ast_context,
clang_type,