summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-01-25 18:06:21 +0000
committerGreg Clayton <gclayton@apple.com>2013-01-25 18:06:21 +0000
commitc7bece56faa5eef1c3d141d0c0b0b68b28a9aed2 (patch)
tree9a0132fc3b0bb4f38d06a0f352ee75ac57994771
parentd0ed6c249dbd6bd488b6491b536a387548c00f7e (diff)
downloadbcm5719-llvm-c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2.tar.gz
bcm5719-llvm-c7bece56faa5eef1c3d141d0c0b0b68b28a9aed2.zip
<rdar://problem/13069948>
Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
-rw-r--r--lldb/examples/python/operating_system.py3
-rw-r--r--lldb/include/lldb/API/SBData.h28
-rw-r--r--lldb/include/lldb/Breakpoint/Breakpoint.h4
-rw-r--r--lldb/include/lldb/Breakpoint/BreakpointIDList.h12
-rw-r--r--lldb/include/lldb/Breakpoint/BreakpointList.h4
-rw-r--r--lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h4
-rw-r--r--lldb/include/lldb/Breakpoint/BreakpointLocationList.h4
-rw-r--r--lldb/include/lldb/Breakpoint/BreakpointSite.h9
-rw-r--r--lldb/include/lldb/Breakpoint/Watchpoint.h2
-rw-r--r--lldb/include/lldb/Core/ArchSpec.h2
-rw-r--r--lldb/include/lldb/Core/CXXFormatterFunctions.h26
-rw-r--r--lldb/include/lldb/Core/DataExtractor.h134
-rw-r--r--lldb/include/lldb/Core/Debugger.h4
-rw-r--r--lldb/include/lldb/Core/Disassembler.h12
-rw-r--r--lldb/include/lldb/Core/FileSpecList.h16
-rw-r--r--lldb/include/lldb/Core/FormatClasses.h22
-rw-r--r--lldb/include/lldb/Core/FormatManager.h20
-rw-r--r--lldb/include/lldb/Core/FormatNavigator.h16
-rw-r--r--lldb/include/lldb/Core/MappedHash.h24
-rw-r--r--lldb/include/lldb/Core/Module.h30
-rw-r--r--lldb/include/lldb/Core/ModuleList.h28
-rw-r--r--lldb/include/lldb/Core/PluginManager.h2
-rw-r--r--lldb/include/lldb/Core/RegisterValue.h2
-rw-r--r--lldb/include/lldb/Core/Scalar.h16
-rw-r--r--lldb/include/lldb/Core/Section.h10
-rw-r--r--lldb/include/lldb/Core/Stream.h64
-rw-r--r--lldb/include/lldb/Core/StreamAsynchronousIO.h2
-rw-r--r--lldb/include/lldb/Core/StreamBuffer.h2
-rw-r--r--lldb/include/lldb/Core/StreamCallback.h2
-rw-r--r--lldb/include/lldb/Core/StreamFile.h2
-rw-r--r--lldb/include/lldb/Core/StreamString.h2
-rw-r--r--lldb/include/lldb/Core/StreamTee.h8
-rw-r--r--lldb/include/lldb/Core/StringList.h2
-rw-r--r--lldb/include/lldb/Core/VMRange.h2
-rw-r--r--lldb/include/lldb/Core/Value.h2
-rw-r--r--lldb/include/lldb/Core/ValueObject.h54
-rw-r--r--lldb/include/lldb/Core/ValueObjectCast.h2
-rw-r--r--lldb/include/lldb/Core/ValueObjectChild.h2
-rw-r--r--lldb/include/lldb/Core/ValueObjectConstResult.h14
-rw-r--r--lldb/include/lldb/Core/ValueObjectConstResultChild.h2
-rw-r--r--lldb/include/lldb/Core/ValueObjectConstResultImpl.h2
-rw-r--r--lldb/include/lldb/Core/ValueObjectDynamicValue.h2
-rw-r--r--lldb/include/lldb/Core/ValueObjectList.h10
-rw-r--r--lldb/include/lldb/Core/ValueObjectMemory.h2
-rw-r--r--lldb/include/lldb/Core/ValueObjectRegister.h12
-rw-r--r--lldb/include/lldb/Core/ValueObjectSyntheticFilter.h6
-rw-r--r--lldb/include/lldb/Core/ValueObjectVariable.h2
-rw-r--r--lldb/include/lldb/Core/dwarf.h1
-rw-r--r--lldb/include/lldb/Expression/ClangFunction.h10
-rw-r--r--lldb/include/lldb/Expression/DWARFExpression.h22
-rw-r--r--lldb/include/lldb/Host/File.h4
-rw-r--r--lldb/include/lldb/Interpreter/Args.h6
-rw-r--r--lldb/include/lldb/Interpreter/CommandInterpreter.h2
-rw-r--r--lldb/include/lldb/Interpreter/CommandObject.h2
-rw-r--r--lldb/include/lldb/Interpreter/CommandReturnObject.h4
-rw-r--r--lldb/include/lldb/Interpreter/OptionValueArray.h12
-rw-r--r--lldb/include/lldb/Interpreter/OptionValueDictionary.h2
-rw-r--r--lldb/include/lldb/Interpreter/ScriptInterpreter.h2
-rw-r--r--lldb/include/lldb/Interpreter/ScriptInterpreterPython.h2
-rw-r--r--lldb/include/lldb/Symbol/Block.h2
-rw-r--r--lldb/include/lldb/Symbol/ClangASTContext.h10
-rw-r--r--lldb/include/lldb/Symbol/ObjectFile.h2
-rw-r--r--lldb/include/lldb/Symbol/Symbol.h4
-rw-r--r--lldb/include/lldb/Symbol/SymbolContext.h4
-rw-r--r--lldb/include/lldb/Symbol/SymbolVendor.h22
-rw-r--r--lldb/include/lldb/Symbol/Symtab.h10
-rw-r--r--lldb/include/lldb/Symbol/Variable.h6
-rw-r--r--lldb/include/lldb/Symbol/VariableList.h4
-rw-r--r--lldb/include/lldb/Target/Platform.h8
-rw-r--r--lldb/include/lldb/Target/Process.h16
-rw-r--r--lldb/include/lldb/Target/RegisterContext.h4
-rw-r--r--lldb/include/lldb/lldb-defines.h1
-rw-r--r--lldb/include/lldb/lldb-types.h1
-rw-r--r--lldb/scripts/Python/interface/SBData.i28
-rw-r--r--lldb/source/API/SBData.cpp56
-rw-r--r--lldb/source/Breakpoint/Breakpoint.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointIDList.cpp22
-rw-r--r--lldb/source/Breakpoint/BreakpointList.cpp8
-rw-r--r--lldb/source/Breakpoint/BreakpointLocationCollection.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointLocationList.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverFileLine.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverName.cpp14
-rw-r--r--lldb/source/Breakpoint/BreakpointSite.cpp11
-rw-r--r--lldb/source/Breakpoint/Watchpoint.cpp2
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectApropos.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectArgs.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectHelp.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp29
-rw-r--r--lldb/source/Commands/CommandObjectMultiword.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp16
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp16
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp15
-rw-r--r--lldb/source/Commands/CommandObjectSyntax.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp82
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp6
-rw-r--r--lldb/source/Core/Address.cpp6
-rw-r--r--lldb/source/Core/ArchSpec.cpp8
-rw-r--r--lldb/source/Core/CXXFormatterFunctions.cpp38
-rw-r--r--lldb/source/Core/ConstString.cpp6
-rw-r--r--lldb/source/Core/DataBufferMemoryMap.cpp3
-rw-r--r--lldb/source/Core/DataExtractor.cpp209
-rw-r--r--lldb/source/Core/Debugger.cpp13
-rw-r--r--lldb/source/Core/Disassembler.cpp14
-rw-r--r--lldb/source/Core/EmulateInstruction.cpp2
-rw-r--r--lldb/source/Core/Error.cpp2
-rw-r--r--lldb/source/Core/FileSpecList.cpp15
-rw-r--r--lldb/source/Core/FormatClasses.cpp4
-rw-r--r--lldb/source/Core/FormatManager.cpp2
-rw-r--r--lldb/source/Core/Module.cpp83
-rw-r--r--lldb/source/Core/ModuleList.cpp32
-rw-r--r--lldb/source/Core/PluginManager.cpp2
-rw-r--r--lldb/source/Core/RegisterValue.cpp2
-rw-r--r--lldb/source/Core/Scalar.cpp170
-rw-r--r--lldb/source/Core/SearchFilter.cpp16
-rw-r--r--lldb/source/Core/Section.cpp22
-rw-r--r--lldb/source/Core/SourceManager.cpp19
-rw-r--r--lldb/source/Core/Stream.cpp98
-rw-r--r--lldb/source/Core/StreamAsynchronousIO.cpp2
-rw-r--r--lldb/source/Core/StreamCallback.cpp2
-rw-r--r--lldb/source/Core/StreamFile.cpp2
-rw-r--r--lldb/source/Core/StreamString.cpp2
-rw-r--r--lldb/source/Core/StringList.cpp12
-rw-r--r--lldb/source/Core/UUID.cpp2
-rw-r--r--lldb/source/Core/VMRange.cpp2
-rw-r--r--lldb/source/Core/Value.cpp4
-rw-r--r--lldb/source/Core/ValueObject.cpp110
-rw-r--r--lldb/source/Core/ValueObjectCast.cpp2
-rw-r--r--lldb/source/Core/ValueObjectChild.cpp2
-rw-r--r--lldb/source/Core/ValueObjectConstResult.cpp12
-rw-r--r--lldb/source/Core/ValueObjectConstResultChild.cpp2
-rw-r--r--lldb/source/Core/ValueObjectConstResultImpl.cpp2
-rw-r--r--lldb/source/Core/ValueObjectDynamicValue.cpp2
-rw-r--r--lldb/source/Core/ValueObjectList.cpp10
-rw-r--r--lldb/source/Core/ValueObjectMemory.cpp2
-rw-r--r--lldb/source/Core/ValueObjectRegister.cpp16
-rw-r--r--lldb/source/Core/ValueObjectSyntheticFilter.cpp10
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp2
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp8
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp2
-rw-r--r--lldb/source/Expression/ClangFunction.cpp6
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp84
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp8
-rw-r--r--lldb/source/Host/common/File.cpp8
-rw-r--r--lldb/source/Host/common/FileSpec.cpp2
-rw-r--r--lldb/source/Host/macosx/Host.mm2
-rw-r--r--lldb/source/Host/macosx/Symbols.cpp12
-rw-r--r--lldb/source/Interpreter/Args.cpp40
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp55
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp8
-rw-r--r--lldb/source/Interpreter/CommandReturnObject.cpp18
-rw-r--r--lldb/source/Interpreter/PythonDataObjects.cpp10
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp2
-rw-r--r--lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp2
-rw-r--r--lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp2
-rw-r--r--lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp4
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp8
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h4
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp4
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp32
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp22
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp2
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h4
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp10
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp24
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp26
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp14
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h12
-rw-r--r--lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp4
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp40
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h14
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp43
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h8
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp67
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h2
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp22
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h6
-rw-r--r--lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp47
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp24
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextMemory.h4
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp10
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h16
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp10
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp11
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp72
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h10
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp32
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp67
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h10
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h31
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp6
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp12
-rw-r--r--lldb/source/Symbol/ClangASTType.cpp8
-rw-r--r--lldb/source/Symbol/DWARFCallFrameInfo.cpp11
-rw-r--r--lldb/source/Symbol/Symbol.cpp2
-rw-r--r--lldb/source/Symbol/SymbolContext.cpp12
-rw-r--r--lldb/source/Symbol/SymbolVendor.cpp28
-rw-r--r--lldb/source/Symbol/Symtab.cpp14
-rw-r--r--lldb/source/Symbol/VariableList.cpp4
-rw-r--r--lldb/source/Target/Process.cpp6
-rw-r--r--lldb/source/Target/Target.cpp2
-rw-r--r--lldb/source/Utility/StringExtractor.cpp20
-rw-r--r--lldb/source/Utility/StringExtractor.h10
-rw-r--r--lldb/tools/debugserver/source/DNBDataRef.cpp99
248 files changed, 1676 insertions, 1817 deletions
diff --git a/lldb/examples/python/operating_system.py b/lldb/examples/python/operating_system.py
index 204063298bf..cd4ae37f854 100644
--- a/lldb/examples/python/operating_system.py
+++ b/lldb/examples/python/operating_system.py
@@ -25,8 +25,9 @@ class OperatingSystemPlugIn(object):
return self.process.target
def create_thread(self, tid, context):
+ print 'tid type is: ' + str(type(tid))
if tid == 0x444444444:
- thread_info = { 'tid' : 0x444444444, 'name' : 'four' , 'queue' : 'queue4', 'state' : 'stopped', 'stop_reason' : 'none' }
+ thread_info = { 'tid' : tid, 'name' : 'four' , 'queue' : 'queue4', 'state' : 'stopped', 'stop_reason' : 'none' }
self.threads.append(thread_info)
return thread_info
return None
diff --git a/lldb/include/lldb/API/SBData.h b/lldb/include/lldb/API/SBData.h
index b2824a49018..10c00224727 100644
--- a/lldb/include/lldb/API/SBData.h
+++ b/lldb/include/lldb/API/SBData.h
@@ -49,47 +49,47 @@ public:
SetByteOrder (lldb::ByteOrder endian);
float
- GetFloat (lldb::SBError& error, uint32_t offset);
+ GetFloat (lldb::SBError& error, lldb::offset_t offset);
double
- GetDouble (lldb::SBError& error, uint32_t offset);
+ GetDouble (lldb::SBError& error, lldb::offset_t offset);
long double
- GetLongDouble (lldb::SBError& error, uint32_t offset);
+ GetLongDouble (lldb::SBError& error, lldb::offset_t offset);
lldb::addr_t
- GetAddress (lldb::SBError& error, uint32_t offset);
+ GetAddress (lldb::SBError& error, lldb::offset_t offset);
uint8_t
- GetUnsignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset);
uint16_t
- GetUnsignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset);
uint32_t
- GetUnsignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset);
uint64_t
- GetUnsignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset);
int8_t
- GetSignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset);
int16_t
- GetSignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset);
int32_t
- GetSignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset);
int64_t
- GetSignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset);
const char*
- GetString (lldb::SBError& error, uint32_t offset);
+ GetString (lldb::SBError& error, lldb::offset_t offset);
size_t
ReadRawData (lldb::SBError& error,
- uint32_t offset,
+ lldb::offset_t offset,
void *buf,
size_t size);
diff --git a/lldb/include/lldb/Breakpoint/Breakpoint.h b/lldb/include/lldb/Breakpoint/Breakpoint.h
index 66bea54237a..816c0fb1344 100644
--- a/lldb/include/lldb/Breakpoint/Breakpoint.h
+++ b/lldb/include/lldb/Breakpoint/Breakpoint.h
@@ -136,7 +136,7 @@ public:
static lldb::BreakpointLocationSP
GetBreakpointLocationAtIndexFromEvent (const lldb::EventSP &event_sp, uint32_t loc_idx);
- static uint32_t
+ static size_t
GetNumBreakpointLocationsFromEvent (const lldb::EventSP &event_sp);
static const BreakpointEventData *
@@ -310,7 +310,7 @@ public:
/// greater than then number of actual locations.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetLocationAtIndex (uint32_t index);
+ GetLocationAtIndex (size_t index);
//------------------------------------------------------------------
// The next section deals with various breakpoint options.
diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
index 47531f9f0ca..c9fcef0a783 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h
@@ -41,10 +41,10 @@ public:
GetSize();
BreakpointID &
- GetBreakpointIDAtIndex (uint32_t index);
+ GetBreakpointIDAtIndex (size_t index);
bool
- RemoveBreakpointIDAtIndex (uint32_t index);
+ RemoveBreakpointIDAtIndex (size_t index);
void
Clear();
@@ -56,16 +56,16 @@ public:
AddBreakpointID (const char *bp_id);
bool
- FindBreakpointID (BreakpointID &bp_id, uint32_t *position);
+ FindBreakpointID (BreakpointID &bp_id, size_t *position);
bool
- FindBreakpointID (const char *bp_id, uint32_t *position);
+ FindBreakpointID (const char *bp_id, size_t *position);
void
- InsertStringArray (const char **string_array, uint32_t array_size, CommandReturnObject &result);
+ InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result);
static bool
- StringContainsIDRangeExpression (const char *in_string, uint32_t *range_start_len, uint32_t *range_end_pos);
+ StringContainsIDRangeExpression (const char *in_string, size_t *range_start_len, size_t *range_end_pos);
static void
FindAndReplaceIDRanges (Args &old_args, Target *target, CommandReturnObject &result, Args &new_args);
diff --git a/lldb/include/lldb/Breakpoint/BreakpointList.h b/lldb/include/lldb/Breakpoint/BreakpointList.h
index cf2584cf777..97eb2b46bc0 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointList.h
@@ -92,7 +92,7 @@ public:
/// breakpoint doesn't exist.
//------------------------------------------------------------------
lldb::BreakpointSP
- GetBreakpointAtIndex (uint32_t i);
+ GetBreakpointAtIndex (size_t i);
//------------------------------------------------------------------
/// Returns a shared pointer to the breakpoint with index \a i, const version
@@ -105,7 +105,7 @@ public:
/// breakpoint doesn't exist.
//------------------------------------------------------------------
const lldb::BreakpointSP
- GetBreakpointAtIndex (uint32_t i) const;
+ GetBreakpointAtIndex (size_t i) const;
//------------------------------------------------------------------
/// Returns the number of elements in this breakpoint list.
diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h b/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h
index f77a99c8b9b..0a1ee7174a2 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h
@@ -101,7 +101,7 @@ public:
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetByIndex (uint32_t i);
+ GetByIndex (size_t i);
//------------------------------------------------------------------
/// Returns a shared pointer to the breakpoint location with index
@@ -115,7 +115,7 @@ public:
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
const lldb::BreakpointLocationSP
- GetByIndex (uint32_t i) const;
+ GetByIndex (size_t i) const;
//------------------------------------------------------------------
/// Returns the number of elements in this breakpoint location list.
diff --git a/lldb/include/lldb/Breakpoint/BreakpointLocationList.h b/lldb/include/lldb/Breakpoint/BreakpointLocationList.h
index 1be2237fb28..1cba23d9118 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointLocationList.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointLocationList.h
@@ -119,7 +119,7 @@ public:
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetByIndex (uint32_t i);
+ GetByIndex (size_t i);
//------------------------------------------------------------------
/// Returns a shared pointer to the breakpoint location with index
@@ -133,7 +133,7 @@ public:
/// pointer if the breakpoint doesn't exist.
//------------------------------------------------------------------
const lldb::BreakpointLocationSP
- GetByIndex (uint32_t i) const;
+ GetByIndex (size_t i) const;
//------------------------------------------------------------------
/// Removes all the locations in this list from their breakpoint site
diff --git a/lldb/include/lldb/Breakpoint/BreakpointSite.h b/lldb/include/lldb/Breakpoint/BreakpointSite.h
index d56feae8d37..ff71e0441e8 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointSite.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointSite.h
@@ -83,7 +83,7 @@ public:
//------------------------------------------------------------------
bool
SetTrapOpcode (const uint8_t *trap_opcode,
- size_t trap_opcode_size);
+ uint32_t trap_opcode_size);
//------------------------------------------------------------------
/// Gets the original instruction bytes that were overwritten by the trap
@@ -168,7 +168,7 @@ public:
/// @return
/// The number of owners.
//------------------------------------------------------------------
- uint32_t
+ size_t
GetNumberOfOwners ();
//------------------------------------------------------------------
@@ -183,7 +183,7 @@ public:
/// A shared pointer to the breakpoint location at that index.
//------------------------------------------------------------------
lldb::BreakpointLocationSP
- GetOwnerAtIndex (uint32_t index);
+ GetOwnerAtIndex (size_t idx);
//------------------------------------------------------------------
/// Check whether the owners of this breakpoint site have any
@@ -244,7 +244,7 @@ private:
/// @param[in] context
/// \a break_loc_id is the Breakpoint Location to remove.
//------------------------------------------------------------------
- uint32_t
+ size_t
RemoveOwner (lldb::break_id_t break_id,
lldb::break_id_t break_loc_id);
@@ -265,7 +265,6 @@ private:
BreakpointSite (BreakpointSiteList *list,
const lldb::BreakpointLocationSP& owner,
lldb::addr_t m_addr,
- lldb::tid_t tid,
bool use_hardware);
DISALLOW_COPY_AND_ASSIGN(BreakpointSite);
diff --git a/lldb/include/lldb/Breakpoint/Watchpoint.h b/lldb/include/lldb/Breakpoint/Watchpoint.h
index 1a4551d27ba..a5dbf0593c8 100644
--- a/lldb/include/lldb/Breakpoint/Watchpoint.h
+++ b/lldb/include/lldb/Breakpoint/Watchpoint.h
@@ -76,7 +76,7 @@ public:
DISALLOW_COPY_AND_ASSIGN (WatchpointEventData);
};
- Watchpoint (Target& target, lldb::addr_t addr, size_t size, const ClangASTType *type, bool hardware = true);
+ Watchpoint (Target& target, lldb::addr_t addr, uint32_t size, const ClangASTType *type, bool hardware = true);
~Watchpoint ();
void
diff --git a/lldb/include/lldb/Core/ArchSpec.h b/lldb/include/lldb/Core/ArchSpec.h
index 0a3a5d341e3..79ab66f5883 100644
--- a/lldb/include/lldb/Core/ArchSpec.h
+++ b/lldb/include/lldb/Core/ArchSpec.h
@@ -159,7 +159,7 @@ public:
const ArchSpec&
operator= (const ArchSpec& rhs);
- static uint32_t
+ static size_t
AutoComplete (const char *name,
StringList &matches);
diff --git a/lldb/include/lldb/Core/CXXFormatterFunctions.h b/lldb/include/lldb/Core/CXXFormatterFunctions.h
index 48734f98f4e..12a8b4744a1 100644
--- a/lldb/include/lldb/Core/CXXFormatterFunctions.h
+++ b/lldb/include/lldb/Core/CXXFormatterFunctions.h
@@ -135,11 +135,11 @@ namespace lldb_private {
public:
NSArrayMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
@@ -166,11 +166,11 @@ namespace lldb_private {
public:
NSArrayISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
@@ -186,7 +186,7 @@ namespace lldb_private {
private:
ExecutionContextRef m_exe_ctx_ref;
uint8_t m_ptr_size;
- uint64_t m_items;
+ size_t m_items;
lldb::addr_t m_data_ptr;
ClangASTType m_id_type;
std::vector<lldb::ValueObjectSP> m_children;
@@ -197,11 +197,11 @@ namespace lldb_private {
public:
NSArrayCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
@@ -242,11 +242,11 @@ namespace lldb_private {
public:
NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
@@ -298,11 +298,11 @@ namespace lldb_private {
public:
NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
@@ -328,11 +328,11 @@ namespace lldb_private {
public:
NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren ();
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update();
diff --git a/lldb/include/lldb/Core/DataExtractor.h b/lldb/include/lldb/Core/DataExtractor.h
index a8778010276..80206f76290 100644
--- a/lldb/include/lldb/Core/DataExtractor.h
+++ b/lldb/include/lldb/Core/DataExtractor.h
@@ -86,7 +86,7 @@ public:
/// @param[in] addr_size
/// A new address byte size value.
//------------------------------------------------------------------
- DataExtractor (const void* data, uint32_t data_length, lldb::ByteOrder byte_order, uint8_t addr_size);
+ DataExtractor (const void* data, lldb::offset_t data_length, lldb::ByteOrder byte_order, uint32_t addr_size);
//------------------------------------------------------------------
/// Construct with shared data.
@@ -105,7 +105,7 @@ public:
/// @param[in] addr_size
/// A new address byte size value.
//------------------------------------------------------------------
- DataExtractor (const lldb::DataBufferSP& data_sp, lldb::ByteOrder byte_order, uint8_t addr_size);
+ DataExtractor (const lldb::DataBufferSP& data_sp, lldb::ByteOrder byte_order, uint32_t addr_size);
//------------------------------------------------------------------
/// Construct with a subset of \a data.
@@ -130,7 +130,7 @@ public:
/// @param[in] length
/// The length in bytes of the subset of data.
//------------------------------------------------------------------
- DataExtractor (const DataExtractor& data, uint32_t offset, uint32_t length);
+ DataExtractor (const DataExtractor& data, lldb::offset_t offset, lldb::offset_t length);
DataExtractor (const DataExtractor& rhs);
//------------------------------------------------------------------
@@ -204,10 +204,10 @@ public:
/// @return
/// The offset at which dumping ended.
//------------------------------------------------------------------
- uint32_t
+ lldb::offset_t
PutToLog (Log *log,
- uint32_t offset,
- uint32_t length,
+ lldb::offset_t offset,
+ lldb::offset_t length,
uint64_t base_addr,
uint32_t num_per_line,
Type type,
@@ -273,13 +273,13 @@ public:
/// @return
/// The offset at which dumping ended.
//------------------------------------------------------------------
- uint32_t
+ lldb::offset_t
Dump (Stream *s,
- uint32_t offset,
+ lldb::offset_t offset,
lldb::Format item_format,
- uint32_t item_byte_size,
- uint32_t item_count,
- uint32_t num_per_line,
+ size_t item_byte_size,
+ size_t item_count,
+ size_t num_per_line,
uint64_t base_addr,
uint32_t item_bit_size,
uint32_t item_bit_offset,
@@ -300,7 +300,7 @@ public:
/// UUID value.
//------------------------------------------------------------------
void
- DumpUUID (Stream *s, uint32_t offset) const;
+ DumpUUID (Stream *s, lldb::offset_t offset) const;
//------------------------------------------------------------------
/// Extract an arbitrary number of bytes in the specified byte
@@ -332,7 +332,7 @@ public:
/// if there aren't enough bytes at the specified offset.
//------------------------------------------------------------------
size_t
- ExtractBytes (uint32_t offset, uint32_t length, lldb::ByteOrder dst_byte_order, void *dst) const;
+ ExtractBytes (lldb::offset_t offset, lldb::offset_t length, lldb::ByteOrder dst_byte_order, void *dst) const;
//------------------------------------------------------------------
/// Extract an address from \a *offset_ptr.
@@ -353,10 +353,10 @@ public:
/// The extracted address value.
//------------------------------------------------------------------
uint64_t
- GetAddress (uint32_t *offset_ptr) const;
+ GetAddress (lldb::offset_t *offset_ptr) const;
uint64_t
- GetAddress_unchecked (uint32_t *offset_ptr) const;
+ GetAddress_unchecked (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Get the current address size.
@@ -367,7 +367,7 @@ public:
/// @return
/// The size in bytes of address values that will be extracted.
//------------------------------------------------------------------
- uint8_t
+ uint32_t
GetAddressByteSize () const
{
return m_addr_size;
@@ -379,7 +379,7 @@ public:
/// @return
/// The total number of bytes of data this object refers to.
//------------------------------------------------------------------
- size_t
+ uint64_t
GetByteSize () const
{
return m_end - m_start;
@@ -408,7 +408,7 @@ public:
/// NULL will be returned.
//------------------------------------------------------------------
const char *
- GetCStr (uint32_t *offset_ptr) const;
+ GetCStr (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a length bytes from \a *offset_ptr.
@@ -434,7 +434,7 @@ public:
/// and length are valid, or NULL otherwise.
//------------------------------------------------------------------
const void*
- GetData (uint32_t *offset_ptr, uint32_t length) const;
+ GetData (lldb::offset_t *offset_ptr, lldb::offset_t length) const;
//------------------------------------------------------------------
/// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied
@@ -475,11 +475,11 @@ public:
/// Returns the number of bytes that were copied, or zero if
/// anything goes wrong.
//------------------------------------------------------------------
- uint32_t
- CopyByteOrderedData (uint32_t src_offset,
- uint32_t src_len,
+ lldb::offset_t
+ CopyByteOrderedData (lldb::offset_t src_offset,
+ lldb::offset_t src_len,
void *dst,
- uint32_t dst_len,
+ lldb::offset_t dst_len,
lldb::ByteOrder dst_byte_order) const;
//------------------------------------------------------------------
@@ -538,13 +538,13 @@ public:
/// The floating value that was extracted, or zero on failure.
//------------------------------------------------------------------
float
- GetFloat (uint32_t *offset_ptr) const;
+ GetFloat (lldb::offset_t *offset_ptr) const;
double
- GetDouble (uint32_t *offset_ptr) const;
+ GetDouble (lldb::offset_t *offset_ptr) const;
long double
- GetLongDouble (uint32_t *offset_ptr) const;
+ GetLongDouble (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract a GNU encoded pointer value from \a *offset_ptr.
@@ -575,7 +575,11 @@ public:
/// The extracted GNU encoded pointer value.
//------------------------------------------------------------------
uint64_t
- GetGNUEHPointer (uint32_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr);
+ GetGNUEHPointer (lldb::offset_t *offset_ptr,
+ uint32_t eh_ptr_enc,
+ lldb::addr_t pc_rel_addr,
+ lldb::addr_t text_addr,
+ lldb::addr_t data_addr);
//------------------------------------------------------------------
/// Extract an integer of size \a byte_size from \a *offset_ptr.
@@ -601,7 +605,7 @@ public:
/// The integer value that was extracted, or zero on failure.
//------------------------------------------------------------------
uint32_t
- GetMaxU32 (uint32_t *offset_ptr, uint32_t byte_size) const;
+ GetMaxU32 (lldb::offset_t *offset_ptr, size_t byte_size) const;
//------------------------------------------------------------------
/// Extract an unsigned integer of size \a byte_size from \a
@@ -630,10 +634,10 @@ public:
/// failure.
//------------------------------------------------------------------
uint64_t
- GetMaxU64 (uint32_t *offset_ptr, uint32_t byte_size) const;
+ GetMaxU64 (lldb::offset_t *offset_ptr, size_t byte_size) const;
uint64_t
- GetMaxU64_unchecked (uint32_t *offset_ptr, uint32_t byte_size) const;
+ GetMaxU64_unchecked (lldb::offset_t *offset_ptr, size_t byte_size) const;
//------------------------------------------------------------------
/// Extract an signed integer of size \a byte_size from \a *offset_ptr.
@@ -661,7 +665,7 @@ public:
/// or zero on failure.
//------------------------------------------------------------------
int64_t
- GetMaxS64 (uint32_t *offset_ptr, uint32_t size) const;
+ GetMaxS64 (lldb::offset_t *offset_ptr, size_t size) const;
//------------------------------------------------------------------
/// Extract an unsigned integer of size \a byte_size from \a
@@ -700,7 +704,10 @@ public:
/// zero on failure.
//------------------------------------------------------------------
uint64_t
- GetMaxU64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const;
+ GetMaxU64Bitfield (lldb::offset_t *offset_ptr,
+ size_t size,
+ uint32_t bitfield_bit_size,
+ uint32_t bitfield_bit_offset) const;
//------------------------------------------------------------------
/// Extract an signed integer of size \a byte_size from \a
@@ -739,7 +746,10 @@ public:
/// zero on failure.
//------------------------------------------------------------------
int64_t
- GetMaxS64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const;
+ GetMaxS64Bitfield (lldb::offset_t *offset_ptr,
+ size_t size,
+ uint32_t bitfield_bit_size,
+ uint32_t bitfield_bit_offset) const;
//------------------------------------------------------------------
/// Extract an pointer from \a *offset_ptr.
@@ -760,7 +770,7 @@ public:
/// The extracted pointer value as a 64 integer.
//------------------------------------------------------------------
uint64_t
- GetPointer (uint32_t *offset_ptr) const;
+ GetPointer (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Get the current byte order value.
@@ -792,10 +802,10 @@ public:
/// The extracted uint8_t value.
//------------------------------------------------------------------
uint8_t
- GetU8 ( uint32_t *offset_ptr) const;
+ GetU8 ( lldb::offset_t *offset_ptr) const;
uint8_t
- GetU8_unchecked (uint32_t *offset_ptr) const
+ GetU8_unchecked (lldb::offset_t *offset_ptr) const
{
uint8_t val = m_start[*offset_ptr];
*offset_ptr += 1;
@@ -803,13 +813,13 @@ public:
}
uint16_t
- GetU16_unchecked (uint32_t *offset_ptr) const;
+ GetU16_unchecked (lldb::offset_t *offset_ptr) const;
uint32_t
- GetU32_unchecked (uint32_t *offset_ptr) const;
+ GetU32_unchecked (lldb::offset_t *offset_ptr) const;
uint64_t
- GetU64_unchecked (uint32_t *offset_ptr) const;
+ GetU64_unchecked (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint8_t values from \a *offset_ptr.
///
@@ -836,7 +846,7 @@ public:
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU8 ( uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU8 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a uint16_t value from \a *offset_ptr.
@@ -855,7 +865,7 @@ public:
/// The extracted uint16_t value.
//------------------------------------------------------------------
uint16_t
- GetU16 (uint32_t *offset_ptr) const;
+ GetU16 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint16_t values from \a *offset_ptr.
@@ -883,7 +893,7 @@ public:
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU16 (uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU16 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a uint32_t value from \a *offset_ptr.
@@ -902,7 +912,7 @@ public:
/// The extracted uint32_t value.
//------------------------------------------------------------------
uint32_t
- GetU32 (uint32_t *offset_ptr) const;
+ GetU32 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint32_t values from \a *offset_ptr.
@@ -930,7 +940,7 @@ public:
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU32 (uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU32 (lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a uint64_t value from \a *offset_ptr.
@@ -949,7 +959,7 @@ public:
/// The extracted uint64_t value.
//------------------------------------------------------------------
uint64_t
- GetU64 (uint32_t *offset_ptr) const;
+ GetU64 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract \a count uint64_t values from \a *offset_ptr.
@@ -977,7 +987,7 @@ public:
/// NULL otherise.
//------------------------------------------------------------------
void *
- GetU64 ( uint32_t *offset_ptr, void *dst, uint32_t count) const;
+ GetU64 ( lldb::offset_t *offset_ptr, void *dst, uint32_t count) const;
//------------------------------------------------------------------
/// Extract a signed LEB128 value from \a *offset_ptr.
@@ -998,7 +1008,7 @@ public:
/// The extracted signed integer value.
//------------------------------------------------------------------
int64_t
- GetSLEB128 (uint32_t *offset_ptr) const;
+ GetSLEB128 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Extract a unsigned LEB128 value from \a *offset_ptr.
@@ -1019,7 +1029,7 @@ public:
/// The extracted unsigned integer value.
//------------------------------------------------------------------
uint64_t
- GetULEB128 (uint32_t *offset_ptr) const;
+ GetULEB128 (lldb::offset_t *offset_ptr) const;
lldb::DataBufferSP &
GetSharedDataBuffer ()
@@ -1042,7 +1052,7 @@ public:
/// NULL otherwise.
//------------------------------------------------------------------
const char *
- PeekCStr (uint32_t offset) const;
+ PeekCStr (lldb::offset_t offset) const;
//------------------------------------------------------------------
/// Peek at a bytes at \a offset.
@@ -1056,7 +1066,7 @@ public:
/// otherwise.
//------------------------------------------------------------------
const uint8_t*
- PeekData (uint32_t offset, uint32_t length) const;
+ PeekData (lldb::offset_t offset, lldb::offset_t length) const;
//------------------------------------------------------------------
/// Set the address byte size.
@@ -1068,7 +1078,7 @@ public:
/// The size in bytes to use when extracting addresses.
//------------------------------------------------------------------
void
- SetAddressByteSize (uint8_t addr_size)
+ SetAddressByteSize (uint32_t addr_size)
{
m_addr_size = addr_size;
}
@@ -1094,8 +1104,8 @@ public:
/// @return
/// The number of bytes that this object now contains.
//------------------------------------------------------------------
- uint32_t
- SetData (const void *bytes, uint32_t length, lldb::ByteOrder byte_order);
+ lldb::offset_t
+ SetData (const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order);
//------------------------------------------------------------------
/// Adopt a subset of \a data.
@@ -1123,8 +1133,8 @@ public:
/// @return
/// The number of bytes that this object now contains.
//------------------------------------------------------------------
- uint32_t
- SetData (const DataExtractor& data, uint32_t offset, uint32_t length);
+ lldb::offset_t
+ SetData (const DataExtractor& data, lldb::offset_t offset, lldb::offset_t length);
//------------------------------------------------------------------
/// Adopt a subset of shared data in \a data_sp.
@@ -1151,8 +1161,8 @@ public:
/// @return
/// The number of bytes that this object now contains.
//------------------------------------------------------------------
- uint32_t
- SetData (const lldb::DataBufferSP& data_sp, uint32_t offset = 0, uint32_t length = UINT32_MAX);
+ lldb::offset_t
+ SetData (const lldb::DataBufferSP& data_sp, lldb::offset_t offset = 0, lldb::offset_t length = LLDB_INVALID_OFFSET);
//------------------------------------------------------------------
/// Set the byte_order value.
@@ -1188,7 +1198,7 @@ public:
// The number of bytes consumed during the extraction.
//------------------------------------------------------------------
uint32_t
- Skip_LEB128 (uint32_t *offset_ptr) const;
+ Skip_LEB128 (lldb::offset_t *offset_ptr) const;
//------------------------------------------------------------------
/// Test the validity of \a offset.
@@ -1198,7 +1208,7 @@ public:
/// object, \b false otherwise.
//------------------------------------------------------------------
bool
- ValidOffset (uint32_t offset) const
+ ValidOffset (lldb::offset_t offset) const
{
return offset < GetByteSize();
}
@@ -1211,7 +1221,7 @@ public:
/// length bytes available at that offset, \b false otherwise.
//------------------------------------------------------------------
bool
- ValidOffsetForDataOfSize (uint32_t offset, uint32_t length) const;
+ ValidOffsetForDataOfSize (lldb::offset_t offset, lldb::offset_t length) const;
size_t
Copy (DataExtractor& dest_data) const;
@@ -1220,7 +1230,7 @@ public:
Append (DataExtractor& rhs);
bool
- Append (void* bytes, uint32_t length);
+ Append (void* bytes, lldb::offset_t length);
protected:
//------------------------------------------------------------------
@@ -1229,7 +1239,7 @@ protected:
const uint8_t * m_start; ///< A pointer to the first byte of data.
const uint8_t * m_end; ///< A pointer to the byte that is past the end of the data.
lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from.
- uint8_t m_addr_size; ///< The address size to use when extracting pointers or addresses
+ uint32_t m_addr_size; ///< The address size to use when extracting pointers or addresses
mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can be shared among multilple instances
};
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index 88bb57f7592..4543536abd5 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -227,11 +227,11 @@ public:
static lldb::DebuggerSP
FindDebuggerWithInstanceName (const ConstString &instance_name);
- static uint32_t
+ static size_t
GetNumDebuggers();
static lldb::DebuggerSP
- GetDebuggerAtIndex (uint32_t);
+ GetDebuggerAtIndex (size_t index);
static bool
FormatPrompt (const char *format,
diff --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h
index 52d17f1f1a2..451bff57b56 100644
--- a/lldb/include/lldb/Core/Disassembler.h
+++ b/lldb/include/lldb/Core/Disassembler.h
@@ -88,8 +88,8 @@ public:
virtual size_t
Decode (const Disassembler &disassembler,
- const DataExtractor& data,
- uint32_t data_offset) = 0;
+ const DataExtractor& data,
+ lldb::offset_t data_offset) = 0;
virtual void
SetDescription (const char *) {} // May be overridden in sub-classes that have descriptions.
@@ -166,7 +166,7 @@ public:
GetMaxOpcocdeByteSize () const;
lldb::InstructionSP
- GetInstructionAtIndex (uint32_t idx) const;
+ GetInstructionAtIndex (size_t idx) const;
uint32_t
GetIndexOfNextBranchInstruction(uint32_t start) const;
@@ -218,7 +218,7 @@ public:
virtual size_t
Decode (const Disassembler &disassembler,
const DataExtractor &data,
- uint32_t data_offset);
+ lldb::offset_t data_offset);
void
SetOpcode (size_t opcode_size, void *opcode_data);
@@ -350,8 +350,8 @@ public:
virtual size_t
DecodeInstructions (const Address &base_addr,
const DataExtractor& data,
- uint32_t data_offset,
- uint32_t num_instructions,
+ lldb::offset_t data_offset,
+ size_t num_instructions,
bool append) = 0;
InstructionList &
diff --git a/lldb/include/lldb/Core/FileSpecList.h b/lldb/include/lldb/Core/FileSpecList.h
index 2ff28ce6721..52fa04d9c10 100644
--- a/lldb/include/lldb/Core/FileSpecList.h
+++ b/lldb/include/lldb/Core/FileSpecList.h
@@ -123,8 +123,8 @@ public:
/// The index of the file that matches \a file if it is found,
/// else UINT32_MAX is returned.
//------------------------------------------------------------------
- uint32_t
- FindFileIndex (uint32_t idx, const FileSpec &file, bool full) const;
+ size_t
+ FindFileIndex (size_t idx, const FileSpec &file, bool full) const;
//------------------------------------------------------------------
/// Get file at index.
@@ -143,7 +143,7 @@ public:
/// returned.
//------------------------------------------------------------------
const FileSpec &
- GetFileSpecAtIndex (uint32_t idx) const;
+ GetFileSpecAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get file specification pointer at index.
@@ -159,7 +159,7 @@ public:
/// If \a idx is out of range, then an NULL is returned.
//------------------------------------------------------------------
const FileSpec *
- GetFileSpecPointerAtIndex (uint32_t idx) const;
+ GetFileSpecPointerAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get the memory cost of this object.
@@ -182,11 +182,11 @@ public:
/// @return
/// The number of files in the file spec list.
//------------------------------------------------------------------
- uint32_t
+ size_t
GetSize () const;
bool
- Insert (uint32_t idx, const FileSpec &file)
+ Insert (size_t idx, const FileSpec &file)
{
if (idx < m_files.size())
{
@@ -202,7 +202,7 @@ public:
}
bool
- Replace (uint32_t idx, const FileSpec &file)
+ Replace (size_t idx, const FileSpec &file)
{
if (idx < m_files.size())
{
@@ -213,7 +213,7 @@ public:
}
bool
- Remove (uint32_t idx)
+ Remove (size_t idx)
{
if (idx < m_files.size())
{
diff --git a/lldb/include/lldb/Core/FormatClasses.h b/lldb/include/lldb/Core/FormatClasses.h
index e479e69bd5e..0d66ca5da86 100644
--- a/lldb/include/lldb/Core/FormatClasses.h
+++ b/lldb/include/lldb/Core/FormatClasses.h
@@ -237,11 +237,11 @@ public:
{
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren () = 0;
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx) = 0;
+ GetChildAtIndex (size_t idx) = 0;
virtual uint32_t
GetIndexOfChildWithName (const ConstString &name) = 0;
@@ -479,14 +479,14 @@ public:
m_expression_paths.clear();
}
- int
+ size_t
GetCount() const
{
return m_expression_paths.size();
}
const char*
- GetExpressionPathAtIndex(int i) const
+ GetExpressionPathAtIndex(size_t i) const
{
return m_expression_paths[i].c_str();
}
@@ -556,14 +556,14 @@ public:
{
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren()
{
return filter->GetCount();
}
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
if (idx >= filter->GetCount())
return lldb::ValueObjectSP();
@@ -720,7 +720,7 @@ public:
virtual
~FrontEnd();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren()
{
if (!m_wrapper_sp || m_interpreter == NULL)
@@ -729,7 +729,7 @@ public:
}
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx);
+ GetChildAtIndex (size_t idx);
virtual bool
Update()
@@ -911,7 +911,7 @@ public:
}
int
- GetRealIndexForIndex(int i);
+ GetRealIndexForIndex(size_t i);
bool
IsScripted()
@@ -939,7 +939,7 @@ public:
{
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren()
{
return filter->GetCount();
@@ -952,7 +952,7 @@ public:
}
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
if (idx >= filter->GetCount())
return lldb::ValueObjectSP();
diff --git a/lldb/include/lldb/Core/FormatManager.h b/lldb/include/lldb/Core/FormatManager.h
index 5bf544d4ebd..600ae74d132 100644
--- a/lldb/include/lldb/Core/FormatManager.h
+++ b/lldb/include/lldb/Core/FormatManager.h
@@ -150,7 +150,7 @@ public:
#endif
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierForSummaryAtIndex (uint32_t index)
+ GetTypeNameSpecifierForSummaryAtIndex (size_t index)
{
if (index < m_summary_nav->GetCount())
return m_summary_nav->GetTypeNameSpecifierAtIndex(index);
@@ -159,7 +159,7 @@ public:
}
SummaryNavigator::MapValueType
- GetSummaryAtIndex (uint32_t index)
+ GetSummaryAtIndex (size_t index)
{
if (index < m_summary_nav->GetCount())
return m_summary_nav->GetAtIndex(index);
@@ -168,7 +168,7 @@ public:
}
FilterNavigator::MapValueType
- GetFilterAtIndex (uint32_t index)
+ GetFilterAtIndex (size_t index)
{
if (index < m_filter_nav->GetCount())
return m_filter_nav->GetAtIndex(index);
@@ -177,7 +177,7 @@ public:
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierForFilterAtIndex (uint32_t index)
+ GetTypeNameSpecifierForFilterAtIndex (size_t index)
{
if (index < m_filter_nav->GetCount())
return m_filter_nav->GetTypeNameSpecifierAtIndex(index);
@@ -199,7 +199,7 @@ public:
}
SynthNavigator::MapValueType
- GetSyntheticAtIndex (uint32_t index)
+ GetSyntheticAtIndex (size_t index)
{
if (index < m_synth_nav->GetCount())
return m_synth_nav->GetAtIndex(index);
@@ -208,7 +208,7 @@ public:
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)
+ GetTypeNameSpecifierForSyntheticAtIndex (size_t index)
{
if (index < m_synth_nav->GetCount())
return m_synth_nav->GetTypeNameSpecifierAtIndex(index);
@@ -486,7 +486,7 @@ public:
LoopThrough (CallbackType callback, void* param);
lldb::TypeCategoryImplSP
- GetAtIndex (uint32_t);
+ GetAtIndex (size_t index);
bool
AnyMatches (ConstString type_name,
@@ -495,7 +495,7 @@ public:
const char** matching_category = NULL,
TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);
- uint32_t
+ size_t
GetCount ()
{
return m_map.size();
@@ -615,14 +615,14 @@ public:
return m_categories_map.Clear();
}
- uint32_t
+ size_t
GetCategoriesCount ()
{
return m_categories_map.GetCount();
}
lldb::TypeCategoryImplSP
- GetCategoryAtIndex (uint32_t index)
+ GetCategoryAtIndex (size_t index)
{
return m_categories_map.GetAtIndex(index);
}
diff --git a/lldb/include/lldb/Core/FormatNavigator.h b/lldb/include/lldb/Core/FormatNavigator.h
index 789f2d175f0..38cfa1f6c4e 100644
--- a/lldb/include/lldb/Core/FormatNavigator.h
+++ b/lldb/include/lldb/Core/FormatNavigator.h
@@ -185,14 +185,14 @@ public:
}
}
- uint32_t
+ size_t
GetCount ()
{
return m_map.size();
}
ValueSP
- GetValueAtIndex (uint32_t index)
+ GetValueAtIndex (size_t index)
{
Mutex::Locker locker(m_map_mutex);
MapIterator iter = m_map.begin();
@@ -208,7 +208,7 @@ public:
}
KeyType
- GetKeyAtIndex (uint32_t index)
+ GetKeyAtIndex (size_t index)
{
Mutex::Locker locker(m_map_mutex);
MapIterator iter = m_map.begin();
@@ -316,13 +316,13 @@ public:
}
MapValueType
- GetAtIndex (uint32_t index)
+ GetAtIndex (size_t index)
{
return m_format_map.GetValueAtIndex(index);
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex (uint32_t index)
+ GetTypeNameSpecifierAtIndex (size_t index)
{
return GetTypeNameSpecifierAtIndex_Impl(index, (KeyType*)NULL);
}
@@ -339,7 +339,7 @@ public:
m_format_map.LoopThrough(callback,param);
}
- uint32_t
+ size_t
GetCount ()
{
return m_format_map.GetCount();
@@ -405,7 +405,7 @@ protected:
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex_Impl (uint32_t index, ConstString *dummy)
+ GetTypeNameSpecifierAtIndex_Impl (size_t index, ConstString *dummy)
{
ConstString key = m_format_map.GetKeyAtIndex(index);
if (key)
@@ -416,7 +416,7 @@ protected:
}
lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex_Impl (uint32_t index, lldb::RegularExpressionSP *dummy)
+ GetTypeNameSpecifierAtIndex_Impl (size_t index, lldb::RegularExpressionSP *dummy)
{
lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);
if (regex.get() == NULL)
diff --git a/lldb/include/lldb/Core/MappedHash.h b/lldb/include/lldb/Core/MappedHash.h
index 1198a2dee03..77da44a4eee 100644
--- a/lldb/include/lldb/Core/MappedHash.h
+++ b/lldb/include/lldb/Core/MappedHash.h
@@ -36,7 +36,7 @@ public:
}
static uint32_t
- HashString (const uint8_t hash_function, const char *s)
+ HashString (uint32_t hash_function, const char *s)
{
switch (hash_function)
{
@@ -115,8 +115,8 @@ public:
s.Printf ("header.header_data_len = 0x%8.8x %u\n", header_data_len, header_data_len);
}
- virtual uint32_t
- Read (lldb_private::DataExtractor &data, uint32_t offset)
+ virtual lldb::offset_t
+ Read (lldb_private::DataExtractor &data, lldb::offset_t offset)
{
if (data.ValidOffsetForDataOfSize (offset,
sizeof (magic) +
@@ -140,14 +140,14 @@ public:
data.SetByteOrder(lldb::eByteOrderBig);
break;
default:
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
}
else
{
// Magic bytes didn't match
version = 0;
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
}
@@ -155,7 +155,7 @@ public:
if (version != 1)
{
// Unsupported version
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
hash_function = data.GetU16 (&offset);
if (hash_function == 4)
@@ -165,7 +165,7 @@ public:
header_data_len = data.GetU32 (&offset);
return offset;
}
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
//
// // Returns a buffer that contains a serialized version of this table
@@ -379,8 +379,8 @@ public:
m_hash_values (NULL),
m_hash_offsets (NULL)
{
- uint32_t offset = m_header.Read (data, 0);
- if (offset != UINT32_MAX && IsValid ())
+ lldb::offset_t offset = m_header.Read (data, 0);
+ if (offset != LLDB_INVALID_OFFSET && IsValid ())
{
m_hash_indexes = (uint32_t *)data.GetData (&offset, m_header.bucket_count * sizeof(uint32_t));
m_hash_values = (uint32_t *)data.GetData (&offset, m_header.hashes_count * sizeof(uint32_t));
@@ -443,10 +443,10 @@ public:
const uint32_t curr_hash_value = GetHashValue (hash_idx);
if (curr_hash_value == hash_value)
{
- uint32_t hash_data_offset = GetHashDataOffset (hash_idx);
+ lldb::offset_t hash_data_offset = GetHashDataOffset (hash_idx);
while (hash_data_offset != UINT32_MAX)
{
- const uint32_t prev_hash_data_offset = hash_data_offset;
+ const lldb::offset_t prev_hash_data_offset = hash_data_offset;
Result hash_result = GetHashDataForName (name, &hash_data_offset, pair);
// Check the result of getting our hash data
switch (hash_result)
@@ -505,7 +505,7 @@ public:
virtual Result
GetHashDataForName (const char *name,
- uint32_t* hash_data_offset_ptr,
+ lldb::offset_t* hash_data_offset_ptr,
Pair &pair) const = 0;
const HeaderType &
diff --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index d63ed92a644..3f98e815bb1 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -247,7 +247,7 @@ public:
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list);
@@ -284,7 +284,7 @@ public:
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
@@ -315,7 +315,7 @@ public:
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindFunctions (const RegularExpression& regex,
bool symbols_ok,
bool inlines_ok,
@@ -348,11 +348,11 @@ public:
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list);
//------------------------------------------------------------------
@@ -377,10 +377,10 @@ public:
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list);
//------------------------------------------------------------------
@@ -424,11 +424,11 @@ public:
/// @return
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindTypes (const SymbolContext& sc,
const ConstString &type_name,
bool exact_match,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types);
lldb::TypeSP
@@ -458,11 +458,11 @@ public:
/// @return
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindTypesInNamespace (const SymbolContext& sc,
const ConstString &type_name,
const ClangNamespaceDecl *namespace_decl,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& type_list);
//------------------------------------------------------------------
@@ -570,11 +570,11 @@ public:
/// The number of compile units that the symbol vendor plug-in
/// finds.
//------------------------------------------------------------------
- uint32_t
+ size_t
GetNumCompileUnits();
lldb::CompUnitSP
- GetCompileUnitAtIndex (uint32_t);
+ GetCompileUnitAtIndex (size_t idx);
const ConstString &
GetObjectName() const;
@@ -963,12 +963,12 @@ protected:
private:
- uint32_t
+ size_t
FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types);
diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h
index 8d13ed5aa29..16e2375abdc 100644
--- a/lldb/include/lldb/Core/ModuleList.h
+++ b/lldb/include/lldb/Core/ModuleList.h
@@ -165,7 +165,7 @@ public:
return m_modules_mutex;
}
- uint32_t
+ size_t
GetIndexForModule (const Module *module) const;
//------------------------------------------------------------------
@@ -181,7 +181,7 @@ public:
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
lldb::ModuleSP
- GetModuleAtIndex (uint32_t idx) const;
+ GetModuleAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get the module shared pointer for the module at index \a idx without
@@ -198,7 +198,7 @@ public:
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
lldb::ModuleSP
- GetModuleAtIndexUnlocked (uint32_t idx) const;
+ GetModuleAtIndexUnlocked (size_t idx) const;
//------------------------------------------------------------------
/// Get the module pointer for the module at index \a idx.
@@ -213,7 +213,7 @@ public:
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
Module*
- GetModulePointerAtIndex (uint32_t idx) const;
+ GetModulePointerAtIndex (size_t idx) const;
//------------------------------------------------------------------
/// Get the module pointer for the module at index \a idx without
@@ -230,7 +230,7 @@ public:
/// @see ModuleList::GetSize()
//------------------------------------------------------------------
Module*
- GetModulePointerAtIndexUnlocked (uint32_t idx) const;
+ GetModulePointerAtIndexUnlocked (size_t idx) const;
//------------------------------------------------------------------
/// Find compile units by partial or full path.
@@ -253,7 +253,7 @@ public:
/// @return
/// The number of matches added to \a sc_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list) const;
@@ -261,7 +261,7 @@ public:
//------------------------------------------------------------------
/// @see Module::FindFunctions ()
//------------------------------------------------------------------
- uint32_t
+ size_t
FindFunctions (const ConstString &name,
uint32_t name_type_mask,
bool include_symbols,
@@ -292,10 +292,10 @@ public:
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const ConstString &name,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const;
//------------------------------------------------------------------
@@ -320,10 +320,10 @@ public:
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const;
//------------------------------------------------------------------
@@ -422,11 +422,11 @@ public:
/// @return
/// The number of matches added to \a type_list.
//------------------------------------------------------------------
- uint32_t
+ size_t
FindTypes (const SymbolContext& sc,
const ConstString &name,
bool name_is_fully_qualified,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types) const;
bool
@@ -503,7 +503,7 @@ public:
FindSharedModules (const ModuleSpec &module_spec,
ModuleList &matching_module_list);
- static uint32_t
+ static size_t
RemoveOrphanSharedModules (bool mandatory);
static bool
diff --git a/lldb/include/lldb/Core/PluginManager.h b/lldb/include/lldb/Core/PluginManager.h
index 1b84e66312a..dca436457c7 100644
--- a/lldb/include/lldb/Core/PluginManager.h
+++ b/lldb/include/lldb/Core/PluginManager.h
@@ -216,7 +216,7 @@ public:
static const char *
GetPlatformPluginDescriptionAtIndex (uint32_t idx);
- static uint32_t
+ static size_t
AutoCompletePlatformName (const char *partial_name,
StringList &matches);
//------------------------------------------------------------------
diff --git a/lldb/include/lldb/Core/RegisterValue.h b/lldb/include/lldb/Core/RegisterValue.h
index 5c340defed6..67a43239473 100644
--- a/lldb/include/lldb/Core/RegisterValue.h
+++ b/lldb/include/lldb/Core/RegisterValue.h
@@ -345,7 +345,7 @@ namespace lldb_private {
Error
SetValueFromData (const RegisterInfo *reg_info,
DataExtractor &data,
- uint32_t offset,
+ lldb::offset_t offset,
bool partial_data_ok);
// The default value of 0 for reg_name_right_align_at means no alignment at all.
diff --git a/lldb/include/lldb/Core/Scalar.h b/lldb/include/lldb/Core/Scalar.h
index 60c182e2338..3636b243eb6 100644
--- a/lldb/include/lldb/Core/Scalar.h
+++ b/lldb/include/lldb/Core/Scalar.h
@@ -73,9 +73,9 @@ public:
bool
GetData (DataExtractor &data, size_t limit_byte_size = UINT32_MAX) const;
- uint32_t
+ size_t
GetAsMemoryData (void *dst,
- uint32_t dst_len,
+ size_t dst_len,
lldb::ByteOrder dst_byte_order,
Error &error) const;
@@ -219,7 +219,7 @@ public:
GetRawBits64 (uint64_t fail_value) const;
Error
- SetValueFromCString (const char *s, lldb::Encoding encoding, uint32_t byte_size);
+ SetValueFromCString (const char *s, lldb::Encoding encoding, size_t byte_size);
static bool
UIntValueIsValidForSize (uint64_t uval64, size_t total_byte_size)
@@ -249,6 +249,16 @@ public:
}
protected:
+ typedef int sint_t;
+ typedef unsigned int uint_t;
+ typedef long slong_t;
+ typedef unsigned long ulong_t;
+ typedef long long slonglong_t;
+ typedef unsigned long long ulonglong_t;
+ typedef float float_t;
+ typedef double double_t;
+ typedef long double long_double_t;
+
union ValueData
{
int sint;
diff --git a/lldb/include/lldb/Core/Section.h b/lldb/include/lldb/Core/Section.h
index d3dbe1adee7..931c4535778 100644
--- a/lldb/include/lldb/Core/Section.h
+++ b/lldb/include/lldb/Core/Section.h
@@ -34,13 +34,13 @@ public:
virtual
~SectionList();
- uint32_t
+ size_t
AddSection (const lldb::SectionSP& section_sp);
- uint32_t
+ size_t
AddUniqueSection (const lldb::SectionSP& section_sp);
- uint32_t
+ size_t
FindSectionIndex (const Section* sect);
bool
@@ -56,7 +56,7 @@ public:
FindSectionByID (lldb::user_id_t sect_id) const;
lldb::SectionSP
- FindSectionByType (lldb::SectionType sect_type, bool check_children, uint32_t start_idx = 0) const;
+ FindSectionByType (lldb::SectionType sect_type, bool check_children, size_t start_idx = 0) const;
lldb::SectionSP
FindSectionContainingFileAddress (lldb::addr_t addr, uint32_t depth = UINT32_MAX) const;
@@ -82,7 +82,7 @@ public:
ReplaceSection (lldb::user_id_t sect_id, const lldb::SectionSP& section_sp, uint32_t depth = UINT32_MAX);
lldb::SectionSP
- GetSectionAtIndex (uint32_t idx) const;
+ GetSectionAtIndex (size_t idx) const;
size_t
Slide (lldb::addr_t slide_amount, bool slide_children);
diff --git a/lldb/include/lldb/Core/Stream.h b/lldb/include/lldb/Core/Stream.h
index ca329878adc..0fd4aac041a 100644
--- a/lldb/include/lldb/Core/Stream.h
+++ b/lldb/include/lldb/Core/Stream.h
@@ -87,13 +87,13 @@ public:
/// @return
/// The number of bytes that were appended to the stream.
//------------------------------------------------------------------
- virtual int
+ virtual size_t
Write (const void *src, size_t src_len) = 0;
//------------------------------------------------------------------
// Member functions
//------------------------------------------------------------------
- int
+ size_t
PutChar (char ch);
//------------------------------------------------------------------
@@ -125,7 +125,7 @@ public:
/// @return
/// The number of bytes that were appended to the stream.
//------------------------------------------------------------------
- int
+ size_t
PrintfAsRawHex8 (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
//------------------------------------------------------------------
@@ -142,59 +142,59 @@ public:
/// @return
/// The number of bytes that were appended to the stream.
//------------------------------------------------------------------
- int
+ size_t
PutHex8 (uint8_t uvalue);
- int
+ size_t
PutNHex8 (size_t n, uint8_t uvalue);
- int
+ size_t
PutHex16 (uint16_t uvalue,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutHex32 (uint32_t uvalue,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutHex64 (uint64_t uvalue,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutMaxHex64 (uint64_t uvalue,
size_t byte_size,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutFloat (float f,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutDouble (double d,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutLongDouble (long double ld,
lldb::ByteOrder byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutPointer (void *ptr);
// Append \a src_len bytes from \a src to the stream as hex characters
// (two ascii characters per byte of input data)
- int
+ size_t
PutBytesAsRawHex8 (const void *src,
size_t src_len,
lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid,
lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid);
// Append \a src_len bytes from \a s to the stream as binary data.
- int
+ size_t
PutRawBytes (const void *s,
size_t src_len,
lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid,
lldb::ByteOrder dst_byte_order = lldb::eByteOrderInvalid);
- int
+ size_t
PutCStringAsRawHex8 (const char *s);
//------------------------------------------------------------------
@@ -359,7 +359,7 @@ public:
/// A suffix C string. If NULL, no suffix will be output.
//------------------------------------------------------------------
void
- Address (uint64_t addr, int addr_size, const char *prefix = NULL, const char *suffix = NULL);
+ Address (uint64_t addr, uint32_t addr_size, const char *prefix = NULL, const char *suffix = NULL);
//------------------------------------------------------------------
/// Output an address range to this stream.
@@ -383,7 +383,7 @@ public:
/// A suffix C string. If NULL, no suffix will be output.
//------------------------------------------------------------------
void
- AddressRange(uint64_t lo_addr, uint64_t hi_addr, int addr_size, const char *prefix = NULL, const char *suffix = NULL);
+ AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix = NULL, const char *suffix = NULL);
//------------------------------------------------------------------
/// Output a C string to the stream.
@@ -393,13 +393,13 @@ public:
/// @param[in] cstr
/// The string to be output to the stream.
//------------------------------------------------------------------
- int
+ size_t
PutCString (const char *cstr);
//------------------------------------------------------------------
/// Output and End of Line character to the stream.
//------------------------------------------------------------------
- int
+ size_t
EOL();
//------------------------------------------------------------------
@@ -409,7 +409,7 @@ public:
/// The size of an address in bytes that is used when outputting
/// address and pointer values to the stream.
//------------------------------------------------------------------
- uint8_t
+ uint32_t
GetAddressByteSize () const;
//------------------------------------------------------------------
@@ -478,7 +478,7 @@ public:
/// A C string to print following the indentation. If NULL, just
/// output the indentation characters.
//------------------------------------------------------------------
- int
+ size_t
Indent(const char *s = NULL);
//------------------------------------------------------------------
@@ -520,10 +520,10 @@ public:
/// Variable arguments that are needed for the printf style
/// format string \a format.
//------------------------------------------------------------------
- int
+ size_t
Printf (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
- int
+ size_t
PrintfVarArg(const char *format, va_list args);
//------------------------------------------------------------------
@@ -549,7 +549,7 @@ public:
/// address and pointer values.
//------------------------------------------------------------------
void
- SetAddressByteSize (uint8_t addr_size);
+ SetAddressByteSize (uint32_t addr_size);
//------------------------------------------------------------------
/// Set the current indentation level.
@@ -572,7 +572,7 @@ public:
/// @param[in] format
/// The optional printf format that can be overridden.
//------------------------------------------------------------------
- int
+ size_t
PutSLEB128 (int64_t uval);
//------------------------------------------------------------------
@@ -587,7 +587,7 @@ public:
/// @param[in] format
/// The optional printf format that can be overridden.
//------------------------------------------------------------------
- int
+ size_t
PutULEB128 (uint64_t uval);
static void
@@ -597,12 +597,12 @@ protected:
//------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
- Flags m_flags; ///< Dump flags.
- uint8_t m_addr_size; ///< Size of an address in bytes.
- lldb::ByteOrder m_byte_order;///< Byte order to use when encoding scalar types.
- int m_indent_level; ///< Indention level.
+ Flags m_flags; ///< Dump flags.
+ uint32_t m_addr_size; ///< Size of an address in bytes.
+ lldb::ByteOrder m_byte_order; ///< Byte order to use when encoding scalar types.
+ int m_indent_level; ///< Indention level.
- int _PutHex8 (uint8_t uvalue, bool add_prefix);
+ size_t _PutHex8 (uint8_t uvalue, bool add_prefix);
};
} // namespace lldb_private
diff --git a/lldb/include/lldb/Core/StreamAsynchronousIO.h b/lldb/include/lldb/Core/StreamAsynchronousIO.h
index 9dd798ce6d5..0e3e9ee9bcf 100644
--- a/lldb/include/lldb/Core/StreamAsynchronousIO.h
+++ b/lldb/include/lldb/Core/StreamAsynchronousIO.h
@@ -28,7 +28,7 @@ public:
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *src, size_t src_len);
diff --git a/lldb/include/lldb/Core/StreamBuffer.h b/lldb/include/lldb/Core/StreamBuffer.h
index 358f39b37b7..9d25e842ecc 100644
--- a/lldb/include/lldb/Core/StreamBuffer.h
+++ b/lldb/include/lldb/Core/StreamBuffer.h
@@ -47,7 +47,7 @@ public:
// Nothing to do when flushing a buffer based stream...
}
- virtual int
+ virtual size_t
Write (const void *s, size_t length)
{
if (s && length)
diff --git a/lldb/include/lldb/Core/StreamCallback.h b/lldb/include/lldb/Core/StreamCallback.h
index bb25e4e4073..b5fb91c6ce0 100644
--- a/lldb/include/lldb/Core/StreamCallback.h
+++ b/lldb/include/lldb/Core/StreamCallback.h
@@ -29,7 +29,7 @@ public:
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *src, size_t src_len);
diff --git a/lldb/include/lldb/Core/StreamFile.h b/lldb/include/lldb/Core/StreamFile.h
index 0a60a801eac..d032c0b21e6 100644
--- a/lldb/include/lldb/Core/StreamFile.h
+++ b/lldb/include/lldb/Core/StreamFile.h
@@ -57,7 +57,7 @@ public:
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *s, size_t length);
protected:
diff --git a/lldb/include/lldb/Core/StreamString.h b/lldb/include/lldb/Core/StreamString.h
index 76304fff54b..a26ad2d16a0 100644
--- a/lldb/include/lldb/Core/StreamString.h
+++ b/lldb/include/lldb/Core/StreamString.h
@@ -31,7 +31,7 @@ public:
virtual void
Flush ();
- virtual int
+ virtual size_t
Write (const void *s, size_t length);
void
diff --git a/lldb/include/lldb/Core/StreamTee.h b/lldb/include/lldb/Core/StreamTee.h
index d315551c73a..e2a29a37455 100644
--- a/lldb/include/lldb/Core/StreamTee.h
+++ b/lldb/include/lldb/Core/StreamTee.h
@@ -93,14 +93,14 @@ public:
}
}
- virtual int
+ virtual size_t
Write (const void *s, size_t length)
{
Mutex::Locker locker (m_streams_mutex);
if (m_streams.empty())
return 0;
- int min_bytes_written = INT_MAX;
+ size_t min_bytes_written = SIZE_MAX;
collection::iterator pos, end;
for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos)
{
@@ -111,11 +111,13 @@ public:
Stream *strm = pos->get();
if (strm)
{
- int bytes_written = strm->Write (s, length);
+ const size_t bytes_written = strm->Write (s, length);
if (min_bytes_written > bytes_written)
min_bytes_written = bytes_written;
}
}
+ if (min_bytes_written == SIZE_MAX)
+ return 0;
return min_bytes_written;
}
diff --git a/lldb/include/lldb/Core/StringList.h b/lldb/include/lldb/Core/StringList.h
index 3ae6a157195..5503274173c 100644
--- a/lldb/include/lldb/Core/StringList.h
+++ b/lldb/include/lldb/Core/StringList.h
@@ -48,7 +48,7 @@ public:
bool
ReadFileLines (FileSpec &input_file);
- uint32_t
+ size_t
GetSize () const;
const char *
diff --git a/lldb/include/lldb/Core/VMRange.h b/lldb/include/lldb/Core/VMRange.h
index 9a6b465e1aa..94c83e730e9 100644
--- a/lldb/include/lldb/Core/VMRange.h
+++ b/lldb/include/lldb/Core/VMRange.h
@@ -161,7 +161,7 @@ public:
// Returns a valid index into coll when a match is found, else UINT32_MAX
// is returned
- static uint32_t
+ static size_t
FindRangeIndexThatContainsValue (const VMRange::collection& coll, lldb::addr_t value);
protected:
diff --git a/lldb/include/lldb/Core/Value.h b/lldb/include/lldb/Core/Value.h
index c3fa1facedc..2ce275ac9fa 100644
--- a/lldb/include/lldb/Core/Value.h
+++ b/lldb/include/lldb/Core/Value.h
@@ -213,7 +213,7 @@ public:
}
void
- ResizeData(int len);
+ ResizeData(size_t len);
bool
ValueOf(ExecutionContext *exe_ctx, clang::ASTContext *ast_context);
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 244cb2cf173..e23fc43d037 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -732,32 +732,32 @@ public:
GetName() const;
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx, bool can_create);
+ GetChildAtIndex (size_t idx, bool can_create);
// this will always create the children if necessary
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::initializer_list<uint32_t> &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::initializer_list<size_t> &idxs,
+ size_t* index_of_error = NULL);
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::vector<uint32_t> &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::vector<size_t> &idxs,
+ size_t* index_of_error = NULL);
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::initializer_list< std::pair<uint32_t, bool> > &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::initializer_list< std::pair<size_t, bool> > &idxs,
+ size_t* index_of_error = NULL);
lldb::ValueObjectSP
- GetChildAtIndexPath (const std::vector< std::pair<uint32_t, bool> > &idxs,
- uint32_t* index_of_error = NULL);
+ GetChildAtIndexPath (const std::vector< std::pair<size_t, bool> > &idxs,
+ size_t* index_of_error = NULL);
virtual lldb::ValueObjectSP
GetChildMemberWithName (const ConstString &name, bool can_create);
- virtual uint32_t
+ virtual size_t
GetIndexOfChildWithName (const ConstString &name);
- uint32_t
+ size_t
GetNumChildren ();
const Value &
@@ -833,13 +833,13 @@ public:
GetSyntheticChild (const ConstString &key) const;
lldb::ValueObjectSP
- GetSyntheticArrayMember (int32_t index, bool can_create);
+ GetSyntheticArrayMember (size_t index, bool can_create);
lldb::ValueObjectSP
- GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create);
+ GetSyntheticArrayMemberFromPointer (size_t index, bool can_create);
lldb::ValueObjectSP
- GetSyntheticArrayMemberFromArray (int32_t index, bool can_create);
+ GetSyntheticArrayMemberFromArray (size_t index, bool can_create);
lldb::ValueObjectSP
GetSyntheticBitFieldChild (uint32_t from, uint32_t to, bool can_create);
@@ -1117,13 +1117,13 @@ protected:
{
public:
ChildrenManager() :
- m_mutex(Mutex::eMutexTypeRecursive),
- m_children(),
- m_children_count(0)
+ m_mutex(Mutex::eMutexTypeRecursive),
+ m_children(),
+ m_children_count(0)
{}
bool
- HasChildAtIndex (uint32_t idx)
+ HasChildAtIndex (size_t idx)
{
Mutex::Locker locker(m_mutex);
ChildrenIterator iter = m_children.find(idx);
@@ -1132,7 +1132,7 @@ protected:
}
ValueObject*
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
Mutex::Locker locker(m_mutex);
ChildrenIterator iter = m_children.find(idx);
@@ -1144,7 +1144,7 @@ protected:
}
void
- SetChildAtIndex (uint32_t idx, ValueObject* valobj)
+ SetChildAtIndex (size_t idx, ValueObject* valobj)
{
ChildrenPair pair(idx,valobj); // we do not need to be mutex-protected to make a pair
Mutex::Locker locker(m_mutex);
@@ -1152,12 +1152,12 @@ protected:
}
void
- SetChildrenCount (uint32_t count)
+ SetChildrenCount (size_t count)
{
m_children_count = count;
}
- uint32_t
+ size_t
GetChildrenCount ()
{
return m_children_count;
@@ -1172,12 +1172,12 @@ protected:
}
private:
- typedef std::map<uint32_t, ValueObject*> ChildrenMap;
+ typedef std::map<size_t, ValueObject*> ChildrenMap;
typedef ChildrenMap::iterator ChildrenIterator;
typedef ChildrenMap::value_type ChildrenPair;
Mutex m_mutex;
ChildrenMap m_children;
- uint32_t m_children_count;
+ size_t m_children_count;
};
//------------------------------------------------------------------
@@ -1279,14 +1279,14 @@ protected:
// Should only be called by ValueObject::GetChildAtIndex()
// Returns a ValueObject managed by this ValueObject's manager.
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
// Should only be called by ValueObject::GetNumChildren()
- virtual uint32_t
+ virtual size_t
CalculateNumChildren() = 0;
void
- SetNumChildren (uint32_t num_children);
+ SetNumChildren (size_t num_children);
void
SetValueDidChange (bool value_changed);
diff --git a/lldb/include/lldb/Core/ValueObjectCast.h b/lldb/include/lldb/Core/ValueObjectCast.h
index e7218b5dfaf..a7b79b2f153 100644
--- a/lldb/include/lldb/Core/ValueObjectCast.h
+++ b/lldb/include/lldb/Core/ValueObjectCast.h
@@ -35,7 +35,7 @@ public:
virtual size_t
GetByteSize();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
diff --git a/lldb/include/lldb/Core/ValueObjectChild.h b/lldb/include/lldb/Core/ValueObjectChild.h
index 4e1e47fa613..7339a587599 100644
--- a/lldb/include/lldb/Core/ValueObjectChild.h
+++ b/lldb/include/lldb/Core/ValueObjectChild.h
@@ -53,7 +53,7 @@ public:
virtual lldb::ValueType
GetValueType() const;
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ConstString
diff --git a/lldb/include/lldb/Core/ValueObjectConstResult.h b/lldb/include/lldb/Core/ValueObjectConstResult.h
index 1ce8ad84d02..fdd4565fc20 100644
--- a/lldb/include/lldb/Core/ValueObjectConstResult.h
+++ b/lldb/include/lldb/Core/ValueObjectConstResult.h
@@ -47,7 +47,7 @@ public:
const ConstString &name,
const lldb::DataBufferSP &result_data_sp,
lldb::ByteOrder byte_order,
- uint8_t addr_size,
+ uint32_t addr_size,
lldb::addr_t address = LLDB_INVALID_ADDRESS);
static lldb::ValueObjectSP
@@ -57,7 +57,7 @@ public:
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size);
+ uint32_t addr_byte_size);
static lldb::ValueObjectSP
Create (ExecutionContextScope *exe_scope,
@@ -78,7 +78,7 @@ public:
virtual lldb::ValueType
GetValueType() const;
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ConstString
@@ -101,7 +101,7 @@ public:
Dereference (Error &error);
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
virtual lldb::ValueObjectSP
GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
@@ -147,7 +147,7 @@ protected:
clang::ASTContext *m_clang_ast; // The clang AST that the clang type comes from
ConstString m_type_name;
- uint32_t m_byte_size;
+ size_t m_byte_size;
ValueObjectConstResultImpl m_impl;
@@ -171,7 +171,7 @@ private:
const ConstString &name,
const lldb::DataBufferSP &result_data_sp,
lldb::ByteOrder byte_order,
- uint8_t addr_size,
+ uint32_t addr_size,
lldb::addr_t address);
ValueObjectConstResult (ExecutionContextScope *exe_scope,
@@ -180,7 +180,7 @@ private:
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size);
+ uint32_t addr_byte_size);
ValueObjectConstResult (ExecutionContextScope *exe_scope,
clang::ASTContext *clang_ast,
diff --git a/lldb/include/lldb/Core/ValueObjectConstResultChild.h b/lldb/include/lldb/Core/ValueObjectConstResultChild.h
index 3dcef1ff4e5..fbc3e7c694d 100644
--- a/lldb/include/lldb/Core/ValueObjectConstResultChild.h
+++ b/lldb/include/lldb/Core/ValueObjectConstResultChild.h
@@ -43,7 +43,7 @@ public:
Dereference (Error &error);
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
virtual lldb::clang_type_t
GetClangType ()
diff --git a/lldb/include/lldb/Core/ValueObjectConstResultImpl.h b/lldb/include/lldb/Core/ValueObjectConstResultImpl.h
index b8c846fa1f5..271b9382356 100644
--- a/lldb/include/lldb/Core/ValueObjectConstResultImpl.h
+++ b/lldb/include/lldb/Core/ValueObjectConstResultImpl.h
@@ -39,7 +39,7 @@ public:
Dereference (Error &error);
ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
lldb::ValueObjectSP
GetSyntheticChildAtOffset (uint32_t offset, const ClangASTType& type, bool can_create);
diff --git a/lldb/include/lldb/Core/ValueObjectDynamicValue.h b/lldb/include/lldb/Core/ValueObjectDynamicValue.h
index fd174e1d11d..f366194ba4f 100644
--- a/lldb/include/lldb/Core/ValueObjectDynamicValue.h
+++ b/lldb/include/lldb/Core/ValueObjectDynamicValue.h
@@ -38,7 +38,7 @@ public:
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
diff --git a/lldb/include/lldb/Core/ValueObjectList.h b/lldb/include/lldb/Core/ValueObjectList.h
index 5320eb75f2f..5bfe40b2e95 100644
--- a/lldb/include/lldb/Core/ValueObjectList.h
+++ b/lldb/include/lldb/Core/ValueObjectList.h
@@ -50,20 +50,20 @@ public:
lldb::ValueObjectSP
FindValueObjectByPointer (ValueObject *valobj);
- uint32_t
+ size_t
GetSize () const;
void
- Resize (uint32_t size);
+ Resize (size_t size);
lldb::ValueObjectSP
- GetValueObjectAtIndex (uint32_t idx);
+ GetValueObjectAtIndex (size_t idx);
lldb::ValueObjectSP
- RemoveValueObjectAtIndex (uint32_t idx);
+ RemoveValueObjectAtIndex (size_t idx);
void
- SetValueObjectAtIndex (uint32_t idx,
+ SetValueObjectAtIndex (size_t idx,
const lldb::ValueObjectSP &valobj_sp);
lldb::ValueObjectSP
diff --git a/lldb/include/lldb/Core/ValueObjectMemory.h b/lldb/include/lldb/Core/ValueObjectMemory.h
index 69aee77aa2c..78de9a99301 100644
--- a/lldb/include/lldb/Core/ValueObjectMemory.h
+++ b/lldb/include/lldb/Core/ValueObjectMemory.h
@@ -47,7 +47,7 @@ public:
virtual ConstString
GetTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
diff --git a/lldb/include/lldb/Core/ValueObjectRegister.h b/lldb/include/lldb/Core/ValueObjectRegister.h
index 6bc64cc6908..4e8e9bf6361 100644
--- a/lldb/include/lldb/Core/ValueObjectRegister.h
+++ b/lldb/include/lldb/Core/ValueObjectRegister.h
@@ -46,11 +46,11 @@ public:
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
protected:
virtual bool
@@ -96,16 +96,16 @@ public:
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual ValueObject *
- CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
+ CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index);
virtual lldb::ValueObjectSP
GetChildMemberWithName (const ConstString &name, bool can_create);
- virtual uint32_t
+ virtual size_t
GetIndexOfChildWithName (const ConstString &name);
@@ -154,7 +154,7 @@ public:
virtual ConstString
GetTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual bool
diff --git a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
index bc18aea6714..c64109119d3 100644
--- a/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
+++ b/lldb/include/lldb/Core/ValueObjectSyntheticFilter.h
@@ -42,19 +42,19 @@ public:
virtual bool
MightHaveChildren();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
GetValueType() const;
virtual lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx, bool can_create);
+ GetChildAtIndex (size_t idx, bool can_create);
virtual lldb::ValueObjectSP
GetChildMemberWithName (const ConstString &name, bool can_create);
- virtual uint32_t
+ virtual size_t
GetIndexOfChildWithName (const ConstString &name);
virtual bool
diff --git a/lldb/include/lldb/Core/ValueObjectVariable.h b/lldb/include/lldb/Core/ValueObjectVariable.h
index 70807b43003..9e2a626b574 100644
--- a/lldb/include/lldb/Core/ValueObjectVariable.h
+++ b/lldb/include/lldb/Core/ValueObjectVariable.h
@@ -40,7 +40,7 @@ public:
virtual ConstString
GetQualifiedTypeName();
- virtual uint32_t
+ virtual size_t
CalculateNumChildren();
virtual lldb::ValueType
diff --git a/lldb/include/lldb/Core/dwarf.h b/lldb/include/lldb/Core/dwarf.h
index 649e872309c..bf77125d86a 100644
--- a/lldb/include/lldb/Core/dwarf.h
+++ b/lldb/include/lldb/Core/dwarf.h
@@ -34,7 +34,6 @@ typedef uint32_t dw_offset_t; // Dwarf Debug Information Entry offset for
#endif
/* Constants */
-#define DW_INVALID_ADDRESS (~(dw_addr_t)0)
#define DW_INVALID_OFFSET (~(dw_offset_t)0)
#define DW_INVALID_INDEX 0xFFFFFFFFul
diff --git a/lldb/include/lldb/Expression/ClangFunction.h b/lldb/include/lldb/Expression/ClangFunction.h
index 348ba37a3e0..a056c6c1b07 100644
--- a/lldb/include/lldb/Expression/ClangFunction.h
+++ b/lldb/include/lldb/Expression/ClangFunction.h
@@ -132,7 +132,8 @@ public:
/// @return
/// The number of errors.
//------------------------------------------------------------------
- unsigned CompileFunction (Stream &errors);
+ unsigned
+ CompileFunction (Stream &errors);
//------------------------------------------------------------------
/// Insert the default function wrapper and its default argument struct
@@ -152,9 +153,10 @@ public:
/// @return
/// True on success; false otherwise.
//------------------------------------------------------------------
- bool InsertFunction (ExecutionContext &exe_ctx,
- lldb::addr_t &args_addr_ref,
- Stream &errors);
+ bool
+ InsertFunction (ExecutionContext &exe_ctx,
+ lldb::addr_t &args_addr_ref,
+ Stream &errors);
//------------------------------------------------------------------
/// Insert the default function wrapper (using the JIT)
diff --git a/lldb/include/lldb/Expression/DWARFExpression.h b/lldb/include/lldb/Expression/DWARFExpression.h
index d75bccb45bb..792f06347a5 100644
--- a/lldb/include/lldb/Expression/DWARFExpression.h
+++ b/lldb/include/lldb/Expression/DWARFExpression.h
@@ -59,8 +59,8 @@ public:
/// The byte length of the location expression.
//------------------------------------------------------------------
DWARFExpression(const DataExtractor& data,
- uint32_t data_offset,
- uint32_t data_length);
+ lldb::offset_t data_offset,
+ lldb::offset_t data_length);
//------------------------------------------------------------------
/// Copy constructor
@@ -184,7 +184,7 @@ public:
/// The byte length of the location expression.
//------------------------------------------------------------------
void
- SetOpcodeData(const DataExtractor& data, uint32_t data_offset, uint32_t data_length);
+ SetOpcodeData(const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length);
//------------------------------------------------------------------
/// Copy the DWARF location expression into a local buffer.
@@ -212,8 +212,8 @@ public:
//------------------------------------------------------------------
void
CopyOpcodeData (const DataExtractor& data,
- uint32_t data_offset,
- uint32_t data_length);
+ lldb::offset_t data_offset,
+ lldb::offset_t data_length);
//------------------------------------------------------------------
@@ -340,8 +340,8 @@ public:
ClangExpressionDeclMap *decl_map,
RegisterContext *reg_ctx,
const DataExtractor& opcodes,
- const uint32_t offset,
- const uint32_t length,
+ const lldb::offset_t offset,
+ const lldb::offset_t length,
const uint32_t reg_set,
const Value* initial_value_ptr,
Value& result,
@@ -403,16 +403,16 @@ protected:
//------------------------------------------------------------------
void
DumpLocation(Stream *s,
- uint32_t offset,
- uint32_t length,
+ lldb::offset_t offset,
+ lldb::offset_t length,
lldb::DescriptionLevel level,
ABI *abi) const;
bool
GetLocation (lldb::addr_t base_addr,
lldb::addr_t pc,
- uint32_t &offset,
- uint32_t &len);
+ lldb::offset_t &offset,
+ lldb::offset_t &len);
//------------------------------------------------------------------
/// Classes that inherit from DWARFExpression can see and modify these
diff --git a/lldb/include/lldb/Host/File.h b/lldb/include/lldb/Host/File.h
index 662a0eae89b..a0e625771fa 100644
--- a/lldb/include/lldb/Host/File.h
+++ b/lldb/include/lldb/Host/File.h
@@ -457,10 +457,10 @@ public:
/// Variable arguments that are needed for the printf style
/// format string \a format.
//------------------------------------------------------------------
- int
+ size_t
Printf (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
- int
+ size_t
PrintfVarArg(const char *format, va_list args);
protected:
diff --git a/lldb/include/lldb/Interpreter/Args.h b/lldb/include/lldb/Interpreter/Args.h
index 8296e2fd03b..84918367040 100644
--- a/lldb/include/lldb/Interpreter/Args.h
+++ b/lldb/include/lldb/Interpreter/Args.h
@@ -268,7 +268,7 @@ public:
// FIXME: Handle the quote character somehow.
//------------------------------------------------------------------
void
- SetArguments (int argc, const char **argv);
+ SetArguments (size_t argc, const char **argv);
void
SetArguments (const char **argv);
@@ -390,7 +390,7 @@ public:
static bool
StringToBoolean (const char *s, bool fail_value, bool *success_ptr);
- static int32_t
+ static int64_t
StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, int32_t fail_value, Error &error);
static lldb::ScriptLanguage
@@ -399,7 +399,7 @@ public:
static Error
StringToFormat (const char *s,
lldb::Format &format,
- uint32_t *byte_size_ptr); // If non-NULL, then a byte size can precede the format character
+ size_t *byte_size_ptr); // If non-NULL, then a byte size can precede the format character
static lldb::Encoding
StringToEncoding (const char *s,
diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index 7c2f302f64d..dd3dfc32a08 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -278,7 +278,7 @@ public:
const char *command_word,
const char *separator,
const char *help_text,
- uint32_t max_word_len);
+ size_t max_word_len);
// this mimics OutputFormattedHelpText but it does perform a much simpler
// formatting, basically ensuring line alignment. This is only good if you have
diff --git a/lldb/include/lldb/Interpreter/CommandObject.h b/lldb/include/lldb/Interpreter/CommandObject.h
index 49f131e8b54..4e2aba70ed9 100644
--- a/lldb/include/lldb/Interpreter/CommandObject.h
+++ b/lldb/include/lldb/Interpreter/CommandObject.h
@@ -409,7 +409,7 @@ public:
/// total number of matches, and the window the user wants returned.
///
/// @return
- /// \btrue if we were in an option, \bfalse otherwise.
+ /// The number of completions.
//------------------------------------------------------------------
virtual int
diff --git a/lldb/include/lldb/Interpreter/CommandReturnObject.h b/lldb/include/lldb/Interpreter/CommandReturnObject.h
index 737ef525a92..aa92e14c173 100644
--- a/lldb/include/lldb/Interpreter/CommandReturnObject.h
+++ b/lldb/include/lldb/Interpreter/CommandReturnObject.h
@@ -124,7 +124,7 @@ public:
AppendMessageWithFormat (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
void
- AppendRawWarning (const char *in_string, int len = -1);
+ AppendRawWarning (const char *in_string);
void
AppendWarning (const char *in_string);
@@ -136,7 +136,7 @@ public:
AppendError (const char *in_string);
void
- AppendRawError (const char *in_string, int len = -1);
+ AppendRawError (const char *in_string);
void
AppendErrorWithFormat (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
diff --git a/lldb/include/lldb/Interpreter/OptionValueArray.h b/lldb/include/lldb/Interpreter/OptionValueArray.h
index ef9a3f1c83b..39ae2f6f43d 100644
--- a/lldb/include/lldb/Interpreter/OptionValueArray.h
+++ b/lldb/include/lldb/Interpreter/OptionValueArray.h
@@ -79,14 +79,14 @@ public:
// Subclass specific functions
//---------------------------------------------------------------------
- uint32_t
+ size_t
GetSize () const
{
return m_values.size();
}
lldb::OptionValueSP
- operator[](uint32_t idx) const
+ operator[](size_t idx) const
{
lldb::OptionValueSP value_sp;
if (idx < m_values.size())
@@ -95,7 +95,7 @@ public:
}
lldb::OptionValueSP
- GetValueAtIndex (uint32_t idx) const
+ GetValueAtIndex (size_t idx) const
{
lldb::OptionValueSP value_sp;
if (idx < m_values.size())
@@ -117,7 +117,7 @@ public:
}
bool
- InsertValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
+ InsertValue (size_t idx, const lldb::OptionValueSP &value_sp)
{
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
@@ -133,7 +133,7 @@ public:
}
bool
- ReplaceValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
+ ReplaceValue (size_t idx, const lldb::OptionValueSP &value_sp)
{
// Make sure the value_sp object is allowed to contain
// values of the type passed in...
@@ -149,7 +149,7 @@ public:
}
bool
- DeleteValue (uint32_t idx)
+ DeleteValue (size_t idx)
{
if (idx < m_values.size())
{
diff --git a/lldb/include/lldb/Interpreter/OptionValueDictionary.h b/lldb/include/lldb/Interpreter/OptionValueDictionary.h
index 04322640395..5fb698b9f22 100644
--- a/lldb/include/lldb/Interpreter/OptionValueDictionary.h
+++ b/lldb/include/lldb/Interpreter/OptionValueDictionary.h
@@ -80,7 +80,7 @@ public:
// Subclass specific functions
//---------------------------------------------------------------------
- uint32_t
+ size_t
GetNumValues() const
{
return m_values.size();
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreter.h b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
index 420f7b3d896..cc66a08f0cf 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreter.h
@@ -340,7 +340,7 @@ public:
return false;
}
- virtual uint32_t
+ virtual size_t
CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor)
{
return 0;
diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
index 991428741eb..c6a66fdb432 100644
--- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
+++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h
@@ -98,7 +98,7 @@ public:
lldb::tid_t tid,
lldb::addr_t context);
- virtual uint32_t
+ virtual size_t
CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor);
virtual lldb::ValueObjectSP
diff --git a/lldb/include/lldb/Symbol/Block.h b/lldb/include/lldb/Symbol/Block.h
index f2041a12041..a2d703b9069 100644
--- a/lldb/include/lldb/Symbol/Block.h
+++ b/lldb/include/lldb/Symbol/Block.h
@@ -435,7 +435,7 @@ public:
Block *
FindBlockByID (lldb::user_id_t block_id);
- uint32_t
+ size_t
GetNumRanges () const
{
return m_ranges.GetSize();
diff --git a/lldb/include/lldb/Symbol/ClangASTContext.h b/lldb/include/lldb/Symbol/ClangASTContext.h
index 50875001fda..f2f6a989f3a 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -596,19 +596,19 @@ public:
static lldb::clang_type_t
GetDirectBaseClassAtIndex (clang::ASTContext *ast,
lldb::clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr);
static lldb::clang_type_t
GetVirtualBaseClassAtIndex (clang::ASTContext *ast,
lldb::clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr);
static lldb::clang_type_t
GetFieldAtIndex (clang::ASTContext *ast,
lldb::clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
std::string& name,
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
@@ -621,7 +621,7 @@ public:
GetChildClangTypeAtIndex (ExecutionContext *exe_ctx,
const char *parent_name,
lldb::clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
@@ -638,7 +638,7 @@ public:
clang::ASTContext *ast,
const char *parent_name,
lldb::clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h
index 4466e0232d6..150338d5c71 100644
--- a/lldb/include/lldb/Symbol/ObjectFile.h
+++ b/lldb/include/lldb/Symbol/ObjectFile.h
@@ -214,7 +214,7 @@ public:
/// architecture (and object for archives). Returns zero if no
/// architecture or object has been selected.
//------------------------------------------------------------------
- virtual size_t
+ virtual uint32_t
GetAddressByteSize () const = 0;
//------------------------------------------------------------------
diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h
index 2d72f7637b2..6cc72afff9f 100644
--- a/lldb/include/lldb/Symbol/Symbol.h
+++ b/lldb/include/lldb/Symbol/Symbol.h
@@ -37,7 +37,7 @@ public:
bool is_artificial,
const lldb::SectionSP &section_sp,
lldb::addr_t value,
- uint32_t size,
+ lldb::addr_t size,
uint32_t flags);
Symbol (uint32_t symID,
@@ -209,7 +209,7 @@ public:
GetByteSize () const;
void
- SetByteSize (uint32_t size)
+ SetByteSize (lldb::addr_t size)
{
m_calculated_size = size > 0;
m_addr_range.SetByteSize(size);
diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h
index f8ff2d03d7d..f6c05b0895b 100644
--- a/lldb/include/lldb/Symbol/SymbolContext.h
+++ b/lldb/include/lldb/Symbol/SymbolContext.h
@@ -459,10 +459,10 @@ public:
/// otherwise.
//------------------------------------------------------------------
bool
- GetContextAtIndex(uint32_t idx, SymbolContext& sc) const;
+ GetContextAtIndex(size_t idx, SymbolContext& sc) const;
bool
- RemoveContextAtIndex (uint32_t idx);
+ RemoveContextAtIndex (size_t idx);
//------------------------------------------------------------------
/// Get accessor for a symbol context list size.
///
diff --git a/lldb/include/lldb/Symbol/SymbolVendor.h b/lldb/include/lldb/Symbol/SymbolVendor.h
index e2b00561245..d466e1dde49 100644
--- a/lldb/include/lldb/Symbol/SymbolVendor.h
+++ b/lldb/include/lldb/Symbol/SymbolVendor.h
@@ -100,20 +100,20 @@ public:
uint32_t resolve_scope,
SymbolContextList& sc_list);
- virtual uint32_t
+ virtual size_t
FindGlobalVariables (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variables);
- virtual uint32_t
+ virtual size_t
FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variables);
- virtual uint32_t
+ virtual size_t
FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
uint32_t name_type_mask,
@@ -121,18 +121,18 @@ public:
bool append,
SymbolContextList& sc_list);
- virtual uint32_t
+ virtual size_t
FindFunctions (const RegularExpression& regex,
bool include_inlines,
bool append,
SymbolContextList& sc_list);
- virtual uint32_t
+ virtual size_t
FindTypes (const SymbolContext& sc,
const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types);
virtual lldb_private::ClangNamespaceDecl
@@ -140,15 +140,15 @@ public:
const ConstString &name,
const ClangNamespaceDecl *parent_namespace_decl);
- virtual uint32_t
+ virtual size_t
GetNumCompileUnits();
virtual bool
- SetCompileUnitAtIndex (uint32_t cu_idx,
+ SetCompileUnitAtIndex (size_t cu_idx,
const lldb::CompUnitSP &cu_sp);
virtual lldb::CompUnitSP
- GetCompileUnitAtIndex(uint32_t idx);
+ GetCompileUnitAtIndex(size_t idx);
TypeList&
GetTypeList()
diff --git a/lldb/include/lldb/Symbol/Symtab.h b/lldb/include/lldb/Symbol/Symtab.h
index f2a25574140..54c9b83639d 100644
--- a/lldb/include/lldb/Symbol/Symtab.h
+++ b/lldb/include/lldb/Symbol/Symtab.h
@@ -41,8 +41,8 @@ public:
Symtab(ObjectFile *objfile);
~Symtab();
- void Reserve (uint32_t count);
- Symbol * Resize (uint32_t count);
+ void Reserve (size_t count);
+ Symbol * Resize (size_t count);
uint32_t AddSymbol(const Symbol& symbol);
size_t GetNumSymbols() const;
void Dump(Stream *s, Target *target, SortOrder sort_type);
@@ -53,8 +53,8 @@ public:
return m_mutex;
}
Symbol * FindSymbolByID (lldb::user_id_t uid) const;
- Symbol * SymbolAtIndex (uint32_t idx);
- const Symbol * SymbolAtIndex (uint32_t idx) const;
+ Symbol * SymbolAtIndex (size_t idx);
+ const Symbol * SymbolAtIndex (size_t idx) const;
Symbol * FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx);
uint32_t AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
uint32_t AppendSymbolIndexesWithTypeAndFlagsValue (lldb::SymbolType symbol_type, uint32_t flags_value, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
@@ -114,7 +114,7 @@ protected:
private:
bool
- CheckSymbolAtIndex (uint32_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
+ CheckSymbolAtIndex (size_t idx, Debug symbol_debug_type, Visibility symbol_visibility) const
{
switch (symbol_debug_type)
{
diff --git a/lldb/include/lldb/Symbol/Variable.h b/lldb/include/lldb/Symbol/Variable.h
index 69938247678..ff416aa8a1c 100644
--- a/lldb/include/lldb/Symbol/Variable.h
+++ b/lldb/include/lldb/Symbol/Variable.h
@@ -144,9 +144,9 @@ public:
m_loc_is_const_data = b;
}
- typedef uint32_t (*GetVariableCallback) (void *baton,
- const char *name,
- VariableList &var_list);
+ typedef size_t (*GetVariableCallback) (void *baton,
+ const char *name,
+ VariableList &var_list);
static Error
diff --git a/lldb/include/lldb/Symbol/VariableList.h b/lldb/include/lldb/Symbol/VariableList.h
index e2b5722f1f6..a5189d26120 100644
--- a/lldb/include/lldb/Symbol/VariableList.h
+++ b/lldb/include/lldb/Symbol/VariableList.h
@@ -42,10 +42,10 @@ public:
Dump(Stream *s, bool show_context) const;
lldb::VariableSP
- GetVariableAtIndex(uint32_t idx) const;
+ GetVariableAtIndex(size_t idx) const;
lldb::VariableSP
- RemoveVariableAtIndex (uint32_t idx);
+ RemoveVariableAtIndex (size_t idx);
lldb::VariableSP
FindVariable (const ConstString& name);
diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h
index 7cf463f6d2a..1d0e50ad77e 100644
--- a/lldb/include/lldb/Target/Platform.h
+++ b/lldb/include/lldb/Target/Platform.h
@@ -480,13 +480,13 @@ namespace lldb_private {
}
// Used for column widths
- uint32_t
+ size_t
GetMaxUserIDNameLength() const
{
return m_max_uid_name_len;
}
// Used for column widths
- uint32_t
+ size_t
GetMaxGroupIDNameLength() const
{
return m_max_gid_name_len;
@@ -550,8 +550,8 @@ namespace lldb_private {
Mutex m_gid_map_mutex;
IDToNameMap m_uid_map;
IDToNameMap m_gid_map;
- uint32_t m_max_uid_name_len;
- uint32_t m_max_gid_name_len;
+ size_t m_max_uid_name_len;
+ size_t m_max_gid_name_len;
const char *
GetCachedUserName (uint32_t uid)
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index c765f6ca11a..0de212d9cc8 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -637,7 +637,7 @@ public:
const FileAction *
GetFileActionForFD (int fd) const
{
- for (uint32_t idx=0, count=m_file_actions.size(); idx < count; ++idx)
+ for (size_t idx=0, count=m_file_actions.size(); idx < count; ++idx)
{
if (m_file_actions[idx].GetFD () == fd)
return &m_file_actions[idx];
@@ -1069,7 +1069,7 @@ public:
m_infos.clear();
}
- uint32_t
+ size_t
GetSize()
{
return m_infos.size();
@@ -1082,7 +1082,7 @@ public:
}
const char *
- GetProcessNameAtIndex (uint32_t idx)
+ GetProcessNameAtIndex (size_t idx)
{
if (idx < m_infos.size())
return m_infos[idx].GetName();
@@ -1090,7 +1090,7 @@ public:
}
size_t
- GetProcessNameLengthAtIndex (uint32_t idx)
+ GetProcessNameLengthAtIndex (size_t idx)
{
if (idx < m_infos.size())
return m_infos[idx].GetNameLength();
@@ -1098,7 +1098,7 @@ public:
}
lldb::pid_t
- GetProcessIDAtIndex (uint32_t idx)
+ GetProcessIDAtIndex (size_t idx)
{
if (idx < m_infos.size())
return m_infos[idx].GetProcessID();
@@ -1106,7 +1106,7 @@ public:
}
bool
- GetInfoAtIndex (uint32_t idx, ProcessInstanceInfo &info)
+ GetInfoAtIndex (size_t idx, ProcessInstanceInfo &info)
{
if (idx < m_infos.size())
{
@@ -1118,7 +1118,7 @@ public:
// You must ensure "idx" is valid before calling this function
const ProcessInstanceInfo &
- GetProcessInfoAtIndex (uint32_t idx) const
+ GetProcessInfoAtIndex (size_t idx) const
{
assert (idx < m_infos.size());
return m_infos[idx];
@@ -2769,7 +2769,7 @@ public:
size_t
WriteScalarToMemory (lldb::addr_t vm_addr,
const Scalar &scalar,
- uint32_t size,
+ size_t size,
Error &error);
size_t
diff --git a/lldb/include/lldb/Target/RegisterContext.h b/lldb/include/lldb/Target/RegisterContext.h
index fdfcae92ba3..5f13fe125fa 100644
--- a/lldb/include/lldb/Target/RegisterContext.h
+++ b/lldb/include/lldb/Target/RegisterContext.h
@@ -45,13 +45,13 @@ public:
GetRegisterCount () = 0;
virtual const RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg) = 0;
+ GetRegisterInfoAtIndex (size_t reg) = 0;
virtual size_t
GetRegisterSetCount () = 0;
virtual const RegisterSet *
- GetRegisterSet (uint32_t reg_set) = 0;
+ GetRegisterSet (size_t reg_set) = 0;
virtual bool
ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0;
diff --git a/lldb/include/lldb/lldb-defines.h b/lldb/include/lldb/lldb-defines.h
index 07353a905c4..6f53de7ecd3 100644
--- a/lldb/include/lldb/lldb-defines.h
+++ b/lldb/include/lldb/lldb-defines.h
@@ -77,6 +77,7 @@
#define LLDB_INVALID_THREAD_ID 0
#define LLDB_INVALID_FRAME_ID UINT32_MAX
#define LLDB_INVALID_SIGNAL_NUMBER INT32_MAX
+#define LLDB_INVALID_OFFSET UINT64_MAX // Must match max of lldb::offset_t
//----------------------------------------------------------------------
/// CPU Type defintions
diff --git a/lldb/include/lldb/lldb-types.h b/lldb/include/lldb/lldb-types.h
index aba69e16179..9df38139ab1 100644
--- a/lldb/include/lldb/lldb-types.h
+++ b/lldb/include/lldb/lldb-types.h
@@ -74,6 +74,7 @@ namespace lldb
typedef uint64_t user_id_t;
typedef uint64_t pid_t;
typedef uint64_t tid_t;
+ typedef uint64_t offset_t;
typedef int32_t break_id_t;
typedef int32_t watch_id_t;
typedef void * clang_type_t;
diff --git a/lldb/scripts/Python/interface/SBData.i b/lldb/scripts/Python/interface/SBData.i
index 0d4fb0ee250..fbc0f0837d0 100644
--- a/lldb/scripts/Python/interface/SBData.i
+++ b/lldb/scripts/Python/interface/SBData.i
@@ -42,50 +42,50 @@ public:
SetByteOrder (lldb::ByteOrder endian);
float
- GetFloat (lldb::SBError& error, uint32_t offset);
+ GetFloat (lldb::SBError& error, lldb::offset_t offset);
double
- GetDouble (lldb::SBError& error, uint32_t offset);
+ GetDouble (lldb::SBError& error, lldb::offset_t offset);
long double
- GetLongDouble (lldb::SBError& error, uint32_t offset);
+ GetLongDouble (lldb::SBError& error, lldb::offset_t offset);
lldb::addr_t
- GetAddress (lldb::SBError& error, uint32_t offset);
+ GetAddress (lldb::SBError& error, lldb::offset_t offset);
uint8_t
- GetUnsignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset);
uint16_t
- GetUnsignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset);
uint32_t
- GetUnsignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset);
uint64_t
- GetUnsignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset);
int8_t
- GetSignedInt8 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset);
int16_t
- GetSignedInt16 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset);
int32_t
- GetSignedInt32 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset);
int64_t
- GetSignedInt64 (lldb::SBError& error, uint32_t offset);
+ GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset);
const char*
- GetString (lldb::SBError& error, uint32_t offset);
+ GetString (lldb::SBError& error, lldb::offset_t offset);
bool
GetDescription (lldb::SBStream &description, lldb::addr_t base_addr);
size_t
ReadRawData (lldb::SBError& error,
- uint32_t offset,
+ lldb::offset_t offset,
void *buf,
size_t size);
diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp
index 9f9bc4f5b63..2a6c59d8384 100644
--- a/lldb/source/API/SBData.cpp
+++ b/lldb/source/API/SBData.cpp
@@ -151,7 +151,7 @@ SBData::SetByteOrder (lldb::ByteOrder endian)
float
-SBData::GetFloat (lldb::SBError& error, uint32_t offset)
+SBData::GetFloat (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
float value = 0;
@@ -167,13 +167,13 @@ SBData::GetFloat (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetFloat (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetFloat (error=%p,offset=%" PRIu64 ") => "
"(%f)", error.get(), offset, value);
return value;
}
double
-SBData::GetDouble (lldb::SBError& error, uint32_t offset)
+SBData::GetDouble (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
double value = 0;
@@ -189,13 +189,13 @@ SBData::GetDouble (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetDouble (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetDouble (error=%p,offset=%" PRIu64 ") => "
"(%f)", error.get(), offset, value);
return value;
}
long double
-SBData::GetLongDouble (lldb::SBError& error, uint32_t offset)
+SBData::GetLongDouble (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
long double value = 0;
@@ -211,13 +211,13 @@ SBData::GetLongDouble (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetLongDouble (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetLongDouble (error=%p,offset=%" PRIu64 ") => "
"(%Lf)", error.get(), offset, value);
return value;
}
lldb::addr_t
-SBData::GetAddress (lldb::SBError& error, uint32_t offset)
+SBData::GetAddress (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
lldb::addr_t value = 0;
@@ -233,13 +233,13 @@ SBData::GetAddress (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetAddress (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetAddress (error=%p,offset=%" PRIu64 ") => "
"(%p)", error.get(), offset, (void*)value);
return value;
}
uint8_t
-SBData::GetUnsignedInt8 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt8 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint8_t value = 0;
@@ -255,13 +255,13 @@ SBData::GetUnsignedInt8 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt8 (error=%p,offset=%" PRIu64 ") => "
"(%c)", error.get(), offset, value);
return value;
}
uint16_t
-SBData::GetUnsignedInt16 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt16 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint16_t value = 0;
@@ -277,13 +277,13 @@ SBData::GetUnsignedInt16 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt16 (error=%p,offset=%" PRIu64 ") => "
"(%hd)", error.get(), offset, value);
return value;
}
uint32_t
-SBData::GetUnsignedInt32 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt32 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint32_t value = 0;
@@ -299,13 +299,13 @@ SBData::GetUnsignedInt32 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt32 (error=%p,offset=%" PRIu64 ") => "
"(%d)", error.get(), offset, value);
return value;
}
uint64_t
-SBData::GetUnsignedInt64 (lldb::SBError& error, uint32_t offset)
+SBData::GetUnsignedInt64 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
uint64_t value = 0;
@@ -321,13 +321,13 @@ SBData::GetUnsignedInt64 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%" PRIu64 ") => "
"(%" PRId64 ")", error.get(), offset, value);
return value;
}
int8_t
-SBData::GetSignedInt8 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt8 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int8_t value = 0;
@@ -343,13 +343,13 @@ SBData::GetSignedInt8 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt8 (error=%p,offset=%" PRIu64 ") => "
"(%c)", error.get(), offset, value);
return value;
}
int16_t
-SBData::GetSignedInt16 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt16 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int16_t value = 0;
@@ -365,13 +365,13 @@ SBData::GetSignedInt16 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt16 (error=%p,offset=%" PRIu64 ") => "
"(%hd)", error.get(), offset, value);
return value;
}
int32_t
-SBData::GetSignedInt32 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt32 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int32_t value = 0;
@@ -387,13 +387,13 @@ SBData::GetSignedInt32 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt32 (error=%p,offset=%" PRIu64 ") => "
"(%d)", error.get(), offset, value);
return value;
}
int64_t
-SBData::GetSignedInt64 (lldb::SBError& error, uint32_t offset)
+SBData::GetSignedInt64 (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
int64_t value = 0;
@@ -409,13 +409,13 @@ SBData::GetSignedInt64 (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%" PRIu64 ") => "
"(%" PRId64 ")", error.get(), offset, value);
return value;
}
const char*
-SBData::GetString (lldb::SBError& error, uint32_t offset)
+SBData::GetString (lldb::SBError& error, lldb::offset_t offset)
{
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
const char* value = 0;
@@ -431,7 +431,7 @@ SBData::GetString (lldb::SBError& error, uint32_t offset)
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::GetString (error=%p,offset=%d) => "
+ log->Printf ("SBData::GetString (error=%p,offset=%" PRIu64 ") => "
"(%p)", error.get(), offset, value);
return value;
}
@@ -461,7 +461,7 @@ SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr)
size_t
SBData::ReadRawData (lldb::SBError& error,
- uint32_t offset,
+ lldb::offset_t offset,
void *buf,
size_t size)
{
@@ -479,7 +479,7 @@ SBData::ReadRawData (lldb::SBError& error,
error.SetErrorString("unable to read data");
}
if (log)
- log->Printf ("SBData::ReadRawData (error=%p,offset=%d,buf=%p,size=%lu) => "
+ log->Printf ("SBData::ReadRawData (error=%p,offset=%" PRIu64 ",buf=%p,size=%lu) => "
"(%p)", error.get(), offset, buf, size, ok);
return ok ? size : 0;
}
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index 1a7911f4a65..9e486580387 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -108,7 +108,7 @@ Breakpoint::FindLocationByID (break_id_t bp_loc_id)
}
BreakpointLocationSP
-Breakpoint::GetLocationAtIndex (uint32_t index)
+Breakpoint::GetLocationAtIndex (size_t index)
{
return m_locations.GetByIndex(index);
}
@@ -760,7 +760,7 @@ Breakpoint::BreakpointEventData::GetBreakpointFromEvent (const EventSP &event_sp
return bp_sp;
}
-uint32_t
+size_t
Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent (const EventSP &event_sp)
{
const BreakpointEventData *data = GetEventDataFromEvent (event_sp.get());
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp
index e7e92992156..24101b1442f 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -38,7 +38,7 @@ BreakpointIDList::GetSize()
}
BreakpointID &
-BreakpointIDList::GetBreakpointIDAtIndex (uint32_t index)
+BreakpointIDList::GetBreakpointIDAtIndex (size_t index)
{
if (index < m_breakpoint_ids.size())
return m_breakpoint_ids[index];
@@ -47,7 +47,7 @@ BreakpointIDList::GetBreakpointIDAtIndex (uint32_t index)
}
bool
-BreakpointIDList::RemoveBreakpointIDAtIndex (uint32_t index)
+BreakpointIDList::RemoveBreakpointIDAtIndex (size_t index)
{
if (index >= m_breakpoint_ids.size())
return false;
@@ -89,10 +89,8 @@ BreakpointIDList::AddBreakpointID (const char *bp_id_str)
}
bool
-BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, uint32_t *position)
+BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, size_t *position)
{
- BreakpointIDArray::iterator tmp_pos;
-
for (size_t i = 0; i < m_breakpoint_ids.size(); ++i)
{
BreakpointID tmp_id = m_breakpoint_ids[i];
@@ -108,7 +106,7 @@ BreakpointIDList::FindBreakpointID (BreakpointID &bp_id, uint32_t *position)
}
bool
-BreakpointIDList::FindBreakpointID (const char *bp_id_str, uint32_t *position)
+BreakpointIDList::FindBreakpointID (const char *bp_id_str, size_t *position)
{
BreakpointID temp_bp_id;
break_id_t bp_id;
@@ -124,7 +122,7 @@ BreakpointIDList::FindBreakpointID (const char *bp_id_str, uint32_t *position)
}
void
-BreakpointIDList::InsertStringArray (const char **string_array, uint32_t array_size, CommandReturnObject &result)
+BreakpointIDList::InsertStringArray (const char **string_array, size_t array_size, CommandReturnObject &result)
{
if (string_array == NULL)
return;
@@ -174,8 +172,8 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman
bool is_range = false;
current_arg = old_args.GetArgumentAtIndex (i);
- uint32_t range_start_len = 0;
- uint32_t range_end_pos = 0;
+ size_t range_start_len = 0;
+ size_t range_end_pos = 0;
if (BreakpointIDList::StringContainsIDRangeExpression (current_arg, &range_start_len, &range_end_pos))
{
is_range = true;
@@ -350,8 +348,8 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman
bool
BreakpointIDList::StringContainsIDRangeExpression (const char *in_string,
- uint32_t *range_start_len,
- uint32_t *range_end_pos)
+ size_t *range_start_len,
+ size_t *range_end_pos)
{
bool is_range_expression = false;
std::string arg_str = in_string;
@@ -368,7 +366,7 @@ BreakpointIDList::StringContainsIDRangeExpression (const char *in_string,
for (int i = 0; i < specifiers_size && !is_range_expression; ++i)
{
const char *specifier_str = BreakpointID::g_range_specifiers[i];
- int len = strlen (specifier_str);
+ size_t len = strlen (specifier_str);
idx = arg_str.find (BreakpointID::g_range_specifiers[i]);
if (idx != std::string::npos)
{
diff --git a/lldb/source/Breakpoint/BreakpointList.cpp b/lldb/source/Breakpoint/BreakpointList.cpp
index 5b40e2e67c4..5926663af7b 100644
--- a/lldb/source/Breakpoint/BreakpointList.cpp
+++ b/lldb/source/Breakpoint/BreakpointList.cpp
@@ -172,13 +172,13 @@ BreakpointList::Dump (Stream *s) const
BreakpointSP
-BreakpointList::GetBreakpointAtIndex (uint32_t i)
+BreakpointList::GetBreakpointAtIndex (size_t i)
{
Mutex::Locker locker(m_mutex);
BreakpointSP stop_sp;
bp_collection::iterator end = m_breakpoints.end();
bp_collection::iterator pos;
- uint32_t curr_i = 0;
+ size_t curr_i = 0;
for (pos = m_breakpoints.begin(), curr_i = 0; pos != end; ++pos, ++curr_i)
{
if (curr_i == i)
@@ -188,13 +188,13 @@ BreakpointList::GetBreakpointAtIndex (uint32_t i)
}
const BreakpointSP
-BreakpointList::GetBreakpointAtIndex (uint32_t i) const
+BreakpointList::GetBreakpointAtIndex (size_t i) const
{
Mutex::Locker locker(m_mutex);
BreakpointSP stop_sp;
bp_collection::const_iterator end = m_breakpoints.end();
bp_collection::const_iterator pos;
- uint32_t curr_i = 0;
+ size_t curr_i = 0;
for (pos = m_breakpoints.begin(), curr_i = 0; pos != end; ++pos, ++curr_i)
{
if (curr_i == i)
diff --git a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
index bc493b22543..c03b7dd2b16 100644
--- a/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocationCollection.cpp
@@ -115,7 +115,7 @@ BreakpointLocationCollection::FindByIDPair (lldb::break_id_t break_id, lldb::bre
}
BreakpointLocationSP
-BreakpointLocationCollection::GetByIndex (uint32_t i)
+BreakpointLocationCollection::GetByIndex (size_t i)
{
BreakpointLocationSP stop_sp;
if (i < m_break_loc_collection.size())
@@ -125,7 +125,7 @@ BreakpointLocationCollection::GetByIndex (uint32_t i)
}
const BreakpointLocationSP
-BreakpointLocationCollection::GetByIndex (uint32_t i) const
+BreakpointLocationCollection::GetByIndex (size_t i) const
{
BreakpointLocationSP stop_sp;
if (i < m_break_loc_collection.size())
diff --git a/lldb/source/Breakpoint/BreakpointLocationList.cpp b/lldb/source/Breakpoint/BreakpointLocationList.cpp
index 0034a9241b8..7615f7b45ec 100644
--- a/lldb/source/Breakpoint/BreakpointLocationList.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocationList.cpp
@@ -138,7 +138,7 @@ BreakpointLocationList::Dump (Stream *s) const
BreakpointLocationSP
-BreakpointLocationList::GetByIndex (uint32_t i)
+BreakpointLocationList::GetByIndex (size_t i)
{
Mutex::Locker locker (m_mutex);
BreakpointLocationSP bp_loc_sp;
@@ -149,7 +149,7 @@ BreakpointLocationList::GetByIndex (uint32_t i)
}
const BreakpointLocationSP
-BreakpointLocationList::GetByIndex (uint32_t i) const
+BreakpointLocationList::GetByIndex (size_t i) const
{
Mutex::Locker locker (m_mutex);
BreakpointLocationSP bp_loc_sp;
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
index 6231bce6589..84db721d13b 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -73,8 +73,8 @@ BreakpointResolverFileLine::SearchCallback
// So we go through the match list and pull out the sets that have the same file spec in their line_entry
// and treat each set separately.
- uint32_t num_comp_units = context.module_sp->GetNumCompileUnits();
- for (uint32_t i = 0; i < num_comp_units; i++)
+ const size_t num_comp_units = context.module_sp->GetNumCompileUnits();
+ for (size_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (context.module_sp->GetCompileUnitAtIndex (i));
if (cu_sp)
diff --git a/lldb/source/Breakpoint/BreakpointResolverName.cpp b/lldb/source/Breakpoint/BreakpointResolverName.cpp
index 60932bf581a..cb5e4ee7da9 100644
--- a/lldb/source/Breakpoint/BreakpointResolverName.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverName.cpp
@@ -170,13 +170,13 @@ BreakpointResolverName::SearchCallback
size_t num_names = m_func_names.size();
for (int j = 0; j < num_names; j++)
{
- uint32_t num_functions = context.module_sp->FindFunctions (m_func_names[j],
- NULL,
- m_func_name_type_mask,
- include_symbols,
- include_inlines,
- append,
- func_list);
+ size_t num_functions = context.module_sp->FindFunctions (m_func_names[j],
+ NULL,
+ m_func_name_type_mask,
+ include_symbols,
+ include_inlines,
+ append,
+ func_list);
// If the search filter specifies a Compilation Unit, then we don't need to bother to look in plain
// symbols, since all the ones from a set compilation unit will have been found above already.
diff --git a/lldb/source/Breakpoint/BreakpointSite.cpp b/lldb/source/Breakpoint/BreakpointSite.cpp
index 5f94a190d10..77572e86e19 100644
--- a/lldb/source/Breakpoint/BreakpointSite.cpp
+++ b/lldb/source/Breakpoint/BreakpointSite.cpp
@@ -25,10 +25,9 @@ BreakpointSite::BreakpointSite
BreakpointSiteList *list,
const BreakpointLocationSP& owner,
lldb::addr_t addr,
- lldb::tid_t tid,
bool use_hardware
) :
- StoppointLocation(GetNextID(), addr, tid, use_hardware),
+ StoppointLocation(GetNextID(), addr, 0, use_hardware),
m_type (eSoftware), // Process subclasses need to set this correctly using SetType()
m_saved_opcode(),
m_trap_opcode(),
@@ -118,7 +117,7 @@ BreakpointSite::GetTrapOpcodeMaxByteSize() const
}
bool
-BreakpointSite::SetTrapOpcode (const uint8_t *trap_opcode, size_t trap_opcode_size)
+BreakpointSite::SetTrapOpcode (const uint8_t *trap_opcode, uint32_t trap_opcode_size)
{
if (trap_opcode_size > 0 && trap_opcode_size <= sizeof(m_trap_opcode))
{
@@ -160,21 +159,21 @@ BreakpointSite::AddOwner (const BreakpointLocationSP &owner)
m_owners.Add(owner);
}
-uint32_t
+size_t
BreakpointSite::RemoveOwner (lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
{
m_owners.Remove(break_id, break_loc_id);
return m_owners.GetSize();
}
-uint32_t
+size_t
BreakpointSite::GetNumberOfOwners ()
{
return m_owners.GetSize();
}
BreakpointLocationSP
-BreakpointSite::GetOwnerAtIndex (uint32_t index)
+BreakpointSite::GetOwnerAtIndex (size_t index)
{
return m_owners.GetByIndex (index);
}
diff --git a/lldb/source/Breakpoint/Watchpoint.cpp b/lldb/source/Breakpoint/Watchpoint.cpp
index 09cf2b671b1..f18722a9901 100644
--- a/lldb/source/Breakpoint/Watchpoint.cpp
+++ b/lldb/source/Breakpoint/Watchpoint.cpp
@@ -27,7 +27,7 @@
using namespace lldb;
using namespace lldb_private;
-Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, size_t size, const ClangASTType *type, bool hardware) :
+Watchpoint::Watchpoint (Target& target, lldb::addr_t addr, uint32_t size, const ClangASTType *type, bool hardware) :
StoppointLocation (0, addr, size, hardware),
m_target(target),
m_enabled(false),
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 175c91d875d..e6f23238975 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -131,7 +131,7 @@ DiskFilesOrDirectories
// I'm going to use the "glob" function with GLOB_TILDE for user directory expansion.
// If it is not defined on your host system, you'll need to implement it yourself...
- int partial_name_len = strlen(partial_file_name);
+ size_t partial_name_len = strlen(partial_file_name);
if (partial_name_len >= PATH_MAX)
return matches.GetSize();
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp
index c493d4fb6d7..2eeec78e4b0 100644
--- a/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/lldb/source/Commands/CommandObjectApropos.cpp
@@ -56,7 +56,7 @@ CommandObjectApropos::~CommandObjectApropos()
bool
CommandObjectApropos::DoExecute (Args& args, CommandReturnObject &result)
{
- const int argc = args.GetArgumentCount ();
+ const size_t argc = args.GetArgumentCount ();
if (argc == 1)
{
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp
index 891c368ae46..a8f64a235f8 100644
--- a/lldb/source/Commands/CommandObjectArgs.cpp
+++ b/lldb/source/Commands/CommandObjectArgs.cpp
@@ -120,7 +120,7 @@ CommandObjectArgs::DoExecute (Args& args, CommandReturnObject &result)
return false;
}
- int num_args = args.GetArgumentCount ();
+ const size_t num_args = args.GetArgumentCount ();
int arg_index;
if (!num_args)
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 831b6935cc4..b43cf86dde2 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -396,7 +396,7 @@ protected:
case eSetTypeFileAndLine: // Breakpoint by source position
{
FileSpec file;
- uint32_t num_files = m_options.m_filenames.GetSize();
+ const size_t num_files = m_options.m_filenames.GetSize();
if (num_files == 0)
{
if (!GetDefaultFile (target, file, result))
@@ -469,7 +469,7 @@ protected:
break;
case eSetTypeSourceRegexp: // Breakpoint by regexp on source text.
{
- int num_files = m_options.m_filenames.GetSize();
+ const size_t num_files = m_options.m_filenames.GetSize();
if (num_files == 0)
{
@@ -1794,7 +1794,7 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe
Breakpoint *breakpoint = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
if (breakpoint != NULL)
{
- int num_locations = breakpoint->GetNumLocations();
+ const size_t num_locations = breakpoint->GetNumLocations();
if (cur_bp_id.GetLocationID() > num_locations)
{
StreamString id_str;
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index e8937eaaba5..7448a871dbd 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -188,7 +188,7 @@ public:
return "";
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
@@ -285,7 +285,7 @@ protected:
bool
DoExecute(Args& command, CommandReturnObject &result)
{
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc == 1)
{
const char *filename = command.GetArgumentAtIndex(0);
@@ -1289,7 +1289,7 @@ public:
{
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index abaf4c67891..703e1356332 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -424,7 +424,7 @@ CommandObjectExpression::EvaluateExpression
const char *error_cstr = result_valobj_sp->GetError().AsCString();
if (error_cstr && error_cstr[0])
{
- int error_cstr_len = strlen (error_cstr);
+ const size_t error_cstr_len = strlen (error_cstr);
const bool ends_with_newline = error_cstr[error_cstr_len - 1] == '\n';
if (strstr(error_cstr, "error:") != error_cstr)
error_stream->PutCString ("error: ");
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index f2ff3cfef88..266753b641a 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -419,7 +419,7 @@ protected:
{
if (m_option_variable.use_regex)
{
- const uint32_t regex_start_index = regex_var_list.GetSize();
+ const size_t regex_start_index = regex_var_list.GetSize();
RegularExpression regex (name_cstr);
if (regex.Compile(name_cstr))
{
@@ -429,7 +429,7 @@ protected:
num_matches);
if (num_new_regex_vars > 0)
{
- for (uint32_t regex_idx = regex_start_index, end_index = regex_var_list.GetSize();
+ for (size_t regex_idx = regex_start_index, end_index = regex_var_list.GetSize();
regex_idx < end_index;
++regex_idx)
{
@@ -512,10 +512,10 @@ protected:
}
else // No command arg specified. Use variable_list, instead.
{
- const uint32_t num_variables = variable_list->GetSize();
+ const size_t num_variables = variable_list->GetSize();
if (num_variables > 0)
{
- for (uint32_t i=0; i<num_variables; i++)
+ for (size_t i=0; i<num_variables; i++)
{
var_sp = variable_list->GetVariableAtIndex(i);
bool dump_variable = true;
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 9a50e5c10c4..00e2551842f 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -64,7 +64,7 @@ CommandObjectHelp::DoExecute (Args& command, CommandReturnObject &result)
{
CommandObject::CommandMap::iterator pos;
CommandObject *cmd_obj;
- const int argc = command.GetArgumentCount ();
+ const size_t argc = command.GetArgumentCount ();
// 'help' doesn't take any arguments, other than command names. If argc is 0, we show the user
// all commands (aliases and user commands if asked for). Otherwise every argument must be the name of a command or a sub-command.
@@ -224,8 +224,8 @@ CommandObjectHelp::DoExecute (Args& command, CommandReturnObject &result)
{
Stream &output_strm = result.GetOutputStream();
output_strm.Printf("Help requested with ambiguous command name, possible completions:\n");
- const uint32_t match_count = matches.GetSize();
- for (uint32_t i = 0; i < match_count; i++)
+ const size_t match_count = matches.GetSize();
+ for (size_t i = 0; i < match_count; i++)
{
output_strm.Printf("\t%s\n", matches.GetStringAtIndex(i));
}
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index cbff45ccbcf..e77dc116e8d 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -742,10 +742,10 @@ protected:
{
if (m_memory_options.m_output_as_binary)
{
- int bytes_written = outfile_stream.Write (data_sp->GetBytes(), bytes_read);
+ const size_t bytes_written = outfile_stream.Write (data_sp->GetBytes(), bytes_read);
if (bytes_written > 0)
{
- result.GetOutputStream().Printf ("%i bytes %s to '%s'\n",
+ result.GetOutputStream().Printf ("%zi bytes %s to '%s'\n",
bytes_written,
append ? "appended" : "written",
path);
@@ -835,16 +835,16 @@ protected:
assert (output_stream);
- uint32_t bytes_dumped = data.Dump (output_stream,
- 0,
- m_format_options.GetFormat(),
- item_byte_size,
- item_count,
- num_per_line,
- addr,
- 0,
- 0,
- exe_scope);
+ size_t bytes_dumped = data.Dump (output_stream,
+ 0,
+ m_format_options.GetFormat(),
+ item_byte_size,
+ item_count,
+ num_per_line,
+ addr,
+ 0,
+ 0,
+ exe_scope);
m_next_addr = addr + bytes_dumped;
output_stream->EOL();
return true;
@@ -1129,9 +1129,8 @@ protected:
uint64_t uval64;
int64_t sval64;
bool success = false;
- const uint32_t num_value_args = command.GetArgumentCount();
- uint32_t i;
- for (i=0; i<num_value_args; ++i)
+ const size_t num_value_args = command.GetArgumentCount();
+ for (size_t i=0; i<num_value_args; ++i)
{
const char *value_str = command.GetArgumentAtIndex(i);
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp
index d2e281197da..aa3a8ebe367 100644
--- a/lldb/source/Commands/CommandObjectMultiword.cpp
+++ b/lldb/source/Commands/CommandObjectMultiword.cpp
@@ -143,7 +143,7 @@ CommandObjectMultiword::Execute(const char *args_string, CommandReturnObject &re
else
{
std::string error_msg;
- int num_subcmd_matches = matches.GetSize();
+ const size_t num_subcmd_matches = matches.GetSize();
if (num_subcmd_matches > 0)
error_msg.assign ("ambiguous command ");
else
@@ -158,14 +158,14 @@ CommandObjectMultiword::Execute(const char *args_string, CommandReturnObject &re
if (num_subcmd_matches > 0)
{
error_msg.append (" Possible completions:");
- for (int i = 0; i < num_subcmd_matches; i++)
+ for (size_t i = 0; i < num_subcmd_matches; i++)
{
error_msg.append ("\n\t");
error_msg.append (matches.GetStringAtIndex (i));
}
}
error_msg.append ("\n");
- result.AppendRawError (error_msg.c_str(), error_msg.size());
+ result.AppendRawError (error_msg.c_str());
result.SetStatus (eReturnStatusFailed);
}
}
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index cd6a9e28258..6bf9c60d145 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -386,7 +386,7 @@ protected:
if (platform_sp)
{
Error error;
- const uint32_t argc = args.GetArgumentCount();
+ const size_t argc = args.GetArgumentCount();
Target *target = m_exe_ctx.GetTargetPtr();
Module *exe_module = target->GetExecutableModulePointer();
if (exe_module)
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index b63089ed3a9..df5d8ff9687 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -69,7 +69,7 @@ public:
{
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
@@ -446,10 +446,10 @@ public:
match_info.SetNameMatchType(eNameMatchStartsWith);
}
platform_sp->FindProcesses (match_info, process_infos);
- const uint32_t num_matches = process_infos.GetSize();
+ const size_t num_matches = process_infos.GetSize();
if (num_matches > 0)
{
- for (uint32_t i=0; i<num_matches; ++i)
+ for (size_t i=0; i<num_matches; ++i)
{
matches.AppendString (process_infos.GetProcessNameAtIndex(i),
process_infos.GetProcessNameLengthAtIndex(i));
@@ -773,12 +773,12 @@ protected:
StopInfoSP stop_info_sp = sel_thread_sp->GetStopInfo();
if (stop_info_sp && stop_info_sp->GetStopReason() == eStopReasonBreakpoint)
{
- uint64_t bp_site_id = stop_info_sp->GetValue();
+ lldb::break_id_t bp_site_id = (lldb::break_id_t)stop_info_sp->GetValue();
BreakpointSiteSP bp_site_sp(process->GetBreakpointSiteList().FindByID(bp_site_id));
if (bp_site_sp)
{
- uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
- for (uint32_t i = 0; i < num_owners; i++)
+ const size_t num_owners = bp_site_sp->GetNumberOfOwners();
+ for (size_t i = 0; i < num_owners; i++)
{
Breakpoint &bp_ref = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint();
if (!bp_ref.IsInternal())
@@ -1134,7 +1134,7 @@ protected:
{
Process *process = m_exe_ctx.GetProcessPtr();
- const uint32_t argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
for (uint32_t i=0; i<argc; ++i)
{
@@ -1191,7 +1191,7 @@ protected:
{
Process *process = m_exe_ctx.GetProcessPtr();
- const uint32_t argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
for (uint32_t i=0; i<argc; ++i)
{
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index db1c3af1862..79a76fbaed9 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -129,7 +129,7 @@ public:
DumpRegisterSet (const ExecutionContext &exe_ctx,
Stream &strm,
RegisterContext *reg_ctx,
- uint32_t set_idx,
+ size_t set_idx,
bool primitive_only=false)
{
uint32_t unavailable_count = 0;
@@ -139,8 +139,8 @@ public:
{
strm.Printf ("%s:\n", reg_set->name);
strm.IndentMore ();
- const uint32_t num_registers = reg_set->num_registers;
- for (uint32_t reg_idx = 0; reg_idx < num_registers; ++reg_idx)
+ const size_t num_registers = reg_set->num_registers;
+ for (size_t reg_idx = 0; reg_idx < num_registers; ++reg_idx)
{
const uint32_t reg = reg_set->registers[reg_idx];
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg);
@@ -173,20 +173,20 @@ protected:
const RegisterInfo *reg_info = NULL;
if (command.GetArgumentCount() == 0)
{
- uint32_t set_idx;
+ size_t set_idx;
- uint32_t num_register_sets = 1;
- const uint32_t set_array_size = m_command_options.set_indexes.GetSize();
+ size_t num_register_sets = 1;
+ const size_t set_array_size = m_command_options.set_indexes.GetSize();
if (set_array_size > 0)
{
- for (uint32_t i=0; i<set_array_size; ++i)
+ for (size_t i=0; i<set_array_size; ++i)
{
set_idx = m_command_options.set_indexes[i]->GetUInt64Value (UINT32_MAX, NULL);
if (set_idx != UINT32_MAX)
{
if (!DumpRegisterSet (m_exe_ctx, strm, reg_ctx, set_idx))
{
- result.AppendErrorWithFormat ("invalid register set index: %u\n", set_idx);
+ result.AppendErrorWithFormat ("invalid register set index: %zu\n", set_idx);
result.SetStatus (eReturnStatusFailed);
break;
}
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index 576519a39a0..f2a2488e6fe 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -299,7 +299,7 @@ protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc != 0)
{
@@ -320,10 +320,11 @@ protected:
bool append = true;
size_t num_matches = 0;
- if (m_options.modules.size() > 0)
+ const size_t num_modules = m_options.modules.size();
+ if (num_modules > 0)
{
ModuleList matching_modules;
- for (unsigned i = 0, e = m_options.modules.size(); i != e; i++)
+ for (size_t i = 0; i < num_modules; ++i)
{
FileSpec module_file_spec(m_options.modules[i].c_str(), false);
if (module_file_spec)
@@ -423,7 +424,7 @@ protected:
// This is a little hacky, but the first line table entry for a function points to the "{" that
// starts the function block. It would be nice to actually get the function
// declaration in there too. So back up a bit, but not further than what you're going to display.
- size_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2;
+ uint32_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2;
uint32_t line_no;
if (start_line <= lines_to_back_up)
line_no = 1;
@@ -475,8 +476,8 @@ protected:
// The target isn't loaded yet, we need to lookup the file address
// in all modules
const ModuleList &module_list = target->GetImages();
- const uint32_t num_modules = module_list.GetSize();
- for (uint32_t i=0; i<num_modules; ++i)
+ const size_t num_modules = module_list.GetSize();
+ for (size_t i=0; i<num_modules; ++i)
{
ModuleSP module_sp (module_list.GetModuleAtIndex(i));
if (module_sp && module_sp->ResolveFileAddress(m_options.address, so_addr))
@@ -621,7 +622,7 @@ protected:
if (m_options.modules.size() > 0)
{
ModuleList matching_modules;
- for (unsigned i = 0, e = m_options.modules.size(); i != e; i++)
+ for (size_t i = 0, e = m_options.modules.size(); i < e; ++i)
{
FileSpec module_file_spec(m_options.modules[i].c_str(), false);
if (module_file_spec)
diff --git a/lldb/source/Commands/CommandObjectSyntax.cpp b/lldb/source/Commands/CommandObjectSyntax.cpp
index ca1fad22aa6..e08e86f74c4 100644
--- a/lldb/source/Commands/CommandObjectSyntax.cpp
+++ b/lldb/source/Commands/CommandObjectSyntax.cpp
@@ -59,7 +59,7 @@ CommandObjectSyntax::DoExecute (Args& command, CommandReturnObject &result)
{
CommandObject::CommandMap::iterator pos;
CommandObject *cmd_obj;
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc > 0)
{
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index badea458ae2..55168ca0cae 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -192,7 +192,7 @@ public:
return &m_option_group;
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
@@ -220,7 +220,7 @@ protected:
bool
DoExecute (Args& command, CommandReturnObject &result)
{
- const int argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
FileSpec core_file (m_core_file.GetOptionValue().GetCurrentValue());
if (argc == 1 || core_file)
@@ -697,9 +697,9 @@ public:
}
- static uint32_t GetVariableCallback (void *baton,
- const char *name,
- VariableList &variable_list)
+ static size_t GetVariableCallback (void *baton,
+ const char *name,
+ VariableList &variable_list)
{
Target *target = static_cast<Target *>(baton);
if (target)
@@ -782,7 +782,7 @@ protected:
ValueObjectList valobj_list;
const char *arg = args.GetArgumentAtIndex(idx);
- uint32_t matches = 0;
+ size_t matches = 0;
bool use_var_name = false;
if (m_option_variable.use_regex)
{
@@ -1019,7 +1019,7 @@ protected:
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
if (target)
{
- uint32_t argc = command.GetArgumentCount();
+ const size_t argc = command.GetArgumentCount();
if (argc & 1)
{
result.AppendError ("add requires an even number of arguments\n");
@@ -1027,7 +1027,7 @@ protected:
}
else
{
- for (uint32_t i=0; i<argc; i+=2)
+ for (size_t i=0; i<argc; i+=2)
{
const char *from = command.GetArgumentAtIndex(i);
const char *to = command.GetArgumentAtIndex(i+1);
@@ -1156,7 +1156,7 @@ protected:
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
if (target)
{
- uint32_t argc = command.GetArgumentCount();
+ size_t argc = command.GetArgumentCount();
// check for at least 3 arguments and an odd nubmer of parameters
if (argc >= 3 && argc & 1)
{
@@ -1670,7 +1670,7 @@ DumpSymbolContextList (ExecutionContextScope *exe_scope, Stream &strm, SymbolCon
strm.IndentLess ();
}
-static uint32_t
+static size_t
LookupFunctionInModule (CommandInterpreter &interpreter,
Stream &strm,
Module *module,
@@ -1684,7 +1684,7 @@ LookupFunctionInModule (CommandInterpreter &interpreter,
{
SymbolContextList sc_list;
const bool append = true;
- uint32_t num_matches = 0;
+ size_t num_matches = 0;
if (name_is_regex)
{
RegularExpression function_name_regex (name);
@@ -1709,7 +1709,7 @@ LookupFunctionInModule (CommandInterpreter &interpreter,
if (num_matches)
{
strm.Indent ();
- strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : "");
+ strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
DumpSymbolContextList (interpreter.GetExecutionContext().GetBestExecutionContextScope(), strm, sc_list, verbose);
@@ -1719,7 +1719,7 @@ LookupFunctionInModule (CommandInterpreter &interpreter,
return 0;
}
-static uint32_t
+static size_t
LookupTypeInModule (CommandInterpreter &interpreter,
Stream &strm,
Module *module,
@@ -1730,7 +1730,7 @@ LookupTypeInModule (CommandInterpreter &interpreter,
{
TypeList type_list;
const uint32_t max_num_matches = UINT32_MAX;
- uint32_t num_matches = 0;
+ size_t num_matches = 0;
bool name_is_fully_qualified = false;
SymbolContext sc;
@@ -1740,7 +1740,7 @@ LookupTypeInModule (CommandInterpreter &interpreter,
if (num_matches)
{
strm.Indent ();
- strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : "");
+ strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
const uint32_t num_types = type_list.GetSize();
@@ -1774,7 +1774,7 @@ LookupTypeInModule (CommandInterpreter &interpreter,
return 0;
}
-static uint32_t
+static size_t
LookupTypeHere (CommandInterpreter &interpreter,
Stream &strm,
const SymbolContext &sym_ctx,
@@ -1786,7 +1786,7 @@ LookupTypeHere (CommandInterpreter &interpreter,
TypeList type_list;
const uint32_t max_num_matches = UINT32_MAX;
- uint32_t num_matches = 1;
+ size_t num_matches = 1;
bool name_is_fully_qualified = false;
ConstString name(name_cstr);
@@ -1873,9 +1873,9 @@ FindModulesByName (Target *target,
{
// Check the global list
Mutex::Locker locker(Module::GetAllocationModuleCollectionMutex());
- const uint32_t num_modules = Module::GetNumberAllocatedModules();
+ const size_t num_modules = Module::GetNumberAllocatedModules();
ModuleSP module_sp;
- for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
+ for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
Module *module = Module::GetAllocatedModuleAtIndex(image_idx);
@@ -2145,11 +2145,11 @@ protected:
{
// Dump all sections for all modules images
Mutex::Locker modules_locker(target->GetImages().GetMutex());
- const uint32_t num_modules = target->GetImages().GetSize();
+ const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping symbol table for %u modules.\n", num_modules);
- for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
+ result.GetOutputStream().Printf("Dumping symbol table for %zu modules.\n", num_modules);
+ for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (num_dumped > 0)
{
@@ -2278,11 +2278,11 @@ protected:
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
- const uint32_t num_modules = target->GetImages().GetSize();
+ const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping sections for %u modules.\n", num_modules);
- for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
+ result.GetOutputStream().Printf("Dumping sections for %zu modules.\n", num_modules);
+ for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
num_dumped++;
DumpModuleSections (m_interpreter, result.GetOutputStream(), target->GetImages().GetModulePointerAtIndex(image_idx));
@@ -2386,10 +2386,10 @@ protected:
// Dump all sections for all modules images
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker (target_modules.GetMutex());
- const uint32_t num_modules = target_modules.GetSize();
+ const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping debug symbols for %u modules.\n", num_modules);
+ result.GetOutputStream().Printf("Dumping debug symbols for %zu modules.\n", num_modules);
for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (DumpModuleSymbolVendor (result.GetOutputStream(), target_modules.GetModulePointerAtIndexUnlocked(image_idx)))
@@ -2491,7 +2491,7 @@ protected:
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());
- const uint32_t num_modules = target_modules.GetSize();
+ const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
uint32_t num_dumped = 0;
@@ -2582,7 +2582,7 @@ public:
return &m_option_group;
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
@@ -3037,7 +3037,7 @@ public:
}
else
{
- uint32_t width = 0;
+ unsigned long width = 0;
if (option_arg)
width = strtoul (option_arg, NULL, 0);
m_format_array.push_back(std::make_pair(short_option, width));
@@ -3129,7 +3129,7 @@ protected:
ModuleSP module_sp (module_address.GetModule());
if (module_sp)
{
- PrintModule (target, module_sp.get(), UINT32_MAX, 0, strm);
+ PrintModule (target, module_sp.get(), 0, strm);
result.SetStatus (eReturnStatusSuccessFinishResult);
}
else
@@ -3152,7 +3152,7 @@ protected:
return result.Succeeded();
}
- uint32_t num_modules = 0;
+ size_t num_modules = 0;
Mutex::Locker locker; // This locker will be locked on the mutex in module_list_ptr if it is non-NULL.
// Otherwise it will lock the AllocationModuleCollectionMutex when accessing
// the global module list directly.
@@ -3214,8 +3214,8 @@ protected:
module_sp = module->shared_from_this();
}
- int indent = strm.Printf("[%3u] ", image_idx);
- PrintModule (target, module, image_idx, indent, strm);
+ const size_t indent = strm.Printf("[%3u] ", image_idx);
+ PrintModule (target, module, indent, strm);
}
result.SetStatus (eReturnStatusSuccessFinishResult);
@@ -3244,7 +3244,7 @@ protected:
}
void
- PrintModule (Target *target, Module *module, uint32_t idx, int indent, Stream &strm)
+ PrintModule (Target *target, Module *module, int indent, Stream &strm)
{
if (module == NULL)
@@ -3338,7 +3338,7 @@ protected:
break;
case 'r':
{
- uint32_t ref_count = 0;
+ size_t ref_count = 0;
ModuleSP module_sp (module->shared_from_this());
if (module_sp)
{
@@ -3346,9 +3346,9 @@ protected:
ref_count = module_sp.use_count() - 1;
}
if (width)
- strm.Printf("{%*u}", width, ref_count);
+ strm.Printf("{%*zu}", width, ref_count);
else
- strm.Printf("{%u}", ref_count);
+ strm.Printf("{%zu}", ref_count);
}
break;
@@ -3581,7 +3581,7 @@ protected:
if (m_options.m_type == eLookupTypeFunctionOrSymbol)
{
SymbolContextList sc_list;
- uint32_t num_matches;
+ size_t num_matches;
ConstString function_name (m_options.m_str.c_str());
num_matches = target->GetImages().FindFunctions (function_name, eFunctionNameTypeAuto, true, false, true, sc_list);
for (uint32_t idx = 0; idx < num_matches; idx++)
@@ -4038,7 +4038,7 @@ protected:
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());
- const uint32_t num_modules = target_modules.GetSize();
+ const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
for (i = 0; i<num_modules && syntax_error == false; ++i)
@@ -4217,7 +4217,7 @@ public:
{
}
- int
+ virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
int &cursor_char_position,
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 8a978d3a10f..9b48e160a95 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -205,12 +205,12 @@ protected:
}
else
{
- uint32_t num_args = command.GetArgumentCount();
+ const size_t num_args = command.GetArgumentCount();
Process *process = m_exe_ctx.GetProcessPtr();
Mutex::Locker locker (process->GetThreadList().GetMutex());
std::vector<ThreadSP> thread_sps;
- for (uint32_t i = 0; i < num_args; i++)
+ for (size_t i = 0; i < num_args; i++)
{
bool success;
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index f4d3c1340ba..f7b8c4f9825 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -975,9 +975,9 @@ public:
}
protected:
- static uint32_t GetVariableCallback (void *baton,
- const char *name,
- VariableList &variable_list)
+ static size_t GetVariableCallback (void *baton,
+ const char *name,
+ VariableList &variable_list)
{
Target *target = static_cast<Target *>(baton);
if (target)
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp
index 9d4d8706c5a..5c9ed1a51fb 100644
--- a/lldb/source/Core/Address.cpp
+++ b/lldb/source/Core/Address.cpp
@@ -86,7 +86,7 @@ ReadUIntMax64 (ExecutionContextScope *exe_scope, const Address &address, uint32_
if (GetByteOrderAndAddressSize (exe_scope, address, byte_order, addr_size))
{
DataExtractor data (&buf, sizeof(buf), byte_order, addr_size);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uval64 = data.GetU64(&offset);
}
else
@@ -696,8 +696,8 @@ Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, Dum
stop_if_block_is_inlined_function,
&variable_list);
- uint32_t num_variables = variable_list.GetSize();
- for (uint32_t var_idx = 0; var_idx < num_variables; ++var_idx)
+ const size_t num_variables = variable_list.GetSize();
+ for (size_t var_idx = 0; var_idx < num_variables; ++var_idx)
{
Variable *var = variable_list.GetVariableAtIndex (var_idx).get();
if (var && var->LocationIsValidForAddress (*this))
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp
index 476807c338e..51bea8a95b5 100644
--- a/lldb/source/Core/ArchSpec.cpp
+++ b/lldb/source/Core/ArchSpec.cpp
@@ -118,7 +118,7 @@ struct ArchDefinition
};
-uint32_t
+size_t
ArchSpec::AutoComplete (const char *name, StringList &matches)
{
uint32_t i;
@@ -495,11 +495,11 @@ ParseMachCPUDashSubtypeTriple (const char *triple_cstr, ArchSpec &arch)
{
char *end = NULL;
errno = 0;
- uint32_t cpu = ::strtoul (triple_cstr, &end, 0);
+ uint32_t cpu = (uint32_t)::strtoul (triple_cstr, &end, 0);
if (errno == 0 && cpu != 0 && end && ((*end == '-') || (*end == '.')))
{
errno = 0;
- uint32_t sub = ::strtoul (end + 1, &end, 0);
+ uint32_t sub = (uint32_t)::strtoul (end + 1, &end, 0);
if (errno == 0 && end && ((*end == '-') || (*end == '.') || (*end == '\0')))
{
if (arch.SetArchitecture (eArchTypeMachO, cpu, sub))
@@ -513,7 +513,7 @@ ParseMachCPUDashSubtypeTriple (const char *triple_cstr, ArchSpec &arch)
llvm::StringRef vendor_str(vendor_os.substr(0, dash_pos));
arch.GetTriple().setVendorName(vendor_str);
const size_t vendor_start_pos = dash_pos+1;
- dash_pos = vendor_os.find(vendor_start_pos, '-');
+ dash_pos = vendor_os.find('-', vendor_start_pos);
if (dash_pos == llvm::StringRef::npos)
{
if (vendor_start_pos < vendor_os.size())
diff --git a/lldb/source/Core/CXXFormatterFunctions.cpp b/lldb/source/Core/CXXFormatterFunctions.cpp
index a907d793989..81e72e5418c 100644
--- a/lldb/source/Core/CXXFormatterFunctions.cpp
+++ b/lldb/source/Core/CXXFormatterFunctions.cpp
@@ -1092,7 +1092,7 @@ m_data_64(NULL)
}
}
-uint32_t
+size_t
lldb_private::formatters::NSArrayMSyntheticFrontEnd::CalculateNumChildren ()
{
if (m_data_32)
@@ -1103,7 +1103,7 @@ lldb_private::formatters::NSArrayMSyntheticFrontEnd::CalculateNumChildren ()
}
lldb::ValueObjectSP
-lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
if (!m_data_32 && !m_data_64)
return lldb::ValueObjectSP();
@@ -1112,7 +1112,7 @@ lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (uint32_t i
lldb::addr_t object_at_idx = (m_data_32 ? m_data_32->_data : m_data_64->_data);
object_at_idx += (idx * m_ptr_size);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromAddress(idx_name.GetData(),
object_at_idx,
m_exe_ctx_ref,
@@ -1240,7 +1240,7 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::GetIndexOfChildWithName (co
return idx;
}
-uint32_t
+size_t
lldb_private::formatters::NSArrayISyntheticFrontEnd::CalculateNumChildren ()
{
return m_items;
@@ -1286,7 +1286,7 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::MightHaveChildren ()
}
lldb::ValueObjectSP
-lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
if (idx >= CalculateNumChildren())
return lldb::ValueObjectSP();
@@ -1302,7 +1302,7 @@ lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (uint32_t i
StreamString expr;
expr.Printf("(id)%" PRIu64,object_at_idx);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
m_children.push_back(retval_sp);
return retval_sp;
@@ -1353,7 +1353,7 @@ lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::NSArrayCodeRunnin
SyntheticChildrenFrontEnd(*valobj_sp.get())
{}
-uint32_t
+size_t
lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::CalculateNumChildren ()
{
uint64_t count = 0;
@@ -1363,10 +1363,10 @@ lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::CalculateNumChild
}
lldb::ValueObjectSP
-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
lldb::ValueObjectSP valobj_sp = CallSelectorOnObject(m_backend,"id","objectAtIndex:",idx);
if (valobj_sp)
valobj_sp->SetName(ConstString(idx_name.GetData()));
@@ -1440,7 +1440,7 @@ lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::NSDictionary
SyntheticChildrenFrontEnd(*valobj_sp.get())
{}
-uint32_t
+size_t
lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::CalculateNumChildren ()
{
uint64_t count = 0;
@@ -1450,14 +1450,14 @@ lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::CalculateNum
}
lldb::ValueObjectSP
-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
StreamString valobj_expr_path;
m_backend.GetExpressionPath(valobj_expr_path, false);
StreamString key_fetcher_expr;
- key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%d]",valobj_expr_path.GetData(),idx);
+ key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%zu]",valobj_expr_path.GetData(),idx);
StreamString value_fetcher_expr;
value_fetcher_expr.Printf("(id)[%s objectForKey:%s]",valobj_expr_path.GetData(),key_fetcher_expr.GetData());
StreamString object_fetcher_expr;
@@ -1520,7 +1520,7 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetIndexOfChildWithNam
return idx;
}
-uint32_t
+size_t
lldb_private::formatters::NSDictionaryISyntheticFrontEnd::CalculateNumChildren ()
{
if (!m_data_32 && !m_data_64)
@@ -1581,7 +1581,7 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::MightHaveChildren ()
}
lldb::ValueObjectSP
-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
uint32_t num_children = CalculateNumChildren();
@@ -1633,7 +1633,7 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (uint3
StreamString expr;
expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
}
return dict_item.valobj_sp;
@@ -1668,7 +1668,7 @@ lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetIndexOfChildWithNam
return idx;
}
-uint32_t
+size_t
lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::CalculateNumChildren ()
{
if (!m_data_32 && !m_data_64)
@@ -1728,7 +1728,7 @@ lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::MightHaveChildren ()
}
lldb::ValueObjectSP
-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)
+lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
lldb::addr_t m_keys_ptr = (m_data_32 ? m_data_32->_keys_addr : m_data_64->_keys_addr);
lldb::addr_t m_values_ptr = (m_data_32 ? m_data_32->_objs_addr : m_data_64->_objs_addr);
@@ -1783,7 +1783,7 @@ lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (uint3
StreamString expr;
expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
StreamString idx_name;
- idx_name.Printf("[%d]",idx);
+ idx_name.Printf("[%zu]",idx);
dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
}
return dict_item.valobj_sp;
diff --git a/lldb/source/Core/ConstString.cpp b/lldb/source/Core/ConstString.cpp
index 72a4332a4ff..875169428d2 100644
--- a/lldb/source/Core/ConstString.cpp
+++ b/lldb/source/Core/ConstString.cpp
@@ -87,7 +87,7 @@ public:
}
const char *
- GetConstCStringWithLength (const char *cstr, int cstr_len)
+ GetConstCStringWithLength (const char *cstr, size_t cstr_len)
{
if (cstr)
{
@@ -132,11 +132,11 @@ public:
}
const char *
- GetConstTrimmedCStringWithLength (const char *cstr, int cstr_len)
+ GetConstTrimmedCStringWithLength (const char *cstr, size_t cstr_len)
{
if (cstr)
{
- int trimmed_len = std::min<int> (strlen (cstr), cstr_len);
+ const size_t trimmed_len = std::min<size_t> (strlen (cstr), cstr_len);
return GetConstCStringWithLength (cstr, trimmed_len);
}
return NULL;
diff --git a/lldb/source/Core/DataBufferMemoryMap.cpp b/lldb/source/Core/DataBufferMemoryMap.cpp
index 5e1403a5a82..0a94f57e40a 100644
--- a/lldb/source/Core/DataBufferMemoryMap.cpp
+++ b/lldb/source/Core/DataBufferMemoryMap.cpp
@@ -116,8 +116,7 @@ DataBufferMemoryMap::MemoryMapFromFileSpec (const FileSpec* filespec,
if (error.Success())
{
const bool fd_is_file = true;
- MemoryMapFromFileDescriptor (file.GetDescriptor(), offset, length, writeable, fd_is_file);
- return GetByteSize();
+ return MemoryMapFromFileDescriptor (file.GetDescriptor(), offset, length, writeable, fd_is_file);
}
}
}
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp
index 0be3ef8546b..71dff0d54e8 100644
--- a/lldb/source/Core/DataExtractor.cpp
+++ b/lldb/source/Core/DataExtractor.cpp
@@ -38,35 +38,35 @@ using namespace lldb;
using namespace lldb_private;
static inline uint16_t
-ReadInt16(const unsigned char* ptr, unsigned offset)
+ReadInt16(const unsigned char* ptr, offset_t offset)
{
return *(uint16_t *)(ptr + offset);
}
static inline uint32_t
-ReadInt32 (const unsigned char* ptr, unsigned offset)
+ReadInt32 (const unsigned char* ptr, offset_t offset)
{
return *(uint32_t *)(ptr + offset);
}
static inline uint64_t
-ReadInt64(const unsigned char* ptr, unsigned offset)
+ReadInt64(const unsigned char* ptr, offset_t offset)
{
return *(uint64_t *)(ptr + offset);
}
static inline uint16_t
-ReadSwapInt16(const unsigned char* ptr, unsigned offset)
+ReadSwapInt16(const unsigned char* ptr, offset_t offset)
{
return llvm::ByteSwap_16(*(uint16_t *)(ptr + offset));
}
static inline uint32_t
-ReadSwapInt32 (const unsigned char* ptr, unsigned offset)
+ReadSwapInt32 (const unsigned char* ptr, offset_t offset)
{
return llvm::ByteSwap_32(*(uint32_t *)(ptr + offset));
}
static inline uint64_t
-ReadSwapInt64(const unsigned char* ptr, unsigned offset)
+ReadSwapInt64(const unsigned char* ptr, offset_t offset)
{
return llvm::ByteSwap_64(*(uint64_t *)(ptr + offset));
}
@@ -88,7 +88,7 @@ DataExtractor::DataExtractor () :
// This constructor allows us to use data that is owned by someone else.
// The data must stay around as long as this object is valid.
//----------------------------------------------------------------------
-DataExtractor::DataExtractor (const void* data, uint32_t length, ByteOrder endian, uint8_t addr_size) :
+DataExtractor::DataExtractor (const void* data, offset_t length, ByteOrder endian, uint32_t addr_size) :
m_start ((uint8_t*)data),
m_end ((uint8_t*)data + length),
m_byte_order(endian),
@@ -104,7 +104,7 @@ DataExtractor::DataExtractor (const void* data, uint32_t length, ByteOrder endia
// as long as any DataExtractor objects exist that have a reference to
// this data.
//----------------------------------------------------------------------
-DataExtractor::DataExtractor (const DataBufferSP& data_sp, ByteOrder endian, uint8_t addr_size) :
+DataExtractor::DataExtractor (const DataBufferSP& data_sp, ByteOrder endian, uint32_t addr_size) :
m_start (NULL),
m_end (NULL),
m_byte_order(endian),
@@ -121,7 +121,7 @@ DataExtractor::DataExtractor (const DataBufferSP& data_sp, ByteOrder endian, uin
// as any object contains a reference to that data. The endian
// swap and address size settings are copied from "data".
//----------------------------------------------------------------------
-DataExtractor::DataExtractor (const DataExtractor& data, uint32_t offset, uint32_t length) :
+DataExtractor::DataExtractor (const DataExtractor& data, offset_t offset, offset_t length) :
m_start(NULL),
m_end(NULL),
m_byte_order(data.m_byte_order),
@@ -130,7 +130,7 @@ DataExtractor::DataExtractor (const DataExtractor& data, uint32_t offset, uint32
{
if (data.ValidOffset(offset))
{
- uint32_t bytes_available = data.GetByteSize() - offset;
+ offset_t bytes_available = data.GetByteSize() - offset;
if (length > bytes_available)
length = bytes_available;
SetData(data, offset, length);
@@ -213,9 +213,9 @@ DataExtractor::GetSharedDataOffset () const
// into the data that is in this object.
//------------------------------------------------------------------
bool
-DataExtractor::ValidOffsetForDataOfSize (uint32_t offset, uint32_t length) const
+DataExtractor::ValidOffsetForDataOfSize (offset_t offset, offset_t length) const
{
- size_t size = GetByteSize();
+ offset_t size = GetByteSize();
if (offset >= size)
return false; // offset isn't valid
@@ -244,8 +244,8 @@ DataExtractor::ValidOffsetForDataOfSize (uint32_t offset, uint32_t length) const
// reference to that data will be released. Is SWAP is set to true,
// any data extracted will be endian swapped.
//----------------------------------------------------------------------
-uint32_t
-DataExtractor::SetData (const void *bytes, uint32_t length, ByteOrder endian)
+lldb::offset_t
+DataExtractor::SetData (const void *bytes, offset_t length, ByteOrder endian)
{
m_byte_order = endian;
m_data_sp.reset();
@@ -276,8 +276,8 @@ DataExtractor::SetData (const void *bytes, uint32_t length, ByteOrder endian)
// refers to those bytes. The address size and endian swap settings
// are copied from the current values in "data".
//----------------------------------------------------------------------
-uint32_t
-DataExtractor::SetData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+lldb::offset_t
+DataExtractor::SetData (const DataExtractor& data, offset_t data_offset, offset_t data_length)
{
m_addr_size = data.m_addr_size;
// If "data" contains shared pointer to data, then we can use that
@@ -311,8 +311,8 @@ DataExtractor::SetData (const DataExtractor& data, uint32_t data_offset, uint32_
// around as long as it is needed. The address size and endian swap
// settings will remain unchanged from their current settings.
//----------------------------------------------------------------------
-uint32_t
-DataExtractor::SetData (const DataBufferSP& data_sp, uint32_t data_offset, uint32_t data_length)
+lldb::offset_t
+DataExtractor::SetData (const DataBufferSP& data_sp, offset_t data_offset, offset_t data_length)
{
m_start = m_end = NULL;
@@ -335,7 +335,7 @@ DataExtractor::SetData (const DataBufferSP& data_sp, uint32_t data_offset, uint3
}
}
- uint32_t new_size = GetByteSize();
+ size_t new_size = GetByteSize();
// Don't hold a shared pointer to the data buffer if we don't share
// any valid bytes in the shared buffer.
@@ -352,7 +352,7 @@ DataExtractor::SetData (const DataBufferSP& data_sp, uint32_t data_offset, uint3
// RETURNS the byte that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint8_t
-DataExtractor::GetU8 (uint32_t *offset_ptr) const
+DataExtractor::GetU8 (offset_t *offset_ptr) const
{
uint8_t val = 0;
if ( m_start < m_end )
@@ -373,9 +373,9 @@ DataExtractor::GetU8 (uint32_t *offset_ptr) const
// the buffer due to being out of bounds, or unsufficient data.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU8 (uint32_t *offset_ptr, void *dst, uint32_t count) const
+DataExtractor::GetU8 (offset_t *offset_ptr, void *dst, uint32_t count) const
{
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, count) )
{
@@ -396,10 +396,10 @@ DataExtractor::GetU8 (uint32_t *offset_ptr, void *dst, uint32_t count) const
// RETURNS the uint16_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint16_t
-DataExtractor::GetU16 (uint32_t *offset_ptr) const
+DataExtractor::GetU16 (offset_t *offset_ptr) const
{
uint16_t val = 0;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( ValidOffsetForDataOfSize(offset, sizeof(val)) )
{
if (m_byte_order != lldb::endian::InlHostByteOrder())
@@ -414,7 +414,7 @@ DataExtractor::GetU16 (uint32_t *offset_ptr) const
}
uint16_t
-DataExtractor::GetU16_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetU16_unchecked (offset_t *offset_ptr) const
{
uint16_t val = (m_byte_order == lldb::endian::InlHostByteOrder()) ?
ReadInt16 (m_start, *offset_ptr) :
@@ -424,7 +424,7 @@ DataExtractor::GetU16_unchecked (uint32_t *offset_ptr) const
}
uint32_t
-DataExtractor::GetU32_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetU32_unchecked (offset_t *offset_ptr) const
{
uint32_t val = (m_byte_order == lldb::endian::InlHostByteOrder()) ?
ReadInt32 (m_start, *offset_ptr) :
@@ -434,7 +434,7 @@ DataExtractor::GetU32_unchecked (uint32_t *offset_ptr) const
}
uint64_t
-DataExtractor::GetU64_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetU64_unchecked (offset_t *offset_ptr) const
{
uint64_t val = (m_byte_order == lldb::endian::InlHostByteOrder()) ?
ReadInt64 (m_start, *offset_ptr) :
@@ -454,11 +454,11 @@ DataExtractor::GetU64_unchecked (uint32_t *offset_ptr) const
// in the buffer due to being out of bounds, or unsufficient data.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU16 (uint32_t *offset_ptr, void *void_dst, uint32_t count) const
+DataExtractor::GetU16 (offset_t *offset_ptr, void *void_dst, uint32_t count) const
{
uint16_t *dst = (uint16_t *)void_dst;
const size_t value_size = sizeof(*dst);
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, value_size * count) )
{
@@ -490,10 +490,10 @@ DataExtractor::GetU16 (uint32_t *offset_ptr, void *void_dst, uint32_t count) con
// RETURNS the uint32_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint32_t
-DataExtractor::GetU32 (uint32_t *offset_ptr) const
+DataExtractor::GetU32 (offset_t *offset_ptr) const
{
uint32_t val = 0;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( ValidOffsetForDataOfSize(offset, sizeof(val)) )
{
@@ -518,11 +518,11 @@ DataExtractor::GetU32 (uint32_t *offset_ptr) const
// in the buffer due to being out of bounds, or unsufficient data.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU32 (uint32_t *offset_ptr, void *void_dst, uint32_t count) const
+DataExtractor::GetU32 (offset_t *offset_ptr, void *void_dst, uint32_t count) const
{
uint32_t *dst = (uint32_t *)void_dst;
const size_t value_size = sizeof(*dst);
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, value_size * count))
{
@@ -555,10 +555,10 @@ DataExtractor::GetU32 (uint32_t *offset_ptr, void *void_dst, uint32_t count) con
// RETURNS the uint64_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetU64 (uint32_t *offset_ptr) const
+DataExtractor::GetU64 (offset_t *offset_ptr) const
{
uint64_t val = 0;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( ValidOffsetForDataOfSize(offset, sizeof(val)) )
{
if (m_byte_order != lldb::endian::InlHostByteOrder())
@@ -580,11 +580,11 @@ DataExtractor::GetU64 (uint32_t *offset_ptr) const
// return false and leave the offset pointed to by offset_ptr unchanged.
//----------------------------------------------------------------------
void *
-DataExtractor::GetU64 (uint32_t *offset_ptr, void *void_dst, uint32_t count) const
+DataExtractor::GetU64 (offset_t *offset_ptr, void *void_dst, uint32_t count) const
{
uint64_t *dst = (uint64_t *)void_dst;
const size_t value_size = sizeof(uint64_t);
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ((count > 0) && ValidOffsetForDataOfSize(offset, value_size * count))
{
@@ -621,7 +621,7 @@ DataExtractor::GetU64 (uint32_t *offset_ptr, void *void_dst, uint32_t count) con
// RETURNS the integer value that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint32_t
-DataExtractor::GetMaxU32 (uint32_t *offset_ptr, uint32_t byte_size) const
+DataExtractor::GetMaxU32 (offset_t *offset_ptr, size_t byte_size) const
{
switch (byte_size)
{
@@ -629,7 +629,7 @@ DataExtractor::GetMaxU32 (uint32_t *offset_ptr, uint32_t byte_size) const
case 2: return GetU16(offset_ptr); break;
case 4: return GetU32(offset_ptr); break;
default:
- assert(!"GetMaxU32 unhandled case!");
+ assert("GetMaxU32 unhandled case!" == NULL);
break;
}
return 0;
@@ -646,7 +646,7 @@ DataExtractor::GetMaxU32 (uint32_t *offset_ptr, uint32_t byte_size) const
// RETURNS the integer value that was extracted, or zero on failure.
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetMaxU64 (uint32_t *offset_ptr, uint32_t size) const
+DataExtractor::GetMaxU64 (offset_t *offset_ptr, size_t size) const
{
switch (size)
{
@@ -655,14 +655,14 @@ DataExtractor::GetMaxU64 (uint32_t *offset_ptr, uint32_t size) const
case 4: return GetU32(offset_ptr); break;
case 8: return GetU64(offset_ptr); break;
default:
- assert(!"GetMax64 unhandled case!");
+ assert("GetMax64 unhandled case!" == NULL);
break;
}
return 0;
}
uint64_t
-DataExtractor::GetMaxU64_unchecked (uint32_t *offset_ptr, uint32_t size) const
+DataExtractor::GetMaxU64_unchecked (offset_t *offset_ptr, size_t size) const
{
switch (size)
{
@@ -671,14 +671,14 @@ DataExtractor::GetMaxU64_unchecked (uint32_t *offset_ptr, uint32_t size) const
case 4: return GetU32_unchecked (offset_ptr); break;
case 8: return GetU64_unchecked (offset_ptr); break;
default:
- assert(!"GetMax64 unhandled case!");
+ assert("GetMax64 unhandled case!" == NULL);
break;
}
return 0;
}
int64_t
-DataExtractor::GetMaxS64 (uint32_t *offset_ptr, uint32_t size) const
+DataExtractor::GetMaxS64 (offset_t *offset_ptr, size_t size) const
{
switch (size)
{
@@ -687,14 +687,14 @@ DataExtractor::GetMaxS64 (uint32_t *offset_ptr, uint32_t size) const
case 4: return (int32_t)GetU32(offset_ptr); break;
case 8: return (int64_t)GetU64(offset_ptr); break;
default:
- assert(!"GetMax64 unhandled case!");
+ assert("GetMax64 unhandled case!" == NULL);
break;
}
return 0;
}
uint64_t
-DataExtractor::GetMaxU64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
+DataExtractor::GetMaxU64Bitfield (offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
{
uint64_t uval64 = GetMaxU64 (offset_ptr, size);
if (bitfield_bit_size > 0)
@@ -710,7 +710,7 @@ DataExtractor::GetMaxU64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t
}
int64_t
-DataExtractor::GetMaxS64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
+DataExtractor::GetMaxS64Bitfield (offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const
{
int64_t sval64 = GetMaxS64 (offset_ptr, size);
if (bitfield_bit_size > 0)
@@ -728,7 +728,7 @@ DataExtractor::GetMaxS64Bitfield (uint32_t *offset_ptr, uint32_t size, uint32_t
float
-DataExtractor::GetFloat (uint32_t *offset_ptr) const
+DataExtractor::GetFloat (offset_t *offset_ptr) const
{
typedef float float_type;
float_type val = 0.0;
@@ -754,7 +754,7 @@ DataExtractor::GetFloat (uint32_t *offset_ptr) const
}
double
-DataExtractor::GetDouble (uint32_t *offset_ptr) const
+DataExtractor::GetDouble (offset_t *offset_ptr) const
{
typedef double float_type;
float_type val = 0.0;
@@ -781,7 +781,7 @@ DataExtractor::GetDouble (uint32_t *offset_ptr) const
long double
-DataExtractor::GetLongDouble (uint32_t *offset_ptr) const
+DataExtractor::GetLongDouble (offset_t *offset_ptr) const
{
typedef long double float_type;
float_type val = 0.0;
@@ -816,13 +816,13 @@ DataExtractor::GetLongDouble (uint32_t *offset_ptr) const
// RETURNS the address that was extracted, or zero on failure.
//------------------------------------------------------------------
uint64_t
-DataExtractor::GetAddress (uint32_t *offset_ptr) const
+DataExtractor::GetAddress (offset_t *offset_ptr) const
{
return GetMaxU64 (offset_ptr, m_addr_size);
}
uint64_t
-DataExtractor::GetAddress_unchecked (uint32_t *offset_ptr) const
+DataExtractor::GetAddress_unchecked (offset_t *offset_ptr) const
{
return GetMaxU64_unchecked (offset_ptr, m_addr_size);
}
@@ -836,7 +836,7 @@ DataExtractor::GetAddress_unchecked (uint32_t *offset_ptr) const
// RETURNS the pointer that was extracted, or zero on failure.
//------------------------------------------------------------------
uint64_t
-DataExtractor::GetPointer (uint32_t *offset_ptr) const
+DataExtractor::GetPointer (offset_t *offset_ptr) const
{
return GetMaxU64 (offset_ptr, m_addr_size);
}
@@ -849,7 +849,7 @@ DataExtractor::GetPointer (uint32_t *offset_ptr) const
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetGNUEHPointer (uint32_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr)//, BSDRelocs *data_relocs) const
+DataExtractor::GetGNUEHPointer (offset_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr)//, BSDRelocs *data_relocs) const
{
if (eh_ptr_enc == DW_EH_PE_omit)
return ULLONG_MAX; // Value isn't in the buffer...
@@ -948,7 +948,7 @@ DataExtractor::GetGNUEHPointer (uint32_t *offset_ptr, uint32_t eh_ptr_enc, lldb:
}
size_t
-DataExtractor::ExtractBytes (uint32_t offset, uint32_t length, ByteOrder dst_byte_order, void *dst) const
+DataExtractor::ExtractBytes (offset_t offset, offset_t length, ByteOrder dst_byte_order, void *dst) const
{
const uint8_t *src = PeekData (offset, length);
if (src)
@@ -971,7 +971,7 @@ DataExtractor::ExtractBytes (uint32_t offset, uint32_t length, ByteOrder dst_byt
// and there are "length" bytes available, else NULL is returned.
//----------------------------------------------------------------------
const uint8_t*
-DataExtractor::PeekData (uint32_t offset, uint32_t length) const
+DataExtractor::PeekData (offset_t offset, offset_t length) const
{
if ( length > 0 && ValidOffsetForDataOfSize(offset, length) )
return m_start + offset;
@@ -988,10 +988,10 @@ DataExtractor::PeekData (uint32_t offset, uint32_t length) const
// or NULL otherwise.
//----------------------------------------------------------------------
const void*
-DataExtractor::GetData (uint32_t *offset_ptr, uint32_t length) const
+DataExtractor::GetData (offset_t *offset_ptr, offset_t length) const
{
const uint8_t* bytes = NULL;
- register uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
if ( length > 0 && ValidOffsetForDataOfSize(offset, length) )
{
bytes = m_start + offset;
@@ -1001,15 +1001,16 @@ DataExtractor::GetData (uint32_t *offset_ptr, uint32_t length) const
}
// Extract data and swap if needed when doing the copy
-uint32_t
-DataExtractor::CopyByteOrderedData (uint32_t src_offset,
- uint32_t src_len,
+lldb::offset_t
+DataExtractor::CopyByteOrderedData (offset_t src_offset,
+ offset_t src_len,
void *dst_void_ptr,
- uint32_t dst_len,
+ offset_t dst_len,
ByteOrder dst_byte_order) const
{
// Validate the source info
- assert (ValidOffsetForDataOfSize(src_offset, src_len));
+ if (!ValidOffsetForDataOfSize(src_offset, src_len))
+ assert (ValidOffsetForDataOfSize(src_offset, src_len));
assert (src_len > 0);
assert (m_byte_order == eByteOrderBig || m_byte_order == eByteOrderLittle);
@@ -1033,7 +1034,7 @@ DataExtractor::CopyByteOrderedData (uint32_t src_offset,
// We are copying the entire value from src into dst.
// Calculate how many, if any, zeroes we need for the most
// significant bytes if "dst_len" is greater than "src_len"...
- const uint32_t num_zeroes = dst_len - src_len;
+ const size_t num_zeroes = dst_len - src_len;
if (dst_byte_order == eByteOrderBig)
{
// Big endian, so we lead with zeroes...
@@ -1126,7 +1127,7 @@ DataExtractor::CopyByteOrderedData (uint32_t src_offset,
// updated.
//----------------------------------------------------------------------
const char*
-DataExtractor::GetCStr (uint32_t *offset_ptr) const
+DataExtractor::GetCStr (offset_t *offset_ptr) const
{
const char *s = NULL;
if ( m_start < m_end )
@@ -1153,7 +1154,7 @@ DataExtractor::GetCStr (uint32_t *offset_ptr) const
// this object's data, else NULL is returned.
//------------------------------------------------------------------
const char *
-DataExtractor::PeekCStr (uint32_t offset) const
+DataExtractor::PeekCStr (offset_t offset) const
{
if (ValidOffset (offset))
return (const char*)m_start + offset;
@@ -1169,7 +1170,7 @@ DataExtractor::PeekCStr (uint32_t offset) const
// Returned the extracted integer value.
//----------------------------------------------------------------------
uint64_t
-DataExtractor::GetULEB128 (uint32_t *offset_ptr) const
+DataExtractor::GetULEB128 (offset_t *offset_ptr) const
{
const uint8_t *src = m_start + *offset_ptr;
const uint8_t *end = m_end;
@@ -1206,7 +1207,7 @@ DataExtractor::GetULEB128 (uint32_t *offset_ptr) const
// Returned the extracted integer value.
//----------------------------------------------------------------------
int64_t
-DataExtractor::GetSLEB128 (uint32_t *offset_ptr) const
+DataExtractor::GetSLEB128 (offset_t *offset_ptr) const
{
int64_t result = 0;
@@ -1247,7 +1248,7 @@ DataExtractor::GetSLEB128 (uint32_t *offset_ptr) const
// Returns the number of bytes consumed during the extraction.
//----------------------------------------------------------------------
uint32_t
-DataExtractor::Skip_LEB128 (uint32_t *offset_ptr) const
+DataExtractor::Skip_LEB128 (offset_t *offset_ptr) const
{
uint32_t bytes_consumed = 0;
if ( m_start < m_end )
@@ -1263,11 +1264,11 @@ DataExtractor::Skip_LEB128 (uint32_t *offset_ptr) const
return bytes_consumed;
}
-static uint32_t
-DumpAPInt (Stream *s, const DataExtractor &data, uint32_t offset, uint32_t byte_size, bool is_signed, unsigned radix)
+static lldb::offset_t
+DumpAPInt (Stream *s, const DataExtractor &data, lldb::offset_t offset, lldb::offset_t byte_size, bool is_signed, unsigned radix)
{
llvm::SmallVector<uint64_t, 2> uint64_array;
- uint32_t bytes_left = byte_size;
+ lldb::offset_t bytes_left = byte_size;
uint64_t u64;
const lldb::ByteOrder byte_order = data.GetByteOrder();
if (byte_order == lldb::eByteOrderLittle)
@@ -1281,7 +1282,7 @@ DumpAPInt (Stream *s, const DataExtractor &data, uint32_t offset, uint32_t byte_
}
else
{
- u64 = data.GetMaxU64(&offset, bytes_left);
+ u64 = data.GetMaxU64(&offset, (uint32_t)bytes_left);
bytes_left = 0;
}
uint64_array.push_back(u64);
@@ -1289,8 +1290,8 @@ DumpAPInt (Stream *s, const DataExtractor &data, uint32_t offset, uint32_t byte_
}
else if (byte_order == lldb::eByteOrderBig)
{
- uint32_t be_offset = offset + byte_size;
- uint32_t temp_offset;
+ lldb::offset_t be_offset = offset + byte_size;
+ lldb::offset_t temp_offset;
while (bytes_left > 0)
{
if (bytes_left >= 8)
@@ -1304,7 +1305,7 @@ DumpAPInt (Stream *s, const DataExtractor &data, uint32_t offset, uint32_t byte_
{
be_offset -= bytes_left;
temp_offset = be_offset;
- u64 = data.GetMaxU64(&temp_offset, bytes_left);
+ u64 = data.GetMaxU64(&temp_offset, (uint32_t)bytes_left);
bytes_left = 0;
}
uint64_array.push_back(u64);
@@ -1331,13 +1332,13 @@ DumpAPInt (Stream *s, const DataExtractor &data, uint32_t offset, uint32_t byte_
return offset;
}
-uint32_t
+lldb::offset_t
DataExtractor::Dump (Stream *s,
- uint32_t start_offset,
+ offset_t start_offset,
lldb::Format item_format,
- uint32_t item_byte_size,
- uint32_t item_count,
- uint32_t num_per_line,
+ size_t item_byte_size,
+ size_t item_count,
+ size_t num_per_line,
uint64_t base_addr,
uint32_t item_bit_size, // If zero, this is not a bitfield value, if non-zero, the value is a bitfield
uint32_t item_bit_offset, // If "item_bit_size" is non-zero, this is the shift amount to apply to a bitfield
@@ -1352,7 +1353,7 @@ DataExtractor::Dump (Stream *s,
item_byte_size = s->GetAddressByteSize();
}
- uint32_t offset = start_offset;
+ offset_t offset = start_offset;
if (item_format == eFormatInstruction)
{
@@ -1393,7 +1394,7 @@ DataExtractor::Dump (Stream *s,
if ((item_format == eFormatOSType || item_format == eFormatAddressInfo) && item_byte_size > 8)
item_format = eFormatHex;
- uint32_t line_start_offset = start_offset;
+ lldb::offset_t line_start_offset = start_offset;
for (uint32_t count = 0; ValidOffset(offset) && count < item_count; ++count)
{
if ((count % num_per_line) == 0)
@@ -1402,8 +1403,8 @@ DataExtractor::Dump (Stream *s,
{
if (item_format == eFormatBytesWithASCII && offset > line_start_offset)
{
- s->Printf("%*s", (num_per_line - (offset - line_start_offset)) * 3 + 2, "");
- Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
+ s->Printf("%*s", static_cast<int>((num_per_line - (offset - line_start_offset)) * 3 + 2), "");
+ Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, LLDB_INVALID_OFFSET, LLDB_INVALID_ADDRESS, 0, 0);
}
s->EOL();
}
@@ -1428,7 +1429,7 @@ DataExtractor::Dump (Stream *s,
s->Printf ("%s", GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset) ? "true" : "false");
else
{
- s->Printf("error: unsupported byte size (%u) for boolean format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for boolean format", item_byte_size);
return offset;
}
break;
@@ -1584,7 +1585,7 @@ DataExtractor::Dump (Stream *s,
if (!cstr)
{
s->Printf("NULL");
- offset = UINT32_MAX;
+ offset = LLDB_INVALID_OFFSET;
}
else
{
@@ -1628,7 +1629,7 @@ DataExtractor::Dump (Stream *s,
case eFormatComplexInteger:
{
- uint32_t complex_int_byte_size = item_byte_size / 2;
+ size_t complex_int_byte_size = item_byte_size / 2;
if (complex_int_byte_size <= 8)
{
@@ -1637,7 +1638,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
- s->Printf("error: unsupported byte size (%u) for complex integer format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for complex integer format", item_byte_size);
return offset;
}
}
@@ -1669,7 +1670,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
- s->Printf("error: unsupported byte size (%u) for complex float format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for complex float format", item_byte_size);
return offset;
}
break;
@@ -1682,7 +1683,7 @@ DataExtractor::Dump (Stream *s,
bool wantsuppercase = (item_format == eFormatHexUppercase);
if (item_byte_size <= 8)
{
- s->Printf(wantsuppercase ? "0x%*.*" PRIX64 : "0x%*.*" PRIx64, 2 * item_byte_size, 2 * item_byte_size, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+ s->Printf(wantsuppercase ? "0x%*.*" PRIX64 : "0x%*.*" PRIx64, (int)(2 * item_byte_size), (int)(2 * item_byte_size), GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
}
else
{
@@ -1727,7 +1728,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
- s->Printf("error: unsupported byte size (%u) for float format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for float format", item_byte_size);
return offset;
}
ss.flush();
@@ -1746,7 +1747,7 @@ DataExtractor::Dump (Stream *s,
case eFormatAddressInfo:
{
addr_t addr = GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset);
- s->Printf("0x%*.*" PRIx64, 2 * item_byte_size, 2 * item_byte_size, addr);
+ s->Printf("0x%*.*" PRIx64, (int)(2 * item_byte_size), (int)(2 * item_byte_size), addr);
if (exe_scope)
{
TargetSP target_sp (exe_scope->CalculateTarget());
@@ -1790,7 +1791,7 @@ DataExtractor::Dump (Stream *s,
}
else
{
- s->Printf("error: unsupported byte size (%u) for hex float format", item_byte_size);
+ s->Printf("error: unsupported byte size (%zu) for hex float format", item_byte_size);
return offset;
}
break;
@@ -1874,8 +1875,8 @@ DataExtractor::Dump (Stream *s,
if (item_format == eFormatBytesWithASCII && offset > line_start_offset)
{
- s->Printf("%*s", (num_per_line - (offset - line_start_offset)) * 3 + 2, "");
- Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
+ s->Printf("%*s", static_cast<int>((num_per_line - (offset - line_start_offset)) * 3 + 2), "");
+ Dump(s, line_start_offset, eFormatCharPrintable, 1, offset - line_start_offset, LLDB_INVALID_OFFSET, LLDB_INVALID_ADDRESS, 0, 0);
}
return offset; // Return the offset at which we ended up
}
@@ -1892,12 +1893,12 @@ DataExtractor::Dump (Stream *s,
// string will be used for the supplied "type". If the stream "s"
// is NULL, then the output will be send to Log().
//----------------------------------------------------------------------
-uint32_t
+lldb::offset_t
DataExtractor::PutToLog
(
Log *log,
- uint32_t start_offset,
- uint32_t length,
+ offset_t start_offset,
+ offset_t length,
uint64_t base_addr,
uint32_t num_per_line,
DataExtractor::Type type,
@@ -1907,8 +1908,8 @@ DataExtractor::PutToLog
if (log == NULL)
return start_offset;
- uint32_t offset;
- uint32_t end_offset;
+ offset_t offset;
+ offset_t end_offset;
uint32_t count;
StreamString sstr;
for (offset = start_offset, end_offset = offset + length, count = 0; ValidOffset(offset) && offset < end_offset; ++count)
@@ -1956,7 +1957,7 @@ DataExtractor::PutToLog
// Dump out a UUID starting at 'offset' bytes into the buffer
//----------------------------------------------------------------------
void
-DataExtractor::DumpUUID (Stream *s, uint32_t offset) const
+DataExtractor::DumpUUID (Stream *s, offset_t offset) const
{
if (s)
{
@@ -1968,7 +1969,7 @@ DataExtractor::DumpUUID (Stream *s, uint32_t offset) const
}
else
{
- s->Printf("<not enough data for UUID at offset 0x%8.8x>", offset);
+ s->Printf("<not enough data for UUID at offset 0x%8.8" PRIx64 ">", offset);
}
}
}
@@ -2039,7 +2040,7 @@ DataExtractor::Append(DataExtractor& rhs)
}
bool
-DataExtractor::Append(void* buf, uint32_t length)
+DataExtractor::Append(void* buf, offset_t length)
{
if (buf == NULL)
return false;
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 2a296dba15b..e7e0e203f4d 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -999,7 +999,7 @@ Debugger::GetAsyncErrorStream ()
CommandInterpreter::eBroadcastBitAsynchronousErrorData));
}
-uint32_t
+size_t
Debugger::GetNumDebuggers()
{
if (g_shared_debugger_refcount > 0)
@@ -1011,7 +1011,7 @@ Debugger::GetNumDebuggers()
}
lldb::DebuggerSP
-Debugger::GetDebuggerAtIndex (uint32_t index)
+Debugger::GetDebuggerAtIndex (size_t index)
{
DebuggerSP debugger_sp;
@@ -1228,7 +1228,7 @@ ScanBracketedRange (const char* var_name_begin,
{
if (log)
log->Printf("[ScanBracketedRange] swapping indices");
- int temp = *index_lower;
+ int64_t temp = *index_lower;
*index_lower = *index_higher;
*index_higher = temp;
}
@@ -1240,7 +1240,7 @@ ScanBracketedRange (const char* var_name_begin,
static ValueObjectSP
ExpandIndexedExpression (ValueObject* valobj,
- uint32_t index,
+ size_t index,
StackFrame* frame,
bool deref_pointer)
{
@@ -2539,8 +2539,7 @@ Debugger::FormatPrompt
unsigned long octal_value = ::strtoul (oct_str, NULL, 8);
if (octal_value <= UINT8_MAX)
{
- char octal_char = octal_value;
- s.Write (&octal_char, 1);
+ s.PutChar((char)octal_value);
}
}
break;
@@ -2563,7 +2562,7 @@ Debugger::FormatPrompt
unsigned long hex_value = strtoul (hex_str, NULL, 16);
if (hex_value <= UINT8_MAX)
- s.PutChar (hex_value);
+ s.PutChar ((char)hex_value);
}
else
{
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 08d6d9a5ac0..0d29e01ecc9 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -638,7 +638,7 @@ Instruction::ReadArray (FILE *in_file, Stream *out_stream, OptionValue::Type dat
std::string line (buffer);
- int len = line.size();
+ size_t len = line.size();
if (line[len-1] == '\n')
{
line[len-1] = '\0';
@@ -706,7 +706,7 @@ Instruction::ReadDictionary (FILE *in_file, Stream *out_stream)
// Check to see if the line contains the end-of-dictionary marker ("}")
std::string line (buffer);
- int len = line.size();
+ size_t len = line.size();
if (line[len-1] == '\n')
{
line[len-1] = '\0';
@@ -776,7 +776,7 @@ Instruction::ReadDictionary (FILE *in_file, Stream *out_stream)
}
else
{
- int len = value.size();
+ size_t len = value.size();
if ((value[0] == '"') && (value[len-1] == '"'))
value = value.substr (1, len-2);
value_sp.reset (new OptionValueString (value.c_str(), ""));
@@ -945,7 +945,7 @@ InstructionList::GetMaxOpcocdeByteSize () const
InstructionSP
-InstructionList::GetInstructionAtIndex (uint32_t idx) const
+InstructionList::GetInstructionAtIndex (size_t idx) const
{
InstructionSP inst_sp;
if (idx < m_instructions.size())
@@ -1007,9 +1007,9 @@ InstructionList::GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Tar
{
Address address;
address.SetLoadAddress(load_addr, &target);
- uint32_t num_instructions = m_instructions.size();
+ size_t num_instructions = m_instructions.size();
uint32_t index = UINT32_MAX;
- for (int i = 0; i < num_instructions; i++)
+ for (size_t i = 0; i < num_instructions; i++)
{
if (m_instructions[i]->GetAddress() == address)
{
@@ -1171,7 +1171,7 @@ PseudoInstruction::DoesBranch () const
size_t
PseudoInstruction::Decode (const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,
- uint32_t data_offset)
+ lldb::offset_t data_offset)
{
return m_opcode.GetByteSize();
}
diff --git a/lldb/source/Core/EmulateInstruction.cpp b/lldb/source/Core/EmulateInstruction.cpp
index ad074181aff..73763f5ceec 100644
--- a/lldb/source/Core/EmulateInstruction.cpp
+++ b/lldb/source/Core/EmulateInstruction.cpp
@@ -186,7 +186,7 @@ EmulateInstruction::ReadMemoryUnsigned (const Context &context, lldb::addr_t add
size_t bytes_read = m_read_mem_callback (this, m_baton, context, addr, buf, byte_size);
if (bytes_read == byte_size)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
DataExtractor data (buf, byte_size, GetByteOrder(), GetAddressByteSize());
uval64 = data.GetMaxU64 (&offset, byte_size);
success = true;
diff --git a/lldb/source/Core/Error.cpp b/lldb/source/Core/Error.cpp
index 61faca464b7..9de99be12f5 100644
--- a/lldb/source/Core/Error.cpp
+++ b/lldb/source/Core/Error.cpp
@@ -356,7 +356,7 @@ Error::SetErrorStringWithVarArg (const char *format, va_list args)
// allocated buffer above
va_list copy_args;
va_copy (copy_args, args);
- size_t length = ::vsnprintf (buf.data(), buf.size(), format, args);
+ unsigned length = ::vsnprintf (buf.data(), buf.size(), format, args);
if (length >= buf.size())
{
// The error formatted string didn't fit into our buffer, resize it
diff --git a/lldb/source/Core/FileSpecList.cpp b/lldb/source/Core/FileSpecList.cpp
index a24494d16e4..0cec8faa6bc 100644
--- a/lldb/source/Core/FileSpecList.cpp
+++ b/lldb/source/Core/FileSpecList.cpp
@@ -106,17 +106,16 @@ FileSpecList::Dump(Stream *s, const char *separator_cstr) const
// Returns the valid index of the file that matches "file_spec" if
// it is found, else UINT32_MAX is returned.
//------------------------------------------------------------------
-uint32_t
-FileSpecList::FindFileIndex (uint32_t start_idx, const FileSpec &file_spec, bool full) const
+size_t
+FileSpecList::FindFileIndex (size_t start_idx, const FileSpec &file_spec, bool full) const
{
- const uint32_t num_files = m_files.size();
- uint32_t idx;
+ const size_t num_files = m_files.size();
// When looking for files, we will compare only the filename if the
// FILE_SPEC argument is empty
bool compare_filename_only = file_spec.GetDirectory().IsEmpty();
- for (idx = start_idx; idx < num_files; ++idx)
+ for (size_t idx = start_idx; idx < num_files; ++idx)
{
if (compare_filename_only)
{
@@ -139,7 +138,7 @@ FileSpecList::FindFileIndex (uint32_t start_idx, const FileSpec &file_spec, bool
// range, then an empty FileSpec object will be returned.
//------------------------------------------------------------------
const FileSpec &
-FileSpecList::GetFileSpecAtIndex(uint32_t idx) const
+FileSpecList::GetFileSpecAtIndex(size_t idx) const
{
if (idx < m_files.size())
@@ -149,7 +148,7 @@ FileSpecList::GetFileSpecAtIndex(uint32_t idx) const
}
const FileSpec *
-FileSpecList::GetFileSpecPointerAtIndex(uint32_t idx) const
+FileSpecList::GetFileSpecPointerAtIndex(size_t idx) const
{
if (idx < m_files.size())
return &m_files[idx];
@@ -179,7 +178,7 @@ FileSpecList::MemorySize () const
//------------------------------------------------------------------
// Return the number of files in the file spec list.
//------------------------------------------------------------------
-uint32_t
+size_t
FileSpecList::GetSize() const
{
return m_files.size();
diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp
index 84d450a90b8..cc25f38e561 100644
--- a/lldb/source/Core/FormatClasses.cpp
+++ b/lldb/source/Core/FormatClasses.cpp
@@ -345,7 +345,7 @@ TypeSyntheticImpl::FrontEnd::~FrontEnd()
}
lldb::ValueObjectSP
-TypeSyntheticImpl::FrontEnd::GetChildAtIndex (uint32_t idx)
+TypeSyntheticImpl::FrontEnd::GetChildAtIndex (size_t idx)
{
if (!m_wrapper_sp || !m_interpreter)
return lldb::ValueObjectSP();
@@ -369,7 +369,7 @@ TypeSyntheticImpl::GetDescription()
#endif // #ifndef LLDB_DISABLE_PYTHON
int
-SyntheticArrayView::GetRealIndexForIndex(int i)
+SyntheticArrayView::GetRealIndexForIndex(size_t i)
{
if (i >= GetCount())
return -1;
diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp
index cd2ae7f29f2..2a84b806124 100644
--- a/lldb/source/Core/FormatManager.cpp
+++ b/lldb/source/Core/FormatManager.cpp
@@ -615,7 +615,7 @@ CategoryMap::LoopThrough(CallbackType callback, void* param)
}
TypeCategoryImplSP
-CategoryMap::GetAtIndex (uint32_t index)
+CategoryMap::GetAtIndex (size_t index)
{
Mutex::Locker locker(m_map_mutex);
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 82abbaec557..e7012875607 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -346,16 +346,15 @@ void
Module::ParseAllDebugSymbols()
{
Mutex::Locker locker (m_mutex);
- uint32_t num_comp_units = GetNumCompileUnits();
+ size_t num_comp_units = GetNumCompileUnits();
if (num_comp_units == 0)
return;
SymbolContext sc;
sc.module_sp = shared_from_this();
- uint32_t cu_idx;
SymbolVendor *symbols = GetSymbolVendor ();
- for (cu_idx = 0; cu_idx < num_comp_units; cu_idx++)
+ for (size_t cu_idx = 0; cu_idx < num_comp_units; cu_idx++)
{
sc.comp_unit = symbols->GetCompileUnitAtIndex(cu_idx).get();
if (sc.comp_unit)
@@ -365,8 +364,7 @@ Module::ParseAllDebugSymbols()
symbols->ParseCompileUnitFunctions(sc);
- uint32_t func_idx;
- for (func_idx = 0; (sc.function = sc.comp_unit->GetFunctionAtIndex(func_idx).get()) != NULL; ++func_idx)
+ for (size_t func_idx = 0; (sc.function = sc.comp_unit->GetFunctionAtIndex(func_idx).get()) != NULL; ++func_idx)
{
symbols->ParseFunctionBlocks(sc);
@@ -400,7 +398,7 @@ Module::DumpSymbolContext(Stream *s)
s->Printf(", Module{%p}", this);
}
-uint32_t
+size_t
Module::GetNumCompileUnits()
{
Mutex::Locker locker (m_mutex);
@@ -412,10 +410,10 @@ Module::GetNumCompileUnits()
}
CompUnitSP
-Module::GetCompileUnitAtIndex (uint32_t index)
+Module::GetCompileUnitAtIndex (size_t index)
{
Mutex::Locker locker (m_mutex);
- uint32_t num_comp_units = GetNumCompileUnits ();
+ size_t num_comp_units = GetNumCompileUnits ();
CompUnitSP cu_sp;
if (index < num_comp_units)
@@ -529,16 +527,24 @@ Module::ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_t li
}
-uint32_t
-Module::FindGlobalVariables(const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
+size_t
+Module::FindGlobalVariables (const ConstString &name,
+ const ClangNamespaceDecl *namespace_decl,
+ bool append,
+ size_t max_matches,
+ VariableList& variables)
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
return symbols->FindGlobalVariables(name, namespace_decl, append, max_matches, variables);
return 0;
}
-uint32_t
-Module::FindGlobalVariables(const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
+
+size_t
+Module::FindGlobalVariables (const RegularExpression& regex,
+ bool append,
+ size_t max_matches,
+ VariableList& variables)
{
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
@@ -546,7 +552,7 @@ Module::FindGlobalVariables(const RegularExpression& regex, bool append, uint32_
return 0;
}
-uint32_t
+size_t
Module::FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list)
@@ -554,12 +560,12 @@ Module::FindCompileUnits (const FileSpec &path,
if (!append)
sc_list.Clear();
- const uint32_t start_size = sc_list.GetSize();
- const uint32_t num_compile_units = GetNumCompileUnits();
+ const size_t start_size = sc_list.GetSize();
+ const size_t num_compile_units = GetNumCompileUnits();
SymbolContext sc;
sc.module_sp = shared_from_this();
const bool compare_directory = path.GetDirectory();
- for (uint32_t i=0; i<num_compile_units; ++i)
+ for (size_t i=0; i<num_compile_units; ++i)
{
sc.comp_unit = GetCompileUnitAtIndex(i).get();
if (sc.comp_unit)
@@ -571,10 +577,10 @@ Module::FindCompileUnits (const FileSpec &path,
return sc_list.GetSize() - start_size;
}
-uint32_t
+size_t
Module::FindFunctions (const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
- uint32_t name_type_mask,
+ uint32_t name_type_mask,
bool include_symbols,
bool include_inlines,
bool append,
@@ -583,7 +589,7 @@ Module::FindFunctions (const ConstString &name,
if (!append)
sc_list.Clear();
- const uint32_t start_size = sc_list.GetSize();
+ const size_t start_size = sc_list.GetSize();
// Find all the functions (not symbols, but debug information functions...
SymbolVendor *symbols = GetSymbolVendor ();
@@ -601,12 +607,12 @@ Module::FindFunctions (const ConstString &name,
{
std::vector<uint32_t> symbol_indexes;
symtab->FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
- const uint32_t num_matches = symbol_indexes.size();
+ const size_t num_matches = symbol_indexes.size();
if (num_matches)
{
const bool merge_symbol_into_function = true;
SymbolContext sc(this);
- for (uint32_t i=0; i<num_matches; i++)
+ for (size_t i=0; i<num_matches; i++)
{
sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
sc_list.AppendIfUnique (sc, merge_symbol_into_function);
@@ -618,7 +624,7 @@ Module::FindFunctions (const ConstString &name,
return sc_list.GetSize() - start_size;
}
-uint32_t
+size_t
Module::FindFunctions (const RegularExpression& regex,
bool include_symbols,
bool include_inlines,
@@ -628,7 +634,7 @@ Module::FindFunctions (const RegularExpression& regex,
if (!append)
sc_list.Clear();
- const uint32_t start_size = sc_list.GetSize();
+ const size_t start_size = sc_list.GetSize();
SymbolVendor *symbols = GetSymbolVendor ();
if (symbols)
@@ -644,12 +650,12 @@ Module::FindFunctions (const RegularExpression& regex,
{
std::vector<uint32_t> symbol_indexes;
symtab->AppendSymbolIndexesMatchingRegExAndType (regex, eSymbolTypeCode, Symtab::eDebugAny, Symtab::eVisibilityAny, symbol_indexes);
- const uint32_t num_matches = symbol_indexes.size();
+ const size_t num_matches = symbol_indexes.size();
if (num_matches)
{
const bool merge_symbol_into_function = true;
SymbolContext sc(this);
- for (uint32_t i=0; i<num_matches; i++)
+ for (size_t i=0; i<num_matches; i++)
{
sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
sc_list.AppendIfUnique (sc, merge_symbol_into_function);
@@ -661,12 +667,12 @@ Module::FindFunctions (const RegularExpression& regex,
return sc_list.GetSize() - start_size;
}
-uint32_t
+size_t
Module::FindTypes_Impl (const SymbolContext& sc,
const ConstString &name,
const ClangNamespaceDecl *namespace_decl,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types)
{
Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
@@ -679,11 +685,11 @@ Module::FindTypes_Impl (const SymbolContext& sc,
return 0;
}
-uint32_t
+size_t
Module::FindTypesInNamespace (const SymbolContext& sc,
const ConstString &type_name,
const ClangNamespaceDecl *namespace_decl,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& type_list)
{
const bool append = true;
@@ -696,21 +702,21 @@ Module::FindFirstType (const SymbolContext& sc,
bool exact_match)
{
TypeList type_list;
- const uint32_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
+ const size_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
if (num_matches)
return type_list.GetTypeAtIndex(0);
return TypeSP();
}
-uint32_t
+size_t
Module::FindTypes (const SymbolContext& sc,
const ConstString &name,
bool exact_match,
- uint32_t max_matches,
+ size_t max_matches,
TypeList& types)
{
- uint32_t num_matches = 0;
+ size_t num_matches = 0;
const char *type_name_cstr = name.GetCString();
std::string type_scope;
std::string type_basename;
@@ -756,17 +762,6 @@ Module::FindTypes (const SymbolContext& sc,
}
-//uint32_t
-//Module::FindTypes(const SymbolContext& sc, const RegularExpression& regex, bool append, uint32_t max_matches, Type::Encoding encoding, const char *udt_name, TypeList& types)
-//{
-// Timer scoped_timer(__PRETTY_FUNCTION__);
-// SymbolVendor *symbols = GetSymbolVendor ();
-// if (symbols)
-// return symbols->FindTypes(sc, regex, append, max_matches, encoding, udt_name, types);
-// return 0;
-//
-//}
-
SymbolVendor*
Module::GetSymbolVendor (bool can_create, lldb_private::Stream *feedback_strm)
{
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index f2f39204688..05dc3e3a786 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -296,14 +296,14 @@ ModuleList::ClearImpl (bool use_notifier)
}
Module*
-ModuleList::GetModulePointerAtIndex (uint32_t idx) const
+ModuleList::GetModulePointerAtIndex (size_t idx) const
{
Mutex::Locker locker(m_modules_mutex);
return GetModulePointerAtIndexUnlocked(idx);
}
Module*
-ModuleList::GetModulePointerAtIndexUnlocked (uint32_t idx) const
+ModuleList::GetModulePointerAtIndexUnlocked (size_t idx) const
{
if (idx < m_modules.size())
return m_modules[idx].get();
@@ -311,14 +311,14 @@ ModuleList::GetModulePointerAtIndexUnlocked (uint32_t idx) const
}
ModuleSP
-ModuleList::GetModuleAtIndex(uint32_t idx) const
+ModuleList::GetModuleAtIndex(size_t idx) const
{
Mutex::Locker locker(m_modules_mutex);
return GetModuleAtIndexUnlocked(idx);
}
ModuleSP
-ModuleList::GetModuleAtIndexUnlocked(uint32_t idx) const
+ModuleList::GetModuleAtIndexUnlocked(size_t idx) const
{
ModuleSP module_sp;
if (idx < m_modules.size())
@@ -326,7 +326,7 @@ ModuleList::GetModuleAtIndexUnlocked(uint32_t idx) const
return module_sp;
}
-uint32_t
+size_t
ModuleList::FindFunctions (const ConstString &name,
uint32_t name_type_mask,
bool include_symbols,
@@ -347,7 +347,7 @@ ModuleList::FindFunctions (const ConstString &name,
return sc_list.GetSize();
}
-uint32_t
+size_t
ModuleList::FindCompileUnits (const FileSpec &path,
bool append,
SymbolContextList &sc_list) const
@@ -365,10 +365,10 @@ ModuleList::FindCompileUnits (const FileSpec &path,
return sc_list.GetSize();
}
-uint32_t
+size_t
ModuleList::FindGlobalVariables (const ConstString &name,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const
{
size_t initial_size = variable_list.GetSize();
@@ -382,10 +382,10 @@ ModuleList::FindGlobalVariables (const ConstString &name,
}
-uint32_t
+size_t
ModuleList::FindGlobalVariables (const RegularExpression& regex,
bool append,
- uint32_t max_matches,
+ size_t max_matches,
VariableList& variable_list) const
{
size_t initial_size = variable_list.GetSize();
@@ -495,12 +495,12 @@ ModuleList::FindModule (const UUID &uuid) const
}
-uint32_t
-ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, uint32_t max_matches, TypeList& types) const
+size_t
+ModuleList::FindTypes (const SymbolContext& sc, const ConstString &name, bool name_is_fully_qualified, size_t max_matches, TypeList& types) const
{
Mutex::Locker locker(m_modules_mutex);
- uint32_t total_matches = 0;
+ size_t total_matches = 0;
collection::const_iterator pos, end = m_modules.end();
if (sc.module_sp)
{
@@ -689,7 +689,7 @@ ModuleList::ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_
return sc_list.GetSize();
}
-uint32_t
+size_t
ModuleList::GetIndexForModule (const Module *module) const
{
if (module)
@@ -737,7 +737,7 @@ ModuleList::FindSharedModules (const ModuleSpec &module_spec, ModuleList &matchi
return GetSharedModuleList ().FindModules (module_spec, matching_module_list);
}
-uint32_t
+size_t
ModuleList::RemoveOrphanSharedModules (bool mandatory)
{
return GetSharedModuleList ().RemoveOrphans(mandatory);
@@ -781,7 +781,7 @@ ModuleList::GetSharedModule
const size_t num_matching_modules = shared_module_list.FindModules (module_spec, matching_module_list);
if (num_matching_modules > 0)
{
- for (uint32_t module_idx = 0; module_idx < num_matching_modules; ++module_idx)
+ for (size_t module_idx = 0; module_idx < num_matching_modules; ++module_idx)
{
module_sp = matching_module_list.GetModuleAtIndex(module_idx);
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp
index 0a4b21fd409..fc24cafc8aa 100644
--- a/lldb/source/Core/PluginManager.cpp
+++ b/lldb/source/Core/PluginManager.cpp
@@ -1346,7 +1346,7 @@ PluginManager::GetPlatformCreateCallbackForPluginName (const char *name)
return NULL;
}
-uint32_t
+size_t
PluginManager::AutoCompletePlatformName (const char *name, StringList &matches)
{
if (name && name[0])
diff --git a/lldb/source/Core/RegisterValue.cpp b/lldb/source/Core/RegisterValue.cpp
index a54e10dbbc4..4bfc7be0713 100644
--- a/lldb/source/Core/RegisterValue.cpp
+++ b/lldb/source/Core/RegisterValue.cpp
@@ -301,7 +301,7 @@ RegisterValue::SetType (const RegisterInfo *reg_info)
}
Error
-RegisterValue::SetValueFromData (const RegisterInfo *reg_info, DataExtractor &src, uint32_t src_offset, bool partial_data_ok)
+RegisterValue::SetValueFromData (const RegisterInfo *reg_info, DataExtractor &src, lldb::offset_t src_offset, bool partial_data_ok)
{
Error error;
diff --git a/lldb/source/Core/Scalar.cpp b/lldb/source/Core/Scalar.cpp
index 8750397197c..0fa112c80d6 100644
--- a/lldb/source/Core/Scalar.cpp
+++ b/lldb/source/Core/Scalar.cpp
@@ -523,11 +523,11 @@ Scalar::GetValueTypeAsCString (Scalar::Type type)
Scalar::Type
Scalar::GetValueTypeForSignedIntegerWithByteSize (size_t byte_size)
{
- if (byte_size <= sizeof(int))
+ if (byte_size <= sizeof(sint_t))
return e_sint;
- if (byte_size <= sizeof(long))
+ if (byte_size <= sizeof(slong_t))
return e_slong;
- if (byte_size <= sizeof(long long))
+ if (byte_size <= sizeof(slonglong_t))
return e_slonglong;
return e_void;
}
@@ -535,11 +535,11 @@ Scalar::GetValueTypeForSignedIntegerWithByteSize (size_t byte_size)
Scalar::Type
Scalar::GetValueTypeForUnsignedIntegerWithByteSize (size_t byte_size)
{
- if (byte_size <= sizeof(unsigned int))
+ if (byte_size <= sizeof(uint_t))
return e_uint;
- if (byte_size <= sizeof(unsigned long))
+ if (byte_size <= sizeof(ulong_t))
return e_ulong;
- if (byte_size <= sizeof(unsigned long long))
+ if (byte_size <= sizeof(ulonglong_t))
return e_ulonglong;
return e_void;
}
@@ -547,11 +547,11 @@ Scalar::GetValueTypeForUnsignedIntegerWithByteSize (size_t byte_size)
Scalar::Type
Scalar::GetValueTypeForFloatWithByteSize (size_t byte_size)
{
- if (byte_size == sizeof(float))
+ if (byte_size == sizeof(float_t))
return e_float;
- if (byte_size == sizeof(double))
+ if (byte_size == sizeof(double_t))
return e_double;
- if (byte_size == sizeof(long double))
+ if (byte_size == sizeof(long_double_t))
return e_long_double;
return e_void;
}
@@ -601,8 +601,8 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.slong; success = true; break;
- case e_uint: m_data.uint = m_data.slong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.slong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.slong; success = true; break;
case e_slong: success = true; break;
case e_ulong: m_data.ulong = m_data.slong; success = true; break;
case e_slonglong: m_data.slonglong = m_data.slong; success = true; break;
@@ -617,8 +617,8 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.ulong; success = true; break;
- case e_uint: m_data.uint = m_data.ulong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.ulong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.ulong; success = true; break;
case e_slong: m_data.slong = m_data.ulong; success = true; break;
case e_ulong: success = true; break;
case e_slonglong: m_data.slonglong = m_data.ulong; success = true; break;
@@ -633,8 +633,8 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.slonglong; success = true; break;
- case e_uint: m_data.uint = m_data.slonglong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.slonglong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.slonglong; success = true; break;
case e_slong: m_data.slong = m_data.slonglong; success = true; break;
case e_ulong: m_data.ulong = m_data.slonglong; success = true; break;
case e_slonglong: success = true; break;
@@ -649,8 +649,8 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.ulonglong; success = true; break;
- case e_uint: m_data.uint = m_data.ulonglong; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.ulonglong; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.ulonglong; success = true; break;
case e_slong: m_data.slong = m_data.ulonglong; success = true; break;
case e_ulong: m_data.ulong = m_data.ulonglong; success = true; break;
case e_slonglong: m_data.slonglong = m_data.ulonglong; success = true; break;
@@ -665,15 +665,15 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.flt; success = true; break;
- case e_uint: m_data.uint = m_data.flt; success = true; break;
- case e_slong: m_data.slong = m_data.flt; success = true; break;
- case e_ulong: m_data.ulong = m_data.flt; success = true; break;
- case e_slonglong: m_data.slonglong = m_data.flt; success = true; break;
- case e_ulonglong: m_data.ulonglong = m_data.flt; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.flt; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.flt; success = true; break;
+ case e_slong: m_data.slong = (slong_t)m_data.flt; success = true; break;
+ case e_ulong: m_data.ulong = (ulong_t)m_data.flt; success = true; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)m_data.flt; success = true; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)m_data.flt; success = true; break;
case e_float: success = true; break;
- case e_double: m_data.dbl = m_data.flt; success = true; break;
- case e_long_double: m_data.ldbl = m_data.flt; success = true; break;
+ case e_double: m_data.dbl = m_data.flt; success = true; break;
+ case e_long_double: m_data.ldbl = m_data.flt; success = true; break;
}
break;
@@ -681,15 +681,15 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.dbl; success = true; break;
- case e_uint: m_data.uint = m_data.dbl; success = true; break;
- case e_slong: m_data.slong = m_data.dbl; success = true; break;
- case e_ulong: m_data.ulong = m_data.dbl; success = true; break;
- case e_slonglong: m_data.slonglong = m_data.dbl; success = true; break;
- case e_ulonglong: m_data.ulonglong = m_data.dbl; success = true; break;
- case e_float: m_data.flt = m_data.dbl; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.dbl; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.dbl; success = true; break;
+ case e_slong: m_data.slong = (slong_t)m_data.dbl; success = true; break;
+ case e_ulong: m_data.ulong = (ulong_t)m_data.dbl; success = true; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)m_data.dbl; success = true; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)m_data.dbl; success = true; break;
+ case e_float: m_data.flt = (float_t)m_data.dbl; success = true; break;
case e_double: success = true; break;
- case e_long_double: m_data.ldbl = m_data.dbl; success = true; break;
+ case e_long_double: m_data.ldbl = m_data.dbl; success = true; break;
}
break;
@@ -697,14 +697,14 @@ Scalar::Cast(Scalar::Type type)
switch (type)
{
case e_void:
- case e_sint: m_data.sint = m_data.ldbl; success = true; break;
- case e_uint: m_data.uint = m_data.ldbl; success = true; break;
- case e_slong: m_data.slong = m_data.ldbl; success = true; break;
- case e_ulong: m_data.ulong = m_data.ldbl; success = true; break;
- case e_slonglong: m_data.slonglong = m_data.ldbl; success = true; break;
- case e_ulonglong: m_data.ulonglong = m_data.ldbl; success = true; break;
- case e_float: m_data.flt = m_data.ldbl; success = true; break;
- case e_double: m_data.dbl = m_data.ldbl; success = true; break;
+ case e_sint: m_data.sint = (sint_t)m_data.ldbl; success = true; break;
+ case e_uint: m_data.uint = (uint_t)m_data.ldbl; success = true; break;
+ case e_slong: m_data.slong = (slong_t)m_data.ldbl; success = true; break;
+ case e_ulong: m_data.ulong = (ulong_t)m_data.ldbl; success = true; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)m_data.ldbl; success = true; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)m_data.ldbl; success = true; break;
+ case e_float: m_data.flt = (float_t)m_data.ldbl; success = true; break;
+ case e_double: m_data.dbl = (double_t)m_data.ldbl; success = true; break;
case e_long_double: success = true; break;
}
break;
@@ -815,29 +815,29 @@ Scalar::GetRawBits64(uint64_t fail_value) const
return m_data.ulonglong;
case e_float:
- if (sizeof(m_data.flt) == sizeof(int))
+ if (sizeof(m_data.flt) == sizeof(m_data.uint))
return m_data.uint;
- else if (sizeof(m_data.flt) == sizeof(unsigned long))
+ else if (sizeof(m_data.flt) == sizeof(m_data.ulong))
return m_data.ulong;
- else if (sizeof(m_data.flt) == sizeof(unsigned long long))
+ else if (sizeof(m_data.flt) == sizeof(m_data.ulonglong))
return m_data.ulonglong;
break;
case e_double:
- if (sizeof(m_data.dbl) == sizeof(int))
+ if (sizeof(m_data.dbl) == sizeof(m_data.uint))
return m_data.uint;
- else if (sizeof(m_data.dbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.dbl) == sizeof(m_data.ulong))
return m_data.ulong;
- else if (sizeof(m_data.dbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.dbl) == sizeof(m_data.ulonglong))
return m_data.ulonglong;
break;
case e_long_double:
- if (sizeof(m_data.ldbl) == sizeof(int))
+ if (sizeof(m_data.ldbl) == sizeof(m_data.uint))
return m_data.uint;
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.ldbl) == sizeof(m_data.ulong))
return m_data.ulong;
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.ldbl) == sizeof(m_data.ulonglong))
return m_data.ulonglong;
break;
}
@@ -1756,7 +1756,7 @@ Scalar::RawULongLong () const
Error
-Scalar::SetValueFromCString (const char *value_str, Encoding encoding, uint32_t byte_size)
+Scalar::SetValueFromCString (const char *value_str, Encoding encoding, size_t byte_size)
{
Error error;
if (value_str == NULL || value_str[0] == '\0')
@@ -1778,24 +1778,24 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, uint32_t
if (!success)
error.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string value", value_str);
else if (!UIntValueIsValidForSize (uval64, byte_size))
- error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
+ error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %zu byte unsigned integer value", uval64, byte_size);
else
{
m_type = Scalar::GetValueTypeForUnsignedIntegerWithByteSize (byte_size);
switch (m_type)
{
- case e_uint: m_data.uint = uval64; break;
- case e_ulong: m_data.ulong = uval64; break;
- case e_ulonglong: m_data.ulonglong = uval64; break;
+ case e_uint: m_data.uint = (uint_t)uval64; break;
+ case e_ulong: m_data.ulong = (ulong_t)uval64; break;
+ case e_ulonglong: m_data.ulonglong = (ulonglong_t)uval64; break;
default:
- error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
break;
}
}
}
else
{
- error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported unsigned integer byte size: %zu", byte_size);
return error;
}
break;
@@ -1807,24 +1807,24 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, uint32_t
if (!success)
error.SetErrorStringWithFormat ("'%s' is not a valid signed integer string value", value_str);
else if (!SIntValueIsValidForSize (sval64, byte_size))
- error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte signed integer value", sval64, byte_size);
+ error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %zu byte signed integer value", sval64, byte_size);
else
{
m_type = Scalar::GetValueTypeForSignedIntegerWithByteSize (byte_size);
switch (m_type)
{
- case e_sint: m_data.sint = sval64; break;
- case e_slong: m_data.slong = sval64; break;
- case e_slonglong: m_data.slonglong = sval64; break;
+ case e_sint: m_data.sint = (sint_t)sval64; break;
+ case e_slong: m_data.slong = (slong_t)sval64; break;
+ case e_slonglong: m_data.slonglong = (slonglong_t)sval64; break;
default:
- error.SetErrorStringWithFormat ("unsupported signed integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
break;
}
}
}
else
{
- error.SetErrorStringWithFormat ("unsupported signed integer byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported signed integer byte size: %zu", byte_size);
return error;
}
break;
@@ -1853,7 +1853,7 @@ Scalar::SetValueFromCString (const char *value_str, Encoding encoding, uint32_t
}
else
{
- error.SetErrorStringWithFormat ("unsupported float byte size: %u", byte_size);
+ error.SetErrorStringWithFormat ("unsupported float byte size: %zu", byte_size);
return error;
}
break;
@@ -1935,9 +1935,9 @@ Scalar::SignExtend (uint32_t sign_bit_pos)
return false;
}
-uint32_t
+size_t
Scalar::GetAsMemoryData (void *dst,
- uint32_t dst_len,
+ size_t dst_len,
lldb::ByteOrder dst_byte_order,
Error &error) const
{
@@ -1952,7 +1952,7 @@ Scalar::GetAsMemoryData (void *dst,
const size_t src_len = data.GetByteSize();
// Prepare a memory buffer that contains some or all of the register value
- const uint32_t bytes_copied = data.CopyByteOrderedData (0, // src offset
+ const size_t bytes_copied = data.CopyByteOrderedData (0, // src offset
src_len, // src length
dst, // dst buffer
dst_len, // dst length
@@ -1978,60 +1978,60 @@ Scalar::ExtractBitfield (uint32_t bit_size,
break;
case e_float:
- if (sizeof(m_data.flt) == sizeof(int))
- m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
- else if (sizeof(m_data.flt) == sizeof(unsigned long))
- m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
- else if (sizeof(m_data.flt) == sizeof(unsigned long long))
- m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
+ if (sizeof(m_data.flt) == sizeof(sint_t))
+ m_data.sint = (sint_t)SignedBits (m_data.sint, msbit, lsbit);
+ else if (sizeof(m_data.flt) == sizeof(ulong_t))
+ m_data.slong = (slong_t)SignedBits (m_data.slong, msbit, lsbit);
+ else if (sizeof(m_data.flt) == sizeof(ulonglong_t))
+ m_data.slonglong = (slonglong_t)SignedBits (m_data.slonglong, msbit, lsbit);
else
return false;
return true;
case e_double:
- if (sizeof(m_data.dbl) == sizeof(int))
+ if (sizeof(m_data.dbl) == sizeof(sint_t))
m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
- else if (sizeof(m_data.dbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.dbl) == sizeof(ulong_t))
m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
- else if (sizeof(m_data.dbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.dbl) == sizeof(ulonglong_t))
m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
else
return false;
return true;
case e_long_double:
- if (sizeof(m_data.ldbl) == sizeof(int))
+ if (sizeof(m_data.ldbl) == sizeof(sint_t))
m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long))
+ else if (sizeof(m_data.ldbl) == sizeof(ulong_t))
m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
- else if (sizeof(m_data.ldbl) == sizeof(unsigned long long))
+ else if (sizeof(m_data.ldbl) == sizeof(ulonglong_t))
m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
else
return false;
return true;
case Scalar::e_sint:
- m_data.sint = SignedBits (m_data.sint, msbit, lsbit);
+ m_data.sint = (sint_t)SignedBits (m_data.sint, msbit, lsbit);
return true;
case Scalar::e_uint:
- m_data.uint = UnsignedBits (m_data.uint, msbit, lsbit);
+ m_data.uint = (uint_t)UnsignedBits (m_data.uint, msbit, lsbit);
return true;
case Scalar::e_slong:
- m_data.slong = SignedBits (m_data.slong, msbit, lsbit);
+ m_data.slong = (slong_t)SignedBits (m_data.slong, msbit, lsbit);
return true;
case Scalar::e_ulong:
- m_data.ulong = UnsignedBits (m_data.ulong, msbit, lsbit);
+ m_data.ulong = (ulong_t)UnsignedBits (m_data.ulong, msbit, lsbit);
return true;
case Scalar::e_slonglong:
- m_data.slonglong = SignedBits (m_data.slonglong, msbit, lsbit);
+ m_data.slonglong = (slonglong_t)SignedBits (m_data.slonglong, msbit, lsbit);
return true;
case Scalar::e_ulonglong:
- m_data.ulonglong = UnsignedBits (m_data.ulonglong, msbit, lsbit);
+ m_data.ulonglong = (ulonglong_t)UnsignedBits (m_data.ulonglong, msbit, lsbit);
return true;
}
return false;
diff --git a/lldb/source/Core/SearchFilter.cpp b/lldb/source/Core/SearchFilter.cpp
index d9af19ed183..edc565698e5 100644
--- a/lldb/source/Core/SearchFilter.cpp
+++ b/lldb/source/Core/SearchFilter.cpp
@@ -245,8 +245,8 @@ SearchFilter::DoCUIteration (const ModuleSP &module_sp, const SymbolContext &con
Searcher::CallbackReturn shouldContinue;
if (context.comp_unit == NULL)
{
- uint32_t num_comp_units = module_sp->GetNumCompileUnits();
- for (uint32_t i = 0; i < num_comp_units; i++)
+ const size_t num_comp_units = module_sp->GetNumCompileUnits();
+ for (size_t i = 0; i < num_comp_units; i++)
{
CompUnitSP cu_sp (module_sp->GetCompileUnitAtIndex (i));
if (cu_sp)
@@ -617,7 +617,7 @@ SearchFilterByModuleList::Search (Searcher &searcher)
void
SearchFilterByModuleList::GetDescription (Stream *s)
{
- uint32_t num_modules = m_module_spec_list.GetSize();
+ size_t num_modules = m_module_spec_list.GetSize();
if (num_modules == 1)
{
s->Printf (", module = ");
@@ -634,8 +634,8 @@ SearchFilterByModuleList::GetDescription (Stream *s)
}
else
{
- s->Printf (", modules(%u) = ", num_modules);
- for (uint32_t i = 0; i < num_modules; i++)
+ s->Printf (", modules(%zu) = ", num_modules);
+ for (size_t i = 0; i < num_modules; i++)
{
if (s->GetVerbose())
{
@@ -812,7 +812,7 @@ SearchFilterByModuleListAndCU::Search (Searcher &searcher)
void
SearchFilterByModuleListAndCU::GetDescription (Stream *s)
{
- uint32_t num_modules = m_module_spec_list.GetSize();
+ size_t num_modules = m_module_spec_list.GetSize();
if (num_modules == 1)
{
s->Printf (", module = ");
@@ -829,8 +829,8 @@ SearchFilterByModuleListAndCU::GetDescription (Stream *s)
}
else if (num_modules > 0)
{
- s->Printf (", modules(%d) = ", num_modules);
- for (uint32_t i = 0; i < num_modules; i++)
+ s->Printf (", modules(%zd) = ", num_modules);
+ for (size_t i = 0; i < num_modules; i++)
{
if (s->GetVerbose())
{
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 0efa39a03e2..a9481d2ccac 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -162,10 +162,10 @@ Section::GetLoadBaseAddress (Target *target) const
bool
Section::ResolveContainedAddress (addr_t offset, Address &so_addr) const
{
- const uint32_t num_children = m_children.GetSize();
+ const size_t num_children = m_children.GetSize();
if (num_children > 0)
{
- for (uint32_t i=0; i<num_children; i++)
+ for (size_t i=0; i<num_children; i++)
{
Section* child_section = m_children.GetSectionAtIndex (i).get();
@@ -395,17 +395,17 @@ SectionList::~SectionList ()
{
}
-uint32_t
+size_t
SectionList::AddSection (const lldb::SectionSP& section_sp)
{
assert (section_sp.get());
- uint32_t section_index = m_sections.size();
+ size_t section_index = m_sections.size();
m_sections.push_back(section_sp);
InvalidateRangeCache();
return section_index;
}
-uint32_t
+size_t
SectionList::FindSectionIndex (const Section* sect)
{
iterator sect_iter;
@@ -422,10 +422,10 @@ SectionList::FindSectionIndex (const Section* sect)
return UINT32_MAX;
}
-uint32_t
+size_t
SectionList::AddUniqueSection (const lldb::SectionSP& sect_sp)
{
- uint32_t sect_idx = FindSectionIndex (sect_sp.get());
+ size_t sect_idx = FindSectionIndex (sect_sp.get());
if (sect_idx == UINT32_MAX)
sect_idx = AddSection (sect_sp);
return sect_idx;
@@ -470,7 +470,7 @@ SectionList::GetNumSections (uint32_t depth) const
}
SectionSP
-SectionList::GetSectionAtIndex (uint32_t idx) const
+SectionList::GetSectionAtIndex (size_t idx) const
{
SectionSP sect_sp;
if (idx < m_sections.size())
@@ -530,11 +530,11 @@ SectionList::FindSectionByID (user_id_t sect_id) const
SectionSP
-SectionList::FindSectionByType (SectionType sect_type, bool check_children, uint32_t start_idx) const
+SectionList::FindSectionByType (SectionType sect_type, bool check_children, size_t start_idx) const
{
SectionSP sect_sp;
- uint32_t num_sections = m_sections.size();
- for (uint32_t idx = start_idx; idx < num_sections; ++idx)
+ size_t num_sections = m_sections.size();
+ for (size_t idx = start_idx; idx < num_sections; ++idx)
{
if (m_sections[idx]->GetType() == sect_type)
{
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index 87874c6b866..65b81650712 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -284,13 +284,18 @@ SourceManager::GetDefaultFileAndLine (FileSpec &file_spec, uint32_t &line)
if (executable_ptr)
{
SymbolContextList sc_list;
- uint32_t num_matches;
ConstString main_name("main");
bool symbols_okay = false; // Force it to be a debug symbol.
bool inlines_okay = true;
bool append = false;
- num_matches = executable_ptr->FindFunctions (main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay, symbols_okay, append, sc_list);
- for (uint32_t idx = 0; idx < num_matches; idx++)
+ size_t num_matches = executable_ptr->FindFunctions (main_name,
+ NULL,
+ lldb::eFunctionNameTypeBase,
+ inlines_okay,
+ symbols_okay,
+ append,
+ sc_list);
+ for (size_t idx = 0; idx < num_matches; idx++)
{
SymbolContext sc;
sc_list.GetContextAtIndex(idx, sc);
@@ -584,14 +589,14 @@ SourceManager::File::CalculateLineOffsets (uint32_t line)
else
{
// Some lines have been populated, start where we last left off
- assert(!"Not implemented yet");
+ assert("Not implemented yet" == NULL);
}
}
else
{
// Calculate all line offsets up to "line"
- assert(!"Not implemented yet");
+ assert("Not implemented yet" == NULL);
}
return false;
}
@@ -602,8 +607,8 @@ SourceManager::File::GetLine (uint32_t line_no, std::string &buffer)
if (!LineIsValid(line_no))
return false;
- uint32_t start_offset = GetLineOffset (line_no);
- uint32_t end_offset = GetLineOffset (line_no + 1);
+ size_t start_offset = GetLineOffset (line_no);
+ size_t end_offset = GetLineOffset (line_no + 1);
if (end_offset == UINT32_MAX)
{
end_offset = m_data_sp->GetByteSize();
diff --git a/lldb/source/Core/Stream.cpp b/lldb/source/Core/Stream.cpp
index bb1af7b407c..49c15d63c36 100644
--- a/lldb/source/Core/Stream.cpp
+++ b/lldb/source/Core/Stream.cpp
@@ -64,10 +64,10 @@ Stream::Offset (uint32_t uval, const char *format)
// Put an SLEB128 "uval" out to the stream using the printf format
// in "format".
//------------------------------------------------------------------
-int
+size_t
Stream::PutSLEB128 (int64_t sval)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (m_flags.Test(eBinary))
{
bool more = true;
@@ -98,10 +98,10 @@ Stream::PutSLEB128 (int64_t sval)
// Put an ULEB128 "uval" out to the stream using the printf format
// in "format".
//------------------------------------------------------------------
-int
+size_t
Stream::PutULEB128 (uint64_t uval)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (m_flags.Test(eBinary))
{
do
@@ -127,10 +127,10 @@ Stream::PutULEB128 (uint64_t uval)
//------------------------------------------------------------------
// Print a raw NULL terminated C string to the stream.
//------------------------------------------------------------------
-int
+size_t
Stream::PutCString (const char *cstr)
{
- int cstr_len = strlen(cstr);
+ size_t cstr_len = strlen(cstr);
// when in binary mode, emit the NULL terminator
if (m_flags.Test(eBinary))
++cstr_len;
@@ -152,7 +152,7 @@ Stream::QuotedCString (const char *cstr, const char *format)
// and suffix strings.
//------------------------------------------------------------------
void
-Stream::Address (uint64_t addr, int addr_size, const char *prefix, const char *suffix)
+Stream::Address (uint64_t addr, uint32_t addr_size, const char *prefix, const char *suffix)
{
if (prefix == NULL)
prefix = "";
@@ -168,7 +168,7 @@ Stream::Address (uint64_t addr, int addr_size, const char *prefix, const char *s
// and suffix strings.
//------------------------------------------------------------------
void
-Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, int addr_size, const char *prefix, const char *suffix)
+Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, uint32_t addr_size, const char *prefix, const char *suffix)
{
if (prefix && prefix[0])
PutCString (prefix);
@@ -179,7 +179,7 @@ Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr, int addr_size, const ch
}
-int
+size_t
Stream::PutChar (char ch)
{
return Write (&ch, 1);
@@ -189,7 +189,7 @@ Stream::PutChar (char ch)
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
Stream::Printf (const char *format, ...)
{
va_list args;
@@ -202,7 +202,7 @@ Stream::Printf (const char *format, ...)
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
Stream::PrintfVarArg (const char *format, va_list args)
{
char str[1024];
@@ -210,7 +210,7 @@ Stream::PrintfVarArg (const char *format, va_list args)
va_copy (args_copy, args);
- int bytes_written = 0;
+ size_t bytes_written = 0;
// Try and format our string into a fixed buffer first and see if it fits
size_t length = ::vsnprintf (str, sizeof(str), format, args);
if (length < sizeof(str))
@@ -244,7 +244,7 @@ Stream::PrintfVarArg (const char *format, va_list args)
//------------------------------------------------------------------
// Print and End of Line character to the stream
//------------------------------------------------------------------
-int
+size_t
Stream::EOL()
{
return PutChar ('\n');
@@ -254,7 +254,7 @@ Stream::EOL()
// Indent the current line using the current indentation level and
// print an optional string following the idenatation spaces.
//------------------------------------------------------------------
-int
+size_t
Stream::Indent(const char *s)
{
return Printf ("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : "");
@@ -412,7 +412,7 @@ Stream::IndentLess (int amount)
//------------------------------------------------------------------
// Get the address size in bytes
//------------------------------------------------------------------
-uint8_t
+uint32_t
Stream::GetAddressByteSize() const
{
return m_addr_size;
@@ -422,7 +422,7 @@ Stream::GetAddressByteSize() const
// Set the address size in bytes
//------------------------------------------------------------------
void
-Stream::SetAddressByteSize(uint8_t addr_size)
+Stream::SetAddressByteSize(uint32_t addr_size)
{
m_addr_size = addr_size;
}
@@ -473,7 +473,7 @@ Stream::GetByteOrder() const
return m_byte_order;
}
-int
+size_t
Stream::PrintfAsRawHex8 (const char *format, ...)
{
va_list args;
@@ -482,7 +482,7 @@ Stream::PrintfAsRawHex8 (const char *format, ...)
va_copy (args, args_copy); // Copy this so we
char str[1024];
- int bytes_written = 0;
+ size_t bytes_written = 0;
// Try and format our string into a fixed buffer first and see if it fits
size_t length = ::vsnprintf (str, sizeof(str), format, args);
if (length < sizeof(str))
@@ -511,19 +511,19 @@ Stream::PrintfAsRawHex8 (const char *format, ...)
return bytes_written;
}
-int
+size_t
Stream::PutNHex8 (size_t n, uint8_t uvalue)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
for (size_t i=0; i<n; ++i)
bytes_written += _PutHex8 (uvalue, m_flags.Test(eAddPrefix));
return bytes_written;
}
-int
+size_t
Stream::_PutHex8 (uint8_t uvalue, bool add_prefix)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (m_flags.Test(eBinary))
{
bytes_written = Write (&uvalue, 1);
@@ -542,76 +542,76 @@ Stream::_PutHex8 (uint8_t uvalue, bool add_prefix)
return bytes_written;
}
-int
+size_t
Stream::PutHex8 (uint8_t uvalue)
{
return _PutHex8 (uvalue, m_flags.Test(eAddPrefix));
}
-int
+size_t
Stream::PutHex16 (uint16_t uvalue, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
byte_order = m_byte_order;
bool add_prefix = m_flags.Test(eAddPrefix);
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (byte_order == eByteOrderLittle)
{
for (size_t byte = 0; byte < sizeof(uvalue); ++byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
else
{
for (size_t byte = sizeof(uvalue)-1; byte < sizeof(uvalue); --byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
return bytes_written;
}
-int
+size_t
Stream::PutHex32(uint32_t uvalue, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
byte_order = m_byte_order;
bool add_prefix = m_flags.Test(eAddPrefix);
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (byte_order == eByteOrderLittle)
{
for (size_t byte = 0; byte < sizeof(uvalue); ++byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
else
{
for (size_t byte = sizeof(uvalue)-1; byte < sizeof(uvalue); --byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
return bytes_written;
}
-int
+size_t
Stream::PutHex64(uint64_t uvalue, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
byte_order = m_byte_order;
bool add_prefix = m_flags.Test(eAddPrefix);
- int bytes_written = 0;
+ size_t bytes_written = 0;
if (byte_order == eByteOrderLittle)
{
for (size_t byte = 0; byte < sizeof(uvalue); ++byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
else
{
for (size_t byte = sizeof(uvalue)-1; byte < sizeof(uvalue); --byte, add_prefix = false)
- bytes_written += _PutHex8 (uvalue >> (byte * 8), add_prefix);
+ bytes_written += _PutHex8 ((uint8_t)(uvalue >> (byte * 8)), add_prefix);
}
return bytes_written;
}
-int
+size_t
Stream::PutMaxHex64
(
uint64_t uvalue,
@@ -621,21 +621,21 @@ Stream::PutMaxHex64
{
switch (byte_size)
{
- case 1: return PutHex8 (uvalue);
- case 2: return PutHex16 (uvalue);
- case 4: return PutHex32 (uvalue);
+ case 1: return PutHex8 ((uint8_t)uvalue);
+ case 2: return PutHex16 ((uint16_t)uvalue);
+ case 4: return PutHex32 ((uint32_t)uvalue);
case 8: return PutHex64 (uvalue);
}
return 0;
}
-int
+size_t
Stream::PutPointer (void *ptr)
{
return PutRawBytes (&ptr, sizeof(ptr), lldb::endian::InlHostByteOrder(), lldb::endian::InlHostByteOrder());
}
-int
+size_t
Stream::PutFloat(float f, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
@@ -644,7 +644,7 @@ Stream::PutFloat(float f, ByteOrder byte_order)
return PutRawBytes (&f, sizeof(f), lldb::endian::InlHostByteOrder(), byte_order);
}
-int
+size_t
Stream::PutDouble(double d, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
@@ -653,7 +653,7 @@ Stream::PutDouble(double d, ByteOrder byte_order)
return PutRawBytes (&d, sizeof(d), lldb::endian::InlHostByteOrder(), byte_order);
}
-int
+size_t
Stream::PutLongDouble(long double ld, ByteOrder byte_order)
{
if (byte_order == eByteOrderInvalid)
@@ -662,7 +662,7 @@ Stream::PutLongDouble(long double ld, ByteOrder byte_order)
return PutRawBytes (&ld, sizeof(ld), lldb::endian::InlHostByteOrder(), byte_order);
}
-int
+size_t
Stream::PutRawBytes (const void *s, size_t src_len, ByteOrder src_byte_order, ByteOrder dst_byte_order)
{
if (src_byte_order == eByteOrderInvalid)
@@ -671,7 +671,7 @@ Stream::PutRawBytes (const void *s, size_t src_len, ByteOrder src_byte_order, By
if (dst_byte_order == eByteOrderInvalid)
dst_byte_order = m_byte_order;
- int bytes_written = 0;
+ size_t bytes_written = 0;
const uint8_t *src = (const uint8_t *)s;
bool binary_was_set = m_flags.Test (eBinary);
if (!binary_was_set)
@@ -692,7 +692,7 @@ Stream::PutRawBytes (const void *s, size_t src_len, ByteOrder src_byte_order, By
return bytes_written;
}
-int
+size_t
Stream::PutBytesAsRawHex8 (const void *s, size_t src_len, ByteOrder src_byte_order, ByteOrder dst_byte_order)
{
if (src_byte_order == eByteOrderInvalid)
@@ -701,7 +701,7 @@ Stream::PutBytesAsRawHex8 (const void *s, size_t src_len, ByteOrder src_byte_ord
if (dst_byte_order == eByteOrderInvalid)
dst_byte_order = m_byte_order;
- int bytes_written = 0;
+ size_t bytes_written = 0;
const uint8_t *src = (const uint8_t *)s;
bool binary_is_set = m_flags.Test(eBinary);
m_flags.Clear(eBinary);
@@ -721,10 +721,10 @@ Stream::PutBytesAsRawHex8 (const void *s, size_t src_len, ByteOrder src_byte_ord
return bytes_written;
}
-int
+size_t
Stream::PutCStringAsRawHex8 (const char *s)
{
- int bytes_written = 0;
+ size_t bytes_written = 0;
bool binary_is_set = m_flags.Test(eBinary);
m_flags.Clear(eBinary);
do
diff --git a/lldb/source/Core/StreamAsynchronousIO.cpp b/lldb/source/Core/StreamAsynchronousIO.cpp
index 84659c6e16b..d6ab0d85725 100644
--- a/lldb/source/Core/StreamAsynchronousIO.cpp
+++ b/lldb/source/Core/StreamAsynchronousIO.cpp
@@ -44,7 +44,7 @@ StreamAsynchronousIO::Flush ()
}
}
-int
+size_t
StreamAsynchronousIO::Write (const void *s, size_t length)
{
m_accumulated_data.Write (s, length);
diff --git a/lldb/source/Core/StreamCallback.cpp b/lldb/source/Core/StreamCallback.cpp
index 63f3c9f8b2d..d144b16755e 100644
--- a/lldb/source/Core/StreamCallback.cpp
+++ b/lldb/source/Core/StreamCallback.cpp
@@ -55,7 +55,7 @@ StreamCallback::Flush ()
out_stream.Clear();
}
-int
+size_t
StreamCallback::Write (const void *s, size_t length)
{
lldb::tid_t cur_tid = Host::GetCurrentThreadID();
diff --git a/lldb/source/Core/StreamFile.cpp b/lldb/source/Core/StreamFile.cpp
index 0d5750801aa..9a4eb796dbe 100644
--- a/lldb/source/Core/StreamFile.cpp
+++ b/lldb/source/Core/StreamFile.cpp
@@ -64,7 +64,7 @@ StreamFile::Flush ()
m_file.Flush();
}
-int
+size_t
StreamFile::Write (const void *s, size_t length)
{
m_file.Write (s, length);
diff --git a/lldb/source/Core/StreamString.cpp b/lldb/source/Core/StreamString.cpp
index 1c6f146f1be..8d7d039fd65 100644
--- a/lldb/source/Core/StreamString.cpp
+++ b/lldb/source/Core/StreamString.cpp
@@ -34,7 +34,7 @@ StreamString::Flush ()
// Nothing to do when flushing a buffer based stream...
}
-int
+size_t
StreamString::Write (const void *s, size_t length)
{
m_packet.append ((char *)s, length);
diff --git a/lldb/source/Core/StringList.cpp b/lldb/source/Core/StringList.cpp
index 18b6224a520..fa023e0caf4 100644
--- a/lldb/source/Core/StringList.cpp
+++ b/lldb/source/Core/StringList.cpp
@@ -75,9 +75,9 @@ StringList::AppendList (const char **strv, int strc)
void
StringList::AppendList (StringList strings)
{
- uint32_t len = strings.GetSize();
+ size_t len = strings.GetSize();
- for (uint32_t i = 0; i < len; ++i)
+ for (size_t i = 0; i < len; ++i)
m_strings.push_back (strings.GetStringAtIndex(i));
}
@@ -87,7 +87,7 @@ StringList::ReadFileLines (FileSpec &input_file)
return input_file.ReadFileLines (m_strings);
}
-uint32_t
+size_t
StringList::GetSize () const
{
return m_strings.size();
@@ -104,7 +104,7 @@ StringList::GetStringAtIndex (size_t idx) const
void
StringList::Join (const char *separator, Stream &strm)
{
- uint32_t size = GetSize();
+ size_t size = GetSize();
if (size == 0)
return;
@@ -127,8 +127,8 @@ void
StringList::LongestCommonPrefix (std::string &common_prefix)
{
//arg_sstr_collection::iterator pos, end = m_args.end();
- int pos = 0;
- int end = m_strings.size();
+ size_t pos = 0;
+ size_t end = m_strings.size();
if (pos == end)
common_prefix.clear();
diff --git a/lldb/source/Core/UUID.cpp b/lldb/source/Core/UUID.cpp
index 8ff97afebcc..bfd6c189032 100644
--- a/lldb/source/Core/UUID.cpp
+++ b/lldb/source/Core/UUID.cpp
@@ -178,7 +178,7 @@ UUID::SetFromCString (const char *cstr)
while (isspace(*p))
++p;
- const uint32_t uuid_byte_idx = UUID::DecodeUUIDBytesFromCString (p, m_uuid, &p);
+ const size_t uuid_byte_idx = UUID::DecodeUUIDBytesFromCString (p, m_uuid, &p);
// If we successfully decoded a UUID, return the amount of characters that
// were consumed
diff --git a/lldb/source/Core/VMRange.cpp b/lldb/source/Core/VMRange.cpp
index 0631069bb38..902489e1ff3 100644
--- a/lldb/source/Core/VMRange.cpp
+++ b/lldb/source/Core/VMRange.cpp
@@ -40,7 +40,7 @@ VMRange::ContainsRange(const VMRange::collection& coll, const VMRange& range)
return false;
}
-uint32_t
+size_t
VMRange::FindRangeIndexThatContainsValue (const VMRange::collection& coll, lldb::addr_t value)
{
ValueInRangeUnaryPredicate in_range_predicate(value);
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 193ae4f84cc..5b6e8fd9882 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -144,7 +144,7 @@ Value::GetType()
}
void
-Value::ResizeData(int len)
+Value::ResizeData(size_t len)
{
m_value_type = eValueTypeHostAddress;
m_data_buffer.SetByteSize(len);
@@ -560,7 +560,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
}
// If we got here, we need to read the value from memory
- uint32_t byte_size = GetValueByteSize (ast_context, &error);
+ size_t byte_size = GetValueByteSize (ast_context, &error);
// Bail if we encountered any errors getting the byte size
if (error.Fail())
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 92d2c36415e..5ea8e7d6b8d 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -510,7 +510,7 @@ ValueObject::SetValueDidChange (bool value_changed)
}
ValueObjectSP
-ValueObject::GetChildAtIndex (uint32_t idx, bool can_create)
+ValueObject::GetChildAtIndex (size_t idx, bool can_create)
{
ValueObjectSP child_sp;
// We may need to update our value if we are dynamic
@@ -534,13 +534,13 @@ ValueObject::GetChildAtIndex (uint32_t idx, bool can_create)
}
ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::initializer_list<uint32_t>& idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::initializer_list<size_t>& idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (uint32_t idx : idxs)
+ for (size_t idx : idxs)
{
root = root->GetChildAtIndex(idx, true);
if (!root)
@@ -554,13 +554,13 @@ ValueObject::GetChildAtIndexPath (const std::initializer_list<uint32_t>& idxs,
}
ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::initializer_list< std::pair<uint32_t, bool> >& idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::initializer_list< std::pair<size_t, bool> >& idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (std::pair<uint32_t, bool> idx : idxs)
+ for (std::pair<size_t, bool> idx : idxs)
{
root = root->GetChildAtIndex(idx.first, idx.second);
if (!root)
@@ -574,13 +574,13 @@ ValueObject::GetChildAtIndexPath (const std::initializer_list< std::pair<uint32_
}
lldb::ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::vector<uint32_t> &idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::vector<size_t> &idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (uint32_t idx : idxs)
+ for (size_t idx : idxs)
{
root = root->GetChildAtIndex(idx, true);
if (!root)
@@ -594,13 +594,13 @@ ValueObject::GetChildAtIndexPath (const std::vector<uint32_t> &idxs,
}
lldb::ValueObjectSP
-ValueObject::GetChildAtIndexPath (const std::vector< std::pair<uint32_t, bool> > &idxs,
- uint32_t* index_of_error)
+ValueObject::GetChildAtIndexPath (const std::vector< std::pair<size_t, bool> > &idxs,
+ size_t* index_of_error)
{
if (idxs.size() == 0)
return GetSP();
ValueObjectSP root(GetSP());
- for (std::pair<uint32_t, bool> idx : idxs)
+ for (std::pair<size_t, bool> idx : idxs)
{
root = root->GetChildAtIndex(idx.first, idx.second);
if (!root)
@@ -613,7 +613,7 @@ ValueObject::GetChildAtIndexPath (const std::vector< std::pair<uint32_t, bool> >
return root;
}
-uint32_t
+size_t
ValueObject::GetIndexOfChildWithName (const ConstString &name)
{
bool omit_empty_base_classes = true;
@@ -668,7 +668,7 @@ ValueObject::GetChildMemberWithName (const ConstString &name, bool can_create)
}
-uint32_t
+size_t
ValueObject::GetNumChildren ()
{
UpdateValueIfNeeded();
@@ -703,7 +703,7 @@ ValueObject::MightHaveChildren()
// Should only be called by ValueObject::GetNumChildren()
void
-ValueObject::SetNumChildren (uint32_t num_children)
+ValueObject::SetNumChildren (size_t num_children)
{
m_children_count_valid = true;
m_children.SetChildrenCount(num_children);
@@ -716,7 +716,7 @@ ValueObject::SetName (const ConstString &name)
}
ValueObject *
-ValueObject::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObject::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
ValueObject *valobj = NULL;
@@ -1474,10 +1474,10 @@ ValueObject::DumpPrintableRepresentation(Stream& s,
if ((custom_format == eFormatBytes) ||
(custom_format == eFormatBytesWithASCII))
{
- uint32_t count = GetNumChildren();
+ const size_t count = GetNumChildren();
s << '[';
- for (uint32_t low = 0; low < count; low++)
+ for (size_t low = 0; low < count; low++)
{
if (low)
@@ -1510,12 +1510,12 @@ ValueObject::DumpPrintableRepresentation(Stream& s,
(custom_format == eFormatVectorOfUInt64) ||
(custom_format == eFormatVectorOfUInt8)) // arrays of bytes, bytes with ASCII or any vector format should be printed directly
{
- uint32_t count = GetNumChildren();
+ const size_t count = GetNumChildren();
Format format = FormatManager::GetSingleItemFormat(custom_format);
s << '[';
- for (uint32_t low = 0; low < count; low++)
+ for (size_t low = 0; low < count; low++)
{
if (low)
@@ -1564,8 +1564,8 @@ ValueObject::DumpPrintableRepresentation(Stream& s,
bool var_success = false;
{
- const char * return_value;
- std::string alloc_mem;
+ const char *cstr = NULL;
+ StreamString strm;
if (custom_format != eFormatInvalid)
SetFormat(custom_format);
@@ -1573,59 +1573,49 @@ ValueObject::DumpPrintableRepresentation(Stream& s,
switch(val_obj_display)
{
case eValueObjectRepresentationStyleValue:
- return_value = GetValueAsCString();
+ cstr = GetValueAsCString();
break;
case eValueObjectRepresentationStyleSummary:
- return_value = GetSummaryAsCString();
+ cstr = GetSummaryAsCString();
break;
case eValueObjectRepresentationStyleLanguageSpecific:
- return_value = GetObjectDescription();
+ cstr = GetObjectDescription();
break;
case eValueObjectRepresentationStyleLocation:
- return_value = GetLocationAsCString();
+ cstr = GetLocationAsCString();
break;
case eValueObjectRepresentationStyleChildrenCount:
- {
- alloc_mem.resize(512);
- return_value = &alloc_mem[0];
- int count = GetNumChildren();
- snprintf((char*)return_value, 512, "%d", count);
- }
+ strm.Printf("%zu", GetNumChildren());
+ cstr = strm.GetString().c_str();
break;
case eValueObjectRepresentationStyleType:
- return_value = GetTypeName().AsCString();
+ cstr = GetTypeName().AsCString();
break;
}
- if (!return_value)
+ if (!cstr)
{
if (val_obj_display == eValueObjectRepresentationStyleValue)
- return_value = GetSummaryAsCString();
+ cstr = GetSummaryAsCString();
else if (val_obj_display == eValueObjectRepresentationStyleSummary)
{
if (ClangASTContext::IsAggregateType (GetClangType()) == true)
{
- // this thing has no value, and it seems to have no summary
- // some combination of unitialized data and other factors can also
- // raise this condition, so let's print a nice generic description
- {
- alloc_mem.resize(684);
- return_value = &alloc_mem[0];
- snprintf((char*)return_value, 684, "%s @ %s", GetTypeName().AsCString(), GetLocationAsCString());
- }
+ strm.Printf("%s @ %s", GetTypeName().AsCString(), GetLocationAsCString());
+ cstr = strm.GetString().c_str();
}
else
- return_value = GetValueAsCString();
+ cstr = GetValueAsCString();
}
}
- if (return_value)
- s.PutCString(return_value);
+ if (cstr)
+ s.PutCString(cstr);
else
{
if (m_error.Fail())
@@ -1706,7 +1696,7 @@ ValueObject::GetPointerValue (AddressType *address_type)
case Value::eValueTypeLoadAddress:
case Value::eValueTypeFileAddress:
{
- uint32_t data_offset = 0;
+ lldb::offset_t data_offset = 0;
address = m_data.GetPointer(&data_offset);
}
break;
@@ -1913,7 +1903,7 @@ ValueObject::IsObjCNil ()
}
ValueObjectSP
-ValueObject::GetSyntheticArrayMember (int32_t index, bool can_create)
+ValueObject::GetSyntheticArrayMember (size_t index, bool can_create)
{
if (IsArrayType())
return GetSyntheticArrayMemberFromArray(index, can_create);
@@ -1926,13 +1916,13 @@ ValueObject::GetSyntheticArrayMember (int32_t index, bool can_create)
}
ValueObjectSP
-ValueObject::GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create)
+ValueObject::GetSyntheticArrayMemberFromPointer (size_t index, bool can_create)
{
ValueObjectSP synthetic_child_sp;
if (IsPointerType ())
{
char index_str[64];
- snprintf(index_str, sizeof(index_str), "[%i]", index);
+ snprintf(index_str, sizeof(index_str), "[%zu]", index);
ConstString index_const_str(index_str);
// Check if we have already created a synthetic array member in this
// valid object. If we have we will re-use it.
@@ -1969,13 +1959,13 @@ ValueObject::GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create)
// there are more items in "item_array".
ValueObjectSP
-ValueObject::GetSyntheticArrayMemberFromArray (int32_t index, bool can_create)
+ValueObject::GetSyntheticArrayMemberFromArray (size_t index, bool can_create)
{
ValueObjectSP synthetic_child_sp;
if (IsArrayType ())
{
char index_str[64];
- snprintf(index_str, sizeof(index_str), "[%i]", index);
+ snprintf(index_str, sizeof(index_str), "[%zu]", index);
ConstString index_const_str(index_str);
// Check if we have already created a synthetic array member in this
// valid object. If we have we will re-use it.
@@ -3057,8 +3047,8 @@ ValueObject::ExpandArraySliceExpression(const char* expression_cstr,
}
else // expand this into list
{
- int max_index = root->GetNumChildren() - 1;
- for (int index = 0; index < max_index; index++)
+ const size_t max_index = root->GetNumChildren() - 1;
+ for (size_t index = 0; index < max_index; index++)
{
ValueObjectSP child =
root->GetChildAtIndex(index, true);
@@ -3094,8 +3084,8 @@ ValueObject::ExpandArraySliceExpression(const char* expression_cstr,
{
if (root_clang_type_info.Test(ClangASTContext::eTypeIsArray))
{
- int max_index = root->GetNumChildren() - 1;
- for (int index = 0; index < max_index; index++)
+ const size_t max_index = root->GetNumChildren() - 1;
+ for (size_t index = 0; index < max_index; index++)
{
ValueObjectSP child =
root->GetChildAtIndex(index, true);
@@ -3467,7 +3457,7 @@ DumpValueObject_Impl (Stream &s,
ValueObjectSP synth_valobj_sp = valobj->GetSyntheticValue (options.m_use_synthetic);
synth_valobj = (synth_valobj_sp ? synth_valobj_sp.get() : valobj);
- uint32_t num_children = synth_valobj->GetNumChildren();
+ size_t num_children = synth_valobj->GetNumChildren();
bool print_dotdotdot = false;
if (num_children)
{
@@ -3483,7 +3473,7 @@ DumpValueObject_Impl (Stream &s,
s.IndentMore();
}
- uint32_t max_num_children = valobj->GetTargetSP()->GetMaximumNumberOfChildrenToDisplay();
+ const size_t max_num_children = valobj->GetTargetSP()->GetMaximumNumberOfChildrenToDisplay();
if (num_children > max_num_children && !options.m_ignore_cap)
{
@@ -3495,7 +3485,7 @@ DumpValueObject_Impl (Stream &s,
child_options.SetFormat(options.m_format).SetSummary().SetRootValueObjectName();
child_options.SetScopeChecked(true)
.SetOmitSummaryDepth(child_options.m_omit_summary_depth > 1 ? child_options.m_omit_summary_depth - 1 : 0);
- for (uint32_t idx=0; idx<num_children; ++idx)
+ for (size_t idx=0; idx<num_children; ++idx)
{
ValueObjectSP child_sp(synth_valobj->GetChildAtIndex(idx, true));
if (child_sp.get())
diff --git a/lldb/source/Core/ValueObjectCast.cpp b/lldb/source/Core/ValueObjectCast.cpp
index 7834c850874..6abf83607d1 100644
--- a/lldb/source/Core/ValueObjectCast.cpp
+++ b/lldb/source/Core/ValueObjectCast.cpp
@@ -67,7 +67,7 @@ ValueObjectCast::GetClangTypeImpl ()
return m_cast_type.GetOpaqueQualType();
}
-uint32_t
+size_t
ValueObjectCast::CalculateNumChildren()
{
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp
index 81f8ccef6dc..ee2bbb5ddc3 100644
--- a/lldb/source/Core/ValueObjectChild.cpp
+++ b/lldb/source/Core/ValueObjectChild.cpp
@@ -62,7 +62,7 @@ ValueObjectChild::GetValueType() const
return m_parent->GetValueType();
}
-uint32_t
+size_t
ValueObjectChild::CalculateNumChildren()
{
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp
index cc6bafc0e88..4a9dfbe5d4b 100644
--- a/lldb/source/Core/ValueObjectConstResult.cpp
+++ b/lldb/source/Core/ValueObjectConstResult.cpp
@@ -124,7 +124,7 @@ ValueObjectConstResult::Create
const ConstString &name,
const lldb::DataBufferSP &data_sp,
lldb::ByteOrder data_byte_order,
- uint8_t data_addr_size,
+ uint32_t data_addr_size,
lldb::addr_t address
)
{
@@ -155,7 +155,7 @@ ValueObjectConstResult::ValueObjectConstResult
const ConstString &name,
const lldb::DataBufferSP &data_sp,
lldb::ByteOrder data_byte_order,
- uint8_t data_addr_size,
+ uint32_t data_addr_size,
lldb::addr_t address
) :
ValueObject (exe_scope),
@@ -185,7 +185,7 @@ ValueObjectConstResult::Create
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size
+ uint32_t addr_byte_size
)
{
return (new ValueObjectConstResult (exe_scope,
@@ -205,7 +205,7 @@ ValueObjectConstResult::ValueObjectConstResult
const ConstString &name,
lldb::addr_t address,
AddressType address_type,
- uint8_t addr_byte_size
+ uint32_t addr_byte_size
) :
ValueObject (exe_scope),
m_clang_ast (clang_ast),
@@ -300,7 +300,7 @@ ValueObjectConstResult::SetByteSize (size_t size)
m_byte_size = size;
}
-uint32_t
+size_t
ValueObjectConstResult::CalculateNumChildren()
{
return ClangASTContext::GetNumChildren (GetClangAST (), GetClangType(), true);
@@ -363,7 +363,7 @@ ValueObjectConstResult::GetAddressOf (bool scalar_is_load_address,
}
ValueObject *
-ValueObjectConstResult::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectConstResult::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
return m_impl.CreateChildAtIndex(idx, synthetic_array_member, synthetic_index);
}
diff --git a/lldb/source/Core/ValueObjectConstResultChild.cpp b/lldb/source/Core/ValueObjectConstResultChild.cpp
index 2a305a1bea5..4f40381eb54 100644
--- a/lldb/source/Core/ValueObjectConstResultChild.cpp
+++ b/lldb/source/Core/ValueObjectConstResultChild.cpp
@@ -68,7 +68,7 @@ ValueObjectConstResultChild::AddressOf (Error &error)
}
ValueObject *
-ValueObjectConstResultChild::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectConstResultChild::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
return m_impl.CreateChildAtIndex(idx, synthetic_array_member, synthetic_index);
}
diff --git a/lldb/source/Core/ValueObjectConstResultImpl.cpp b/lldb/source/Core/ValueObjectConstResultImpl.cpp
index 731f3938e28..3d86b9109f8 100644
--- a/lldb/source/Core/ValueObjectConstResultImpl.cpp
+++ b/lldb/source/Core/ValueObjectConstResultImpl.cpp
@@ -84,7 +84,7 @@ ValueObjectConstResultImpl::Dereference (Error &error)
}
ValueObject *
-ValueObjectConstResultImpl::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectConstResultImpl::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
if (m_impl_backend == NULL)
return NULL;
diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp
index 8cd1d1f547b..1af293660fc 100644
--- a/lldb/source/Core/ValueObjectDynamicValue.cpp
+++ b/lldb/source/Core/ValueObjectDynamicValue.cpp
@@ -87,7 +87,7 @@ ValueObjectDynamicValue::GetQualifiedTypeName()
return m_parent->GetTypeName();
}
-uint32_t
+size_t
ValueObjectDynamicValue::CalculateNumChildren()
{
const bool success = UpdateValueIfNeeded(false);
diff --git a/lldb/source/Core/ValueObjectList.cpp b/lldb/source/Core/ValueObjectList.cpp
index 9f7185aa668..180d4a0eaf1 100644
--- a/lldb/source/Core/ValueObjectList.cpp
+++ b/lldb/source/Core/ValueObjectList.cpp
@@ -61,20 +61,20 @@ ValueObjectList::Append (const ValueObjectList &valobj_list)
}
-uint32_t
+size_t
ValueObjectList::GetSize() const
{
return m_value_objects.size();
}
void
-ValueObjectList::Resize (uint32_t size)
+ValueObjectList::Resize (size_t size)
{
m_value_objects.resize (size);
}
lldb::ValueObjectSP
-ValueObjectList::GetValueObjectAtIndex (uint32_t idx)
+ValueObjectList::GetValueObjectAtIndex (size_t idx)
{
lldb::ValueObjectSP valobj_sp;
if (idx < m_value_objects.size())
@@ -83,7 +83,7 @@ ValueObjectList::GetValueObjectAtIndex (uint32_t idx)
}
lldb::ValueObjectSP
-ValueObjectList::RemoveValueObjectAtIndex (uint32_t idx)
+ValueObjectList::RemoveValueObjectAtIndex (size_t idx)
{
lldb::ValueObjectSP valobj_sp;
if (idx < m_value_objects.size())
@@ -95,7 +95,7 @@ ValueObjectList::RemoveValueObjectAtIndex (uint32_t idx)
}
void
-ValueObjectList::SetValueObjectAtIndex (uint32_t idx, const ValueObjectSP &valobj_sp)
+ValueObjectList::SetValueObjectAtIndex (size_t idx, const ValueObjectSP &valobj_sp)
{
if (idx >= m_value_objects.size())
m_value_objects.resize (idx + 1);
diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp
index 7b3dbf2f307..325dc88f9e9 100644
--- a/lldb/source/Core/ValueObjectMemory.cpp
+++ b/lldb/source/Core/ValueObjectMemory.cpp
@@ -146,7 +146,7 @@ ValueObjectMemory::GetTypeName()
return ClangASTType::GetConstTypeName (GetClangAST(), m_clang_type.GetOpaqueQualType());
}
-uint32_t
+size_t
ValueObjectMemory::CalculateNumChildren()
{
if (m_type_sp)
diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp
index 843f10d2f61..95a6315f435 100644
--- a/lldb/source/Core/ValueObjectRegister.cpp
+++ b/lldb/source/Core/ValueObjectRegister.cpp
@@ -60,7 +60,7 @@ ValueObjectRegisterContext::GetQualifiedTypeName()
return ConstString();
}
-uint32_t
+size_t
ValueObjectRegisterContext::CalculateNumChildren()
{
return m_reg_ctx_sp->GetRegisterSetCount();
@@ -101,11 +101,11 @@ ValueObjectRegisterContext::UpdateValue ()
}
ValueObject *
-ValueObjectRegisterContext::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectRegisterContext::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
ValueObject *new_valobj = NULL;
- const uint32_t num_children = GetNumChildren();
+ const size_t num_children = GetNumChildren();
if (idx < num_children)
{
ExecutionContext exe_ctx(GetExecutionContextRef());
@@ -162,7 +162,7 @@ ValueObjectRegisterSet::GetQualifiedTypeName()
return ConstString();
}
-uint32_t
+size_t
ValueObjectRegisterSet::CalculateNumChildren()
{
const RegisterSet *reg_set = m_reg_ctx_sp->GetRegisterSet(m_reg_set_idx);
@@ -222,12 +222,12 @@ ValueObjectRegisterSet::UpdateValue ()
ValueObject *
-ValueObjectRegisterSet::CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index)
+ValueObjectRegisterSet::CreateChildAtIndex (size_t idx, bool synthetic_array_member, int32_t synthetic_index)
{
ValueObject *valobj = NULL;
if (m_reg_ctx_sp && m_reg_set)
{
- const uint32_t num_children = GetNumChildren();
+ const size_t num_children = GetNumChildren();
if (idx < num_children)
valobj = new ValueObjectRegister(*this, m_reg_ctx_sp, m_reg_set->registers[idx]);
}
@@ -250,7 +250,7 @@ ValueObjectRegisterSet::GetChildMemberWithName (const ConstString &name, bool ca
return ValueObjectSP();
}
-uint32_t
+size_t
ValueObjectRegisterSet::GetIndexOfChildWithName (const ConstString &name)
{
if (m_reg_ctx_sp && m_reg_set)
@@ -341,7 +341,7 @@ ValueObjectRegister::GetTypeName()
return m_type_name;
}
-uint32_t
+size_t
ValueObjectRegister::CalculateNumChildren()
{
return 0;
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index f9c23a016a6..8ca0ea99111 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
@@ -27,14 +27,14 @@ public:
SyntheticChildrenFrontEnd(backend)
{}
- uint32_t
+ size_t
CalculateNumChildren()
{
return 0;
}
lldb::ValueObjectSP
- GetChildAtIndex (uint32_t idx)
+ GetChildAtIndex (size_t idx)
{
return lldb::ValueObjectSP();
}
@@ -95,7 +95,7 @@ ValueObjectSynthetic::GetTypeName()
return m_parent->GetTypeName();
}
-uint32_t
+size_t
ValueObjectSynthetic::CalculateNumChildren()
{
UpdateValueIfNeeded();
@@ -183,7 +183,7 @@ ValueObjectSynthetic::UpdateValue ()
}
lldb::ValueObjectSP
-ValueObjectSynthetic::GetChildAtIndex (uint32_t idx, bool can_create)
+ValueObjectSynthetic::GetChildAtIndex (size_t idx, bool can_create)
{
UpdateValueIfNeeded();
@@ -219,7 +219,7 @@ ValueObjectSynthetic::GetChildMemberWithName (const ConstString &name, bool can_
return GetChildAtIndex(index, can_create);
}
-uint32_t
+size_t
ValueObjectSynthetic::GetIndexOfChildWithName (const ConstString &name)
{
UpdateValueIfNeeded();
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index 3ff37e9deac..5647fbb890e 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -80,7 +80,7 @@ ValueObjectVariable::GetQualifiedTypeName()
return ConstString();
}
-uint32_t
+size_t
ValueObjectVariable::CalculateNumChildren()
{
ClangASTType type(GetClangAST(),
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 36f0e84b6b5..ed3e6299294 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -615,9 +615,7 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context,
const ModuleList &target_images = m_target->GetImages();
Mutex::Locker modules_locker (target_images.GetMutex());
- for (uint32_t i = 0, e = target_images.GetSize();
- i != e;
- ++i)
+ for (size_t i = 0, e = target_images.GetSize(); i < e; ++i)
{
lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
@@ -1602,9 +1600,7 @@ ClangASTSource::CompleteNamespaceMap (ClangASTImporter::NamespaceMapSP &namespac
ClangNamespaceDecl null_namespace_decl;
- for (uint32_t i = 0, e = target_images.GetSize();
- i != e;
- ++i)
+ for (size_t i = 0, e = target_images.GetSize(); i < e; ++i)
{
lldb::ModuleSP image = target_images.GetModuleAtIndexUnlocked(i);
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index 9c67d09c0fc..22e7b45b5a1 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -809,7 +809,7 @@ ClangExpressionParser::DisassembleFunction (Stream &stream, ExecutionContext &ex
InstructionList &instruction_list = disassembler->GetInstructionList();
const uint32_t max_opcode_byte_size = instruction_list.GetMaxOpcocdeByteSize();
- for (uint32_t instruction_index = 0, num_instructions = instruction_list.GetSize();
+ for (size_t instruction_index = 0, num_instructions = instruction_list.GetSize();
instruction_index < num_instructions;
++instruction_index)
{
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index 2d69941a010..d749b1410f7 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -136,7 +136,7 @@ ClangFunction::CompileFunction (Stream &errors)
// to pull the defined arguments out of the function, then add the types from the
// arguments list for the variable arguments.
- uint32_t num_args = UINT32_MAX;
+ size_t num_args = UINT32_MAX;
bool trust_function = false;
// GetArgumentCount returns -1 for an unprototyped function.
if (m_function_ptr)
@@ -338,7 +338,7 @@ ClangFunction::WriteFunctionArguments (ExecutionContext &exe_ctx,
// TODO: verify fun_addr needs to be a callable address
Scalar fun_addr (function_address.GetCallableLoadAddress(exe_ctx.GetTargetPtr()));
- int first_offset = m_member_offsets[0];
+ uint64_t first_offset = m_member_offsets[0];
process->WriteScalarToMemory(args_addr_ref + first_offset, fun_addr, process->GetAddressByteSize(), error);
// FIXME: We will need to extend this for Variadic functions.
@@ -356,7 +356,7 @@ ClangFunction::WriteFunctionArguments (ExecutionContext &exe_ctx,
{
// FIXME: We should sanity check sizes.
- int offset = m_member_offsets[i+1]; // Clang sizes are in bytes.
+ uint64_t offset = m_member_offsets[i+1]; // Clang sizes are in bytes.
Value *arg_value = arg_values.GetValueAtIndex(i);
// FIXME: For now just do scalars:
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 538afb71d56..0be564a1785 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -233,7 +233,7 @@ DWARFExpression::DWARFExpression(const DWARFExpression& rhs) :
}
-DWARFExpression::DWARFExpression(const DataExtractor& data, uint32_t data_offset, uint32_t data_length) :
+DWARFExpression::DWARFExpression(const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length) :
m_data(data, data_offset, data_length),
m_reg_kind (eRegisterKindDWARF),
m_loclist_slide(LLDB_INVALID_ADDRESS)
@@ -261,7 +261,7 @@ DWARFExpression::SetOpcodeData (const DataExtractor& data)
}
void
-DWARFExpression::CopyOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+DWARFExpression::CopyOpcodeData (const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length)
{
const uint8_t *bytes = data.PeekData(data_offset, data_length);
if (bytes)
@@ -273,21 +273,21 @@ DWARFExpression::CopyOpcodeData (const DataExtractor& data, uint32_t data_offset
}
void
-DWARFExpression::SetOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+DWARFExpression::SetOpcodeData (const DataExtractor& data, lldb::offset_t data_offset, lldb::offset_t data_length)
{
m_data.SetData(data, data_offset, data_length);
}
void
-DWARFExpression::DumpLocation (Stream *s, uint32_t offset, uint32_t length, lldb::DescriptionLevel level, ABI *abi) const
+DWARFExpression::DumpLocation (Stream *s, lldb::offset_t offset, lldb::offset_t length, lldb::DescriptionLevel level, ABI *abi) const
{
if (!m_data.ValidOffsetForDataOfSize(offset, length))
return;
- const uint32_t start_offset = offset;
- const uint32_t end_offset = offset + length;
+ const lldb::offset_t start_offset = offset;
+ const lldb::offset_t end_offset = offset + length;
while (m_data.ValidOffset(offset) && offset < end_offset)
{
- const uint32_t op_offset = offset;
+ const lldb::offset_t op_offset = offset;
const uint8_t op = m_data.GetU8(&offset);
switch (level)
@@ -308,7 +308,7 @@ DWARFExpression::DumpLocation (Stream *s, uint32_t offset, uint32_t length, lldb
if (level == lldb::eDescriptionLevelFull)
break;
// Fall through for verbose and print offset and DW_OP prefix..
- s->Printf("0x%8.8x: %s", op_offset, op >= DW_OP_APPLE_uninit ? "DW_OP_APPLE_" : "DW_OP_");
+ s->Printf("0x%8.8" PRIx64 ": %s", op_offset, op >= DW_OP_APPLE_uninit ? "DW_OP_APPLE_" : "DW_OP_");
break;
}
@@ -506,7 +506,7 @@ DWARFExpression::DumpLocation (Stream *s, uint32_t offset, uint32_t length, lldb
case DW_OP_regx: // 0x90 1 ULEB128 register
{
- uint64_t reg_num = m_data.GetULEB128(&offset);
+ uint32_t reg_num = m_data.GetULEB128(&offset);
if (abi)
{
RegisterInfo reg_info;
@@ -524,7 +524,7 @@ DWARFExpression::DumpLocation (Stream *s, uint32_t offset, uint32_t length, lldb
}
}
}
- s->Printf("DW_OP_regx(%" PRIu64 ")", reg_num); break;
+ s->Printf("DW_OP_regx(%" PRIu32 ")", reg_num); break;
}
break;
case DW_OP_fbreg: // 0x91 1 SLEB128 offset
@@ -551,7 +551,7 @@ DWARFExpression::DumpLocation (Stream *s, uint32_t offset, uint32_t length, lldb
}
}
}
- s->Printf("DW_OP_bregx(reg=%u,offset=%" PRIi64 ")", reg_num, reg_offset);
+ s->Printf("DW_OP_bregx(reg=%" PRIu32 ",offset=%" PRIi64 ")", reg_num, reg_offset);
}
break;
case DW_OP_piece: // 0x93 1 ULEB128 size of piece addressed
@@ -664,7 +664,7 @@ DWARFExpression::GetDescription (Stream *s, lldb::DescriptionLevel level, addr_t
if (IsLocationList())
{
// We have a location list
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t count = 0;
addr_t curr_base_addr = location_list_base_addr;
while (m_data.ValidOffset(offset))
@@ -678,7 +678,7 @@ DWARFExpression::GetDescription (Stream *s, lldb::DescriptionLevel level, addr_t
VMRange addr_range(curr_base_addr + begin_addr_offset, curr_base_addr + end_addr_offset);
addr_range.Dump(s, 0, 8);
s->PutChar('{');
- uint32_t location_length = m_data.GetU16(&offset);
+ lldb::offset_t location_length = m_data.GetU16(&offset);
DumpLocation (s, offset, location_length, level, abi);
s->PutChar('}');
offset += location_length;
@@ -782,7 +782,7 @@ ReadRegisterValueAsScalar
//
// if (IsLocationList())
// {
-// uint32_t offset = 0;
+// lldb::offset_t offset = 0;
//
// addr_t loc_list_base_addr = m_loclist_slide.GetLoadAddress(process);
//
@@ -811,10 +811,10 @@ ReadRegisterValueAsScalar
// return false;
//}
-static uint32_t
-GetOpcodeDataSize (const DataExtractor &data, const uint32_t data_offset, const uint8_t op)
+static offset_t
+GetOpcodeDataSize (const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op)
{
- uint32_t offset = data_offset;
+ lldb::offset_t offset = data_offset;
switch (op)
{
case DW_OP_addr:
@@ -1006,7 +1006,7 @@ GetOpcodeDataSize (const DataExtractor &data, const uint32_t data_offset, const
default:
break;
}
- return UINT32_MAX;
+ return LLDB_INVALID_OFFSET;
}
bool
@@ -1015,7 +1015,7 @@ DWARFExpression::LocationContains_DW_OP_addr (lldb::addr_t file_addr, bool &erro
error = false;
if (IsLocationList())
return false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (m_data.ValidOffset(offset))
{
const uint8_t op = m_data.GetU8(&offset);
@@ -1030,8 +1030,8 @@ DWARFExpression::LocationContains_DW_OP_addr (lldb::addr_t file_addr, bool &erro
}
else
{
- const uint32_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
- if (op_arg_size == UINT32_MAX)
+ const offset_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
+ if (op_arg_size == LLDB_INVALID_OFFSET)
{
error = true;
break;
@@ -1047,14 +1047,14 @@ DWARFExpression::Update_DW_OP_addr (lldb::addr_t file_addr)
{
if (IsLocationList())
return false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (m_data.ValidOffset(offset))
{
const uint8_t op = m_data.GetU8(&offset);
if (op == DW_OP_addr)
{
- const uint8_t addr_byte_size = m_data.GetAddressByteSize();
+ const uint32_t addr_byte_size = m_data.GetAddressByteSize();
// We have to make a copy of the data as we don't know if this
// data is from a read only memory mapped buffer, so we duplicate
// all of the data first, then modify it, and if all goes well,
@@ -1083,8 +1083,8 @@ DWARFExpression::Update_DW_OP_addr (lldb::addr_t file_addr)
}
else
{
- const uint32_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
- if (op_arg_size == UINT32_MAX)
+ const offset_t op_arg_size = GetOpcodeDataSize (m_data, offset, op);
+ if (op_arg_size == LLDB_INVALID_OFFSET)
break;
offset += op_arg_size;
}
@@ -1100,7 +1100,7 @@ DWARFExpression::LocationListContainsAddress (lldb::addr_t loclist_base_addr, ll
if (IsLocationList())
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (loclist_base_addr == LLDB_INVALID_ADDRESS)
return false;
@@ -1128,7 +1128,7 @@ DWARFExpression::LocationListContainsAddress (lldb::addr_t loclist_base_addr, ll
}
bool
-DWARFExpression::GetLocation (addr_t base_addr, addr_t pc, uint32_t &offset, uint32_t &length)
+DWARFExpression::GetLocation (addr_t base_addr, addr_t pc, lldb::offset_t &offset, lldb::offset_t &length)
{
offset = 0;
if (!IsLocationList())
@@ -1164,7 +1164,7 @@ DWARFExpression::GetLocation (addr_t base_addr, addr_t pc, uint32_t &offset, uin
}
}
}
- offset = UINT32_MAX;
+ offset = LLDB_INVALID_OFFSET;
length = 0;
return false;
}
@@ -1176,8 +1176,8 @@ DWARFExpression::DumpLocationForAddress (Stream *s,
addr_t address,
ABI *abi)
{
- uint32_t offset = 0;
- uint32_t length = 0;
+ lldb::offset_t offset = 0;
+ lldb::offset_t length = 0;
if (GetLocation (base_addr, address, offset, length))
{
@@ -1223,7 +1223,7 @@ DWARFExpression::Evaluate
{
if (IsLocationList())
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
addr_t pc;
StackFrame *frame = NULL;
if (reg_ctx)
@@ -1294,8 +1294,8 @@ DWARFExpression::Evaluate
ClangExpressionDeclMap *decl_map,
RegisterContext *reg_ctx,
const DataExtractor& opcodes,
- const uint32_t opcodes_offset,
- const uint32_t opcodes_length,
+ const lldb::offset_t opcodes_offset,
+ const lldb::offset_t opcodes_length,
const uint32_t reg_kind,
const Value* initial_value_ptr,
Value& result,
@@ -1318,8 +1318,8 @@ DWARFExpression::Evaluate
if (initial_value_ptr)
stack.push_back(*initial_value_ptr);
- uint32_t offset = opcodes_offset;
- const uint32_t end_offset = opcodes_offset + opcodes_length;
+ lldb::offset_t offset = opcodes_offset;
+ const lldb::offset_t end_offset = opcodes_offset + opcodes_length;
Value tmp;
uint32_t reg_num;
@@ -1335,7 +1335,7 @@ DWARFExpression::Evaluate
while (opcodes.ValidOffset(offset) && offset < end_offset)
{
- const uint32_t op_offset = offset;
+ const lldb::offset_t op_offset = offset;
const uint8_t op = opcodes.GetU8(&offset);
if (log && log->GetVerbose())
@@ -1349,7 +1349,7 @@ DWARFExpression::Evaluate
stack[i].Dump(&new_value);
log->Printf(" %s", new_value.GetData());
}
- log->Printf("0x%8.8x: %s", op_offset, DW_OP_value_to_name(op));
+ log->Printf("0x%8.8" PRIx64 ": %s", op_offset, DW_OP_value_to_name(op));
}
switch (op)
{
@@ -1431,7 +1431,7 @@ DWARFExpression::Evaluate
if (process->ReadMemory(pointer_addr, &addr_bytes, addr_size, error) == addr_size)
{
DataExtractor addr_data(addr_bytes, sizeof(addr_bytes), process->GetByteOrder(), addr_size);
- uint32_t addr_data_offset = 0;
+ lldb::offset_t addr_data_offset = 0;
stack.back().GetScalar() = addr_data.GetPointer(&addr_data_offset);
stack.back().ClearContext();
}
@@ -1522,7 +1522,7 @@ DWARFExpression::Evaluate
if (process->ReadMemory(pointer_addr, &addr_bytes, size, error) == size)
{
DataExtractor addr_data(addr_bytes, sizeof(addr_bytes), process->GetByteOrder(), size);
- uint32_t addr_data_offset = 0;
+ lldb::offset_t addr_data_offset = 0;
switch (size)
{
case 1: stack.back().GetScalar() = addr_data.GetU8(&addr_data_offset); break;
@@ -1996,7 +1996,7 @@ DWARFExpression::Evaluate
}
else
{
- uint32_t uconst_value = opcodes.GetULEB128(&offset);
+ const uint64_t uconst_value = opcodes.GetULEB128(&offset);
// Implicit conversion from a UINT to a Scalar...
stack.back().ResolveValue(exe_ctx, ast_context) += uconst_value;
if (!stack.back().ResolveValue(exe_ctx, ast_context).IsValid())
@@ -2113,7 +2113,7 @@ DWARFExpression::Evaluate
case DW_OP_skip:
{
int16_t skip_offset = (int16_t)opcodes.GetU16(&offset);
- uint32_t new_offset = offset + skip_offset;
+ lldb::offset_t new_offset = offset + skip_offset;
if (new_offset >= opcodes_offset && new_offset < end_offset)
offset = new_offset;
else
@@ -2143,7 +2143,7 @@ DWARFExpression::Evaluate
Scalar zero(0);
if (tmp.ResolveValue(exe_ctx, ast_context) != zero)
{
- uint32_t new_offset = offset + bra_offset;
+ lldb::offset_t new_offset = offset + bra_offset;
if (new_offset >= opcodes_offset && new_offset < end_offset)
offset = new_offset;
else
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index 2027556586a..a01e19165e1 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -506,7 +506,7 @@ public:
size_t value_size = m_target_data.getTypeStoreSize(value->getType());
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint64_t u64value = value_extractor->GetMaxU64(&offset, value_size);
return AssignToMatchType(scalar, u64value, value->getType());
@@ -885,7 +885,7 @@ public:
return false;
Type *R_ty = pointer_ptr_ty->getElementType();
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
lldb::addr_t pointer = P_extractor->GetAddress(&offset);
Memory::Region R = m_memory.Lookup(pointer, R_ty);
@@ -1693,7 +1693,7 @@ IRInterpreter::runOnFunction (lldb::ClangExpressionVariableSP &result,
DataExtractorSP P_extractor(memory.GetExtractor(P));
DataEncoderSP D_encoder(memory.GetEncoder(D));
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
lldb::addr_t pointer = P_extractor->GetAddress(&offset);
Memory::Region R = memory.Lookup(pointer, target_ty);
@@ -1806,7 +1806,7 @@ IRInterpreter::runOnFunction (lldb::ClangExpressionVariableSP &result,
if (!P_extractor || !D_extractor)
return false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
lldb::addr_t pointer = P_extractor->GetAddress(&offset);
Memory::Region R = memory.Lookup(pointer, target_ty);
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 7fd5dd67e91..ae0bf887974 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -625,12 +625,12 @@ File::Write (const void *buf, size_t &num_bytes, off_t &offset)
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
File::Printf (const char *format, ...)
{
va_list args;
va_start (args, format);
- int result = PrintfVarArg (format, args);
+ size_t result = PrintfVarArg (format, args);
va_end (args);
return result;
}
@@ -638,10 +638,10 @@ File::Printf (const char *format, ...)
//------------------------------------------------------------------
// Print some formatted output to the stream.
//------------------------------------------------------------------
-int
+size_t
File::PrintfVarArg (const char *format, va_list args)
{
- int result = 0;
+ size_t result = 0;
if (DescriptorIsValid())
{
char *s = NULL;
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index 655b9e4b8e5..8b986c2a7fb 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -110,7 +110,7 @@ FileSpec::ResolveUsername (const char *src_path, char *dst_path, size_t dst_len)
}
else
{
- int user_name_len = first_slash - src_path - 1;
+ size_t user_name_len = first_slash - src_path - 1;
::memcpy (user_home, src_path + 1, user_name_len);
user_home[user_name_len] = '\0';
user_name = user_home;
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm
index 62669becc30..6cfc59d8d4d 100644
--- a/lldb/source/Host/macosx/Host.mm
+++ b/lldb/source/Host/macosx/Host.mm
@@ -1079,7 +1079,7 @@ GetMacOSXProcessArgs (const ProcessInstanceInfoMatch *match_info_ptr,
if (::sysctl (proc_args_mib, 3, arg_data, &arg_data_size , NULL, 0) == 0)
{
DataExtractor data (arg_data, arg_data_size, lldb::endian::InlHostByteOrder(), sizeof(void *));
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t argc = data.GetU32 (&offset);
const char *cstr;
diff --git a/lldb/source/Host/macosx/Symbols.cpp b/lldb/source/Host/macosx/Symbols.cpp
index 03ce57eedb9..1036b025879 100644
--- a/lldb/source/Host/macosx/Symbols.cpp
+++ b/lldb/source/Host/macosx/Symbols.cpp
@@ -58,7 +58,7 @@ SkinnyMachOFileContainsArchAndUUID
const lldb_private::UUID *uuid, // the UUID we are looking for
off_t file_offset,
DataExtractor& data,
- uint32_t data_offset,
+ lldb::offset_t data_offset,
const uint32_t magic
)
{
@@ -116,7 +116,7 @@ SkinnyMachOFileContainsArchAndUUID
for (i=0; i<ncmds; i++)
{
- const uint32_t cmd_offset = data_offset; // Save this data_offset in case parsing of the segment goes awry!
+ const lldb::offset_t cmd_offset = data_offset; // Save this data_offset in case parsing of the segment goes awry!
uint32_t cmd = data.GetU32(&data_offset);
uint32_t cmd_size = data.GetU32(&data_offset);
if (cmd == LoadCommandUUID)
@@ -151,7 +151,7 @@ UniversalMachOFileContainsArchAndUUID
const lldb_private::UUID *uuid,
off_t file_offset,
DataExtractor& data,
- uint32_t data_offset,
+ lldb::offset_t data_offset,
const uint32_t magic
)
{
@@ -189,7 +189,7 @@ UniversalMachOFileContainsArchAndUUID
DataExtractor arch_data;
DataBufferSP data_buffer_sp (file_spec.ReadFileContents (file_offset + arch_offset, 0x1000));
arch_data.SetData(data_buffer_sp);
- uint32_t arch_data_offset = 0;
+ lldb::offset_t arch_data_offset = 0;
uint32_t arch_magic = arch_data.GetU32(&arch_data_offset);
switch (arch_magic)
@@ -222,7 +222,7 @@ FileAtPathContainsArchAndUUID
{
data.SetData(data_buffer_sp);
- uint32_t data_offset = 0;
+ lldb::offset_t data_offset = 0;
uint32_t magic = data.GetU32(&data_offset);
switch (magic)
@@ -701,7 +701,7 @@ Symbols::DownloadObjectAndSymbolFile (ModuleSpec &module_spec, bool force_lookup
g_dsym_for_uuid_exe_exists = dsym_for_uuid_exe_spec.Exists();
if (!g_dsym_for_uuid_exe_exists)
{
- int bufsize;
+ long bufsize;
if ((bufsize = sysconf(_SC_GETPW_R_SIZE_MAX)) != -1)
{
char buffer[bufsize];
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index 266bcd6fb9c..006e7c8e73f 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -98,15 +98,15 @@ Args::~Args ()
void
Args::Dump (Stream *s)
{
- const int argc = m_argv.size();
- for (int i=0; i<argc; ++i)
+ const size_t argc = m_argv.size();
+ for (size_t i=0; i<argc; ++i)
{
s->Indent();
const char *arg_cstr = m_argv[i];
if (arg_cstr)
- s->Printf("argv[%i]=\"%s\"\n", i, arg_cstr);
+ s->Printf("argv[%zi]=\"%s\"\n", i, arg_cstr);
else
- s->Printf("argv[%i]=NULL\n", i);
+ s->Printf("argv[%zi]=NULL\n", i);
}
s->EOL();
}
@@ -115,8 +115,8 @@ bool
Args::GetCommandString (std::string &command) const
{
command.clear();
- int argc = GetArgumentCount();
- for (int i=0; i<argc; ++i)
+ const size_t argc = GetArgumentCount();
+ for (size_t i=0; i<argc; ++i)
{
if (i > 0)
command += ' ';
@@ -129,7 +129,7 @@ bool
Args::GetQuotedCommandString (std::string &command) const
{
command.clear ();
- size_t argc = GetArgumentCount ();
+ const size_t argc = GetArgumentCount();
for (size_t i = 0; i < argc; ++i)
{
if (i > 0)
@@ -571,7 +571,7 @@ Args::DeleteArgumentAtIndex (size_t idx)
}
void
-Args::SetArguments (int argc, const char **argv)
+Args::SetArguments (size_t argc, const char **argv)
{
// m_argv will be rebuilt in UpdateArgvFromArgs() below, so there is
// no need to clear it here.
@@ -723,11 +723,12 @@ Args::StringToSInt32 (const char *s, int32_t fail_value, int base, bool *success
if (s && s[0])
{
char *end = NULL;
- int32_t uval = ::strtol (s, &end, base);
+ const long sval = ::strtol (s, &end, base);
if (*end == '\0')
{
- if (success_ptr) *success_ptr = true;
- return uval; // All characters were used, return the result
+ if (success_ptr)
+ *success_ptr = ((sval <= INT32_MAX) && (sval >= INT32_MIN));
+ return (int32_t)sval; // All characters were used, return the result
}
}
if (success_ptr) *success_ptr = false;
@@ -740,11 +741,12 @@ Args::StringToUInt32 (const char *s, uint32_t fail_value, int base, bool *succes
if (s && s[0])
{
char *end = NULL;
- uint32_t uval = ::strtoul (s, &end, base);
+ const unsigned long uval = ::strtoul (s, &end, base);
if (*end == '\0')
{
- if (success_ptr) *success_ptr = true;
- return uval; // All characters were used, return the result
+ if (success_ptr)
+ *success_ptr = (uval <= UINT32_MAX);
+ return (uint32_t)uval; // All characters were used, return the result
}
}
if (success_ptr) *success_ptr = false;
@@ -941,8 +943,7 @@ Args::StringToVersion (const char *s, uint32_t &major, uint32_t &minor, uint32_t
if (s && s[0])
{
char *pos = NULL;
- uint32_t uval32;
- uval32 = ::strtoul (s, &pos, 0);
+ unsigned long uval32 = ::strtoul (s, &pos, 0);
if (pos == s)
return s;
major = uval32;
@@ -992,7 +993,7 @@ Args::GetShellSafeArgument (const char *unsafe_arg, std::string &safe_arg)
}
-int32_t
+int64_t
Args::StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, int32_t fail_value, Error &error)
{
if (enum_values)
@@ -1052,7 +1053,7 @@ Args::StringToFormat
(
const char *s,
lldb::Format &format,
- uint32_t *byte_size_ptr
+ size_t *byte_size_ptr
)
{
format = eFormatInvalid;
@@ -1674,8 +1675,7 @@ Args::EncodeEscapeSequences (const char *src, std::string &dst)
unsigned long octal_value = ::strtoul (oct_str, NULL, 8);
if (octal_value <= UINT8_MAX)
{
- const char octal_char = octal_value;
- dst.append(1, octal_char);
+ dst.append(1, (char)octal_value);
}
}
break;
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 7dfc5d8318e..e3da3a5526b 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -600,7 +600,7 @@ CommandObjectSP
CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bool exact, StringList *matches)
{
CommandObject::CommandMap::iterator pos;
- CommandObjectSP ret_val;
+ CommandObjectSP command_sp;
std::string cmd(cmd_cstr);
@@ -608,24 +608,24 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo
{
pos = m_command_dict.find(cmd);
if (pos != m_command_dict.end())
- ret_val = pos->second;
+ command_sp = pos->second;
}
if (include_aliases && HasAliases())
{
pos = m_alias_dict.find(cmd);
if (pos != m_alias_dict.end())
- ret_val = pos->second;
+ command_sp = pos->second;
}
if (HasUserCommands())
{
pos = m_user_dict.find(cmd);
if (pos != m_user_dict.end())
- ret_val = pos->second;
+ command_sp = pos->second;
}
- if (!exact && !ret_val)
+ if (!exact && !command_sp)
{
// We will only get into here if we didn't find any exact matches.
@@ -695,13 +695,13 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo
return user_match_sp;
}
}
- else if (matches && ret_val)
+ else if (matches && command_sp)
{
matches->AppendString (cmd_cstr);
}
- return ret_val;
+ return command_sp;
}
bool
@@ -871,7 +871,7 @@ CommandInterpreter::ProcessAliasOptionsArgs (lldb::CommandObjectSP &cmd_obj_sp,
options_string)));
else
{
- int argc = args.GetArgumentCount();
+ const size_t argc = args.GetArgumentCount();
for (size_t i = 0; i < argc; ++i)
if (strcmp (args.GetArgumentAtIndex (i), "") != 0)
option_arg_vector->push_back
@@ -981,7 +981,7 @@ CommandInterpreter::GetHelp (CommandReturnObject &result,
uint32_t cmd_types)
{
CommandObject::CommandMap::const_iterator pos;
- uint32_t max_len = FindLongestCommandWord (m_command_dict);
+ size_t max_len = FindLongestCommandWord (m_command_dict);
if ( (cmd_types & eCommandTypesBuiltin) == eCommandTypesBuiltin )
{
@@ -1595,21 +1595,15 @@ CommandInterpreter::HandleCommand (const char *command_line,
if (cmd_obj == NULL)
{
- uint32_t num_matches = matches.GetSize();
+ const size_t num_matches = matches.GetSize();
if (matches.GetSize() > 1) {
- std::string error_msg;
- error_msg.assign ("Ambiguous command '");
- error_msg.append(next_word.c_str());
- error_msg.append ("'.");
-
- error_msg.append (" Possible matches:");
+ StreamString error_msg;
+ error_msg.Printf ("Ambiguous command '%s'. Possible matches:\n", next_word.c_str());
for (uint32_t i = 0; i < num_matches; ++i) {
- error_msg.append ("\n\t");
- error_msg.append (matches.GetStringAtIndex(i));
+ error_msg.Printf ("\t%s\n", matches.GetStringAtIndex(i));
}
- error_msg.append ("\n");
- result.AppendRawError (error_msg.c_str(), error_msg.size());
+ result.AppendRawError (error_msg.GetString().c_str());
} else {
// We didn't have only one match, otherwise we wouldn't get here.
assert(num_matches == 0);
@@ -1777,7 +1771,7 @@ CommandInterpreter::HandleCommand (const char *command_line,
error_msg.append (matches.GetStringAtIndex (i));
}
error_msg.append ("\n");
- result.AppendRawError (error_msg.c_str(), error_msg.size());
+ result.AppendRawError (error_msg.c_str());
}
else
result.AppendErrorWithFormat ("Unrecognized command '%s'.\n", command_args.GetArgumentAtIndex (0));
@@ -1957,7 +1951,7 @@ CommandInterpreter::HandleCompletion (const char *current_line,
std::string common_prefix;
matches.LongestCommonPrefix (common_prefix);
- int partial_name_len = command_partial_str.size();
+ const size_t partial_name_len = command_partial_str.size();
// If we matched a unique single command, add a space...
// Only do this if the completer told us this was a complete word, however...
@@ -2211,7 +2205,7 @@ CommandInterpreter::BuildAliasCommandArgs (CommandObject *alias_cmd_obj,
}
OptionArgVector *option_arg_vector = option_arg_vector_sp.get();
- int old_size = cmd_args.GetArgumentCount();
+ const size_t old_size = cmd_args.GetArgumentCount();
std::vector<bool> used (old_size + 1, false);
used[0] = true;
@@ -2626,7 +2620,7 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm,
const char *word_text,
const char *separator,
const char *help_text,
- uint32_t max_word_len)
+ size_t max_word_len)
{
const uint32_t max_columns = m_debugger.GetTerminalWidth();
@@ -2635,7 +2629,7 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm,
strm.IndentMore (indent_size);
StreamString text_strm;
- text_strm.Printf ("%-*s %s %s", max_word_len, word_text, separator, help_text);
+ text_strm.Printf ("%-*s %s %s", (int)max_word_len, word_text, separator, help_text);
size_t len = text_strm.GetSize();
const char *text = text_strm.GetData();
@@ -2655,10 +2649,9 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm,
// We need to break it up into multiple lines.
bool first_line = true;
int text_width;
- int start = 0;
- int end = start;
- int final_end = strlen (text);
- int sub_len;
+ size_t start = 0;
+ size_t end = start;
+ const size_t final_end = strlen (text);
while (end < final_end)
{
@@ -2686,7 +2679,7 @@ CommandInterpreter::OutputFormattedHelpText (Stream &strm,
assert (end > 0);
}
- sub_len = end - start;
+ const size_t sub_len = end - start;
if (start != 0)
strm.EOL();
if (!first_line)
@@ -2814,7 +2807,7 @@ CommandInterpreter::FindHistoryString (const char *input_str) const
if (input_str[1] == '-')
{
bool success;
- uint32_t idx = Args::StringToUInt32 (input_str+2, 0, 0, &success);
+ size_t idx = Args::StringToUInt32 (input_str+2, 0, 0, &success);
if (!success)
return NULL;
if (idx > m_command_history.size())
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index 784187f8763..391b2f2d60b 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -351,13 +351,9 @@ class CommandDictCommandPartialMatch
{
// A NULL or empty string matches everything.
if (m_match_str == NULL || *m_match_str == '\0')
- return 1;
+ return true;
- size_t found = map_element.first.find (m_match_str, 0);
- if (found == std::string::npos)
- return 0;
- else
- return found == 0;
+ return map_element.first.find (m_match_str, 0) == 0;
}
private:
diff --git a/lldb/source/Interpreter/CommandReturnObject.cpp b/lldb/source/Interpreter/CommandReturnObject.cpp
index c7ab8a988d7..53eb1becf2f 100644
--- a/lldb/source/Interpreter/CommandReturnObject.cpp
+++ b/lldb/source/Interpreter/CommandReturnObject.cpp
@@ -123,13 +123,10 @@ CommandReturnObject::AppendWarning (const char *in_string)
// don't append "\n" to the end of it.
void
-CommandReturnObject::AppendRawWarning (const char *in_string, int len)
+CommandReturnObject::AppendRawWarning (const char *in_string)
{
- if (!in_string)
- return;
- if (len < 0)
- len = ::strlen (in_string);
- GetErrorStream().Printf("%*.*s", len, len, in_string);
+ if (in_string && in_string[0])
+ GetErrorStream().PutCString(in_string);
}
void
@@ -153,13 +150,10 @@ CommandReturnObject::SetError (const Error &error, const char *fallback_error_cs
// don't append "\n" to the end of it.
void
-CommandReturnObject::AppendRawError (const char *in_string, int len)
+CommandReturnObject::AppendRawError (const char *in_string)
{
- if (!in_string)
- return;
- if (len < 0)
- len = ::strlen (in_string);
- GetErrorStream().Printf ("%*.*s", len, len, in_string);
+ if (in_string && in_string[0])
+ GetErrorStream().PutCString(in_string);
}
void
diff --git a/lldb/source/Interpreter/PythonDataObjects.cpp b/lldb/source/Interpreter/PythonDataObjects.cpp
index 5b8ec527739..8cd4db999a7 100644
--- a/lldb/source/Interpreter/PythonDataObjects.cpp
+++ b/lldb/source/Interpreter/PythonDataObjects.cpp
@@ -316,8 +316,14 @@ PythonDictionary::GetItemForKeyAsInteger (const PythonString &key, int64_t fail_
if (m_py_obj && key)
{
PyObject *py_obj = PyDict_GetItem(m_py_obj, key.GetPythonObject());
- if (py_obj && PyInt_Check(py_obj))
- return PyInt_AsLong(py_obj);
+ if (py_obj)
+ {
+ if (PyInt_Check(py_obj))
+ return PyInt_AsLong(py_obj);
+
+ if (PyLong_Check(py_obj))
+ return PyLong_AsLong(py_obj);
+ }
}
return fail_value;
}
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 3dce1c5d478..0b0aec1ae68 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -2360,7 +2360,7 @@ ScriptInterpreterPython::PythonInputReaderManager::RunPythonInputReader (lldb::t
return NULL;
}
-uint32_t
+size_t
ScriptInterpreterPython::CalculateNumChildren (const lldb::ScriptInterpreterObjectSP& implementor_sp)
{
if (!implementor_sp)
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
index d25c9b427a7..3a9f767cfc7 100644
--- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
@@ -548,7 +548,7 @@ ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueObj
{
DataExtractor data;
size_t num_bytes = new_value_sp->GetData(data);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (num_bytes <= 8)
{
const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("r0", 0);
diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
index 7390b5596cb..03592522833 100644
--- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
+++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
@@ -722,7 +722,7 @@ ABIMacOSX_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb
{
DataExtractor data;
size_t num_bytes = new_value_sp->GetData(data);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (num_bytes <= 8)
{
const RegisterInfo *eax_info = reg_ctx->GetRegisterInfoByName("eax", 0);
diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
index c412c1f6459..fbb18ddce02 100644
--- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
@@ -588,7 +588,7 @@ ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp, lldb::ValueOb
DataExtractor data;
size_t num_bytes = new_value_sp->GetData(data);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (num_bytes <= 8)
{
uint64_t raw_value = data.GetMaxU64(&offset, num_bytes);
@@ -727,7 +727,7 @@ ABISysV_x86_64::GetReturnValueObjectSimple (Thread &thread,
DataExtractor data;
if (xmm0_value.GetData(data))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
switch (bit_width)
{
default:
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
index 7522a1ced16..ec715293bd1 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
@@ -68,7 +68,7 @@ public:
virtual size_t
Decode (const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,
- uint32_t data_offset)
+ lldb::offset_t data_offset)
{
// All we have to do is read the opcode which can be easy for some
// architetures
@@ -239,7 +239,7 @@ public:
m_comment.assign ("unknown opcode");
inst_size = m_opcode.GetByteSize();
StreamString mnemonic_strm;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
switch (inst_size)
{
case 1:
@@ -486,8 +486,8 @@ DisassemblerLLVMC::~DisassemblerLLVMC()
size_t
DisassemblerLLVMC::DecodeInstructions (const Address &base_addr,
const DataExtractor& data,
- uint32_t data_offset,
- uint32_t num_instructions,
+ lldb::offset_t data_offset,
+ size_t num_instructions,
bool append)
{
if (!append)
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
index 5f9bcc837ee..c6c3e6652bb 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
@@ -50,8 +50,8 @@ public:
size_t
DecodeInstructions (const lldb_private::Address &base_addr,
const lldb_private::DataExtractor& data,
- uint32_t data_offset,
- uint32_t num_instructions,
+ lldb::offset_t data_offset,
+ size_t num_instructions,
bool append);
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 0cb04468fbb..5aa8869091f 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -612,7 +612,7 @@ DynamicLoaderDarwinKernel::ReadKextSummaryHeader ()
const size_t bytes_read = m_process->GetTarget().ReadMemory (m_kext_summary_header_addr, prefer_file_cache, buf, count, error);
if (bytes_read == count)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
m_kext_summary_header.version = data.GetU32(&offset);
if (m_kext_summary_header.version >= 2)
{
@@ -723,7 +723,7 @@ DynamicLoaderDarwinKernel::ReadKextSummaries (const Address &kext_summary_addr,
i < image_infos.size() && extractor.ValidOffsetForDataOfSize(kext_summary_offset, m_kext_summary_header.entry_size);
++i, kext_summary_offset += m_kext_summary_header.entry_size)
{
- uint32_t offset = kext_summary_offset;
+ lldb::offset_t offset = kext_summary_offset;
const void *name_data = extractor.GetData(&offset, KERNEL_MODULE_MAX_NAME);
if (name_data == NULL)
break;
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 22cc1d56d86..dd34da370db 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -279,7 +279,7 @@ DynamicLoaderMacOSXDYLD::LocateDYLD()
Error error;
if (m_process->ReadMemory (shlib_addr, buf, 4, error) == 4)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t magic = data.GetU32 (&offset);
switch (magic)
{
@@ -449,8 +449,8 @@ DynamicLoaderMacOSXDYLD::UpdateCommPageLoadAddress(Module *module)
SectionList *section_list = image_object_file->GetSectionList ();
if (section_list)
{
- uint32_t num_sections = section_list->GetSize();
- for (uint32_t i=0; i<num_sections; ++i)
+ const size_t num_sections = section_list->GetSize();
+ for (size_t i=0; i<num_sections; ++i)
{
SectionSP section_sp (section_list->GetSectionAtIndex (i));
if (section_sp)
@@ -490,8 +490,8 @@ DynamicLoaderMacOSXDYLD::UpdateImageLoadAddress (Module *module, DYLDImageInfo&
std::vector<uint32_t> inaccessible_segment_indexes;
// We now know the slide amount, so go through all sections
// and update the load addresses with the correct values.
- uint32_t num_segments = info.segments.size();
- for (uint32_t i=0; i<num_segments; ++i)
+ const size_t num_segments = info.segments.size();
+ for (size_t i=0; i<num_segments; ++i)
{
// Only load a segment if it has protections. Things like
// __PAGEZERO don't have any protections, and they shouldn't
@@ -585,8 +585,8 @@ DynamicLoaderMacOSXDYLD::UnloadImageLoadAddress (Module *module, DYLDImageInfo&
SectionList *section_list = image_object_file->GetSectionList ();
if (section_list)
{
- uint32_t num_segments = info.segments.size();
- for (uint32_t i=0; i<num_segments; ++i)
+ const size_t num_segments = info.segments.size();
+ for (size_t i=0; i<num_segments; ++i)
{
SectionSP section_sp(section_list->FindSectionByName(info.segments[i].name));
if (section_sp)
@@ -715,7 +715,7 @@ DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure ()
uint8_t buf[256];
DataExtractor data (buf, sizeof(buf), byte_order, addr_size);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const size_t count_v2 = sizeof (uint32_t) + // version
sizeof (uint32_t) + // infoArrayCount
@@ -740,7 +740,6 @@ DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure ()
addr_size; // errorSymbol
assert (sizeof (buf) >= count_v11);
- int count;
Error error;
if (m_process->ReadMemory (m_dyld_all_image_infos_addr, buf, 4, error) == 4)
{
@@ -767,10 +766,7 @@ DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure ()
return false;
}
- if (m_dyld_all_image_infos.version >= 11)
- count = count_v11;
- else
- count = count_v2;
+ const size_t count = (m_dyld_all_image_infos.version >= 11) ? count_v11 : count_v2;
const size_t bytes_read = m_process->ReadMemory (m_dyld_all_image_infos_addr, buf, count, error);
if (bytes_read == count)
@@ -1049,7 +1045,7 @@ DynamicLoaderMacOSXDYLD::ReadImageInfos (lldb::addr_t image_infos_addr,
error);
if (bytes_read == count)
{
- uint32_t info_data_offset = 0;
+ lldb::offset_t info_data_offset = 0;
DataExtractor info_data_ref(info_data.GetBytes(), info_data.GetByteSize(), endian, addr_size);
for (int i = 0; i < image_infos.size() && info_data_ref.ValidOffset(info_data_offset); i++)
{
@@ -1167,7 +1163,7 @@ DynamicLoaderMacOSXDYLD::ReadMachHeader (lldb::addr_t addr, llvm::MachO::mach_he
error);
if (bytes_read == sizeof(llvm::MachO::mach_header))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
::memset (header, 0, sizeof(llvm::MachO::mach_header));
// Get the magic byte unswapped so we can figure out what we are dealing with
@@ -1229,7 +1225,7 @@ DynamicLoaderMacOSXDYLD::ReadMachHeader (lldb::addr_t addr, llvm::MachO::mach_he
uint32_t
DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImageInfo& dylib_info, FileSpec *lc_id_dylinker)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t cmd_idx;
Segment segment;
dylib_info.Clear (true);
@@ -1242,7 +1238,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImage
if (data.ValidOffsetForDataOfSize (offset, sizeof(llvm::MachO::load_command)))
{
llvm::MachO::load_command load_cmd;
- uint32_t load_cmd_offset = offset;
+ lldb::offset_t load_cmd_offset = offset;
load_cmd.cmd = data.GetU32 (&offset);
load_cmd.cmdsize = data.GetU32 (&offset);
switch (load_cmd.cmd)
@@ -1276,7 +1272,7 @@ DynamicLoaderMacOSXDYLD::ParseLoadCommands (const DataExtractor& data, DYLDImage
case llvm::MachO::LoadCommandDynamicLinkerIdent:
if (lc_id_dylinker)
{
- uint32_t name_offset = load_cmd_offset + data.GetU32 (&offset);
+ const lldb::offset_t name_offset = load_cmd_offset + data.GetU32 (&offset);
const char *path = data.PeekCStr (name_offset);
lc_id_dylinker->SetFile (path, true);
}
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
index 17d9da054ca..de4d1e77b88 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
@@ -26,21 +26,25 @@ using namespace lldb_private;
static bool
GetMaxU64(DataExtractor &data,
- uint32_t *offset, uint64_t *value, unsigned int byte_size)
+ lldb::offset_t *offset_ptr,
+ uint64_t *value,
+ unsigned int byte_size)
{
- uint32_t saved_offset = *offset;
- *value = data.GetMaxU64(offset, byte_size);
- return *offset != saved_offset;
+ lldb::offset_t saved_offset = *offset_ptr;
+ *value = data.GetMaxU64(offset_ptr, byte_size);
+ return *offset_ptr != saved_offset;
}
static bool
-ParseAuxvEntry(DataExtractor &data, AuxVector::Entry &entry,
- uint32_t *offset, unsigned int byte_size)
+ParseAuxvEntry(DataExtractor &data,
+ AuxVector::Entry &entry,
+ lldb::offset_t *offset_ptr,
+ unsigned int byte_size)
{
- if (!GetMaxU64(data, offset, &entry.type, byte_size))
+ if (!GetMaxU64(data, offset_ptr, &entry.type, byte_size))
return false;
- if (!GetMaxU64(data, offset, &entry.value, byte_size))
+ if (!GetMaxU64(data, offset_ptr, &entry.value, byte_size))
return false;
return true;
@@ -57,7 +61,7 @@ void
AuxVector::ParseAuxv(DataExtractor &data)
{
const unsigned int byte_size = m_process->GetAddressByteSize();
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
for (;;)
{
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index 6b9b8d6baa2..b57f2c5b0b3 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -304,7 +304,7 @@ DYLDRendezvous::DumpToLog(LogSP log) const
log->PutCString("DYLDRendezvous:");
log->Printf(" Address: %" PRIx64, GetRendezvousAddress());
- log->Printf(" Version: %d", GetVersion());
+ log->Printf(" Version: %" PRIu64, GetVersion());
log->Printf(" Link : %" PRIx64, GetLinkMapAddress());
log->Printf(" Break : %" PRIx64, GetBreakAddress());
log->Printf(" LDBase : %" PRIx64, GetLDBase());
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
index 3402a72ce91..81cb74f153b 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
@@ -73,7 +73,7 @@ public:
GetRendezvousAddress() const { return m_rendezvous_addr; }
/// @returns the version of the rendezvous protocol being used.
- int
+ uint64_t
GetVersion() const { return m_current.version; }
/// @returns address in the inferiors address space containing the linked
@@ -92,7 +92,7 @@ public:
GetBreakAddress() const { return m_current.brk; }
/// Returns the current state of the rendezvous structure.
- int
+ uint64_t
GetState() const { return m_current.state; }
/// @returns the base address of the runtime linker in the inferiors address
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 2cd340980c1..494cf92bc37 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -90,10 +90,10 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value,
return false;
}
- uint32_t offset_ptr = 0;
- lldb::addr_t vtable_address_point = data.GetAddress (&offset_ptr);
+ lldb::offset_t offset = 0;
+ lldb::addr_t vtable_address_point = data.GetAddress (&offset);
- if (offset_ptr == 0)
+ if (offset == 0)
return false;
// Now find the symbol that contains this address:
@@ -255,8 +255,8 @@ ItaniumABILanguageRuntime::GetDynamicTypeAndAddress (ValueObject &in_value,
return false;
}
- offset_ptr = 0;
- int64_t offset_to_top = data.GetMaxS64(&offset_ptr, process->GetAddressByteSize());
+ offset = 0;
+ int64_t offset_to_top = data.GetMaxS64(&offset, process->GetAddressByteSize());
// So the dynamic type is a value that starts at offset_to_top
// above the original address.
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
index 545a8cae624..782b74a43fe 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
@@ -385,7 +385,7 @@ AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded()
const uint32_t addr_size = m_process->GetAddressByteSize();
const ByteOrder byte_order = m_process->GetByteOrder();
DataExtractor data (buffer.GetBytes(), buffer.GetByteSize(), byte_order, addr_size);
- uint32_t offset = addr_size; // Skip prototype
+ lldb::offset_t offset = addr_size; // Skip prototype
const uint32_t count = data.GetU32(&offset);
const uint32_t num_buckets = data.GetU32(&offset);
const addr_t buckets_ptr = data.GetPointer(&offset);
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index cfe7d13c697..6c4223784cd 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -1256,7 +1256,7 @@ private:
DataExtractor extractor(objc_class_buf.GetBytes(), objc_class_size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_isa = extractor.GetAddress_unchecked(&cursor); // uintptr_t isa;
m_superclass = extractor.GetAddress_unchecked(&cursor); // Class superclass;
@@ -1315,7 +1315,7 @@ private:
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_flags = extractor.GetU32_unchecked(&cursor);
m_instanceStart = extractor.GetU32_unchecked(&cursor);
@@ -1386,13 +1386,13 @@ private:
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_flags = extractor.GetU32_unchecked(&cursor);
m_version = extractor.GetU32_unchecked(&cursor);
- m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
- m_method_list_ptr = extractor.GetAddress_unchecked(&cursor);
- m_properties_ptr = extractor.GetAddress_unchecked(&cursor);
+ m_ro_ptr = extractor.GetAddress_unchecked(&cursor);
+ m_method_list_ptr = extractor.GetAddress_unchecked(&cursor);
+ m_properties_ptr = extractor.GetAddress_unchecked(&cursor);
m_firstSubclass = extractor.GetAddress_unchecked(&cursor);
m_nextSiblingClass = extractor.GetAddress_unchecked(&cursor);
@@ -1422,7 +1422,7 @@ private:
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_entsize = extractor.GetU32_unchecked(&cursor) & ~(uint32_t)3;
m_count = extractor.GetU32_unchecked(&cursor);
@@ -1465,7 +1465,7 @@ private:
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_name_ptr = extractor.GetAddress_unchecked(&cursor);
m_types_ptr = extractor.GetAddress_unchecked(&cursor);
@@ -1508,7 +1508,7 @@ private:
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_entsize = extractor.GetU32_unchecked(&cursor);
m_count = extractor.GetU32_unchecked(&cursor);
@@ -1555,7 +1555,7 @@ private:
DataExtractor extractor(buffer.GetBytes(), size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t cursor = 0;
+ lldb::offset_t cursor = 0;
m_offset_ptr = extractor.GetAddress_unchecked(&cursor);
m_name_ptr = extractor.GetAddress_unchecked(&cursor);
@@ -2176,11 +2176,11 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded()
DataExtractor isa_extractor(isas_buffer.GetBytes(), isas_allocation_size, process->GetByteOrder(), process->GetAddressByteSize());
- uint32_t offset_ptr = 0;
+ lldb::offset_t offset = 0;
for (size_t index = 0; index < num_isas; ++index)
{
- uint64_t isa = isa_extractor.GetPointer(&offset_ptr);
+ uint64_t isa = isa_extractor.GetPointer(&offset);
const char *name = (const char*)(names_buffer.GetBytes() + (name_size * index));
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
index 1e35a2f9661..7766f5cd2aa 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
@@ -194,12 +194,12 @@ AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion()
return;
}
- uint32_t offset_ptr = 0;
- const uint16_t header_size = data.GetU16(&offset_ptr);
- const uint16_t descriptor_size = data.GetU16(&offset_ptr);
- const size_t num_descriptors = data.GetU32(&offset_ptr);
+ lldb::offset_t offset = 0;
+ const uint16_t header_size = data.GetU16(&offset);
+ const uint16_t descriptor_size = data.GetU16(&offset);
+ const size_t num_descriptors = data.GetU32(&offset);
- m_next_region = data.GetPointer(&offset_ptr);
+ m_next_region = data.GetPointer(&offset);
// If the header size is 0, that means we've come in too early before this data is set up.
// Set ourselves as not valid, and continue.
@@ -239,16 +239,16 @@ AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion()
// The actual code for the vtables will be laid out consecutively, so I also
// compute the start and end of the whole code block.
- offset_ptr = 0;
+ offset = 0;
m_code_start_addr = 0;
m_code_end_addr = 0;
for (int i = 0; i < num_descriptors; i++)
{
- lldb::addr_t start_offset = offset_ptr;
- uint32_t offset = desc_extractor.GetU32 (&offset_ptr);
- uint32_t flags = desc_extractor.GetU32 (&offset_ptr);
- lldb::addr_t code_addr = desc_ptr + start_offset + offset;
+ lldb::addr_t start_offset = offset;
+ uint32_t voffset = desc_extractor.GetU32 (&offset);
+ uint32_t flags = desc_extractor.GetU32 (&offset);
+ lldb::addr_t code_addr = desc_ptr + start_offset + voffset;
m_descriptors.push_back (VTableDescriptor(flags, code_addr));
if (m_code_start_addr == 0 || code_addr < m_code_start_addr)
@@ -256,7 +256,7 @@ AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion()
if (code_addr > m_code_end_addr)
m_code_end_addr = code_addr;
- offset_ptr = start_offset + descriptor_size;
+ offset = start_offset + descriptor_size;
}
// Finally, a little bird told me that all the vtable code blocks are the same size.
// Let's compute the blocks and if they are all the same add the size to the code end address:
@@ -427,8 +427,8 @@ AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines (void *baton,
data,
0,
NULL);
- uint32_t offset_ptr = 0;
- lldb::addr_t region_addr = data.GetPointer(&offset_ptr);
+ lldb::offset_t offset = 0;
+ lldb::addr_t region_addr = data.GetPointer(&offset);
if (region_addr != 0)
vtable_handler->ReadRegions(region_addr);
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index 97aed1a323b..d61a88b51af 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -49,8 +49,8 @@ ObjectContainerBSDArchive::Object::Clear()
ar_file_size = 0;
}
-uint32_t
-ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, uint32_t offset)
+lldb::offset_t
+ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, lldb::offset_t offset)
{
size_t ar_name_len = 0;
std::string str;
@@ -98,7 +98,7 @@ ObjectContainerBSDArchive::Object::Extract (const DataExtractor& data, uint32_t
ar_file_size = ar_size - ar_name_len;
return offset;
}
- return LLDB_INVALID_INDEX32;
+ return LLDB_INVALID_OFFSET;
}
ObjectContainerBSDArchive::Archive::Archive
@@ -120,7 +120,7 @@ size_t
ObjectContainerBSDArchive::Archive::ParseObjects (DataExtractor &data)
{
std::string str;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
str.assign((const char *)data.GetData(&offset, SARMAG), SARMAG);
if (str == ARMAG)
{
@@ -128,9 +128,9 @@ ObjectContainerBSDArchive::Archive::ParseObjects (DataExtractor &data)
do
{
offset = obj.Extract (data, offset);
- if (offset == LLDB_INVALID_INDEX32)
+ if (offset == LLDB_INVALID_OFFSET)
break;
- uint32_t obj_idx = m_objects.size();
+ size_t obj_idx = m_objects.size();
m_objects.push_back(obj);
// Insert all of the C strings out of order for now...
m_object_name_to_index_map.Append (obj.ar_name.GetCString(), obj_idx);
@@ -147,7 +147,7 @@ ObjectContainerBSDArchive::Archive::ParseObjects (DataExtractor &data)
ObjectContainerBSDArchive::Object *
ObjectContainerBSDArchive::Archive::FindObject (const ConstString &object_name)
{
- const UniqueCStringMap<uint32_t>::Entry *match = m_object_name_to_index_map.FindFirstValueForName (object_name.GetCString());
+ const ObjectNameToIndexMap::Entry *match = m_object_name_to_index_map.FindFirstValueForName (object_name.GetCString());
if (match)
return &m_objects[match->value];
return NULL;
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
index ce245b1f54b..22779a1848a 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
@@ -97,8 +97,8 @@ protected:
void
Clear();
- uint32_t
- Extract (const lldb_private::DataExtractor& data, uint32_t offset);
+ lldb::offset_t
+ Extract (const lldb_private::DataExtractor& data, lldb::offset_t offset);
lldb_private::ConstString ar_name; // name
uint32_t ar_date; // modification time
@@ -106,8 +106,8 @@ protected:
uint16_t ar_gid; // group id
uint16_t ar_mode; // octal file permissions
uint32_t ar_size; // size in bytes
- uint32_t ar_file_offset; // file offset in bytes from the beginning of the file of the object data
- uint32_t ar_file_size; // length of the object data
+ lldb::offset_t ar_file_offset; // file offset in bytes from the beginning of the file of the object data
+ lldb::offset_t ar_file_size; // length of the object data
typedef std::vector<Object> collection;
typedef collection::iterator iterator;
@@ -170,14 +170,14 @@ protected:
HasNoExternalReferences() const;
protected:
-
+ typedef lldb_private::UniqueCStringMap<uint32_t> ObjectNameToIndexMap;
//----------------------------------------------------------------------
// Member Variables
//----------------------------------------------------------------------
lldb_private::ArchSpec m_arch;
lldb_private::TimeValue m_time;
Object::collection m_objects;
- lldb_private::UniqueCStringMap<uint32_t> m_object_name_to_index_map;
+ ObjectNameToIndexMap m_object_name_to_index_map;
};
void
diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index 2241bc773a5..5641c265675 100644
--- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -75,7 +75,7 @@ ObjectContainerUniversalMachO::CreateInstance
bool
ObjectContainerUniversalMachO::MagicBytesMatch (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t magic = data.GetU32(&offset);
return magic == UniversalMagic || magic == UniversalMagicSwapped;
}
@@ -105,7 +105,7 @@ ObjectContainerUniversalMachO::ParseHeader ()
{
// Store the file offset for this universal file as we could have a universal .o file
// in a BSD archive, or be contained in another kind of object.
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
// Universal mach-o files always have their headers in big endian.
m_data.SetByteOrder (eByteOrderBig);
m_header.magic = m_data.GetU32(&offset);
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
index bfff9f3336e..d9cac0d06b3 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -23,20 +23,24 @@ using namespace llvm::ELF;
// GetMaxU64 and GetMaxS64 wrap the similarly named methods from DataExtractor
// with error handling code and provide for parsing a sequence of values.
static bool
-GetMaxU64(const lldb_private::DataExtractor &data,
- uint32_t *offset, uint64_t *value, uint32_t byte_size)
+GetMaxU64(const lldb_private::DataExtractor &data,
+ lldb::offset_t *offset,
+ uint64_t *value,
+ uint32_t byte_size)
{
- const uint32_t saved_offset = *offset;
+ const lldb::offset_t saved_offset = *offset;
*value = data.GetMaxU64(offset, byte_size);
return *offset != saved_offset;
}
static bool
GetMaxU64(const lldb_private::DataExtractor &data,
- uint32_t *offset, uint64_t *value, uint32_t byte_size,
+ lldb::offset_t *offset,
+ uint64_t *value,
+ uint32_t byte_size,
uint32_t count)
{
- uint32_t saved_offset = *offset;
+ lldb::offset_t saved_offset = *offset;
for (uint32_t i = 0; i < count; ++i, ++value)
{
@@ -51,19 +55,23 @@ GetMaxU64(const lldb_private::DataExtractor &data,
static bool
GetMaxS64(const lldb_private::DataExtractor &data,
- uint32_t *offset, int64_t *value, uint32_t byte_size)
+ lldb::offset_t *offset,
+ int64_t *value,
+ uint32_t byte_size)
{
- const uint32_t saved_offset = *offset;
+ const lldb::offset_t saved_offset = *offset;
*value = data.GetMaxS64(offset, byte_size);
return *offset != saved_offset;
}
static bool
GetMaxS64(const lldb_private::DataExtractor &data,
- uint32_t *offset, int64_t *value, uint32_t byte_size,
+ lldb::offset_t *offset,
+ int64_t *value,
+ uint32_t byte_size,
uint32_t count)
{
- uint32_t saved_offset = *offset;
+ lldb::offset_t saved_offset = *offset;
for (uint32_t i = 0; i < count; ++i, ++value)
{
@@ -95,7 +103,7 @@ ELFHeader::GetByteOrder() const
}
bool
-ELFHeader::Parse(lldb_private::DataExtractor &data, uint32_t *offset)
+ELFHeader::Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
// Read e_ident. This provides byte order and address size info.
if (data.GetU8(offset, &e_ident, EI_NIDENT) == NULL)
@@ -190,7 +198,7 @@ ELFSectionHeader::ELFSectionHeader()
bool
ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
- uint32_t *offset)
+ lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
@@ -226,7 +234,7 @@ ELFSymbol::ELFSymbol()
}
bool
-ELFSymbol::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFSymbol::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
const bool parsing_32 = byte_size == 4;
@@ -276,7 +284,7 @@ ELFProgramHeader::ELFProgramHeader()
bool
ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
- uint32_t *offset)
+ lldb::offset_t *offset)
{
const uint32_t byte_size = data.GetAddressByteSize();
const bool parsing_32 = byte_size == 4;
@@ -320,7 +328,7 @@ ELFDynamic::ELFDynamic()
}
bool
-ELFDynamic::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFDynamic::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
return GetMaxS64(data, offset, &d_tag, byte_size, 2);
@@ -335,7 +343,7 @@ ELFRel::ELFRel()
}
bool
-ELFRel::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFRel::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
@@ -355,7 +363,7 @@ ELFRela::ELFRela()
}
bool
-ELFRela::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFRela::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
const unsigned byte_size = data.GetAddressByteSize();
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h
index 45798574ccc..77e5cda3980 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h
+++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h
@@ -123,7 +123,7 @@ struct ELFHeader
/// True if the ELFSectionHeader was successfully read and false
/// otherwise.
bool
- Parse(lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset);
//--------------------------------------------------------------------------
/// Examines at most EI_NIDENT bytes starting from the given pointer and
@@ -181,7 +181,7 @@ struct ELFSectionHeader
/// True if the ELFSectionHeader was successfully read and false
/// otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
@@ -216,7 +216,7 @@ struct ELFProgramHeader
/// True if the ELFProgramHeader was successfully read and false
/// otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
@@ -259,7 +259,7 @@ struct ELFSymbol
/// @return
/// True if the ELFSymbol was successfully read and false otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
@@ -292,7 +292,7 @@ struct ELFDynamic
/// True if the ELFDynamic entry was successfully read and false
/// otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
};
//------------------------------------------------------------------------------
@@ -320,7 +320,7 @@ struct ELFRel
/// @return
/// True if the ELFRel entry was successfully read and false otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
/// Returns the type when the given entry represents a 32-bit relocation.
static unsigned
@@ -379,7 +379,7 @@ struct ELFRela
/// @return
/// True if the ELFRela entry was successfully read and false otherwise.
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
/// Returns the type when the given entry represents a 32-bit relocation.
static unsigned
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index e357aff0e64..a430c264499 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -53,7 +53,7 @@ public:
~ELFRelocation();
bool
- Parse(const lldb_private::DataExtractor &data, uint32_t *offset);
+ Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset);
static unsigned
RelocType32(const ELFRelocation &rel);
@@ -94,7 +94,7 @@ ELFRelocation::~ELFRelocation()
}
bool
-ELFRelocation::Parse(const lldb_private::DataExtractor &data, uint32_t *offset)
+ELFRelocation::Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset)
{
if (reloc.is<ELFRel*>())
return reloc.get<ELFRel*>()->Parse(data, offset);
@@ -270,28 +270,28 @@ ObjectFileELF::GetByteOrder() const
return eByteOrderInvalid;
}
-size_t
+uint32_t
ObjectFileELF::GetAddressByteSize() const
{
return m_data.GetAddressByteSize();
}
-unsigned
+size_t
ObjectFileELF::SectionIndex(const SectionHeaderCollIter &I)
{
- return std::distance(m_section_headers.begin(), I) + 1;
+ return std::distance(m_section_headers.begin(), I) + 1u;
}
-unsigned
+size_t
ObjectFileELF::SectionIndex(const SectionHeaderCollConstIter &I) const
{
- return std::distance(m_section_headers.begin(), I) + 1;
+ return std::distance(m_section_headers.begin(), I) + 1u;
}
bool
ObjectFileELF::ParseHeader()
{
- uint32_t offset = GetOffset();
+ lldb::offset_t offset = GetOffset();
return m_header.Parse(m_data, &offset);
}
@@ -445,8 +445,8 @@ ObjectFileELF::ParseDependentModules()
ReadSectionData(dynstr, dynstr_data))
{
ELFDynamic symbol;
- const unsigned section_size = dynsym_data.GetByteSize();
- unsigned offset = 0;
+ const lldb::offset_t section_size = dynsym_data.GetByteSize();
+ lldb::offset_t offset = 0;
// The only type of entries we are concerned with are tagged DT_NEEDED,
// yielding the name of a required library.
@@ -492,7 +492,7 @@ ObjectFileELF::ParseProgramHeaders()
return 0;
uint32_t idx;
- uint32_t offset;
+ lldb::offset_t offset;
for (idx = 0, offset = 0; idx < m_header.e_phnum; ++idx)
{
if (m_program_headers[idx].Parse(data, &offset) == false)
@@ -530,7 +530,7 @@ ObjectFileELF::ParseSectionHeaders()
return 0;
uint32_t idx;
- uint32_t offset;
+ lldb::offset_t offset;
for (idx = 0, offset = 0; idx < m_header.e_shnum; ++idx)
{
if (m_section_headers[idx].Parse(data, &offset) == false)
@@ -698,9 +698,8 @@ ParseSymbols(Symtab *symtab,
const DataExtractor &strtab_data)
{
ELFSymbol symbol;
- uint32_t offset = 0;
- const unsigned num_symbols =
- symtab_data.GetByteSize() / symtab_shdr->sh_entsize;
+ lldb::offset_t offset = 0;
+ const size_t num_symbols = symtab_data.GetByteSize() / symtab_shdr->sh_entsize;
static ConstString text_section_name(".text");
static ConstString init_section_name(".init");
@@ -877,8 +876,8 @@ ObjectFileELF::ParseDynamicSymbols()
DataExtractor dynsym_data;
if (ReadSectionData(dynsym, dynsym_data))
{
- const unsigned section_size = dynsym_data.GetByteSize();
- unsigned cursor = 0;
+ const lldb::offset_t section_size = dynsym_data.GetByteSize();
+ lldb::offset_t cursor = 0;
while (cursor < section_size)
{
@@ -956,9 +955,9 @@ ParsePLTRelocations(Symtab *symbol_table,
{
ELFRelocation rel(rel_type);
ELFSymbol symbol;
- uint32_t offset = 0;
- const unsigned plt_entsize = plt_hdr->sh_entsize;
- const unsigned num_relocations = rel_hdr->sh_size / rel_hdr->sh_entsize;
+ lldb::offset_t offset = 0;
+ const elf_xword plt_entsize = plt_hdr->sh_entsize;
+ const elf_xword num_relocations = rel_hdr->sh_size / rel_hdr->sh_entsize;
typedef unsigned (*reloc_info_fn)(const ELFRelocation &rel);
reloc_info_fn reloc_type;
@@ -985,7 +984,7 @@ ParsePLTRelocations(Symtab *symbol_table,
if (reloc_type(rel) != slot_type)
continue;
- unsigned symbol_offset = reloc_symbol(rel) * sym_hdr->sh_entsize;
+ lldb::offset_t symbol_offset = reloc_symbol(rel) * sym_hdr->sh_entsize;
uint64_t plt_index = (i + 1) * plt_entsize;
if (!symbol.Parse(symtab_data, &symbol_offset))
@@ -1378,7 +1377,7 @@ ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type)
// Dump an token value for the ELF section header member sh_flags
//----------------------------------------------------------------------
void
-ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, elf_word sh_flags)
+ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, elf_xword sh_flags)
{
*s << ((sh_flags & SHF_WRITE) ? "WRITE" : " ")
<< (((sh_flags & SHF_WRITE) && (sh_flags & SHF_ALLOC)) ? '+' : ' ')
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
index 9bf6d734e11..f347c7b3118 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -84,7 +84,7 @@ public:
virtual bool
IsExecutable () const;
- virtual size_t
+ virtual uint32_t
GetAddressByteSize() const;
virtual lldb_private::Symtab *
@@ -168,11 +168,11 @@ private:
lldb_private::Address m_entry_point_address;
/// Returns a 1 based index of the given section header.
- unsigned
+ size_t
SectionIndex(const SectionHeaderCollIter &I);
/// Returns a 1 based index of the given section header.
- unsigned
+ size_t
SectionIndex(const SectionHeaderCollConstIter &I) const;
/// Parses all section headers present in this object file and populates
@@ -282,7 +282,7 @@ private:
static void
DumpELFSectionHeader_sh_flags(lldb_private::Stream *s,
- elf::elf_word sh_flags);
+ elf::elf_xword sh_flags);
//@}
/// ELF dependent module dump routine.
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 926f17f6648..ce47b58a461 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -58,7 +58,7 @@ public:
void
SetRegisterDataFrom_LC_THREAD (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
SetError (GPRRegSet, Read, -1);
SetError (FPURegSet, Read, -1);
SetError (EXCRegSet, Read, -1);
@@ -166,7 +166,7 @@ public:
void
SetRegisterDataFrom_LC_THREAD (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
SetError (GPRRegSet, Read, -1);
SetError (FPURegSet, Read, -1);
SetError (EXCRegSet, Read, -1);
@@ -273,7 +273,7 @@ public:
void
SetRegisterDataFrom_LC_THREAD (const DataExtractor &data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
SetError (GPRRegSet, Read, -1);
SetError (FPURegSet, Read, -1);
SetError (EXCRegSet, Read, -1);
@@ -472,7 +472,7 @@ ObjectFileMachO::MagicBytesMatch (DataBufferSP& data_sp,
{
DataExtractor data;
data.SetData (data_sp, data_offset, data_length);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t magic = data.GetU32(&offset);
return MachHeaderSizeFromMagic(magic) != 0;
}
@@ -522,7 +522,7 @@ ObjectFileMachO::ParseHeader ()
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
bool can_parse = false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
m_data.SetByteOrder (lldb::endian::InlHostByteOrder());
// Leave magic in the original byte order
m_header.magic = m_data.GetU32(&offset);
@@ -612,7 +612,7 @@ ObjectFileMachO::IsExecutable() const
return m_header.filetype == HeaderFileTypeExecutable;
}
-size_t
+uint32_t
ObjectFileMachO::GetAddressByteSize () const
{
return m_data.GetAddressByteSize ();
@@ -769,7 +769,7 @@ ObjectFileMachO::ParseSections ()
{
lldb::user_id_t segID = 0;
lldb::user_id_t sectID = 0;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
const bool is_core = GetType() == eTypeCoreFile;
//bool dump_sections = false;
@@ -780,7 +780,7 @@ ObjectFileMachO::ParseSections ()
encryption_info_command encryption_cmd;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t load_cmd_offset = offset;
+ const lldb::offset_t load_cmd_offset = offset;
if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
break;
@@ -805,7 +805,7 @@ ObjectFileMachO::ParseSections ()
struct segment_command_64 load_cmd;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t load_cmd_offset = offset;
+ const lldb::offset_t load_cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
@@ -826,7 +826,7 @@ ObjectFileMachO::ParseSections ()
// get at data that isn't stored in the abstracted Sections.
m_mach_segments.push_back (load_cmd);
- ConstString segment_name (load_cmd.segname, std::min<int>(strlen(load_cmd.segname), sizeof(load_cmd.segname)));
+ ConstString segment_name (load_cmd.segname, std::min<size_t>(strlen(load_cmd.segname), sizeof(load_cmd.segname)));
// Use a segment ID of the segment index shifted left by 8 so they
// never conflict with any of the sections.
SectionSP segment_sp;
@@ -1209,14 +1209,14 @@ ObjectFileMachO::ParseSymtab (bool minimize)
struct linkedit_data_command function_starts_load_command = { 0, 0, 0, 0 };
typedef AddressDataArray<lldb::addr_t, bool, 100> FunctionStarts;
FunctionStarts function_starts;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SYMBOLS));
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
// Read in the load command and load command size
struct load_command lc;
if (m_data.GetU32(&offset, &lc, 2) == NULL)
@@ -1282,13 +1282,14 @@ ObjectFileMachO::ParseSymtab (bool minimize)
ProcessSP process_sp (m_process_wp.lock());
Process *process = process_sp.get();
- const size_t addr_byte_size = m_data.GetAddressByteSize();
+ const uint32_t addr_byte_size = m_data.GetAddressByteSize();
+ const ByteOrder byte_order = m_data.GetByteOrder();
bool bit_width_32 = addr_byte_size == 4;
const size_t nlist_byte_size = bit_width_32 ? sizeof(struct nlist) : sizeof(struct nlist_64);
- DataExtractor nlist_data (NULL, 0, m_data.GetByteOrder(), m_data.GetAddressByteSize());
- DataExtractor strtab_data (NULL, 0, m_data.GetByteOrder(), m_data.GetAddressByteSize());
- DataExtractor function_starts_data (NULL, 0, m_data.GetByteOrder(), m_data.GetAddressByteSize());
+ DataExtractor nlist_data (NULL, 0, byte_order, addr_byte_size);
+ DataExtractor strtab_data (NULL, 0, byte_order, addr_byte_size);
+ DataExtractor function_starts_data (NULL, 0, byte_order, addr_byte_size);
const addr_t nlist_data_byte_size = symtab_load_command.nsyms * nlist_byte_size;
const addr_t strtab_data_byte_size = symtab_load_command.strsize;
@@ -1420,7 +1421,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
{
FunctionStarts::Entry function_start_entry;
function_start_entry.data = false;
- uint32_t function_start_offset = 0;
+ lldb::offset_t function_start_offset = 0;
function_start_entry.addr = text_section_sp->GetFileAddress();
uint64_t delta;
while ((delta = function_starts_data.GetULEB128(&function_start_offset)) > 0)
@@ -1431,11 +1432,11 @@ ObjectFileMachO::ParseSymtab (bool minimize)
}
}
- const uint32_t function_starts_count = function_starts.GetSize();
+ const size_t function_starts_count = function_starts.GetSize();
- uint8_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NListSectionNoSection;
+ const user_id_t TEXT_eh_frame_sectID = eh_frame_section_sp.get() ? eh_frame_section_sp->GetID() : NListSectionNoSection;
- uint32_t nlist_data_offset = 0;
+ lldb::offset_t nlist_data_offset = 0;
uint32_t N_SO_index = UINT32_MAX;
@@ -1457,7 +1458,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
uint32_t sym_idx = 0;
Symbol *sym = NULL;
- uint32_t num_syms = 0;
+ size_t num_syms = 0;
std::string memory_symbol_name;
uint32_t unmapped_local_symbols_found = 0;
@@ -1547,7 +1548,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
if (DataBufferSP dsc_data_sp = dsc_filespec.MemoryMapFileContents(0, sizeof(struct lldb_copy_dyld_cache_header)))
{
- DataExtractor dsc_header_data(dsc_data_sp, m_data.GetByteOrder(), m_data.GetAddressByteSize());
+ DataExtractor dsc_header_data(dsc_data_sp, byte_order, addr_byte_size);
uint32_t offset = offsetof (struct lldb_copy_dyld_cache_header, mappingOffset);
uint32_t mappingOffset = dsc_header_data.GetU32(&offset);
@@ -1566,7 +1567,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
// Map the local symbols
if (DataBufferSP dsc_local_symbols_data_sp = dsc_filespec.MemoryMapFileContents(localSymbolsOffset, localSymbolsSize))
{
- DataExtractor dsc_local_symbols_data(dsc_local_symbols_data_sp, m_data.GetByteOrder(), m_data.GetAddressByteSize());
+ DataExtractor dsc_local_symbols_data(dsc_local_symbols_data_sp, byte_order, addr_byte_size);
offset = 0;
@@ -2382,7 +2383,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
const char *symbol_name_non_abi_mangled = NULL;
SectionSP symbol_section;
- uint32_t symbol_byte_size = 0;
+ lldb::addr_t symbol_byte_size = 0;
bool add_nlist = true;
bool is_debug = ((nlist.n_type & NlistMaskStab) != 0);
bool demangled_is_synthesized = false;
@@ -3191,7 +3192,7 @@ ObjectFileMachO::ParseSymtab (bool minimize)
{
const uint32_t symbol_stub_index = symbol_stub_index_offset + stub_idx;
const lldb::addr_t symbol_stub_addr = m_mach_sections[sect_idx].addr + (stub_idx * symbol_stub_byte_size);
- uint32_t symbol_stub_offset = symbol_stub_index * 4;
+ lldb::offset_t symbol_stub_offset = symbol_stub_index * 4;
if (indirect_symbol_index_data.ValidOffsetForDataOfSize(symbol_stub_offset, 4))
{
const uint32_t stub_sym_id = indirect_symbol_index_data.GetU32 (&symbol_stub_offset);
@@ -3299,11 +3300,11 @@ ObjectFileMachO::GetUUID (lldb_private::UUID* uuid)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct uuid_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
@@ -3346,7 +3347,7 @@ ObjectFileMachO::GetDependentModules (FileSpecList& files)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct load_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
const bool resolve_path = false; // Don't resolve the dependend file paths since they may not reside on this system
uint32_t i;
for (i=0; i<m_header.ncmds; ++i)
@@ -3419,14 +3420,14 @@ ObjectFileMachO::GetEntryPointAddress ()
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct load_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t i;
lldb::addr_t start_address = LLDB_INVALID_ADDRESS;
bool done = false;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
@@ -3563,7 +3564,7 @@ ObjectFileMachO::GetNumThreadContexts ()
if (!m_thread_context_offsets_valid)
{
m_thread_context_offsets_valid = true;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
FileRangeArray::Entry file_range;
thread_command thread_cmd;
for (uint32_t i=0; i<m_header.ncmds; ++i)
@@ -3729,13 +3730,13 @@ ObjectFileMachO::GetVersion (uint32_t *versions, uint32_t num_versions)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
struct dylib_command load_cmd;
- uint32_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
uint32_t version_cmd = 0;
uint64_t version = 0;
uint32_t i;
for (i=0; i<m_header.ncmds; ++i)
{
- const uint32_t cmd_offset = offset;
+ const lldb::offset_t cmd_offset = offset;
if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
index e6a4931de1d..6075bb53782 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
@@ -85,7 +85,7 @@ public:
virtual bool
IsExecutable () const;
- virtual size_t
+ virtual uint32_t
GetAddressByteSize () const;
virtual lldb::AddressClass
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 8447a88d1dc..6bfe69503e9 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -169,7 +169,7 @@ bool
ObjectFilePECOFF::MagicBytesMatch (DataBufferSP& dataSP)
{
DataExtractor data(dataSP, eByteOrderLittle, 4);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint16_t magic = data.GetU16 (&offset);
return magic == IMAGE_DOS_SIGNATURE;
}
@@ -206,7 +206,7 @@ ObjectFilePECOFF::ParseHeader ()
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
m_sect_headers.clear();
m_data.SetByteOrder (eByteOrderLittle);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (ParseDOSHeader())
{
@@ -239,7 +239,7 @@ ObjectFilePECOFF::IsExecutable() const
return (m_coff_header.flags & IMAGE_FILE_DLL) == 0;
}
-size_t
+uint32_t
ObjectFilePECOFF::GetAddressByteSize () const
{
if (m_coff_header_opt.magic == OPT_HEADER_MAGIC_PE32_PLUS)
@@ -271,7 +271,7 @@ bool
ObjectFilePECOFF::ParseDOSHeader ()
{
bool success = false;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
success = m_data.ValidOffsetForDataOfSize(0, sizeof(m_dos_header));
if (success)
@@ -326,7 +326,7 @@ ObjectFilePECOFF::ParseDOSHeader ()
// ParserCOFFHeader
//----------------------------------------------------------------------
bool
-ObjectFilePECOFF::ParseCOFFHeader(uint32_t* offset_ptr)
+ObjectFilePECOFF::ParseCOFFHeader(lldb::offset_t *offset_ptr)
{
bool success = m_data.ValidOffsetForDataOfSize (*offset_ptr, sizeof(m_coff_header));
if (success)
@@ -345,10 +345,10 @@ ObjectFilePECOFF::ParseCOFFHeader(uint32_t* offset_ptr)
}
bool
-ObjectFilePECOFF::ParseCOFFOptionalHeader(uint32_t* offset_ptr)
+ObjectFilePECOFF::ParseCOFFOptionalHeader(lldb::offset_t *offset_ptr)
{
bool success = false;
- const uint32_t end_offset = *offset_ptr + m_coff_header.hdrsize;
+ const lldb::offset_t end_offset = *offset_ptr + m_coff_header.hdrsize;
if (*offset_ptr < end_offset)
{
success = true;
@@ -429,7 +429,7 @@ ObjectFilePECOFF::ParseSectionHeaders (uint32_t section_header_data_offset)
DataBufferSP section_header_data_sp(m_file.ReadFileContents (section_header_data_offset, section_header_byte_size));
DataExtractor section_header_data (section_header_data_sp, GetByteOrder(), addr_byte_size);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (section_header_data.ValidOffsetForDataOfSize (offset, section_header_byte_size))
{
m_sect_headers.resize(nsects);
@@ -462,8 +462,8 @@ ObjectFilePECOFF::GetSectionName(std::string& sect_name, const section_header_t&
{
if (sect.name[0] == '/')
{
- uint32_t stroff = strtoul(&sect.name[1], NULL, 10);
- uint32_t string_file_offset = m_coff_header.symoff + (m_coff_header.nsyms * 18) + stroff;
+ lldb::offset_t stroff = strtoul(&sect.name[1], NULL, 10);
+ lldb::offset_t string_file_offset = m_coff_header.symoff + (m_coff_header.nsyms * 18) + stroff;
const char *name = m_data.GetCStr (&string_file_offset);
if (name)
{
@@ -503,7 +503,7 @@ ObjectFilePECOFF::GetSymtab()
// Include the 4 bytes string table size at the end of the symbols
DataBufferSP symtab_data_sp(m_file.ReadFileContents (m_coff_header.symoff, symbol_data_size + 4));
DataExtractor symtab_data (symtab_data_sp, GetByteOrder(), addr_byte_size);
- uint32_t offset = symbol_data_size;
+ lldb::offset_t offset = symbol_data_size;
const uint32_t strtab_size = symtab_data.GetU32 (&offset);
DataBufferSP strtab_data_sp(m_file.ReadFileContents (m_coff_header.symoff + symbol_data_size + 4, strtab_size));
DataExtractor strtab_data (strtab_data_sp, GetByteOrder(), addr_byte_size);
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
index 2e41ce4ff2b..446999c6c84 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
@@ -68,7 +68,7 @@ public:
virtual bool
IsExecutable () const;
- virtual size_t
+ virtual uint32_t
GetAddressByteSize () const;
// virtual lldb_private::AddressClass
@@ -212,8 +212,8 @@ protected:
} coff_symbol_t;
bool ParseDOSHeader ();
- bool ParseCOFFHeader (uint32_t* offset_ptr);
- bool ParseCOFFOptionalHeader (uint32_t* offset_ptr);
+ bool ParseCOFFHeader (lldb::offset_t *offset_ptr);
+ bool ParseCOFFOptionalHeader (lldb::offset_t *offset_ptr);
bool ParseSectionHeaders (uint32_t offset);
static void DumpDOSHeader(lldb_private::Stream *s, const dos_header_t& header);
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index ddc5467ffe9..d867c891b33 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -215,30 +215,33 @@ OperatingSystemPython::CreateThreadFromThreadInfo (PythonDictionary &thread_dict
if (thread_dict)
{
PythonString tid_pystr("tid");
- PythonString name_pystr("name");
- PythonString queue_pystr("queue");
- PythonString state_pystr("state");
- PythonString stop_reason_pystr("stop_reason");
- PythonString reg_data_addr_pystr ("register_data_addr");
-
const tid_t tid = thread_dict.GetItemForKeyAsInteger (tid_pystr, LLDB_INVALID_THREAD_ID);
- const addr_t reg_data_addr = thread_dict.GetItemForKeyAsInteger (reg_data_addr_pystr, LLDB_INVALID_ADDRESS);
- const char *name = thread_dict.GetItemForKeyAsString (name_pystr);
- const char *queue = thread_dict.GetItemForKeyAsString (queue_pystr);
- //const char *state = thread_dict.GetItemForKeyAsString (state_pystr);
- //const char *stop_reason = thread_dict.GetItemForKeyAsString (stop_reason_pystr);
-
- if (old_thread_list_ptr)
- thread_sp = old_thread_list_ptr->FindThreadByID (tid, false);
- if (!thread_sp)
+ if (tid != LLDB_INVALID_THREAD_ID)
{
- if (did_create_ptr)
- *did_create_ptr = true;
- thread_sp.reset (new ThreadMemory (*m_process,
- tid,
- name,
- queue,
- reg_data_addr));
+ PythonString name_pystr("name");
+ PythonString queue_pystr("queue");
+ PythonString state_pystr("state");
+ PythonString stop_reason_pystr("stop_reason");
+ PythonString reg_data_addr_pystr ("register_data_addr");
+
+ const addr_t reg_data_addr = thread_dict.GetItemForKeyAsInteger (reg_data_addr_pystr, LLDB_INVALID_ADDRESS);
+ const char *name = thread_dict.GetItemForKeyAsString (name_pystr);
+ const char *queue = thread_dict.GetItemForKeyAsString (queue_pystr);
+ //const char *state = thread_dict.GetItemForKeyAsString (state_pystr);
+ //const char *stop_reason = thread_dict.GetItemForKeyAsString (stop_reason_pystr);
+
+ if (old_thread_list_ptr)
+ thread_sp = old_thread_list_ptr->FindThreadByID (tid, false);
+ if (!thread_sp)
+ {
+ if (did_create_ptr)
+ *did_create_ptr = true;
+ thread_sp.reset (new ThreadMemory (*m_process,
+ tid,
+ name,
+ queue,
+ reg_data_addr));
+ }
}
}
return thread_sp;
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
index 8e658a50022..32b77ab5d08 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -122,7 +122,7 @@ CommunicationKDP::SendRequestAndGetReply (const CommandType command,
{
if (WaitForPacketWithTimeoutMicroSecondsNoLock (reply_packet, GetPacketTimeoutInMicroSeconds ()))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const uint8_t reply_command = reply_packet.GetU8 (&offset);
const uint8_t reply_sequence_id = reply_packet.GetU8 (&offset);
if ((reply_command & eCommandTypeMask) == command)
@@ -273,7 +273,7 @@ CommunicationKDP::CheckForPacket (const uint8_t *src, size_t src_len, DataExtrac
if (bytes_available >= 8)
{
packet.SetData (&m_bytes[0], bytes_available, m_byte_order);
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint8_t reply_command = packet.GetU8(&offset);
switch (reply_command)
{
@@ -406,7 +406,7 @@ CommunicationKDP::SendRequestReattach (uint16_t reply_port)
{
// Reset the sequence ID to zero for reattach
ClearKDPSettings ();
- uint32_t offset = 4;
+ lldb::offset_t offset = 4;
m_session_key = reply_packet.GetU32 (&offset);
return true;
}
@@ -440,7 +440,7 @@ CommunicationKDP::SendRequestVersion ()
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
m_kdp_version_version = reply_packet.GetU32 (&offset);
m_kdp_version_feature = reply_packet.GetU32 (&offset);
return true;
@@ -568,7 +568,7 @@ CommunicationKDP::SendRequestHostInfo ()
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
m_kdp_hostinfo_cpu_mask = reply_packet.GetU32 (&offset);
m_kdp_hostinfo_cpu_type = reply_packet.GetU32 (&offset);
m_kdp_hostinfo_cpu_subtype = reply_packet.GetU32 (&offset);
@@ -648,7 +648,7 @@ CommunicationKDP::SendRequestReadMemory (lldb::addr_t addr,
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
uint32_t src_len = reply_packet.GetByteSize() - 12;
@@ -696,7 +696,7 @@ CommunicationKDP::SendRequestWriteMemory (lldb::addr_t addr,
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error)
error.SetErrorStringWithFormat ("kdp write memory failed (error %u)", kdp_error);
@@ -730,7 +730,7 @@ CommunicationKDP::SendRawRequest (uint8_t command_byte,
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error)
error.SetErrorStringWithFormat ("request packet 0x%8.8x failed (error %u)", command_byte, kdp_error);
@@ -799,7 +799,7 @@ CommunicationKDP::DumpPacket (Stream &s, const DataExtractor& packet)
}
else
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const uint8_t first_packet_byte = packet.GetU8 (&offset);
const uint8_t sequence_id = packet.GetU8 (&offset);
const uint16_t length = packet.GetU16 (&offset);
@@ -1152,7 +1152,7 @@ CommunicationKDP::SendRequestReadRegisters (uint32_t cpu,
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
uint32_t src_len = reply_packet.GetByteSize() - 12;
@@ -1200,7 +1200,7 @@ CommunicationKDP::SendRequestWriteRegisters (uint32_t cpu,
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error == 0)
return src_len;
@@ -1247,7 +1247,7 @@ CommunicationKDP::SendRequestBreakpoint (bool set, addr_t addr)
DataExtractor reply_packet;
if (SendRequestAndGetReply (command, request_sequence_id, request_packet, reply_packet))
{
- uint32_t offset = 8;
+ lldb::offset_t offset = 8;
uint32_t kdp_error = reply_packet.GetU32 (&offset);
if (kdp_error == 0)
return true;
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
index 920fccf351c..33c5e47d0b2 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
@@ -194,7 +194,7 @@ ThreadKDP::GetPrivateStopReason ()
void
ThreadKDP::SetStopInfoFrom_KDP_EXCEPTION (const DataExtractor &exc_reply_packet)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint8_t reply_command = exc_reply_packet.GetU8(&offset);
if (reply_command == CommunicationKDP::KDP_EXCEPTION)
{
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
index eacdef1fe1d..4d77b6f20fd 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -416,7 +416,7 @@ RegisterContextDarwin_arm::GetRegisterCount ()
}
const RegisterInfo *
-RegisterContextDarwin_arm::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextDarwin_arm::GetRegisterInfoAtIndex (size_t reg)
{
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
@@ -464,7 +464,7 @@ RegisterContextDarwin_arm::GetRegisterSetCount ()
}
const RegisterSet *
-RegisterContextDarwin_arm::GetRegisterSet (uint32_t reg_set)
+RegisterContextDarwin_arm::GetRegisterSet (size_t reg_set)
{
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
index b8e91b7b19b..75832c8f85c 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
@@ -64,13 +64,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t set);
+ GetRegisterSet (size_t set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info,
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
index f07dbffd1ff..a94d1f538a2 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
@@ -298,7 +298,7 @@ RegisterContextDarwin_i386::GetRegisterCount ()
}
const RegisterInfo *
-RegisterContextDarwin_i386::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextDarwin_i386::GetRegisterInfoAtIndex (size_t reg)
{
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
@@ -410,7 +410,7 @@ RegisterContextDarwin_i386::GetRegisterSetCount ()
}
const RegisterSet *
-RegisterContextDarwin_i386::GetRegisterSet (uint32_t reg_set)
+RegisterContextDarwin_i386::GetRegisterSet (size_t reg_set)
{
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
index e2cde590a91..a588494f9dc 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
@@ -34,13 +34,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t set);
+ GetRegisterSet (size_t set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
index 7d97dbd3e41..433782fe20c 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
@@ -336,7 +336,7 @@ RegisterContextDarwin_x86_64::GetRegisterCount ()
const RegisterInfo *
-RegisterContextDarwin_x86_64::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextDarwin_x86_64::GetRegisterInfoAtIndex (size_t reg)
{
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
@@ -457,7 +457,7 @@ RegisterContextDarwin_x86_64::GetRegisterSetCount ()
}
const RegisterSet *
-RegisterContextDarwin_x86_64::GetRegisterSet (uint32_t reg_set)
+RegisterContextDarwin_x86_64::GetRegisterSet (size_t reg_set)
{
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
index a36b8cb8731..4b8127af997 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
@@ -33,13 +33,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t set);
+ GetRegisterSet (size_t set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index fa8dcd3d179..cb691c552f1 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -760,7 +760,7 @@ RegisterContextLLDB::GetRegisterCount ()
}
const RegisterInfo *
-RegisterContextLLDB::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextLLDB::GetRegisterInfoAtIndex (size_t reg)
{
return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex (reg);
}
@@ -772,7 +772,7 @@ RegisterContextLLDB::GetRegisterSetCount ()
}
const RegisterSet *
-RegisterContextLLDB::GetRegisterSet (uint32_t reg_set)
+RegisterContextLLDB::GetRegisterSet (size_t reg_set)
{
return m_thread.GetRegisterContext()->GetRegisterSet (reg_set);
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h
index 1b60996dfb5..572d119446f 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h
@@ -46,13 +46,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
index 6cfad1eb0dd..2c3eee45248 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
@@ -59,7 +59,7 @@ RegisterContextMacOSXFrameBackchain::GetRegisterCount ()
}
const RegisterInfo *
-RegisterContextMacOSXFrameBackchain::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextMacOSXFrameBackchain::GetRegisterInfoAtIndex (size_t reg)
{
return m_thread.GetRegisterContext()->GetRegisterInfoAtIndex(reg);
}
@@ -73,7 +73,7 @@ RegisterContextMacOSXFrameBackchain::GetRegisterSetCount ()
const RegisterSet *
-RegisterContextMacOSXFrameBackchain::GetRegisterSet (uint32_t reg_set)
+RegisterContextMacOSXFrameBackchain::GetRegisterSet (size_t reg_set)
{
return m_thread.GetRegisterContext()->GetRegisterSet (reg_set);
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h
index cc6cb5d5d8c..449e053e5ef 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h
@@ -42,13 +42,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp
index 9f8e2b56ca7..8c33a6814ac 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp
@@ -80,7 +80,7 @@ RegisterContextMemory::GetRegisterCount ()
}
const RegisterInfo *
-RegisterContextMemory::GetRegisterInfoAtIndex (uint32_t reg)
+RegisterContextMemory::GetRegisterInfoAtIndex (size_t reg)
{
return m_reg_infos.GetRegisterInfoAtIndex (reg);
}
@@ -92,7 +92,7 @@ RegisterContextMemory::GetRegisterSetCount ()
}
const RegisterSet *
-RegisterContextMemory::GetRegisterSet (uint32_t reg_set)
+RegisterContextMemory::GetRegisterSet (size_t reg_set)
{
return m_reg_infos.GetRegisterSet (reg_set);
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h
index 062f27aa9b4..8bba52c627f 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h
@@ -46,13 +46,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual uint32_t
ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num);
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 921d08eaa65..c5e86736f96 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -85,7 +85,7 @@ GDBRemoteRegisterContext::GetRegisterCount ()
}
const RegisterInfo *
-GDBRemoteRegisterContext::GetRegisterInfoAtIndex (uint32_t reg)
+GDBRemoteRegisterContext::GetRegisterInfoAtIndex (size_t reg)
{
return m_reg_info.GetRegisterInfoAtIndex (reg);
}
@@ -99,7 +99,7 @@ GDBRemoteRegisterContext::GetRegisterSetCount ()
const RegisterSet *
-GDBRemoteRegisterContext::GetRegisterSet (uint32_t reg_set)
+GDBRemoteRegisterContext::GetRegisterSet (size_t reg_set)
{
return m_reg_info.GetRegisterSet (reg_set);
}
@@ -857,7 +857,7 @@ GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch)
static ConstString gpr_reg_set ("General Purpose Registers");
static ConstString sfp_reg_set ("Software Floating Point Registers");
static ConstString vfp_reg_set ("Floating Point Registers");
- uint32_t i;
+ size_t i;
if (from_scratch)
{
// Calculate the offsets of the registers
@@ -905,8 +905,8 @@ GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch)
else
{
// Add composite registers to our primordial registers, then.
- const uint32_t num_composites = llvm::array_lengthof(g_composites);
- const uint32_t num_primordials = GetNumRegisters();
+ const size_t num_composites = llvm::array_lengthof(g_composites);
+ const size_t num_primordials = GetNumRegisters();
RegisterInfo *g_comp_register_infos = g_register_infos + (num_registers - num_composites);
for (i=0; i<num_composites; ++i)
{
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
index d052449e9b0..3110ddf8edf 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
@@ -51,7 +51,7 @@ public:
lldb_private::ConstString &reg_alt_name,
lldb_private::ConstString &set_name)
{
- const uint32_t reg_num = m_regs.size();
+ const uint32_t reg_num = (uint32_t)m_regs.size();
m_reg_names.push_back (reg_name);
m_reg_alt_names.push_back (reg_alt_name);
reg_info.name = reg_name.AsCString();
@@ -73,7 +73,7 @@ public:
reg_info.invalidate_regs = m_invalidate_regs_map[reg_num].data();
}
m_regs.push_back (reg_info);
- uint32_t set = GetRegisterSetIndexByName (set_name, true);
+ uint32_t set = GetRegisterSetIndexByName (set_name);
assert (set < m_sets.size());
assert (set < m_set_reg_nums.size());
assert (set < m_set_names.size());
@@ -129,20 +129,20 @@ public:
}
uint32_t
- GetRegisterSetIndexByName (lldb_private::ConstString &set_name, bool can_create)
+ GetRegisterSetIndexByName (lldb_private::ConstString &set_name)
{
name_collection::iterator pos, end = m_set_names.end();
for (pos = m_set_names.begin(); pos != end; ++pos)
{
if (*pos == set_name)
- return std::distance (m_set_names.begin(), pos);
+ return static_cast<uint32_t>(std::distance (m_set_names.begin(), pos));
}
m_set_names.push_back(set_name);
m_set_reg_nums.resize(m_set_reg_nums.size()+1);
lldb_private::RegisterSet new_set = { set_name.AsCString(), NULL, 0, NULL };
m_sets.push_back (new_set);
- return m_sets.size() - 1;
+ return static_cast<uint32_t>(m_sets.size() - 1);
}
uint32_t
@@ -152,7 +152,7 @@ public:
for (pos = m_regs.begin(); pos != end; ++pos)
{
if (pos->kinds[kind] == num)
- return std::distance (m_regs.begin(), pos);
+ return static_cast<uint32_t>(std::distance (m_regs.begin(), pos));
}
return LLDB_INVALID_REGNUM;
@@ -217,13 +217,13 @@ public:
GetRegisterCount ();
virtual const lldb_private::RegisterInfo *
- GetRegisterInfoAtIndex (uint32_t reg);
+ GetRegisterInfoAtIndex (size_t reg);
virtual size_t
GetRegisterSetCount ();
virtual const lldb_private::RegisterSet *
- GetRegisterSet (uint32_t reg_set);
+ GetRegisterSet (size_t reg_set);
virtual bool
ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value);
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 07ced0df798..bdeb8671857 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -596,7 +596,7 @@ ProcessGDBRemote::CheckForKernel (Stream *strm)
DataExtractor data4 (buf, sizeof(buf), gdb_remote_arch.GetByteOrder(), 4);
if (DoReadMemory (0xffff0110, buf, 4, error) == 4)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
kernel_addr = data4.GetU32(&offset);
memory_module_sp = ReadModuleFromMemory (FileSpec("mach_kernel", false), kernel_addr, false, false);
if (!memory_module_sp.get()
@@ -616,7 +616,7 @@ ProcessGDBRemote::CheckForKernel (Stream *strm)
DataExtractor data8 (buf, sizeof(buf), gdb_remote_arch.GetByteOrder(), 8);
if (DoReadMemory (0xffffff8000002010ULL, buf, 8, error) == 8)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
kernel_addr = data8.GetU64(&offset);
memory_module_sp = ReadModuleFromMemory (FileSpec("mach_kernel", false), kernel_addr, false, false);
if (!memory_module_sp.get()
@@ -3041,7 +3041,7 @@ ProcessGDBRemote::GetDispatchQueueNameForThread
Error error;
if (ReadMemory (m_dispatch_queue_offsets_addr, memory_buffer, sizeof(dispatch_queue_offsets), error) == sizeof(dispatch_queue_offsets))
{
- uint32_t data_offset = 0;
+ lldb::offset_t data_offset = 0;
if (data.GetU16(&data_offset, &dispatch_queue_offsets.dqo_version, sizeof(dispatch_queue_offsets)/sizeof(uint16_t)))
{
if (ReadMemory (thread_dispatch_qaddr, &memory_buffer, data.GetAddressByteSize(), error) == data.GetAddressByteSize())
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
index 989e49452fb..06e87eab33c 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
@@ -32,13 +32,13 @@ DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag, uint8_t
}
bool
-DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, uint32_t* offset_ptr)
+DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, lldb::offset_t* offset_ptr)
{
return Extract(data, offset_ptr, data.GetULEB128(offset_ptr));
}
bool
-DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, uint32_t* offset_ptr, dw_uleb128_t code)
+DWARFAbbreviationDeclaration::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code)
{
m_code = code;
m_attributes.clear();
@@ -155,7 +155,7 @@ DWARFAbbreviationDeclaration::CopyChangingStringToStrp(
dw_attr_t attr;
dw_form_t form;
uint32_t i;
- dw_offset_t offset = debug_info_offset;
+ lldb::offset_t offset = debug_info_offset;
for (i = 0; i < num_abbr_decl_attributes; ++i)
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
index f748ab141af..f462b7fc108 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
@@ -32,7 +32,7 @@ public:
void SetCode(dw_uleb128_t code) { m_code = code; }
dw_tag_t Tag() const { return m_tag; }
bool HasChildren() const { return m_has_children; }
- uint32_t NumAttributes() const { return m_attributes.size(); }
+ size_t NumAttributes() const { return m_attributes.size(); }
dw_attr_t GetAttrByIndex(uint32_t idx) const { return m_attributes.size() > idx ? m_attributes[idx].get_attr() : 0; }
dw_form_t GetFormByIndex(uint32_t idx) const { return m_attributes.size() > idx ? m_attributes[idx].get_form() : 0; }
bool GetAttrAndFormByIndex(uint32_t idx, dw_attr_t& attr, dw_form_t& form) const
@@ -63,8 +63,8 @@ public:
const DWARFCompileUnit* cu,
const uint32_t strp_min_len);
uint32_t FindAttributeIndex(dw_attr_t attr) const;
- bool Extract(const lldb_private::DataExtractor& data, uint32_t* offset_ptr);
- bool Extract(const lldb_private::DataExtractor& data, uint32_t* offset_ptr, dw_uleb128_t code);
+ bool Extract(const lldb_private::DataExtractor& data, lldb::offset_t *offset_ptr);
+ bool Extract(const lldb_private::DataExtractor& data, lldb::offset_t *offset_ptr, dw_uleb128_t code);
// void Append(BinaryStreamBuf& out_buff) const;
bool IsValid();
void Dump(lldb_private::Stream *s) const;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
index 2d875875e1e..8310b1dda5f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
@@ -25,12 +25,12 @@ public:
void set_attr(dw_attr_t attr) { m_attr_form = (m_attr_form & 0x0000ffffu) | (attr << 16); }
void set_form(dw_form_t form) { m_attr_form = (m_attr_form & 0xffff0000u) | form; }
dw_attr_t get_attr() const { return m_attr_form >> 16; }
- dw_form_t get_form() const { return m_attr_form; }
+ dw_form_t get_form() const { return (dw_form_t)m_attr_form; }
void get(dw_attr_t& attr, dw_form_t& form) const
{
register uint32_t attr_form = m_attr_form;
attr = attr_form >> 16;
- form = attr_form;
+ form = (dw_form_t)attr_form;
}
bool operator == (const DWARFAttribute& rhs) const { return m_attr_form == rhs.m_attr_form; }
typedef std::vector<DWARFAttribute> collection;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
index 08a022f8e68..5d93d194056 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -68,7 +68,7 @@ DWARFCompileUnit::Clear()
}
bool
-DWARFCompileUnit::Extract(const DataExtractor &debug_info, uint32_t* offset_ptr)
+DWARFCompileUnit::Extract(const DataExtractor &debug_info, lldb::offset_t *offset_ptr)
{
Clear();
@@ -103,7 +103,7 @@ DWARFCompileUnit::Extract(const DataExtractor &debug_info, uint32_t* offset_ptr)
dw_offset_t
-DWARFCompileUnit::Extract(dw_offset_t offset, const DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs)
+DWARFCompileUnit::Extract(lldb::offset_t offset, const DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs)
{
Clear();
@@ -167,8 +167,8 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (bool cu_die_only)
// Set the offset to that of the first DIE and calculate the start of the
// next compilation unit header.
- uint32_t offset = GetFirstDIEOffset();
- uint32_t next_cu_offset = GetNextCompileUnitOffset();
+ lldb::offset_t offset = GetFirstDIEOffset();
+ lldb::offset_t next_cu_offset = GetNextCompileUnitOffset();
DWARFDebugInfoEntry die;
// Keep a flat array of the DIE for binary lookup by DIE offset
@@ -273,7 +273,7 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (bool cu_die_only)
// unit header).
if (offset > next_cu_offset)
{
- m_dwarf2Data->GetObjectFile()->GetModule()->ReportWarning ("DWARF compile unit extends beyond its bounds cu 0x%8.8x at 0x%8.8x\n",
+ m_dwarf2Data->GetObjectFile()->GetModule()->ReportWarning ("DWARF compile unit extends beyond its bounds cu 0x%8.8x at 0x%8.8" PRIx64 "\n",
GetOffset(),
offset);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
index c400497f0b2..acbbdf1c2a6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
@@ -29,8 +29,8 @@ public:
DWARFCompileUnit(SymbolFileDWARF* dwarf2Data);
- bool Extract(const lldb_private::DataExtractor &debug_info, uint32_t* offset_ptr);
- dw_offset_t Extract(dw_offset_t offset, const lldb_private::DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs);
+ bool Extract(const lldb_private::DataExtractor &debug_info, lldb::offset_t *offset_ptr);
+ dw_offset_t Extract(lldb::offset_t offset, const lldb_private::DataExtractor& debug_info_data, const DWARFAbbreviationDeclarationSet* abbrevs);
size_t ExtractDIEsIfNeeded (bool cu_die_only);
bool LookupAddress(
const dw_addr_t address,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
index fcf20c1cf48..47657d5089b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
@@ -30,9 +30,9 @@ DWARFAbbreviationDeclarationSet::Clear()
// DWARFAbbreviationDeclarationSet::Extract()
//----------------------------------------------------------------------
bool
-DWARFAbbreviationDeclarationSet::Extract(const DataExtractor& data, uint32_t* offset_ptr)
+DWARFAbbreviationDeclarationSet::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr)
{
- const uint32_t begin_offset = *offset_ptr;
+ const lldb::offset_t begin_offset = *offset_ptr;
m_offset = begin_offset;
Clear();
DWARFAbbreviationDeclaration abbrevDeclaration;
@@ -144,7 +144,7 @@ DWARFDebugAbbrev::DWARFDebugAbbrev() :
void
DWARFDebugAbbrev::Parse(const DataExtractor& data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (data.ValidOffset(offset))
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
index 98bddd99c98..eba439928a2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
@@ -43,7 +43,7 @@ public:
void Clear();
dw_offset_t GetOffset() const { return m_offset; }
void Dump(lldb_private::Stream *s) const;
- bool Extract(const lldb_private::DataExtractor& data, uint32_t* offset_ptr);
+ bool Extract(const lldb_private::DataExtractor& data, lldb::offset_t *offset_ptr);
//void Encode(BinaryStreamBuf& debug_abbrev_buf) const;
dw_uleb128_t AppendAbbrevDeclSequential(const DWARFAbbreviationDeclaration& abbrevDecl);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
index 81dc58cc312..b1eb27299ef 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
@@ -162,7 +162,7 @@ DWARFDebugArangeSet::AddDescriptor(const DWARFDebugArangeSet::Descriptor& range)
}
bool
-DWARFDebugArangeSet::Extract(const DataExtractor &data, uint32_t* offset_ptr)
+DWARFDebugArangeSet::Extract(const DataExtractor &data, lldb::offset_t *offset_ptr)
{
if (data.ValidOffset(*offset_ptr))
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
index 5c1c44e50dd..19ec8d042e7 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
@@ -41,12 +41,12 @@ public:
void SetHeader(uint16_t version, uint32_t cu_offset, uint8_t addr_size, uint8_t seg_size);
void AddDescriptor(const DWARFDebugArangeSet::Descriptor& range);
void Compact();
- bool Extract(const lldb_private::DataExtractor &data, uint32_t* offset_ptr);
+ bool Extract(const lldb_private::DataExtractor &data, lldb::offset_t *offset_ptr);
void Dump(lldb_private::Stream *s) const;
dw_offset_t GetCompileUnitDIEOffset() const { return m_header.cu_offset; }
dw_offset_t GetOffsetOfNextEntry() const;
dw_offset_t FindAddress(dw_addr_t address) const;
- uint32_t NumDescriptors() const { return m_arange_descriptors.size(); }
+ size_t NumDescriptors() const { return m_arange_descriptors.size(); }
const Header& GetHeader() const { return m_header; }
const Descriptor* GetDescriptor(uint32_t i) const
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index 94519a472f1..bcf62b88fef 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -60,7 +60,7 @@ DWARFDebugAranges::Extract(const DataExtractor &debug_aranges_data)
{
if (debug_aranges_data.ValidOffset(0))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
DWARFDebugArangeSet set;
Range range;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
index e17a37da542..88db929226a 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
@@ -66,7 +66,7 @@ public:
{
return m_aranges.IsEmpty();
}
- uint32_t
+ size_t
GetNumRanges() const
{
return m_aranges.GetSize();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 5395a6adae7..2015b2441f1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -73,10 +73,9 @@ DWARFDebugInfo::GetCompileUnitAranges ()
log->Printf ("DWARFDebugInfo::GetCompileUnitAranges() for \"%s/%s\" by parsing",
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetDirectory().GetCString(),
m_dwarf2Data->GetObjectFile()->GetFileSpec().GetFilename().GetCString());
- const uint32_t num_compile_units = GetNumCompileUnits();
- uint32_t idx;
+ const size_t num_compile_units = GetNumCompileUnits();
const bool clear_dies_if_already_not_parsed = true;
- for (idx = 0; idx < num_compile_units; ++idx)
+ for (size_t idx = 0; idx < num_compile_units; ++idx)
{
DWARFCompileUnit* cu = GetCompileUnitAtIndex(idx);
if (cu)
@@ -148,7 +147,7 @@ DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded()
{
if (m_dwarf2Data != NULL)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
const DataExtractor &debug_info_data = m_dwarf2Data->get_debug_info_data();
while (debug_info_data.ValidOffset(offset))
{
@@ -168,7 +167,7 @@ DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded()
}
}
-uint32_t
+size_t
DWARFDebugInfo::GetNumCompileUnits()
{
ParseCompileUnitHeadersIfNeeded();
@@ -395,7 +394,7 @@ DWARFDebugInfo::Parse(SymbolFileDWARF* dwarf2Data, Callback callback, void* user
{
if (dwarf2Data)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
uint32_t depth = 0;
DWARFCompileUnitSP cu(new DWARFCompileUnit(dwarf2Data));
if (cu.get() == NULL)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
index b9010cdefaa..c716fa423ff 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
@@ -45,7 +45,7 @@ public:
DWARFDebugInfoEntry** block_die);
void AddCompileUnit(DWARFCompileUnitSP& cu);
- uint32_t GetNumCompileUnits();
+ size_t GetNumCompileUnits();
bool ContainsCompileUnit (const DWARFCompileUnit *cu) const;
DWARFCompileUnit* GetCompileUnitAtIndex(uint32_t idx);
DWARFCompileUnitSP GetCompileUnit(dw_offset_t cu_offset, uint32_t* idx_ptr = NULL);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 5411ee59bb4..949d6d08488 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -89,7 +89,7 @@ bool
DWARFDebugInfoEntry::Attributes::ExtractFormValueAtIndex (SymbolFileDWARF* dwarf2Data, uint32_t i, DWARFFormValue &form_value) const
{
form_value.SetForm(FormAtIndex(i));
- dw_offset_t offset = DIEOffsetAtIndex(i);
+ lldb::offset_t offset = DIEOffsetAtIndex(i);
return form_value.ExtractValue(dwarf2Data->get_debug_info_data(), &offset, CompileUnitAtIndex(i));
}
@@ -119,7 +119,7 @@ DWARFDebugInfoEntry::FastExtract
const DataExtractor& debug_info_data,
const DWARFCompileUnit* cu,
const uint8_t *fixed_form_sizes,
- uint32_t* offset_ptr
+ lldb::offset_t *offset_ptr
)
{
m_offset = *offset_ptr;
@@ -134,7 +134,7 @@ DWARFDebugInfoEntry::FastExtract
if (m_abbr_idx)
{
- uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
const DWARFAbbreviationDeclaration *abbrevDecl = cu->GetAbbreviations()->GetAbbreviationDeclaration(m_abbr_idx);
@@ -273,14 +273,14 @@ DWARFDebugInfoEntry::Extract
(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- uint32_t* offset_ptr
+ lldb::offset_t *offset_ptr
)
{
const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data();
// const DataExtractor& debug_str_data = dwarf2Data->get_debug_str_data();
const uint32_t cu_end_offset = cu->GetNextCompileUnitOffset();
const uint8_t cu_addr_size = cu->GetAddressByteSize();
- uint32_t offset = *offset_ptr;
+ lldb::offset_t offset = *offset_ptr;
// if (offset >= cu_end_offset)
// Log::Error("DIE at offset 0x%8.8x is beyond the end of the current compile unit (0x%8.8x)", m_offset, cu_end_offset);
if ((offset < cu_end_offset) && debug_info_data.ValidOffset(offset))
@@ -745,12 +745,12 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges
if (dwarf2Data == NULL)
return false;
- dw_addr_t lo_pc = DW_INVALID_ADDRESS;
- dw_addr_t hi_pc = DW_INVALID_ADDRESS;
+ dw_addr_t lo_pc = LLDB_INVALID_ADDRESS;
+ dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
std::vector<dw_offset_t> die_offsets;
bool set_frame_base_loclist_addr = false;
- dw_offset_t offset;
+ lldb::offset_t offset;
const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
if (abbrevDecl)
@@ -859,7 +859,7 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges
if (loc_list_length > 0)
{
frame_base->SetOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length);
- if (lo_pc != DW_INVALID_ADDRESS)
+ if (lo_pc != LLDB_INVALID_ADDRESS)
{
assert (lo_pc >= cu->GetBaseAddress());
frame_base->SetLocationListSlide(lo_pc - cu->GetBaseAddress());
@@ -882,9 +882,9 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges
if (ranges.IsEmpty())
{
- if (lo_pc != DW_INVALID_ADDRESS)
+ if (lo_pc != LLDB_INVALID_ADDRESS)
{
- if (hi_pc != DW_INVALID_ADDRESS && hi_pc > lo_pc)
+ if (hi_pc != LLDB_INVALID_ADDRESS && hi_pc > lo_pc)
ranges.Append(DWARFDebugRanges::Range (lo_pc, hi_pc - lo_pc));
else
ranges.Append(DWARFDebugRanges::Range (lo_pc, 0));
@@ -934,7 +934,7 @@ DWARFDebugInfoEntry::Dump
) const
{
const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data();
- uint32_t offset = m_offset;
+ lldb::offset_t offset = m_offset;
if (debug_info_data.ValidOffset(offset))
{
@@ -1028,7 +1028,7 @@ DWARFDebugInfoEntry::DumpAttribute
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
const DataExtractor& debug_info_data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
Stream &s,
dw_attr_t attr,
dw_form_t form
@@ -1158,7 +1158,7 @@ DWARFDebugInfoEntry::DumpAttribute
{
if ( !verbose )
form_value.Dump(s, debug_str_data, cu);
- uint32_t ranges_offset = form_value.Unsigned();
+ lldb::offset_t ranges_offset = form_value.Unsigned();
dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0;
if (dwarf2Data)
DWARFDebugRanges::Dump(s, dwarf2Data->get_debug_ranges_data(), &ranges_offset, base_addr);
@@ -1190,7 +1190,7 @@ DWARFDebugInfoEntry::GetAttributes
uint32_t curr_depth
) const
{
- uint32_t offset;
+ lldb::offset_t offset;
const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
if (abbrevDecl)
@@ -1287,7 +1287,7 @@ DWARFDebugInfoEntry::GetAttributeValue
dw_offset_t* end_attr_offset_ptr
) const
{
- uint32_t offset;
+ lldb::offset_t offset;
const DWARFAbbreviationDeclaration* abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
if (abbrevDecl)
@@ -1438,7 +1438,7 @@ DWARFDebugInfoEntry::GetAttributeValueAsLocation
// We have a location list offset as the value that is
// the offset into the .debug_loc section that describes
// the value over it's lifetime
- dw_offset_t debug_loc_offset = form_value.Unsigned();
+ lldb::offset_t debug_loc_offset = form_value.Unsigned();
if (dwarf2Data)
{
assert(dwarf2Data->get_debug_loc_data().GetAddressByteSize() == cu->GetAddressByteSize());
@@ -1553,7 +1553,7 @@ DWARFDebugInfoEntry::GetName
(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- const uint32_t die_offset,
+ const dw_offset_t die_offset,
Stream &s
)
{
@@ -1564,7 +1564,7 @@ DWARFDebugInfoEntry::GetName
}
DWARFDebugInfoEntry die;
- uint32_t offset = die_offset;
+ lldb::offset_t offset = die_offset;
if (die.Extract(dwarf2Data, cu, &offset))
{
if (die.IsNULL())
@@ -1602,7 +1602,7 @@ DWARFDebugInfoEntry::AppendTypeName
(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- const uint32_t die_offset,
+ const dw_offset_t die_offset,
Stream &s
)
{
@@ -1613,7 +1613,7 @@ DWARFDebugInfoEntry::AppendTypeName
}
DWARFDebugInfoEntry die;
- uint32_t offset = die_offset;
+ lldb::offset_t offset = die_offset;
if (die.Extract(dwarf2Data, cu, &offset))
{
if (die.IsNULL())
@@ -1720,11 +1720,11 @@ DWARFDebugInfoEntry::BuildAddressRangeTable
{
if (m_tag == DW_TAG_subprogram)
{
- dw_addr_t hi_pc = DW_INVALID_ADDRESS;
- dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (lo_pc != DW_INVALID_ADDRESS)
- hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
- if (hi_pc != DW_INVALID_ADDRESS)
+ dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
+ dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (lo_pc != LLDB_INVALID_ADDRESS)
+ hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, LLDB_INVALID_ADDRESS);
+ if (hi_pc != LLDB_INVALID_ADDRESS)
{
/// printf("BuildAddressRangeTable() 0x%8.8x: %30s: [0x%8.8x - 0x%8.8x)\n", m_offset, DW_TAG_value_to_name(tag), lo_pc, hi_pc);
debug_aranges->AppendRange (cu->GetOffset(), lo_pc, hi_pc);
@@ -1761,11 +1761,11 @@ DWARFDebugInfoEntry::BuildFunctionAddressRangeTable
{
if (m_tag == DW_TAG_subprogram)
{
- dw_addr_t hi_pc = DW_INVALID_ADDRESS;
- dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (lo_pc != DW_INVALID_ADDRESS)
- hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
- if (hi_pc != DW_INVALID_ADDRESS)
+ dw_addr_t hi_pc = LLDB_INVALID_ADDRESS;
+ dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (lo_pc != LLDB_INVALID_ADDRESS)
+ hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, LLDB_INVALID_ADDRESS);
+ if (hi_pc != LLDB_INVALID_ADDRESS)
{
// printf("BuildAddressRangeTable() 0x%8.8x: [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n", m_offset, lo_pc, hi_pc); // DEBUG ONLY
debug_aranges->AppendRange (GetOffset(), lo_pc, hi_pc);
@@ -2052,11 +2052,11 @@ DWARFDebugInfoEntry::LookupAddress
if (match_addr_range)
{
- dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (lo_pc != DW_INVALID_ADDRESS)
+ dw_addr_t lo_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (lo_pc != LLDB_INVALID_ADDRESS)
{
- dw_addr_t hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
- if (hi_pc != DW_INVALID_ADDRESS)
+ dw_addr_t hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, LLDB_INVALID_ADDRESS);
+ if (hi_pc != LLDB_INVALID_ADDRESS)
{
// printf("\n0x%8.8x: %30s: address = 0x%8.8x [0x%8.8x - 0x%8.8x) ", m_offset, DW_TAG_value_to_name(tag), address, lo_pc, hi_pc);
if ((lo_pc <= address) && (address < hi_pc))
@@ -2166,7 +2166,7 @@ DWARFDebugInfoEntry::LookupAddress
const DWARFAbbreviationDeclaration*
DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr (SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit *cu,
- dw_offset_t &offset) const
+ lldb::offset_t &offset) const
{
if (dwarf2Data)
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
index 0a97bbd1ec7..a77801fe265 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -75,7 +75,7 @@ public:
bool ContainsAttribute(dw_attr_t attr) const;
bool RemoveAttribute(dw_attr_t attr);
void Clear() { m_infos.clear(); }
- uint32_t Size() const { return m_infos.size(); }
+ size_t Size() const { return m_infos.size(); }
protected:
struct Info
@@ -145,12 +145,12 @@ public:
const lldb_private::DataExtractor& debug_info_data,
const DWARFCompileUnit* cu,
const uint8_t *fixed_form_sizes,
- dw_offset_t* offset_ptr);
+ lldb::offset_t* offset_ptr);
bool Extract(
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
- dw_offset_t* offset_ptr);
+ lldb::offset_t* offset_ptr);
bool LookupAddress(
const dw_addr_t address,
@@ -277,7 +277,7 @@ public:
SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit* cu,
const lldb_private::DataExtractor& debug_info_data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
lldb_private::Stream &s,
dw_attr_t attr,
dw_form_t form);
@@ -304,7 +304,7 @@ public:
const DWARFAbbreviationDeclaration*
GetAbbreviationDeclarationPtr (SymbolFileDWARF* dwarf2Data,
const DWARFCompileUnit *cu,
- dw_offset_t &offset) const;
+ lldb::offset_t &offset) const;
dw_tag_t
Tag () const
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 77fd4eed5d9..0a19aa2cbdd 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -35,11 +35,11 @@ void
DWARFDebugLine::Parse(const DataExtractor& debug_line_data)
{
m_lineTableMap.clear();
- dw_offset_t offset = 0;
+ lldb::offset_t offset = 0;
LineTable::shared_ptr line_table_sp(new LineTable);
while (debug_line_data.ValidOffset(offset))
{
- const uint32_t debug_line_offset = offset;
+ const lldb::offset_t debug_line_offset = offset;
if (line_table_sp.get() == NULL)
break;
@@ -135,7 +135,7 @@ DWARFDebugLine::DumpStatementTable(Log *log, const DataExtractor& debug_line_dat
{
if (debug_line_data.ValidOffset(debug_line_offset))
{
- uint32_t offset = debug_line_offset;
+ lldb::offset_t offset = debug_line_offset;
log->Printf( "----------------------------------------------------------------------\n"
"debug_line[0x%8.8x]\n"
"----------------------------------------------------------------------\n", debug_line_offset);
@@ -185,7 +185,7 @@ DWARFDebugLine::DumpOpcodes(Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t d
dw_offset_t
DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_data, const dw_offset_t debug_line_offset, uint32_t flags)
{
- uint32_t offset = debug_line_offset;
+ lldb::offset_t offset = debug_line_offset;
if (debug_line_data.ValidOffset(offset))
{
Prologue prologue;
@@ -200,7 +200,7 @@ DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_d
else
{
offset = debug_line_offset;
- log->Printf( "0x%8.8x: skipping pad byte %2.2x", offset, debug_line_data.GetU8(&offset));
+ log->Printf( "0x%8.8" PRIx64 ": skipping pad byte %2.2x", offset, debug_line_data.GetU8(&offset));
return offset;
}
@@ -388,7 +388,7 @@ DWARFDebugLine::DumpStatementOpcodes(Log *log, const DataExtractor& debug_line_d
void
DWARFDebugLine::Parse(const DataExtractor& debug_line_data, DWARFDebugLine::State::Callback callback, void* userData)
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (debug_line_data.ValidOffset(offset))
{
if (!ParseStatementTable(debug_line_data, &offset, callback, userData))
@@ -401,9 +401,9 @@ DWARFDebugLine::Parse(const DataExtractor& debug_line_data, DWARFDebugLine::Stat
// DWARFDebugLine::ParsePrologue
//----------------------------------------------------------------------
bool
-DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t* offset_ptr, Prologue* prologue)
+DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue)
{
- const uint32_t prologue_offset = *offset_ptr;
+ const lldb::offset_t prologue_offset = *offset_ptr;
//DEBUG_PRINTF("0x%8.8x: ParsePrologue()\n", *offset_ptr);
@@ -416,7 +416,7 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t*
return false;
prologue->prologue_length = debug_line_data.GetU32(offset_ptr);
- const dw_offset_t end_prologue_offset = prologue->prologue_length + *offset_ptr;
+ const lldb::offset_t end_prologue_offset = prologue->prologue_length + *offset_ptr;
prologue->min_inst_length = debug_line_data.GetU8(offset_ptr);
prologue->default_is_stmt = debug_line_data.GetU8(offset_ptr);
prologue->line_base = debug_line_data.GetU8(offset_ptr);
@@ -459,8 +459,8 @@ DWARFDebugLine::ParsePrologue(const DataExtractor& debug_line_data, dw_offset_t*
if (*offset_ptr != end_prologue_offset)
{
Host::SystemLog (Host::eSystemLogWarning,
- "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8x\n",
- prologue_offset,
+ "warning: parsing line table prologue at 0x%8.8" PRIx64 " should have ended at 0x%8.8" PRIx64 " but it ended ad 0x%8.8" PRIx64 "\n",
+ prologue_offset,
end_prologue_offset,
*offset_ptr);
}
@@ -474,7 +474,7 @@ DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp,
dw_offset_t stmt_list,
FileSpecList &support_files)
{
- uint32_t offset = stmt_list + 4; // Skip the total length
+ lldb::offset_t offset = stmt_list + 4; // Skip the total length
const char * s;
uint32_t version = debug_line_data.GetU16(&offset);
if (version != 2)
@@ -554,7 +554,7 @@ DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp,
if (offset != end_prologue_offset)
{
Host::SystemLog (Host::eSystemLogError,
- "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8x\n",
+ "warning: parsing line table prologue at 0x%8.8x should have ended at 0x%8.8x but it ended ad 0x%8.8" PRIx64 "\n",
stmt_list,
end_prologue_offset,
offset);
@@ -573,7 +573,7 @@ bool
DWARFDebugLine::ParseStatementTable
(
const DataExtractor& debug_line_data,
- dw_offset_t* offset_ptr,
+ lldb::offset_t* offset_ptr,
DWARFDebugLine::State::Callback callback,
void* userData
)
@@ -613,7 +613,7 @@ DWARFDebugLine::ParseStatementTable
{
// Extended Opcodes always start with a zero opcode followed by
// a uleb128 length so you can skip ones you don't know about
- dw_offset_t ext_offset = *offset_ptr;
+ lldb::offset_t ext_offset = *offset_ptr;
dw_uleb128_t len = debug_line_data.GetULEB128(offset_ptr);
dw_offset_t arg_size = len - (*offset_ptr - ext_offset);
@@ -873,7 +873,7 @@ ParseStatementTableCallback(dw_offset_t offset, const DWARFDebugLine::State& sta
// the prologue and all rows.
//----------------------------------------------------------------------
bool
-DWARFDebugLine::ParseStatementTable(const DataExtractor& debug_line_data, uint32_t* offset_ptr, LineTable* line_table)
+DWARFDebugLine::ParseStatementTable(const DataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table)
{
return ParseStatementTable(debug_line_data, offset_ptr, ParseStatementTableCallback, line_table);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
index 8c7ab6d8259..ade8f9bd9f7 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
@@ -197,11 +197,11 @@ public:
static bool DumpOpcodes(lldb_private::Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t line_offset = DW_INVALID_OFFSET, uint32_t dump_flags = 0); // If line_offset is invalid, dump everything
static bool DumpLineTableRows(lldb_private::Log *log, SymbolFileDWARF* dwarf2Data, dw_offset_t line_offset = DW_INVALID_OFFSET); // If line_offset is invalid, dump everything
static bool ParseSupportFiles(const lldb::ModuleSP &module_sp, const lldb_private::DataExtractor& debug_line_data, const char *cu_comp_dir, dw_offset_t stmt_list, lldb_private::FileSpecList &support_files);
- static bool ParsePrologue(const lldb_private::DataExtractor& debug_line_data, dw_offset_t* offset_ptr, Prologue* prologue);
- static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, dw_offset_t* offset_ptr, State::Callback callback, void* userData);
+ static bool ParsePrologue(const lldb_private::DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, Prologue* prologue);
+ static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, lldb::offset_t* offset_ptr, State::Callback callback, void* userData);
static dw_offset_t DumpStatementTable(lldb_private::Log *log, const lldb_private::DataExtractor& debug_line_data, const dw_offset_t line_offset);
static dw_offset_t DumpStatementOpcodes(lldb_private::Log *log, const lldb_private::DataExtractor& debug_line_data, const dw_offset_t line_offset, uint32_t flags);
- static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, uint32_t* offset_ptr, LineTable* line_table);
+ static bool ParseStatementTable(const lldb_private::DataExtractor& debug_line_data, lldb::offset_t *offset_ptr, LineTable* line_table);
static void Parse(const lldb_private::DataExtractor& debug_line_data, DWARFDebugLine::State::Callback callback, void* userData);
// static void AppendLineTableData(const DWARFDebugLine::Prologue* prologue, const DWARFDebugLine::Row::collection& state_coll, const uint32_t addr_size, BinaryStreamBuf &debug_line_data);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp
index 0501da8fe40..60ace9e8229 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp
@@ -26,7 +26,7 @@ DWARFDebugMacinfo::~DWARFDebugMacinfo()
}
void
-DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, dw_offset_t offset)
+DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, lldb::offset_t offset)
{
DWARFDebugMacinfoEntry maninfo_entry;
if (macinfo_data.GetByteSize() == 0)
@@ -34,7 +34,7 @@ DWARFDebugMacinfo::Dump(Stream *s, const DataExtractor& macinfo_data, dw_offset_
s->PutCString("< EMPTY >\n");
return;
}
- if (offset == DW_INVALID_OFFSET)
+ if (offset == LLDB_INVALID_OFFSET)
{
offset = 0;
while (maninfo_entry.Extract(macinfo_data, &offset))
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h
index 85ddebd1ff2..f35ff165f1f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h
@@ -22,7 +22,7 @@ public:
static void
Dump (lldb_private::Stream *s,
const lldb_private::DataExtractor& macinfo_data,
- dw_offset_t offset = DW_INVALID_OFFSET);
+ lldb::offset_t offset = LLDB_INVALID_OFFSET);
};
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
index 0aaeb7e0249..5cd9cb6be47 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
@@ -80,7 +80,7 @@ DWARFDebugMacinfoEntry::Dump(Stream *s) const
bool
-DWARFDebugMacinfoEntry::Extract(const DataExtractor& mac_info_data, dw_offset_t* offset_ptr)
+DWARFDebugMacinfoEntry::Extract(const DataExtractor& mac_info_data, lldb::offset_t* offset_ptr)
{
if (mac_info_data.ValidOffset(*offset_ptr))
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h
index f701c178204..46fd44a22a6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h
@@ -39,7 +39,7 @@ public:
bool
Extract(const lldb_private::DataExtractor& mac_info_data,
- dw_offset_t* offset_ptr);
+ lldb::offset_t* offset_ptr);
protected:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
index 11e8d4c004d..8e7191e4cb4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
@@ -40,7 +40,7 @@ DWARFDebugPubnames::Extract(const DataExtractor& data)
if (data.ValidOffset(0))
{
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
DWARFDebugPubnamesSet set;
while (data.ValidOffset(offset))
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
index 0421ced55d4..2df8d525f03 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
@@ -78,7 +78,7 @@ DWARFDebugPubnamesSet::InitNameIndexes() const
bool
-DWARFDebugPubnamesSet::Extract(const DataExtractor& data, uint32_t* offset_ptr)
+DWARFDebugPubnamesSet::Extract(const DataExtractor& data, lldb::offset_t *offset_ptr)
{
if (data.ValidOffset(*offset_ptr))
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
index adf93d5a194..941c83e58a4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
@@ -70,7 +70,7 @@ public:
uint32_t NumDescriptors() const { return m_descriptors.size(); }
void AddDescriptor(dw_offset_t cu_rel_offset, const char* name);
void Clear();
- bool Extract(const lldb_private::DataExtractor& debug_pubnames_data, uint32_t* offset_ptr);
+ bool Extract(const lldb_private::DataExtractor& debug_pubnames_data, lldb::offset_t *offset_ptr);
void Dump(lldb_private::Log *s) const;
void InitNameIndexes() const;
void Find(const char* name, bool ignore_case, std::vector<dw_offset_t>& die_offset_coll) const;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
index f69b370b515..461b17fc3ab 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
@@ -28,7 +28,7 @@ void
DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data)
{
RangeList range_list;
- dw_offset_t offset = 0;
+ lldb::offset_t offset = 0;
dw_offset_t debug_ranges_offset = offset;
while (Extract(dwarf2Data, &offset, range_list))
{
@@ -82,11 +82,11 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data)
//}
bool
-DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, uint32_t* offset_ptr, RangeList &range_list)
+DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, lldb::offset_t *offset_ptr, RangeList &range_list)
{
range_list.Clear();
- uint32_t range_offset = *offset_ptr;
+ lldb::offset_t range_offset = *offset_ptr;
const DataExtractor& debug_ranges_data = dwarf2Data->get_debug_ranges_data();
uint32_t addr_size = debug_ranges_data.GetAddressByteSize();
@@ -105,12 +105,12 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, uint32_t* offset_ptr, Ran
{
case 2:
if (begin == 0xFFFFull)
- begin = DW_INVALID_ADDRESS;
+ begin = LLDB_INVALID_ADDRESS;
break;
case 4:
if (begin == 0xFFFFFFFFull)
- begin = DW_INVALID_ADDRESS;
+ begin = LLDB_INVALID_ADDRESS;
break;
case 8:
@@ -130,60 +130,9 @@ DWARFDebugRanges::Extract(SymbolFileDWARF* dwarf2Data, uint32_t* offset_ptr, Ran
return range_offset != *offset_ptr;
}
-//
-//dw_addr_t
-//DWARFDebugRanges::RangeList::LowestAddress(const dw_addr_t cu_base_addr) const
-//{
-// dw_addr_t addr = DW_INVALID_ADDRESS;
-// dw_addr_t curr_base_addr = cu_base_addr;
-// if (!ranges.empty())
-// {
-// Range::const_iterator pos = ranges.begin();
-// Range::const_iterator end_pos = ranges.end();
-// for (pos = ranges.begin(); pos != end_pos; ++pos)
-// {
-// if (pos->begin_offset == DW_INVALID_ADDRESS)
-// curr_base_addr = pos->end_offset;
-// else if (curr_base_addr != DW_INVALID_ADDRESS)
-// {
-// dw_addr_t curr_addr = curr_base_addr + pos->begin_offset;
-// if (addr > curr_addr)
-// addr = curr_addr;
-// }
-// }
-// }
-// return addr;
-//}
-//
-//dw_addr_t
-//DWARFDebugRanges::RangeList::HighestAddress(const dw_addr_t cu_base_addr) const
-//{
-// dw_addr_t addr = 0;
-// dw_addr_t curr_base_addr = cu_base_addr;
-// if (!ranges.empty())
-// {
-// Range::const_iterator pos = ranges.begin();
-// Range::const_iterator end_pos = ranges.end();
-// for (pos = ranges.begin(); pos != end_pos; ++pos)
-// {
-// if (pos->begin_offset == DW_INVALID_ADDRESS)
-// curr_base_addr = pos->end_offset;
-// else if (curr_base_addr != DW_INVALID_ADDRESS)
-// {
-// dw_addr_t curr_addr = curr_base_addr + pos->end_offset;
-// if (addr < curr_addr)
-// addr = curr_addr;
-// }
-// }
-// }
-// if (addr != 0)
-// return addr;
-// return DW_INVALID_ADDRESS;
-//}
-//
void
-DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr)
+DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, lldb::offset_t *offset_ptr, dw_addr_t cu_base_addr)
{
uint32_t addr_size = s.GetAddressByteSize();
bool verbose = s.GetVerbose();
@@ -196,7 +145,7 @@ DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32
// Extend 4 byte addresses that consits of 32 bits of 1's to be 64 bits
// of ones
if (begin == 0xFFFFFFFFull && addr_size == 4)
- begin = DW_INVALID_ADDRESS;
+ begin = LLDB_INVALID_ADDRESS;
s.Indent();
if (verbose)
@@ -210,7 +159,7 @@ DWARFDebugRanges::Dump(Stream &s, const DataExtractor& debug_ranges_data, uint32
s.PutCString(" End");
break;
}
- else if (begin == DW_INVALID_ADDRESS)
+ else if (begin == LLDB_INVALID_ADDRESS)
{
// A base address selection entry
base_addr = end;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
index 82a82edfaf3..40899abe9c2 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
@@ -26,14 +26,14 @@ public:
DWARFDebugRanges();
~DWARFDebugRanges();
void Extract(SymbolFileDWARF* dwarf2Data);
- static void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor& debug_ranges_data, uint32_t* offset_ptr, dw_addr_t cu_base_addr);
+ static void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor& debug_ranges_data, lldb::offset_t *offset_ptr, dw_addr_t cu_base_addr);
bool FindRanges(dw_offset_t debug_ranges_offset, DWARFDebugRanges::RangeList& range_list) const;
protected:
bool
Extract (SymbolFileDWARF* dwarf2Data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
RangeList &range_list);
typedef std::map<dw_offset_t, RangeList> range_map;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index 3288404b236..48232656b61 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -114,7 +114,7 @@ DWARFFormValue::DWARFFormValue(dw_form_t form) :
}
bool
-DWARFFormValue::ExtractValue(const DataExtractor& data, uint32_t* offset_ptr, const DWARFCompileUnit* cu)
+DWARFFormValue::ExtractValue(const DataExtractor& data, lldb::offset_t* offset_ptr, const DWARFCompileUnit* cu)
{
bool indirect = false;
bool is_block = false;
@@ -178,13 +178,13 @@ DWARFFormValue::ExtractValue(const DataExtractor& data, uint32_t* offset_ptr, co
}
bool
-DWARFFormValue::SkipValue(const DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu) const
+DWARFFormValue::SkipValue(const DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const
{
return DWARFFormValue::SkipValue(m_form, debug_info_data, offset_ptr, cu);
}
bool
-DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu)
+DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu)
{
switch (form)
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
index 5051a5125f2..751653c7925 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -49,7 +49,9 @@ public:
void SetForm(dw_form_t form) { m_form = form; }
const ValueType& Value() const { return m_value; }
void Dump(lldb_private::Stream &s, const lldb_private::DataExtractor* debug_str_data, const DWARFCompileUnit* cu) const;
- bool ExtractValue(const lldb_private::DataExtractor& data, uint32_t* offset_ptr, const DWARFCompileUnit* cu);
+ bool ExtractValue(const lldb_private::DataExtractor& data,
+ lldb::offset_t* offset_ptr,
+ const DWARFCompileUnit* cu);
bool IsInlinedCStr() const { return (m_value.data != NULL) && m_value.data == (uint8_t*)m_value.value.cstr; }
const uint8_t* BlockData() const;
uint64_t Reference(const DWARFCompileUnit* cu) const;
@@ -60,9 +62,9 @@ public:
int64_t Signed() const { return m_value.value.sval; }
void SetSigned(int64_t sval) { m_value.value.sval = sval; }
const char* AsCString(const lldb_private::DataExtractor* debug_str_data_ptr) const;
- bool SkipValue(const lldb_private::DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu) const;
- static bool SkipValue(const dw_form_t form, const lldb_private::DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu);
-// static bool TransferValue(dw_form_t form, const lldb_private::DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
+ bool SkipValue(const lldb_private::DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu) const;
+ static bool SkipValue(const dw_form_t form, const lldb_private::DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu);
+// static bool TransferValue(dw_form_t form, const lldb_private::DataExtractor& debug_info_data, lldb::offset_t *offset_ptr, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
// static bool TransferValue(const DWARFFormValue& formValue, const DWARFCompileUnit* cu, BinaryStreamBuf& out_buff);
// static bool PutUnsigned(dw_form_t form, dw_offset_t offset, uint64_t value, BinaryStreamBuf& out_buff, const DWARFCompileUnit* cu, bool fixup_cu_relative_refs);
static bool IsBlockForm(const dw_form_t form);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
index 81492a992f2..fdc07836b88 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
@@ -15,7 +15,7 @@
using namespace lldb_private;
-static int print_dwarf_exp_op (Stream &s, const DataExtractor& data, uint32_t* offset_ptr, int address_size, int dwarf_ref_size);
+static int print_dwarf_exp_op (Stream &s, const DataExtractor& data, lldb::offset_t *offset_ptr, int address_size, int dwarf_ref_size);
int
print_dwarf_expression (Stream &s,
@@ -25,7 +25,7 @@ print_dwarf_expression (Stream &s,
bool location_expression)
{
int op_count = 0;
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
while (data.ValidOffset(offset))
{
if (location_expression && op_count > 0)
@@ -48,7 +48,7 @@ print_dwarf_expression (Stream &s,
static int
print_dwarf_exp_op (Stream &s,
const DataExtractor& data,
- uint32_t* offset_ptr,
+ lldb::offset_t *offset_ptr,
int address_size,
int dwarf_ref_size)
{
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp
index ff65d08e5fc..dad5691267d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.cpp
@@ -18,7 +18,7 @@
using namespace lldb_private;
dw_offset_t
-DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtractor& debug_loc_data, dw_offset_t offset)
+DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtractor& debug_loc_data, lldb::offset_t offset)
{
uint64_t start_addr, end_addr;
uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu);
@@ -52,7 +52,7 @@ DWARFLocationList::Dump(Stream &s, const DWARFCompileUnit* cu, const DataExtract
}
bool
-DWARFLocationList::Extract(const DataExtractor& debug_loc_data, dw_offset_t* offset_ptr, DataExtractor& location_list_data)
+DWARFLocationList::Extract(const DataExtractor& debug_loc_data, lldb::offset_t* offset_ptr, DataExtractor& location_list_data)
{
// Initialize with no data just in case we don't find anything
location_list_data.Clear();
@@ -69,7 +69,7 @@ DWARFLocationList::Extract(const DataExtractor& debug_loc_data, dw_offset_t* off
}
size_t
-DWARFLocationList::Size(const DataExtractor& debug_loc_data, dw_offset_t offset)
+DWARFLocationList::Size(const DataExtractor& debug_loc_data, lldb::offset_t offset)
{
const dw_offset_t debug_loc_offset = offset;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h
index a0163c0c3d3..85e11d90b36 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFLocationList.h
@@ -19,16 +19,16 @@ public:
Dump (lldb_private::Stream &s,
const DWARFCompileUnit* cu,
const lldb_private::DataExtractor& debug_loc_data,
- dw_offset_t offset);
+ lldb::offset_t offset);
static bool
Extract (const lldb_private::DataExtractor& debug_loc_data,
- dw_offset_t* offset_ptr,
+ lldb::offset_t* offset_ptr,
lldb_private::DataExtractor& location_list_data);
static size_t
Size (const lldb_private::DataExtractor& debug_loc_data,
- dw_offset_t offset);
+ lldb::offset_t offset);
};
#endif // SymbolFileDWARF_DWARFLocationList_h_
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
index 3aa1c13e289..8ed2e50dcfc 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
@@ -306,8 +306,9 @@ struct DWARFMappedHash
// void
// Dump (std::ostream* ostrm_ptr);
- uint32_t
- Read (const lldb_private::DataExtractor &data, uint32_t offset)
+ lldb::offset_t
+ Read (const lldb_private::DataExtractor &data,
+ lldb::offset_t offset)
{
ClearAtoms ();
@@ -379,8 +380,8 @@ struct DWARFMappedHash
// virtual void
// Dump (std::ostream* ostrm_ptr);
//
- virtual uint32_t
- Read (lldb_private::DataExtractor &data, uint32_t offset)
+ virtual lldb::offset_t
+ Read (lldb_private::DataExtractor &data, lldb::offset_t offset)
{
offset = MappedHash::Header<Prologue>::Read (data, offset);
if (offset != UINT32_MAX)
@@ -392,7 +393,7 @@ struct DWARFMappedHash
bool
Read (const lldb_private::DataExtractor &data,
- uint32_t *offset_ptr,
+ lldb::offset_t *offset_ptr,
DIEInfo &hash_data) const
{
const size_t num_atoms = header_data.atoms.size();
@@ -409,14 +410,14 @@ struct DWARFMappedHash
switch (header_data.atoms[i].type)
{
case eAtomTypeDIEOffset: // DIE offset, check form for encoding
- hash_data.offset = form_value.Reference (header_data.die_base_offset);
+ hash_data.offset = (dw_offset_t)form_value.Reference (header_data.die_base_offset);
break;
case eAtomTypeTag: // DW_TAG value for the DIE
- hash_data.tag = form_value.Unsigned ();
+ hash_data.tag = (dw_tag_t)form_value.Unsigned ();
case eAtomTypeTypeFlags: // Flags from enum TypeFlags
- hash_data.type_flags = form_value.Unsigned ();
+ hash_data.type_flags = (uint32_t)form_value.Unsigned ();
break;
default:
return false;
@@ -559,7 +560,7 @@ struct DWARFMappedHash
virtual Result
GetHashDataForName (const char *name,
- uint32_t* hash_data_offset_ptr,
+ lldb::offset_t* hash_data_offset_ptr,
Pair &pair) const
{
pair.key = m_data.GetU32 (hash_data_offset_ptr);
@@ -580,7 +581,7 @@ struct DWARFMappedHash
}
const uint32_t count = m_data.GetU32 (hash_data_offset_ptr);
- const uint32_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
+ const size_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
if (count > 0 && m_data.ValidOffsetForDataOfSize (*hash_data_offset_ptr, min_total_hash_data_size))
{
// We have at least one HashData entry, and we have enough
@@ -637,7 +638,7 @@ struct DWARFMappedHash
virtual Result
AppendHashDataForRegularExpression (const lldb_private::RegularExpression& regex,
- uint32_t* hash_data_offset_ptr,
+ lldb::offset_t* hash_data_offset_ptr,
Pair &pair) const
{
pair.key = m_data.GetU32 (hash_data_offset_ptr);
@@ -653,7 +654,7 @@ struct DWARFMappedHash
return eResultError;
const uint32_t count = m_data.GetU32 (hash_data_offset_ptr);
- const uint32_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
+ const size_t min_total_hash_data_size = count * m_header.header_data.GetMinumumHashDataByteSize();
if (count > 0 && m_data.ValidOffsetForDataOfSize (*hash_data_offset_ptr, min_total_hash_data_size))
{
const bool match = regex.Execute(strp_cstr);
@@ -712,10 +713,10 @@ struct DWARFMappedHash
Pair pair;
for (uint32_t offset_idx=0; offset_idx<hash_count; ++offset_idx)
{
- uint32_t hash_data_offset = GetHashDataOffset (offset_idx);
+ lldb::offset_t hash_data_offset = GetHashDataOffset (offset_idx);
while (hash_data_offset != UINT32_MAX)
{
- const uint32_t prev_hash_data_offset = hash_data_offset;
+ const lldb::offset_t prev_hash_data_offset = hash_data_offset;
Result hash_result = AppendHashDataForRegularExpression (regex, &hash_data_offset, pair);
if (prev_hash_data_offset == hash_data_offset)
break;
@@ -749,7 +750,7 @@ struct DWARFMappedHash
for (uint32_t offset_idx=0; offset_idx<hash_count; ++offset_idx)
{
bool done = false;
- uint32_t hash_data_offset = GetHashDataOffset (offset_idx);
+ lldb::offset_t hash_data_offset = GetHashDataOffset (offset_idx);
while (!done && hash_data_offset != UINT32_MAX)
{
KeyType key = m_data.GetU32 (&hash_data_offset);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 6858659f426..32a98cc185b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1206,7 +1206,7 @@ SymbolFileDWARF::ParseCompileUnitLineTable (const SymbolContext &sc)
SectionSP(),
llvm::OwningPtr<LineSequence>()
};
- uint32_t offset = cu_line_offset;
+ lldb::offset_t offset = cu_line_offset;
DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info);
sc.comp_unit->SetLineTable(line_table_ap.release());
return true;
@@ -6858,8 +6858,8 @@ SymbolFileDWARF::ParseVariablesForContext (const SymbolContext& sc)
{
const DWARFDebugInfoEntry *function_die = dwarf_cu->GetDIEPtr(sc.function->GetID());
- dw_addr_t func_lo_pc = function_die->GetAttributeValueAsUnsigned (this, dwarf_cu, DW_AT_low_pc, DW_INVALID_ADDRESS);
- if (func_lo_pc != DW_INVALID_ADDRESS)
+ dw_addr_t func_lo_pc = function_die->GetAttributeValueAsUnsigned (this, dwarf_cu, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (func_lo_pc != LLDB_INVALID_ADDRESS)
{
const size_t num_variables = ParseVariables(sc, dwarf_cu, func_lo_pc, function_die->GetFirstChild(), true, true);
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index ec25600b8ec..dba73cbff02 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -3372,7 +3372,7 @@ ClangASTContext::GetNumFields (clang::ASTContext *ast, clang_type_t clang_type)
clang_type_t
ClangASTContext::GetDirectBaseClassAtIndex (clang::ASTContext *ast,
clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr)
{
if (clang_type == NULL)
@@ -3457,7 +3457,7 @@ ClangASTContext::GetDirectBaseClassAtIndex (clang::ASTContext *ast,
clang_type_t
ClangASTContext::GetVirtualBaseClassAtIndex (clang::ASTContext *ast,
clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
uint32_t *bit_offset_ptr)
{
if (clang_type == NULL)
@@ -3516,7 +3516,7 @@ ClangASTContext::GetVirtualBaseClassAtIndex (clang::ASTContext *ast,
clang_type_t
ClangASTContext::GetFieldAtIndex (clang::ASTContext *ast,
clang_type_t clang_type,
- uint32_t idx,
+ size_t idx,
std::string& name,
uint64_t *bit_offset_ptr,
uint32_t *bitfield_bit_size_ptr,
@@ -3824,7 +3824,7 @@ ClangASTContext::GetChildClangTypeAtIndex
ExecutionContext *exe_ctx,
const char *parent_name,
clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
@@ -3864,7 +3864,7 @@ ClangASTContext::GetChildClangTypeAtIndex
ASTContext *ast,
const char *parent_name,
clang_type_t parent_clang_type,
- uint32_t idx,
+ size_t idx,
bool transparent_pointers,
bool omit_empty_base_classes,
bool ignore_array_bounds,
@@ -4168,7 +4168,7 @@ ClangASTContext::GetChildClangTypeAtIndex
std::pair<uint64_t, unsigned> field_type_info = ast->getTypeInfo(array->getElementType());
char element_name[64];
- ::snprintf (element_name, sizeof (element_name), "[%u]", idx);
+ ::snprintf (element_name, sizeof (element_name), "[%zu]", idx);
child_name.assign(element_name);
assert(field_type_info.first % 8 == 0);
diff --git a/lldb/source/Symbol/ClangASTType.cpp b/lldb/source/Symbol/ClangASTType.cpp
index aa56e2e200e..85ce59cd94a 100644
--- a/lldb/source/Symbol/ClangASTType.cpp
+++ b/lldb/source/Symbol/ClangASTType.cpp
@@ -808,7 +808,7 @@ ClangASTType::DumpValue
const clang::EnumDecl *enum_decl = enum_type->getDecl();
assert(enum_decl);
clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
- uint32_t offset = data_byte_offset;
+ lldb::offset_t offset = data_byte_offset;
const int64_t enum_value = data.GetMaxU64Bitfield(&offset, data_byte_size, bitfield_bit_size, bitfield_bit_offset);
for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
{
@@ -1029,7 +1029,7 @@ ClangASTType::DumpTypeValue (clang::ASTContext *ast_context,
const clang::EnumDecl *enum_decl = enum_type->getDecl();
assert(enum_decl);
clang::EnumDecl::enumerator_iterator enum_pos, enum_end_pos;
- uint32_t offset = byte_offset;
+ lldb::offset_t offset = byte_offset;
const int64_t enum_value = data.GetMaxU64Bitfield (&offset, byte_size, bitfield_bit_size, bitfield_bit_offset);
for (enum_pos = enum_decl->enumerator_begin(), enum_end_pos = enum_decl->enumerator_end(); enum_pos != enum_end_pos; ++enum_pos)
{
@@ -1160,7 +1160,7 @@ ClangASTType::DumpSummary
Process *process = exe_ctx->GetProcessPtr();
if (process)
{
- uint32_t offset = data_byte_offset;
+ lldb::offset_t offset = data_byte_offset;
lldb::addr_t pointer_addresss = data.GetMaxU64(&offset, data_byte_size);
std::vector<uint8_t> buf;
if (length > 0)
@@ -1436,7 +1436,7 @@ ClangASTType::GetValueAsScalar
uint64_t bit_width = ast_context->getTypeSize(qual_type);
uint32_t byte_size = (bit_width + 7 ) / 8;
- uint32_t offset = data_byte_offset;
+ lldb::offset_t offset = data_byte_offset;
switch (encoding)
{
case lldb::eEncodingInvalid:
diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
index 7dbd7117a09..74560ee3c43 100644
--- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
@@ -117,13 +117,13 @@ DWARFCallFrameInfo::CIESP
DWARFCallFrameInfo::ParseCIE (const dw_offset_t cie_offset)
{
CIESP cie_sp(new CIE(cie_offset));
- dw_offset_t offset = cie_offset;
+ lldb::offset_t offset = cie_offset;
if (m_cfi_data_initialized == false)
GetCFIData();
const uint32_t length = m_cfi_data.GetU32(&offset);
const dw_offset_t cie_id = m_cfi_data.GetU32(&offset);
const dw_offset_t end_offset = cie_offset + length + 4;
- if (length > 0 && ((!m_is_eh_frame && cie_id == 0xfffffffful) || (m_is_eh_frame && cie_id == 0ul)))
+ if (length > 0 && ((!m_is_eh_frame && cie_id == UINT32_MAX) || (m_is_eh_frame && cie_id == 0ul)))
{
size_t i;
// cie.offset = cie_offset;
@@ -302,7 +302,7 @@ DWARFCallFrameInfo::GetFDEIndex ()
if (m_fde_index_initialized) // if two threads hit the locker
return;
- dw_offset_t offset = 0;
+ lldb::offset_t offset = 0;
if (m_cfi_data_initialized == false)
GetCFIData();
while (m_cfi_data.ValidOffsetForDataOfSize (offset, 8))
@@ -349,9 +349,10 @@ DWARFCallFrameInfo::GetFDEIndex ()
}
bool
-DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t offset, Address startaddr, UnwindPlan& unwind_plan)
+DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr, UnwindPlan& unwind_plan)
{
- dw_offset_t current_entry = offset;
+ lldb::offset_t offset = dwarf_offset;
+ lldb::offset_t current_entry = offset;
if (m_section_sp.get() == NULL || m_section_sp->IsEncrypted())
return false;
diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp
index 6f2420dcca9..db4ceb24c80 100644
--- a/lldb/source/Symbol/Symbol.cpp
+++ b/lldb/source/Symbol/Symbol.cpp
@@ -52,7 +52,7 @@ Symbol::Symbol
bool is_artificial,
const lldb::SectionSP &section_sp,
addr_t offset,
- uint32_t size,
+ addr_t size,
uint32_t flags
) :
SymbolContextScope (),
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp
index a47ca5493ae..b3d9748a256 100644
--- a/lldb/source/Symbol/SymbolContext.cpp
+++ b/lldb/source/Symbol/SymbolContext.cpp
@@ -1044,7 +1044,7 @@ SymbolContextList::Dump(Stream *s, Target *target) const
}
bool
-SymbolContextList::GetContextAtIndex(uint32_t idx, SymbolContext& sc) const
+SymbolContextList::GetContextAtIndex(size_t idx, SymbolContext& sc) const
{
if (idx < m_symbol_contexts.size())
{
@@ -1055,7 +1055,7 @@ SymbolContextList::GetContextAtIndex(uint32_t idx, SymbolContext& sc) const
}
bool
-SymbolContextList::RemoveContextAtIndex (uint32_t idx)
+SymbolContextList::RemoveContextAtIndex (size_t idx)
{
if (idx < m_symbol_contexts.size())
{
@@ -1075,8 +1075,8 @@ uint32_t
SymbolContextList::NumLineEntriesWithLine (uint32_t line) const
{
uint32_t match_count = 0;
- const uint32_t size = m_symbol_contexts.size();
- for (uint32_t idx = 0; idx<size; ++idx)
+ const size_t size = m_symbol_contexts.size();
+ for (size_t idx = 0; idx<size; ++idx)
{
if (m_symbol_contexts[idx].line_entry.line == line)
++match_count;
@@ -1089,8 +1089,8 @@ SymbolContextList::GetDescription(Stream *s,
lldb::DescriptionLevel level,
Target *target) const
{
- const uint32_t size = m_symbol_contexts.size();
- for (uint32_t idx = 0; idx<size; ++idx)
+ const size_t size = m_symbol_contexts.size();
+ for (size_t idx = 0; idx<size; ++idx)
m_symbol_contexts[idx].GetDescription (s, level, target);
}
diff --git a/lldb/source/Symbol/SymbolVendor.cpp b/lldb/source/Symbol/SymbolVendor.cpp
index a71fc67a697..343a4b1e8ca 100644
--- a/lldb/source/Symbol/SymbolVendor.cpp
+++ b/lldb/source/Symbol/SymbolVendor.cpp
@@ -39,7 +39,7 @@ SymbolVendor::FindPlugin (const lldb::ModuleSP &module_sp, lldb_private::Stream
// We currently only have one debug symbol parser...
//----------------------------------------------------------------------
SymbolVendorCreateInstance create_callback;
- for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolVendorCreateCallbackAtIndex(idx)) != NULL; ++idx)
+ for (size_t idx = 0; (create_callback = PluginManager::GetSymbolVendorCreateCallbackAtIndex(idx)) != NULL; ++idx)
{
instance_ap.reset(create_callback(module_sp, feedback_strm));
@@ -102,13 +102,13 @@ SymbolVendor::AddSymbolFileRepresentation(const ObjectFileSP &objfile_sp)
}
bool
-SymbolVendor::SetCompileUnitAtIndex (uint32_t idx, const CompUnitSP &cu_sp)
+SymbolVendor::SetCompileUnitAtIndex (size_t idx, const CompUnitSP &cu_sp)
{
ModuleSP module_sp(GetModule());
if (module_sp)
{
lldb_private::Mutex::Locker locker(module_sp->GetMutex());
- const uint32_t num_compile_units = GetNumCompileUnits();
+ const size_t num_compile_units = GetNumCompileUnits();
if (idx < num_compile_units)
{
// Fire off an assertion if this compile unit already exists for now.
@@ -130,7 +130,7 @@ SymbolVendor::SetCompileUnitAtIndex (uint32_t idx, const CompUnitSP &cu_sp)
return false;
}
-uint32_t
+size_t
SymbolVendor::GetNumCompileUnits()
{
ModuleSP module_sp(GetModule());
@@ -284,8 +284,8 @@ SymbolVendor::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bo
return 0;
}
-uint32_t
-SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, VariableList& variables)
+size_t
+SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, VariableList& variables)
{
ModuleSP module_sp(GetModule());
if (module_sp)
@@ -297,8 +297,8 @@ SymbolVendor::FindGlobalVariables (const ConstString &name, const ClangNamespace
return 0;
}
-uint32_t
-SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables)
+size_t
+SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append, size_t max_matches, VariableList& variables)
{
ModuleSP module_sp(GetModule());
if (module_sp)
@@ -310,7 +310,7 @@ SymbolVendor::FindGlobalVariables (const RegularExpression& regex, bool append,
return 0;
}
-uint32_t
+size_t
SymbolVendor::FindFunctions(const ConstString &name, const ClangNamespaceDecl *namespace_decl, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list)
{
ModuleSP module_sp(GetModule());
@@ -323,7 +323,7 @@ SymbolVendor::FindFunctions(const ConstString &name, const ClangNamespaceDecl *n
return 0;
}
-uint32_t
+size_t
SymbolVendor::FindFunctions(const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list)
{
ModuleSP module_sp(GetModule());
@@ -337,8 +337,8 @@ SymbolVendor::FindFunctions(const RegularExpression& regex, bool include_inlines
}
-uint32_t
-SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, uint32_t max_matches, TypeList& types)
+size_t
+SymbolVendor::FindTypes (const SymbolContext& sc, const ConstString &name, const ClangNamespaceDecl *namespace_decl, bool append, size_t max_matches, TypeList& types)
{
ModuleSP module_sp(GetModule());
if (module_sp)
@@ -409,13 +409,13 @@ SymbolVendor::Dump(Stream *s)
}
CompUnitSP
-SymbolVendor::GetCompileUnitAtIndex(uint32_t idx)
+SymbolVendor::GetCompileUnitAtIndex(size_t idx)
{
CompUnitSP cu_sp;
ModuleSP module_sp(GetModule());
if (module_sp)
{
- const uint32_t num_compile_units = GetNumCompileUnits();
+ const size_t num_compile_units = GetNumCompileUnits();
if (idx < num_compile_units)
{
cu_sp = m_compile_units[idx];
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 60f2c75b4d9..737527d9a07 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -38,7 +38,7 @@ Symtab::~Symtab()
}
void
-Symtab::Reserve(uint32_t count)
+Symtab::Reserve(size_t count)
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
@@ -46,7 +46,7 @@ Symtab::Reserve(uint32_t count)
}
Symbol *
-Symtab::Resize(uint32_t count)
+Symtab::Resize(size_t count)
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
@@ -150,7 +150,7 @@ Symtab::Dump (Stream *s, Target *target, SortOrder sort_order)
std::vector<uint32_t>::const_iterator end = m_addr_indexes.end();
for (pos = m_addr_indexes.begin(); pos != end; ++pos)
{
- uint32_t idx = *pos;
+ size_t idx = *pos;
if (idx < num_symbols)
{
s->Indent();
@@ -180,7 +180,7 @@ Symtab::Dump(Stream *s, Target *target, std::vector<uint32_t>& indexes) const
DumpSymbolHeader (s);
for (pos = indexes.begin(); pos != end; ++pos)
{
- uint32_t idx = *pos;
+ size_t idx = *pos;
if (idx < num_symbols)
{
s->Indent();
@@ -230,7 +230,7 @@ Symtab::FindSymbolByID (lldb::user_id_t symbol_uid) const
Symbol *
-Symtab::SymbolAtIndex(uint32_t idx)
+Symtab::SymbolAtIndex(size_t idx)
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
@@ -241,7 +241,7 @@ Symtab::SymbolAtIndex(uint32_t idx)
const Symbol *
-Symtab::SymbolAtIndex(uint32_t idx) const
+Symtab::SymbolAtIndex(size_t idx) const
{
// Clients should grab the mutex from this symbol table and lock it manually
// when calling this function to avoid performance issues.
@@ -657,7 +657,7 @@ Symtab::FindSymbolWithType (SymbolType symbol_type, Debug symbol_debug_type, Vis
Mutex::Locker locker (m_mutex);
const size_t count = m_symbols.size();
- for (uint32_t idx = start_idx; idx < count; ++idx)
+ for (size_t idx = start_idx; idx < count; ++idx)
{
if (symbol_type == eSymbolTypeAny || m_symbols[idx].GetType() == symbol_type)
{
diff --git a/lldb/source/Symbol/VariableList.cpp b/lldb/source/Symbol/VariableList.cpp
index 9ab584fae2c..b34ea3a42c9 100644
--- a/lldb/source/Symbol/VariableList.cpp
+++ b/lldb/source/Symbol/VariableList.cpp
@@ -67,7 +67,7 @@ VariableList::Clear()
}
VariableSP
-VariableList::GetVariableAtIndex(uint32_t idx) const
+VariableList::GetVariableAtIndex(size_t idx) const
{
VariableSP var_sp;
if (idx < m_variables.size())
@@ -76,7 +76,7 @@ VariableList::GetVariableAtIndex(uint32_t idx) const
}
VariableSP
-VariableList::RemoveVariableAtIndex(uint32_t idx)
+VariableList::RemoveVariableAtIndex(size_t idx)
{
VariableSP var_sp;
if (idx < m_variables.size())
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 97339235746..a6bbdcf83a7 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2001,7 +2001,7 @@ Process::CreateBreakpointSite (const BreakpointLocationSP &owner, bool use_hardw
}
else
{
- bp_site_sp.reset (new BreakpointSite (&m_breakpoint_site_list, owner, load_addr, LLDB_INVALID_THREAD_ID, use_hardware));
+ bp_site_sp.reset (new BreakpointSite (&m_breakpoint_site_list, owner, load_addr, use_hardware));
if (bp_site_sp)
{
if (EnableBreakpoint (bp_site_sp.get()).Success())
@@ -2520,7 +2520,7 @@ Process::WriteMemory (addr_t addr, const void *buf, size_t size, Error &error)
}
size_t
-Process::WriteScalarToMemory (addr_t addr, const Scalar &scalar, uint32_t byte_size, Error &error)
+Process::WriteScalarToMemory (addr_t addr, const Scalar &scalar, size_t byte_size, Error &error)
{
if (byte_size == UINT32_MAX)
byte_size = scalar.GetByteSize();
@@ -2555,7 +2555,7 @@ Process::ReadScalarIntegerFromMemory (addr_t addr,
if (bytes_read == byte_size)
{
DataExtractor data (&uval, sizeof(uval), GetByteOrder(), GetAddressByteSize());
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (byte_size <= 4)
scalar = data.GetMaxU32 (&offset, byte_size);
else
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 435081c8bba..676fe8a8cd4 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1418,7 +1418,7 @@ Target::ReadScalarIntegerFromMemory (const Address& addr,
if (bytes_read == byte_size)
{
DataExtractor data (&uval, sizeof(uval), m_arch.GetByteOrder(), m_arch.GetAddressByteSize());
- uint32_t offset = 0;
+ lldb::offset_t offset = 0;
if (byte_size <= 4)
scalar = data.GetMaxU32 (&offset, byte_size);
else
diff --git a/lldb/source/Utility/StringExtractor.cpp b/lldb/source/Utility/StringExtractor.cpp
index bbe01d240a3..2f4bcecda8f 100644
--- a/lldb/source/Utility/StringExtractor.cpp
+++ b/lldb/source/Utility/StringExtractor.cpp
@@ -134,7 +134,7 @@ StringExtractor::GetChar (char fail_value)
++m_index;
return ch;
}
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -157,7 +157,7 @@ StringExtractor::GetHexU8 (uint8_t fail_value, bool set_eof_on_fail)
}
}
if (set_eof_on_fail || m_index >= m_packet.size())
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -195,7 +195,7 @@ StringExtractor::GetHexMaxU32 (bool little_endian, uint32_t fail_value)
// Make sure we don't exceed the size of a uint32_t...
if (nibble_count >= (sizeof(uint32_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -227,7 +227,7 @@ StringExtractor::GetHexMaxU32 (bool little_endian, uint32_t fail_value)
// Make sure we don't exceed the size of a uint32_t...
if (nibble_count >= (sizeof(uint32_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -257,7 +257,7 @@ StringExtractor::GetHexMaxU64 (bool little_endian, uint64_t fail_value)
// Make sure we don't exceed the size of a uint64_t...
if (nibble_count >= (sizeof(uint64_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -289,7 +289,7 @@ StringExtractor::GetHexMaxU64 (bool little_endian, uint64_t fail_value)
// Make sure we don't exceed the size of a uint64_t...
if (nibble_count >= (sizeof(uint64_t) * 2))
{
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -341,7 +341,7 @@ StringExtractor::GetHexWithFixedSize (uint32_t byte_size, bool little_endian, ui
// Little Endian
uint32_t shift_amount;
for (i = 0, shift_amount = 0;
- i < byte_size && m_index != UINT32_MAX;
+ i < byte_size && IsGood();
++i, shift_amount += 8)
{
result |= ((uint64_t)GetHexU8() << shift_amount);
@@ -350,14 +350,14 @@ StringExtractor::GetHexWithFixedSize (uint32_t byte_size, bool little_endian, ui
else
{
// Big Endian
- for (i = 0; i < byte_size && m_index != UINT32_MAX; ++i)
+ for (i = 0; i < byte_size && IsGood(); ++i)
{
result <<= 8;
result |= GetHexU8();
}
}
}
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return fail_value;
}
@@ -392,6 +392,6 @@ StringExtractor::GetNameColonValue (std::string &name, std::string &value)
}
}
}
- m_index = UINT32_MAX;
+ m_index = UINT64_MAX;
return false;
}
diff --git a/lldb/source/Utility/StringExtractor.h b/lldb/source/Utility/StringExtractor.h
index 73f0117d813..df4a97aedf5 100644
--- a/lldb/source/Utility/StringExtractor.h
+++ b/lldb/source/Utility/StringExtractor.h
@@ -45,10 +45,10 @@ public:
bool
IsGood() const
{
- return m_index != UINT32_MAX;
+ return m_index != UINT64_MAX;
}
- uint32_t
+ uint64_t
GetFilePos () const
{
return m_index;
@@ -79,7 +79,7 @@ public:
return m_packet.empty();
}
- uint32_t
+ size_t
GetBytesLeft ()
{
if (m_index < m_packet.size())
@@ -126,9 +126,9 @@ protected:
// For StringExtractor only
//------------------------------------------------------------------
std::string m_packet; // The string in which to extract data.
- uint32_t m_index; // When extracting data from a packet, this index
+ uint64_t m_index; // When extracting data from a packet, this index
// will march along as things get extracted. If set
- // to UINT32_MAX the end of the packet data was
+ // to UINT64_MAX the end of the packet data was
// reached when decoding information
};
diff --git a/lldb/tools/debugserver/source/DNBDataRef.cpp b/lldb/tools/debugserver/source/DNBDataRef.cpp
index eab379aac3b..9cf0f01d02c 100644
--- a/lldb/tools/debugserver/source/DNBDataRef.cpp
+++ b/lldb/tools/debugserver/source/DNBDataRef.cpp
@@ -195,105 +195,6 @@ DNBDataRef::GetPointer(offset_t *offset_ptr) const
assert(m_ptrSize != 0);
return GetMax64(offset_ptr, m_ptrSize);
}
-
-//----------------------------------------------------------------------
-// GetDwarfEHPtr
-//
-// Used for calls when the value type is specified by a DWARF EH Frame
-// pointer encoding.
-//----------------------------------------------------------------------
-/*
-uint64_t
-DNBDataRef::GetDwarfEHPtr(offset_t *offset_ptr, uint32_t encoding) const
-{
- if (encoding == DW_EH_PE_omit)
- return ULLONG_MAX; // Value isn't in the buffer...
-
- uint64_t baseAddress = 0;
- uint64_t addressValue = 0;
-
- BOOL signExtendValue = NO;
- // Decode the base part or adjust our offset
- switch (encoding & 0x70)
- {
- case DW_EH_PE_pcrel:
- // SetEHPtrBaseAddresses should be called prior to extracting these
- // so the base addresses are cached.
- assert(m_addrPCRelative != INVALID_NUB_ADDRESS);
- signExtendValue = YES;
- baseAddress = *offset_ptr + m_addrPCRelative;
- break;
-
- case DW_EH_PE_textrel:
- // SetEHPtrBaseAddresses should be called prior to extracting these
- // so the base addresses are cached.
- assert(m_addrTEXT != INVALID_NUB_ADDRESS);
- signExtendValue = YES;
- baseAddress = m_addrTEXT;
- break;
-
- case DW_EH_PE_datarel:
- // SetEHPtrBaseAddresses should be called prior to extracting these
- // so the base addresses are cached.
- assert(m_addrDATA != INVALID_NUB_ADDRESS);
- signExtendValue = YES;
- baseAddress = m_addrDATA;
- break;
-
- case DW_EH_PE_funcrel:
- signExtendValue = YES;
- break;
-
- case DW_EH_PE_aligned:
- // SetPointerSize should be called prior to extracting these so the
- // pointer size is cached
- assert(m_ptrSize != 0);
- if (m_ptrSize)
- {
- // Align to a address size boundary first
- uint32_t alignOffset = *offset_ptr % m_ptrSize;
- if (alignOffset)
- offset_ptr += m_ptrSize - alignOffset;
- }
- break;
-
- default:
- break;
- }
-
- // Decode the value part
- switch (encoding & DW_EH_PE_MASK_ENCODING)
- {
- case DW_EH_PE_absptr : addressValue = GetPointer(offset_ptr); break;
- case DW_EH_PE_uleb128 : addressValue = Get_ULEB128(offset_ptr); break;
- case DW_EH_PE_udata2 : addressValue = Get16(offset_ptr); break;
- case DW_EH_PE_udata4 : addressValue = Get32(offset_ptr); break;
- case DW_EH_PE_udata8 : addressValue = Get64(offset_ptr); break;
- case DW_EH_PE_sleb128 : addressValue = Get_SLEB128(offset_ptr); break;
- case DW_EH_PE_sdata2 : addressValue = (int16_t)Get16(offset_ptr); break;
- case DW_EH_PE_sdata4 : addressValue = (int32_t)Get32(offset_ptr); break;
- case DW_EH_PE_sdata8 : addressValue = (int64_t)Get64(offset_ptr); break;
- default:
- // Unhandled encoding type
- assert(encoding);
- break;
- }
-
- // Since we promote everything to 64 bit, we may need to sign extend
- if (signExtendValue && m_ptrSize < sizeof(baseAddress))
- {
- uint64_t sign_bit = 1ull << ((m_ptrSize * 8ull) - 1ull);
- if (sign_bit & addressValue)
- {
- uint64_t mask = ~sign_bit + 1;
- addressValue |= mask;
- }
- }
- return baseAddress + addressValue;
-}
-*/
-
-
//----------------------------------------------------------------------
// GetCStr
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud