Enabled extra warnings and fixed a bunch of small issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectFrame.cpp b/source/Commands/CommandObjectFrame.cpp
index 3d9d819..0d955b3 100644
--- a/source/Commands/CommandObjectFrame.cpp
+++ b/source/Commands/CommandObjectFrame.cpp
@@ -629,7 +629,7 @@
{
for (uint32_t i=0; i<num_variables; i++)
{
- VariableSP var_sp (variable_list->GetVariableAtIndex(i));
+ var_sp = variable_list->GetVariableAtIndex(i);
bool dump_variable = true;
switch (var_sp->GetScope())
diff --git a/source/Core/DataExtractor.cpp b/source/Core/DataExtractor.cpp
index e6c8a4d..2c80541 100644
--- a/source/Core/DataExtractor.cpp
+++ b/source/Core/DataExtractor.cpp
@@ -1253,7 +1253,7 @@
// earlier C++ libraries
std::string binary_value(64, '0');
std::bitset<64> bits(uval64);
- for (size_t i = 0; i < 64; ++i)
+ for (i = 0; i < 64; ++i)
if (bits[i])
binary_value[64 - 1 - i] = '1';
if (item_bit_size > 0)
diff --git a/source/Core/Value.cpp b/source/Core/Value.cpp
index ce6a95b..41483c7 100644
--- a/source/Core/Value.cpp
+++ b/source/Core/Value.cpp
@@ -142,6 +142,26 @@
}
}
+Value &
+Value::operator=(const Value &rhs)
+{
+ if (this != &rhs)
+ {
+ m_value = rhs.m_value;
+ m_value_type = rhs.m_value_type;
+ m_context = rhs.m_context;
+ m_context_type = rhs.m_context_type;
+ if ((uintptr_t)rhs.m_value.ULongLong(LLDB_INVALID_ADDRESS) == (uintptr_t)rhs.m_data_buffer.GetBytes())
+ {
+ m_data_buffer.CopyData(rhs.m_data_buffer.GetBytes(),
+ rhs.m_data_buffer.GetByteSize());
+
+ m_value = (uintptr_t)m_data_buffer.GetBytes();
+ }
+ }
+ return *this;
+}
+
Value *
Value::CreateProxy()
{
@@ -653,17 +673,17 @@
{
// Resolve the proxy
- Value * v = (Value*)m_context;
+ Value * rhs = (Value*)m_context;
- m_value = v->m_value;
- m_value_type = v->m_value_type;
- m_context = v->m_context;
- m_context_type = v->m_context_type;
+ m_value = rhs->m_value;
+ m_value_type = rhs->m_value_type;
+ m_context = rhs->m_context;
+ m_context_type = rhs->m_context_type;
- if ((uintptr_t)v->m_value.ULongLong(LLDB_INVALID_ADDRESS) == (uintptr_t)v->m_data_buffer.GetBytes())
+ if ((uintptr_t)rhs->m_value.ULongLong(LLDB_INVALID_ADDRESS) == (uintptr_t)rhs->m_data_buffer.GetBytes())
{
- m_data_buffer.CopyData(v->m_data_buffer.GetBytes(),
- v->m_data_buffer.GetByteSize());
+ m_data_buffer.CopyData(rhs->m_data_buffer.GetBytes(),
+ rhs->m_data_buffer.GetByteSize());
m_value = (uintptr_t)m_data_buffer.GetBytes();
}
diff --git a/source/Core/ValueObjectVariable.cpp b/source/Core/ValueObjectVariable.cpp
index bcf4206..f73ce64 100644
--- a/source/Core/ValueObjectVariable.cpp
+++ b/source/Core/ValueObjectVariable.cpp
@@ -118,7 +118,7 @@
loclist_base_load_addr = sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (exe_ctx.target);
}
Value old_value(m_value);
- if (expr.Evaluate (&exe_ctx, GetClangAST(), NULL, loclist_base_load_addr, NULL, m_value, &m_error))
+ if (expr.Evaluate (&exe_ctx, GetClangAST(), NULL, NULL, NULL, loclist_base_load_addr, NULL, m_value, &m_error))
{
m_value.SetContext(Value::eContextTypeVariable, variable);
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index f996242..5c377cf 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -1402,17 +1402,15 @@
{
uint32_t register_number = reg_info.kinds[lldb::eRegisterKindLLDB];
uint32_t register_byte_size = reg_info.byte_size;
-
- Error error;
-
+
if (dematerialize)
{
DataBufferHeap register_data (register_byte_size, 0);
- Error error;
- if (exe_ctx.process->ReadMemory (addr, register_data.GetBytes(), register_byte_size, error) != register_byte_size)
+ Error read_error;
+ if (exe_ctx.process->ReadMemory (addr, register_data.GetBytes(), register_byte_size, read_error) != register_byte_size)
{
- err.SetErrorStringWithFormat ("Couldn't read %s from the target: %s", reg_info.name, error.AsCString());
+ err.SetErrorStringWithFormat ("Couldn't read %s from the target: %s", reg_info.name, read_error.AsCString());
return false;
}
@@ -1801,7 +1799,7 @@
}
Error err;
- if (!var_location_expr.Evaluate(&exe_ctx, ast, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err))
+ if (!var_location_expr.Evaluate(&exe_ctx, ast, NULL, NULL, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err))
{
if (log)
log->Printf("Error evaluating location: %s", err.AsCString());
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 7114518..1679c8d 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -217,18 +217,14 @@
DWARFExpression::DWARFExpression() :
m_data(),
m_reg_kind (eRegisterKindDWARF),
- m_loclist_slide (LLDB_INVALID_ADDRESS),
- m_expr_locals (NULL),
- m_decl_map (NULL)
+ m_loclist_slide (LLDB_INVALID_ADDRESS)
{
}
DWARFExpression::DWARFExpression(const DWARFExpression& rhs) :
m_data(rhs.m_data),
m_reg_kind (rhs.m_reg_kind),
- m_loclist_slide(rhs.m_loclist_slide),
- m_expr_locals (rhs.m_expr_locals),
- m_decl_map (rhs.m_decl_map)
+ m_loclist_slide(rhs.m_loclist_slide)
{
}
@@ -236,9 +232,7 @@
DWARFExpression::DWARFExpression(const DataExtractor& data, uint32_t data_offset, uint32_t data_length) :
m_data(data, data_offset, data_length),
m_reg_kind (eRegisterKindDWARF),
- m_loclist_slide(LLDB_INVALID_ADDRESS),
- m_expr_locals (NULL),
- m_decl_map (NULL)
+ m_loclist_slide(LLDB_INVALID_ADDRESS)
{
}
@@ -256,19 +250,6 @@
return m_data.GetByteSize() > 0;
}
-
-void
-DWARFExpression::SetExpressionLocalVariableList (ClangExpressionVariableList *locals)
-{
- m_expr_locals = locals;
-}
-
-void
-DWARFExpression::SetExpressionDeclMap (ClangExpressionDeclMap *decl_map)
-{
- m_decl_map = decl_map;
-}
-
void
DWARFExpression::SetOpcodeData (const DataExtractor& data)
{
@@ -749,6 +730,8 @@
(
ExecutionContextScope *exe_scope,
clang::ASTContext *ast_context,
+ ClangExpressionVariableList *expr_locals,
+ ClangExpressionDeclMap *decl_map,
lldb::addr_t loclist_base_load_addr,
const Value* initial_value_ptr,
Value& result,
@@ -756,7 +739,7 @@
) const
{
ExecutionContext exe_ctx (exe_scope);
- return Evaluate(&exe_ctx, ast_context, NULL, loclist_base_load_addr, initial_value_ptr, result, error_ptr);
+ return Evaluate(&exe_ctx, ast_context, expr_locals, decl_map, NULL, loclist_base_load_addr, initial_value_ptr, result, error_ptr);
}
bool
@@ -764,6 +747,8 @@
(
ExecutionContext *exe_ctx,
clang::ASTContext *ast_context,
+ ClangExpressionVariableList *expr_locals,
+ ClangExpressionDeclMap *decl_map,
RegisterContext *reg_ctx,
lldb::addr_t loclist_base_load_addr,
const Value* initial_value_ptr,
@@ -809,7 +794,7 @@
if (length > 0 && lo_pc <= pc && pc < hi_pc)
{
- return DWARFExpression::Evaluate (exe_ctx, ast_context, m_data, m_expr_locals, m_decl_map, reg_ctx, offset, length, m_reg_kind, initial_value_ptr, result, error_ptr);
+ return DWARFExpression::Evaluate (exe_ctx, ast_context, expr_locals, decl_map, reg_ctx, m_data, offset, length, m_reg_kind, initial_value_ptr, result, error_ptr);
}
offset += length;
}
@@ -821,7 +806,7 @@
}
// Not a location list, just a single expression.
- return DWARFExpression::Evaluate (exe_ctx, ast_context, m_data, m_expr_locals, m_decl_map, reg_ctx, 0, m_data.GetByteSize(), m_reg_kind, initial_value_ptr, result, error_ptr);
+ return DWARFExpression::Evaluate (exe_ctx, ast_context, expr_locals, decl_map, reg_ctx, m_data, 0, m_data.GetByteSize(), m_reg_kind, initial_value_ptr, result, error_ptr);
}
@@ -831,10 +816,10 @@
(
ExecutionContext *exe_ctx,
clang::ASTContext *ast_context,
- const DataExtractor& opcodes,
ClangExpressionVariableList *expr_locals,
ClangExpressionDeclMap *decl_map,
RegisterContext *reg_ctx,
+ const DataExtractor& opcodes,
const uint32_t opcodes_offset,
const uint32_t opcodes_length,
const uint32_t reg_kind,
diff --git a/source/Expression/IRDynamicChecks.cpp b/source/Expression/IRDynamicChecks.cpp
index a59ac64..e0284c7 100644
--- a/source/Expression/IRDynamicChecks.cpp
+++ b/source/Expression/IRDynamicChecks.cpp
@@ -127,6 +127,10 @@
{
}
+ virtual~Instrumenter ()
+ {
+ }
+
//------------------------------------------------------------------
/// Inspect a function to find instructions to instrument
///
@@ -287,12 +291,16 @@
class ValidPointerChecker : public Instrumenter
{
public:
- ValidPointerChecker(llvm::Module &module,
- DynamicCheckerFunctions &checker_functions) :
+ ValidPointerChecker (llvm::Module &module,
+ DynamicCheckerFunctions &checker_functions) :
Instrumenter(module, checker_functions),
m_valid_pointer_check_func(NULL)
{
}
+
+ virtual ~ValidPointerChecker ()
+ {
+ }
private:
bool InstrumentInstruction(llvm::Instruction *inst)
{
@@ -356,6 +364,12 @@
m_objc_object_check_func(NULL)
{
}
+
+ virtual
+ ~ObjcObjectChecker ()
+ {
+ }
+
private:
bool InstrumentInstruction(llvm::Instruction *inst)
{
diff --git a/source/Interpreter/ScriptInterpreterPython.cpp b/source/Interpreter/ScriptInterpreterPython.cpp
index aafef87..224ea7f 100644
--- a/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/source/Interpreter/ScriptInterpreterPython.cpp
@@ -1293,7 +1293,6 @@
&& python_function_name[0] != '\0')
{
Thread *thread = context->exe_ctx.thread;
- Target *target = context->exe_ctx.target;
const StackFrameSP stop_frame_sp = thread->GetStackFrameSPForStackFramePtr (context->exe_ctx.frame);
BreakpointSP breakpoint_sp = target->GetBreakpointByID (break_id);
const BreakpointLocationSP bp_loc_sp = breakpoint_sp->FindLocationByID (break_loc_id);
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
index 9733a99..25fc480 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
@@ -344,11 +344,10 @@
eSymbolTypeData);
if (trampoline_symbol != NULL)
{
- const Address &temp_address = trampoline_symbol->GetValue();
- if (!temp_address.IsValid())
+ if (!trampoline_symbol->GetValue().IsValid())
return false;
- m_trampoline_header = temp_address.GetLoadAddress(&target);
+ m_trampoline_header = trampoline_symbol->GetValue().GetLoadAddress(&target);
if (m_trampoline_header == LLDB_INVALID_ADDRESS)
return false;
@@ -358,11 +357,10 @@
eSymbolTypeCode);
if (changed_symbol != NULL)
{
- const Address &temp_address = changed_symbol->GetValue();
- if (!temp_address.IsValid())
+ if (!changed_symbol->GetValue().IsValid())
return false;
- lldb::addr_t changed_addr = temp_address.GetLoadAddress(&target);
+ lldb::addr_t changed_addr = changed_symbol->GetValue().GetLoadAddress(&target);
if (changed_addr != LLDB_INVALID_ADDRESS)
{
BreakpointSP trampolines_changed_bp_sp = target.CreateBreakpoint (changed_addr,
diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 7b045ab..1d8ff3b 100644
--- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -202,11 +202,11 @@
Symtab *
ObjectFileMachO::GetSymtab()
{
- lldb_private::Mutex::Locker locker(m_mutex);
+ lldb_private::Mutex::Locker symfile_locker(m_mutex);
if (m_symtab_ap.get() == NULL)
{
m_symtab_ap.reset(new Symtab(this));
- Mutex::Locker locker (m_symtab_ap->GetMutex());
+ Mutex::Locker symtab_locker (m_symtab_ap->GetMutex());
ParseSymtab (true);
}
return m_symtab_ap.get();
diff --git a/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp b/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp
index 9b5847d..5ceedc0 100644
--- a/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp
+++ b/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_arm.cpp
@@ -133,7 +133,7 @@
void
MachThreadContext_arm::RefreshStateAfterStop ()
{
- EnableHardwareSingleStep (false) == KERN_SUCCESS;
+ EnableHardwareSingleStep (false);
}
#if defined (ENABLE_ARM_SINGLE_STEP)
diff --git a/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp b/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp
index f4c86c4..2289331 100644
--- a/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp
+++ b/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp
@@ -89,12 +89,10 @@
{
// Try see if there already is a log - that way we can reuse its settings.
// We could reuse the log in toto, but we don't know that the stream is the same.
- uint32_t flag_bits;
+ uint32_t flag_bits = 0;
LogSP log(GetLog ());
if (log)
flag_bits = log->GetMask().Get();
- else
- flag_bits = 0;
// Now make a new log with this stream if one was provided
if (log_stream_sp)
@@ -105,7 +103,6 @@
if (log)
{
- uint32_t flag_bits = 0;
bool got_unknown_category = false;
const size_t argc = args.GetArgumentCount();
for (size_t i=0; i<argc; ++i)
diff --git a/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index 096ab1a..c23c0b9 100644
--- a/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1032,7 +1032,7 @@
ExecutionContext exe_ctx (&m_thread.GetProcess(), &m_thread, NULL);
Value result;
Error error;
- if (dwarfexpr.Evaluate (&exe_ctx, NULL, this, 0, NULL, result, &error))
+ if (dwarfexpr.Evaluate (&exe_ctx, NULL, NULL, NULL, this, 0, NULL, result, &error))
{
addr_t val;
val = result.GetScalar().ULongLong();
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index d83fb58..6ec7dab 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1098,13 +1098,13 @@
gdb_thread->SetName (thread_name.empty() ? thread_name.c_str() : NULL);
if (exc_type != 0)
{
- const size_t exc_data_count = exc_data.size();
+ const size_t exc_data_size = exc_data.size();
gdb_thread->SetStopInfo (StopInfoMachException::CreateStopReasonWithMachException (*thread_sp,
exc_type,
- exc_data_count,
- exc_data_count >= 1 ? exc_data[0] : 0,
- exc_data_count >= 2 ? exc_data[1] : 0));
+ exc_data_size,
+ exc_data_size >= 1 ? exc_data[0] : 0,
+ exc_data_size >= 2 ? exc_data[1] : 0));
}
else if (signo)
{
@@ -1230,7 +1230,7 @@
timeout_time.OffsetWithSeconds(5);
StateType state = WaitForStateChangedEventsPrivate (&timeout_time, stop_event_sp);
- const bool timed_out = state == eStateInvalid;
+ timed_out = state == eStateInvalid;
if (log)
log->Printf ("ProcessGDBRemote::InterruptIfRunning() catch stop event: state = %s, timed-out=%i", StateAsCString(state), timed_out);
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
index 044edd0..0c019bf 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
@@ -96,12 +96,10 @@
{
// Try see if there already is a log - that way we can reuse its settings.
// We could reuse the log in toto, but we don't know that the stream is the same.
- uint32_t flag_bits;
+ uint32_t flag_bits = 0;
LogSP log(GetLog ());
if (log)
flag_bits = log->GetMask().Get();
- else
- flag_bits = 0;
// Now make a new log with this stream if one was provided
if (log_stream_sp)
@@ -112,7 +110,6 @@
if (log)
{
- uint32_t flag_bits = 0;
bool got_unknown_category = false;
const size_t argc = args.GetArgumentCount();
for (size_t i=0; i<argc; ++i)
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
index d1e4242..25ccfcf 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -639,11 +639,9 @@
const size_t num_attributes = die.GetAttributes(m_dwarf2Data, this, fixed_form_sizes, attributes);
if (num_attributes > 0)
{
- uint32_t i;
-
is_variable = tag == DW_TAG_variable;
- for (i=0; i<num_attributes; ++i)
+ for (uint32_t i=0; i<num_attributes; ++i)
{
dw_attr_t attr = attributes.AttributeAtIndex(i);
DWARFFormValue form_value;
@@ -767,7 +765,7 @@
}
else
{
- for (size_t i=0, num_ranges = ranges.Size(); i<num_ranges; ++i)
+ for (uint32_t i=0, num_ranges = ranges.Size(); i<num_ranges; ++i)
{
const DWARFDebugRanges::Range *range = ranges.RangeAtIndex (i);
aranges->AppendRange (m_offset, range->begin_offset, range->end_offset);
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index d80edfb..f778f45 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1272,10 +1272,10 @@
uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
if (DWARFExpression::Evaluate (NULL,
NULL,
- debug_info_data,
NULL,
NULL,
NULL,
+ debug_info_data,
block_offset,
block_length,
eRegisterKindDWARF,
@@ -2882,14 +2882,14 @@
// DIE and we want to try and find a type that has the complete definition.
TypeSP
SymbolFileDWARF::FindDefinitionTypeForDIE (
- DWARFCompileUnit* curr_cu,
+ DWARFCompileUnit* cu,
const DWARFDebugInfoEntry *die,
const ConstString &type_name
)
{
TypeSP type_sp;
- if (curr_cu == NULL || die == NULL || !type_name)
+ if (cu == NULL || die == NULL || !type_name)
return type_sp;
if (!m_indexed)
@@ -2901,7 +2901,7 @@
if (num_matches > 0)
{
DWARFCompileUnit* type_cu = NULL;
- DWARFCompileUnit* curr_cu = curr_cu;
+ DWARFCompileUnit* curr_cu = cu;
DWARFDebugInfo *info = DebugInfo();
for (size_t i=0; i<num_matches; ++i)
{
@@ -3362,8 +3362,8 @@
ast.StartTagDeclarationDefinition (clang_type);
if (die->HasChildren())
{
- SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
- ParseChildEnumerators(sc, clang_type, type_sp->GetByteSize(), dwarf_cu, die);
+ SymbolContext cu_sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
+ ParseChildEnumerators(cu_sc, clang_type, type_sp->GetByteSize(), dwarf_cu, die);
}
ast.CompleteTagDeclarationDefinition (clang_type);
#endif
@@ -3396,7 +3396,7 @@
uint32_t i;
for (i=0; i<num_attributes; ++i)
{
- const dw_attr_t attr = attributes.AttributeAtIndex(i);
+ attr = attributes.AttributeAtIndex(i);
DWARFFormValue form_value;
if (attributes.ExtractFormValueAtIndex(this, i, form_value))
{
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 7e68a63..3edbf8a 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -3909,7 +3909,7 @@
return NULL;
}
-size_t
+uint32_t
ClangASTContext::GetPointerBitSize ()
{
ASTContext *ast = getASTContext();
diff --git a/source/Symbol/ClangASTType.cpp b/source/Symbol/ClangASTType.cpp
index de559fd..328c7b4 100644
--- a/source/Symbol/ClangASTType.cpp
+++ b/source/Symbol/ClangASTType.cpp
@@ -859,13 +859,13 @@
}
}
-uint64_t
+uint32_t
ClangASTType::GetClangTypeBitWidth ()
{
return GetClangTypeBitWidth (m_ast, m_type);
}
-uint64_t
+uint32_t
ClangASTType::GetClangTypeBitWidth (clang::ASTContext *ast_context, clang_type_t clang_type)
{
if (ast_context && clang_type)
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index 0590a1d..b22ddbf 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -27,16 +27,17 @@
#include "lldb/Target/Process.h"
using namespace lldb;
+using namespace lldb_private;
-lldb_private::Type::Type
+Type::Type
(
lldb::user_id_t uid,
SymbolFile* symbol_file,
const ConstString &name,
uint32_t byte_size,
SymbolContextScope *context,
- uintptr_t encoding_data,
- EncodingDataType encoding_data_type,
+ user_id_t encoding_uid,
+ EncodingDataType encoding_uid_type,
const Declaration& decl,
clang_type_t clang_type,
ResolveState clang_type_resolve_state
@@ -46,8 +47,8 @@
m_symbol_file (symbol_file),
m_context (context),
m_encoding_type (NULL),
- m_encoding_uid_type (encoding_data_type),
- m_encoding_uid (encoding_data),
+ m_encoding_uid (encoding_uid),
+ m_encoding_uid_type (encoding_uid_type),
m_byte_size (byte_size),
m_decl (decl),
m_clang_type (clang_type),
@@ -55,7 +56,7 @@
{
}
-lldb_private::Type::Type () :
+Type::Type () :
UserID (0),
m_name ("<INVALID TYPE>"),
m_symbol_file (NULL),
@@ -71,29 +72,33 @@
}
-const lldb_private::Type&
-lldb_private::Type::operator= (const Type& rhs)
+Type::Type (const Type &rhs) :
+ UserID (rhs),
+ m_name (rhs.m_name),
+ m_symbol_file (rhs.m_symbol_file),
+ m_context (rhs.m_context),
+ m_encoding_type (rhs.m_encoding_type),
+ m_encoding_uid_type (rhs.m_encoding_uid_type),
+ m_encoding_uid (rhs.m_encoding_uid),
+ m_byte_size (rhs.m_byte_size),
+ m_decl (rhs.m_decl),
+ m_clang_type (rhs.m_clang_type),
+ m_clang_type_resolve_state (rhs.m_clang_type_resolve_state)
+{
+}
+
+const Type&
+Type::operator= (const Type& rhs)
{
if (this != &rhs)
{
- UserID::operator= (rhs);
- m_name = rhs.m_name;
- m_symbol_file = rhs.m_symbol_file;
- m_context = rhs.m_context;
- m_encoding_type = rhs.m_encoding_type;
- m_encoding_uid_type = rhs.m_encoding_uid_type;
- m_encoding_uid = rhs.m_encoding_uid;
- m_byte_size = rhs.m_byte_size;
- m_decl = rhs.m_decl;
- m_clang_type = rhs.m_clang_type;
- m_clang_type_resolve_state = rhs.m_clang_type_resolve_state;
}
return *this;
}
void
-lldb_private::Type::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name)
+Type::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_name)
{
*s << "id = " << (const UserID&)*this;
@@ -133,7 +138,7 @@
void
-lldb_private::Type::Dump (Stream *s, bool show_context)
+Type::Dump (Stream *s, bool show_context)
{
s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
@@ -183,8 +188,8 @@
s->EOL();
}
-const lldb_private::ConstString &
-lldb_private::Type::GetName()
+const ConstString &
+Type::GetName()
{
if (!(m_name))
{
@@ -199,18 +204,18 @@
}
void
-lldb_private::Type::DumpTypeName(Stream *s)
+Type::DumpTypeName(Stream *s)
{
GetName().Dump(s, "<invalid-type-name>");
}
void
-lldb_private::Type::DumpValue
+Type::DumpValue
(
- lldb_private::ExecutionContext *exe_ctx,
- lldb_private::Stream *s,
- const lldb_private::DataExtractor &data,
+ ExecutionContext *exe_ctx,
+ Stream *s,
+ const DataExtractor &data,
uint32_t data_byte_offset,
bool show_types,
bool show_summary,
@@ -229,7 +234,7 @@
s->PutCString(") ");
}
- lldb_private::ClangASTType::DumpValue (GetClangAST (),
+ ClangASTType::DumpValue (GetClangAST (),
m_clang_type,
exe_ctx,
s,
@@ -246,8 +251,8 @@
}
}
-lldb_private::Type *
-lldb_private::Type::GetEncodingType ()
+Type *
+Type::GetEncodingType ()
{
if (m_encoding_type == NULL && m_encoding_uid != LLDB_INVALID_UID)
m_encoding_type = m_symbol_file->ResolveTypeUID(m_encoding_uid);
@@ -256,8 +261,8 @@
-uint64_t
-lldb_private::Type::GetByteSize()
+uint32_t
+Type::GetByteSize()
{
if (m_byte_size == 0)
{
@@ -274,7 +279,7 @@
m_byte_size = encoding_type->GetByteSize();
if (m_byte_size == 0)
{
- uint64_t bit_width = ClangASTType::GetClangTypeBitWidth (GetClangAST(), GetClangLayoutType());
+ uint32_t bit_width = ClangASTType::GetClangTypeBitWidth (GetClangAST(), GetClangLayoutType());
m_byte_size = (bit_width + 7 ) / 8;
}
}
@@ -293,7 +298,7 @@
uint32_t
-lldb_private::Type::GetNumChildren (bool omit_empty_base_classes)
+Type::GetNumChildren (bool omit_empty_base_classes)
{
if (ResolveClangType(eResolveStateForward))
{
@@ -305,7 +310,7 @@
}
bool
-lldb_private::Type::IsAggregateType ()
+Type::IsAggregateType ()
{
if (ResolveClangType(eResolveStateForward))
return ClangASTContext::IsAggregateType (m_clang_type);
@@ -313,33 +318,33 @@
}
lldb::Format
-lldb_private::Type::GetFormat ()
+Type::GetFormat ()
{
// Make sure we resolve our type if it already hasn't been.
if (!ResolveClangType(eResolveStateForward))
return lldb::eFormatInvalid;
- return lldb_private::ClangASTType::GetFormat (m_clang_type);
+ return ClangASTType::GetFormat (m_clang_type);
}
lldb::Encoding
-lldb_private::Type::GetEncoding (uint32_t &count)
+Type::GetEncoding (uint32_t &count)
{
// Make sure we resolve our type if it already hasn't been.
if (!ResolveClangType(eResolveStateForward))
return lldb::eEncodingInvalid;
- return lldb_private::ClangASTType::GetEncoding (m_clang_type, count);
+ return ClangASTType::GetEncoding (m_clang_type, count);
}
bool
-lldb_private::Type::DumpValueInMemory
+Type::DumpValueInMemory
(
- lldb_private::ExecutionContext *exe_ctx,
- lldb_private::Stream *s,
+ ExecutionContext *exe_ctx,
+ Stream *s,
lldb::addr_t address,
lldb::AddressType address_type,
bool show_types,
@@ -349,7 +354,7 @@
{
if (address != LLDB_INVALID_ADDRESS)
{
- lldb_private::DataExtractor data;
+ DataExtractor data;
data.SetByteOrder (exe_ctx->process->GetByteOrder());
if (ReadFromMemory (exe_ctx, address, address_type, data))
{
@@ -362,7 +367,7 @@
bool
-lldb_private::Type::ReadFromMemory (lldb_private::ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, lldb_private::DataExtractor &data)
+Type::ReadFromMemory (ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, DataExtractor &data)
{
if (address_type == lldb::eAddressTypeFile)
{
@@ -401,26 +406,26 @@
bool
-lldb_private::Type::WriteToMemory (lldb_private::ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, lldb_private::DataExtractor &data)
+Type::WriteToMemory (ExecutionContext *exe_ctx, lldb::addr_t addr, lldb::AddressType address_type, DataExtractor &data)
{
return false;
}
-lldb_private::TypeList*
-lldb_private::Type::GetTypeList()
+TypeList*
+Type::GetTypeList()
{
return GetSymbolFile()->GetTypeList();
}
-const lldb_private::Declaration &
-lldb_private::Type::GetDeclaration () const
+const Declaration &
+Type::GetDeclaration () const
{
return m_decl;
}
bool
-lldb_private::Type::ResolveClangType (ResolveState clang_type_resolve_state)
+Type::ResolveClangType (ResolveState clang_type_resolve_state)
{
Type *encoding_type = NULL;
if (m_clang_type == NULL)
@@ -560,7 +565,7 @@
return m_clang_type != NULL;
}
uint32_t
-lldb_private::Type::GetEncodingMask ()
+Type::GetEncodingMask ()
{
uint32_t encoding_mask = 1u << m_encoding_uid_type;
Type *encoding_type = GetEncodingType();
@@ -571,40 +576,40 @@
}
clang_type_t
-lldb_private::Type::GetClangType ()
+Type::GetClangType ()
{
ResolveClangType(eResolveStateFull);
return m_clang_type;
}
clang_type_t
-lldb_private::Type::GetClangLayoutType ()
+Type::GetClangLayoutType ()
{
ResolveClangType(eResolveStateLayout);
return m_clang_type;
}
clang_type_t
-lldb_private::Type::GetClangForwardType ()
+Type::GetClangForwardType ()
{
ResolveClangType (eResolveStateForward);
return m_clang_type;
}
clang::ASTContext *
-lldb_private::Type::GetClangAST ()
+Type::GetClangAST ()
{
return GetClangASTContext().getASTContext();
}
-lldb_private::ClangASTContext &
-lldb_private::Type::GetClangASTContext ()
+ClangASTContext &
+Type::GetClangASTContext ()
{
return m_symbol_file->GetClangASTContext();
}
int
-lldb_private::Type::Compare(const Type &a, const Type &b)
+Type::Compare(const Type &a, const Type &b)
{
// Just compare the UID values for now...
lldb::user_id_t a_uid = a.GetID();
@@ -620,14 +625,14 @@
void *
-lldb_private::Type::CreateClangPointerType (lldb_private::Type *type)
+Type::CreateClangPointerType (Type *type)
{
assert(type);
return GetClangASTContext().CreatePointerType(type->GetClangForwardType());
}
void *
-lldb_private::Type::CreateClangTypedefType (lldb_private::Type *typedef_type, lldb_private::Type *base_type)
+Type::CreateClangTypedefType (Type *typedef_type, Type *base_type)
{
assert(typedef_type && base_type);
return GetClangASTContext().CreateTypedefType (typedef_type->GetName().AsCString(),
@@ -636,14 +641,14 @@
}
void *
-lldb_private::Type::CreateClangLValueReferenceType (lldb_private::Type *type)
+Type::CreateClangLValueReferenceType (Type *type)
{
assert(type);
return GetClangASTContext().CreateLValueReferenceType(type->GetClangForwardType());
}
void *
-lldb_private::Type::CreateClangRValueReferenceType (lldb_private::Type *type)
+Type::CreateClangRValueReferenceType (Type *type)
{
assert(type);
return GetClangASTContext().CreateRValueReferenceType (type->GetClangForwardType());
diff --git a/source/Target/StackFrame.cpp b/source/Target/StackFrame.cpp
index 633d394..32917b7 100644
--- a/source/Target/StackFrame.cpp
+++ b/source/Target/StackFrame.cpp
@@ -48,9 +48,9 @@
lldb::addr_t pc,
const SymbolContext *sc_ptr
) :
+ m_thread (thread),
m_frame_index (frame_idx),
m_concrete_frame_index (unwind_frame_index),
- m_thread (thread),
m_reg_context_sp (),
m_id (pc, cfa, NULL),
m_frame_code_addr (NULL, pc),
@@ -59,7 +59,8 @@
m_frame_base (),
m_frame_base_error (),
m_variable_list_sp (),
- m_variable_list_value_objects ()
+ m_variable_list_value_objects (),
+ m_disassembly ()
{
if (sc_ptr != NULL)
{
@@ -78,9 +79,9 @@
lldb::addr_t pc,
const SymbolContext *sc_ptr
) :
+ m_thread (thread),
m_frame_index (frame_idx),
m_concrete_frame_index (unwind_frame_index),
- m_thread (thread),
m_reg_context_sp (reg_context_sp),
m_id (pc, cfa, NULL),
m_frame_code_addr (NULL, pc),
@@ -89,7 +90,8 @@
m_frame_base (),
m_frame_base_error (),
m_variable_list_sp (),
- m_variable_list_value_objects ()
+ m_variable_list_value_objects (),
+ m_disassembly ()
{
if (sc_ptr != NULL)
{
@@ -114,9 +116,9 @@
const Address& pc_addr,
const SymbolContext *sc_ptr
) :
+ m_thread (thread),
m_frame_index (frame_idx),
m_concrete_frame_index (unwind_frame_index),
- m_thread (thread),
m_reg_context_sp (reg_context_sp),
m_id (pc_addr.GetLoadAddress (&thread.GetProcess().GetTarget()), cfa, NULL),
m_frame_code_addr (pc_addr),
@@ -125,7 +127,8 @@
m_frame_base (),
m_frame_base_error (),
m_variable_list_sp (),
- m_variable_list_value_objects ()
+ m_variable_list_value_objects (),
+ m_disassembly ()
{
if (sc_ptr != NULL)
{
@@ -626,7 +629,7 @@
if (var_path.size() > 2) // Need at least two brackets and a number
{
char *end = NULL;
- int32_t child_index = ::strtol (&var_path[1], &end, 0);
+ long child_index = ::strtol (&var_path[1], &end, 0);
if (end && *end == ']')
{
@@ -745,7 +748,7 @@
if (m_sc.function->GetFrameBaseExpression().IsLocationList())
loclist_base_addr = m_sc.function->GetAddressRange().GetBaseAddress().GetLoadAddress (&m_thread.GetProcess().GetTarget());
- if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false)
+ if (m_sc.function->GetFrameBaseExpression().Evaluate(&exe_ctx, NULL, NULL, NULL, NULL, loclist_base_addr, NULL, expr_value, &m_frame_base_error) == false)
{
// We should really have an error if evaluate returns, but in case
// we don't, lets set the error to something at least.
@@ -963,4 +966,4 @@
StackFrame::GetSP ()
{
return m_thread.GetStackFrameSPForStackFramePtr (this);
-}
\ No newline at end of file
+}
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 2dca598..3129317 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -844,7 +844,7 @@
stack_size = m_discarded_plan_stack.size();
s->Printf ("Discarded Plan Stack: %d elements.\n", stack_size);
- for (int i = stack_size - 1; i >= 0; i--)
+ for (i = stack_size - 1; i >= 0; i--)
{
s->Printf ("Element %d: ", i);
s->IndentMore();
diff --git a/source/Target/ThreadPlanShouldStopHere.cpp b/source/Target/ThreadPlanShouldStopHere.cpp
index 493ab63..a297dd8 100644
--- a/source/Target/ThreadPlanShouldStopHere.cpp
+++ b/source/Target/ThreadPlanShouldStopHere.cpp
@@ -50,4 +50,4 @@
return m_callback (m_owner, m_flags, m_baton);
else
return NULL;
-}
\ No newline at end of file
+}