aboutsummaryrefslogtreecommitdiffstats
path: root/include/lldb
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0 /include/lldb
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
downloadsrc-f73363f1dd94996356cefbf24388f561891acf0b.tar.gz
src-f73363f1dd94996356cefbf24388f561891acf0b.zip
Vendor import of lldb trunk r338150:vendor/lldb/lldb-trunk-r338150
Notes
Notes: svn path=/vendor/lldb/dist/; revision=336823 svn path=/vendor/lldb/lldb-trunk-r338150/; revision=336824; tag=vendor/lldb/lldb-trunk-r338150
Diffstat (limited to 'include/lldb')
-rw-r--r--include/lldb/API/SBAddress.h12
-rw-r--r--include/lldb/API/SBBroadcaster.h14
-rw-r--r--include/lldb/API/SBCommandInterpreter.h50
-rw-r--r--include/lldb/API/SBCommandReturnObject.h3
-rw-r--r--include/lldb/API/SBData.h14
-rw-r--r--include/lldb/API/SBDebugger.h2
-rw-r--r--include/lldb/API/SBExpressionOptions.h6
-rw-r--r--include/lldb/API/SBFrame.h8
-rw-r--r--include/lldb/API/SBInstruction.h5
-rw-r--r--include/lldb/API/SBInstructionList.h4
-rw-r--r--include/lldb/API/SBLaunchInfo.h9
-rw-r--r--include/lldb/API/SBModule.h15
-rw-r--r--include/lldb/API/SBProcess.h42
-rw-r--r--include/lldb/API/SBStream.h13
-rw-r--r--include/lldb/API/SBStructuredData.h1
-rw-r--r--include/lldb/API/SBSymbol.h4
-rw-r--r--include/lldb/API/SBTarget.h29
-rw-r--r--include/lldb/API/SBThread.h16
-rw-r--r--include/lldb/API/SBValue.h3
-rw-r--r--include/lldb/API/SBValueList.h4
-rw-r--r--include/lldb/API/SystemInitializerFull.h38
-rw-r--r--include/lldb/Breakpoint/Breakpoint.h175
-rw-r--r--include/lldb/Breakpoint/BreakpointID.h2
-rw-r--r--include/lldb/Breakpoint/BreakpointIDList.h2
-rw-r--r--include/lldb/Breakpoint/BreakpointList.h21
-rw-r--r--include/lldb/Breakpoint/BreakpointLocation.h73
-rw-r--r--include/lldb/Breakpoint/BreakpointLocationCollection.h4
-rw-r--r--include/lldb/Breakpoint/BreakpointLocationList.h73
-rw-r--r--include/lldb/Breakpoint/BreakpointName.h4
-rw-r--r--include/lldb/Breakpoint/BreakpointOptions.h59
-rw-r--r--include/lldb/Breakpoint/BreakpointResolver.h64
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverAddress.h10
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverFileLine.h9
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverFileRegex.h5
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverName.h10
-rw-r--r--include/lldb/Breakpoint/BreakpointSite.h71
-rw-r--r--include/lldb/Breakpoint/BreakpointSiteList.h21
-rw-r--r--include/lldb/Breakpoint/StoppointCallbackContext.h11
-rw-r--r--include/lldb/Breakpoint/StoppointLocation.h4
-rw-r--r--include/lldb/Breakpoint/Watchpoint.h12
-rw-r--r--include/lldb/Breakpoint/WatchpointList.h28
-rw-r--r--include/lldb/Breakpoint/WatchpointOptions.h31
-rw-r--r--include/lldb/Core/Address.h202
-rw-r--r--include/lldb/Core/AddressRange.h54
-rw-r--r--include/lldb/Core/AddressResolver.h14
-rw-r--r--include/lldb/Core/AddressResolverFileLine.h7
-rw-r--r--include/lldb/Core/AddressResolverName.h10
-rw-r--r--include/lldb/Core/Architecture.h36
-rw-r--r--include/lldb/Core/Broadcaster.h83
-rw-r--r--include/lldb/Core/Communication.h163
-rw-r--r--include/lldb/Core/Debugger.h35
-rw-r--r--include/lldb/Core/Disassembler.h59
-rw-r--r--include/lldb/Core/DumpRegisterValue.h31
-rw-r--r--include/lldb/Core/EmulateInstruction.h104
-rw-r--r--include/lldb/Core/Event.h6
-rw-r--r--include/lldb/Core/FileLineResolver.h5
-rw-r--r--include/lldb/Core/FileSpecList.h37
-rw-r--r--include/lldb/Core/FormatEntity.h13
-rw-r--r--include/lldb/Core/IOHandler.h30
-rw-r--r--include/lldb/Core/LoadedModuleInfoList.h4
-rw-r--r--include/lldb/Core/Mangled.h56
-rw-r--r--include/lldb/Core/MappedHash.h219
-rw-r--r--include/lldb/Core/Module.h402
-rw-r--r--include/lldb/Core/ModuleChild.h2
-rw-r--r--include/lldb/Core/ModuleList.h92
-rw-r--r--include/lldb/Core/ModuleSpec.h8
-rw-r--r--include/lldb/Core/PluginManager.h10
-rw-r--r--include/lldb/Core/RangeMap.h75
-rw-r--r--include/lldb/Core/RegisterValue.h23
-rw-r--r--include/lldb/Core/STLUtils.h4
-rw-r--r--include/lldb/Core/Scalar.h58
-rw-r--r--include/lldb/Core/SearchFilter.h55
-rw-r--r--include/lldb/Core/Section.h9
-rw-r--r--include/lldb/Core/SourceManager.h5
-rw-r--r--include/lldb/Core/StreamBuffer.h5
-rw-r--r--include/lldb/Core/ThreadSafeDenseSet.h2
-rw-r--r--include/lldb/Core/ThreadSafeValue.h1
-rw-r--r--include/lldb/Core/UniqueCStringMap.h73
-rw-r--r--include/lldb/Core/UserSettingsController.h19
-rw-r--r--include/lldb/Core/Value.h10
-rw-r--r--include/lldb/Core/ValueObject.h74
-rw-r--r--include/lldb/Core/ValueObjectSyntheticFilter.h6
-rw-r--r--include/lldb/DataFormatters/DataVisualization.h11
-rw-r--r--include/lldb/DataFormatters/FormatClasses.h4
-rw-r--r--include/lldb/DataFormatters/FormatManager.h47
-rw-r--r--include/lldb/DataFormatters/FormattersContainer.h10
-rw-r--r--include/lldb/DataFormatters/StringPrinter.h3
-rw-r--r--include/lldb/DataFormatters/TypeFormat.h7
-rw-r--r--include/lldb/DataFormatters/TypeSummary.h11
-rw-r--r--include/lldb/DataFormatters/TypeSynthetic.h50
-rw-r--r--include/lldb/DataFormatters/TypeValidator.h7
-rw-r--r--include/lldb/DataFormatters/ValueObjectPrinter.h8
-rw-r--r--include/lldb/DataFormatters/VectorIterator.h1
-rw-r--r--include/lldb/Expression/DWARFExpression.h81
-rw-r--r--include/lldb/Expression/Expression.h29
-rw-r--r--include/lldb/Expression/ExpressionParser.h16
-rw-r--r--include/lldb/Expression/ExpressionSourceCode.h5
-rw-r--r--include/lldb/Expression/ExpressionTypeSystemHelper.h6
-rw-r--r--include/lldb/Expression/ExpressionVariable.h24
-rw-r--r--include/lldb/Expression/FunctionCaller.h27
-rw-r--r--include/lldb/Expression/IRDynamicChecks.h33
-rw-r--r--include/lldb/Expression/IRExecutionUnit.h62
-rw-r--r--include/lldb/Expression/IRInterpreter.h8
-rw-r--r--include/lldb/Expression/IRMemoryMap.h22
-rw-r--r--include/lldb/Expression/LLVMUserExpression.h23
-rw-r--r--include/lldb/Expression/UserExpression.h27
-rw-r--r--include/lldb/Expression/UtilityFunction.h37
-rw-r--r--include/lldb/Host/Config.h4
-rw-r--r--include/lldb/Host/Config.h.cmake8
-rw-r--r--include/lldb/Host/Debug.h10
-rw-r--r--include/lldb/Host/Editline.h27
-rw-r--r--include/lldb/Host/File.h81
-rw-r--r--include/lldb/Host/Host.h77
-rw-r--r--include/lldb/Host/HostInfo.h21
-rw-r--r--include/lldb/Host/HostInfoBase.h53
-rw-r--r--include/lldb/Host/HostProcess.h14
-rw-r--r--include/lldb/Host/HostThread.h2
-rw-r--r--include/lldb/Host/MainLoop.h26
-rw-r--r--include/lldb/Host/MainLoopBase.h21
-rw-r--r--include/lldb/Host/MonitoringProcessLauncher.h3
-rw-r--r--include/lldb/Host/PosixApi.h5
-rw-r--r--include/lldb/Host/Predicate.h350
-rw-r--r--include/lldb/Host/ProcessRunLock.h6
-rw-r--r--include/lldb/Host/PseudoTerminal.h106
-rw-r--r--include/lldb/Host/Socket.h6
-rw-r--r--include/lldb/Host/SocketAddress.h28
-rw-r--r--include/lldb/Host/StringConvert.h2
-rw-r--r--include/lldb/Host/Symbols.h16
-rw-r--r--include/lldb/Host/TaskPool.h31
-rw-r--r--include/lldb/Host/Terminal.h21
-rw-r--r--include/lldb/Host/XML.h22
-rw-r--r--include/lldb/Host/common/GetOptInc.h4
-rw-r--r--include/lldb/Host/common/NativeBreakpoint.h4
-rw-r--r--include/lldb/Host/common/NativeProcessProtocol.h36
-rw-r--r--include/lldb/Host/common/NativeRegisterContext.h17
-rw-r--r--include/lldb/Host/common/NativeThreadProtocol.h8
-rw-r--r--include/lldb/Host/freebsd/HostInfoFreeBSD.h3
-rw-r--r--include/lldb/Host/linux/HostInfoLinux.h4
-rw-r--r--include/lldb/Host/macosx/HostInfoMacOSX.h5
-rw-r--r--include/lldb/Host/netbsd/HostInfoNetBSD.h3
-rw-r--r--include/lldb/Host/posix/ConnectionFileDescriptorPosix.h6
-rw-r--r--include/lldb/Host/posix/HostInfoPosix.h7
-rw-r--r--include/lldb/Host/posix/PipePosix.h2
-rw-r--r--include/lldb/Host/windows/HostInfoWindows.h6
-rw-r--r--include/lldb/Host/windows/PipeWindows.h2
-rw-r--r--include/lldb/Host/windows/PosixApi.h2
-rw-r--r--include/lldb/Interpreter/CommandAlias.h21
-rw-r--r--include/lldb/Interpreter/CommandCompletions.h99
-rw-r--r--include/lldb/Interpreter/CommandInterpreter.h85
-rw-r--r--include/lldb/Interpreter/CommandObject.h148
-rw-r--r--include/lldb/Interpreter/CommandObjectMultiword.h26
-rw-r--r--include/lldb/Interpreter/CommandObjectRegexCommand.h8
-rw-r--r--include/lldb/Interpreter/OptionArgParser.h43
-rw-r--r--include/lldb/Interpreter/OptionGroupBoolean.h6
-rw-r--r--include/lldb/Interpreter/OptionGroupPlatform.h7
-rw-r--r--include/lldb/Interpreter/OptionValue.h26
-rw-r--r--include/lldb/Interpreter/OptionValueArch.h6
-rw-r--r--include/lldb/Interpreter/OptionValueArray.h12
-rw-r--r--include/lldb/Interpreter/OptionValueBoolean.h5
-rw-r--r--include/lldb/Interpreter/OptionValueEnumeration.h5
-rw-r--r--include/lldb/Interpreter/OptionValueFileSpec.h5
-rw-r--r--include/lldb/Interpreter/OptionValueFormatEntity.h5
-rw-r--r--include/lldb/Interpreter/OptionValueProperties.h10
-rw-r--r--include/lldb/Interpreter/OptionValueUInt64.h6
-rw-r--r--include/lldb/Interpreter/OptionValueUUID.h5
-rw-r--r--include/lldb/Interpreter/Options.h265
-rw-r--r--include/lldb/Interpreter/ScriptInterpreter.h17
-rw-r--r--include/lldb/Symbol/Block.h53
-rw-r--r--include/lldb/Symbol/ClangASTContext.h29
-rw-r--r--include/lldb/Symbol/ClangASTImporter.h11
-rw-r--r--include/lldb/Symbol/ClangExternalASTSourceCallbacks.h12
-rw-r--r--include/lldb/Symbol/CompactUnwindInfo.h33
-rw-r--r--include/lldb/Symbol/CompileUnit.h114
-rw-r--r--include/lldb/Symbol/CompilerType.h72
-rw-r--r--include/lldb/Symbol/DWARFCallFrameInfo.h44
-rw-r--r--include/lldb/Symbol/DeclVendor.h5
-rw-r--r--include/lldb/Symbol/Declaration.h23
-rw-r--r--include/lldb/Symbol/FuncUnwinders.h45
-rw-r--r--include/lldb/Symbol/Function.h110
-rw-r--r--include/lldb/Symbol/GoASTContext.h11
-rw-r--r--include/lldb/Symbol/LineEntry.h42
-rw-r--r--include/lldb/Symbol/LineTable.h23
-rw-r--r--include/lldb/Symbol/ObjectContainer.h65
-rw-r--r--include/lldb/Symbol/ObjectFile.h409
-rw-r--r--include/lldb/Symbol/Symbol.h70
-rw-r--r--include/lldb/Symbol/SymbolContext.h123
-rw-r--r--include/lldb/Symbol/SymbolContextScope.h51
-rw-r--r--include/lldb/Symbol/SymbolFile.h14
-rw-r--r--include/lldb/Symbol/SymbolVendor.h19
-rw-r--r--include/lldb/Symbol/Type.h38
-rw-r--r--include/lldb/Symbol/TypeSystem.h50
-rw-r--r--include/lldb/Symbol/UnwindPlan.h47
-rw-r--r--include/lldb/Symbol/UnwindTable.h21
-rw-r--r--include/lldb/Symbol/Variable.h14
-rw-r--r--include/lldb/Symbol/VariableList.h11
-rw-r--r--include/lldb/Target/ABI.h15
-rw-r--r--include/lldb/Target/DynamicLoader.h143
-rw-r--r--include/lldb/Target/ExecutionContext.h395
-rw-r--r--include/lldb/Target/ExecutionContextScope.h29
-rw-r--r--include/lldb/Target/JITLoader.h28
-rw-r--r--include/lldb/Target/Language.h19
-rw-r--r--include/lldb/Target/LanguageRuntime.h31
-rw-r--r--include/lldb/Target/Memory.h4
-rw-r--r--include/lldb/Target/MemoryRegionInfo.h20
-rw-r--r--include/lldb/Target/ModuleCache.h9
-rw-r--r--include/lldb/Target/ObjCLanguageRuntime.h27
-rw-r--r--include/lldb/Target/OperatingSystem.h11
-rw-r--r--include/lldb/Target/PathMappingList.h2
-rw-r--r--include/lldb/Target/Platform.h349
-rw-r--r--include/lldb/Target/Process.h934
-rw-r--r--include/lldb/Target/ProcessInfo.h21
-rw-r--r--include/lldb/Target/ProcessLaunchInfo.h13
-rw-r--r--include/lldb/Target/ProcessStructReader.h1
-rw-r--r--include/lldb/Target/Queue.h13
-rw-r--r--include/lldb/Target/QueueItem.h11
-rw-r--r--include/lldb/Target/QueueList.h9
-rw-r--r--include/lldb/Target/RegisterCheckpoint.h15
-rw-r--r--include/lldb/Target/RegisterContext.h18
-rw-r--r--include/lldb/Target/RegisterNumber.h4
-rw-r--r--include/lldb/Target/SectionLoadHistory.h16
-rw-r--r--include/lldb/Target/SectionLoadList.h12
-rw-r--r--include/lldb/Target/StackFrame.h80
-rw-r--r--include/lldb/Target/StackID.h18
-rw-r--r--include/lldb/Target/StopInfo.h52
-rw-r--r--include/lldb/Target/SystemRuntime.h136
-rw-r--r--include/lldb/Target/Target.h166
-rw-r--r--include/lldb/Target/Thread.h138
-rw-r--r--include/lldb/Target/ThreadCollection.h6
-rw-r--r--include/lldb/Target/ThreadList.h13
-rw-r--r--include/lldb/Target/ThreadPlan.h62
-rw-r--r--include/lldb/Target/ThreadPlanCallFunction.h39
-rw-r--r--include/lldb/Target/ThreadPlanCallFunctionUsingABI.h8
-rw-r--r--include/lldb/Target/ThreadPlanShouldStopHere.h28
-rw-r--r--include/lldb/Target/ThreadPlanStepOverBreakpoint.h1
-rw-r--r--include/lldb/Target/ThreadPlanStepRange.h7
-rw-r--r--include/lldb/Target/UnixSignals.h35
-rw-r--r--include/lldb/Utility/AnsiTerminal.h11
-rw-r--r--include/lldb/Utility/ArchSpec.h146
-rw-r--r--include/lldb/Utility/Args.h (renamed from include/lldb/Interpreter/Args.h)321
-rw-r--r--include/lldb/Utility/Baton.h10
-rw-r--r--include/lldb/Utility/CleanUp.h252
-rw-r--r--include/lldb/Utility/CompletionRequest.h120
-rw-r--r--include/lldb/Utility/Connection.h32
-rw-r--r--include/lldb/Utility/ConstString.h176
-rw-r--r--include/lldb/Utility/DataBuffer.h39
-rw-r--r--include/lldb/Utility/DataBufferHeap.h29
-rw-r--r--include/lldb/Utility/DataBufferLLVM.h4
-rw-r--r--include/lldb/Utility/DataEncoder.h102
-rw-r--r--include/lldb/Utility/DataExtractor.h356
-rw-r--r--include/lldb/Utility/Environment.h96
-rw-r--r--include/lldb/Utility/FileSpec.h169
-rw-r--r--include/lldb/Utility/Flags.h16
-rw-r--r--include/lldb/Utility/History.h136
-rw-r--r--include/lldb/Utility/JSON.h5
-rw-r--r--include/lldb/Utility/Log.h47
-rw-r--r--include/lldb/Utility/RegularExpression.h41
-rw-r--r--include/lldb/Utility/SafeMachO.h17
-rw-r--r--include/lldb/Utility/SelectHelper.h31
-rw-r--r--include/lldb/Utility/SharedCluster.h8
-rw-r--r--include/lldb/Utility/SharingPtr.h6
-rw-r--r--include/lldb/Utility/Status.h80
-rw-r--r--include/lldb/Utility/Stream.h64
-rw-r--r--include/lldb/Utility/StreamTee.h21
-rw-r--r--include/lldb/Utility/StringExtractor.h10
-rw-r--r--include/lldb/Utility/StringExtractorGDBRemote.h204
-rw-r--r--include/lldb/Utility/StringList.h17
-rw-r--r--include/lldb/Utility/StructuredData.h18
-rw-r--r--include/lldb/Utility/TildeExpressionResolver.h8
-rw-r--r--include/lldb/Utility/Timeout.h6
-rw-r--r--include/lldb/Utility/Timer.h2
-rw-r--r--include/lldb/Utility/UUID.h101
-rw-r--r--include/lldb/Utility/UserID.h18
-rw-r--r--include/lldb/lldb-defines.h4
-rw-r--r--include/lldb/lldb-enumerations.h165
-rw-r--r--include/lldb/lldb-forward.h1
-rw-r--r--include/lldb/lldb-private-defines.h2
-rw-r--r--include/lldb/lldb-private-enumerations.h58
-rw-r--r--include/lldb/lldb-private-forward.h7
-rw-r--r--include/lldb/lldb-private-types.h35
-rw-r--r--include/lldb/lldb-types.h4
-rw-r--r--include/lldb/lldb-versioning.h4
-rw-r--r--include/lldb/module.modulemap139
282 files changed, 6208 insertions, 6927 deletions
diff --git a/include/lldb/API/SBAddress.h b/include/lldb/API/SBAddress.h
index 9e697beffdd1..02e847b97aa1 100644
--- a/include/lldb/API/SBAddress.h
+++ b/include/lldb/API/SBAddress.h
@@ -54,9 +54,9 @@ public:
lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope);
// The following functions grab individual objects for a given address and
- // are less efficient if you want more than one symbol related objects.
- // Use one of the following when you want multiple debug symbol related
- // objects for an address:
+ // are less efficient if you want more than one symbol related objects. Use
+ // one of the following when you want multiple debug symbol related objects
+ // for an address:
// lldb::SBSymbolContext SBAddress::GetSymbolContext (uint32_t
// resolve_scope);
// lldb::SBSymbolContext SBTarget::ResolveSymbolContextForAddress (const
@@ -80,8 +80,6 @@ public:
lldb::SBLineEntry GetLineEntry();
- lldb::AddressClass GetAddressClass();
-
protected:
friend class SBBlock;
friend class SBBreakpointLocation;
@@ -103,7 +101,7 @@ protected:
const lldb_private::Address *operator->() const;
- friend bool operator==(const SBAddress &lhs, const SBAddress &rhs);
+ friend bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
lldb_private::Address *get();
@@ -119,7 +117,7 @@ private:
std::unique_ptr<lldb_private::Address> m_opaque_ap;
};
-bool operator==(const SBAddress &lhs, const SBAddress &rhs);
+bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
} // namespace lldb
diff --git a/include/lldb/API/SBBroadcaster.h b/include/lldb/API/SBBroadcaster.h
index 3fc47af65513..dc6c50ec0a8a 100644
--- a/include/lldb/API/SBBroadcaster.h
+++ b/include/lldb/API/SBBroadcaster.h
@@ -46,17 +46,17 @@ public:
bool RemoveListener(const lldb::SBListener &listener,
uint32_t event_mask = UINT32_MAX);
- // This comparison is checking if the internal opaque pointer value
- // is equal to that in "rhs".
+ // This comparison is checking if the internal opaque pointer value is equal
+ // to that in "rhs".
bool operator==(const lldb::SBBroadcaster &rhs) const;
- // This comparison is checking if the internal opaque pointer value
- // is not equal to that in "rhs".
+ // This comparison is checking if the internal opaque pointer value is not
+ // equal to that in "rhs".
bool operator!=(const lldb::SBBroadcaster &rhs) const;
- // This comparison is checking if the internal opaque pointer value
- // is less than that in "rhs" so SBBroadcaster objects can be contained
- // in ordered containers.
+ // This comparison is checking if the internal opaque pointer value is less
+ // than that in "rhs" so SBBroadcaster objects can be contained in ordered
+ // containers.
bool operator<(const lldb::SBBroadcaster &rhs) const;
protected:
diff --git a/include/lldb/API/SBCommandInterpreter.h b/include/lldb/API/SBCommandInterpreter.h
index 80f24ceca7b4..8b9f06599366 100644
--- a/include/lldb/API/SBCommandInterpreter.h
+++ b/include/lldb/API/SBCommandInterpreter.h
@@ -138,23 +138,20 @@ public:
lldb::SBCommandReturnObject result);
// The pointer based interface is not useful in SWIG, since the cursor &
- // last_char arguments are string pointers INTO current_line
- // and you can't do that in a scripting language interface in general...
+ // last_char arguments are string pointers INTO current_line and you can't do
+ // that in a scripting language interface in general...
// In either case, the way this works is that the you give it a line and
- // cursor position in the line. The function
- // will return the number of completions. The matches list will contain
- // number_of_completions + 1 elements. The first
- // element is the common substring after the cursor position for all the
- // matches. The rest of the elements are the
- // matches. The first element is useful if you are emulating the common shell
- // behavior where the tab completes
- // to the string that is common among all the matches, then you should first
- // check if the first element is non-empty,
+ // cursor position in the line. The function will return the number of
+ // completions. The matches list will contain number_of_completions + 1
+ // elements. The first element is the common substring after the cursor
+ // position for all the matches. The rest of the elements are the matches.
+ // The first element is useful if you are emulating the common shell behavior
+ // where the tab completes to the string that is common among all the
+ // matches, then you should first check if the first element is non-empty,
// and if so just insert it and move the cursor to the end of the insertion.
- // The next tab will return an empty
- // common substring, and a list of choices (if any), at which point you should
- // display the choices and let the user
+ // The next tab will return an empty common substring, and a list of choices
+ // (if any), at which point you should display the choices and let the user
// type further to disambiguate.
int HandleCompletion(const char *current_line, const char *cursor,
@@ -167,9 +164,9 @@ public:
bool WasInterrupted() const;
- // Catch commands before they execute by registering a callback that will
- // get called when the command gets executed. This allows GUI or command
- // line interfaces to intercept a command and stop it from happening
+ // Catch commands before they execute by registering a callback that will get
+ // called when the command gets executed. This allows GUI or command line
+ // interfaces to intercept a command and stop it from happening
bool SetCommandOverrideCallback(const char *command_name,
lldb::CommandOverrideCallback callback,
void *baton);
@@ -211,6 +208,25 @@ public:
void SetPromptOnQuit(bool b);
//----------------------------------------------------------------------
+ /// Sets whether the command interpreter should allow custom exit codes
+ /// for the 'quit' command.
+ //----------------------------------------------------------------------
+ void AllowExitCodeOnQuit(bool allow);
+
+ //----------------------------------------------------------------------
+ /// Returns true if the user has called the 'quit' command with a custom exit
+ /// code.
+ //----------------------------------------------------------------------
+ bool HasCustomQuitExitCode();
+
+ //----------------------------------------------------------------------
+ /// Returns the exit code that the user has specified when running the
+ /// 'quit' command. Returns 0 if the user hasn't called 'quit' at all or
+ /// without a custom exit code.
+ //----------------------------------------------------------------------
+ int GetQuitStatus();
+
+ //----------------------------------------------------------------------
/// Resolve the command just as HandleCommand would, expanding abbreviations
/// and aliases. If successful, result->GetOutput has the full expansion.
//----------------------------------------------------------------------
diff --git a/include/lldb/API/SBCommandReturnObject.h b/include/lldb/API/SBCommandReturnObject.h
index c73e3f7cf1f2..a372ea2ad9ee 100644
--- a/include/lldb/API/SBCommandReturnObject.h
+++ b/include/lldb/API/SBCommandReturnObject.h
@@ -67,8 +67,7 @@ public:
bool GetDescription(lldb::SBStream &description);
- // deprecated, these two functions do not take
- // ownership of file handle
+ // deprecated, these two functions do not take ownership of file handle
void SetImmediateOutputFile(FILE *fh);
void SetImmediateErrorFile(FILE *fh);
diff --git a/include/lldb/API/SBData.h b/include/lldb/API/SBData.h
index 7aa4ea0ff8d0..7ff619e68667 100644
--- a/include/lldb/API/SBData.h
+++ b/include/lldb/API/SBData.h
@@ -71,11 +71,10 @@ public:
lldb::addr_t base_addr = LLDB_INVALID_ADDRESS);
// it would be nice to have SetData(SBError, const void*, size_t) when
- // endianness and address size can be
- // inferred from the existing DataExtractor, but having two SetData()
- // signatures triggers a SWIG bug where
- // the typemap isn't applied before resolving the overload, and thus the right
- // function never gets called
+ // endianness and address size can be inferred from the existing
+ // DataExtractor, but having two SetData() signatures triggers a SWIG bug
+ // where the typemap isn't applied before resolving the overload, and thus
+ // the right function never gets called
void SetData(lldb::SBError &error, const void *buf, size_t size,
lldb::ByteOrder endian, uint8_t addr_size);
@@ -87,9 +86,8 @@ public:
const char *data);
// in the following CreateData*() and SetData*() prototypes, the two
- // parameters array and array_len
- // should not be renamed or rearranged, because doing so will break the SWIG
- // typemap
+ // parameters array and array_len should not be renamed or rearranged,
+ // because doing so will break the SWIG typemap
static lldb::SBData CreateDataFromUInt64Array(lldb::ByteOrder endian,
uint32_t addr_byte_size,
uint64_t *array,
diff --git a/include/lldb/API/SBDebugger.h b/include/lldb/API/SBDebugger.h
index 8379a6911afc..a416b460f318 100644
--- a/include/lldb/API/SBDebugger.h
+++ b/include/lldb/API/SBDebugger.h
@@ -181,6 +181,8 @@ public:
static const char *StateAsCString(lldb::StateType state);
+ static SBStructuredData GetBuildConfiguration();
+
static bool StateIsRunningState(lldb::StateType state);
static bool StateIsStoppedState(lldb::StateType state);
diff --git a/include/lldb/API/SBExpressionOptions.h b/include/lldb/API/SBExpressionOptions.h
index 370811d0c355..1459ba6fee2a 100644
--- a/include/lldb/API/SBExpressionOptions.h
+++ b/include/lldb/API/SBExpressionOptions.h
@@ -51,10 +51,8 @@ public:
uint32_t GetOneThreadTimeoutInMicroSeconds() const;
// Set the timeout for running on one thread, 0 means use the default
- // behavior.
- // If you set this higher than the overall timeout, you'll get an error when
- // you
- // try to run the expression.
+ // behavior. If you set this higher than the overall timeout, you'll get an
+ // error when you try to run the expression.
void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout = 0);
bool GetTryAllThreads() const;
diff --git a/include/lldb/API/SBFrame.h b/include/lldb/API/SBFrame.h
index 58339750def6..b8953dd13236 100644
--- a/include/lldb/API/SBFrame.h
+++ b/include/lldb/API/SBFrame.h
@@ -153,10 +153,10 @@ public:
lldb::DynamicValueType use_dynamic);
// Find a value for a variable expression path like "rect.origin.x" or
- // "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_
- // and expression result and is not a constant object like
- // SBFrame::EvaluateExpression(...) returns, but a child object of
- // the variable value.
+ // "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_ and
+ // expression result and is not a constant object like
+ // SBFrame::EvaluateExpression(...) returns, but a child object of the
+ // variable value.
lldb::SBValue GetValueForVariablePath(const char *var_expr_cstr,
DynamicValueType use_dynamic);
diff --git a/include/lldb/API/SBInstruction.h b/include/lldb/API/SBInstruction.h
index 23daf1c56637..5ef02b8f696a 100644
--- a/include/lldb/API/SBInstruction.h
+++ b/include/lldb/API/SBInstruction.h
@@ -16,8 +16,7 @@
#include <stdio.h>
// There's a lot to be fixed here, but need to wait for underlying insn
-// implementation
-// to be revised & settle down first.
+// implementation to be revised & settle down first.
class InstructionImpl;
@@ -37,8 +36,6 @@ public:
SBAddress GetAddress();
- lldb::AddressClass GetAddressClass();
-
const char *GetMnemonic(lldb::SBTarget target);
const char *GetOperands(lldb::SBTarget target);
diff --git a/include/lldb/API/SBInstructionList.h b/include/lldb/API/SBInstructionList.h
index 0323a3c80c05..c8fed5c83192 100644
--- a/include/lldb/API/SBInstructionList.h
+++ b/include/lldb/API/SBInstructionList.h
@@ -33,8 +33,8 @@ public:
lldb::SBInstruction GetInstructionAtIndex(uint32_t idx);
// ----------------------------------------------------------------------
- // Returns the number of instructions between the start and end address.
- // If canSetBreakpoint is true then the count will be the number of
+ // Returns the number of instructions between the start and end address. If
+ // canSetBreakpoint is true then the count will be the number of
// instructions on which a breakpoint can be set.
// ----------------------------------------------------------------------
size_t GetInstructionsCount(const SBAddress &start,
diff --git a/include/lldb/API/SBLaunchInfo.h b/include/lldb/API/SBLaunchInfo.h
index 1cece235127f..80eea7e42921 100644
--- a/include/lldb/API/SBLaunchInfo.h
+++ b/include/lldb/API/SBLaunchInfo.h
@@ -12,6 +12,10 @@
#include "lldb/API/SBDefines.h"
+namespace lldb_private {
+class SBLaunchInfoImpl;
+}
+
namespace lldb {
class SBPlatform;
@@ -141,11 +145,10 @@ protected:
friend class SBPlatform;
friend class SBTarget;
- lldb_private::ProcessLaunchInfo &ref();
-
const lldb_private::ProcessLaunchInfo &ref() const;
+ void set_ref(const lldb_private::ProcessLaunchInfo &info);
- ProcessLaunchInfoSP m_opaque_sp;
+ std::shared_ptr<lldb_private::SBLaunchInfoImpl> m_opaque_sp;
};
} // namespace lldb
diff --git a/include/lldb/API/SBModule.h b/include/lldb/API/SBModule.h
index bcc3997a275b..d73267f8af50 100644
--- a/include/lldb/API/SBModule.h
+++ b/include/lldb/API/SBModule.h
@@ -129,6 +129,21 @@ public:
lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t);
+ //------------------------------------------------------------------
+ /// Find compile units related to *this module and passed source
+ /// file.
+ ///
+ /// @param[in] sb_file_spec
+ /// A lldb::SBFileSpec object that contains source file
+ /// specification.
+ ///
+ /// @return
+ /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// the symbol contexts for all the matches.
+ //------------------------------------------------------------------
+ lldb::SBSymbolContextList
+ FindCompileUnits(const lldb::SBFileSpec &sb_file_spec);
+
size_t GetNumSymbols();
lldb::SBSymbol GetSymbolAtIndex(size_t idx);
diff --git a/include/lldb/API/SBProcess.h b/include/lldb/API/SBProcess.h
index 2e8925941fb7..4ad24f63f076 100644
--- a/include/lldb/API/SBProcess.h
+++ b/include/lldb/API/SBProcess.h
@@ -98,10 +98,10 @@ public:
lldb::SBThread GetSelectedThread() const;
//------------------------------------------------------------------
- // Function for lazily creating a thread using the current OS
- // plug-in. This function will be removed in the future when there
- // are APIs to create SBThread objects through the interface and add
- // them to the process through the SBProcess API.
+ // Function for lazily creating a thread using the current OS plug-in. This
+ // function will be removed in the future when there are APIs to create
+ // SBThread objects through the interface and add them to the process through
+ // the SBProcess API.
//------------------------------------------------------------------
lldb::SBThread CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context);
@@ -313,6 +313,40 @@ public:
const lldb::SBFileSpec &remote_image_spec,
lldb::SBError &error);
+ //------------------------------------------------------------------
+ /// Load a shared library into this process, starting with a
+ /// library name and a list of paths, searching along the list of
+ /// paths till you find a matching library.
+ ///
+ /// @param[in] local_spec
+ /// The name of the shared library that you want to load.
+ /// If local_spec is a relative path, the relative path will be
+ /// appended to the search paths.
+ /// If the local_spec is an absolute path, just the basename is used.
+ ///
+ /// @param[in] paths
+ /// A list of paths to search for the library whose basename is
+ /// local_spec.
+ ///
+ /// @param[out] loaded_path
+ /// If the library was found along the paths, this will store the
+ /// full path to the found library.
+ ///
+ /// @param[out] error
+ /// An error object that gets filled in with any errors that
+ /// might occur when trying to search for the shared library.
+ ///
+ /// @return
+ /// A token that represents the shared library that can be
+ /// later passed to UnloadImage. A value of
+ /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared
+ /// library can't be opened.
+ //------------------------------------------------------------------
+ uint32_t LoadImageUsingPaths(const lldb::SBFileSpec &image_spec,
+ SBStringList &paths,
+ lldb::SBFileSpec &loaded_path,
+ lldb::SBError &error);
+
lldb::SBError UnloadImage(uint32_t image_token);
lldb::SBError SendEventData(const char *data);
diff --git a/include/lldb/API/SBStream.h b/include/lldb/API/SBStream.h
index a75afc7ee375..7364ca7797f8 100644
--- a/include/lldb/API/SBStream.h
+++ b/include/lldb/API/SBStream.h
@@ -26,13 +26,12 @@ public:
bool IsValid() const;
- // If this stream is not redirected to a file, it will maintain a local
- // cache for the stream data which can be accessed using this accessor.
+ // If this stream is not redirected to a file, it will maintain a local cache
+ // for the stream data which can be accessed using this accessor.
const char *GetData();
- // If this stream is not redirected to a file, it will maintain a local
- // cache for the stream output whose length can be accessed using this
- // accessor.
+ // If this stream is not redirected to a file, it will maintain a local cache
+ // for the stream output whose length can be accessed using this accessor.
size_t GetSize();
void Printf(const char *format, ...) __attribute__((format(printf, 2, 3)));
@@ -44,8 +43,8 @@ public:
void RedirectToFileDescriptor(int fd, bool transfer_fh_ownership);
// If the stream is redirected to a file, forget about the file and if
- // ownership of the file was transferred to this object, close the file.
- // If the stream is backed by a local cache, clear this cache.
+ // ownership of the file was transferred to this object, close the file. If
+ // the stream is backed by a local cache, clear this cache.
void Clear();
protected:
diff --git a/include/lldb/API/SBStructuredData.h b/include/lldb/API/SBStructuredData.h
index f3baaf7c4801..ca8229a574df 100644
--- a/include/lldb/API/SBStructuredData.h
+++ b/include/lldb/API/SBStructuredData.h
@@ -99,6 +99,7 @@ public:
protected:
friend class SBTraceOptions;
friend class SBDebugger;
+ friend class SBTarget;
StructuredDataImplUP m_impl_up;
};
diff --git a/include/lldb/API/SBSymbol.h b/include/lldb/API/SBSymbol.h
index d17a4ccffe02..a29ac61d2912 100644
--- a/include/lldb/API/SBSymbol.h
+++ b/include/lldb/API/SBSymbol.h
@@ -55,8 +55,8 @@ public:
bool GetDescription(lldb::SBStream &description);
//----------------------------------------------------------------------
- // Returns true if the symbol is externally visible in the module that
- // it is defined in
+ // Returns true if the symbol is externally visible in the module that it is
+ // defined in
//----------------------------------------------------------------------
bool IsExternal();
diff --git a/include/lldb/API/SBTarget.h b/include/lldb/API/SBTarget.h
index 4085a16b43fb..8d99545902fe 100644
--- a/include/lldb/API/SBTarget.h
+++ b/include/lldb/API/SBTarget.h
@@ -75,6 +75,8 @@ public:
lldb::SBProcess GetProcess();
+ lldb::SBStructuredData GetStatistics();
+
//------------------------------------------------------------------
/// Return the platform object associated with the target.
///
@@ -163,6 +165,7 @@ public:
bool stop_at_entry, lldb::SBError &error);
SBProcess LoadCore(const char *core_file);
+ SBProcess LoadCore(const char *core_file, lldb::SBError &error);
//------------------------------------------------------------------
/// Launch a new process with sensible defaults.
@@ -289,6 +292,21 @@ public:
lldb::SBModule FindModule(const lldb::SBFileSpec &file_spec);
+ //------------------------------------------------------------------
+ /// Find compile units related to *this target and passed source
+ /// file.
+ ///
+ /// @param[in] sb_file_spec
+ /// A lldb::SBFileSpec object that contains source file
+ /// specification.
+ ///
+ /// @return
+ /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// the symbol contexts for all the matches.
+ //------------------------------------------------------------------
+ lldb::SBSymbolContextList
+ FindCompileUnits(const lldb::SBFileSpec &sb_file_spec);
+
lldb::ByteOrder GetByteOrder();
uint32_t GetAddressByteSize();
@@ -716,9 +734,9 @@ public:
// Finds all breakpoints by name, returning the list in bkpt_list. Returns
// false if the name is not a valid breakpoint name, true otherwise.
bool FindBreakpointsByName(const char *name, SBBreakpointList &bkpt_list);
-
+
void GetBreakpointNames(SBStringList &names);
-
+
void DeleteBreakpointName(const char *name);
bool EnableAllBreakpoints();
@@ -773,8 +791,7 @@ public:
const void *buf, size_t size);
// The "WithFlavor" is necessary to keep SWIG from getting confused about
- // overloaded arguments when
- // using the buf + size -> Python Object magic.
+ // overloaded arguments when using the buf + size -> Python Object magic.
lldb::SBInstructionList GetInstructionsWithFlavor(lldb::SBAddress base_addr,
const char *flavor_string,
@@ -827,8 +844,8 @@ protected:
friend class SBValue;
//------------------------------------------------------------------
- // Constructors are private, use static Target::Create function to
- // create an instance of this class.
+ // Constructors are private, use static Target::Create function to create an
+ // instance of this class.
//------------------------------------------------------------------
lldb::TargetSP GetSP() const;
diff --git a/include/lldb/API/SBThread.h b/include/lldb/API/SBThread.h
index 7f1cf10cc456..afc05d2c61ad 100644
--- a/include/lldb/API/SBThread.h
+++ b/include/lldb/API/SBThread.h
@@ -93,6 +93,8 @@ public:
void StepOver(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+ void StepOver(lldb::RunMode stop_other_threads, SBError &error);
+
void StepInto(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
void StepInto(const char *target_name,
@@ -103,10 +105,16 @@ public:
void StepOut();
- void StepOutOfFrame(lldb::SBFrame &frame);
+ void StepOut(SBError &error);
+
+ void StepOutOfFrame(SBFrame &frame);
+
+ void StepOutOfFrame(SBFrame &frame, SBError &error);
void StepInstruction(bool step_over);
+ void StepInstruction(bool step_over, SBError &error);
+
SBError StepOverUntil(lldb::SBFrame &frame, lldb::SBFileSpec &file_spec,
uint32_t line);
@@ -119,6 +127,8 @@ public:
void RunToAddress(lldb::addr_t addr);
+ void RunToAddress(lldb::addr_t addr, SBError &error);
+
SBError ReturnFromFrame(SBFrame &frame, SBValue &return_value);
SBError UnwindInnermostExpression();
@@ -146,8 +156,12 @@ public:
//--------------------------------------------------------------------------
bool Suspend();
+ bool Suspend(SBError &error);
+
bool Resume();
+ bool Resume(SBError &error);
+
bool IsSuspended();
bool IsStopped();
diff --git a/include/lldb/API/SBValue.h b/include/lldb/API/SBValue.h
index 5ef8915b58f9..ab5bdfea993d 100644
--- a/include/lldb/API/SBValue.h
+++ b/include/lldb/API/SBValue.h
@@ -134,8 +134,7 @@ public:
lldb::SBType type);
// this has no address! GetAddress() and GetLoadAddress() as well as
- // AddressOf()
- // on the return of this call all return invalid
+ // AddressOf() on the return of this call all return invalid
lldb::SBValue CreateValueFromData(const char *name, lldb::SBData data,
lldb::SBType type);
diff --git a/include/lldb/API/SBValueList.h b/include/lldb/API/SBValueList.h
index 495b0140cad0..0242dd7f71a2 100644
--- a/include/lldb/API/SBValueList.h
+++ b/include/lldb/API/SBValueList.h
@@ -43,8 +43,8 @@ public:
const lldb::SBValueList &operator=(const lldb::SBValueList &rhs);
protected:
- // only useful for visualizing the pointer or comparing two SBValueLists
- // to see if they are backed by the same underlying Impl.
+ // only useful for visualizing the pointer or comparing two SBValueLists to
+ // see if they are backed by the same underlying Impl.
void *opaque_ptr();
private:
diff --git a/include/lldb/API/SystemInitializerFull.h b/include/lldb/API/SystemInitializerFull.h
deleted file mode 100644
index 9cfc6896da61..000000000000
--- a/include/lldb/API/SystemInitializerFull.h
+++ /dev/null
@@ -1,38 +0,0 @@
-//===-- SystemInitializerFull.h ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_API_SYSTEM_INITIALIZER_FULL_H
-#define LLDB_API_SYSTEM_INITIALIZER_FULL_H
-
-#include "lldb/Initialization/SystemInitializerCommon.h"
-
-namespace lldb_private {
-//------------------------------------------------------------------
-/// Initializes lldb.
-///
-/// This class is responsible for initializing all of lldb system
-/// services needed to use the full LLDB application. This class is
-/// not intended to be used externally, but is instead used
-/// internally by SBDebugger to initialize the system.
-//------------------------------------------------------------------
-class SystemInitializerFull : public SystemInitializerCommon {
-public:
- SystemInitializerFull();
- ~SystemInitializerFull() override;
-
- void Initialize() override;
- void Terminate() override;
-
-private:
- void InitializeSWIG();
-};
-
-} // namespace lldb_private
-
-#endif // LLDB_API_SYSTEM_INITIALIZER_FULL_H
diff --git a/include/lldb/Breakpoint/Breakpoint.h b/include/lldb/Breakpoint/Breakpoint.h
index 9a798090a59f..ec4bc946280f 100644
--- a/include/lldb/Breakpoint/Breakpoint.h
+++ b/include/lldb/Breakpoint/Breakpoint.h
@@ -33,8 +33,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Breakpoint Breakpoint.h "lldb/Breakpoint/Breakpoint.h"
-/// @brief Class that manages logical breakpoint setting.
+/// @class Breakpoint Breakpoint.h "lldb/Breakpoint/Breakpoint.h" Class that
+/// manages logical breakpoint setting.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -42,33 +42,28 @@ namespace lldb_private {
/// A breakpoint has four main parts, a filter, a resolver, the list of
/// breakpoint
/// locations that have been determined for the filter/resolver pair, and
-/// finally
-/// a set of options for the breakpoint.
+/// finally a set of options for the breakpoint.
///
/// \b Filter:
-/// This is an object derived from SearchFilter. It manages the search
-/// for breakpoint location matches through the symbols in the module list of
-/// the target
-/// that owns it. It also filters out locations based on whatever logic it
-/// wants.
+/// This is an object derived from SearchFilter. It manages the search for
+/// breakpoint location matches through the symbols in the module list of the
+/// target that owns it. It also filters out locations based on whatever
+/// logic it wants.
///
/// \b Resolver:
-/// This is an object derived from BreakpointResolver. It provides a
-/// callback to the filter that will find breakpoint locations. How it does
-/// this is
+/// This is an object derived from BreakpointResolver. It provides a callback
+/// to the filter that will find breakpoint locations. How it does this is
/// determined by what kind of resolver it is.
///
/// The Breakpoint class also provides constructors for the common breakpoint
-/// cases
-/// which make the appropriate filter and resolver for you.
+/// cases which make the appropriate filter and resolver for you.
///
/// \b Location List:
-/// This stores the breakpoint locations that have been determined
-/// to date. For a given breakpoint, there will be only one location with a
-/// given
-/// address. Adding a location at an already taken address will just return the
-/// location
-/// already at that address. Locations can be looked up by ID, or by address.
+/// This stores the breakpoint locations that have been determined to date.
+/// For a given breakpoint, there will be only one location with a given
+/// address. Adding a location at an already taken address will just return
+/// the location already at that address. Locations can be looked up by ID,
+/// or by address.
///
/// \b Options:
/// This includes:
@@ -77,25 +72,17 @@ namespace lldb_private {
/// \b Callback
/// \b Condition
/// Note, these options can be set on the breakpoint, and they can also be set
-/// on the
-/// individual locations. The options set on the breakpoint take precedence
-/// over the
-/// options set on the individual location.
-/// So for instance disabling the breakpoint will cause NONE of the locations to
-/// get hit.
-/// But if the breakpoint is enabled, then the location's enabled state will be
-/// checked
-/// to determine whether to insert that breakpoint location.
+/// on the individual locations. The options set on the breakpoint take
+/// precedence over the options set on the individual location. So for
+/// instance disabling the breakpoint will cause NONE of the locations to get
+/// hit. But if the breakpoint is enabled, then the location's enabled state
+/// will be checked to determine whether to insert that breakpoint location.
/// Similarly, if the breakpoint condition says "stop", we won't check the
-/// location's condition.
-/// But if the breakpoint condition says "continue", then we will check the
-/// location for whether
-/// to actually stop or not.
-/// One subtle point worth observing here is that you don't actually stop at a
-/// Breakpoint, you
-/// always stop at one of its locations. So the "should stop" tests are done by
-/// the location,
-/// not by the breakpoint.
+/// location's condition. But if the breakpoint condition says "continue",
+/// then we will check the location for whether to actually stop or not. One
+/// subtle point worth observing here is that you don't actually stop at a
+/// Breakpoint, you always stop at one of its locations. So the "should stop"
+/// tests are done by the location, not by the breakpoint.
//----------------------------------------------------------------------
class Breakpoint : public std::enable_shared_from_this<Breakpoint>,
public Stoppoint {
@@ -103,8 +90,8 @@ public:
static const ConstString &GetEventIdentifier();
//------------------------------------------------------------------
- /// An enum specifying the match style for breakpoint settings. At
- /// present only used for function name style breakpoints.
+ /// An enum specifying the match style for breakpoint settings. At present
+ /// only used for function name style breakpoints.
//------------------------------------------------------------------
typedef enum { Exact, Regexp, Glob } MatchType;
@@ -191,9 +178,9 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is not virtual since there should be no reason to subclass
- /// breakpoints. The varieties of breakpoints are specified instead by
- /// providing different resolvers & filters.
+ /// The destructor is not virtual since there should be no reason to
+ /// subclass breakpoints. The varieties of breakpoints are specified
+ /// instead by providing different resolvers & filters.
//------------------------------------------------------------------
~Breakpoint() override;
@@ -202,8 +189,7 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Tell whether this breakpoint is an "internal" breakpoint.
- /// @return
+ /// Tell whether this breakpoint is an "internal" breakpoint. @return
/// Returns \b true if this is an internal breakpoint, \b false otherwise.
//------------------------------------------------------------------
bool IsInternal() const;
@@ -214,13 +200,13 @@ public:
void Dump(Stream *s) override;
//------------------------------------------------------------------
- // The next set of methods provide ways to tell the breakpoint to update
- // it's location list - usually done when modules appear or disappear.
+ // The next set of methods provide ways to tell the breakpoint to update it's
+ // location list - usually done when modules appear or disappear.
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Tell this breakpoint to clear all its breakpoint sites. Done
- /// when the process holding the breakpoint sites is destroyed.
+ /// Tell this breakpoint to clear all its breakpoint sites. Done when the
+ /// process holding the breakpoint sites is destroyed.
//------------------------------------------------------------------
void ClearAllBreakpointSites();
@@ -231,8 +217,8 @@ public:
void ResolveBreakpoint();
//------------------------------------------------------------------
- /// Tell this breakpoint to scan a given module list and resolve any
- /// new locations that match the breakpoint's specifications.
+ /// Tell this breakpoint to scan a given module list and resolve any new
+ /// locations that match the breakpoint's specifications.
///
/// @param[in] module_list
/// The list of modules to look in for new locations.
@@ -245,8 +231,8 @@ public:
bool send_event = true);
//------------------------------------------------------------------
- /// Tell this breakpoint to scan a given module list and resolve any
- /// new locations that match the breakpoint's specifications.
+ /// Tell this breakpoint to scan a given module list and resolve any new
+ /// locations that match the breakpoint's specifications.
///
/// @param[in] changed_modules
/// The list of modules to look in for new locations.
@@ -274,9 +260,9 @@ public:
bool delete_locations = false);
//------------------------------------------------------------------
- /// Tells the breakpoint the old module \a old_module_sp has been
- /// replaced by new_module_sp (usually because the underlying file has been
- /// rebuilt, and the old version is gone.)
+ /// Tells the breakpoint the old module \a old_module_sp has been replaced
+ /// by new_module_sp (usually because the underlying file has been rebuilt,
+ /// and the old version is gone.)
///
/// @param[in] old_module_sp
/// The old module that is going away.
@@ -287,13 +273,13 @@ public:
lldb::ModuleSP new_module_sp);
//------------------------------------------------------------------
- // The next set of methods provide access to the breakpoint locations
- // for this breakpoint.
+ // The next set of methods provide access to the breakpoint locations for
+ // this breakpoint.
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Add a location to the breakpoint's location list. This is only meant
- /// to be called by the breakpoint's resolver. FIXME: how do I ensure that?
+ /// Add a location to the breakpoint's location list. This is only meant to
+ /// be called by the breakpoint's resolver. FIXME: how do I ensure that?
///
/// @param[in] addr
/// The Address specifying the new location.
@@ -359,12 +345,12 @@ public:
/// Removes all invalid breakpoint locations.
///
/// Removes all breakpoint locations with architectures that aren't
- /// compatible with \a arch. Also remove any breakpoint locations
- /// with whose locations have address where the section has been
- /// deleted (module and object files no longer exist).
+ /// compatible with \a arch. Also remove any breakpoint locations with whose
+ /// locations have address where the section has been deleted (module and
+ /// object files no longer exist).
///
- /// This is typically used after the process calls exec, or anytime
- /// the architecture of the target changes.
+ /// This is typically used after the process calls exec, or anytime the
+ /// architecture of the target changes.
///
/// @param[in] arch
/// If valid, check the module in each breakpoint to make sure
@@ -403,8 +389,7 @@ public:
uint32_t GetIgnoreCount() const;
//------------------------------------------------------------------
- /// Return the current hit count for all locations.
- /// @return
+ /// Return the current hit count for all locations. @return
/// The current hit count for all locations.
//------------------------------------------------------------------
uint32_t GetHitCount() const;
@@ -422,7 +407,8 @@ public:
bool IsOneShot() const;
//------------------------------------------------------------------
- /// If \a auto_continue is \b true, breakpoint will auto-continue when on hit.
+ /// If \a auto_continue is \b true, breakpoint will auto-continue when on
+ /// hit.
//------------------------------------------------------------------
void SetAutoContinue(bool auto_continue);
@@ -508,8 +494,8 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Return the number of breakpoint locations that have resolved to
- /// actual breakpoint sites.
+ /// Return the number of breakpoint locations that have resolved to actual
+ /// breakpoint sites.
///
/// @return
/// The number locations resolved breakpoint sites.
@@ -541,10 +527,9 @@ public:
//------------------------------------------------------------------
/// Set the "kind" description for a breakpoint. If the breakpoint is hit
- /// the stop info will show this "kind" description instead of the breakpoint
- /// number. Mostly useful for internal breakpoints, where the breakpoint
- /// number
- /// doesn't have meaning to the user.
+ /// the stop info will show this "kind" description instead of the
+ /// breakpoint number. Mostly useful for internal breakpoints, where the
+ /// breakpoint number doesn't have meaning to the user.
///
/// @param[in] kind
/// New "kind" description.
@@ -574,10 +559,9 @@ public:
//------------------------------------------------------------------
/// Find breakpoint locations which match the (filename, line_number)
- /// description.
- /// The breakpoint location collection is to be filled with the matching
- /// locations.
- /// It should be initialized with 0 size by the API client.
+ /// description. The breakpoint location collection is to be filled with the
+ /// matching locations. It should be initialized with 0 size by the API
+ /// client.
///
/// @return
/// True if there is a match
@@ -661,13 +645,12 @@ public:
/// Set a pre-condition filter that overrides all user provided
/// filters/callbacks etc.
///
- /// Used to define fancy breakpoints that can do dynamic hit detection without
- /// taking up the condition slot -
- /// which really belongs to the user anyway...
+ /// Used to define fancy breakpoints that can do dynamic hit detection
+ /// without taking up the condition slot - which really belongs to the user
+ /// anyway...
///
- /// The Precondition should not continue the target, it should return true if
- /// the condition says to stop and
- /// false otherwise.
+ /// The Precondition should not continue the target, it should return true
+ /// if the condition says to stop and false otherwise.
///
//------------------------------------------------------------------
void SetPrecondition(BreakpointPreconditionSP precondition_sp) {
@@ -706,10 +689,9 @@ protected:
//------------------------------------------------------------------
/// Constructors and Destructors
/// Only the Target can make a breakpoint, and it owns the breakpoint
- /// lifespans.
- /// The constructor takes a filter and a resolver. Up in Target there are
- /// convenience
- /// variants that make breakpoints for some common cases.
+ /// lifespans. The constructor takes a filter and a resolver. Up in Target
+ /// there are convenience variants that make breakpoints for some common
+ /// cases.
///
/// @param[in] target
/// The target in which the breakpoint will be set.
@@ -744,10 +726,10 @@ protected:
void DecrementIgnoreCount();
// BreakpointLocation::IgnoreCountShouldStop &
- // Breakpoint::IgnoreCountShouldStop can only be called once per stop,
- // and BreakpointLocation::IgnoreCountShouldStop should be tested first, and
- // if it returns false we should
- // continue, otherwise we should test Breakpoint::IgnoreCountShouldStop.
+ // Breakpoint::IgnoreCountShouldStop can only be called once per stop, and
+ // BreakpointLocation::IgnoreCountShouldStop should be tested first, and if
+ // it returns false we should continue, otherwise we should test
+ // Breakpoint::IgnoreCountShouldStop.
bool IgnoreCountShouldStop();
@@ -760,8 +742,7 @@ protected:
private:
// This one should only be used by Target to copy breakpoints from target to
- // target - primarily from the dummy
- // target to prime new targets.
+ // target - primarily from the dummy target to prime new targets.
Breakpoint(Target &new_target, Breakpoint &bp_to_copy_from);
//------------------------------------------------------------------
@@ -782,9 +763,9 @@ private:
BreakpointPreconditionSP m_precondition_sp; // The precondition is a
// breakpoint-level hit filter
// that can be used
- // to skip certain breakpoint hits. For instance, exception breakpoints
- // use this to limit the stop to certain exception classes, while leaving
- // the condition & callback free for user specification.
+ // to skip certain breakpoint hits. For instance, exception breakpoints use
+ // this to limit the stop to certain exception classes, while leaving the
+ // condition & callback free for user specification.
std::unique_ptr<BreakpointOptions>
m_options_up; // Settable breakpoint options
BreakpointLocationList
diff --git a/include/lldb/Breakpoint/BreakpointID.h b/include/lldb/Breakpoint/BreakpointID.h
index 57411b316317..bbad45ca2d8b 100644
--- a/include/lldb/Breakpoint/BreakpointID.h
+++ b/include/lldb/Breakpoint/BreakpointID.h
@@ -57,7 +57,7 @@ public:
//------------------------------------------------------------------
/// Takes an input string containing the description of a breakpoint or
- /// breakpoint and location and returns the a BreakpointID filled out with
+ /// breakpoint and location and returns a BreakpointID filled out with
/// the proper id and location.
///
/// @param[in] input
diff --git a/include/lldb/Breakpoint/BreakpointIDList.h b/include/lldb/Breakpoint/BreakpointIDList.h
index 5877b6c551ad..ec305583e8d9 100644
--- a/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/include/lldb/Breakpoint/BreakpointIDList.h
@@ -55,7 +55,7 @@ public:
bool FindBreakpointID(const char *bp_id, size_t *position) const;
- void InsertStringArray(const char **string_array, size_t array_size,
+ void InsertStringArray(llvm::ArrayRef<const char *> string_array,
CommandReturnObject &result);
// Returns a pair consisting of the beginning and end of a breakpoint
diff --git a/include/lldb/Breakpoint/BreakpointList.h b/include/lldb/Breakpoint/BreakpointList.h
index 9f38f8aa120d..f4c013d41cc2 100644
--- a/include/lldb/Breakpoint/BreakpointList.h
+++ b/include/lldb/Breakpoint/BreakpointList.h
@@ -23,7 +23,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointList BreakpointList.h "lldb/Breakpoint/BreakpointList.h"
-/// @brief This class manages a list of breakpoints.
+/// This class manages a list of breakpoints.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -91,7 +91,8 @@ public:
lldb::BreakpointSP GetBreakpointAtIndex(size_t i);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint with index \a i, const version
+ /// Returns a shared pointer to the breakpoint with index \a i, const
+ /// version
///
/// @param[in] i
/// The breakpoint index to seek for.
@@ -138,13 +139,13 @@ public:
//------------------------------------------------------------------
/// Removes all invalid breakpoint locations.
///
- /// Removes all breakpoint locations in the list with architectures
- /// that aren't compatible with \a arch. Also remove any breakpoint
- /// locations with whose locations have address where the section
- /// has been deleted (module and object files no longer exist).
+ /// Removes all breakpoint locations in the list with architectures that
+ /// aren't compatible with \a arch. Also remove any breakpoint locations
+ /// with whose locations have address where the section has been deleted
+ /// (module and object files no longer exist).
///
- /// This is typically used after the process calls exec, or anytime
- /// the architecture of the target changes.
+ /// This is typically used after the process calls exec, or anytime the
+ /// architecture of the target changes.
///
/// @param[in] arch
/// If valid, check the module in each breakpoint to make sure
@@ -163,8 +164,8 @@ public:
//------------------------------------------------------------------
/// Removes all the breakpoints from this list - first checking the
- /// ePermDelete on the breakpoints. This call should be used unless you
- /// are shutting down and need to actually clear them all.
+ /// ePermDelete on the breakpoints. This call should be used unless you are
+ /// shutting down and need to actually clear them all.
//------------------------------------------------------------------
void RemoveAllowed(bool notify);
diff --git a/include/lldb/Breakpoint/BreakpointLocation.h b/include/lldb/Breakpoint/BreakpointLocation.h
index b68a9ffad04c..c5911085e61b 100644
--- a/include/lldb/Breakpoint/BreakpointLocation.h
+++ b/include/lldb/Breakpoint/BreakpointLocation.h
@@ -27,22 +27,20 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointLocation BreakpointLocation.h
-/// "lldb/Breakpoint/BreakpointLocation.h"
-/// @brief Class that manages one unique (by address) instance of a logical
-/// breakpoint.
+/// "lldb/Breakpoint/BreakpointLocation.h" Class that manages one unique (by
+/// address) instance of a logical breakpoint.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
/// A breakpoint location is defined by the breakpoint that produces it,
-/// and the address that resulted in this particular instantiation.
-/// Each breakpoint location also may have a breakpoint site if its
-/// address has been loaded into the program.
-/// Finally it has a settable options object.
+/// and the address that resulted in this particular instantiation. Each
+/// breakpoint location also may have a breakpoint site if its address has
+/// been loaded into the program. Finally it has a settable options object.
///
/// FIXME: Should we also store some fingerprint for the location, so
-/// we can map one location to the "equivalent location" on rerun? This
-/// would be useful if you've set options on the locations.
+/// we can map one location to the "equivalent location" on rerun? This would
+/// be useful if you've set options on the locations.
//----------------------------------------------------------------------
class BreakpointLocation
@@ -52,22 +50,19 @@ public:
~BreakpointLocation() override;
//------------------------------------------------------------------
- /// Gets the load address for this breakpoint location
- /// @return
+ /// Gets the load address for this breakpoint location @return
/// Returns breakpoint location load address, \b
/// LLDB_INVALID_ADDRESS if not yet set.
//------------------------------------------------------------------
lldb::addr_t GetLoadAddress() const override;
//------------------------------------------------------------------
- /// Gets the Address for this breakpoint location
- /// @return
+ /// Gets the Address for this breakpoint location @return
/// Returns breakpoint location Address.
//------------------------------------------------------------------
Address &GetAddress();
//------------------------------------------------------------------
- /// Gets the Breakpoint that created this breakpoint location
- /// @return
+ /// Gets the Breakpoint that created this breakpoint location @return
/// Returns the owning breakpoint.
//------------------------------------------------------------------
Breakpoint &GetBreakpoint();
@@ -75,12 +70,11 @@ public:
Target &GetTarget();
//------------------------------------------------------------------
- /// Determines whether we should stop due to a hit at this
- /// breakpoint location.
+ /// Determines whether we should stop due to a hit at this breakpoint
+ /// location.
///
- /// Side Effects: This may evaluate the breakpoint condition, and
- /// run the callback. So this command may do a considerable amount
- /// of work.
+ /// Side Effects: This may evaluate the breakpoint condition, and run the
+ /// callback. So this command may do a considerable amount of work.
///
/// @return
/// \b true if this breakpoint location thinks we should stop,
@@ -93,8 +87,7 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// If \a enable is \b true, enable the breakpoint, if \b false
- /// disable it.
+ /// If \a enable is \b true, enable the breakpoint, if \b false disable it.
//------------------------------------------------------------------
void SetEnabled(bool enabled);
@@ -138,8 +131,8 @@ public:
//------------------------------------------------------------------
/// Set the callback action invoked when the breakpoint is hit.
///
- /// The callback will return a bool indicating whether the target
- /// should stop at this breakpoint or not.
+ /// The callback will return a bool indicating whether the target should
+ /// stop at this breakpoint or not.
///
/// @param[in] callback
/// The method that will get called when the breakpoint is hit.
@@ -213,8 +206,8 @@ public:
bool ResolveBreakpointSite();
//------------------------------------------------------------------
- /// Clear this breakpoint location's breakpoint site - for instance
- /// when disabling the breakpoint.
+ /// Clear this breakpoint location's breakpoint site - for instance when
+ /// disabling the breakpoint.
///
/// @return
/// \b true if there was a breakpoint site to be cleared, \b false
@@ -223,8 +216,7 @@ public:
bool ClearBreakpointSite();
//------------------------------------------------------------------
- /// Return whether this breakpoint location has a breakpoint site.
- /// @return
+ /// Return whether this breakpoint location has a breakpoint site. @return
/// \b true if there was a breakpoint site for this breakpoint
/// location, \b false otherwise.
//------------------------------------------------------------------
@@ -237,8 +229,7 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Print a description of this breakpoint location to the stream
- /// \a s.
+ /// Print a description of this breakpoint location to the stream \a s.
///
/// @param[in] s
/// The stream to which to print the description.
@@ -259,8 +250,8 @@ public:
//------------------------------------------------------------------
/// Use this to set location specific breakpoint options.
///
- /// It will create a copy of the containing breakpoint's options if
- /// that hasn't been done already
+ /// It will create a copy of the containing breakpoint's options if that
+ /// hasn't been done already
///
/// @return
/// A pointer to the breakpoint options.
@@ -302,8 +293,7 @@ public:
//------------------------------------------------------------------
/// Returns whether we should resolve Indirect functions in setting the
- /// breakpoint site
- /// for this location.
+ /// breakpoint site for this location.
///
/// @return
/// \b true if the breakpoint SITE for this location should be set on the
@@ -315,8 +305,7 @@ public:
//------------------------------------------------------------------
/// Returns whether the address set in the breakpoint site for this location
- /// was found by resolving
- /// an indirect symbol.
+ /// was found by resolving an indirect symbol.
///
/// @return
/// \b true or \b false as given in the description above.
@@ -327,8 +316,7 @@ public:
//------------------------------------------------------------------
/// Returns whether the address set in the breakpoint location was re-routed
- /// to the target of a
- /// re-exported symbol.
+ /// to the target of a re-exported symbol.
///
/// @return
/// \b true or \b false as given in the description above.
@@ -339,10 +327,8 @@ public:
//------------------------------------------------------------------
/// Returns whether the two breakpoint locations might represent "equivalent
- /// locations".
- /// This is used when modules changed to determine if a Location in the old
- /// module might
- /// be the "same as" the input location.
+ /// locations". This is used when modules changed to determine if a Location
+ /// in the old module might be the "same as" the input location.
///
/// @param[in] location
/// The location to compare against.
@@ -384,8 +370,7 @@ private:
//------------------------------------------------------------------
// Constructors and Destructors
//
- // Only the Breakpoint can make breakpoint locations, and it owns
- // them.
+ // Only the Breakpoint can make breakpoint locations, and it owns them.
//------------------------------------------------------------------
//------------------------------------------------------------------
diff --git a/include/lldb/Breakpoint/BreakpointLocationCollection.h b/include/lldb/Breakpoint/BreakpointLocationCollection.h
index 4b2d9d4b344d..579d468647f3 100644
--- a/include/lldb/Breakpoint/BreakpointLocationCollection.h
+++ b/include/lldb/Breakpoint/BreakpointLocationCollection.h
@@ -178,8 +178,8 @@ public:
protected:
//------------------------------------------------------------------
- // Classes that inherit from BreakpointLocationCollection can see
- // and modify these
+ // Classes that inherit from BreakpointLocationCollection can see and modify
+ // these
//------------------------------------------------------------------
private:
diff --git a/include/lldb/Breakpoint/BreakpointLocationList.h b/include/lldb/Breakpoint/BreakpointLocationList.h
index 46eb2612bbe8..4e61abb2838e 100644
--- a/include/lldb/Breakpoint/BreakpointLocationList.h
+++ b/include/lldb/Breakpoint/BreakpointLocationList.h
@@ -26,21 +26,16 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointLocationList BreakpointLocationList.h
-/// "lldb/Breakpoint/BreakpointLocationList.h"
-/// @brief This class is used by Breakpoint to manage a list of breakpoint
-/// locations,
-// each breakpoint location in the list
-/// has a unique ID, and is unique by Address as well.
+/// "lldb/Breakpoint/BreakpointLocationList.h" This class is used by
+/// Breakpoint to manage a list of breakpoint locations, each breakpoint
+/// location in the list has a unique ID, and is unique by Address as well.
//----------------------------------------------------------------------
-
class BreakpointLocationList {
- // Only Breakpoints can make the location list, or add elements to it.
- // This is not just some random collection of locations. Rather, the act of
- // adding the location
- // to this list sets its ID, and implicitly all the locations have the same
- // breakpoint ID as
- // well. If you need a generic container for breakpoint locations, use
- // BreakpointLocationCollection.
+ // Only Breakpoints can make the location list, or add elements to it. This
+ // is not just some random collection of locations. Rather, the act of
+ // adding the location to this list sets its ID, and implicitly all the
+ // locations have the same breakpoint ID as well. If you need a generic
+ // container for breakpoint locations, use BreakpointLocationCollection.
friend class Breakpoint;
public:
@@ -52,8 +47,8 @@ public:
void Dump(Stream *s) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location at address
- /// \a addr - const version.
+ /// Returns a shared pointer to the breakpoint location at address \a addr -
+ /// const version.
///
/// @param[in] addr
/// The address to look for.
@@ -65,8 +60,8 @@ public:
const lldb::BreakpointLocationSP FindByAddress(const Address &addr) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location with id
- /// \a breakID, const version.
+ /// Returns a shared pointer to the breakpoint location with id \a breakID,
+ /// const version.
///
/// @param[in] breakID
/// The breakpoint location ID to seek for.
@@ -78,8 +73,8 @@ public:
lldb::BreakpointLocationSP FindByID(lldb::break_id_t breakID) const;
//------------------------------------------------------------------
- /// Returns the breakpoint location id to the breakpoint location
- /// at address \a addr.
+ /// Returns the breakpoint location id to the breakpoint location at address
+ /// \a addr.
///
/// @param[in] addr
/// The address to match.
@@ -90,9 +85,8 @@ public:
lldb::break_id_t FindIDByAddress(const Address &addr);
//------------------------------------------------------------------
- /// Returns a breakpoint location list of the breakpoint locations
- /// in the module \a module. This list is allocated, and owned by
- /// the caller.
+ /// Returns a breakpoint location list of the breakpoint locations in the
+ /// module \a module. This list is allocated, and owned by the caller.
///
/// @param[in] module
/// The module to seek in.
@@ -108,8 +102,7 @@ public:
BreakpointLocationCollection &bp_loc_list);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location with
- /// index \a i.
+ /// Returns a shared pointer to the breakpoint location with index \a i.
///
/// @param[in] i
/// The breakpoint location index to seek for.
@@ -121,8 +114,8 @@ public:
lldb::BreakpointLocationSP GetByIndex(size_t i);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location with index
- /// \a i, const version.
+ /// Returns a shared pointer to the breakpoint location with index \a i,
+ /// const version.
///
/// @param[in] i
/// The breakpoint location index to seek for.
@@ -134,20 +127,20 @@ public:
const lldb::BreakpointLocationSP GetByIndex(size_t i) const;
//------------------------------------------------------------------
- /// Removes all the locations in this list from their breakpoint site
- /// owners list.
+ /// Removes all the locations in this list from their breakpoint site owners
+ /// list.
//------------------------------------------------------------------
void ClearAllBreakpointSites();
//------------------------------------------------------------------
- /// Tells all the breakpoint locations in this list to attempt to
- /// resolve any possible breakpoint sites.
+ /// Tells all the breakpoint locations in this list to attempt to resolve
+ /// any possible breakpoint sites.
//------------------------------------------------------------------
void ResolveAllBreakpointSites();
//------------------------------------------------------------------
- /// Returns the number of breakpoint locations in this list with
- /// resolved breakpoints.
+ /// Returns the number of breakpoint locations in this list with resolved
+ /// breakpoints.
///
/// @result
/// Number of qualifying breakpoint locations.
@@ -163,8 +156,8 @@ public:
uint32_t GetHitCount() const;
//------------------------------------------------------------------
- /// Enquires of the breakpoint location in this list with ID \a
- /// breakID whether we should stop.
+ /// Enquires of the breakpoint location in this list with ID \a breakID
+ /// whether we should stop.
///
/// @param[in] context
/// This contains the information about this stop.
@@ -186,8 +179,8 @@ public:
size_t GetSize() const { return m_locations.size(); }
//------------------------------------------------------------------
- /// Print a description of the breakpoint locations in this list to
- /// the stream \a s.
+ /// Print a description of the breakpoint locations in this list to the
+ /// stream \a s.
///
/// @param[in] s
/// The stream to which to print the description.
@@ -204,9 +197,9 @@ protected:
//------------------------------------------------------------------
/// This is the standard constructor.
///
- /// It creates an empty breakpoint location list. It is protected
- /// here because only Breakpoints are allowed to create the
- /// breakpoint location list.
+ /// It creates an empty breakpoint location list. It is protected here
+ /// because only Breakpoints are allowed to create the breakpoint location
+ /// list.
//------------------------------------------------------------------
BreakpointLocationList(Breakpoint &owner);
@@ -235,6 +228,8 @@ protected:
lldb::BreakpointLocationSP from_location_sp);
bool RemoveLocation(const lldb::BreakpointLocationSP &bp_loc_sp);
+
+ void RemoveLocationByIndex(size_t idx);
void RemoveInvalidLocations(const ArchSpec &arch);
diff --git a/include/lldb/Breakpoint/BreakpointName.h b/include/lldb/Breakpoint/BreakpointName.h
index 1cfa141011a0..292a0de4f48b 100644
--- a/include/lldb/Breakpoint/BreakpointName.h
+++ b/include/lldb/Breakpoint/BreakpointName.h
@@ -80,8 +80,8 @@ public:
*this = Permissions();
}
- // Merge the permissions from incoming into this set of permissions.
- // Only merge set permissions, and most restrictive permission wins.
+ // Merge the permissions from incoming into this set of permissions. Only
+ // merge set permissions, and most restrictive permission wins.
void MergeInto(const Permissions &incoming)
{
MergePermission(incoming, listPerm);
diff --git a/include/lldb/Breakpoint/BreakpointOptions.h b/include/lldb/Breakpoint/BreakpointOptions.h
index 0229d52df471..84821817f980 100644
--- a/include/lldb/Breakpoint/BreakpointOptions.h
+++ b/include/lldb/Breakpoint/BreakpointOptions.h
@@ -27,9 +27,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointOptions BreakpointOptions.h
-/// "lldb/Breakpoint/BreakpointOptions.h"
-/// @brief Class that manages the options on a breakpoint or breakpoint
-/// location.
+/// "lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a
+/// breakpoint or breakpoint location.
//----------------------------------------------------------------------
class BreakpointOptions {
@@ -106,9 +105,8 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// This constructor allows you to specify all the breakpoint options
- /// except the callback. That one is more complicated, and better
- /// to do by hand.
+ /// This constructor allows you to specify all the breakpoint options except
+ /// the callback. That one is more complicated, and better to do by hand.
///
/// @param[in] condition
/// The expression which if it evaluates to \b true if we are to stop
@@ -125,8 +123,8 @@ public:
bool auto_continue = false);
//------------------------------------------------------------------
- /// Breakpoints make options with all flags set. Locations and Names make options
- /// with no flags set.
+ /// Breakpoints make options with all flags set. Locations and Names make
+ /// options with no flags set.
//------------------------------------------------------------------
BreakpointOptions(bool all_flags_set);
BreakpointOptions(const BreakpointOptions &rhs);
@@ -156,18 +154,16 @@ public:
// Callbacks
//
// Breakpoint callbacks come in two forms, synchronous and asynchronous.
- // Synchronous callbacks will get
- // run before any of the thread plans are consulted, and if they return false
- // the target will continue
- // "under the radar" of the thread plans. There are a couple of restrictions
- // to synchronous callbacks:
- // 1) They should NOT resume the target themselves. Just return false if you
- // want the target to restart.
- // 2) Breakpoints with synchronous callbacks can't have conditions (or rather,
- // they can have them, but they
- // won't do anything. Ditto with ignore counts, etc... You are supposed
- // to control that all through the
- // callback.
+ // Synchronous callbacks will get run before any of the thread plans are
+ // consulted, and if they return false the target will continue "under the
+ // radar" of the thread plans. There are a couple of restrictions to
+ // synchronous callbacks:
+ // 1) They should NOT resume the target themselves.
+ // Just return false if you want the target to restart.
+ // 2) Breakpoints with synchronous callbacks can't have conditions
+ // (or rather, they can have them, but they won't do anything.
+ // Ditto with ignore counts, etc... You are supposed to control that all
+ // through the callback.
// Asynchronous callbacks get run as part of the "ShouldStop" logic in the
// thread plan. The logic there is:
// a) If the breakpoint is thread specific and not for this thread, continue
@@ -181,12 +177,10 @@ public:
// b) If the ignore count says we shouldn't stop, then ditto.
// c) If the condition says we shouldn't stop, then ditto.
// d) Otherwise, the callback will get run, and if it returns true we will
- // stop, and if false we won't.
+ // stop, and if false we won't.
// The asynchronous callback can run the target itself, but at present that
- // should be the last action the
- // callback does. We will relax this condition at some point, but it will
- // take a bit of plumbing to get
- // that to work.
+ // should be the last action the callback does. We will relax this condition
+ // at some point, but it will take a bit of plumbing to get that to work.
//
//------------------------------------------------------------------
@@ -227,8 +221,8 @@ public:
//------------------------------------------------------------------
void ClearCallback();
- // The rest of these functions are meant to be used only within the breakpoint
- // handling mechanism.
+ // The rest of these functions are meant to be used only within the
+ // breakpoint handling mechanism.
//------------------------------------------------------------------
/// Use this function to invoke the callback for a specific stop.
@@ -367,8 +361,7 @@ public:
//------------------------------------------------------------------
/// Return the current thread spec for this option. This will return nullptr
- /// if the no thread
- /// specifications have been set for this Option yet.
+ /// if the no thread specifications have been set for this Option yet.
/// @return
/// The thread specification pointer for this option, or nullptr if none
/// has
@@ -377,8 +370,8 @@ public:
const ThreadSpec *GetThreadSpecNoCreate() const;
//------------------------------------------------------------------
- /// Returns a pointer to the ThreadSpec for this option, creating it.
- /// if it hasn't been created already. This API is used for setting the
+ /// Returns a pointer to the ThreadSpec for this option, creating it. if it
+ /// hasn't been created already. This API is used for setting the
/// ThreadSpec items for this option.
//------------------------------------------------------------------
ThreadSpec *GetThreadSpec();
@@ -400,8 +393,8 @@ public:
lldb::user_id_t break_loc_id);
//------------------------------------------------------------------
- /// Set a callback based on BreakpointOptions::CommandData.
- /// @param[in] cmd_data
+ /// Set a callback based on BreakpointOptions::CommandData. @param[in]
+ /// cmd_data
/// A UP holding the new'ed CommandData object.
/// The breakpoint will take ownership of pointer held by this object.
//------------------------------------------------------------------
diff --git a/include/lldb/Breakpoint/BreakpointResolver.h b/include/lldb/Breakpoint/BreakpointResolver.h
index 7bcd889ce78b..944741308da6 100644
--- a/include/lldb/Breakpoint/BreakpointResolver.h
+++ b/include/lldb/Breakpoint/BreakpointResolver.h
@@ -26,24 +26,19 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolver BreakpointResolver.h
-/// "lldb/Breakpoint/BreakpointResolver.h"
-/// @brief This class works with SearchFilter to resolve logical breakpoints to
-/// their
-/// of concrete breakpoint locations.
+/// "lldb/Breakpoint/BreakpointResolver.h" This class works with SearchFilter
+/// to resolve logical breakpoints to their of concrete breakpoint locations.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
-/// The BreakpointResolver is a Searcher. In that protocol,
-/// the SearchFilter asks the question "At what depth of the symbol context
-/// descent do you want your callback to get called?" of the filter. The
-/// resolver
-/// answers this question (in the GetDepth method) and provides the resolution
-/// callback.
+/// The BreakpointResolver is a Searcher. In that protocol, the SearchFilter
+/// asks the question "At what depth of the symbol context descent do you want
+/// your callback to get called?" of the filter. The resolver answers this
+/// question (in the GetDepth method) and provides the resolution callback.
/// Each Breakpoint has a BreakpointResolver, and it calls either
-/// ResolveBreakpoint
-/// or ResolveBreakpointInModules to tell it to look for new breakpoint
-/// locations.
+/// ResolveBreakpoint or ResolveBreakpointInModules to tell it to look for new
+/// breakpoint locations.
//----------------------------------------------------------------------
class BreakpointResolver : public Searcher {
@@ -53,8 +48,7 @@ public:
//------------------------------------------------------------------
/// The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint
/// to make sense. It can be constructed without a breakpoint, but you have
- /// to
- /// call SetBreakpoint before ResolveBreakpoint.
+ /// to call SetBreakpoint before ResolveBreakpoint.
///
/// @param[in] bkpt
/// The breakpoint that owns this resolver.
@@ -82,9 +76,9 @@ public:
void SetBreakpoint(Breakpoint *bkpt);
//------------------------------------------------------------------
- /// This updates the offset for this breakpoint. All the locations currently
- /// set for this breakpoint will have their offset adjusted when this is
- /// called.
+ /// This updates the offset for this breakpoint. All the locations
+ /// currently set for this breakpoint will have their offset adjusted when
+ /// this is called.
///
/// @param[in] offset
/// The offset to add to all locations.
@@ -92,9 +86,9 @@ public:
void SetOffset(lldb::addr_t offset);
//------------------------------------------------------------------
- /// This updates the offset for this breakpoint. All the locations currently
- /// set for this breakpoint will have their offset adjusted when this is
- /// called.
+ /// This updates the offset for this breakpoint. All the locations
+ /// currently set for this breakpoint will have their offset adjusted when
+ /// this is called.
///
/// @param[in] offset
/// The offset to add to all locations.
@@ -103,8 +97,7 @@ public:
//------------------------------------------------------------------
/// In response to this method the resolver scans all the modules in the
- /// breakpoint's
- /// target, and adds any new locations it finds.
+ /// breakpoint's target, and adds any new locations it finds.
///
/// @param[in] filter
/// The filter that will manage the search for this resolver.
@@ -113,8 +106,7 @@ public:
//------------------------------------------------------------------
/// In response to this method the resolver scans the modules in the module
- /// list
- /// \a modules, and adds any new locations it finds.
+ /// list \a modules, and adds any new locations it finds.
///
/// @param[in] filter
/// The filter that will manage the search for this resolver.
@@ -157,8 +149,8 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// An enumeration for keeping track of the concrete subclass that
- /// is actually instantiated. Values of this enumeration are kept in the
+ /// An enumeration for keeping track of the concrete subclass that is
+ /// actually instantiated. Values of this enumeration are kept in the
/// BreakpointResolver's SubclassID field. They are used for concrete type
/// identification.
enum ResolverTy {
@@ -171,8 +163,8 @@ public:
UnknownResolver
};
- // Translate the Ty to name for serialization,
- // the "+2" is one for size vrs. index, and one for UnknownResolver.
+ // Translate the Ty to name for serialization, the "+2" is one for size vrs.
+ // index, and one for UnknownResolver.
static const char *g_ty_to_name[LastKnownResolverType + 2];
//------------------------------------------------------------------
@@ -199,8 +191,8 @@ public:
protected:
// Used for serializing resolver options:
- // The options in this enum and the strings in the
- // g_option_names must be kept in sync.
+ // The options in this enum and the strings in the g_option_names must be
+ // kept in sync.
enum class OptionNames : uint32_t {
AddressOffset = 0,
ExactMatch,
@@ -227,12 +219,10 @@ public:
protected:
//------------------------------------------------------------------
- /// SetSCMatchesByLine - Takes a symbol context list of matches which
- /// supposedly represent the same file and
- /// line number in a CU, and find the nearest actual line number that matches,
- /// and then filter down the
- /// matching addresses to unique entries, and skip the prologue if asked to do
- /// so, and then set
+ /// Takes a symbol context list of matches which supposedly represent the
+ /// same file and line number in a CU, and find the nearest actual line
+ /// number that matches, and then filter down the matching addresses to
+ /// unique entries, and skip the prologue if asked to do so, and then set
/// breakpoint locations in this breakpoint for all the resultant addresses.
void SetSCMatchesByLine(SearchFilter &filter, SymbolContextList &sc_list,
bool skip_prologue, llvm::StringRef log_ident);
diff --git a/include/lldb/Breakpoint/BreakpointResolverAddress.h b/include/lldb/Breakpoint/BreakpointResolverAddress.h
index 9d757c8853b9..5845fe7cabed 100644
--- a/include/lldb/Breakpoint/BreakpointResolverAddress.h
+++ b/include/lldb/Breakpoint/BreakpointResolverAddress.h
@@ -21,10 +21,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverAddress BreakpointResolverAddress.h
-/// "lldb/Breakpoint/BreakpointResolverAddress.h"
-/// @brief This class sets breakpoints on a given Address. This breakpoint only
-/// takes
-/// once, and then it won't attempt to reset itself.
+/// "lldb/Breakpoint/BreakpointResolverAddress.h" This class sets breakpoints
+/// on a given Address. This breakpoint only takes once, and then it won't
+/// attempt to reset itself.
//----------------------------------------------------------------------
class BreakpointResolverAddress : public BreakpointResolver {
@@ -74,8 +73,7 @@ protected:
FileSpec m_module_filespec; // If this filespec is Valid, and m_addr is an
// offset, then it will be converted
// to a Section+Offset address in this module, whenever that module gets
- // around to
- // being loaded.
+ // around to being loaded.
private:
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverAddress);
};
diff --git a/include/lldb/Breakpoint/BreakpointResolverFileLine.h b/include/lldb/Breakpoint/BreakpointResolverFileLine.h
index f7bba3d4ccb4..3464f8ea80d8 100644
--- a/include/lldb/Breakpoint/BreakpointResolverFileLine.h
+++ b/include/lldb/Breakpoint/BreakpointResolverFileLine.h
@@ -20,10 +20,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverFileLine BreakpointResolverFileLine.h
-/// "lldb/Breakpoint/BreakpointResolverFileLine.h"
-/// @brief This class sets breakpoints by file and line. Optionally, it will
-/// look for inlined
-/// instances of the file and line specification.
+/// "lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints
+/// by file and line. Optionally, it will look for inlined instances of the
+/// file and line specification.
//----------------------------------------------------------------------
class BreakpointResolverFileLine : public BreakpointResolver {
@@ -63,7 +62,7 @@ public:
lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override;
protected:
- void FilterContexts(SymbolContextList &sc_list);
+ void FilterContexts(SymbolContextList &sc_list, bool is_relative);
friend class Breakpoint;
FileSpec m_file_spec; // This is the file spec we are looking for.
diff --git a/include/lldb/Breakpoint/BreakpointResolverFileRegex.h b/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
index d620e99ffc60..c1a7a15566a5 100644
--- a/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
+++ b/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
@@ -23,9 +23,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverFileRegex BreakpointResolverFileRegex.h
-/// "lldb/Breakpoint/BreakpointResolverFileRegex.h"
-/// @brief This class sets breakpoints by file and line. Optionally, it will
-/// look for inlined
+/// "lldb/Breakpoint/BreakpointResolverFileRegex.h" This class sets
+/// breakpoints by file and line. Optionally, it will look for inlined
/// instances of the file and line specification.
//----------------------------------------------------------------------
diff --git a/include/lldb/Breakpoint/BreakpointResolverName.h b/include/lldb/Breakpoint/BreakpointResolverName.h
index c7716d5146ef..794ea67bb721 100644
--- a/include/lldb/Breakpoint/BreakpointResolverName.h
+++ b/include/lldb/Breakpoint/BreakpointResolverName.h
@@ -24,10 +24,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverName BreakpointResolverName.h
-/// "lldb/Breakpoint/BreakpointResolverName.h"
-/// @brief This class sets breakpoints on a given function name, either by exact
-/// match
-/// or by regular expression.
+/// "lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on
+/// a given function name, either by exact match or by regular expression.
//----------------------------------------------------------------------
class BreakpointResolverName : public BreakpointResolver {
@@ -48,8 +46,8 @@ public:
uint32_t name_type_mask, lldb::LanguageType language,
lldb::addr_t offset, bool skip_prologue);
- // Creates a function breakpoint by regular expression. Takes over control of
- // the lifespan of func_regex.
+ // Creates a function breakpoint by regular expression. Takes over control
+ // of the lifespan of func_regex.
BreakpointResolverName(Breakpoint *bkpt, RegularExpression &func_regex,
lldb::LanguageType language, lldb::addr_t offset,
bool skip_prologue);
diff --git a/include/lldb/Breakpoint/BreakpointSite.h b/include/lldb/Breakpoint/BreakpointSite.h
index 6e9875615fd9..c9bd883ca738 100644
--- a/include/lldb/Breakpoint/BreakpointSite.h
+++ b/include/lldb/Breakpoint/BreakpointSite.h
@@ -28,15 +28,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointSite BreakpointSite.h "lldb/Breakpoint/BreakpointSite.h"
-/// @brief Class that manages the actual breakpoint that will be inserted
-/// into the running program.
+/// Class that manages the actual breakpoint that will be inserted into the
+/// running program.
///
-/// The BreakpointSite class handles the physical breakpoint that is
-/// actually inserted in the target program. As such, it is also the
-/// one that gets hit, when the program stops. It keeps a list of all
-/// BreakpointLocations that share this physical site. When the
-/// breakpoint is hit, all the locations are informed by the breakpoint
-/// site. Breakpoint sites are owned by the process.
+/// The BreakpointSite class handles the physical breakpoint that is actually
+/// inserted in the target program. As such, it is also the one that gets
+/// hit, when the program stops. It keeps a list of all BreakpointLocations
+/// that share this physical site. When the breakpoint is hit, all the
+/// locations are informed by the breakpoint site. Breakpoint sites are owned
+/// by the process.
//----------------------------------------------------------------------
class BreakpointSite : public std::enable_shared_from_this<BreakpointSite>,
@@ -101,10 +101,9 @@ public:
/// Tells whether the current breakpoint site is enabled or not
///
/// This is a low-level enable bit for the breakpoint sites. If a
- /// breakpoint site has no enabled owners, it should just get
- /// removed. This enable/disable is for the low-level target code
- /// to enable and disable breakpoint sites when single stepping,
- /// etc.
+ /// breakpoint site has no enabled owners, it should just get removed. This
+ /// enable/disable is for the low-level target code to enable and disable
+ /// breakpoint sites when single stepping, etc.
//------------------------------------------------------------------
bool IsEnabled() const;
@@ -118,8 +117,7 @@ public:
//------------------------------------------------------------------
/// Enquires of the breakpoint locations that produced this breakpoint site
- /// whether
- /// we should stop at this location.
+ /// whether we should stop at this location.
///
/// @param[in] context
/// This contains the information about this stop.
@@ -138,9 +136,8 @@ public:
void Dump(Stream *s) const override;
//------------------------------------------------------------------
- /// The "Owners" are the breakpoint locations that share this
- /// breakpoint site. The method adds the \a owner to this breakpoint
- /// site's owner list.
+ /// The "Owners" are the breakpoint locations that share this breakpoint
+ /// site. The method adds the \a owner to this breakpoint site's owner list.
///
/// @param[in] context
/// \a owner is the Breakpoint Location to add.
@@ -148,8 +145,8 @@ public:
void AddOwner(const lldb::BreakpointLocationSP &owner);
//------------------------------------------------------------------
- /// This method returns the number of breakpoint locations currently
- /// located at this breakpoint site.
+ /// This method returns the number of breakpoint locations currently located
+ /// at this breakpoint site.
///
/// @return
/// The number of owners.
@@ -157,10 +154,10 @@ public:
size_t GetNumberOfOwners();
//------------------------------------------------------------------
- /// This method returns the breakpoint location at index \a index
- /// located at this breakpoint site. The owners are listed ordinally
- /// from 0 to GetNumberOfOwners() - 1 so you can use this method to iterate
- /// over the owners
+ /// This method returns the breakpoint location at index \a index located at
+ /// this breakpoint site. The owners are listed ordinally from 0 to
+ /// GetNumberOfOwners() - 1 so you can use this method to iterate over the
+ /// owners
///
/// @param[in] index
/// The index in the list of owners for which you wish the owner location.
@@ -183,9 +180,9 @@ public:
size_t CopyOwnersList(BreakpointLocationCollection &out_collection);
//------------------------------------------------------------------
- /// Check whether the owners of this breakpoint site have any
- /// thread specifiers, and if yes, is \a thread contained in any
- /// of these specifiers.
+ /// Check whether the owners of this breakpoint site have any thread
+ /// specifiers, and if yes, is \a thread contained in any of these
+ /// specifiers.
///
/// @param[in] thread
/// The thread against which to test.
@@ -198,9 +195,9 @@ public:
//------------------------------------------------------------------
/// Print a description of this breakpoint site to the stream \a s.
- /// GetDescription tells you about the breakpoint site's owners.
- /// Use BreakpointSite::Dump(Stream *) to get information about the
- /// breakpoint site itself.
+ /// GetDescription tells you about the breakpoint site's owners. Use
+ /// BreakpointSite::Dump(Stream *) to get information about the breakpoint
+ /// site itself.
///
/// @param[in] s
/// The stream to which to print the description.
@@ -226,7 +223,8 @@ public:
bool IsBreakpointAtThisSite(lldb::break_id_t bp_id);
//------------------------------------------------------------------
- /// Tell whether ALL the breakpoints in the location collection are internal.
+ /// Tell whether ALL the breakpoints in the location collection are
+ /// internal.
///
/// @result
/// \b true if all breakpoint locations are owned by internal breakpoints,
@@ -241,15 +239,16 @@ public:
private:
friend class Process;
friend class BreakpointLocation;
- // The StopInfoBreakpoint knows when it is processing a hit for a thread for a
- // site, so let it be the
- // one to manage setting the location hit count once and only once.
+ // The StopInfoBreakpoint knows when it is processing a hit for a thread for
+ // a site, so let it be the one to manage setting the location hit count once
+ // and only once.
friend class StopInfoBreakpoint;
void BumpHitCounts();
//------------------------------------------------------------------
- /// The method removes the owner at \a break_loc_id from this breakpoint list.
+ /// The method removes the owner at \a break_loc_id from this breakpoint
+ /// list.
///
/// @param[in] context
/// \a break_loc_id is the Breakpoint Location to remove.
@@ -264,8 +263,8 @@ private:
bool
m_enabled; ///< Boolean indicating if this breakpoint site enabled or not.
- // Consider adding an optimization where if there is only one
- // owner, we don't store a list. The usual case will be only one owner...
+ // Consider adding an optimization where if there is only one owner, we don't
+ // store a list. The usual case will be only one owner...
BreakpointLocationCollection m_owners; ///< This has the BreakpointLocations
///that share this breakpoint site.
std::recursive_mutex
diff --git a/include/lldb/Breakpoint/BreakpointSiteList.h b/include/lldb/Breakpoint/BreakpointSiteList.h
index 1431fe799675..d6530c170430 100644
--- a/include/lldb/Breakpoint/BreakpointSiteList.h
+++ b/include/lldb/Breakpoint/BreakpointSiteList.h
@@ -24,8 +24,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointSiteList BreakpointSiteList.h
-/// "lldb/Breakpoint/BreakpointSiteList.h"
-/// @brief Class that manages lists of BreakpointSite shared pointers.
+/// "lldb/Breakpoint/BreakpointSiteList.h" Class that manages lists of
+/// BreakpointSite shared pointers.
//----------------------------------------------------------------------
class BreakpointSiteList {
// At present Process directly accesses the map of BreakpointSites so it can
@@ -56,15 +56,13 @@ public:
lldb::break_id_t Add(const lldb::BreakpointSiteSP &bp_site_sp);
//------------------------------------------------------------------
- /// Standard Dump routine, doesn't do anything at present.
- /// @param[in] s
+ /// Standard Dump routine, doesn't do anything at present. @param[in] s
/// Stream into which to dump the description.
//------------------------------------------------------------------
void Dump(Stream *s) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint site at address
- /// \a addr.
+ /// Returns a shared pointer to the breakpoint site at address \a addr.
///
/// @param[in] addr
/// The address to look for.
@@ -89,8 +87,8 @@ public:
lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint site with id \a breakID - const
- /// version.
+ /// Returns a shared pointer to the breakpoint site with id \a breakID -
+ /// const version.
///
/// @param[in] breakID
/// The breakpoint site ID to seek for.
@@ -103,7 +101,8 @@ public:
const lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID) const;
//------------------------------------------------------------------
- /// Returns the breakpoint site id to the breakpoint site at address \a addr.
+ /// Returns the breakpoint site id to the breakpoint site at address \a
+ /// addr.
///
/// @param[in] addr
/// The address to match.
@@ -161,8 +160,8 @@ public:
void *baton);
//------------------------------------------------------------------
- /// Enquires of the breakpoint site on in this list with ID \a breakID whether
- /// we should stop for the breakpoint or not.
+ /// Enquires of the breakpoint site on in this list with ID \a breakID
+ /// whether we should stop for the breakpoint or not.
///
/// @param[in] context
/// This contains the information about this stop.
diff --git a/include/lldb/Breakpoint/StoppointCallbackContext.h b/include/lldb/Breakpoint/StoppointCallbackContext.h
index 2680584845d7..1dac342d3325 100644
--- a/include/lldb/Breakpoint/StoppointCallbackContext.h
+++ b/include/lldb/Breakpoint/StoppointCallbackContext.h
@@ -17,18 +17,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class StoppointCallbackContext StoppointCallbackContext.h
-/// "lldb/Breakpoint/StoppointCallbackContext.h"
-/// @brief Class holds the information that a breakpoint callback needs to
-/// evaluate this stop.
+/// "lldb/Breakpoint/StoppointCallbackContext.h" Class holds the information
+/// that a breakpoint callback needs to evaluate this stop.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
/// When we hit a breakpoint we need to package up whatever information is
-/// needed
-/// to evaluate breakpoint commands and conditions. This class is the container
-/// of
-/// that information.
+/// needed to evaluate breakpoint commands and conditions. This class is the
+/// container of that information.
//----------------------------------------------------------------------
class StoppointCallbackContext {
diff --git a/include/lldb/Breakpoint/StoppointLocation.h b/include/lldb/Breakpoint/StoppointLocation.h
index f64035bbb941..5c717bbc3b0f 100644
--- a/include/lldb/Breakpoint/StoppointLocation.h
+++ b/include/lldb/Breakpoint/StoppointLocation.h
@@ -77,8 +77,8 @@ protected:
// breakpoint/watchpoint
uint32_t m_byte_size; // The size in bytes of stop location. e.g. the length
// of the trap opcode for
- // software breakpoints, or the optional length in bytes for
- // hardware breakpoints, or the length of the watchpoint.
+ // software breakpoints, or the optional length in bytes for hardware
+ // breakpoints, or the length of the watchpoint.
uint32_t
m_hit_count; // Number of times this breakpoint/watchpoint has been hit
diff --git a/include/lldb/Breakpoint/Watchpoint.h b/include/lldb/Breakpoint/Watchpoint.h
index 69067a567621..10df18a5c266 100644
--- a/include/lldb/Breakpoint/Watchpoint.h
+++ b/include/lldb/Breakpoint/Watchpoint.h
@@ -71,9 +71,9 @@ public:
bool IsEnabled() const;
- // This doesn't really enable/disable the watchpoint.
- // It is currently just for use in the Process plugin's
- // {Enable,Disable}Watchpoint, which should be used instead.
+ // This doesn't really enable/disable the watchpoint. It is currently just
+ // for use in the Process plugin's {Enable,Disable}Watchpoint, which should
+ // be used instead.
void SetEnabled(bool enabled, bool notify = true);
@@ -197,10 +197,8 @@ private:
uint32_t m_disabled_count; // Keep track of the count that the watchpoint is
// disabled while in ephemeral mode.
// At the end of the ephemeral mode when the watchpoint is to be enabled
- // again,
- // we check the count, if it is more than 1, it means the user-supplied
- // actions
- // actually want the watchpoint to be disabled!
+ // again, we check the count, if it is more than 1, it means the user-
+ // supplied actions actually want the watchpoint to be disabled!
uint32_t m_watch_read : 1, // 1 if we stop when the watched data is read from
m_watch_write : 1, // 1 if we stop when the watched data is written to
m_watch_was_read : 1, // Set to 1 when watchpoint is hit for a read access
diff --git a/include/lldb/Breakpoint/WatchpointList.h b/include/lldb/Breakpoint/WatchpointList.h
index 9abac9167b0b..d5e0da444afb 100644
--- a/include/lldb/Breakpoint/WatchpointList.h
+++ b/include/lldb/Breakpoint/WatchpointList.h
@@ -25,15 +25,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class WatchpointList WatchpointList.h "lldb/Breakpoint/WatchpointList.h"
-/// @brief This class is used by Watchpoint to manage a list of watchpoints,
+/// This class is used by Watchpoint to manage a list of watchpoints,
// each watchpoint in the list has a unique ID, and is unique by Address as
// well.
//----------------------------------------------------------------------
class WatchpointList {
- // Only Target can make the watchpoint list, or add elements to it.
- // This is not just some random collection of watchpoints. Rather, the act of
- // adding the watchpoint to this list sets its ID.
+ // Only Target can make the watchpoint list, or add elements to it. This is
+ // not just some random collection of watchpoints. Rather, the act of adding
+ // the watchpoint to this list sets its ID.
friend class Watchpoint;
friend class Target;
@@ -70,9 +70,8 @@ public:
void DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the watchpoint at address
- /// \a addr -
- /// const version.
+ /// Returns a shared pointer to the watchpoint at address \a addr - const
+ /// version.
///
/// @param[in] addr
/// The address to look for.
@@ -84,9 +83,8 @@ public:
const lldb::WatchpointSP FindByAddress(lldb::addr_t addr) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the watchpoint with watchpoint spec
- /// \a spec -
- /// const version.
+ /// Returns a shared pointer to the watchpoint with watchpoint spec \a spec
+ /// - const version.
///
/// @param[in] spec
/// The watchpoint spec to look for.
@@ -98,8 +96,7 @@ public:
const lldb::WatchpointSP FindBySpec(std::string spec) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the watchpoint with id
- /// \a watchID, const
+ /// Returns a shared pointer to the watchpoint with id \a watchID, const
/// version.
///
/// @param[in] watchID
@@ -112,8 +109,7 @@ public:
lldb::WatchpointSP FindByID(lldb::watch_id_t watchID) const;
//------------------------------------------------------------------
- /// Returns the watchpoint id to the watchpoint
- /// at address \a addr.
+ /// Returns the watchpoint id to the watchpoint at address \a addr.
///
/// @param[in] addr
/// The address to match.
@@ -124,8 +120,8 @@ public:
lldb::watch_id_t FindIDByAddress(lldb::addr_t addr);
//------------------------------------------------------------------
- /// Returns the watchpoint id to the watchpoint
- /// with watchpoint spec \a spec.
+ /// Returns the watchpoint id to the watchpoint with watchpoint spec \a
+ /// spec.
///
/// @param[in] spec
/// The watchpoint spec to match.
diff --git a/include/lldb/Breakpoint/WatchpointOptions.h b/include/lldb/Breakpoint/WatchpointOptions.h
index 6ab1264a1c7f..8cb3b97f3a62 100644
--- a/include/lldb/Breakpoint/WatchpointOptions.h
+++ b/include/lldb/Breakpoint/WatchpointOptions.h
@@ -25,8 +25,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class WatchpointOptions WatchpointOptions.h
-/// "lldb/Breakpoint/WatchpointOptions.h"
-/// @brief Class that manages the options on a watchpoint.
+/// "lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a
+/// watchpoint.
//----------------------------------------------------------------------
class WatchpointOptions {
@@ -69,15 +69,13 @@ public:
// Callbacks
//
// Watchpoint callbacks come in two forms, synchronous and asynchronous.
- // Synchronous callbacks will get
- // run before any of the thread plans are consulted, and if they return false
- // the target will continue
- // "under the radar" of the thread plans. There are a couple of restrictions
- // to synchronous callbacks:
- // 1) They should NOT resume the target themselves. Just return false if you
- // want the target to restart.
- // 2) Watchpoints with synchronous callbacks can't have conditions (or rather,
- // they can have them, but they
+ // Synchronous callbacks will get run before any of the thread plans are
+ // consulted, and if they return false the target will continue "under the
+ // radar" of the thread plans. There are a couple of restrictions to
+ // synchronous callbacks: 1) They should NOT resume the target themselves.
+ // Just return false if you want the target to restart. 2) Watchpoints with
+ // synchronous callbacks can't have conditions (or rather, they can have
+ // them, but they
// won't do anything. Ditto with ignore counts, etc... You are supposed
// to control that all through the
// callback.
@@ -118,8 +116,8 @@ public:
//------------------------------------------------------------------
void ClearCallback();
- // The rest of these functions are meant to be used only within the watchpoint
- // handling mechanism.
+ // The rest of these functions are meant to be used only within the
+ // watchpoint handling mechanism.
//------------------------------------------------------------------
/// Use this function to invoke the callback for a specific stop.
@@ -168,8 +166,7 @@ public:
//------------------------------------------------------------------
/// Return the current thread spec for this option. This will return nullptr
- /// if the no thread
- /// specifications have been set for this Option yet.
+ /// if the no thread specifications have been set for this Option yet.
/// @return
/// The thread specification pointer for this option, or nullptr if none
/// has
@@ -178,8 +175,8 @@ public:
const ThreadSpec *GetThreadSpecNoCreate() const;
//------------------------------------------------------------------
- /// Returns a pointer to the ThreadSpec for this option, creating it.
- /// if it hasn't been created already. This API is used for setting the
+ /// Returns a pointer to the ThreadSpec for this option, creating it. if it
+ /// hasn't been created already. This API is used for setting the
/// ThreadSpec items for this option.
//------------------------------------------------------------------
ThreadSpec *GetThreadSpec();
diff --git a/include/lldb/Core/Address.h b/include/lldb/Core/Address.h
index 4c77458061d0..617aaefe91c9 100644
--- a/include/lldb/Core/Address.h
+++ b/include/lldb/Core/Address.h
@@ -11,8 +11,8 @@
#define liblldb_Address_h_
#include "lldb/lldb-defines.h" // for LLDB_INVALID_ADDRESS
-#include "lldb/lldb-enumerations.h" // for AddressClass::eAddressClassInvalid
#include "lldb/lldb-forward.h" // for SectionWP, SectionSP, ModuleSP
+#include "lldb/lldb-private-enumerations.h" // for AddressClass
#include "lldb/lldb-types.h" // for addr_t
#include <stddef.h> // for size_t
@@ -53,54 +53,50 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Address Address.h "lldb/Core/Address.h"
-/// @brief A section + offset based address class.
+/// A section + offset based address class.
///
-/// The Address class allows addresses to be relative to a section
-/// that can move during runtime due to images (executables, shared
-/// libraries, bundles, frameworks) being loaded at different
-/// addresses than the addresses found in the object file that
-/// represents them on disk. There are currently two types of addresses
-/// for a section:
+/// The Address class allows addresses to be relative to a section that can
+/// move during runtime due to images (executables, shared libraries, bundles,
+/// frameworks) being loaded at different addresses than the addresses found
+/// in the object file that represents them on disk. There are currently two
+/// types of addresses for a section:
/// @li file addresses
/// @li load addresses
///
-/// File addresses represent the virtual addresses that are in the "on
-/// disk" object files. These virtual addresses are converted to be
-/// relative to unique sections scoped to the object file so that
-/// when/if the addresses slide when the images are loaded/unloaded
-/// in memory, we can easily track these changes without having to
-/// update every object (compile unit ranges, line tables, function
-/// address ranges, lexical block and inlined subroutine address
-/// ranges, global and static variables) each time an image is loaded or
-/// unloaded.
+/// File addresses represent the virtual addresses that are in the "on disk"
+/// object files. These virtual addresses are converted to be relative to
+/// unique sections scoped to the object file so that when/if the addresses
+/// slide when the images are loaded/unloaded in memory, we can easily track
+/// these changes without having to update every object (compile unit ranges,
+/// line tables, function address ranges, lexical block and inlined subroutine
+/// address ranges, global and static variables) each time an image is loaded
+/// or unloaded.
///
-/// Load addresses represent the virtual addresses where each section
-/// ends up getting loaded at runtime. Before executing a program, it
-/// is common for all of the load addresses to be unresolved. When a
-/// DynamicLoader plug-in receives notification that shared libraries
-/// have been loaded/unloaded, the load addresses of the main executable
-/// and any images (shared libraries) will be resolved/unresolved. When
-/// this happens, breakpoints that are in one of these sections can be
-/// set/cleared.
+/// Load addresses represent the virtual addresses where each section ends up
+/// getting loaded at runtime. Before executing a program, it is common for
+/// all of the load addresses to be unresolved. When a DynamicLoader plug-in
+/// receives notification that shared libraries have been loaded/unloaded, the
+/// load addresses of the main executable and any images (shared libraries)
+/// will be resolved/unresolved. When this happens, breakpoints that are in
+/// one of these sections can be set/cleared.
//----------------------------------------------------------------------
class Address {
public:
//------------------------------------------------------------------
- /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const
- /// function to display Address contents in a variety of ways.
+ /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const function
+ /// to display Address contents in a variety of ways.
//------------------------------------------------------------------
typedef enum {
DumpStyleInvalid, ///< Invalid dump style
DumpStyleSectionNameOffset, ///< Display as the section name + offset.
///< \code
/// // address for printf in libSystem.B.dylib as a section name + offset
- /// libSystem.B.dylib.__TEXT.__text + 0x0005cfdf
- /// \endcode
+ /// libSystem.B.dylib.__TEXT.__text + 0x0005cfdf \endcode
DumpStyleSectionPointerOffset, ///< Display as the section pointer + offset
///(debug output).
///< \code
- /// // address for printf in libSystem.B.dylib as a section pointer + offset
- /// (lldb::Section *)0x35cc50 + 0x000000000005cfdf \endcode
+ /// // address for printf in libSystem.B.dylib as a section pointer +
+ /// offset (lldb::Section *)0x35cc50 + 0x000000000005cfdf \endcode
DumpStyleFileAddress, ///< Display as the file address (if any).
///< \code
/// // address for printf in libSystem.B.dylib as a file address
@@ -135,8 +131,8 @@ public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// Initialize with a invalid section (NULL) and an invalid
- /// offset (LLDB_INVALID_ADDRESS).
+ /// Initialize with a invalid section (NULL) and an invalid offset
+ /// (LLDB_INVALID_ADDRESS).
//------------------------------------------------------------------
Address() : m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) {}
@@ -154,8 +150,7 @@ public:
//------------------------------------------------------------------
/// Construct with a section pointer and offset.
///
- /// Initialize the address with the supplied \a section and \a
- /// offset.
+ /// Initialize the address with the supplied \a section and \a offset.
///
/// @param[in] section
/// A section pointer to a valid lldb::Section, or NULL if the
@@ -175,8 +170,8 @@ public:
//------------------------------------------------------------------
/// Construct with a virtual address and section list.
///
- /// Initialize and resolve the address with the supplied virtual
- /// address \a file_addr.
+ /// Initialize and resolve the address with the supplied virtual address \a
+ /// file_addr.
///
/// @param[in] file_addr
/// A virtual file address.
@@ -191,8 +186,8 @@ public:
//------------------------------------------------------------------
/// Assignment operator.
///
-/// Copies the address value from another Address object \a rhs
-/// into \a this object.
+/// Copies the address value from another Address object \a rhs into \a this
+/// object.
///
/// @param[in] rhs
/// A const Address object reference to copy.
@@ -207,8 +202,8 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Sets the section to an invalid value (NULL) and an invalid
- /// offset (LLDB_INVALID_ADDRESS).
+ /// Sets the section to an invalid value (NULL) and an invalid offset
+ /// (LLDB_INVALID_ADDRESS).
//------------------------------------------------------------------
void Clear() {
m_section_wp.reset();
@@ -250,9 +245,9 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s. There are many ways to display a section
- /// offset based address, and \a style lets the user choose.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s. There are many ways to display a section offset based address, and
+ /// \a style lets the user choose.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -275,14 +270,14 @@ public:
DumpStyle fallback_style = DumpStyleInvalid,
uint32_t addr_byte_size = UINT32_MAX) const;
- lldb::AddressClass GetAddressClass() const;
+ AddressClass GetAddressClass() const;
//------------------------------------------------------------------
/// Get the file address.
///
- /// If an address comes from a file on disk that has section
- /// relative addresses, then it has a virtual address that is
- /// relative to unique section in the object file.
+ /// If an address comes from a file on disk that has section relative
+ /// addresses, then it has a virtual address that is relative to unique
+ /// section in the object file.
///
/// @return
/// The valid file virtual address, or LLDB_INVALID_ADDRESS if
@@ -294,12 +289,12 @@ public:
//------------------------------------------------------------------
/// Get the load address.
///
- /// If an address comes from a file on disk that has section
- /// relative addresses, then it has a virtual address that is
- /// relative to unique section in the object file. Sections get
- /// resolved at runtime by DynamicLoader plug-ins as images
- /// (executables and shared libraries) get loaded/unloaded. If a
- /// section is loaded, then the load address can be resolved.
+ /// If an address comes from a file on disk that has section relative
+ /// addresses, then it has a virtual address that is relative to unique
+ /// section in the object file. Sections get resolved at runtime by
+ /// DynamicLoader plug-ins as images (executables and shared libraries) get
+ /// loaded/unloaded. If a section is loaded, then the load address can be
+ /// resolved.
///
/// @return
/// The valid load virtual address, or LLDB_INVALID_ADDRESS if
@@ -310,12 +305,12 @@ public:
//------------------------------------------------------------------
/// Get the load address as a callable code load address.
///
- /// This function will first resolve its address to a load address.
- /// Then, if the address turns out to be in code address, return the
- /// load address that would be required to call or return to. The
- /// address might have extra bits set (bit zero will be set to Thumb
- /// functions for an ARM target) that are required when changing the
- /// program counter to setting a return address.
+ /// This function will first resolve its address to a load address. Then, if
+ /// the address turns out to be in code address, return the load address
+ /// that would be required to call or return to. The address might have
+ /// extra bits set (bit zero will be set to Thumb functions for an ARM
+ /// target) that are required when changing the program counter to setting a
+ /// return address.
///
/// @return
/// The valid load virtual address, or LLDB_INVALID_ADDRESS if
@@ -327,14 +322,14 @@ public:
//------------------------------------------------------------------
/// Get the load address as an opcode load address.
///
- /// This function will first resolve its address to a load address.
- /// Then, if the address turns out to be in code address, return the
- /// load address for an opcode. This address object might have
- /// extra bits set (bit zero will be set to Thumb functions for an
+ /// This function will first resolve its address to a load address. Then, if
+ /// the address turns out to be in code address, return the load address for
+ /// an opcode. This address object might have extra bits set (bit zero will
+ /// be set to Thumb functions for an
/// ARM target) that are required for changing the program counter
- /// and this function will remove any bits that are intended for
- /// these special purposes. The result of this function can be used
- /// to safely write a software breakpoint trap to memory.
+ /// and this function will remove any bits that are intended for these
+ /// special purposes. The result of this function can be used to safely
+ /// write a software breakpoint trap to memory.
///
/// @return
/// The valid load virtual address with extra callable bits
@@ -343,7 +338,7 @@ public:
//------------------------------------------------------------------
lldb::addr_t GetOpcodeLoadAddress(
Target *target,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
+ AddressClass addr_class = AddressClass::eInvalid) const;
//------------------------------------------------------------------
/// Get the section relative offset value.
@@ -357,11 +352,11 @@ public:
//------------------------------------------------------------------
/// Check if an address is section offset.
///
- /// When converting a virtual file or load address into a section
- /// offset based address, we often need to know if, given a section
- /// list, if the address was able to be converted to section offset.
- /// This function returns true if the current value contained in
- /// this object is section offset based.
+ /// When converting a virtual file or load address into a section offset
+ /// based address, we often need to know if, given a section list, if the
+ /// address was able to be converted to section offset. This function
+ /// returns true if the current value contained in this object is section
+ /// offset based.
///
/// @return
/// Returns \b true if the address has a valid section and
@@ -375,8 +370,8 @@ public:
/// Check if the object state is valid.
///
/// A valid Address object contains either a section pointer and
- /// and offset (for section offset based addresses), or just a valid
- /// offset (for absolute addresses that have no section).
+ /// offset (for section offset based addresses), or just a valid offset
+ /// (for absolute addresses that have no section).
///
/// @return
/// Returns \b true if the offset is valid, \b false
@@ -395,8 +390,8 @@ public:
//------------------------------------------------------------------
/// Resolve a file virtual address using a section list.
///
- /// Given a list of sections, attempt to resolve \a addr as a
- /// an offset into one of the file sections.
+ /// Given a list of sections, attempt to resolve \a addr as an offset into
+ /// one of the file sections.
///
/// @return
/// Returns \b true if \a addr was able to be resolved, \b false
@@ -408,11 +403,10 @@ public:
//------------------------------------------------------------------
/// Set the address to represent \a load_addr.
///
- /// The address will attempt to find a loaded section within
- /// \a target that contains \a load_addr. If successful, this
- /// address object will have a valid section and offset. Else this
- /// address object will have no section (NULL) and the offset will
- /// be \a load_addr.
+ /// The address will attempt to find a loaded section within \a target that
+ /// contains \a load_addr. If successful, this address object will have a
+ /// valid section and offset. Else this address object will have no section
+ /// (NULL) and the offset will be \a load_addr.
///
/// @param[in] load_addr
/// A load address from a current process.
@@ -438,7 +432,7 @@ public:
bool SetOpcodeLoadAddress(
lldb::addr_t load_addr, Target *target,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid,
+ AddressClass addr_class = AddressClass::eInvalid,
bool allow_section_end = false);
bool SetCallableLoadAddress(lldb::addr_t load_addr, Target *target);
@@ -507,10 +501,10 @@ public:
//------------------------------------------------------------------
/// Reconstruct a symbol context from an address.
///
- /// This class doesn't inherit from SymbolContextScope because many
- /// address objects have short lifespans. Address objects that are
- /// section offset can reconstruct their symbol context by looking
- /// up the address in the module found in the section.
+ /// This class doesn't inherit from SymbolContextScope because many address
+ /// objects have short lifespans. Address objects that are section offset
+ /// can reconstruct their symbol context by looking up the address in the
+ /// module found in the section.
///
/// @see SymbolContextScope::CalculateSymbolContext(SymbolContext*)
//------------------------------------------------------------------
@@ -531,11 +525,11 @@ public:
bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const;
//------------------------------------------------------------------
- // Returns true if the section should be valid, but isn't because
- // the shared pointer to the section can't be reconstructed from
- // a weak pointer that contains a valid weak reference to a section.
- // Returns false if the section weak pointer has no reference to
- // a section, or if the section is still valid
+ // Returns true if the section should be valid, but isn't because the shared
+ // pointer to the section can't be reconstructed from a weak pointer that
+ // contains a valid weak reference to a section. Returns false if the section
+ // weak pointer has no reference to a section, or if the section is still
+ // valid
//------------------------------------------------------------------
bool SectionWasDeleted() const;
@@ -547,29 +541,27 @@ protected:
lldb::addr_t m_offset; ///< Offset into section if \a m_section_wp is valid...
//------------------------------------------------------------------
- // Returns true if the m_section_wp once had a reference to a valid
- // section shared pointer, but no longer does. This can happen if
- // we have an address from a module that gets unloaded and deleted.
- // This function should only be called if GetSection() returns an
- // empty shared pointer and you want to know if this address used to
- // have a valid section.
+ // Returns true if the m_section_wp once had a reference to a valid section
+ // shared pointer, but no longer does. This can happen if we have an address
+ // from a module that gets unloaded and deleted. This function should only be
+ // called if GetSection() returns an empty shared pointer and you want to
+ // know if this address used to have a valid section.
//------------------------------------------------------------------
bool SectionWasDeletedPrivate() const;
};
//----------------------------------------------------------------------
// NOTE: Be careful using this operator. It can correctly compare two
-// addresses from the same Module correctly. It can't compare two
-// addresses from different modules in any meaningful way, but it will
-// compare the module pointers.
+// addresses from the same Module correctly. It can't compare two addresses
+// from different modules in any meaningful way, but it will compare the module
+// pointers.
//
// To sum things up:
-// - works great for addresses within the same module
-// - it works for addresses across multiple modules, but don't expect the
+// - works great for addresses within the same module - it works for addresses
+// across multiple modules, but don't expect the
// address results to make much sense
//
-// This basically lets Address objects be used in ordered collection
-// classes.
+// This basically lets Address objects be used in ordered collection classes.
//----------------------------------------------------------------------
bool operator<(const Address &lhs, const Address &rhs);
bool operator>(const Address &lhs, const Address &rhs);
diff --git a/include/lldb/Core/AddressRange.h b/include/lldb/Core/AddressRange.h
index e787d1d5740d..9f69c87ee354 100644
--- a/include/lldb/Core/AddressRange.h
+++ b/include/lldb/Core/AddressRange.h
@@ -30,23 +30,23 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressRange AddressRange.h "lldb/Core/AddressRange.h"
-/// @brief A section + offset based address range class.
+/// A section + offset based address range class.
//----------------------------------------------------------------------
class AddressRange {
public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// Initialize with a invalid section (NULL), an invalid
- /// offset (LLDB_INVALID_ADDRESS), and zero byte size.
+ /// Initialize with a invalid section (NULL), an invalid offset
+ /// (LLDB_INVALID_ADDRESS), and zero byte size.
//------------------------------------------------------------------
AddressRange();
//------------------------------------------------------------------
/// Construct with a section pointer, offset, and byte_size.
///
- /// Initialize the address with the supplied \a section, \a
- /// offset and \a byte_size.
+ /// Initialize the address with the supplied \a section, \a offset and \a
+ /// byte_size.
///
/// @param[in] section
/// A section pointer to a valid lldb::Section, or NULL if the
@@ -64,8 +64,8 @@ public:
//------------------------------------------------------------------
/// Construct with a virtual address, section list and byte size.
///
- /// Initialize and resolve the address with the supplied virtual
- /// address \a file_addr, and byte size \a byte_size.
+ /// Initialize and resolve the address with the supplied virtual address \a
+ /// file_addr, and byte size \a byte_size.
///
/// @param[in] file_addr
/// A virtual address.
@@ -82,8 +82,8 @@ public:
//------------------------------------------------------------------
/// Construct with a Address object address and byte size.
///
- /// Initialize by copying the section offset address in \a so_addr,
- /// and setting the byte size to \a byte_size.
+ /// Initialize by copying the section offset address in \a so_addr, and
+ /// setting the byte size to \a byte_size.
///
/// @param[in] so_addr
/// A section offset address object.
@@ -135,8 +135,8 @@ public:
// Contains (const Address *so_addr_ptr) const;
//------------------------------------------------------------------
- /// Check if a section offset \a so_addr when represented as a file
- /// address is contained within this object's file address range.
+ /// Check if a section offset \a so_addr when represented as a file address
+ /// is contained within this object's file address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -149,8 +149,8 @@ public:
bool ContainsFileAddress(const Address &so_addr) const;
//------------------------------------------------------------------
- /// Check if the resolved file address \a file_addr is contained
- /// within this object's file address range.
+ /// Check if the resolved file address \a file_addr is contained within this
+ /// object's file address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -163,8 +163,8 @@ public:
bool ContainsFileAddress(lldb::addr_t file_addr) const;
//------------------------------------------------------------------
- /// Check if a section offset \a so_addr when represented as a load
- /// address is contained within this object's load address range.
+ /// Check if a section offset \a so_addr when represented as a load address
+ /// is contained within this object's load address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -177,8 +177,8 @@ public:
bool ContainsLoadAddress(const Address &so_addr, Target *target) const;
//------------------------------------------------------------------
- /// Check if the resolved load address \a load_addr is contained
- /// within this object's load address range.
+ /// Check if the resolved load address \a load_addr is contained within this
+ /// object's load address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -193,10 +193,10 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s. There are many ways to display a section
- /// offset based address range, and \a style lets the user choose
- /// how the base address gets displayed.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s. There are many ways to display a section offset based address
+ /// range, and \a style lets the user choose how the base address gets
+ /// displayed.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -219,11 +219,11 @@ public:
//------------------------------------------------------------------
/// Dump a debug description of this object to a Stream.
///
- /// Dump a debug description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a debug description of the contents of this object to the supplied
+ /// stream \a s.
///
- /// The debug description contains verbose internal state such
- /// and pointer values, reference counts, etc.
+ /// The debug description contains verbose internal state such and pointer
+ /// values, reference counts, etc.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -261,8 +261,8 @@ public:
/// The number of bytes that this object occupies in memory.
//------------------------------------------------------------------
size_t MemorySize() const {
- // Noting special for the memory size of a single AddressRange object,
- // it is just the size of itself.
+ // Noting special for the memory size of a single AddressRange object, it
+ // is just the size of itself.
return sizeof(AddressRange);
}
diff --git a/include/lldb/Core/AddressResolver.h b/include/lldb/Core/AddressResolver.h
index 432268e497b4..cfd103e0be01 100644
--- a/include/lldb/Core/AddressResolver.h
+++ b/include/lldb/Core/AddressResolver.h
@@ -27,18 +27,16 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
-/// @brief This class works with SearchFilter to resolve function names and
-/// source file locations to their concrete addresses.
+/// This class works with SearchFilter to resolve function names and source
+/// file locations to their concrete addresses.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
-/// The AddressResolver is a Searcher. In that protocol,
-/// the SearchFilter asks the question "At what depth of the symbol context
-/// descent do you want your callback to get called?" of the filter. The
-/// resolver
-/// answers this question (in the GetDepth method) and provides the resolution
-/// callback.
+/// The AddressResolver is a Searcher. In that protocol, the SearchFilter
+/// asks the question "At what depth of the symbol context descent do you want
+/// your callback to get called?" of the filter. The resolver answers this
+/// question (in the GetDepth method) and provides the resolution callback.
//----------------------------------------------------------------------
class AddressResolver : public Searcher {
diff --git a/include/lldb/Core/AddressResolverFileLine.h b/include/lldb/Core/AddressResolverFileLine.h
index ec15cc76d887..e434a62e0319 100644
--- a/include/lldb/Core/AddressResolverFileLine.h
+++ b/include/lldb/Core/AddressResolverFileLine.h
@@ -31,10 +31,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressResolverFileLine AddressResolverFileLine.h
-/// "lldb/Core/AddressResolverFileLine.h"
-/// @brief This class finds address for source file and line. Optionally, it
-/// will look for inlined
-/// instances of the file and line specification.
+/// "lldb/Core/AddressResolverFileLine.h" This class finds address for source
+/// file and line. Optionally, it will look for inlined instances of the file
+/// and line specification.
//----------------------------------------------------------------------
class AddressResolverFileLine : public AddressResolver {
diff --git a/include/lldb/Core/AddressResolverName.h b/include/lldb/Core/AddressResolverName.h
index aadc05495999..49a805f2115a 100644
--- a/include/lldb/Core/AddressResolverName.h
+++ b/include/lldb/Core/AddressResolverName.h
@@ -30,10 +30,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressResolverName AddressResolverName.h
-/// "lldb/Core/AddressResolverName.h"
-/// @brief This class finds addresses for a given function name, either by exact
-/// match
-/// or by regular expression.
+/// "lldb/Core/AddressResolverName.h" This class finds addresses for a given
+/// function name, either by exact match or by regular expression.
//----------------------------------------------------------------------
class AddressResolverName : public AddressResolver {
@@ -41,8 +39,8 @@ public:
AddressResolverName(const char *func_name,
AddressResolver::MatchType type = Exact);
- // Creates a function breakpoint by regular expression. Takes over control of
- // the lifespan of func_regex.
+ // Creates a function breakpoint by regular expression. Takes over control
+ // of the lifespan of func_regex.
AddressResolverName(RegularExpression &func_regex);
AddressResolverName(const char *class_name, const char *method,
diff --git a/include/lldb/Core/Architecture.h b/include/lldb/Core/Architecture.h
index af774ecdaf9c..3a5a9789223d 100644
--- a/include/lldb/Core/Architecture.h
+++ b/include/lldb/Core/Architecture.h
@@ -31,7 +31,41 @@ public:
/// stopped at the current PC. The code is generic and applies to all
/// ARM CPUs.
//------------------------------------------------------------------
- virtual void OverrideStopInfo(Thread &thread) = 0;
+ virtual void OverrideStopInfo(Thread &thread) const = 0;
+
+ //------------------------------------------------------------------
+ /// This method is used to get the number of bytes that should be
+ /// skipped, from function start address, to reach the first
+ /// instruction after the prologue. If overrode, it must return
+ /// non-zero only if the current address matches one of the known
+ /// function entry points.
+ ///
+ /// This method is called only if the standard platform-independent
+ /// code fails to get the number of bytes to skip, giving the plugin
+ /// a chance to try to find the missing info.
+ ///
+ /// This is specifically used for PPC64, where functions may have
+ /// more than one entry point, global and local, so both should
+ /// be compared with current address, in order to find out the
+ /// number of bytes that should be skipped, in case we are stopped
+ /// at either function entry point.
+ //------------------------------------------------------------------
+ virtual size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const {
+ return 0;
+ }
+
+ //------------------------------------------------------------------
+ /// Adjust function breakpoint address, if needed. In some cases,
+ /// the function start address is not the right place to set the
+ /// breakpoint, specially in functions with multiple entry points.
+ ///
+ /// This is specifically used for PPC64, for functions that have
+ /// both a global and a local entry point. In this case, the
+ /// breakpoint is adjusted to the first function address reached
+ /// by both entry points.
+ //------------------------------------------------------------------
+ virtual void AdjustBreakpointAddress(const Symbol &func,
+ Address &addr) const {}
private:
Architecture(const Architecture &) = delete;
diff --git a/include/lldb/Core/Broadcaster.h b/include/lldb/Core/Broadcaster.h
index 825287db5984..4851007c9a2a 100644
--- a/include/lldb/Core/Broadcaster.h
+++ b/include/lldb/Core/Broadcaster.h
@@ -59,10 +59,9 @@ public:
uint32_t GetEventBits() const { return m_event_bits; }
- // Tell whether this BroadcastEventSpec is contained in in_spec.
- // That is:
- // (a) the two spec's share the same broadcaster class
- // (b) the event bits of this spec are wholly contained in those of in_spec.
+ // Tell whether this BroadcastEventSpec is contained in in_spec. That is: (a)
+ // the two spec's share the same broadcaster class (b) the event bits of this
+ // spec are wholly contained in those of in_spec.
bool IsContainedIn(BroadcastEventSpec in_spec) const {
if (m_broadcaster_class != in_spec.GetBroadcasterClass())
return false;
@@ -224,21 +223,21 @@ private:
};
//----------------------------------------------------------------------
-/// @class Broadcaster Broadcaster.h "lldb/Core/Broadcaster.h"
-/// @brief An event broadcasting class.
+/// @class Broadcaster Broadcaster.h "lldb/Core/Broadcaster.h" An event
+/// broadcasting class.
///
-/// The Broadcaster class is designed to be subclassed by objects that
-/// wish to vend events in a multi-threaded environment. Broadcaster
-/// objects can each vend 32 events. Each event is represented by a bit
-/// in a 32 bit value and these bits can be set:
+/// The Broadcaster class is designed to be subclassed by objects that wish to
+/// vend events in a multi-threaded environment. Broadcaster objects can each
+/// vend 32 events. Each event is represented by a bit in a 32 bit value and
+/// these bits can be set:
/// @see Broadcaster::SetEventBits(uint32_t)
/// or cleared:
/// @see Broadcaster::ResetEventBits(uint32_t)
-/// When an event gets set the Broadcaster object will notify the
-/// Listener object that is listening for the event (if there is one).
+/// When an event gets set the Broadcaster object will notify the Listener
+/// object that is listening for the event (if there is one).
///
-/// Subclasses should provide broadcast bit definitions for any events
-/// they vend, typically using an enumeration:
+/// Subclasses should provide broadcast bit definitions for any events they
+/// vend, typically using an enumeration:
/// \code
/// class Foo : public Broadcaster
/// {
@@ -324,12 +323,11 @@ public:
//------------------------------------------------------------------
/// Listen for any events specified by \a event_mask.
///
- /// Only one listener can listen to each event bit in a given
- /// Broadcaster. Once a listener has acquired an event bit, no
- /// other broadcaster will have access to it until it is
- /// relinquished by the first listener that gets it. The actual
- /// event bits that get acquired by \a listener may be different
- /// from what is requested in \a event_mask, and to track this the
+ /// Only one listener can listen to each event bit in a given Broadcaster.
+ /// Once a listener has acquired an event bit, no other broadcaster will
+ /// have access to it until it is relinquished by the first listener that
+ /// gets it. The actual event bits that get acquired by \a listener may be
+ /// different from what is requested in \a event_mask, and to track this the
/// actual event bits that are acquired get returned.
///
/// @param[in] listener
@@ -349,8 +347,7 @@ public:
}
//------------------------------------------------------------------
- /// Get the NULL terminated C string name of this Broadcaster
- /// object.
+ /// Get the NULL terminated C string name of this Broadcaster object.
///
/// @return
/// The NULL terminated C string name of this Broadcaster.
@@ -395,10 +392,10 @@ public:
}
//------------------------------------------------------------------
- /// Removes a Listener from this broadcasters list and frees the
- /// event bits specified by \a event_mask that were previously
- /// acquired by \a listener (assuming \a listener was listening to
- /// this object) for other listener objects to use.
+ /// Removes a Listener from this broadcasters list and frees the event bits
+ /// specified by \a event_mask that were previously acquired by \a listener
+ /// (assuming \a listener was listening to this object) for other listener
+ /// objects to use.
///
/// @param[in] listener
/// A Listener object that previously called AddListener.
@@ -420,10 +417,9 @@ public:
//------------------------------------------------------------------
/// Provides a simple mechanism to temporarily redirect events from
/// broadcaster. When you call this function passing in a listener and
- /// event type mask, all events from the broadcaster matching the mask
- /// will now go to the hijacking listener.
- /// Only one hijack can occur at a time. If we need more than this we
- /// will have to implement a Listener stack.
+ /// event type mask, all events from the broadcaster matching the mask will
+ /// now go to the hijacking listener. Only one hijack can occur at a time.
+ /// If we need more than this we will have to implement a Listener stack.
///
/// @param[in] listener
/// A Listener object. You do not need to call StartListeningForEvents
@@ -454,8 +450,7 @@ public:
void RestoreBroadcaster() { m_broadcaster_sp->RestoreBroadcaster(); }
// This needs to be filled in if you are going to register the broadcaster
- // with the broadcaster
- // manager and do broadcaster class matching.
+ // with the broadcaster manager and do broadcaster class matching.
// FIXME: Probably should make a ManagedBroadcaster subclass with all the bits
// needed to work
// with the BroadcasterManager, so that it is clearer how to add one.
@@ -465,21 +460,17 @@ public:
protected:
// BroadcasterImpl contains the actual Broadcaster implementation. The
- // Broadcaster makes a BroadcasterImpl
- // which lives as long as it does. The Listeners & the Events hold a weak
- // pointer to the BroadcasterImpl,
- // so that they can survive if a Broadcaster they were listening to is
- // destroyed w/o their being able to
- // unregister from it (which can happen if the Broadcasters & Listeners are
- // being destroyed on separate threads
- // simultaneously.
- // The Broadcaster itself can't be shared out as a weak pointer, because some
- // things that are broadcasters
- // (e.g. the Target and the Process) are shared in their own right.
+ // Broadcaster makes a BroadcasterImpl which lives as long as it does. The
+ // Listeners & the Events hold a weak pointer to the BroadcasterImpl, so that
+ // they can survive if a Broadcaster they were listening to is destroyed w/o
+ // their being able to unregister from it (which can happen if the
+ // Broadcasters & Listeners are being destroyed on separate threads
+ // simultaneously. The Broadcaster itself can't be shared out as a weak
+ // pointer, because some things that are broadcasters (e.g. the Target and
+ // the Process) are shared in their own right.
//
// For the most part, the Broadcaster functions dispatch to the
- // BroadcasterImpl, and are documented in the
- // public Broadcaster API above.
+ // BroadcasterImpl, and are documented in the public Broadcaster API above.
class BroadcasterImpl {
friend class Listener;
@@ -557,7 +548,7 @@ protected:
llvm::SmallVector<std::pair<lldb::ListenerSP, uint32_t &>, 4>
GetListeners();
- Broadcaster &m_broadcaster; ///< The broadcsater that this implements
+ Broadcaster &m_broadcaster; ///< The broadcaster that this implements
event_names_map m_event_names; ///< Optionally define event names for
///readability and logging for each event bit
collection m_listeners; ///< A list of Listener / event_mask pairs that are
diff --git a/include/lldb/Core/Communication.h b/include/lldb/Core/Communication.h
index 57fa483bd3a3..3e29307039e4 100644
--- a/include/lldb/Core/Communication.h
+++ b/include/lldb/Core/Communication.h
@@ -39,60 +39,57 @@ class Status;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Communication Communication.h "lldb/Core/Communication.h"
-/// @brief An abstract communications class.
+/// @class Communication Communication.h "lldb/Core/Communication.h" An
+/// abstract communications class.
///
-/// Communication is an class that handles data communication
-/// between two data sources. It uses a Connection class to do the
-/// real communication. This approach has a couple of advantages: it
-/// allows a single instance of this class to be used even though its
-/// connection can change. Connections could negotiate for different
-/// connections based on abilities like starting with Bluetooth and
-/// negotiating up to WiFi if available. It also allows this class to be
-/// subclassed by any interfaces that don't want to give bytes but want
-/// to validate and give out packets. This can be done by overriding:
+/// Communication is an class that handles data communication between two data
+/// sources. It uses a Connection class to do the real communication. This
+/// approach has a couple of advantages: it allows a single instance of this
+/// class to be used even though its connection can change. Connections could
+/// negotiate for different connections based on abilities like starting with
+/// Bluetooth and negotiating up to WiFi if available. It also allows this
+/// class to be subclassed by any interfaces that don't want to give bytes but
+/// want to validate and give out packets. This can be done by overriding:
///
/// AppendBytesToCache (const uint8_t *src, size_t src_len, bool broadcast);
///
-/// Communication inherits from Broadcaster which means it can be
-/// used in conjunction with Listener to wait for multiple broadcaster
-/// objects and multiple events from each of those objects.
-/// Communication defines a set of pre-defined event bits (see
-/// enumerations definitions that start with "eBroadcastBit" below).
+/// Communication inherits from Broadcaster which means it can be used in
+/// conjunction with Listener to wait for multiple broadcaster objects and
+/// multiple events from each of those objects. Communication defines a set of
+/// pre-defined event bits (see enumerations definitions that start with
+/// "eBroadcastBit" below).
///
/// There are two modes in which communications can occur:
/// @li single-threaded
/// @li multi-threaded
///
-/// In single-threaded mode, all reads and writes happen synchronously
-/// on the calling thread.
+/// In single-threaded mode, all reads and writes happen synchronously on the
+/// calling thread.
///
-/// In multi-threaded mode, a read thread is spawned that continually
-/// reads data and caches any received bytes. To start the read thread
-/// clients call:
+/// In multi-threaded mode, a read thread is spawned that continually reads
+/// data and caches any received bytes. To start the read thread clients call:
///
/// bool Communication::StartReadThread (Status *);
///
-/// If true is returned a read thread has been spawned that will
-/// continually execute a call to the pure virtual DoRead function:
+/// If true is returned a read thread has been spawned that will continually
+/// execute a call to the pure virtual DoRead function:
///
/// size_t Communication::ReadFromConnection (void *, size_t, uint32_t);
///
-/// When bytes are received the data gets cached in \a m_bytes and this
-/// class will broadcast a \b eBroadcastBitReadThreadGotBytes event.
-/// Clients that want packet based communication should override
-/// AppendBytesToCache. The subclasses can choose to call the
-/// built in AppendBytesToCache with the \a broadcast parameter set to
-/// false. This will cause the \b eBroadcastBitReadThreadGotBytes event
-/// not get broadcast, and then the subclass can post a \b
-/// eBroadcastBitPacketAvailable event when a full packet of data has
-/// been received.
+/// When bytes are received the data gets cached in \a m_bytes and this class
+/// will broadcast a \b eBroadcastBitReadThreadGotBytes event. Clients that
+/// want packet based communication should override AppendBytesToCache. The
+/// subclasses can choose to call the built in AppendBytesToCache with the \a
+/// broadcast parameter set to false. This will cause the \b
+/// eBroadcastBitReadThreadGotBytes event not get broadcast, and then the
+/// subclass can post a \b eBroadcastBitPacketAvailable event when a full
+/// packet of data has been received.
///
-/// If the connection is disconnected a \b eBroadcastBitDisconnected
-/// event gets broadcast. If the read thread exits a \b
-/// eBroadcastBitReadThreadDidExit event will be broadcast. Clients
-/// can also post a \b eBroadcastBitReadThreadShouldExit event to this
-/// object which will cause the read thread to exit.
+/// If the connection is disconnected a \b eBroadcastBitDisconnected event
+/// gets broadcast. If the read thread exits a \b
+/// eBroadcastBitReadThreadDidExit event will be broadcast. Clients can also
+/// post a \b eBroadcastBitReadThreadShouldExit event to this object which
+/// will cause the read thread to exit.
//----------------------------------------------------------------------
class Communication : public Broadcaster {
public:
@@ -120,8 +117,8 @@ public:
size_t src_len);
//------------------------------------------------------------------
- /// Construct the Communication object with the specified name for
- /// the Broadcaster that this object inherits from.
+ /// Construct the Communication object with the specified name for the
+ /// Broadcaster that this object inherits from.
///
/// @param[in] broadcaster_name
/// The name of the broadcaster object. This name should be as
@@ -141,9 +138,8 @@ public:
void Clear();
//------------------------------------------------------------------
- /// Connect using the current connection by passing \a url to its
- /// connect function.
- /// string.
+ /// Connect using the current connection by passing \a url to its connect
+ /// function. string.
///
/// @param[in] url
/// A string that contains all information needed by the
@@ -160,8 +156,7 @@ public:
lldb::ConnectionStatus Connect(const char *url, Status *error_ptr);
//------------------------------------------------------------------
- /// Disconnect the communications connection if one is currently
- /// connected.
+ /// Disconnect the communications connection if one is currently connected.
///
/// @return
/// \b True if the disconnect succeeded, \b false otherwise. The
@@ -189,16 +184,15 @@ public:
//------------------------------------------------------------------
/// Read bytes from the current connection.
///
- /// If no read thread is running, this function call the
- /// connection's Connection::Read(...) function to get any available.
+ /// If no read thread is running, this function call the connection's
+ /// Connection::Read(...) function to get any available.
///
- /// If a read thread has been started, this function will check for
- /// any cached bytes that have already been read and return any
- /// currently available bytes. If no bytes are cached, it will wait
- /// for the bytes to become available by listening for the \a
- /// eBroadcastBitReadThreadGotBytes event. If this function consumes
- /// all of the bytes in the cache, it will reset the
- /// \a eBroadcastBitReadThreadGotBytes event bit.
+ /// If a read thread has been started, this function will check for any
+ /// cached bytes that have already been read and return any currently
+ /// available bytes. If no bytes are cached, it will wait for the bytes to
+ /// become available by listening for the \a eBroadcastBitReadThreadGotBytes
+ /// event. If this function consumes all of the bytes in the cache, it will
+ /// reset the \a eBroadcastBitReadThreadGotBytes event bit.
///
/// @param[in] dst
/// A destination buffer that must be at least \a dst_len bytes
@@ -220,8 +214,8 @@ public:
lldb::ConnectionStatus &status, Status *error_ptr);
//------------------------------------------------------------------
- /// The actual write function that attempts to write to the
- /// communications protocol.
+ /// The actual write function that attempts to write to the communications
+ /// protocol.
///
/// Subclasses must override this function.
///
@@ -242,11 +236,10 @@ public:
//------------------------------------------------------------------
/// Sets the connection that it to be used by this class.
///
- /// By making a communication class that uses different connections
- /// it allows a single communication interface to negotiate and
- /// change its connection without any interruption to the client.
- /// It also allows the Communication class to be subclassed for
- /// packet based communication.
+ /// By making a communication class that uses different connections it
+ /// allows a single communication interface to negotiate and change its
+ /// connection without any interruption to the client. It also allows the
+ /// Communication class to be subclassed for packet based communication.
///
/// @param[in] connection
/// A connection that this class will own and destroy.
@@ -257,19 +250,19 @@ public:
void SetConnection(Connection *connection);
//------------------------------------------------------------------
- /// Starts a read thread whose sole purpose it to read bytes from
- /// the current connection. This function will call connection's
- /// read function:
+ /// Starts a read thread whose sole purpose it to read bytes from the
+ /// current connection. This function will call connection's read function:
///
/// size_t Connection::Read (void *, size_t);
///
/// When bytes are read and cached, this function will call:
///
- /// Communication::AppendBytesToCache (const uint8_t * bytes, size_t len, bool
+ /// Communication::AppendBytesToCache (const uint8_t * bytes, size_t len,
+ /// bool
/// broadcast);
///
- /// Subclasses should override this function if they wish to override
- /// the default action of caching the bytes and broadcasting a \b
+ /// Subclasses should override this function if they wish to override the
+ /// default action of caching the bytes and broadcasting a \b
/// eBroadcastBitReadThreadGotBytes event.
///
/// @return
@@ -277,8 +270,8 @@ public:
/// false otherwise.
///
/// @see size_t Connection::Read (void *, size_t);
- /// @see void Communication::AppendBytesToCache (const uint8_t * bytes, size_t
- /// len, bool broadcast);
+ /// @see void Communication::AppendBytesToCache (const uint8_t * bytes,
+ /// size_t len, bool broadcast);
//------------------------------------------------------------------
virtual bool StartReadThread(Status *error_ptr = nullptr);
@@ -301,11 +294,10 @@ public:
bool ReadThreadIsRunning();
//------------------------------------------------------------------
- /// The static read thread function. This function will call
- /// the "DoRead" function continuously and wait for data to become
- /// available. When data is received it will append the available
- /// data to the internal cache and broadcast a
- /// \b eBroadcastBitReadThreadGotBytes event.
+ /// The static read thread function. This function will call the "DoRead"
+ /// function continuously and wait for data to become available. When data
+ /// is received it will append the available data to the internal cache and
+ /// broadcast a \b eBroadcastBitReadThreadGotBytes event.
///
/// @param[in] comm_ptr
/// A pointer to an instance of this class.
@@ -364,18 +356,17 @@ protected:
lldb::ConnectionStatus &status, Status *error_ptr);
//------------------------------------------------------------------
- /// Append new bytes that get read from the read thread into the
- /// internal object byte cache. This will cause a \b
- /// eBroadcastBitReadThreadGotBytes event to be broadcast if \a
- /// broadcast is true.
+ /// Append new bytes that get read from the read thread into the internal
+ /// object byte cache. This will cause a \b eBroadcastBitReadThreadGotBytes
+ /// event to be broadcast if \a broadcast is true.
///
- /// Subclasses can override this function in order to inspect the
- /// received data and check if a packet is available.
+ /// Subclasses can override this function in order to inspect the received
+ /// data and check if a packet is available.
///
- /// Subclasses can also still call this function from the
- /// overridden method to allow the caching to correctly happen and
- /// suppress the broadcasting of the \a eBroadcastBitReadThreadGotBytes
- /// event by setting \a broadcast to false.
+ /// Subclasses can also still call this function from the overridden method
+ /// to allow the caching to correctly happen and suppress the broadcasting
+ /// of the \a eBroadcastBitReadThreadGotBytes event by setting \a broadcast
+ /// to false.
///
/// @param[in] src
/// A source buffer that must be at least \a src_len bytes
@@ -389,9 +380,9 @@ protected:
lldb::ConnectionStatus status);
//------------------------------------------------------------------
- /// Get any available bytes from our data cache. If this call
- /// empties the data cache, the \b eBroadcastBitReadThreadGotBytes event
- /// will be reset to signify no more bytes are available.
+ /// Get any available bytes from our data cache. If this call empties the
+ /// data cache, the \b eBroadcastBitReadThreadGotBytes event will be reset
+ /// to signify no more bytes are available.
///
/// @param[in] dst
/// A destination buffer that must be at least \a dst_len bytes
diff --git a/include/lldb/Core/Debugger.h b/include/lldb/Core/Debugger.h
index 34d35ffe7c80..cc7176e5c95d 100644
--- a/include/lldb/Core/Debugger.h
+++ b/include/lldb/Core/Debugger.h
@@ -76,7 +76,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Debugger Debugger.h "lldb/Core/Debugger.h"
-/// @brief A class to manage flag bits.
+/// A class to manage flag bits.
///
/// Provides a global root objects for the debugger core.
//----------------------------------------------------------------------
@@ -156,11 +156,9 @@ public:
lldb::ListenerSP GetListener() { return m_listener_sp; }
// This returns the Debugger's scratch source manager. It won't be able to
- // look up files in debug
- // information, but it can look up files by absolute path and display them to
- // you.
- // To get the target's source manager, call GetSourceManager on the target
- // instead.
+ // look up files in debug information, but it can look up files by absolute
+ // path and display them to you. To get the target's source manager, call
+ // GetSourceManager on the target instead.
SourceManager &GetSourceManager();
lldb::TargetSP GetSelectedTarget() {
@@ -171,10 +169,9 @@ public:
//------------------------------------------------------------------
/// Get accessor for the target list.
///
- /// The target list is part of the global debugger object. This
- /// the single debugger shared instance to control where targets
- /// get created and to allow for tracking and searching for targets
- /// based on certain criteria.
+ /// The target list is part of the global debugger object. This the single
+ /// debugger shared instance to control where targets get created and to
+ /// allow for tracking and searching for targets based on certain criteria.
///
/// @return
/// A global shared target list.
@@ -188,9 +185,8 @@ public:
void DispatchInputEndOfFile();
//------------------------------------------------------------------
- // If any of the streams are not set, set them to the in/out/err
- // stream of the top most input reader to ensure they at least have
- // something
+ // If any of the streams are not set, set them to the in/out/err stream of
+ // the top most input reader to ensure they at least have something
//------------------------------------------------------------------
void AdoptTopIOHandlerFilesIfInvalid(lldb::StreamFileSP &in,
lldb::StreamFileSP &out,
@@ -323,9 +319,8 @@ public:
Status RunREPL(lldb::LanguageType language, const char *repl_options);
// This is for use in the command interpreter, when you either want the
- // selected target, or if no target
- // is present you want to prime the dummy target with entities that will be
- // copied over to new targets.
+ // selected target, or if no target is present you want to prime the dummy
+ // target with entities that will be copied over to new targets.
Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
Target *GetDummyTarget();
@@ -378,8 +373,8 @@ protected:
lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a
// broadcaster manager of
// last resort.
- // It needs to get constructed before the target_list or any other
- // member that might want to broadcast through the debugger.
+ // It needs to get constructed before the target_list or any other member
+ // that might want to broadcast through the debugger.
TerminalState m_terminal_state;
TargetList m_target_list;
@@ -418,8 +413,8 @@ protected:
};
private:
- // Use Debugger::CreateInstance() to get a shared pointer to a new
- // debugger object
+ // Use Debugger::CreateInstance() to get a shared pointer to a new debugger
+ // object
Debugger(lldb::LogOutputCallback m_log_callback, void *baton);
DISALLOW_COPY_AND_ASSIGN(Debugger);
diff --git a/include/lldb/Core/Disassembler.h b/include/lldb/Core/Disassembler.h
index fa5e6a636aaf..ef1f2ee54dd1 100644
--- a/include/lldb/Core/Disassembler.h
+++ b/include/lldb/Core/Disassembler.h
@@ -22,8 +22,8 @@
#include "lldb/Utility/ConstString.h" // for ConstString
#include "lldb/Utility/FileSpec.h"
#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
-#include "lldb/lldb-enumerations.h" // for AddressClass, AddressClass...
#include "lldb/lldb-forward.h" // for InstructionSP, DisassemblerSP
+#include "lldb/lldb-private-enumerations.h" // for AddressClass
#include "lldb/lldb-types.h" // for addr_t, offset_t
#include "llvm/ADT/StringRef.h" // for StringRef
@@ -78,7 +78,7 @@ namespace lldb_private {
class Instruction {
public:
Instruction(const Address &address,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid);
+ AddressClass addr_class = AddressClass::eInvalid);
virtual ~Instruction();
@@ -102,12 +102,11 @@ public:
virtual void
CalculateMnemonicOperandsAndComment(const ExecutionContext *exe_ctx) = 0;
- lldb::AddressClass GetAddressClass();
+ AddressClass GetAddressClass();
void SetAddress(const Address &addr) {
- // Invalidate the address class to lazily discover
- // it if we need to.
- m_address_class = lldb::eAddressClassInvalid;
+ // Invalidate the address class to lazily discover it if we need to.
+ m_address_class = AddressClass::eInvalid;
m_address = addr;
}
@@ -235,14 +234,15 @@ public:
protected:
Address m_address; // The section offset address of this instruction
// We include an address class in the Instruction class to
- // allow the instruction specify the eAddressClassCodeAlternateISA
- // (currently used for thumb), and also to specify data (eAddressClassData).
- // The usual value will be eAddressClassCode, but often when
- // disassembling memory, you might run into data. This can
- // help us to disassemble appropriately.
+ // allow the instruction specify the
+ // AddressClass::eCodeAlternateISA (currently used for
+ // thumb), and also to specify data (AddressClass::eData).
+ // The usual value will be AddressClass::eCode, but often
+ // when disassembling memory, you might run into data.
+ // This can help us to disassemble appropriately.
private:
- lldb::AddressClass
- m_address_class; // Use GetAddressClass () accessor function!
+ AddressClass m_address_class; // Use GetAddressClass () accessor function!
+
protected:
Opcode m_opcode; // The opcode for this instruction
std::string m_opcode_name;
@@ -365,12 +365,10 @@ public:
};
// FindPlugin should be lax about the flavor string (it is too annoying to
- // have various internal uses of the
- // disassembler fail because the global flavor string gets set wrong.
- // Instead, if you get a flavor string you
+ // have various internal uses of the disassembler fail because the global
+ // flavor string gets set wrong. Instead, if you get a flavor string you
// don't understand, use the default. Folks who care to check can use the
- // FlavorValidForArchSpec method on the
- // disassembler they got back.
+ // FlavorValidForArchSpec method on the disassembler they got back.
static lldb::DisassemblerSP
FindPlugin(const ArchSpec &arch, const char *flavor, const char *plugin_name);
@@ -470,8 +468,8 @@ public:
const char *flavor) = 0;
protected:
- // SourceLine and SourceLinesToDisplay structures are only used in
- // the mixed source and assembly display methods internal to this class.
+ // SourceLine and SourceLinesToDisplay structures are only used in the mixed
+ // source and assembly display methods internal to this class.
struct SourceLine {
FileSpec file;
@@ -494,9 +492,9 @@ protected:
struct SourceLinesToDisplay {
std::vector<SourceLine> lines;
- // index of the "current" source line, if we want to highlight that
- // when displaying the source lines. (as opposed to the surrounding
- // source lines provided to give context)
+ // index of the "current" source line, if we want to highlight that when
+ // displaying the source lines. (as opposed to the surrounding source
+ // lines provided to give context)
size_t current_source_line;
// Whether to print a blank line at the end of the source lines.
@@ -507,8 +505,8 @@ protected:
}
};
- // Get the function's declaration line number, hopefully a line number earlier
- // than the opening curly brace at the start of the function body.
+ // Get the function's declaration line number, hopefully a line number
+ // earlier than the opening curly brace at the start of the function body.
static SourceLine GetFunctionDeclLineEntry(const SymbolContext &sc);
// Add the provided SourceLine to the map of filenames-to-source-lines-seen.
@@ -517,14 +515,13 @@ protected:
std::map<FileSpec, std::set<uint32_t>> &source_lines_seen);
// Given a source line, determine if we should print it when we're doing
- // mixed source & assembly output.
- // We're currently using the target.process.thread.step-avoid-regexp setting
- // (which is used for stepping over inlined STL functions by default) to
- // determine what source lines to avoid showing.
+ // mixed source & assembly output. We're currently using the
+ // target.process.thread.step-avoid-regexp setting (which is used for
+ // stepping over inlined STL functions by default) to determine what source
+ // lines to avoid showing.
//
// Returns true if this source line should be elided (if the source line
- // should
- // not be displayed).
+ // should not be displayed).
static bool
ElideMixedSourceAndDisassemblyLine(const ExecutionContext &exe_ctx,
const SymbolContext &sc, SourceLine &line);
diff --git a/include/lldb/Core/DumpRegisterValue.h b/include/lldb/Core/DumpRegisterValue.h
new file mode 100644
index 000000000000..bc4860fbc0e5
--- /dev/null
+++ b/include/lldb/Core/DumpRegisterValue.h
@@ -0,0 +1,31 @@
+//===-- DumpRegisterValue.h -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_CORE_DUMPREGISTERVALUE_H
+#define LLDB_CORE_DUMPREGISTERVALUE_H
+
+#include "lldb/lldb-enumerations.h"
+#include <cstdint>
+
+namespace lldb_private {
+
+class RegisterValue;
+struct RegisterInfo;
+class Stream;
+
+// The default value of 0 for reg_name_right_align_at means no alignment at
+// all.
+bool DumpRegisterValue(const RegisterValue &reg_val, Stream *s,
+ const RegisterInfo *reg_info, bool prefix_with_name,
+ bool prefix_with_alt_name, lldb::Format format,
+ uint32_t reg_name_right_align_at = 0);
+
+} // namespace lldb_private
+
+#endif // LLDB_CORE_DUMPREGISTERVALUE_H
diff --git a/include/lldb/Core/EmulateInstruction.h b/include/lldb/Core/EmulateInstruction.h
index b0a4267a00a2..5d23bcd7b96e 100644
--- a/include/lldb/Core/EmulateInstruction.h
+++ b/include/lldb/Core/EmulateInstruction.h
@@ -48,62 +48,61 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class EmulateInstruction EmulateInstruction.h
/// "lldb/Core/EmulateInstruction.h"
-/// @brief A class that allows emulation of CPU opcodes.
+/// A class that allows emulation of CPU opcodes.
///
-/// This class is a plug-in interface that is accessed through the
-/// standard static FindPlugin function call in the EmulateInstruction
-/// class. The FindPlugin takes a target triple and returns a new object
-/// if there is a plug-in that supports the architecture and OS. Four
-/// callbacks and a baton are provided. The four callbacks are read
-/// register, write register, read memory and write memory.
+/// This class is a plug-in interface that is accessed through the standard
+/// static FindPlugin function call in the EmulateInstruction class. The
+/// FindPlugin takes a target triple and returns a new object if there is a
+/// plug-in that supports the architecture and OS. Four callbacks and a baton
+/// are provided. The four callbacks are read register, write register, read
+/// memory and write memory.
///
-/// This class is currently designed for these main use cases:
-/// - Auto generation of Call Frame Information (CFI) from assembly code
-/// - Predicting single step breakpoint locations
-/// - Emulating instructions for breakpoint traps
+/// This class is currently designed for these main use cases: - Auto
+/// generation of Call Frame Information (CFI) from assembly code - Predicting
+/// single step breakpoint locations - Emulating instructions for breakpoint
+/// traps
///
-/// Objects can be asked to read an instruction which will cause a call
-/// to the read register callback to get the PC, followed by a read
-/// memory call to read the opcode. If ReadInstruction () returns true,
-/// then a call to EmulateInstruction::EvaluateInstruction () can be
-/// made. At this point the EmulateInstruction subclass will use all of
-/// the callbacks to emulate an instruction.
+/// Objects can be asked to read an instruction which will cause a call to the
+/// read register callback to get the PC, followed by a read memory call to
+/// read the opcode. If ReadInstruction () returns true, then a call to
+/// EmulateInstruction::EvaluateInstruction () can be made. At this point the
+/// EmulateInstruction subclass will use all of the callbacks to emulate an
+/// instruction.
///
/// Clients that provide the callbacks can either do the read/write
-/// registers/memory to actually emulate the instruction on a real or
-/// virtual CPU, or watch for the EmulateInstruction::Context which
-/// is context for the read/write register/memory which explains why
-/// the callback is being called. Examples of a context are:
-/// "pushing register 3 onto the stack at offset -12", or "adjusting
-/// stack pointer by -16". This extra context allows the generation of
+/// registers/memory to actually emulate the instruction on a real or virtual
+/// CPU, or watch for the EmulateInstruction::Context which is context for the
+/// read/write register/memory which explains why the callback is being
+/// called. Examples of a context are: "pushing register 3 onto the stack at
+/// offset -12", or "adjusting stack pointer by -16". This extra context
+/// allows the generation of
/// CFI information from assembly code without having to actually do
/// the read/write register/memory.
///
-/// Clients must be prepared that not all instructions for an
-/// Instruction Set Architecture (ISA) will be emulated.
+/// Clients must be prepared that not all instructions for an Instruction Set
+/// Architecture (ISA) will be emulated.
///
-/// Subclasses at the very least should implement the instructions that
-/// save and restore registers onto the stack and adjustment to the stack
-/// pointer. By just implementing a few instructions for an ISA that are
-/// the typical prologue opcodes, you can then generate CFI using a
-/// class that will soon be available.
+/// Subclasses at the very least should implement the instructions that save
+/// and restore registers onto the stack and adjustment to the stack pointer.
+/// By just implementing a few instructions for an ISA that are the typical
+/// prologue opcodes, you can then generate CFI using a class that will soon
+/// be available.
///
-/// Implementing all of the instructions that affect the PC can then
-/// allow single step prediction support.
+/// Implementing all of the instructions that affect the PC can then allow
+/// single step prediction support.
///
-/// Implementing all of the instructions allows for emulation of opcodes
-/// for breakpoint traps and will pave the way for "thread centric"
-/// debugging. The current debugging model is "process centric" where
-/// all threads must be stopped when any thread is stopped; when
-/// hitting software breakpoints we must disable the breakpoint by
-/// restoring the original breakpoint opcode, single stepping and
-/// restoring the breakpoint trap. If all threads were allowed to run
-/// then other threads could miss the breakpoint.
+/// Implementing all of the instructions allows for emulation of opcodes for
+/// breakpoint traps and will pave the way for "thread centric" debugging. The
+/// current debugging model is "process centric" where all threads must be
+/// stopped when any thread is stopped; when hitting software breakpoints we
+/// must disable the breakpoint by restoring the original breakpoint opcode,
+/// single stepping and restoring the breakpoint trap. If all threads were
+/// allowed to run then other threads could miss the breakpoint.
///
-/// This class centralizes the code that usually is done in separate
-/// code paths in a debugger (single step prediction, finding save
-/// restore locations of registers for unwinding stack frame variables)
-/// and emulating the instruction is just a bonus.
+/// This class centralizes the code that usually is done in separate code
+/// paths in a debugger (single step prediction, finding save restore
+/// locations of registers for unwinding stack frame variables) and emulating
+/// the instruction is just a bonus.
//----------------------------------------------------------------------
class EmulateInstruction : public PluginInterface {
@@ -125,8 +124,8 @@ public:
// prologue
eContextPushRegisterOnStack,
- // Exclusively used when restoring a register off the stack as part of
- // the epilogue
+ // Exclusively used when restoring a register off the stack as part of the
+ // epilogue
eContextPopRegisterOffStack,
// Add or subtract a value from the stack
@@ -135,8 +134,8 @@ public:
// Adjust the frame pointer for the current frame
eContextSetFramePointer,
- // Typically in an epilogue sequence. Copy the frame pointer back
- // into the stack pointer, use SP for CFA calculations again.
+ // Typically in an epilogue sequence. Copy the frame pointer back into the
+ // stack pointer, use SP for CFA calculations again.
eContextRestoreStackPointer,
// Add or subtract a value from a base address register (other than SP)
@@ -159,8 +158,8 @@ public:
// Used when performing an absolute branch where the
eContextAbsoluteBranchRegister,
- // Used when performing a supervisor call to an operating system to
- // provide a service:
+ // Used when performing a supervisor call to an operating system to provide
+ // a service:
eContextSupervisorCall,
// Used when performing a MemU operation to read the PC-relative offset
@@ -360,9 +359,8 @@ public:
const RegisterValue &reg_value);
// Type to represent the condition of an instruction. The UINT32 value is
- // reserved for the
- // unconditional case and all other value can be used in an architecture
- // dependent way.
+ // reserved for the unconditional case and all other value can be used in an
+ // architecture dependent way.
typedef uint32_t InstructionCondition;
static const InstructionCondition UnconditionalCondition = UINT32_MAX;
diff --git a/include/lldb/Core/Event.h b/include/lldb/Core/Event.h
index f4c7f4769a37..fa3017057675 100644
--- a/include/lldb/Core/Event.h
+++ b/include/lldb/Core/Event.h
@@ -121,10 +121,8 @@ public:
const ConstString &GetFlavor() const override { return GetFlavorString(); }
- bool WaitForEventReceived(
- const std::chrono::microseconds &abstime = std::chrono::microseconds(0),
- bool *timed_out = nullptr) {
- return m_predicate.WaitForValueEqualTo(true, abstime, timed_out);
+ bool WaitForEventReceived(const Timeout<std::micro> &timeout = llvm::None) {
+ return m_predicate.WaitForValueEqualTo(true, timeout);
}
private:
diff --git a/include/lldb/Core/FileLineResolver.h b/include/lldb/Core/FileLineResolver.h
index 54bce4fd2f41..855d749ed5d4 100644
--- a/include/lldb/Core/FileLineResolver.h
+++ b/include/lldb/Core/FileLineResolver.h
@@ -28,9 +28,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h"
-/// @brief This class finds address for source file and line. Optionally, it
-/// will look for inlined
-/// instances of the file and line specification.
+/// This class finds address for source file and line. Optionally, it will
+/// look for inlined instances of the file and line specification.
//----------------------------------------------------------------------
class FileLineResolver : public Searcher {
diff --git a/include/lldb/Core/FileSpecList.h b/include/lldb/Core/FileSpecList.h
index 3cbffca44f69..713ed2aaffc6 100644
--- a/include/lldb/Core/FileSpecList.h
+++ b/include/lldb/Core/FileSpecList.h
@@ -25,7 +25,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FileSpecList FileSpecList.h "lldb/Core/FileSpecList.h"
-/// @brief A file collection class.
+/// A file collection class.
///
/// A class that contains a mutable list of FileSpec objects.
//----------------------------------------------------------------------
@@ -56,8 +56,7 @@ public:
//------------------------------------------------------------------
/// Assignment operator.
///
- /// Replace the file list in this object with the file list from
- /// \a rhs.
+ /// Replace the file list in this object with the file list from \a rhs.
///
/// @param[in] rhs
/// A file list object to copy.
@@ -80,8 +79,8 @@ public:
//------------------------------------------------------------------
/// Append a FileSpec object if unique.
///
- /// Appends \a file to the end of the file list if it doesn't
- /// already exist in the file list.
+ /// Appends \a file to the end of the file list if it doesn't already exist
+ /// in the file list.
///
/// @param[in] file
/// A new file to append to this file list.
@@ -107,8 +106,8 @@ public:
//------------------------------------------------------------------
/// Find a file index.
///
- /// Find the index of the file in the file spec list that matches
- /// \a file starting \a idx entries into the file spec list.
+ /// Find the index of the file in the file spec list that matches \a file
+ /// starting \a idx entries into the file spec list.
///
/// @param[in] idx
/// An index into the file list.
@@ -119,24 +118,18 @@ public:
/// @param[in] full
/// Should FileSpec::Equal be called with "full" true or false.
///
- /// @param[in] remove_backup_dots
- /// Should FileSpec::Equal be called with "remove_backup_dots" true or
- /// false.
- ///
/// @return
/// The index of the file that matches \a file if it is found,
/// else UINT32_MAX is returned.
//------------------------------------------------------------------
- size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
- bool remove_backup_dots = false) const;
+ size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
//------------------------------------------------------------------
/// Get file at index.
///
- /// Gets a file from the file list. If \a idx is not a valid index,
- /// an empty FileSpec object will be returned. The file objects
- /// that are returned can be tested using
- /// FileSpec::operator void*().
+ /// Gets a file from the file list. If \a idx is not a valid index, an empty
+ /// FileSpec object will be returned. The file objects that are returned can
+ /// be tested using FileSpec::operator void*().
///
/// @param[in] idx
/// An index into the file list.
@@ -151,8 +144,8 @@ public:
//------------------------------------------------------------------
/// Get file specification pointer at index.
///
- /// Gets a file from the file list. The file objects that are
- /// returned can be tested using FileSpec::operator void*().
+ /// Gets a file from the file list. The file objects that are returned can
+ /// be tested using FileSpec::operator void*().
///
/// @param[in] idx
/// An index into the file list.
@@ -166,9 +159,9 @@ public:
//------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Return the size in bytes that this object takes in memory. This
- /// returns the size in bytes of this object, not any shared string
- /// values it may refer to.
+ /// Return the size in bytes that this object takes in memory. This returns
+ /// the size in bytes of this object, not any shared string values it may
+ /// refer to.
///
/// @return
/// The number of bytes that this object occupies in memory.
diff --git a/include/lldb/Core/FormatEntity.h b/include/lldb/Core/FormatEntity.h
index aa5ccb48e56a..93c7b3a94e4e 100644
--- a/include/lldb/Core/FormatEntity.h
+++ b/include/lldb/Core/FormatEntity.h
@@ -10,6 +10,7 @@
#ifndef liblldb_FormatEntity_h_
#define liblldb_FormatEntity_h_
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/FileSpec.h" // for FileSpec
#include "lldb/Utility/Status.h"
#include "lldb/lldb-enumerations.h" // for Format::eFormatDefault, Format
@@ -211,17 +212,15 @@ public:
llvm::StringRef &variable_name,
llvm::StringRef &variable_format);
- static size_t AutoComplete(llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ static size_t AutoComplete(lldb_private::CompletionRequest &request);
//----------------------------------------------------------------------
// Format the current elements into the stream \a s.
//
- // The root element will be stripped off and the format str passed in
- // will be either an empty string (print a description of this object),
- // or contain a . separated series like a domain name that identifies
- // further sub elements to display.
+ // The root element will be stripped off and the format str passed in will be
+ // either an empty string (print a description of this object), or contain a
+ // `.`-separated series like a domain name that identifies further
+ // sub-elements to display.
//----------------------------------------------------------------------
static bool FormatFileSpec(const FileSpec &file, Stream &s,
llvm::StringRef elements,
diff --git a/include/lldb/Core/IOHandler.h b/include/lldb/Core/IOHandler.h
index e8cfbade5c61..2170ad10674e 100644
--- a/include/lldb/Core/IOHandler.h
+++ b/include/lldb/Core/IOHandler.h
@@ -63,14 +63,13 @@ public:
virtual ~IOHandler();
- // Each IOHandler gets to run until it is done. It should read data
- // from the "in" and place output into "out" and "err and return
- // when done.
+ // Each IOHandler gets to run until it is done. It should read data from the
+ // "in" and place output into "out" and "err and return when done.
virtual void Run() = 0;
- // Called when an input reader should relinquish its control so another
- // can be pushed onto the IO handler stack, or so the current IO
- // handler can pop itself off the stack
+ // Called when an input reader should relinquish its control so another can
+ // be pushed onto the IO handler stack, or so the current IO handler can pop
+ // itself off the stack
virtual void Cancel() = 0;
@@ -273,8 +272,8 @@ public:
//------------------------------------------------------------------
virtual bool IOHandlerIsInputComplete(IOHandler &io_handler,
StringList &lines) {
- // Impose no requirements for input to be considered
- // complete. subclasses should do something more intelligent.
+ // Impose no requirements for input to be considered complete. subclasses
+ // should do something more intelligent.
return true;
}
@@ -289,8 +288,8 @@ public:
//------------------------------------------------------------------
// Intercept the IOHandler::Interrupt() calls and do something.
//
- // Return true if the interrupt was handled, false if the IOHandler
- // should continue to try handle the interrupt itself.
+ // Return true if the interrupt was handled, false if the IOHandler should
+ // continue to try handle the interrupt itself.
//------------------------------------------------------------------
virtual bool IOHandlerInterrupt(IOHandler &io_handler) { return false; }
@@ -302,8 +301,7 @@ protected:
// IOHandlerDelegateMultiline
//
// A IOHandlerDelegate that handles terminating multi-line input when
-// the last line is equal to "end_line" which is specified in the
-// constructor.
+// the last line is equal to "end_line" which is specified in the constructor.
//----------------------------------------------------------------------
class IOHandlerDelegateMultiline : public IOHandlerDelegate {
public:
@@ -325,9 +323,8 @@ public:
// Determine whether the end of input signal has been entered
const size_t num_lines = lines.GetSize();
if (num_lines > 0 && lines[num_lines - 1] == m_end_line) {
- // Remove the terminal line from "lines" so it doesn't appear in
- // the resulting input and return true to indicate we are done
- // getting lines
+ // Remove the terminal line from "lines" so it doesn't appear in the
+ // resulting input and return true to indicate we are done getting lines
lines.PopBack();
return true;
}
@@ -454,8 +451,7 @@ protected:
};
// The order of base classes is important. Look at the constructor of
-// IOHandlerConfirm
-// to see how.
+// IOHandlerConfirm to see how.
class IOHandlerConfirm : public IOHandlerDelegate, public IOHandlerEditline {
public:
IOHandlerConfirm(Debugger &debugger, llvm::StringRef prompt,
diff --git a/include/lldb/Core/LoadedModuleInfoList.h b/include/lldb/Core/LoadedModuleInfoList.h
index ecbe3548d687..6554c64fa870 100644
--- a/include/lldb/Core/LoadedModuleInfoList.h
+++ b/include/lldb/Core/LoadedModuleInfoList.h
@@ -13,10 +13,14 @@
// C Includes
// C++ Includes
+#include <cassert>
+#include <string>
#include <vector>
// Other libraries and framework includes
+#include "lldb/lldb-defines.h"
#include "lldb/lldb-private-forward.h"
+#include "lldb/lldb-types.h"
namespace lldb_private {
class LoadedModuleInfoList {
diff --git a/include/lldb/Core/Mangled.h b/include/lldb/Core/Mangled.h
index 22778fabe63d..d263297ecfc6 100644
--- a/include/lldb/Core/Mangled.h
+++ b/include/lldb/Core/Mangled.h
@@ -28,15 +28,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Mangled Mangled.h "lldb/Core/Mangled.h"
-/// @brief A class that handles mangled names.
+/// A class that handles mangled names.
///
-/// Designed to handle mangled names. The demangled version of any names
-/// will be computed when the demangled name is accessed through the
-/// Demangled() acccessor. This class can also tokenize the demangled
-/// version of the name for powerful searches. Functions and symbols
-/// could make instances of this class for their mangled names. Uniqued
-/// string pools are used for the mangled, demangled, and token string
-/// values to allow for faster comparisons and for efficient memory use.
+/// Designed to handle mangled names. The demangled version of any names will
+/// be computed when the demangled name is accessed through the Demangled()
+/// acccessor. This class can also tokenize the demangled version of the name
+/// for powerful searches. Functions and symbols could make instances of this
+/// class for their mangled names. Uniqued string pools are used for the
+/// mangled, demangled, and token string values to allow for faster
+/// comparisons and for efficient memory use.
//----------------------------------------------------------------------
class Mangled {
public:
@@ -91,16 +91,16 @@ public:
//----------------------------------------------------------------------
/// Destructor
///
- /// Releases its ref counts on the mangled and demangled strings that
- /// live in the global string pool.
+ /// Releases its ref counts on the mangled and demangled strings that live
+ /// in the global string pool.
//----------------------------------------------------------------------
~Mangled();
//----------------------------------------------------------------------
/// Convert to pointer operator.
///
- /// This allows code to check a Mangled object to see if it contains
- /// a valid mangled name using code such as:
+ /// This allows code to check a Mangled object to see if it contains a valid
+ /// mangled name using code such as:
///
/// @code
/// Mangled mangled(...);
@@ -117,8 +117,8 @@ public:
//----------------------------------------------------------------------
/// Logical NOT operator.
///
- /// This allows code to check a Mangled object to see if it contains
- /// an empty mangled name using code such as:
+ /// This allows code to check a Mangled object to see if it contains an
+ /// empty mangled name using code such as:
///
/// @code
/// Mangled mangled(...);
@@ -158,8 +158,8 @@ public:
//----------------------------------------------------------------------
/// Dump a description of this object to a Stream \a s.
///
- /// Dump a Mangled object to stream \a s. We don't force our
- /// demangled name to be computed currently (we don't use the accessor).
+ /// Dump a Mangled object to stream \a s. We don't force our demangled name
+ /// to be computed currently (we don't use the accessor).
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -245,9 +245,9 @@ public:
//----------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Return the size in bytes that this object takes in memory. This
- /// returns the size in bytes of this object, not any shared string
- /// values it may refer to.
+ /// Return the size in bytes that this object takes in memory. This returns
+ /// the size in bytes of this object, not any shared string values it may
+ /// refer to.
///
/// @return
/// The number of bytes that this object occupies in memory.
@@ -259,8 +259,8 @@ public:
//----------------------------------------------------------------------
/// Set the string value in this object.
///
- /// If \a is_mangled is \b true, then the mangled named is set to \a
- /// name, else the demangled name is set to \a name.
+ /// If \a is_mangled is \b true, then the mangled named is set to \a name,
+ /// else the demangled name is set to \a name.
///
/// @param[in] name
/// The already const version of the name for this object.
@@ -285,14 +285,14 @@ public:
//----------------------------------------------------------------------
/// Try to guess the language from the mangling.
///
- /// For a mangled name to have a language it must have both a mangled
- /// and a demangled name and it can be guessed from the mangling what
- /// the language is. Note: this will return C++ for any language that
- /// uses Itanium ABI mangling.
+ /// For a mangled name to have a language it must have both a mangled and a
+ /// demangled name and it can be guessed from the mangling what the language
+ /// is. Note: this will return C++ for any language that uses Itanium ABI
+ /// mangling.
///
- /// Standard C function names will return eLanguageTypeUnknown because
- /// they aren't mangled and it isn't clear what language the name
- /// represents (there will be no mangled name).
+ /// Standard C function names will return eLanguageTypeUnknown because they
+ /// aren't mangled and it isn't clear what language the name represents
+ /// (there will be no mangled name).
///
/// @return
/// The language for the mangled/demangled name, eLanguageTypeUnknown
diff --git a/include/lldb/Core/MappedHash.h b/include/lldb/Core/MappedHash.h
index d56a6d537868..1bdf59c73649 100644
--- a/include/lldb/Core/MappedHash.h
+++ b/include/lldb/Core/MappedHash.h
@@ -24,6 +24,7 @@
// Project includes
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Stream.h"
+#include "llvm/Support/DJB.h"
class MappedHash {
public:
@@ -32,22 +33,10 @@ public:
// by the ELF GNU_HASH sections
};
- static uint32_t HashStringUsingDJB(const char *s) {
- uint32_t h = 5381;
-
- for (unsigned char c = *s; c; c = *++s)
- h = ((h << 5) + h) + c;
-
- return h;
- }
-
- static uint32_t HashString(uint32_t hash_function, const char *s) {
- if (!s)
- return 0;
-
+ static uint32_t HashString(uint32_t hash_function, llvm::StringRef s) {
switch (hash_function) {
case MappedHash::eHashFunctionDJB:
- return HashStringUsingDJB(s);
+ return llvm::djbHash(s);
default:
break;
@@ -152,164 +141,6 @@ public:
// Write (int fd);
};
- template <typename __KeyType, class __HeaderDataType, class __ValueType>
- class ExportTable {
- public:
- typedef __HeaderDataType HeaderDataType;
- typedef Header<HeaderDataType> HeaderType;
- typedef __KeyType KeyType;
- typedef __ValueType ValueType;
-
- struct Entry {
- uint32_t hash;
- KeyType key;
- ValueType value;
- };
-
- typedef std::vector<ValueType> ValueArrayType;
-
- typedef std::map<KeyType, ValueArrayType> HashData;
- // Map a name hash to one or more name infos
- typedef std::map<uint32_t, HashData> HashToHashData;
-
- virtual KeyType GetKeyForStringType(const char *cstr) const = 0;
-
- virtual size_t GetByteSize(const HashData &key_to_key_values) = 0;
-
- virtual bool WriteHashData(const HashData &hash_data,
- lldb_private::Stream &ostrm) = 0;
- //
- void AddEntry(const char *cstr, const ValueType &value) {
- Entry entry;
- entry.hash = MappedHash::HashString(eHashFunctionDJB, cstr);
- entry.key = GetKeyForStringType(cstr);
- entry.value = value;
- m_entries.push_back(entry);
- }
-
- void Save(const HeaderDataType &header_data, lldb_private::Stream &ostrm) {
- if (m_entries.empty())
- return;
-
- const uint32_t num_entries = m_entries.size();
- uint32_t i = 0;
-
- HeaderType header;
-
- header.magic = HASH_MAGIC;
- header.version = 1;
- header.hash_function = eHashFunctionDJB;
- header.bucket_count = 0;
- header.hashes_count = 0;
- header.prologue_length = header_data.GetByteSize();
-
- // We need to figure out the number of unique hashes first before we can
- // calculate the number of buckets we want to use.
- typedef std::vector<uint32_t> hash_coll;
- hash_coll unique_hashes;
- unique_hashes.resize(num_entries);
- for (i = 0; i < num_entries; ++i)
- unique_hashes[i] = m_entries[i].hash;
- std::sort(unique_hashes.begin(), unique_hashes.end());
- hash_coll::iterator pos =
- std::unique(unique_hashes.begin(), unique_hashes.end());
- const size_t num_unique_hashes =
- std::distance(unique_hashes.begin(), pos);
-
- if (num_unique_hashes > 1024)
- header.bucket_count = num_unique_hashes / 4;
- else if (num_unique_hashes > 16)
- header.bucket_count = num_unique_hashes / 2;
- else
- header.bucket_count = num_unique_hashes;
- if (header.bucket_count == 0)
- header.bucket_count = 1;
-
- std::vector<HashToHashData> hash_buckets;
- std::vector<uint32_t> hash_indexes(header.bucket_count, 0);
- std::vector<uint32_t> hash_values;
- std::vector<uint32_t> hash_offsets;
- hash_buckets.resize(header.bucket_count);
- uint32_t bucket_entry_empties = 0;
- // StreamString hash_file_data(Stream::eBinary,
- // dwarf->GetObjectFile()->GetAddressByteSize(),
- // dwarf->GetObjectFile()->GetByteSize());
-
- // Push all of the hashes into their buckets and create all bucket
- // entries all populated with data.
- for (i = 0; i < num_entries; ++i) {
- const uint32_t hash = m_entries[i].hash;
- const uint32_t bucket_idx = hash % header.bucket_count;
- const uint32_t strp_offset = m_entries[i].str_offset;
- const uint32_t die_offset = m_entries[i].die_offset;
- hash_buckets[bucket_idx][hash][strp_offset].push_back(die_offset);
- }
-
- // Now for each bucket we write the bucket value which is the
- // number of hashes and the hash index encoded into a single
- // 32 bit unsigned integer.
- for (i = 0; i < header.bucket_count; ++i) {
- HashToHashData &bucket_entry = hash_buckets[i];
-
- if (bucket_entry.empty()) {
- // Empty bucket
- ++bucket_entry_empties;
- hash_indexes[i] = UINT32_MAX;
- } else {
- const uint32_t hash_value_index = hash_values.size();
- uint32_t hash_count = 0;
- typename HashToHashData::const_iterator pos, end = bucket_entry.end();
- for (pos = bucket_entry.begin(); pos != end; ++pos) {
- hash_values.push_back(pos->first);
- hash_offsets.push_back(GetByteSize(pos->second));
- ++hash_count;
- }
-
- hash_indexes[i] = hash_value_index;
- }
- }
- header.hashes_count = hash_values.size();
-
- // Write the header out now that we have the hash_count
- header.Write(ostrm);
-
- // Now for each bucket we write the start index of the hashes
- // for the current bucket, or UINT32_MAX if the bucket is empty
- for (i = 0; i < header.bucket_count; ++i) {
- ostrm.PutHex32(hash_indexes[i]);
- }
-
- // Now we need to write out all of the hash values
- for (i = 0; i < header.hashes_count; ++i) {
- ostrm.PutHex32(hash_values[i]);
- }
-
- // Now we need to write out all of the hash data offsets,
- // there is an offset for each hash in the hashes array
- // that was written out above
- for (i = 0; i < header.hashes_count; ++i) {
- ostrm.PutHex32(hash_offsets[i]);
- }
-
- // Now we write the data for each hash and verify we got the offset
- // correct above...
- for (i = 0; i < header.bucket_count; ++i) {
- HashToHashData &bucket_entry = hash_buckets[i];
-
- typename HashToHashData::const_iterator pos, end = bucket_entry.end();
- for (pos = bucket_entry.begin(); pos != end; ++pos) {
- if (!bucket_entry.empty()) {
- WriteHashData(pos->second);
- }
- }
- }
- }
-
- protected:
- typedef std::vector<Entry> collection;
- collection m_entries;
- };
-
// A class for reading and using a saved hash table from a block of data
// in memory
template <typename __KeyType, class __HeaderType, class __HashData>
@@ -377,8 +208,8 @@ public:
return result;
}
- bool Find(const char *name, Pair &pair) const {
- if (!name || !name[0])
+ bool Find(llvm::StringRef name, Pair &pair) const {
+ if (name.empty())
return false;
if (IsValid()) {
@@ -425,13 +256,12 @@ public:
return false;
}
- // This method must be implemented in any subclasses.
- // The KeyType is user specified and must somehow result in a string
- // value. For example, the KeyType might be a string offset in a string
- // table and subclasses can store their string table as a member of the
- // subclass and return a valie "const char *" given a "key". The value
- // could also be a C string pointer, in which case just returning "key"
- // will suffice.
+ // This method must be implemented in any subclasses. The KeyType is user
+ // specified and must somehow result in a string value. For example, the
+ // KeyType might be a string offset in a string table and subclasses can
+ // store their string table as a member of the subclass and return a valie
+ // "const char *" given a "key". The value could also be a C string
+ // pointer, in which case just returning "key" will suffice.
virtual const char *GetStringForKeyType(KeyType key) const = 0;
virtual bool ReadHashData(uint32_t hash_data_offset,
@@ -439,20 +269,19 @@ public:
// This method must be implemented in any subclasses and it must try to
// read one "Pair" at the offset pointed to by the "hash_data_offset_ptr"
- // parameter. This offset should be updated as bytes are consumed and
- // a value "Result" enum should be returned. If the "name" matches the
- // full name for the "pair.key" (which must be filled in by this call),
- // then the HashData in the pair ("pair.value") should be extracted and
- // filled in and "eResultKeyMatch" should be returned. If "name" doesn't
- // match this string for the key, then "eResultKeyMismatch" should be
- // returned and all data for the current HashData must be consumed or
- // skipped and the "hash_data_offset_ptr" offset needs to be updated to
- // point to the next HashData. If the end of the HashData objects for
- // a given hash value have been reached, then "eResultEndOfHashData"
- // should be returned. If anything else goes wrong during parsing,
- // return "eResultError" and the corresponding "Find()" function will
- // be canceled and return false.
- virtual Result GetHashDataForName(const char *name,
+ // parameter. This offset should be updated as bytes are consumed and a
+ // value "Result" enum should be returned. If the "name" matches the full
+ // name for the "pair.key" (which must be filled in by this call), then the
+ // HashData in the pair ("pair.value") should be extracted and filled in
+ // and "eResultKeyMatch" should be returned. If "name" doesn't match this
+ // string for the key, then "eResultKeyMismatch" should be returned and all
+ // data for the current HashData must be consumed or skipped and the
+ // "hash_data_offset_ptr" offset needs to be updated to point to the next
+ // HashData. If the end of the HashData objects for a given hash value have
+ // been reached, then "eResultEndOfHashData" should be returned. If
+ // anything else goes wrong during parsing, return "eResultError" and the
+ // corresponding "Find()" function will be canceled and return false.
+ virtual Result GetHashDataForName(llvm::StringRef name,
lldb::offset_t *hash_data_offset_ptr,
Pair &pair) const = 0;
diff --git a/include/lldb/Core/Module.h b/include/lldb/Core/Module.h
index da981ade78ba..83d5f519f086 100644
--- a/include/lldb/Core/Module.h
+++ b/include/lldb/Core/Module.h
@@ -12,6 +12,7 @@
#include "lldb/Core/Address.h" // for Address
#include "lldb/Core/ModuleSpec.h" // for ModuleSpec
+#include "lldb/Symbol/ObjectFile.h" // for ObjectFile
#include "lldb/Symbol/SymbolContextScope.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Target/PathMappingList.h"
@@ -93,33 +94,30 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Module Module.h "lldb/Core/Module.h"
-/// @brief A class that describes an executable image and its associated
+/// A class that describes an executable image and its associated
/// object and symbol files.
///
/// The module is designed to be able to select a single slice of an
-/// executable image as it would appear on disk and during program
-/// execution.
+/// executable image as it would appear on disk and during program execution.
///
/// Modules control when and if information is parsed according to which
/// accessors are called. For example the object file (ObjectFile)
-/// representation will only be parsed if the object file is requested
-/// using the Module::GetObjectFile() is called. The debug symbols
-/// will only be parsed if the symbol vendor (SymbolVendor) is
-/// requested using the Module::GetSymbolVendor() is called.
+/// representation will only be parsed if the object file is requested using
+/// the Module::GetObjectFile() is called. The debug symbols will only be
+/// parsed if the symbol vendor (SymbolVendor) is requested using the
+/// Module::GetSymbolVendor() is called.
///
-/// The module will parse more detailed information as more queries are
-/// made.
+/// The module will parse more detailed information as more queries are made.
//----------------------------------------------------------------------
class Module : public std::enable_shared_from_this<Module>,
public SymbolContextScope {
public:
- // Static functions that can track the lifetime of module objects.
- // This is handy because we might have Module objects that are in
- // shared pointers that aren't in the global module list (from
- // ModuleList). If this is the case we need to know about it.
- // The modules in the global list maintained by these functions
- // can be viewed using the "target modules list" command using the
- // "--global" (-g for short).
+ // Static functions that can track the lifetime of module objects. This is
+ // handy because we might have Module objects that are in shared pointers
+ // that aren't in the global module list (from ModuleList). If this is the
+ // case we need to know about it. The modules in the global list maintained
+ // by these functions can be viewed using the "target modules list" command
+ // using the "--global" (-g for short).
static size_t GetNumberAllocatedModules();
static Module *GetAllocatedModuleAtIndex(size_t idx);
@@ -129,8 +127,8 @@ public:
//------------------------------------------------------------------
/// Construct with file specification and architecture.
///
- /// Clients that wish to share modules with other targets should
- /// use ModuleList::GetSharedModule().
+ /// Clients that wish to share modules with other targets should use
+ /// ModuleList::GetSharedModule().
///
/// @param[in] file_spec
/// The file specification for the on disk representation of
@@ -158,8 +156,23 @@ public:
Module(const ModuleSpec &module_spec);
- static lldb::ModuleSP
- CreateJITModule(const lldb::ObjectFileJITDelegateSP &delegate_sp);
+ template <typename ObjFilePlugin, typename... Args>
+ static lldb::ModuleSP CreateModuleFromObjectFile(Args &&... args) {
+ // Must create a module and place it into a shared pointer before we can
+ // create an object file since it has a std::weak_ptr back to the module,
+ // so we need to control the creation carefully in this static function
+ lldb::ModuleSP module_sp(new Module());
+ module_sp->m_objfile_sp =
+ std::make_shared<ObjFilePlugin>(module_sp, std::forward<Args>(args)...);
+
+ // Once we get the object file, update our module with the object file's
+ // architecture since it might differ in vendor/os if some parts were
+ // unknown.
+ if (!module_sp->m_objfile_sp->GetArchitecture(module_sp->m_arch))
+ return nullptr;
+
+ return module_sp;
+ }
//------------------------------------------------------------------
/// Destructor.
@@ -169,13 +182,13 @@ public:
bool MatchesModuleSpec(const ModuleSpec &module_ref);
//------------------------------------------------------------------
- /// Set the load address for all sections in a module to be the
- /// file address plus \a slide.
+ /// Set the load address for all sections in a module to be the file address
+ /// plus \a slide.
///
- /// Many times a module will be loaded in a target with a constant
- /// offset applied to all top level sections. This function can
- /// set the load address for all top level sections to be the
- /// section file address + offset.
+ /// Many times a module will be loaded in a target with a constant offset
+ /// applied to all top level sections. This function can set the load
+ /// address for all top level sections to be the section file address +
+ /// offset.
///
/// @param[in] target
/// The target in which to apply the section load addresses.
@@ -225,19 +238,18 @@ public:
//------------------------------------------------------------------
/// Get the module path and object name.
///
- /// Modules can refer to object files. In this case the specification
- /// is simple and would return the path to the file:
+ /// Modules can refer to object files. In this case the specification is
+ /// simple and would return the path to the file:
///
/// "/usr/lib/foo.dylib"
///
- /// Modules can be .o files inside of a BSD archive (.a file). In
- /// this case, the object specification will look like:
+ /// Modules can be .o files inside of a BSD archive (.a file). In this case,
+ /// the object specification will look like:
///
/// "/usr/lib/foo.a(bar.o)"
///
- /// There are many places where logging wants to log this fully
- /// qualified specification, so we centralize this functionality
- /// here.
+ /// There are many places where logging wants to log this fully qualified
+ /// specification, so we centralize this functionality here.
///
/// @return
/// The object path + object name if there is one.
@@ -247,11 +259,10 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s. The dumped content will be only what has
- /// been loaded or parsed up to this point at which this function
- /// is called, so this is a good way to see what has been parsed
- /// in a module.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s. The dumped content will be only what has been loaded or parsed up
+ /// to this point at which this function is called, so this is a good way to
+ /// see what has been parsed in a module.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -316,8 +327,8 @@ public:
//------------------------------------------------------------------
/// Find compile units by partial or full path.
///
- /// Finds all compile units that match \a path in all of the modules
- /// and returns the results in \a sc_list.
+ /// Finds all compile units that match \a path in all of the modules and
+ /// returns the results in \a sc_list.
///
/// @param[in] path
/// The name of the function we are looking for.
@@ -342,8 +353,7 @@ public:
///
/// If the function is an inlined function, it will have a block,
/// representing the inlined function, and the function will be the
- /// containing function. If it is not inlined, then the block will
- /// be NULL.
+ /// containing function. If it is not inlined, then the block will be NULL.
///
/// @param[in] name
/// The name of the compile unit we are looking for.
@@ -379,8 +389,7 @@ public:
///
/// If the function is an inlined function, it will have a block,
/// representing the inlined function, and the function will be the
- /// containing function. If it is not inlined, then the block will
- /// be NULL.
+ /// containing function. If it is not inlined, then the block will be NULL.
///
/// @param[in] regex
/// A regular expression to use when matching the name.
@@ -438,26 +447,19 @@ public:
/// @param[in] parent_decl_ctx
/// If valid, a decl context that results must exist within
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
size_t FindGlobalVariables(const ConstString &name,
const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches,
- VariableList &variable_list);
+ size_t max_matches, VariableList &variable_list);
//------------------------------------------------------------------
/// Find global and static variables by regular expression.
@@ -465,44 +467,36 @@ public:
/// @param[in] regex
/// A regular expression to use when matching the name.
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- size_t FindGlobalVariables(const RegularExpression &regex, bool append,
- size_t max_matches, VariableList &variable_list);
+ size_t FindGlobalVariables(const RegularExpression &regex, size_t max_matches,
+ VariableList &variable_list);
//------------------------------------------------------------------
/// Find types by name.
///
- /// Type lookups in modules go through the SymbolVendor (which will
- /// use one or more SymbolFile subclasses). The SymbolFile needs to
- /// be able to lookup types by basename and not the fully qualified
- /// typename. This allows the type accelerator tables to stay small,
- /// even with heavily templatized C++. The type search will then
- /// narrow down the search results. If "exact_match" is true, then
- /// the type search will only match exact type name matches. If
- /// "exact_match" is false, the type will match as long as the base
- /// typename matches and as long as any immediate containing
- /// namespaces/class scopes that are specified match. So to search
- /// for a type "d" in "b::c", the name "b::c::d" can be specified
- /// and it will match any class/namespace "b" which contains a
- /// class/namespace "c" which contains type "d". We do this to
- /// allow users to not always have to specify complete scoping on
- /// all expressions, but it also allows for exact matching when
- /// required.
+ /// Type lookups in modules go through the SymbolVendor (which will use one
+ /// or more SymbolFile subclasses). The SymbolFile needs to be able to
+ /// lookup types by basename and not the fully qualified typename. This
+ /// allows the type accelerator tables to stay small, even with heavily
+ /// templatized C++. The type search will then narrow down the search
+ /// results. If "exact_match" is true, then the type search will only match
+ /// exact type name matches. If "exact_match" is false, the type will match
+ /// as long as the base typename matches and as long as any immediate
+ /// containing namespaces/class scopes that are specified match. So to
+ /// search for a type "d" in "b::c", the name "b::c::d" can be specified and
+ /// it will match any class/namespace "b" which contains a class/namespace
+ /// "c" which contains type "d". We do this to allow users to not always
+ /// have to specify complete scoping on all expressions, but it also allows
+ /// for exact matching when required.
///
/// @param[in] sc
/// A symbol context that scopes where to extract a type list
@@ -535,9 +529,9 @@ public:
const ConstString &type_name, bool exact_match);
//------------------------------------------------------------------
- /// Find types by name that are in a namespace. This function is
- /// used by the expression parser when searches need to happen in
- /// an exact namespace scope.
+ /// Find types by name that are in a namespace. This function is used by the
+ /// expression parser when searches need to happen in an exact namespace
+ /// scope.
///
/// @param[in] sc
/// A symbol context that scopes where to extract a type list
@@ -572,9 +566,9 @@ public:
//------------------------------------------------------------------
/// Get const accessor for the module file specification.
///
- /// This function returns the file for the module on the host system
- /// that is running LLDB. This can differ from the path on the
- /// platform since we might be doing remote debugging.
+ /// This function returns the file for the module on the host system that is
+ /// running LLDB. This can differ from the path on the platform since we
+ /// might be doing remote debugging.
///
/// @return
/// A const reference to the file specification object.
@@ -584,14 +578,13 @@ public:
//------------------------------------------------------------------
/// Get accessor for the module platform file specification.
///
- /// Platform file refers to the path of the module as it is known on
- /// the remote system on which it is being debugged. For local
- /// debugging this is always the same as Module::GetFileSpec(). But
- /// remote debugging might mention a file "/usr/lib/liba.dylib"
- /// which might be locally downloaded and cached. In this case the
- /// platform file could be something like:
- /// "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib"
- /// The file could also be cached in a local developer kit directory.
+ /// Platform file refers to the path of the module as it is known on the
+ /// remote system on which it is being debugged. For local debugging this is
+ /// always the same as Module::GetFileSpec(). But remote debugging might
+ /// mention a file "/usr/lib/liba.dylib" which might be locally downloaded
+ /// and cached. In this case the platform file could be something like:
+ /// "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib" The
+ /// file could also be cached in a local developer kit directory.
///
/// @return
/// A const reference to the file specification object.
@@ -631,8 +624,8 @@ public:
}
//------------------------------------------------------------------
- /// Tells whether this module is capable of being the main executable
- /// for a process.
+ /// Tells whether this module is capable of being the main executable for a
+ /// process.
///
/// @return
/// \b true if it is, \b false otherwise.
@@ -640,9 +633,9 @@ public:
bool IsExecutable();
//------------------------------------------------------------------
- /// Tells whether this module has been loaded in the target passed in.
- /// This call doesn't distinguish between whether the module is loaded
- /// by the dynamic loader, or by a "target module add" type call.
+ /// Tells whether this module has been loaded in the target passed in. This
+ /// call doesn't distinguish between whether the module is loaded by the
+ /// dynamic loader, or by a "target module add" type call.
///
/// @param[in] target
/// The target to check whether this is loaded in.
@@ -673,9 +666,8 @@ public:
//------------------------------------------------------------------
/// Get the object file representation for the current architecture.
///
- /// If the object file has not been located or parsed yet, this
- /// function will find the best ObjectFile plug-in that can parse
- /// Module::m_file.
+ /// If the object file has not been located or parsed yet, this function
+ /// will find the best ObjectFile plug-in that can parse Module::m_file.
///
/// @return
/// If Module::m_file does not exist, or no plug-in was found
@@ -688,12 +680,12 @@ public:
virtual ObjectFile *GetObjectFile();
//------------------------------------------------------------------
- /// Get the unified section list for the module. This is the section
- /// list created by the module's object file and any debug info and
- /// symbol files created by the symbol vendor.
+ /// Get the unified section list for the module. This is the section list
+ /// created by the module's object file and any debug info and symbol files
+ /// created by the symbol vendor.
///
- /// If the symbol vendor has not been loaded yet, this function
- /// will return the section list for the object file.
+ /// If the symbol vendor has not been loaded yet, this function will return
+ /// the section list for the object file.
///
/// @return
/// Unified module section list.
@@ -701,27 +693,26 @@ public:
virtual SectionList *GetSectionList();
//------------------------------------------------------------------
- /// Notify the module that the file addresses for the Sections have
- /// been updated.
+ /// Notify the module that the file addresses for the Sections have been
+ /// updated.
///
- /// If the Section file addresses for a module are updated, this
- /// method should be called. Any parts of the module, object file,
- /// or symbol file that has cached those file addresses must invalidate
- /// or update its cache.
+ /// If the Section file addresses for a module are updated, this method
+ /// should be called. Any parts of the module, object file, or symbol file
+ /// that has cached those file addresses must invalidate or update its
+ /// cache.
//------------------------------------------------------------------
virtual void SectionFileAddressesChanged();
- uint32_t GetVersion(uint32_t *versions, uint32_t num_versions);
+ llvm::VersionTuple GetVersion();
//------------------------------------------------------------------
/// Load an object file from memory.
///
- /// If available, the size of the object file in memory may be
- /// passed to avoid additional round trips to process memory.
- /// If the size is not provided, a default value is used. This
- /// value should be large enough to enable the ObjectFile plugins
- /// to read the header of the object file without going back to the
- /// process.
+ /// If available, the size of the object file in memory may be passed to
+ /// avoid additional round trips to process memory. If the size is not
+ /// provided, a default value is used. This value should be large enough to
+ /// enable the ObjectFile plugins to read the header of the object file
+ /// without going back to the process.
///
/// @return
/// The object file loaded from memory or nullptr, if the operation
@@ -733,9 +724,8 @@ public:
//------------------------------------------------------------------
/// Get the symbol vendor interface for the current architecture.
///
- /// If the symbol vendor file has not been located yet, this
- /// function will find the best SymbolVendor plug-in that can
- /// use the current object file.
+ /// If the symbol vendor file has not been located yet, this function will
+ /// find the best SymbolVendor plug-in that can use the current object file.
///
/// @return
/// If this module does not have a valid object file, or no
@@ -758,11 +748,11 @@ public:
TypeList *GetTypeList();
//------------------------------------------------------------------
- /// Get a pointer to the UUID value contained in this object.
+ /// Get a reference to the UUID value contained in this object.
///
- /// If the executable image file doesn't not have a UUID value built
- /// into the file format, an MD5 checksum of the entire file, or
- /// slice of the file for the current architecture should be used.
+ /// If the executable image file doesn't not have a UUID value built into
+ /// the file format, an MD5 checksum of the entire file, or slice of the
+ /// file for the current architecture should be used.
///
/// @return
/// A const pointer to the internal copy of the UUID value in
@@ -775,14 +765,13 @@ public:
/// A debugging function that will cause everything in a module to
/// be parsed.
///
- /// All compile units will be parsed, along with all globals and
- /// static variables and all functions for those compile units.
- /// All types, scopes, local variables, static variables, global
- /// variables, and line tables will be parsed. This can be used
- /// prior to dumping a module to see a complete list of the
- /// resulting debug information that gets parsed, or as a debug
- /// function to ensure that the module can consume all of the
- /// debug data the symbol vendor provides.
+ /// All compile units will be parsed, along with all globals and static
+ /// variables and all functions for those compile units. All types, scopes,
+ /// local variables, static variables, global variables, and line tables
+ /// will be parsed. This can be used prior to dumping a module to see a
+ /// complete list of the resulting debug information that gets parsed, or as
+ /// a debug function to ensure that the module can consume all of the debug
+ /// data the symbol vendor provides.
//------------------------------------------------------------------
void ParseAllDebugSymbols();
@@ -791,17 +780,16 @@ public:
//------------------------------------------------------------------
/// Resolve the symbol context for the given address.
///
- /// Tries to resolve the matching symbol context based on a lookup
- /// from the current symbol vendor. If the lazy lookup fails,
- /// an attempt is made to parse the eh_frame section to handle
- /// stripped symbols. If this fails, an attempt is made to resolve
- /// the symbol to the previous address to handle the case of a
- /// function with a tail call.
+ /// Tries to resolve the matching symbol context based on a lookup from the
+ /// current symbol vendor. If the lazy lookup fails, an attempt is made to
+ /// parse the eh_frame section to handle stripped symbols. If this fails,
+ /// an attempt is made to resolve the symbol to the previous address to
+ /// handle the case of a function with a tail call.
///
- /// Use properties of the modified SymbolContext to inspect any
- /// resolved target, module, compilation unit, symbol, function,
- /// function block or line entry. Use the return value to determine
- /// which of these properties have been modified.
+ /// Use properties of the modified SymbolContext to inspect any resolved
+ /// target, module, compilation unit, symbol, function, function block or
+ /// line entry. Use the return value to determine which of these properties
+ /// have been modified.
///
/// @param[in] so_addr
/// A load address to resolve.
@@ -836,15 +824,14 @@ public:
//------------------------------------------------------------------
/// Resolve items in the symbol context for a given file and line.
///
- /// Tries to resolve \a file_path and \a line to a list of matching
- /// symbol contexts.
+ /// Tries to resolve \a file_path and \a line to a list of matching symbol
+ /// contexts.
///
- /// The line table entries contains addresses that can be used to
- /// further resolve the values in each match: the function, block,
- /// symbol. Care should be taken to minimize the amount of
- /// information that is requested to only what is needed --
- /// typically the module, compile unit, line table and line table
- /// entry are sufficient.
+ /// The line table entries contains addresses that can be used to further
+ /// resolve the values in each match: the function, block, symbol. Care
+ /// should be taken to minimize the amount of information that is requested
+ /// to only what is needed -- typically the module, compile unit, line table
+ /// and line table entry are sufficient.
///
/// @param[in] file_path
/// A path to a source file to match. If \a file_path does not
@@ -883,15 +870,14 @@ public:
//------------------------------------------------------------------
/// Resolve items in the symbol context for a given file and line.
///
- /// Tries to resolve \a file_spec and \a line to a list of matching
- /// symbol contexts.
+ /// Tries to resolve \a file_spec and \a line to a list of matching symbol
+ /// contexts.
///
- /// The line table entries contains addresses that can be used to
- /// further resolve the values in each match: the function, block,
- /// symbol. Care should be taken to minimize the amount of
- /// information that is requested to only what is needed --
- /// typically the module, compile unit, line table and line table
- /// entry are sufficient.
+ /// The line table entries contains addresses that can be used to further
+ /// resolve the values in each match: the function, block, symbol. Care
+ /// should be taken to minimize the amount of information that is requested
+ /// to only what is needed -- typically the module, compile unit, line table
+ /// and line table entry are sufficient.
///
/// @param[in] file_spec
/// A file spec to a source file to match. If \a file_path does
@@ -936,12 +922,10 @@ public:
TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language);
// Special error functions that can do printf style formatting that will
- // prepend the message with
- // something appropriate for this module (like the architecture, path and
- // object name (if any)).
- // This centralizes code so that everyone doesn't need to format their error
- // and log messages on
- // their own and keeps the output a bit more consistent.
+ // prepend the message with something appropriate for this module (like the
+ // architecture, path and object name (if any)). This centralizes code so
+ // that everyone doesn't need to format their error and log messages on their
+ // own and keeps the output a bit more consistent.
void LogMessage(Log *log, const char *format, ...)
__attribute__((format(printf, 3, 4)));
@@ -960,15 +944,15 @@ public:
__attribute__((format(printf, 2, 3)));
//------------------------------------------------------------------
- // Return true if the file backing this module has changed since the
- // module was originally created since we saved the initial file
- // modification time when the module first gets created.
+ // Return true if the file backing this module has changed since the module
+ // was originally created since we saved the initial file modification time
+ // when the module first gets created.
//------------------------------------------------------------------
bool FileHasChanged() const;
//------------------------------------------------------------------
- // SymbolVendor, SymbolFile and ObjectFile member objects should
- // lock the module mutex to avoid deadlocks.
+ // SymbolVendor, SymbolFile and ObjectFile member objects should lock the
+ // module mutex to avoid deadlocks.
//------------------------------------------------------------------
std::recursive_mutex &GetMutex() const { return m_mutex; }
@@ -979,14 +963,13 @@ public:
}
//------------------------------------------------------------------
- /// Finds a source file given a file spec using the module source
- /// path remappings (if any).
+ /// Finds a source file given a file spec using the module source path
+ /// remappings (if any).
///
/// Tries to resolve \a orig_spec by checking the module source path
- /// remappings. It makes sure the file exists, so this call can be
- /// expensive if the remappings are on a network file system, so
- /// use this function sparingly (not in a tight debug info parsing
- /// loop).
+ /// remappings. It makes sure the file exists, so this call can be expensive
+ /// if the remappings are on a network file system, so use this function
+ /// sparingly (not in a tight debug info parsing loop).
///
/// @param[in] orig_spec
/// The original source file path to try and remap.
@@ -1004,9 +987,9 @@ public:
//------------------------------------------------------------------
/// Remaps a source file given \a path into \a new_path.
///
- /// Remaps \a path if any source remappings match. This function
- /// does NOT stat the file system so it can be used in tight loops
- /// where debug info is being parsed.
+ /// Remaps \a path if any source remappings match. This function does NOT
+ /// stat the file system so it can be used in tight loops where debug info
+ /// is being parsed.
///
/// @param[in] path
/// The original source file path to try and remap.
@@ -1021,43 +1004,28 @@ public:
bool RemapSourceFile(llvm::StringRef path, std::string &new_path) const;
bool RemapSourceFile(const char *, std::string &) const = delete;
- //------------------------------------------------------------------
- /// Loads this module to memory.
- ///
- /// Loads the bits needed to create an executable image to the memory.
- /// It is useful with bare-metal targets where target does not have the
- /// ability to start a process itself.
- ///
- /// @param[in] target
- /// Target where to load the module.
- ///
- /// @return
- //------------------------------------------------------------------
- Status LoadInMemory(Target &target, bool set_pc);
-
//----------------------------------------------------------------------
/// @class LookupInfo Module.h "lldb/Core/Module.h"
- /// @brief A class that encapsulates name lookup information.
- ///
- /// Users can type a wide variety of partial names when setting
- /// breakpoints by name or when looking for functions by name.
- /// SymbolVendor and SymbolFile objects are only required to implement
- /// name lookup for function basenames and for fully mangled names.
- /// This means if the user types in a partial name, we must reduce this
- /// to a name lookup that will work with all SymbolFile objects. So we
- /// might reduce a name lookup to look for a basename, and then prune
- /// out any results that don't match.
- ///
- /// The "m_name" member variable represents the name as it was typed
- /// by the user. "m_lookup_name" will be the name we actually search
- /// for through the symbol or objects files. Lanaguage is included in
- /// case we need to filter results by language at a later date. The
- /// "m_name_type_mask" member variable tells us what kinds of names we
- /// are looking for and can help us prune out unwanted results.
+ /// A class that encapsulates name lookup information.
+ ///
+ /// Users can type a wide variety of partial names when setting breakpoints
+ /// by name or when looking for functions by name. SymbolVendor and
+ /// SymbolFile objects are only required to implement name lookup for
+ /// function basenames and for fully mangled names. This means if the user
+ /// types in a partial name, we must reduce this to a name lookup that will
+ /// work with all SymbolFile objects. So we might reduce a name lookup to
+ /// look for a basename, and then prune out any results that don't match.
+ ///
+ /// The "m_name" member variable represents the name as it was typed by the
+ /// user. "m_lookup_name" will be the name we actually search for through
+ /// the symbol or objects files. Lanaguage is included in case we need to
+ /// filter results by language at a later date. The "m_name_type_mask"
+ /// member variable tells us what kinds of names we are looking for and can
+ /// help us prune out unwanted results.
///
/// Function lookups are done in Module.cpp, ModuleList.cpp and in
- /// BreakpointResolverName.cpp and they all now use this class to do
- /// lookups correctly.
+ /// BreakpointResolverName.cpp and they all now use this class to do lookups
+ /// correctly.
//----------------------------------------------------------------------
class LookupInfo {
public:
@@ -1146,7 +1114,7 @@ protected:
std::atomic<bool> m_did_load_objfile{false};
std::atomic<bool> m_did_load_symbol_vendor{false};
- std::atomic<bool> m_did_parse_uuid{false};
+ std::atomic<bool> m_did_set_uuid{false};
mutable bool m_file_has_changed : 1,
m_first_file_changed_log : 1; /// See if the module was modified after it
/// was initially opened.
@@ -1156,9 +1124,9 @@ protected:
///
/// Tries to resolve \a vm_addr as a file address (if \a
/// vm_addr_is_file_addr is true) or as a load address if \a
- /// vm_addr_is_file_addr is false) in the symbol vendor.
- /// \a resolve_scope indicates what clients wish to resolve
- /// and can be used to limit the scope of what is parsed.
+ /// vm_addr_is_file_addr is false) in the symbol vendor. \a resolve_scope
+ /// indicates what clients wish to resolve and can be used to limit the
+ /// scope of what is parsed.
///
/// @param[in] vm_addr
/// The load virtual address to resolve.
@@ -1196,6 +1164,8 @@ protected:
bool SetArchitecture(const ArchSpec &new_arch);
+ void SetUUID(const lldb_private::UUID &uuid);
+
SectionList *GetUnifiedSectionList();
friend class ModuleList;
diff --git a/include/lldb/Core/ModuleChild.h b/include/lldb/Core/ModuleChild.h
index 8f2985c8185b..73438040c359 100644
--- a/include/lldb/Core/ModuleChild.h
+++ b/include/lldb/Core/ModuleChild.h
@@ -16,7 +16,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ModuleChild ModuleChild.h "lldb/Core/ModuleChild.h"
-/// @brief A mix in class that contains a pointer back to the module
+/// A mix in class that contains a pointer back to the module
/// that owns the object which inherits from it.
//----------------------------------------------------------------------
class ModuleChild {
diff --git a/include/lldb/Core/ModuleList.h b/include/lldb/Core/ModuleList.h
index 4b637c9b0427..e1d8a9a7fb85 100644
--- a/include/lldb/Core/ModuleList.h
+++ b/include/lldb/Core/ModuleList.h
@@ -12,6 +12,7 @@
#include "lldb/Core/Address.h" // for Address
#include "lldb/Core/ModuleSpec.h" // for ModuleSpec
+#include "lldb/Core/UserSettingsController.h"
#include "lldb/Utility/FileSpec.h" // for FileSpec
#include "lldb/Utility/Iterable.h"
#include "lldb/Utility/Status.h" // for Status
@@ -74,12 +75,21 @@ class VariableList;
namespace lldb_private {
+class ModuleListProperties : public Properties {
+public:
+ ModuleListProperties();
+
+ FileSpec GetClangModulesCachePath() const;
+ bool SetClangModulesCachePath(llvm::StringRef path);
+ bool GetEnableExternalLookup() const;
+};
+
//----------------------------------------------------------------------
/// @class ModuleList ModuleList.h "lldb/Core/ModuleList.h"
-/// @brief A collection class for Module objects.
+/// A collection class for Module objects.
///
-/// Modules in the module collection class are stored as reference
-/// counted shared pointers to Module objects.
+/// Modules in the module collection class are stored as reference counted
+/// shared pointers to Module objects.
//----------------------------------------------------------------------
class ModuleList {
public:
@@ -107,8 +117,7 @@ public:
//------------------------------------------------------------------
/// Copy Constructor.
///
- /// Creates a new module list object with a copy of the modules from
- /// \a rhs.
+ /// Creates a new module list object with a copy of the modules from \a rhs.
///
/// @param[in] rhs
/// Another module list object.
@@ -146,9 +155,9 @@ public:
void Append(const lldb::ModuleSP &module_sp);
//------------------------------------------------------------------
- /// Append a module to the module list and remove any equivalent
- /// modules. Equivalent modules are ones whose file, platform file
- /// and architecture matches.
+ /// Append a module to the module list and remove any equivalent modules.
+ /// Equivalent modules are ones whose file, platform file and architecture
+ /// matches.
///
/// Replaces the module to the collection.
///
@@ -169,27 +178,27 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Clears the list of modules and releases a reference to each
- /// module object and if the reference count goes to zero, the
- /// module will be deleted.
+ /// Clears the list of modules and releases a reference to each module
+ /// object and if the reference count goes to zero, the module will be
+ /// deleted.
//------------------------------------------------------------------
void Clear();
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Clears the list of modules and releases a reference to each
- /// module object and if the reference count goes to zero, the
- /// module will be deleted. Also release all memory that might be
- /// held by any collection classes (like std::vector)
+ /// Clears the list of modules and releases a reference to each module
+ /// object and if the reference count goes to zero, the module will be
+ /// deleted. Also release all memory that might be held by any collection
+ /// classes (like std::vector)
//------------------------------------------------------------------
void Destroy();
//------------------------------------------------------------------
/// Dump the description of each module contained in this list.
///
- /// Dump the description of each module contained in this list to
- /// the supplied stream \a s.
+ /// Dump the description of each module contained in this list to the
+ /// supplied stream \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -220,8 +229,8 @@ public:
//------------------------------------------------------------------
/// Get the module shared pointer for the module at index \a idx without
- /// acquiring the ModuleList mutex. This MUST already have been
- /// acquired with ModuleList::GetMutex and locked for this call to be safe.
+ /// acquiring the ModuleList mutex. This MUST already have been acquired
+ /// with ModuleList::GetMutex and locked for this call to be safe.
///
/// @param[in] idx
/// An index into this module collection.
@@ -249,9 +258,9 @@ public:
Module *GetModulePointerAtIndex(size_t idx) const;
//------------------------------------------------------------------
- /// Get the module pointer for the module at index \a idx without
- /// acquiring the ModuleList mutex. This MUST already have been
- /// acquired with ModuleList::GetMutex and locked for this call to be safe.
+ /// Get the module pointer for the module at index \a idx without acquiring
+ /// the ModuleList mutex. This MUST already have been acquired with
+ /// ModuleList::GetMutex and locked for this call to be safe.
///
/// @param[in] idx
/// An index into this module collection.
@@ -267,8 +276,8 @@ public:
//------------------------------------------------------------------
/// Find compile units by partial or full path.
///
- /// Finds all compile units that match \a path in all of the modules
- /// and returns the results in \a sc_list.
+ /// Finds all compile units that match \a path in all of the modules and
+ /// returns the results in \a sc_list.
///
/// @param[in] path
/// The name of the compile unit we are looking for.
@@ -315,24 +324,17 @@ public:
/// The name of the global or static variable we are looking
/// for.
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- size_t FindGlobalVariables(const ConstString &name, bool append,
- size_t max_matches,
+ size_t FindGlobalVariables(const ConstString &name, size_t max_matches,
VariableList &variable_list) const;
//------------------------------------------------------------------
@@ -341,29 +343,21 @@ public:
/// @param[in] regex
/// A regular expression to use when matching the name.
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- size_t FindGlobalVariables(const RegularExpression &regex, bool append,
- size_t max_matches,
+ size_t FindGlobalVariables(const RegularExpression &regex, size_t max_matches,
VariableList &variable_list) const;
//------------------------------------------------------------------
- /// Finds the first module whose file specification matches \a
- /// file_spec.
+ /// Finds the first module whose file specification matches \a file_spec.
///
/// @param[in] file_spec_ptr
/// A file specification object to match against the Module's
@@ -400,9 +394,9 @@ public:
//------------------------------------------------------------------
// Find a module by UUID
//
- // The UUID value for a module is extracted from the ObjectFile and
- // is the MD5 checksum, or a smarter object file equivalent, so
- // finding modules by UUID values is very efficient and accurate.
+ // The UUID value for a module is extracted from the ObjectFile and is the
+ // MD5 checksum, or a smarter object file equivalent, so finding modules by
+ // UUID values is very efficient and accurate.
//------------------------------------------------------------------
lldb::ModuleSP FindModule(const UUID &uuid) const;
@@ -534,6 +528,8 @@ public:
Stream *feedback_stream = nullptr,
bool continue_on_error = true);
+ static ModuleListProperties &GetGlobalModuleListProperties();
+
static bool ModuleIsInCache(const Module *module_ptr);
static Status GetSharedModule(const ModuleSpec &module_spec,
@@ -551,7 +547,7 @@ public:
static size_t RemoveOrphanSharedModules(bool mandatory);
static bool RemoveSharedModuleIfOrphaned(const Module *module_ptr);
-
+
void ForEach(std::function<bool(const lldb::ModuleSP &module_sp)> const
&callback) const;
diff --git a/include/lldb/Core/ModuleSpec.h b/include/lldb/Core/ModuleSpec.h
index cc95bd0a0638..16a35a187780 100644
--- a/include/lldb/Core/ModuleSpec.h
+++ b/include/lldb/Core/ModuleSpec.h
@@ -34,9 +34,9 @@ public:
m_object_name(), m_object_offset(0), m_object_size(0),
m_source_mappings() {}
- ModuleSpec(const FileSpec &file_spec)
+ ModuleSpec(const FileSpec &file_spec, const UUID& uuid = UUID())
: m_file(file_spec), m_platform_file(), m_symbol_file(), m_arch(),
- m_uuid(), m_object_name(), m_object_offset(0),
+ m_uuid(uuid), m_object_name(), m_object_offset(0),
m_object_size(file_spec.GetByteSize()), m_source_mappings() {}
ModuleSpec(const FileSpec &file_spec, const ArchSpec &arch)
@@ -341,8 +341,8 @@ public:
m_specs.insert(m_specs.end(), rhs.m_specs.begin(), rhs.m_specs.end());
}
- // The index "i" must be valid and this can't be used in
- // multi-threaded code as no mutex lock is taken.
+ // The index "i" must be valid and this can't be used in multi-threaded code
+ // as no mutex lock is taken.
ModuleSpec &GetModuleSpecRefAtIndex(size_t i) { return m_specs[i]; }
bool GetModuleSpecAtIndex(size_t i, ModuleSpec &module_spec) const {
diff --git a/include/lldb/Core/PluginManager.h b/include/lldb/Core/PluginManager.h
index 68e6ca20b266..b782294f1f60 100644
--- a/include/lldb/Core/PluginManager.h
+++ b/include/lldb/Core/PluginManager.h
@@ -477,11 +477,11 @@ public:
const ConstString &name);
//------------------------------------------------------------------
- // Some plug-ins might register a DebuggerInitializeCallback
- // callback when registering the plug-in. After a new Debugger
- // instance is created, this DebuggerInitialize function will get
- // called. This allows plug-ins to install Properties and do any
- // other initialization that requires a debugger instance.
+ // Some plug-ins might register a DebuggerInitializeCallback callback when
+ // registering the plug-in. After a new Debugger instance is created, this
+ // DebuggerInitialize function will get called. This allows plug-ins to
+ // install Properties and do any other initialization that requires a
+ // debugger instance.
//------------------------------------------------------------------
static void DebuggerInitialize(Debugger &debugger);
diff --git a/include/lldb/Core/RangeMap.h b/include/lldb/Core/RangeMap.h
index 91fd409fb4ed..45bda26e2659 100644
--- a/include/lldb/Core/RangeMap.h
+++ b/include/lldb/Core/RangeMap.h
@@ -27,9 +27,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-// Templatized classes for dealing with generic ranges and also
-// collections of ranges, or collections of ranges that have associated
-// data.
+// Templatized classes for dealing with generic ranges and also collections of
+// ranges, or collections of ranges that have associated data.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -214,8 +213,8 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
+ // Use the swap technique in case our new vector is much smaller. We
+ // must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
@@ -228,8 +227,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // first range's base
+ // m_entries must be sorted, so if we aren't empty, we grab the first
+ // range's base
return m_entries.front().GetRangeBase();
}
@@ -239,8 +238,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // last range's end
+ // m_entries must be sorted, so if we aren't empty, we grab the last
+ // range's end
return m_entries.back().GetRangeEnd();
}
@@ -446,8 +445,8 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
+ // Use the swap technique in case our new vector is much smaller. We
+ // must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
@@ -460,8 +459,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // first range's base
+ // m_entries must be sorted, so if we aren't empty, we grab the first
+ // range's base
return m_entries.front().GetRangeBase();
}
@@ -471,8 +470,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // last range's end
+ // m_entries must be sorted, so if we aren't empty, we grab the last
+ // range's end
return m_entries.back().GetRangeEnd();
}
@@ -604,8 +603,8 @@ protected:
//----------------------------------------------------------------------
// A simple range with data class where you get to define the type of
-// the range base "B", the type used for the range byte size "S", and
-// the type for the associated data "T".
+// the range base "B", the type used for the range byte size "S", and the type
+// for the associated data "T".
//----------------------------------------------------------------------
template <typename B, typename S, typename T>
struct RangeData : public Range<B, S> {
@@ -688,8 +687,8 @@ public:
}
}
- // We we can combine at least one entry, then we make a new collection
- // and populate it accordingly, and then swap it into place.
+ // We we can combine at least one entry, then we make a new collection and
+ // populate it accordingly, and then swap it into place.
if (can_combine) {
Collection minimal_ranges;
for (pos = m_entries.begin(), end = m_entries.end(), prev = end;
@@ -699,9 +698,9 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
- // release or reduce the memory once it has been allocated/reserved.
+ // Use the swap technique in case our new vector is much smaller. We must
+ // swap when using the STL because std::vector objects never release or
+ // reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
}
@@ -828,8 +827,8 @@ protected:
Collection m_entries;
};
-// Same as RangeDataArray, but uses std::vector as to not
-// require static storage of N items in the class itself
+// Same as RangeDataArray, but uses std::vector as to not require static
+// storage of N items in the class itself
template <typename B, typename S, typename T> class RangeDataVector {
public:
typedef RangeData<B, S, T> Entry;
@@ -878,8 +877,8 @@ public:
}
}
- // We we can combine at least one entry, then we make a new collection
- // and populate it accordingly, and then swap it into place.
+ // We we can combine at least one entry, then we make a new collection and
+ // populate it accordingly, and then swap it into place.
if (can_combine) {
Collection minimal_ranges;
for (pos = m_entries.begin(), end = m_entries.end(), prev = end;
@@ -889,15 +888,15 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
- // release or reduce the memory once it has been allocated/reserved.
+ // Use the swap technique in case our new vector is much smaller. We must
+ // swap when using the STL because std::vector objects never release or
+ // reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
}
- // Calculate the byte size of ranges with zero byte sizes by finding
- // the next entry with a base address > the current base address
+ // Calculate the byte size of ranges with zero byte sizes by finding the next
+ // entry with a base address > the current base address
void CalculateSizesOfZeroByteSizeRanges(S full_size = 0) {
#ifdef ASSERT_RANGEMAP_ARE_SORTED
assert(IsSorted());
@@ -907,9 +906,9 @@ public:
typename Collection::iterator next;
for (pos = m_entries.begin(), end = m_entries.end(); pos != end; ++pos) {
if (pos->GetByteSize() == 0) {
- // Watch out for multiple entries with same address and make sure
- // we find an entry that is greater than the current base address
- // before we use that for the size
+ // Watch out for multiple entries with same address and make sure we
+ // find an entry that is greater than the current base address before
+ // we use that for the size
auto curr_base = pos->GetRangeBase();
for (next = pos + 1; next != end; ++next) {
auto next_base = next->GetRangeBase();
@@ -1060,8 +1059,8 @@ public:
}
// This method will return the entry that contains the given address, or the
- // entry following that address. If you give it an address of 0 and the first
- // entry starts at address 0x100, you will get the entry at 0x100.
+ // entry following that address. If you give it an address of 0 and the
+ // first entry starts at address 0x100, you will get the entry at 0x100.
//
// For most uses, FindEntryThatContains is the correct one to use, this is a
// less commonly needed behavior. It was added for core file memory regions,
@@ -1102,8 +1101,8 @@ protected:
//----------------------------------------------------------------------
// A simple range with data class where you get to define the type of
-// the range base "B", the type used for the range byte size "S", and
-// the type for the associated data "T".
+// the range base "B", the type used for the range byte size "S", and the type
+// for the associated data "T".
//----------------------------------------------------------------------
template <typename B, typename T> struct AddressData {
typedef B BaseType;
diff --git a/include/lldb/Core/RegisterValue.h b/include/lldb/Core/RegisterValue.h
index a45db00fb76e..b369c3dff9a9 100644
--- a/include/lldb/Core/RegisterValue.h
+++ b/include/lldb/Core/RegisterValue.h
@@ -35,7 +35,7 @@ namespace lldb_private {
class RegisterValue {
public:
- enum { kMaxRegisterByteSize = 32u };
+ enum { kMaxRegisterByteSize = 64u };
enum Type {
eTypeInvalid,
@@ -95,14 +95,13 @@ public:
bool GetData(DataExtractor &data) const;
- // Copy the register value from this object into a buffer in "dst"
- // and obey the "dst_byte_order" when copying the data. Also watch out
- // in case "dst_len" is longer or shorter than the register value
- // described by "reg_info" and only copy the least significant bytes
- // of the register value, or pad the destination with zeroes if the
- // register byte size is shorter that "dst_len" (all while correctly
- // abiding the "dst_byte_order"). Returns the number of bytes copied
- // into "dst".
+ // Copy the register value from this object into a buffer in "dst" and obey
+ // the "dst_byte_order" when copying the data. Also watch out in case
+ // "dst_len" is longer or shorter than the register value described by
+ // "reg_info" and only copy the least significant bytes of the register
+ // value, or pad the destination with zeroes if the register byte size is
+ // shorter that "dst_len" (all while correctly abiding the "dst_byte_order").
+ // Returns the number of bytes copied into "dst".
uint32_t GetAsMemoryData(const RegisterInfo *reg_info, void *dst,
uint32_t dst_len, lldb::ByteOrder dst_byte_order,
Status &error) const;
@@ -249,12 +248,6 @@ public:
Status SetValueFromData(const RegisterInfo *reg_info, DataExtractor &data,
lldb::offset_t offset, bool partial_data_ok);
- // The default value of 0 for reg_name_right_align_at means no alignment at
- // all.
- bool Dump(Stream *s, const RegisterInfo *reg_info, bool prefix_with_name,
- bool prefix_with_alt_name, lldb::Format format,
- uint32_t reg_name_right_align_at = 0) const;
-
const void *GetBytes() const;
lldb::ByteOrder GetByteOrder() const {
diff --git a/include/lldb/Core/STLUtils.h b/include/lldb/Core/STLUtils.h
index d851ed5464c9..55f1ac05c975 100644
--- a/include/lldb/Core/STLUtils.h
+++ b/include/lldb/Core/STLUtils.h
@@ -40,8 +40,8 @@ struct CStringEqualBinaryPredicate {
};
//----------------------------------------------------------------------
-// Templated type for finding an entry in a std::map<F,S> whose value
-// is equal to something
+// Templated type for finding an entry in a std::map<F,S> whose value is equal
+// to something
//----------------------------------------------------------------------
template <class F, class S> class ValueEquals {
public:
diff --git a/include/lldb/Core/Scalar.h b/include/lldb/Core/Scalar.h
index 943398b88020..40671a242ec3 100644
--- a/include/lldb/Core/Scalar.h
+++ b/include/lldb/Core/Scalar.h
@@ -36,9 +36,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
// A class designed to hold onto values and their corresponding types.
-// Operators are defined and Scalar objects will correctly promote
-// their types and values before performing these operations. Type
-// promotion currently follows the ANSI C type promotion rules.
+// Operators are defined and Scalar objects will correctly promote their types
+// and values before performing these operations. Type promotion currently
+// follows the ANSI C type promotion rules.
//----------------------------------------------------------------------
class Scalar {
public:
@@ -50,13 +50,13 @@ public:
e_ulong,
e_slonglong,
e_ulonglong,
- e_float,
- e_double,
- e_long_double,
- e_uint128,
e_sint128,
+ e_uint128,
+ e_sint256,
e_uint256,
- e_sint256
+ e_float,
+ e_double,
+ e_long_double
};
//------------------------------------------------------------------
@@ -165,8 +165,6 @@ public:
bool Promote(Scalar::Type type);
- bool Cast(Scalar::Type type);
-
bool MakeSigned();
bool MakeUnsigned();
@@ -182,10 +180,10 @@ public:
static Scalar::Type GetValueTypeForFloatWithByteSize(size_t byte_size);
//----------------------------------------------------------------------
- // All operators can benefits from the implicit conversions that will
- // happen automagically by the compiler, so no temporary objects will
- // need to be created. As a result, we currently don't need a variety of
- // overloaded set value accessors.
+ // All operators can benefits from the implicit conversions that will happen
+ // automagically by the compiler, so no temporary objects will need to be
+ // created. As a result, we currently don't need a variety of overloaded set
+ // value accessors.
//----------------------------------------------------------------------
Scalar &operator=(const int i);
Scalar &operator=(unsigned int v);
@@ -204,27 +202,27 @@ public:
Scalar &operator&=(const Scalar &rhs);
//----------------------------------------------------------------------
- // Shifts the current value to the right without maintaining the current
- // sign of the value (if it is signed).
+ // Shifts the current value to the right without maintaining the current sign
+ // of the value (if it is signed).
//----------------------------------------------------------------------
bool ShiftRightLogical(const Scalar &rhs); // Returns true on success
//----------------------------------------------------------------------
- // Takes the absolute value of the current value if it is signed, else
- // the value remains unchanged.
- // Returns false if the contained value has a void type.
+ // Takes the absolute value of the current value if it is signed, else the
+ // value remains unchanged. Returns false if the contained value has a void
+ // type.
//----------------------------------------------------------------------
bool AbsoluteValue(); // Returns true on success
//----------------------------------------------------------------------
- // Negates the current value (even for unsigned values).
- // Returns false if the contained value has a void type.
+ // Negates the current value (even for unsigned values). Returns false if the
+ // contained value has a void type.
//----------------------------------------------------------------------
bool UnaryNegate(); // Returns true on success
//----------------------------------------------------------------------
- // Inverts all bits in the current value as long as it isn't void or
- // a float/double/long double type.
- // Returns false if the contained value has a void/float/double/long
- // double type, else the value is inverted and true is returned.
+ // Inverts all bits in the current value as long as it isn't void or a
+ // float/double/long double type. Returns false if the contained value has a
+ // void/float/double/long double type, else the value is inverted and true is
+ // returned.
//----------------------------------------------------------------------
bool OnesComplement(); // Returns true on success
@@ -234,9 +232,9 @@ public:
Scalar::Type GetType() const { return m_type; }
//----------------------------------------------------------------------
- // Returns a casted value of the current contained data without
- // modifying the current value. FAIL_VALUE will be returned if the type
- // of the value is void or invalid.
+ // Returns a casted value of the current contained data without modifying the
+ // current value. FAIL_VALUE will be returned if the type of the value is
+ // void or invalid.
//----------------------------------------------------------------------
int SInt(int fail_value = 0) const;
@@ -344,8 +342,8 @@ private:
};
//----------------------------------------------------------------------
-// Split out the operators into a format where the compiler will be able
-// to implicitly convert numbers into Scalar objects.
+// Split out the operators into a format where the compiler will be able to
+// implicitly convert numbers into Scalar objects.
//
// This allows code like:
// Scalar two(2);
diff --git a/include/lldb/Core/SearchFilter.h b/include/lldb/Core/SearchFilter.h
index 5861afc801cb..2e641983dc73 100644
--- a/include/lldb/Core/SearchFilter.h
+++ b/include/lldb/Core/SearchFilter.h
@@ -52,9 +52,9 @@ class Target;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Searcher SearchFilter.h "lldb/Core/SearchFilter.h"
-/// @brief Class that is driven by the SearchFilter to search the
-/// SymbolContext space of the target program.
+/// @class Searcher SearchFilter.h "lldb/Core/SearchFilter.h" Class that is
+/// driven by the SearchFilter to search the SymbolContext space of the target
+/// program.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -99,10 +99,10 @@ public:
};
//----------------------------------------------------------------------
-/// @class SearchFilter SearchFilter.h "lldb/Core/SearchFilter.h"
-/// @brief Class descends through the SymbolContext space of the target,
-/// applying a filter at each stage till it reaches the depth specified by
-/// the GetDepth method of the searcher, and calls its callback at that point.
+/// @class SearchFilter SearchFilter.h "lldb/Core/SearchFilter.h" Class
+/// descends through the SymbolContext space of the target, applying a filter
+/// at each stage till it reaches the depth specified by the GetDepth method
+/// of the searcher, and calls its callback at that point.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -110,15 +110,12 @@ public:
/// Provides the callback and search depth for the SearchFilter search.
///
/// The search is done by cooperation between the search filter and the
-/// searcher.
-/// The search filter does the heavy work of recursing through the SymbolContext
-/// space of the target program's symbol space. The Searcher specifies the
-/// depth
-/// at which it wants its callback to be invoked. Note that since the
-/// resolution
-/// of the Searcher may be greater than that of the SearchFilter, before the
-/// Searcher qualifies an address it should pass it to "AddressPasses."
-/// The default implementation is "Everything Passes."
+/// searcher. The search filter does the heavy work of recursing through the
+/// SymbolContext space of the target program's symbol space. The Searcher
+/// specifies the depth at which it wants its callback to be invoked. Note
+/// that since the resolution of the Searcher may be greater than that of the
+/// SearchFilter, before the Searcher qualifies an address it should pass it
+/// to "AddressPasses." The default implementation is "Everything Passes."
//----------------------------------------------------------------------
class SearchFilter {
@@ -172,8 +169,8 @@ public:
virtual bool AddressPasses(Address &addr);
//------------------------------------------------------------------
- /// Call this method with a FileSpec to see if \a file spec passes the filter
- /// as the name of a compilation unit.
+ /// Call this method with a FileSpec to see if \a file spec passes the
+ /// filter as the name of a compilation unit.
///
/// @param[in] fileSpec
/// The file spec to check against the filter.
@@ -218,11 +215,10 @@ public:
virtual void SearchInModuleList(Searcher &searcher, ModuleList &modules);
//------------------------------------------------------------------
- /// This determines which items are REQUIRED for the filter to pass.
- /// For instance, if you are filtering by Compilation Unit, obviously
- /// symbols that have no compilation unit can't pass So return
- /// eSymbolContextCU
- /// and search callbacks can then short cut the search to avoid looking at
+ /// This determines which items are REQUIRED for the filter to pass. For
+ /// instance, if you are filtering by Compilation Unit, obviously symbols
+ /// that have no compilation unit can't pass So return eSymbolContextCU and
+ /// search callbacks can then short cut the search to avoid looking at
/// things that obviously won't pass.
///
/// @return
@@ -303,8 +299,7 @@ protected:
OptionNames name, FileSpecList &file_list);
// These are utility functions to assist with the search iteration. They are
- // used by the
- // default Search method.
+ // used by the default Search method.
Searcher::CallbackReturn DoModuleIteration(const SymbolContext &context,
Searcher &searcher);
@@ -333,9 +328,9 @@ private:
//----------------------------------------------------------------------
/// @class SearchFilterForUnconstrainedSearches SearchFilter.h
-/// "lldb/Core/SearchFilter.h"
-/// @brief This is a SearchFilter that searches through all modules. It also
-/// consults the Target::ModuleIsExcludedForUnconstrainedSearches.
+/// "lldb/Core/SearchFilter.h" This is a SearchFilter that searches through
+/// all modules. It also consults the
+/// Target::ModuleIsExcludedForUnconstrainedSearches.
//----------------------------------------------------------------------
class SearchFilterForUnconstrainedSearches : public SearchFilter {
public:
@@ -360,8 +355,8 @@ protected:
};
//----------------------------------------------------------------------
-/// @class SearchFilterByModule SearchFilter.h "lldb/Core/SearchFilter.h"
-/// @brief This is a SearchFilter that restricts the search to a given module.
+/// @class SearchFilterByModule SearchFilter.h "lldb/Core/SearchFilter.h" This
+/// is a SearchFilter that restricts the search to a given module.
//----------------------------------------------------------------------
class SearchFilterByModule : public SearchFilter {
diff --git a/include/lldb/Core/Section.h b/include/lldb/Core/Section.h
index 2d5d6443ba7f..8e275ce3199e 100644
--- a/include/lldb/Core/Section.h
+++ b/include/lldb/Core/Section.h
@@ -182,6 +182,8 @@ public:
lldb::SectionType GetType() const { return m_type; }
+ const char *GetTypeAsCString() const;
+
lldb::SectionSP GetParent() const { return m_parent_wp.lock(); }
bool IsThreadSpecific() const { return m_thread_specific; }
@@ -270,10 +272,9 @@ protected:
SectionList m_children; // Child sections
bool m_fake : 1, // If true, then this section only can contain the address if
// one of its
- // children contains an address. This allows for gaps between the children
- // that are contained in the address range for this section, but do not
- // produce
- // hits unless the children contain the address.
+ // children contains an address. This allows for gaps between the
+ // children that are contained in the address range for this section, but
+ // do not produce hits unless the children contain the address.
m_encrypted : 1, // Set to true if the contents are encrypted
m_thread_specific : 1, // This section is thread specific
m_readable : 1, // If this section has read permissions
diff --git a/include/lldb/Core/SourceManager.h b/include/lldb/Core/SourceManager.h
index 053badf64ddc..ef652531244d 100644
--- a/include/lldb/Core/SourceManager.h
+++ b/include/lldb/Core/SourceManager.h
@@ -106,9 +106,8 @@ public:
#ifndef SWIG
// The SourceFileCache class separates the source manager from the cache of
- // source files, so the
- // cache can be stored in the Debugger, but the source managers can be per
- // target.
+ // source files, so the cache can be stored in the Debugger, but the source
+ // managers can be per target.
class SourceFileCache {
public:
SourceFileCache() = default;
diff --git a/include/lldb/Core/StreamBuffer.h b/include/lldb/Core/StreamBuffer.h
index 3b18573021b3..307dc7e18a5e 100644
--- a/include/lldb/Core/StreamBuffer.h
+++ b/include/lldb/Core/StreamBuffer.h
@@ -39,9 +39,8 @@ public:
void Clear() { m_packet.clear(); }
// Beware, this might not be NULL terminated as you can expect from
- // StringString as there may be random bits in the llvm::SmallVector. If
- // you are using this class to create a C string, be sure the call PutChar
- // ('\0')
+ // StringString as there may be random bits in the llvm::SmallVector. If you
+ // are using this class to create a C string, be sure the call PutChar ('\0')
// after you have created your string, or use StreamString.
const char *GetData() const { return m_packet.data(); }
diff --git a/include/lldb/Core/ThreadSafeDenseSet.h b/include/lldb/Core/ThreadSafeDenseSet.h
index 49c55e96abe1..44ec2464385f 100644
--- a/include/lldb/Core/ThreadSafeDenseSet.h
+++ b/include/lldb/Core/ThreadSafeDenseSet.h
@@ -46,7 +46,7 @@ public:
}
void Clear() {
- stds::lock_guard<_MutexType> guard(m_mutex);
+ std::lock_guard<_MutexType> guard(m_mutex);
m_set.clear();
}
diff --git a/include/lldb/Core/ThreadSafeValue.h b/include/lldb/Core/ThreadSafeValue.h
index 60eaf91c4f02..10ef8fa41d0c 100644
--- a/include/lldb/Core/ThreadSafeValue.h
+++ b/include/lldb/Core/ThreadSafeValue.h
@@ -17,6 +17,7 @@
// Other libraries and framework includes
// Project includes
+#include "lldb/lldb-defines.h"
namespace lldb_private {
diff --git a/include/lldb/Core/UniqueCStringMap.h b/include/lldb/Core/UniqueCStringMap.h
index e8c6c7c1353e..fe3e831a6045 100644
--- a/include/lldb/Core/UniqueCStringMap.h
+++ b/include/lldb/Core/UniqueCStringMap.h
@@ -25,11 +25,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
// Templatized uniqued string map.
//
-// This map is useful for mapping unique C string names to values of
-// type T. Each "const char *" name added must be unique for a given
+// This map is useful for mapping unique C string names to values of type T.
+// Each "const char *" name added must be unique for a given
// C string value. ConstString::GetCString() can provide such strings.
-// Any other string table that has guaranteed unique values can also
-// be used.
+// Any other string table that has guaranteed unique values can also be used.
//----------------------------------------------------------------------
template <typename T> class UniqueCStringMap {
public:
@@ -51,9 +50,9 @@ public:
};
//------------------------------------------------------------------
- // Call this function multiple times to add a bunch of entries to
- // this map, then later call UniqueCStringMap<T>::Sort() before doing
- // any searches by name.
+ // Call this function multiple times to add a bunch of entries to this map,
+ // then later call UniqueCStringMap<T>::Sort() before doing any searches by
+ // name.
//------------------------------------------------------------------
void Append(ConstString unique_cstr, const T &value) {
m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
@@ -64,8 +63,8 @@ public:
void Clear() { m_map.clear(); }
//------------------------------------------------------------------
- // Call this function to always keep the map sorted when putting
- // entries into the map.
+ // Call this function to always keep the map sorted when putting entries into
+ // the map.
//------------------------------------------------------------------
void Insert(ConstString unique_cstr, const T &value) {
typename UniqueCStringMap<T>::Entry e(unique_cstr, value);
@@ -79,8 +78,8 @@ public:
//------------------------------------------------------------------
// Get an entries by index in a variety of forms.
//
- // The caller is responsible for ensuring that the collection does
- // not change during while using the returned values.
+ // The caller is responsible for ensuring that the collection does not change
+ // during while using the returned values.
//------------------------------------------------------------------
bool GetValueAtIndex(uint32_t idx, T &value) const {
if (idx < m_map.size()) {
@@ -94,12 +93,12 @@ public:
return m_map[idx].cstring;
}
- // Use this function if you have simple types in your map that you
- // can easily copy when accessing values by index.
+ // Use this function if you have simple types in your map that you can easily
+ // copy when accessing values by index.
T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
- // Use this function if you have complex types in your map that you
- // don't want to copy when accessing values by index.
+ // Use this function if you have complex types in your map that you don't
+ // want to copy when accessing values by index.
const T &GetValueRefAtIndexUnchecked(uint32_t idx) const {
return m_map[idx].value;
}
@@ -111,8 +110,8 @@ public:
//------------------------------------------------------------------
// Find the value for the unique string in the map.
//
- // Return the value for \a unique_cstr if one is found, return
- // \a fail_value otherwise. This method works well for simple type
+ // Return the value for \a unique_cstr if one is found, return \a fail_value
+ // otherwise. This method works well for simple type
// T values and only if there is a sensible failure value that can
// be returned and that won't match any existing values.
//------------------------------------------------------------------
@@ -128,11 +127,11 @@ public:
}
//------------------------------------------------------------------
- // Get a pointer to the first entry that matches "name". nullptr will
- // be returned if there is no entry that matches "name".
+ // Get a pointer to the first entry that matches "name". nullptr will be
+ // returned if there is no entry that matches "name".
//
- // The caller is responsible for ensuring that the collection does
- // not change during while using the returned pointer.
+ // The caller is responsible for ensuring that the collection does not change
+ // during while using the returned pointer.
//------------------------------------------------------------------
const Entry *FindFirstValueForName(ConstString unique_cstr) const {
Entry search_entry(unique_cstr);
@@ -144,12 +143,12 @@ public:
}
//------------------------------------------------------------------
- // Get a pointer to the next entry that matches "name" from a
- // previously returned Entry pointer. nullptr will be returned if there
- // is no subsequent entry that matches "name".
+ // Get a pointer to the next entry that matches "name" from a previously
+ // returned Entry pointer. nullptr will be returned if there is no subsequent
+ // entry that matches "name".
//
- // The caller is responsible for ensuring that the collection does
- // not change during while using the returned pointer.
+ // The caller is responsible for ensuring that the collection does not change
+ // during while using the returned pointer.
//------------------------------------------------------------------
const Entry *FindNextValueForName(const Entry *entry_ptr) const {
if (!m_map.empty()) {
@@ -204,16 +203,15 @@ public:
bool IsEmpty() const { return m_map.empty(); }
//------------------------------------------------------------------
- // Reserve memory for at least "n" entries in the map. This is
- // useful to call when you know you will be adding a lot of entries
- // using UniqueCStringMap::Append() (which should be followed by a
- // call to UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
+ // Reserve memory for at least "n" entries in the map. This is useful to call
+ // when you know you will be adding a lot of entries using
+ // UniqueCStringMap::Append() (which should be followed by a call to
+ // UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
//------------------------------------------------------------------
void Reserve(size_t n) { m_map.reserve(n); }
//------------------------------------------------------------------
- // Sort the unsorted contents in this map. A typical code flow would
- // be:
+ // Sort the unsorted contents in this map. A typical code flow would be:
// size_t approximate_num_entries = ....
// UniqueCStringMap<uint32_t> my_map;
// my_map.Reserve (approximate_num_entries);
@@ -226,12 +224,11 @@ public:
void Sort() { std::sort(m_map.begin(), m_map.end()); }
//------------------------------------------------------------------
- // Since we are using a vector to contain our items it will always
- // double its memory consumption as things are added to the vector,
- // so if you intend to keep a UniqueCStringMap around and have
- // a lot of entries in the map, you will want to call this function
- // to create a new vector and copy _only_ the exact size needed as
- // part of the finalization of the string map.
+ // Since we are using a vector to contain our items it will always double its
+ // memory consumption as things are added to the vector, so if you intend to
+ // keep a UniqueCStringMap around and have a lot of entries in the map, you
+ // will want to call this function to create a new vector and copy _only_ the
+ // exact size needed as part of the finalization of the string map.
//------------------------------------------------------------------
void SizeToFit() {
if (m_map.size() < m_map.capacity()) {
diff --git a/include/lldb/Core/UserSettingsController.h b/include/lldb/Core/UserSettingsController.h
index 67bc9b2c0713..aefd42e751ab 100644
--- a/include/lldb/Core/UserSettingsController.h
+++ b/include/lldb/Core/UserSettingsController.h
@@ -49,8 +49,8 @@ public:
virtual ~Properties() {}
virtual lldb::OptionValuePropertiesSP GetValueProperties() const {
- // This function is virtual in case subclasses want to lazily
- // implement creating the properties.
+ // This function is virtual in case subclasses want to lazily implement
+ // creating the properties.
return m_collection_sp;
}
@@ -82,16 +82,11 @@ public:
// We sometimes need to introduce a setting to enable experimental features,
// but then we don't want the setting for these to cause errors when the
- // setting
- // goes away. Add a sub-topic of the settings using this experimental name,
- // and
- // two things will happen. One is that settings that don't find the name will
- // not
- // be treated as errors. Also, if you decide to keep the settings just move
- // them into
- // the containing properties, and we will auto-forward the experimental
- // settings to the
- // real one.
+ // setting goes away. Add a sub-topic of the settings using this
+ // experimental name, and two things will happen. One is that settings that
+ // don't find the name will not be treated as errors. Also, if you decide to
+ // keep the settings just move them into the containing properties, and we
+ // will auto-forward the experimental settings to the real one.
static const char *GetExperimentalSettingsName();
static bool IsSettingExperimental(llvm::StringRef setting);
diff --git a/include/lldb/Core/Value.h b/include/lldb/Core/Value.h
index 678b56fc49f5..801e818c6f5c 100644
--- a/include/lldb/Core/Value.h
+++ b/include/lldb/Core/Value.h
@@ -48,8 +48,8 @@ namespace lldb_private {
class Value {
public:
- // Values Less than zero are an error, greater than or equal to zero
- // returns what the Scalar result is.
+ // Values Less than zero are an error, greater than or equal to zero returns
+ // what the Scalar result is.
enum ValueType {
// m_value contains...
// ============================
@@ -107,8 +107,7 @@ public:
byte_order != lldb::eByteOrderInvalid);
}
// Casts a vector, if valid, to an unsigned int of matching or largest
- // supported size.
- // Truncates to the beginning of the vector if required.
+ // supported size. Truncates to the beginning of the vector if required.
// Returns a default constructed Scalar if the Vector data is internally
// inconsistent.
llvm::APInt rhs = llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128,
@@ -229,6 +228,9 @@ public:
static const char *GetContextTypeAsCString(ContextType context_type);
+ /// Convert this value's file address to a load address, if possible.
+ void ConvertToLoadAddress(Module *module, Target *target);
+
bool GetData(DataExtractor &data);
void Clear();
diff --git a/include/lldb/Core/ValueObject.h b/include/lldb/Core/ValueObject.h
index fa1d14870b05..fddc06413196 100644
--- a/include/lldb/Core/ValueObject.h
+++ b/include/lldb/Core/ValueObject.h
@@ -11,7 +11,6 @@
#define liblldb_ValueObject_h_
#include "lldb/Core/Value.h"
-#include "lldb/DataFormatters/DumpValueObjectOptions.h" // for DumpValueObj...
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/Type.h" // for TypeImpl
#include "lldb/Target/ExecutionContext.h"
@@ -45,6 +44,9 @@ namespace lldb_private {
class Declaration;
}
namespace lldb_private {
+class DumpValueObjectOptions;
+}
+namespace lldb_private {
class EvaluateExpressionOptions;
}
namespace lldb_private {
@@ -286,10 +288,10 @@ public:
return m_exe_ctx_ref;
}
- // Set the EvaluationPoint to the values in exe_scope,
- // Return true if the Evaluation Point changed.
- // Since the ExecutionContextScope is always going to be valid currently,
- // the Updated Context will also always be valid.
+ // Set the EvaluationPoint to the values in exe_scope, Return true if the
+ // Evaluation Point changed. Since the ExecutionContextScope is always
+ // going to be valid currently, the Updated Context will also always be
+ // valid.
// bool
// SetContext (ExecutionContextScope *exe_scope);
@@ -327,8 +329,7 @@ public:
void SetInvalid() {
// Use the stop id to mark us as invalid, leave the thread id and the
- // stack id around for logging and
- // history purposes.
+ // stack id around for logging and history purposes.
m_mod_id.SetInvalid();
// Can't update an invalid state.
@@ -464,17 +465,16 @@ public:
virtual bool SetValueFromCString(const char *value_str, Status &error);
- // Return the module associated with this value object in case the
- // value is from an executable file and might have its data in
- // sections of the file. This can be used for variables.
+ // Return the module associated with this value object in case the value is
+ // from an executable file and might have its data in sections of the file.
+ // This can be used for variables.
virtual lldb::ModuleSP GetModule();
ValueObject *GetRoot();
// Given a ValueObject, loop over itself and its parent, and its parent's
- // parent, ..
- // until either the given callback returns false, or you end up at a null
- // pointer
+ // parent, .. until either the given callback returns false, or you end up at
+ // a null pointer
ValueObject *FollowParentChain(std::function<bool(ValueObject *)>);
virtual bool GetDeclaration(Declaration &decl);
@@ -517,9 +517,9 @@ public:
virtual bool ResolveValue(Scalar &scalar);
- // return 'false' whenever you set the error, otherwise
- // callers may assume true means everything is OK - this will
- // break breakpoint conditions among potentially a few others
+ // return 'false' whenever you set the error, otherwise callers may assume
+ // true means everything is OK - this will break breakpoint conditions among
+ // potentially a few others
virtual bool IsLogicalTrue(Status &error);
virtual const char *GetLocationAsCString();
@@ -646,8 +646,8 @@ public:
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
- // The backing bits of this value object were updated, clear any
- // descriptive string, so we know we have to refetch them
+ // The backing bits of this value object were updated, clear any descriptive
+ // string, so we know we have to refetch them
virtual void ValueUpdated() {
ClearUserVisibleData(eClearUserVisibleDataItemsValue |
eClearUserVisibleDataItemsSummary |
@@ -694,9 +694,8 @@ public:
lldb::ValueObjectSP Persist();
- // returns true if this is a char* or a char[]
- // if it is a char* and check_pointer is true,
- // it also checks that the pointer is valid
+ // returns true if this is a char* or a char[] if it is a char* and
+ // check_pointer is true, it also checks that the pointer is valid
bool IsCStringContainer(bool check_pointer = false);
std::pair<size_t, bool>
@@ -776,11 +775,9 @@ public:
}
// Use GetParent for display purposes, but if you want to tell the parent to
- // update itself
- // then use m_parent. The ValueObjectDynamicValue's parent is not the correct
- // parent for
- // displaying, they are really siblings, so for display it needs to route
- // through to its grandparent.
+ // update itself then use m_parent. The ValueObjectDynamicValue's parent is
+ // not the correct parent for displaying, they are really siblings, so for
+ // display it needs to route through to its grandparent.
virtual ValueObject *GetParent() { return m_parent; }
virtual const ValueObject *GetParent() const { return m_parent; }
@@ -904,9 +901,9 @@ protected:
ValueObjectManager *m_manager; // This object is managed by the root object
// (any ValueObject that gets created
// without a parent.) The manager gets passed through all the generations of
- // dependent objects, and will keep the whole cluster of objects alive as long
- // as a shared pointer to any of them has been handed out. Shared pointers to
- // value objects must always be made with the GetSP method.
+ // dependent objects, and will keep the whole cluster of objects alive as
+ // long as a shared pointer to any of them has been handed out. Shared
+ // pointers to value objects must always be made with the GetSP method.
ChildrenManager m_children;
std::map<ConstString, ValueObject *> m_synthetic_children;
@@ -954,21 +951,19 @@ protected:
// Constructors and Destructors
//------------------------------------------------------------------
- // Use the no-argument constructor to make a constant variable object (with no
- // ExecutionContextScope.)
+ // Use the no-argument constructor to make a constant variable object (with
+ // no ExecutionContextScope.)
ValueObject();
// Use this constructor to create a "root variable object". The ValueObject
- // will be locked to this context
- // through-out its lifespan.
+ // will be locked to this context through-out its lifespan.
ValueObject(ExecutionContextScope *exe_scope,
AddressType child_ptr_or_ref_addr_type = eAddressTypeLoad);
// Use this constructor to create a ValueObject owned by another ValueObject.
- // It will inherit the ExecutionContext
- // of its parent.
+ // It will inherit the ExecutionContext of its parent.
ValueObject(ValueObject &parent);
@@ -990,8 +985,8 @@ protected:
virtual void CalculateSyntheticValue(bool use_synthetic = true);
- // Should only be called by ValueObject::GetChildAtIndex()
- // Returns a ValueObject managed by this ValueObject's manager.
+ // Should only be called by ValueObject::GetChildAtIndex() Returns a
+ // ValueObject managed by this ValueObject's manager.
virtual ValueObject *CreateChildAtIndex(size_t idx,
bool synthetic_array_member,
int32_t synthetic_index);
@@ -1043,8 +1038,9 @@ private:
//------------------------------------------------------------------------------
// A value object manager class that is seeded with the static variable value
// and it vends the user facing value object. If the type is dynamic it can
-// vend the dynamic type. If this user type also has a synthetic type associated
-// with it, it will vend the synthetic type. The class watches the process' stop
+// vend the dynamic type. If this user type also has a synthetic type
+// associated with it, it will vend the synthetic type. The class watches the
+// process' stop
// ID and will update the user type when needed.
//------------------------------------------------------------------------------
class ValueObjectManager {
diff --git a/include/lldb/Core/ValueObjectSyntheticFilter.h b/include/lldb/Core/ValueObjectSyntheticFilter.h
index e32e14030418..b3af6c0ae827 100644
--- a/include/lldb/Core/ValueObjectSyntheticFilter.h
+++ b/include/lldb/Core/ValueObjectSyntheticFilter.h
@@ -39,9 +39,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
// A ValueObject that obtains its children from some source other than
// real information
-// This is currently used to implement Python-based children and filters
-// but you can bind it to any source of synthetic information and have
-// it behave accordingly
+// This is currently used to implement Python-based children and filters but
+// you can bind it to any source of synthetic information and have it behave
+// accordingly
//----------------------------------------------------------------------
class ValueObjectSynthetic : public ValueObject {
public:
diff --git a/include/lldb/DataFormatters/DataVisualization.h b/include/lldb/DataFormatters/DataVisualization.h
index 343099bf2a7b..369fa686a9ff 100644
--- a/include/lldb/DataFormatters/DataVisualization.h
+++ b/include/lldb/DataFormatters/DataVisualization.h
@@ -21,15 +21,14 @@
namespace lldb_private {
-// this class is the high-level front-end of LLDB Data Visualization
-// code in FormatManager.h/cpp is the low-level implementation of this feature
-// clients should refer to this class as the entry-point into the data
-// formatters
+// this class is the high-level front-end of LLDB Data Visualization code in
+// FormatManager.h/cpp is the low-level implementation of this feature clients
+// should refer to this class as the entry-point into the data formatters
// unless they have a good reason to bypass this and go to the backend
class DataVisualization {
public:
- // use this call to force the FM to consider itself updated even when there is
- // no apparent reason for that
+ // use this call to force the FM to consider itself updated even when there
+ // is no apparent reason for that
static void ForceUpdate();
static uint32_t GetCurrentRevision();
diff --git a/include/lldb/DataFormatters/FormatClasses.h b/include/lldb/DataFormatters/FormatClasses.h
index c559c212c2db..458477578d3f 100644
--- a/include/lldb/DataFormatters/FormatClasses.h
+++ b/include/lldb/DataFormatters/FormatClasses.h
@@ -160,8 +160,8 @@ public:
private:
bool m_is_regex;
- // this works better than TypeAndOrName because the latter only wraps a TypeSP
- // whereas TypePair can also be backed by a CompilerType
+ // this works better than TypeAndOrName because the latter only wraps a
+ // TypeSP whereas TypePair can also be backed by a CompilerType
struct TypeOrName {
std::string m_type_name;
TypePair m_type_pair;
diff --git a/include/lldb/DataFormatters/FormatManager.h b/include/lldb/DataFormatters/FormatManager.h
index 924ef0cdf6b4..e973c8b3e849 100644
--- a/include/lldb/DataFormatters/FormatManager.h
+++ b/include/lldb/DataFormatters/FormatManager.h
@@ -33,12 +33,10 @@
namespace lldb_private {
// this file (and its. cpp) contain the low-level implementation of LLDB Data
-// Visualization
-// class DataVisualization is the high-level front-end of this feature
-// clients should refer to that class as the entry-point into the data
-// formatters
-// unless they have a good reason to bypass it and prefer to use this file's
-// objects directly
+// Visualization class DataVisualization is the high-level front-end of this
+// feature clients should refer to that class as the entry-point into the data
+// formatters unless they have a good reason to bypass it and prefer to use
+// this file's objects directly
class FormatManager : public IFormatChangeListener {
typedef FormatMap<ConstString, TypeSummaryImpl> NamedSummariesMap;
@@ -175,24 +173,22 @@ public:
static const char *GetFormatAsCString(lldb::Format format);
- // if the user tries to add formatters for, say, "struct Foo"
- // those will not match any type because of the way we strip qualifiers from
- // typenames
- // this method looks for the case where the user is adding a
- // "class","struct","enum" or "union" Foo
- // and strips the unnecessary qualifier
+ // if the user tries to add formatters for, say, "struct Foo" those will not
+ // match any type because of the way we strip qualifiers from typenames this
+ // method looks for the case where the user is adding a
+ // "class","struct","enum" or "union" Foo and strips the unnecessary
+ // qualifier
static ConstString GetValidTypeName(const ConstString &type);
// when DataExtractor dumps a vectorOfT, it uses a predefined format for each
- // item
- // this method returns it, or eFormatInvalid if vector_format is not a
+ // item this method returns it, or eFormatInvalid if vector_format is not a
// vectorOf
static lldb::Format GetSingleItemFormat(lldb::Format vector_format);
- // this returns true if the ValueObjectPrinter is *highly encouraged*
- // to actually represent this ValueObject in one-liner format
- // If this object has a summary formatter, however, we should not
- // try and do one-lining, just let the summary do the right thing
+ // this returns true if the ValueObjectPrinter is *highly encouraged* to
+ // actually represent this ValueObject in one-liner format If this object has
+ // a summary formatter, however, we should not try and do one-lining, just
+ // let the summary do the right thing
bool ShouldPrintAsOneLiner(ValueObject &valobj);
void Changed() override;
@@ -249,15 +245,12 @@ private:
TypeCategoryMap &GetCategories() { return m_categories_map; }
- // These functions are meant to initialize formatters that are very
- // low-level/global in nature
- // and do not naturally belong in any language. The intent is that most
- // formatters go in
- // language-specific categories. Eventually, the runtimes should also be
- // allowed to vend their
- // own formatters, and then one could put formatters that depend on specific
- // library load events
- // in the language runtimes, on an as-needed basis
+ // These functions are meant to initialize formatters that are very low-
+ // level/global in nature and do not naturally belong in any language. The
+ // intent is that most formatters go in language-specific categories.
+ // Eventually, the runtimes should also be allowed to vend their own
+ // formatters, and then one could put formatters that depend on specific
+ // library load events in the language runtimes, on an as-needed basis
void LoadSystemFormatters();
void LoadVectorFormatters();
diff --git a/include/lldb/DataFormatters/FormattersContainer.h b/include/lldb/DataFormatters/FormattersContainer.h
index 2df5bf4efcfb..df88e88011fe 100644
--- a/include/lldb/DataFormatters/FormattersContainer.h
+++ b/include/lldb/DataFormatters/FormattersContainer.h
@@ -43,12 +43,10 @@ public:
virtual uint32_t GetCurrentRevision() = 0;
};
-// if the user tries to add formatters for, say, "struct Foo"
-// those will not match any type because of the way we strip qualifiers from
-// typenames
-// this method looks for the case where the user is adding a
-// "class","struct","enum" or "union" Foo
-// and strips the unnecessary qualifier
+// if the user tries to add formatters for, say, "struct Foo" those will not
+// match any type because of the way we strip qualifiers from typenames this
+// method looks for the case where the user is adding a "class","struct","enum"
+// or "union" Foo and strips the unnecessary qualifier
static inline ConstString GetValidTypeName_Impl(const ConstString &type) {
if (type.IsEmpty())
return type;
diff --git a/include/lldb/DataFormatters/StringPrinter.h b/include/lldb/DataFormatters/StringPrinter.h
index 8d4a099fbec9..18207921bb71 100644
--- a/include/lldb/DataFormatters/StringPrinter.h
+++ b/include/lldb/DataFormatters/StringPrinter.h
@@ -266,8 +266,7 @@ public:
// I can't use a std::unique_ptr for this because the Deleter is a template
// argument there
// and I want the same type to represent both pointers I want to free and
- // pointers I don't need
- // to free - which is what this class essentially is
+ // pointers I don't need to free - which is what this class essentially is
// It's very specialized to the needs of this file, and not suggested for
// general use
template <typename T = uint8_t, typename U = char, typename S = size_t>
diff --git a/include/lldb/DataFormatters/TypeFormat.h b/include/lldb/DataFormatters/TypeFormat.h
index 8cfe021da3e0..77e3542f5522 100644
--- a/include/lldb/DataFormatters/TypeFormat.h
+++ b/include/lldb/DataFormatters/TypeFormat.h
@@ -146,10 +146,9 @@ public:
virtual Type GetType() { return Type::eTypeUnknown; }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
- // need to hold on to this for
- // extended periods of time and we trust the ValueObject to stay around for as
- // long as it is required
- // for us to generate its value
+ // need to hold on to this for extended periods of time and we trust the
+ // ValueObject to stay around for as long as it is required for us to
+ // generate its value
virtual bool FormatObject(ValueObject *valobj, std::string &dest) const = 0;
virtual std::string GetDescription() = 0;
diff --git a/include/lldb/DataFormatters/TypeSummary.h b/include/lldb/DataFormatters/TypeSummary.h
index 1bde565aa5c8..17cd61ae8c1e 100644
--- a/include/lldb/DataFormatters/TypeSummary.h
+++ b/include/lldb/DataFormatters/TypeSummary.h
@@ -258,10 +258,9 @@ public:
void SetOptions(uint32_t value) { m_flags.SetValue(value); }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
- // need to hold on to this for
- // extended periods of time and we trust the ValueObject to stay around for as
- // long as it is required
- // for us to generate its summary
+ // need to hold on to this for extended periods of time and we trust the
+ // ValueObject to stay around for as long as it is required for us to
+ // generate its summary
virtual bool FormatObject(ValueObject *valobj, std::string &dest,
const TypeSummaryOptions &options) = 0;
@@ -311,8 +310,8 @@ private:
// summaries implemented via a C++ function
struct CXXFunctionSummaryFormat : public TypeSummaryImpl {
- // we should convert these to SBValue and SBStream if we ever cross
- // the boundary towards the external world
+ // we should convert these to SBValue and SBStream if we ever cross the
+ // boundary towards the external world
typedef std::function<bool(ValueObject &, Stream &,
const TypeSummaryOptions &)>
Callback;
diff --git a/include/lldb/DataFormatters/TypeSynthetic.h b/include/lldb/DataFormatters/TypeSynthetic.h
index 59fb6d3fcdbb..07dacd670a62 100644
--- a/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/include/lldb/DataFormatters/TypeSynthetic.h
@@ -55,34 +55,29 @@ public:
virtual size_t GetIndexOfChildWithName(const ConstString &name) = 0;
// this function is assumed to always succeed and it if fails, the front-end
- // should know to deal
- // with it in the correct way (most probably, by refusing to return any
- // children)
- // the return value of Update() should actually be interpreted as
- // "ValueObjectSyntheticFilter cache is good/bad"
- // if =true, ValueObjectSyntheticFilter is allowed to use the children it
- // fetched previously and cached
- // if =false, ValueObjectSyntheticFilter must throw away its cache, and query
- // again for children
+ // should know to deal with it in the correct way (most probably, by refusing
+ // to return any children) the return value of Update() should actually be
+ // interpreted as "ValueObjectSyntheticFilter cache is good/bad" if =true,
+ // ValueObjectSyntheticFilter is allowed to use the children it fetched
+ // previously and cached if =false, ValueObjectSyntheticFilter must throw
+ // away its cache, and query again for children
virtual bool Update() = 0;
// if this function returns false, then CalculateNumChildren() MUST return 0
- // since UI frontends
- // might validly decide not to inquire for children given a false return value
- // from this call
- // if it returns true, then CalculateNumChildren() can return any number >= 0
- // (0 being valid)
- // it should if at all possible be more efficient than CalculateNumChildren()
+ // since UI frontends might validly decide not to inquire for children given
+ // a false return value from this call if it returns true, then
+ // CalculateNumChildren() can return any number >= 0 (0 being valid) it
+ // should if at all possible be more efficient than CalculateNumChildren()
virtual bool MightHaveChildren() = 0;
// if this function returns a non-null ValueObject, then the returned
- // ValueObject will stand
- // for this ValueObject whenever a "value" request is made to this ValueObject
+ // ValueObject will stand for this ValueObject whenever a "value" request is
+ // made to this ValueObject
virtual lldb::ValueObjectSP GetSyntheticValue() { return nullptr; }
- // if this function returns a non-empty ConstString, then clients are expected
- // to use the return
- // as the name of the type of this ValueObject for display purposes
+ // if this function returns a non-empty ConstString, then clients are
+ // expected to use the return as the name of the type of this ValueObject for
+ // display purposes
virtual ConstString GetSyntheticTypeName() { return ConstString(); }
typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
@@ -212,6 +207,19 @@ public:
return *this;
}
+ bool GetFrontEndWantsDereference() const {
+ return (m_flags & lldb::eTypeOptionFrontEndWantsDereference) ==
+ lldb::eTypeOptionFrontEndWantsDereference;
+ }
+
+ Flags &SetFrontEndWantsDereference(bool value = true) {
+ if (value)
+ m_flags |= lldb::eTypeOptionFrontEndWantsDereference;
+ else
+ m_flags &= ~lldb::eTypeOptionFrontEndWantsDereference;
+ return *this;
+ }
+
uint32_t GetValue() { return m_flags; }
void SetValue(uint32_t value) { m_flags = value; }
@@ -231,6 +239,8 @@ public:
bool SkipsReferences() const { return m_flags.GetSkipReferences(); }
bool NonCacheable() const { return m_flags.GetNonCacheable(); }
+
+ bool WantsDereference() const { return m_flags.GetFrontEndWantsDereference();}
void SetCascades(bool value) { m_flags.SetCascades(value); }
diff --git a/include/lldb/DataFormatters/TypeValidator.h b/include/lldb/DataFormatters/TypeValidator.h
index 3c414e39353f..fa2a89148118 100644
--- a/include/lldb/DataFormatters/TypeValidator.h
+++ b/include/lldb/DataFormatters/TypeValidator.h
@@ -147,10 +147,9 @@ public:
virtual Type GetType() { return Type::eTypeUnknown; }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
- // need to hold on to this for
- // extended periods of time and we trust the ValueObject to stay around for as
- // long as it is required
- // for us to generate its value
+ // need to hold on to this for extended periods of time and we trust the
+ // ValueObject to stay around for as long as it is required for us to
+ // generate its value
virtual ValidationResult FormatObject(ValueObject *valobj) const = 0;
virtual std::string GetDescription() = 0;
diff --git a/include/lldb/DataFormatters/ValueObjectPrinter.h b/include/lldb/DataFormatters/ValueObjectPrinter.h
index 41851436873d..67048a4932cf 100644
--- a/include/lldb/DataFormatters/ValueObjectPrinter.h
+++ b/include/lldb/DataFormatters/ValueObjectPrinter.h
@@ -47,16 +47,16 @@ protected:
InstancePointersSetSP m_printed_instance_pointers;
- // only this class (and subclasses, if any) should ever be concerned with
- // the depth mechanism
+ // only this class (and subclasses, if any) should ever be concerned with the
+ // depth mechanism
ValueObjectPrinter(ValueObject *valobj, Stream *s,
const DumpValueObjectOptions &options,
const DumpValueObjectOptions::PointerDepth &ptr_depth,
uint32_t curr_depth,
InstancePointersSetSP printed_instance_pointers);
- // we should actually be using delegating constructors here
- // but some versions of GCC still have trouble with those
+ // we should actually be using delegating constructors here but some versions
+ // of GCC still have trouble with those
void Init(ValueObject *valobj, Stream *s,
const DumpValueObjectOptions &options,
const DumpValueObjectOptions::PointerDepth &ptr_depth,
diff --git a/include/lldb/DataFormatters/VectorIterator.h b/include/lldb/DataFormatters/VectorIterator.h
index fcf5aba6ecbe..f695d2290502 100644
--- a/include/lldb/DataFormatters/VectorIterator.h
+++ b/include/lldb/DataFormatters/VectorIterator.h
@@ -13,6 +13,7 @@
#include "lldb/lldb-forward.h"
+#include "lldb/DataFormatters/TypeSynthetic.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Utility/ConstString.h"
diff --git a/include/lldb/Expression/DWARFExpression.h b/include/lldb/Expression/DWARFExpression.h
index c85aaa5c1f9a..b4bd9697da58 100644
--- a/include/lldb/Expression/DWARFExpression.h
+++ b/include/lldb/Expression/DWARFExpression.h
@@ -18,22 +18,22 @@
#include "lldb/lldb-private.h"
#include <functional>
-class DWARFCompileUnit;
+class DWARFUnit;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class DWARFExpression DWARFExpression.h "lldb/Expression/DWARFExpression.h"
-/// @brief Encapsulates a DWARF location expression and interprets it.
+/// @class DWARFExpression DWARFExpression.h
+/// "lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location
+/// expression and interprets it.
///
/// DWARF location expressions are used in two ways by LLDB. The first
-/// use is to find entities specified in the debug information, since
-/// their locations are specified in precisely this language. The second
-/// is to interpret expressions without having to run the target in cases
-/// where the overhead from copying JIT-compiled code into the target is
-/// too high or where the target cannot be run. This class encapsulates
-/// a single DWARF location expression or a location list and interprets
-/// it.
+/// use is to find entities specified in the debug information, since their
+/// locations are specified in precisely this language. The second is to
+/// interpret expressions without having to run the target in cases where the
+/// overhead from copying JIT-compiled code into the target is too high or
+/// where the target cannot be run. This class encapsulates a single DWARF
+/// location expression or a location list and interprets it.
//----------------------------------------------------------------------
class DWARFExpression {
public:
@@ -46,7 +46,7 @@ public:
//------------------------------------------------------------------
/// Constructor
//------------------------------------------------------------------
- explicit DWARFExpression(DWARFCompileUnit *dwarf_cu);
+ explicit DWARFExpression(DWARFUnit *dwarf_cu);
//------------------------------------------------------------------
/// Constructor
@@ -62,7 +62,7 @@ public:
/// The byte length of the location expression.
//------------------------------------------------------------------
DWARFExpression(lldb::ModuleSP module, const DataExtractor &data,
- DWARFCompileUnit *dwarf_cu, lldb::offset_t data_offset,
+ DWARFUnit *dwarf_cu, lldb::offset_t data_offset,
lldb::offset_t data_length);
//------------------------------------------------------------------
@@ -130,12 +130,12 @@ public:
//------------------------------------------------------------------
/// If a location is not a location list, return true if the location
- /// contains a DW_OP_addr () opcode in the stream that matches \a
- /// file_addr. If file_addr is LLDB_INVALID_ADDRESS, the this
- /// function will return true if the variable there is any DW_OP_addr
- /// in a location that (yet still is NOT a location list). This helps
- /// us detect if a variable is a global or static variable since
- /// there is no other indication from DWARF debug info.
+ /// contains a DW_OP_addr () opcode in the stream that matches \a file_addr.
+ /// If file_addr is LLDB_INVALID_ADDRESS, the this function will return true
+ /// if the variable there is any DW_OP_addr in a location that (yet still is
+ /// NOT a location list). This helps us detect if a variable is a global or
+ /// static variable since there is no other indication from DWARF debug
+ /// info.
///
/// @param[in] op_addr_idx
/// The DW_OP_addr index to retrieve in case there is more than
@@ -161,8 +161,8 @@ public:
&link_address_callback);
//------------------------------------------------------------------
- /// Make the expression parser read its location information from a
- /// given data source. Does not change the offset and length
+ /// Make the expression parser read its location information from a given
+ /// data source. Does not change the offset and length
///
/// @param[in] data
/// A data extractor configured to read the DWARF location expression's
@@ -171,8 +171,8 @@ public:
void SetOpcodeData(const DataExtractor &data);
//------------------------------------------------------------------
- /// Make the expression parser read its location information from a
- /// given data source
+ /// Make the expression parser read its location information from a given
+ /// data source
///
/// @param[in] module_sp
/// The module that defines the DWARF expression.
@@ -193,16 +193,15 @@ public:
//------------------------------------------------------------------
/// Copy the DWARF location expression into a local buffer.
///
- /// It is a good idea to copy the data so we don't keep the entire
- /// object file worth of data around just for a few bytes of location
- /// expression. LLDB typically will mmap the entire contents of debug
- /// information files, and if we use SetOpcodeData, it will get a
- /// shared reference to all of this data for the and cause the object
- /// file to have to stay around. Even worse, a very very large ".a"
- /// that contains one or more .o files could end up being referenced.
- /// Location lists are typically small so even though we are copying
- /// the data, it shouldn't amount to that much for the variables we
- /// end up parsing.
+ /// It is a good idea to copy the data so we don't keep the entire object
+ /// file worth of data around just for a few bytes of location expression.
+ /// LLDB typically will mmap the entire contents of debug information files,
+ /// and if we use SetOpcodeData, it will get a shared reference to all of
+ /// this data for the and cause the object file to have to stay around. Even
+ /// worse, a very very large ".a" that contains one or more .o files could
+ /// end up being referenced. Location lists are typically small so even
+ /// though we are copying the data, it shouldn't amount to that much for the
+ /// variables we end up parsing.
///
/// @param[in] module_sp
/// The module that defines the DWARF expression.
@@ -254,8 +253,8 @@ public:
//------------------------------------------------------------------
/// Wrapper for the static evaluate function that accepts an
- /// ExecutionContextScope instead of an ExecutionContext and uses
- /// member variables to populate many operands
+ /// ExecutionContextScope instead of an ExecutionContext and uses member
+ /// variables to populate many operands
//------------------------------------------------------------------
bool Evaluate(ExecutionContextScope *exe_scope,
lldb::addr_t loclist_base_load_addr,
@@ -263,8 +262,8 @@ public:
Value &result, Status *error_ptr) const;
//------------------------------------------------------------------
- /// Wrapper for the static evaluate function that uses member
- /// variables to populate many operands
+ /// Wrapper for the static evaluate function that uses member variables to
+ /// populate many operands
//------------------------------------------------------------------
bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::addr_t loclist_base_load_addr,
@@ -332,7 +331,7 @@ public:
//------------------------------------------------------------------
static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
- DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset,
+ DWARFUnit *dwarf_cu, const lldb::offset_t offset,
const lldb::offset_t length,
const lldb::RegisterKind reg_set,
const Value *initial_value_ptr,
@@ -348,7 +347,7 @@ public:
lldb::addr_t loclist_base_load_addr,
lldb::addr_t address, ABI *abi);
- static size_t LocationListSize(const DWARFCompileUnit *dwarf_cu,
+ static size_t LocationListSize(const DWARFUnit *dwarf_cu,
const DataExtractor &debug_loc_data,
lldb::offset_t offset);
@@ -356,7 +355,7 @@ public:
int address_size, int dwarf_ref_size,
bool location_expression);
- static void PrintDWARFLocationList(Stream &s, const DWARFCompileUnit *cu,
+ static void PrintDWARFLocationList(Stream &s, const DWARFUnit *cu,
const DataExtractor &debug_loc_data,
lldb::offset_t offset);
@@ -389,7 +388,7 @@ protected:
lldb::offset_t &offset, lldb::offset_t &len);
static bool AddressRangeForLocationListEntry(
- const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data,
+ const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data,
lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc);
bool GetOpAndEndOffsets(StackFrame &frame, lldb::offset_t &op_offset,
@@ -401,7 +400,7 @@ protected:
lldb::ModuleWP m_module_wp; ///< Module which defined this expression.
DataExtractor m_data; ///< A data extractor capable of reading opcode bytes
- DWARFCompileUnit *m_dwarf_cu; ///< The DWARF compile unit this expression
+ DWARFUnit *m_dwarf_cu; ///< The DWARF compile unit this expression
///belongs to. It is used
///< to evaluate values indexing into the .debug_addr section (e.g.
///< DW_OP_GNU_addr_index, DW_OP_GNU_const_index)
diff --git a/include/lldb/Expression/Expression.h b/include/lldb/Expression/Expression.h
index 860444e9c2c2..6b9363864722 100644
--- a/include/lldb/Expression/Expression.h
+++ b/include/lldb/Expression/Expression.h
@@ -28,14 +28,14 @@ namespace lldb_private {
class RecordingMemoryManager;
//----------------------------------------------------------------------
-/// @class Expression Expression.h "lldb/Expression/Expression.h"
-/// @brief Encapsulates a single expression for use in lldb
+/// @class Expression Expression.h "lldb/Expression/Expression.h" Encapsulates
+/// a single expression for use in lldb
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. Expression encapsulates
-/// the objects needed to parse and interpret or JIT an expression. It
-/// uses the expression parser appropriate to the language of the expression
-/// to produce LLVM IR from the expression.
+/// and as a backend for the expr command. Expression encapsulates the
+/// objects needed to parse and interpret or JIT an expression. It uses the
+/// expression parser appropriate to the language of the expression to produce
+/// LLVM IR from the expression.
//----------------------------------------------------------------------
class Expression {
public:
@@ -58,20 +58,19 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
virtual const char *FunctionName() = 0;
//------------------------------------------------------------------
- /// Return the language that should be used when parsing. To use
- /// the default, return eLanguageTypeUnknown.
+ /// Return the language that should be used when parsing. To use the
+ /// default, return eLanguageTypeUnknown.
//------------------------------------------------------------------
virtual lldb::LanguageType Language() { return lldb::eLanguageTypeUnknown; }
//------------------------------------------------------------------
- /// Return the desired result type of the function, or
- /// eResultTypeAny if indifferent.
+ /// Return the desired result type of the function, or eResultTypeAny if
+ /// indifferent.
//------------------------------------------------------------------
virtual ResultType DesiredResultType() { return eResultTypeAny; }
@@ -80,14 +79,12 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
virtual bool NeedsValidation() = 0;
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
virtual bool NeedsVariableResolution() = 0;
diff --git a/include/lldb/Expression/ExpressionParser.h b/include/lldb/Expression/ExpressionParser.h
index a550d576f437..66957926650a 100644
--- a/include/lldb/Expression/ExpressionParser.h
+++ b/include/lldb/Expression/ExpressionParser.h
@@ -20,8 +20,8 @@ class IRExecutionUnit;
//----------------------------------------------------------------------
/// @class ExpressionParser ExpressionParser.h
-/// "lldb/Expression/ExpressionParser.h"
-/// @brief Encapsulates an instance of a compiler that can parse expressions.
+/// "lldb/Expression/ExpressionParser.h" Encapsulates an instance of a
+/// compiler that can parse expressions.
///
/// ExpressionParser is the base class for llvm based Expression parsers.
//----------------------------------------------------------------------
@@ -50,8 +50,8 @@ public:
virtual ~ExpressionParser(){};
//------------------------------------------------------------------
- /// Parse a single expression and convert it to IR using Clang. Don't
- /// wrap the expression in anything at all.
+ /// Parse a single expression and convert it to IR using Clang. Don't wrap
+ /// the expression in anything at all.
///
/// @param[in] diagnostic_manager
/// The diagnostic manager in which to store the errors and warnings.
@@ -64,8 +64,8 @@ public:
//------------------------------------------------------------------
/// Try to use the FixIts in the diagnostic_manager to rewrite the
- /// expression. If successful, the rewritten expression is stored
- /// in the diagnostic_manager, get it out with GetFixedExpression.
+ /// expression. If successful, the rewritten expression is stored in the
+ /// diagnostic_manager, get it out with GetFixedExpression.
///
/// @param[in] diagnostic_manager
/// The diagnostic manager containing fixit's to apply.
@@ -78,8 +78,8 @@ public:
}
//------------------------------------------------------------------
- /// Ready an already-parsed expression for execution, possibly
- /// evaluating it statically.
+ /// Ready an already-parsed expression for execution, possibly evaluating it
+ /// statically.
///
/// @param[out] func_addr
/// The address to which the function has been written.
diff --git a/include/lldb/Expression/ExpressionSourceCode.h b/include/lldb/Expression/ExpressionSourceCode.h
index 02fc72aaf251..b5a6187bf3c5 100644
--- a/include/lldb/Expression/ExpressionSourceCode.h
+++ b/include/lldb/Expression/ExpressionSourceCode.h
@@ -40,9 +40,8 @@ public:
bool static_method, ExecutionContext &exe_ctx) const;
// Given a string returned by GetText, find the beginning and end of the body
- // passed to CreateWrapped.
- // Return true if the bounds could be found. This will also work on text with
- // FixItHints applied.
+ // passed to CreateWrapped. Return true if the bounds could be found. This
+ // will also work on text with FixItHints applied.
static bool GetOriginalBodyBounds(std::string transformed_text,
lldb::LanguageType wrapping_language,
size_t &start_loc, size_t &end_loc);
diff --git a/include/lldb/Expression/ExpressionTypeSystemHelper.h b/include/lldb/Expression/ExpressionTypeSystemHelper.h
index 20a5e67cf9b7..ffcad54fb9f9 100644
--- a/include/lldb/Expression/ExpressionTypeSystemHelper.h
+++ b/include/lldb/Expression/ExpressionTypeSystemHelper.h
@@ -18,11 +18,11 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ExpressionTypeSystemHelper ExpressionTypeSystemHelper.h
/// "lldb/Expression/ExpressionTypeSystemHelper.h"
-/// @brief A helper object that the Expression can pass to its ExpressionParser
+/// A helper object that the Expression can pass to its ExpressionParser
/// to provide generic information that
/// any type of expression will need to supply. It's only job is to support
-/// dyn_cast so that the expression parser
-/// can cast it back to the requisite specific type.
+/// dyn_cast so that the expression parser can cast it back to the requisite
+/// specific type.
///
//----------------------------------------------------------------------
diff --git a/include/lldb/Expression/ExpressionVariable.h b/include/lldb/Expression/ExpressionVariable.h
index c7570932c15a..89b0500faf9c 100644
--- a/include/lldb/Expression/ExpressionVariable.h
+++ b/include/lldb/Expression/ExpressionVariable.h
@@ -69,15 +69,12 @@ public:
void SetName(const ConstString &name) { m_frozen_sp->SetName(name); }
// this function is used to copy the address-of m_live_sp into m_frozen_sp
- // this is necessary because the results of certain cast and
- // pointer-arithmetic
- // operations (such as those described in bugzilla issues 11588 and 11618)
- // generate
- // frozen objects that do not have a valid address-of, which can be
- // troublesome when
- // using synthetic children providers. Transferring the address-of the live
- // object
- // solves these issues and provides the expected user-level behavior
+ // this is necessary because the results of certain cast and pointer-
+ // arithmetic operations (such as those described in bugzilla issues 11588
+ // and 11618) generate frozen objects that do not have a valid address-of,
+ // which can be troublesome when using synthetic children providers.
+ // Transferring the address-of the live object solves these issues and
+ // provides the expected user-level behavior
void TransferAddress(bool force = false) {
if (m_live_sp.get() == nullptr)
return;
@@ -129,7 +126,7 @@ public:
//----------------------------------------------------------------------
/// @class ExpressionVariableList ExpressionVariable.h
/// "lldb/Expression/ExpressionVariable.h"
-/// @brief A list of variable references.
+/// A list of variable references.
///
/// This class stores variables internally, acting as the permanent store.
//----------------------------------------------------------------------
@@ -242,7 +239,12 @@ public:
lldb::ByteOrder byte_order,
uint32_t addr_byte_size) = 0;
- virtual ConstString GetNextPersistentVariableName() = 0;
+ /// Return a new persistent variable name with the specified prefix.
+ ConstString GetNextPersistentVariableName(Target &target,
+ llvm::StringRef prefix);
+
+ virtual llvm::StringRef
+ GetPersistentVariablePrefix(bool is_error = false) const = 0;
virtual void
RemovePersistentVariable(lldb::ExpressionVariableSP variable) = 0;
diff --git a/include/lldb/Expression/FunctionCaller.h b/include/lldb/Expression/FunctionCaller.h
index 56305d5181bd..c36263e34240 100644
--- a/include/lldb/Expression/FunctionCaller.h
+++ b/include/lldb/Expression/FunctionCaller.h
@@ -29,7 +29,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FunctionCaller FunctionCaller.h "lldb/Expression/FunctionCaller.h"
-/// @brief Encapsulates a function that can be called.
+/// Encapsulates a function that can be called.
///
/// A given FunctionCaller object can handle a single function signature.
/// Once constructed, it can set up any number of concurrent calls to
@@ -42,8 +42,8 @@ namespace lldb_private {
/// struct with the written arguments. This method lets Clang handle the
/// vagaries of function calling conventions.
///
-/// The simplest use of the FunctionCaller is to construct it with a
-/// function representative of the signature you want to use, then call
+/// The simplest use of the FunctionCaller is to construct it with a function
+/// representative of the signature you want to use, then call
/// ExecuteFunction(ExecutionContext &, Stream &, Value &).
///
/// If you need to reuse the arguments for several calls, you can call
@@ -53,8 +53,8 @@ namespace lldb_private {
/// If you need to call the function on the thread plan stack, you can also
/// call InsertFunction() followed by GetThreadPlanToCallFunction().
///
-/// Any of the methods that take arg_addr_ptr or arg_addr_ref can be passed
-/// a pointer set to LLDB_INVALID_ADDRESS and new structure will be allocated
+/// Any of the methods that take arg_addr_ptr or arg_addr_ref can be passed a
+/// pointer set to LLDB_INVALID_ADDRESS and new structure will be allocated
/// and its address returned in that variable.
///
/// Any of the methods that take arg_addr_ptr can be passed nullptr, and the
@@ -170,8 +170,8 @@ public:
DiagnosticManager &diagnostic_manager);
//------------------------------------------------------------------
- /// Insert an argument struct with a non-default function address and
- /// non-default argument values
+ /// Insert an argument struct with a non-default function address and non-
+ /// default argument values
///
/// @param[in] exe_ctx
/// The execution context to insert the function and its arguments
@@ -308,28 +308,25 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
const char *FunctionName() override {
return m_wrapper_function_name.c_str();
}
//------------------------------------------------------------------
- /// Return the object that the parser should use when registering
- /// local variables. May be nullptr if the Expression doesn't care.
+ /// Return the object that the parser should use when registering local
+ /// variables. May be nullptr if the Expression doesn't care.
//------------------------------------------------------------------
ExpressionVariableList *LocalVariables() { return nullptr; }
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
bool NeedsValidation() override { return false; }
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return false; }
diff --git a/include/lldb/Expression/IRDynamicChecks.h b/include/lldb/Expression/IRDynamicChecks.h
index b793a60585bb..f31c03cfb9ef 100644
--- a/include/lldb/Expression/IRDynamicChecks.h
+++ b/include/lldb/Expression/IRDynamicChecks.h
@@ -33,17 +33,18 @@ class Stream;
//----------------------------------------------------------------------
/// @class DynamicCheckerFunctions IRDynamicChecks.h
-/// "lldb/Expression/IRDynamicChecks.h"
-/// @brief Encapsulates dynamic check functions used by expressions.
+/// "lldb/Expression/IRDynamicChecks.h" Encapsulates dynamic check functions
+/// used by expressions.
///
/// Each of the utility functions encapsulated in this class is responsible
-/// for validating some data that an expression is about to use. Examples are:
+/// for validating some data that an expression is about to use. Examples
+/// are:
///
-/// a = *b; // check that b is a valid pointer
-/// [b init]; // check that b is a valid object to send "init" to
+/// a = *b; // check that b is a valid pointer [b init]; // check that b
+/// is a valid object to send "init" to
///
-/// The class installs each checker function into the target process and
-/// makes it available to IRDynamicChecks to use.
+/// The class installs each checker function into the target process and makes
+/// it available to IRDynamicChecks to use.
//----------------------------------------------------------------------
class DynamicCheckerFunctions {
public:
@@ -58,8 +59,8 @@ public:
~DynamicCheckerFunctions();
//------------------------------------------------------------------
- /// Install the utility functions into a process. This binds the
- /// instance of DynamicCheckerFunctions to that process.
+ /// Install the utility functions into a process. This binds the instance
+ /// of DynamicCheckerFunctions to that process.
///
/// @param[in] diagnostic_manager
/// A diagnostic manager to report errors to.
@@ -81,16 +82,16 @@ public:
};
//----------------------------------------------------------------------
-/// @class IRDynamicChecks IRDynamicChecks.h "lldb/Expression/IRDynamicChecks.h"
-/// @brief Adds dynamic checks to a user-entered expression to reduce its
-/// likelihood of crashing
+/// @class IRDynamicChecks IRDynamicChecks.h
+/// "lldb/Expression/IRDynamicChecks.h" Adds dynamic checks to a user-entered
+/// expression to reduce its likelihood of crashing
///
/// When an IR function is executed in the target process, it may cause
-/// crashes or hangs by dereferencing NULL pointers, trying to call Objective-C
-/// methods on objects that do not respond to them, and so forth.
+/// crashes or hangs by dereferencing NULL pointers, trying to call
+/// Objective-C methods on objects that do not respond to them, and so forth.
///
-/// IRDynamicChecks adds calls to the functions in DynamicCheckerFunctions
-/// to appropriate locations in an expression's IR.
+/// IRDynamicChecks adds calls to the functions in DynamicCheckerFunctions to
+/// appropriate locations in an expression's IR.
//----------------------------------------------------------------------
class IRDynamicChecks : public llvm::ModulePass {
public:
diff --git a/include/lldb/Expression/IRExecutionUnit.h b/include/lldb/Expression/IRExecutionUnit.h
index 703fcd152af4..e73f8956d955 100644
--- a/include/lldb/Expression/IRExecutionUnit.h
+++ b/include/lldb/Expression/IRExecutionUnit.h
@@ -42,23 +42,23 @@ namespace lldb_private {
class Status;
//----------------------------------------------------------------------
-/// @class IRExecutionUnit IRExecutionUnit.h "lldb/Expression/IRExecutionUnit.h"
-/// @brief Contains the IR and, optionally, JIT-compiled code for a module.
+/// @class IRExecutionUnit IRExecutionUnit.h
+/// "lldb/Expression/IRExecutionUnit.h" Contains the IR and, optionally, JIT-
+/// compiled code for a module.
///
-/// This class encapsulates the compiled version of an expression, in IR
-/// form (for interpretation purposes) and in raw machine code form (for
-/// execution in the target).
+/// This class encapsulates the compiled version of an expression, in IR form
+/// (for interpretation purposes) and in raw machine code form (for execution
+/// in the target).
///
-/// This object wraps an IR module that comes from the expression parser,
-/// and knows how to use the JIT to make it into executable code. It can
-/// then be used as input to the IR interpreter, or the address of the
-/// executable code can be passed to a thread plan to run in the target.
+/// This object wraps an IR module that comes from the expression parser, and
+/// knows how to use the JIT to make it into executable code. It can then be
+/// used as input to the IR interpreter, or the address of the executable code
+/// can be passed to a thread plan to run in the target.
///
/// This class creates a subclass of LLVM's SectionMemoryManager, because that
-/// is
-/// how the JIT emits code. Because LLDB needs to move JIT-compiled code
-/// into the target process, the IRExecutionUnit knows how to copy the
-/// emitted code into the target process.
+/// is how the JIT emits code. Because LLDB needs to move JIT-compiled code
+/// into the target process, the IRExecutionUnit knows how to copy the emitted
+/// code into the target process.
//----------------------------------------------------------------------
class IRExecutionUnit : public std::enable_shared_from_this<IRExecutionUnit>,
public IRMemoryMap,
@@ -90,9 +90,9 @@ public:
lldb::addr_t &func_end);
//------------------------------------------------------------------
- /// Accessors for IRForTarget and other clients that may want binary
- /// data placed on their behalf. The binary data is owned by the
- /// IRExecutionUnit unless the client explicitly chooses to free it.
+ /// Accessors for IRForTarget and other clients that may want binary data
+ /// placed on their behalf. The binary data is owned by the IRExecutionUnit
+ /// unless the client explicitly chooses to free it.
//------------------------------------------------------------------
lldb::addr_t WriteNow(const uint8_t *bytes, size_t size, Status &error);
@@ -123,7 +123,7 @@ public:
//----------------------------------------------------------------------
/// @class JittedFunction IRExecutionUnit.h
/// "lldb/Expression/IRExecutionUnit.h"
- /// @brief Encapsulates a single function that has been generated by the JIT.
+ /// Encapsulates a single function that has been generated by the JIT.
///
/// Functions that have been generated by the JIT are first resident in the
/// local process, and then placed in the target process. JittedFunction
@@ -182,9 +182,9 @@ public:
private:
//------------------------------------------------------------------
- /// Look up the object in m_address_map that contains a given address,
- /// find where it was copied to, and return the remote address at the
- /// same offset into the copied entity
+ /// Look up the object in m_address_map that contains a given address, find
+ /// where it was copied to, and return the remote address at the same offset
+ /// into the copied entity
///
/// @param[in] local_address
/// The address in the debugger.
@@ -195,9 +195,9 @@ private:
lldb::addr_t GetRemoteAddressForLocal(lldb::addr_t local_address);
//------------------------------------------------------------------
- /// Look up the object in m_address_map that contains a given address,
- /// find where it was copied to, and return its address range in the
- /// target process
+ /// Look up the object in m_address_map that contains a given address, find
+ /// where it was copied to, and return its address range in the target
+ /// process
///
/// @param[in] local_address
/// The address in the debugger.
@@ -272,8 +272,8 @@ private:
~MemoryManager() override;
//------------------------------------------------------------------
- /// Allocate space for executable code, and add it to the
- /// m_spaceBlocks map
+ /// Allocate space for executable code, and add it to the m_spaceBlocks
+ /// map
///
/// @param[in] Size
/// The size of the area.
@@ -315,8 +315,8 @@ private:
bool IsReadOnly) override;
//------------------------------------------------------------------
- /// Called when object loading is complete and section page
- /// permissions can be applied. Currently unimplemented for LLDB.
+ /// Called when object loading is complete and section page permissions
+ /// can be applied. Currently unimplemented for LLDB.
///
/// @param[out] ErrMsg
/// The error that prevented the page protection from succeeding.
@@ -355,11 +355,11 @@ private:
//----------------------------------------------------------------------
/// @class AllocationRecord IRExecutionUnit.h
- /// "lldb/Expression/IRExecutionUnit.h"
- /// @brief Encapsulates a single allocation request made by the JIT.
+ /// "lldb/Expression/IRExecutionUnit.h" Encapsulates a single allocation
+ /// request made by the JIT.
///
- /// Allocations made by the JIT are first queued up and then applied in
- /// bulk to the underlying process.
+ /// Allocations made by the JIT are first queued up and then applied in bulk
+ /// to the underlying process.
//----------------------------------------------------------------------
enum class AllocationKind { Stub, Code, Data, Global, Bytes };
diff --git a/include/lldb/Expression/IRInterpreter.h b/include/lldb/Expression/IRInterpreter.h
index 36e03c6fc4f6..2d87346b7066 100644
--- a/include/lldb/Expression/IRInterpreter.h
+++ b/include/lldb/Expression/IRInterpreter.h
@@ -29,12 +29,12 @@ class IRMemoryMap;
//----------------------------------------------------------------------
/// @class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h"
-/// @brief Attempt to interpret the function's code if it does not require
+/// Attempt to interpret the function's code if it does not require
/// running the target.
///
-/// In some cases, the IR for an expression can be evaluated entirely
-/// in the debugger, manipulating variables but not executing any code
-/// in the target. The IRInterpreter attempts to do this.
+/// In some cases, the IR for an expression can be evaluated entirely in the
+/// debugger, manipulating variables but not executing any code in the target.
+/// The IRInterpreter attempts to do this.
//----------------------------------------------------------------------
class IRInterpreter {
public:
diff --git a/include/lldb/Expression/IRMemoryMap.h b/include/lldb/Expression/IRMemoryMap.h
index abb5cd745053..df8a03f4763f 100644
--- a/include/lldb/Expression/IRMemoryMap.h
+++ b/include/lldb/Expression/IRMemoryMap.h
@@ -20,19 +20,19 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class IRMemoryMap IRMemoryMap.h "lldb/Expression/IRMemoryMap.h"
-/// @brief Encapsulates memory that may exist in the process but must
+/// Encapsulates memory that may exist in the process but must
/// also be available in the host process.
///
-/// This class encapsulates a group of memory objects that must be readable
-/// or writable from the host process regardless of whether the process
-/// exists. This allows the IR interpreter as well as JITted code to access
-/// the same memory. All allocations made by this class are represented as
-/// disjoint intervals.
+/// This class encapsulates a group of memory objects that must be readable or
+/// writable from the host process regardless of whether the process exists.
+/// This allows the IR interpreter as well as JITted code to access the same
+/// memory. All allocations made by this class are represented as disjoint
+/// intervals.
///
/// Point queries against this group of memory objects can be made by the
-/// address in the tar at which they reside. If the inferior does not
-/// exist, allocations still get made-up addresses. If an inferior appears
-/// at some point, then those addresses need to be re-mapped.
+/// address in the tar at which they reside. If the inferior does not exist,
+/// allocations still get made-up addresses. If an inferior appears at some
+/// point, then those addresses need to be re-mapped.
//----------------------------------------------------------------------
class IRMemoryMap {
public:
@@ -83,8 +83,8 @@ public:
lldb::TargetSP GetTarget() { return m_target_wp.lock(); }
protected:
- // This function should only be used if you know you are using the JIT.
- // Any other cases should use GetBestExecutionContextScope().
+ // This function should only be used if you know you are using the JIT. Any
+ // other cases should use GetBestExecutionContextScope().
lldb::ProcessWP &GetProcessWP() { return m_process_wp; }
diff --git a/include/lldb/Expression/LLVMUserExpression.h b/include/lldb/Expression/LLVMUserExpression.h
index 745d413e077b..a2f87e8a6e25 100644
--- a/include/lldb/Expression/LLVMUserExpression.h
+++ b/include/lldb/Expression/LLVMUserExpression.h
@@ -26,25 +26,24 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class LLVMUserExpression LLVMUserExpression.h
-/// "lldb/Expression/LLVMUserExpression.h"
-/// @brief Encapsulates a one-time expression for use in lldb.
+/// "lldb/Expression/LLVMUserExpression.h" Encapsulates a one-time expression
+/// for use in lldb.
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. LLVMUserExpression is a virtual base
-/// class that encapsulates the objects needed to parse and JIT an expression.
-/// The actual parsing part will be provided by the specific implementations
-/// of LLVMUserExpression - which will be vended through the appropriate
-/// TypeSystem.
+/// and as a backend for the expr command. LLVMUserExpression is a virtual
+/// base class that encapsulates the objects needed to parse and JIT an
+/// expression. The actual parsing part will be provided by the specific
+/// implementations of LLVMUserExpression - which will be vended through the
+/// appropriate TypeSystem.
//----------------------------------------------------------------------
class LLVMUserExpression : public UserExpression {
public:
// The IRPasses struct is filled in by a runtime after an expression is
- // compiled and can be used to to run
- // fixups/analysis passes as required. EarlyPasses are run on the generated
- // module before lldb runs its own IR
+ // compiled and can be used to to run fixups/analysis passes as required.
+ // EarlyPasses are run on the generated module before lldb runs its own IR
// fixups and inserts instrumentation code/pointer checks. LatePasses are run
- // after the module has been processed by
- // llvm, before the module is assembled and run in the ThreadPlan.
+ // after the module has been processed by llvm, before the module is
+ // assembled and run in the ThreadPlan.
struct IRPasses {
IRPasses() : EarlyPasses(nullptr), LatePasses(nullptr){};
std::shared_ptr<llvm::legacy::PassManager> EarlyPasses;
diff --git a/include/lldb/Expression/UserExpression.h b/include/lldb/Expression/UserExpression.h
index ced5cb2bf2b7..96ca80c882e5 100644
--- a/include/lldb/Expression/UserExpression.h
+++ b/include/lldb/Expression/UserExpression.h
@@ -30,7 +30,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class UserExpression UserExpression.h "lldb/Expression/UserExpression.h"
-/// @brief Encapsulates a one-time expression for use in lldb.
+/// Encapsulates a one-time expression for use in lldb.
///
/// LLDB uses expressions for various purposes, notably to call functions
/// and as a backend for the expr command. UserExpression is a virtual base
@@ -103,8 +103,8 @@ public:
bool MatchesContext(ExecutionContext &exe_ctx);
//------------------------------------------------------------------
- /// Execute the parsed expression by callinng the derived class's
- /// DoExecute method.
+ /// Execute the parsed expression by callinng the derived class's DoExecute
+ /// method.
///
/// @param[in] diagnostic_manager
/// A diagnostic manager to report errors to.
@@ -177,32 +177,29 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
const char *FunctionName() override { return "$__lldb_expr"; }
//------------------------------------------------------------------
- /// Return the language that should be used when parsing. To use
- /// the default, return eLanguageTypeUnknown.
+ /// Return the language that should be used when parsing. To use the
+ /// default, return eLanguageTypeUnknown.
//------------------------------------------------------------------
lldb::LanguageType Language() override { return m_language; }
//------------------------------------------------------------------
- /// Return the desired result type of the function, or
- /// eResultTypeAny if indifferent.
+ /// Return the desired result type of the function, or eResultTypeAny if
+ /// indifferent.
//------------------------------------------------------------------
ResultType DesiredResultType() override { return m_desired_type; }
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
bool NeedsValidation() override { return true; }
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return true; }
@@ -216,8 +213,8 @@ public:
virtual lldb::ModuleSP GetJITModule() { return lldb::ModuleSP(); }
//------------------------------------------------------------------
- /// Evaluate one expression in the scratch context of the
- /// target passed in the exe_ctx and return its result.
+ /// Evaluate one expression in the scratch context of the target passed in
+ /// the exe_ctx and return its result.
///
/// @param[in] exe_ctx
/// The execution context to use when evaluating the expression.
diff --git a/include/lldb/Expression/UtilityFunction.h b/include/lldb/Expression/UtilityFunction.h
index 9c54db35fa37..5d4bc8676b95 100644
--- a/include/lldb/Expression/UtilityFunction.h
+++ b/include/lldb/Expression/UtilityFunction.h
@@ -25,13 +25,13 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class UtilityFunction UtilityFunction.h "lldb/Expression/UtilityFunction.h"
-/// @brief Encapsulates a bit of source code that provides a function that is
-/// callable
+/// @class UtilityFunction UtilityFunction.h
+/// "lldb/Expression/UtilityFunction.h" Encapsulates a bit of source code that
+/// provides a function that is callable
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. UtilityFunction encapsulates
-/// a self-contained function meant to be used from other code. Utility
+/// and as a backend for the expr command. UtilityFunction encapsulates a
+/// self-contained function meant to be used from other code. Utility
/// functions can perform error-checking for ClangUserExpressions,
//----------------------------------------------------------------------
class UtilityFunction : public Expression {
@@ -69,8 +69,7 @@ public:
/// Check whether the given PC is inside the function
///
/// Especially useful if the function dereferences nullptr to indicate a
- /// failed
- /// assert.
+ /// failed assert.
///
/// @param[in] pc
/// The program counter to check.
@@ -80,8 +79,8 @@ public:
/// false if not (or the function is not JIT compiled)
//------------------------------------------------------------------
bool ContainsAddress(lldb::addr_t address) {
- // nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS,
- // so this always returns false if the function is not JIT compiled yet
+ // nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS, so
+ // this always returns false if the function is not JIT compiled yet
return (address >= m_jit_start_addr && address < m_jit_end_addr);
}
@@ -93,33 +92,29 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
const char *FunctionName() override { return m_function_name.c_str(); }
//------------------------------------------------------------------
- /// Return the object that the parser should use when registering
- /// local variables. May be nullptr if the Expression doesn't care.
+ /// Return the object that the parser should use when registering local
+ /// variables. May be nullptr if the Expression doesn't care.
//------------------------------------------------------------------
ExpressionVariableList *LocalVariables() { return nullptr; }
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
bool NeedsValidation() override { return false; }
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return false; }
- // This makes the function caller function.
- // Pass in the ThreadSP if you have one available, compilation can end up
- // calling code (e.g. to look up indirect
- // functions) and we don't want this to wander onto another thread.
+ // This makes the function caller function. Pass in the ThreadSP if you have
+ // one available, compilation can end up calling code (e.g. to look up
+ // indirect functions) and we don't want this to wander onto another thread.
FunctionCaller *MakeFunctionCaller(const CompilerType &return_type,
const ValueList &arg_value_list,
lldb::ThreadSP compilation_thread,
diff --git a/include/lldb/Host/Config.h b/include/lldb/Host/Config.h
index 3fa19e77452d..771937498b32 100644
--- a/include/lldb/Host/Config.h
+++ b/include/lldb/Host/Config.h
@@ -16,6 +16,10 @@
// absence of a configuration step.
#define LLDB_CONFIG_TERMIOS_SUPPORTED 1
+#define LLDB_EDITLINE_USE_WCHAR 1
+
+#define LLDB_HAVE_EL_RFUNC_T 1
+
#define HAVE_SYS_EVENT_H 1
#define HAVE_PPOLL 0
diff --git a/include/lldb/Host/Config.h.cmake b/include/lldb/Host/Config.h.cmake
index 73f4b8f6cc4a..02a57ad8ca92 100644
--- a/include/lldb/Host/Config.h.cmake
+++ b/include/lldb/Host/Config.h.cmake
@@ -12,8 +12,14 @@
#cmakedefine LLDB_CONFIG_TERMIOS_SUPPORTED
+#cmakedefine01 LLDB_EDITLINE_USE_WCHAR
+
+#cmakedefine01 LLDB_HAVE_EL_RFUNC_T
+
#cmakedefine LLDB_DISABLE_POSIX
+#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
+
#cmakedefine01 HAVE_SYS_EVENT_H
#cmakedefine01 HAVE_PPOLL
@@ -24,6 +30,8 @@
#cmakedefine01 HAVE_NR_PROCESS_VM_READV
+#ifndef HAVE_LIBCOMPRESSION
#cmakedefine HAVE_LIBCOMPRESSION
+#endif
#endif // #ifndef LLDB_HOST_CONFIG_H
diff --git a/include/lldb/Host/Debug.h b/include/lldb/Host/Debug.h
index fc190a4eca8f..ed8e633c113f 100644
--- a/include/lldb/Host/Debug.h
+++ b/include/lldb/Host/Debug.h
@@ -25,7 +25,8 @@ namespace lldb_private {
//------------------------------------------------------------------
struct ResumeAction {
lldb::tid_t tid; // The thread ID that this action applies to,
- // LLDB_INVALID_THREAD_ID for the default thread action
+ // LLDB_INVALID_THREAD_ID for the default thread
+ // action
lldb::StateType state; // Valid values are eStateStopped/eStateSuspended,
// eStateRunning, and eStateStepping.
int signal; // When resuming this thread, resume it with this signal if this
@@ -34,10 +35,9 @@ struct ResumeAction {
//------------------------------------------------------------------
// A class that contains instructions for all threads for
-// NativeProcessProtocol::Resume(). Each thread can either run, stay
-// suspended, or step when the process is resumed. We optionally
-// have the ability to also send a signal to the thread when the
-// action is run or step.
+// NativeProcessProtocol::Resume(). Each thread can either run, stay suspended,
+// or step when the process is resumed. We optionally have the ability to also
+// send a signal to the thread when the action is run or step.
//------------------------------------------------------------------
class ResumeActionList {
public:
diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
index 0b75e9c923ca..beb96e7c4924 100644
--- a/include/lldb/Host/Editline.h
+++ b/include/lldb/Host/Editline.h
@@ -23,8 +23,8 @@
// broken, which is why we're
// working around it here.
// c) When resizing the terminal window, if the cursor moves between rows
-// libedit will get confused.
-// d) The incremental search uses escape to cancel input, so it's confused by
+// libedit will get confused. d) The incremental search uses escape to cancel
+// input, so it's confused by
// ANSI sequences starting with escape.
// e) Emoji support is fairly terrible, presumably it doesn't understand
// composed characters?
@@ -33,24 +33,13 @@
#define liblldb_Editline_h_
#if defined(__cplusplus)
+#if LLDB_EDITLINE_USE_WCHAR
+#include <codecvt>
+#endif
#include <locale>
#include <sstream>
#include <vector>
-// components needed to handle wide characters ( <codecvt>, codecvt_utf8,
-// libedit built with '--enable-widec' )
-// are available on some platforms. The wchar_t versions of libedit functions
-// will only be
-// used in cases where this is true. This is a compile time dependecy, for now
-// selected per target Platform
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
- defined(__OpenBSD__)
-#define LLDB_EDITLINE_USE_WCHAR 1
-#include <codecvt>
-#else
-#define LLDB_EDITLINE_USE_WCHAR 0
-#endif
-
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/lldb-private.h"
@@ -82,7 +71,11 @@ using EditLineStringStreamType = std::stringstream;
using EditLineCharType = char;
#endif
-#ifdef EL_CLIENTDATA /* editline with wide support + wide char read function */
+// At one point the callback type of el_set getchar callback changed from char
+// to wchar_t. It is not possible to detect differentiate between the two
+// versions exactly, but this is a pretty good approximation and allows us to
+// build against almost any editline version out there.
+#if LLDB_EDITLINE_USE_WCHAR || defined(EL_CLIENTDATA) || LLDB_HAVE_EL_RFUNC_T
using EditLineGetCharType = wchar_t;
#else
using EditLineGetCharType = char;
diff --git a/include/lldb/Host/File.h b/include/lldb/Host/File.h
index 1dfa12ea593d..d240f810bc8b 100644
--- a/include/lldb/Host/File.h
+++ b/include/lldb/Host/File.h
@@ -23,7 +23,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class File File.h "lldb/Host/File.h"
-/// @brief A file class.
+/// A file class.
///
/// A file class that divides abstracts the LLDB core from host file
/// functionality.
@@ -65,9 +65,9 @@ public:
//------------------------------------------------------------------
/// Constructor with path.
///
- /// Takes a path to a file which can be just a filename, or a full
- /// path. If \a path is not nullptr or empty, this function will call
- /// File::Open (const char *path, uint32_t options, uint32_t permissions).
+ /// Takes a path to a file which can be just a filename, or a full path. If
+ /// \a path is not nullptr or empty, this function will call File::Open
+ /// (const char *path, uint32_t options, uint32_t permissions).
///
/// @param[in] path
/// The full or partial path to a file.
@@ -78,7 +78,8 @@ public:
/// @param[in] permissions
/// Options to use when opening (see File::Permissions)
///
- /// @see File::Open (const char *path, uint32_t options, uint32_t permissions)
+ /// @see File::Open (const char *path, uint32_t options, uint32_t
+ /// permissions)
//------------------------------------------------------------------
File(const char *path, uint32_t options,
uint32_t permissions = lldb::eFilePermissionsFileDefault);
@@ -87,8 +88,7 @@ public:
/// Constructor with FileSpec.
///
/// Takes a FileSpec pointing to a file which can be just a filename, or a
- /// full
- /// path. If \a path is not nullptr or empty, this function will call
+ /// full path. If \a path is not nullptr or empty, this function will call
/// File::Open (const char *path, uint32_t options, uint32_t permissions).
///
/// @param[in] filespec
@@ -100,7 +100,8 @@ public:
/// @param[in] permissions
/// Options to use when opening (see File::Permissions)
///
- /// @see File::Open (const char *path, uint32_t options, uint32_t permissions)
+ /// @see File::Open (const char *path, uint32_t options, uint32_t
+ /// permissions)
//------------------------------------------------------------------
File(const FileSpec &filespec, uint32_t options,
uint32_t permissions = lldb::eFilePermissionsFileDefault);
@@ -125,8 +126,8 @@ public:
//------------------------------------------------------------------
/// Convert to pointer operator.
///
- /// This allows code to check a File object to see if it
- /// contains anything valid using code such as:
+ /// This allows code to check a File object to see if it contains anything
+ /// valid using code such as:
///
/// @code
/// File file(...);
@@ -143,8 +144,8 @@ public:
//------------------------------------------------------------------
/// Logical NOT operator.
///
- /// This allows code to check a File object to see if it is
- /// invalid using code such as:
+ /// This allows code to check a File object to see if it is invalid using
+ /// code such as:
///
/// @code
/// File file(...);
@@ -169,8 +170,7 @@ public:
//------------------------------------------------------------------
/// Open a file for read/writing with the specified options.
///
- /// Takes a path to a file which can be just a filename, or a full
- /// path.
+ /// Takes a path to a file which can be just a filename, or a full path.
///
/// @param[in] path
/// The full or partial path to a file.
@@ -202,8 +202,8 @@ public:
/// Read bytes from a file from the current file position.
///
/// NOTE: This function is NOT thread safe. Use the read function
- /// that takes an "off_t &offset" to ensure correct operation in
- /// multi-threaded environments.
+ /// that takes an "off_t &offset" to ensure correct operation in multi-
+ /// threaded environments.
///
/// @param[in] buf
/// A buffer where to put the bytes that are read.
@@ -222,8 +222,8 @@ public:
/// Write bytes to a file at the current file position.
///
/// NOTE: This function is NOT thread safe. Use the write function
- /// that takes an "off_t &offset" to ensure correct operation in
- /// multi-threaded environments.
+ /// that takes an "off_t &offset" to ensure correct operation in multi-
+ /// threaded environments.
///
/// @param[in] buf
/// A buffer where to put the bytes that are read.
@@ -243,10 +243,10 @@ public:
/// Seek to an offset relative to the beginning of the file.
///
/// NOTE: This function is NOT thread safe, other threads that
- /// access this object might also change the current file position.
- /// For thread safe reads and writes see the following functions:
- /// @see File::Read (void *, size_t, off_t &)
- /// @see File::Write (const void *, size_t, off_t &)
+ /// access this object might also change the current file position. For
+ /// thread safe reads and writes see the following functions: @see
+ /// File::Read (void *, size_t, off_t &) @see File::Write (const void *,
+ /// size_t, off_t &)
///
/// @param[in] offset
/// The offset to seek to within the file relative to the
@@ -265,10 +265,10 @@ public:
/// Seek to an offset relative to the current file position.
///
/// NOTE: This function is NOT thread safe, other threads that
- /// access this object might also change the current file position.
- /// For thread safe reads and writes see the following functions:
- /// @see File::Read (void *, size_t, off_t &)
- /// @see File::Write (const void *, size_t, off_t &)
+ /// access this object might also change the current file position. For
+ /// thread safe reads and writes see the following functions: @see
+ /// File::Read (void *, size_t, off_t &) @see File::Write (const void *,
+ /// size_t, off_t &)
///
/// @param[in] offset
/// The offset to seek to within the file relative to the
@@ -287,10 +287,10 @@ public:
/// Seek to an offset relative to the end of the file.
///
/// NOTE: This function is NOT thread safe, other threads that
- /// access this object might also change the current file position.
- /// For thread safe reads and writes see the following functions:
- /// @see File::Read (void *, size_t, off_t &)
- /// @see File::Write (const void *, size_t, off_t &)
+ /// access this object might also change the current file position. For
+ /// thread safe reads and writes see the following functions: @see
+ /// File::Read (void *, size_t, off_t &) @see File::Write (const void *,
+ /// size_t, off_t &)
///
/// @param[in,out] offset
/// The offset to seek to within the file relative to the
@@ -310,8 +310,8 @@ public:
/// Read bytes from a file from the specified file offset.
///
/// NOTE: This function is thread safe in that clients manager their
- /// own file position markers and reads on other threads won't mess
- /// up the current read.
+ /// own file position markers and reads on other threads won't mess up the
+ /// current read.
///
/// @param[in] dst
/// A buffer where to put the bytes that are read.
@@ -335,8 +335,8 @@ public:
/// Read bytes from a file from the specified file offset.
///
/// NOTE: This function is thread safe in that clients manager their
- /// own file position markers and reads on other threads won't mess
- /// up the current read.
+ /// own file position markers and reads on other threads won't mess up the
+ /// current read.
///
/// @param[in,out] num_bytes
/// The number of bytes to read form the current file position
@@ -367,9 +367,9 @@ public:
/// Write bytes to a file at the specified file offset.
///
/// NOTE: This function is thread safe in that clients manager their
- /// own file position markers, though clients will need to implement
- /// their own locking externally to avoid multiple people writing
- /// to the file at the same time.
+ /// own file position markers, though clients will need to implement their
+ /// own locking externally to avoid multiple people writing to the file at
+ /// the same time.
///
/// @param[in] src
/// A buffer containing the bytes to write.
@@ -431,10 +431,9 @@ public:
//------------------------------------------------------------------
/// Return true if this file from a real terminal.
///
- /// Just knowing a file is a interactive isn't enough, we also need
- /// to know if the terminal has a width and height so we can do
- /// cursor movement and other terminal manipulations by sending
- /// escape sequences.
+ /// Just knowing a file is a interactive isn't enough, we also need to know
+ /// if the terminal has a width and height so we can do cursor movement and
+ /// other terminal manipulations by sending escape sequences.
///
/// @return
/// True if this file is a terminal (tty, not a pty) that has
diff --git a/include/lldb/Host/Host.h b/include/lldb/Host/Host.h
index f099c72381be..459e9f563d1e 100644
--- a/include/lldb/Host/Host.h
+++ b/include/lldb/Host/Host.h
@@ -12,8 +12,9 @@
#include "lldb/Host/File.h"
#include "lldb/Host/HostThread.h"
+#include "lldb/Utility/Environment.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/StringList.h"
+#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-private.h"
#include <cerrno>
@@ -56,10 +57,9 @@ inline bool operator!=(WaitStatus a, WaitStatus b) { return !(a == b); }
//----------------------------------------------------------------------
/// @class Host Host.h "lldb/Host/Host.h"
-/// @brief A class that provides host computer information.
+/// A class that provides host computer information.
///
-/// Host is a class that answers information about the host operating
-/// system.
+/// Host is a class that answers information about the host operating system.
//----------------------------------------------------------------------
class Host {
public:
@@ -72,18 +72,17 @@ public:
//------------------------------------------------------------------
/// Start monitoring a child process.
///
- /// Allows easy monitoring of child processes. \a callback will be
- /// called when the child process exits or if it gets a signal. The
- /// callback will only be called with signals if \a monitor_signals
- /// is \b true. \a callback will usually be called from another
- /// thread so the callback function must be thread safe.
+ /// Allows easy monitoring of child processes. \a callback will be called
+ /// when the child process exits or if it gets a signal. The callback will
+ /// only be called with signals if \a monitor_signals is \b true. \a
+ /// callback will usually be called from another thread so the callback
+ /// function must be thread safe.
///
- /// When the callback gets called, the return value indicates if
- /// monitoring should stop. If \b true is returned from \a callback
- /// the information will be removed. If \b false is returned then
- /// monitoring will continue. If the child process exits, the
- /// monitoring will automatically stop after the callback returned
- /// regardless of the callback return value.
+ /// When the callback gets called, the return value indicates if monitoring
+ /// should stop. If \b true is returned from \a callback the information
+ /// will be removed. If \b false is returned then monitoring will continue.
+ /// If the child process exits, the monitoring will automatically stop after
+ /// the callback returned regardless of the callback return value.
///
/// @param[in] callback
/// A function callback to call when a child receives a signal
@@ -126,9 +125,8 @@ public:
static void Kill(lldb::pid_t pid, int signo);
//------------------------------------------------------------------
- /// Get the thread token (the one returned by ThreadCreate when the thread was
- /// created) for the
- /// calling thread in the current process.
+ /// Get the thread token (the one returned by ThreadCreate when the thread
+ /// was created) for the calling thread in the current process.
///
/// @return
/// The thread token for the calling thread in the current process.
@@ -138,11 +136,11 @@ public:
static const char *GetSignalAsCString(int signo);
//------------------------------------------------------------------
- /// Given an address in the current process (the process that
- /// is running the LLDB code), return the name of the module that
- /// it comes from. This can be useful when you need to know the
- /// path to the shared library that your code is running in for
- /// loading resources that are relative to your binary.
+ /// Given an address in the current process (the process that is running the
+ /// LLDB code), return the name of the module that it comes from. This can
+ /// be useful when you need to know the path to the shared library that your
+ /// code is running in for loading resources that are relative to your
+ /// binary.
///
/// @param[in] host_addr
/// The pointer to some code in the current process.
@@ -155,10 +153,9 @@ public:
static FileSpec GetModuleFileSpecForHostAddress(const void *host_addr);
//------------------------------------------------------------------
- /// If you have an executable that is in a bundle and want to get
- /// back to the bundle directory from the path itself, this
- /// function will change a path to a file within a bundle to the
- /// bundle directory itself.
+ /// If you have an executable that is in a bundle and want to get back to
+ /// the bundle directory from the path itself, this function will change a
+ /// path to a file within a bundle to the bundle directory itself.
///
/// @param[in] file
/// A file spec that might point to a file in a bundle.
@@ -176,10 +173,9 @@ public:
FileSpec &bundle_directory);
//------------------------------------------------------------------
- /// When executable files may live within a directory, where the
- /// directory represents an executable bundle (like the MacOSX
- /// app bundles), then locate the executable within the containing
- /// bundle.
+ /// When executable files may live within a directory, where the directory
+ /// represents an executable bundle (like the MacOSX app bundles), then
+ /// locate the executable within the containing bundle.
///
/// @param[in,out] file
/// A file spec that currently points to the bundle that will
@@ -203,11 +199,14 @@ public:
static const lldb::UnixSignalsSP &GetUnixSignals();
+ /// Launch the process specified in launch_info. The monitoring callback in
+ /// launch_info must be set, and it will be called when the process
+ /// terminates.
static Status LaunchProcess(ProcessLaunchInfo &launch_info);
//------------------------------------------------------------------
- /// Perform expansion of the command-line for this launch info
- /// This can potentially involve wildcard expansion
+ /// Perform expansion of the command-line for this launch info This can
+ /// potentially involve wildcard expansion
// environment variable replacement, and whatever other
// argument magic the platform defines as part of its typical
// user experience
@@ -224,8 +223,7 @@ public:
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec,
- bool run_in_default_shell = true);
+ const Timeout<std::micro> &timeout, bool run_in_default_shell = true);
static Status RunShellCommand(
const Args &args,
@@ -236,13 +234,12 @@ public:
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec,
- bool run_in_default_shell = true);
+ const Timeout<std::micro> &timeout, bool run_in_default_shell = true);
static bool OpenFileInExternalEditor(const FileSpec &file_spec,
uint32_t line_no);
- static size_t GetEnvironment(StringList &env);
+ static Environment GetEnvironment();
static std::unique_ptr<Connection>
CreateDefaultConnection(llvm::StringRef url);
@@ -252,8 +249,8 @@ public:
namespace llvm {
template <> struct format_provider<lldb_private::WaitStatus> {
- /// Options = "" gives a human readable description of the status
- /// Options = "g" gives a gdb-remote protocol status (e.g., X09)
+ /// Options = "" gives a human readable description of the status Options =
+ /// "g" gives a gdb-remote protocol status (e.g., X09)
static void format(const lldb_private::WaitStatus &WS, raw_ostream &OS,
llvm::StringRef Options);
};
diff --git a/include/lldb/Host/HostInfo.h b/include/lldb/Host/HostInfo.h
index b4a2f8baf37f..df762d7160e0 100644
--- a/include/lldb/Host/HostInfo.h
+++ b/include/lldb/Host/HostInfo.h
@@ -12,7 +12,7 @@
//----------------------------------------------------------------------
/// @class HostInfo HostInfo.h "lldb/Host/HostInfo.h"
-/// @brief A class that provides host computer information.
+/// A class that provides host computer information.
///
/// HostInfo is a class that answers information about the host operating
/// system. Note that HostInfo is NOT intended to be used to manipulate or
@@ -22,15 +22,16 @@
/// HostInfoWindows) in a separate file, and then typedefed to HostInfo here.
/// Users of the class reference it as HostInfo::method().
///
-/// Not all hosts provide the same functionality. It is important that methods
-/// only be implemented at the lowest level at which they make sense. It should
-/// be up to the clients of the class to ensure that they not attempt to call a
-/// method which doesn't make sense for a particular platform. For example,
-/// when implementing a method that only makes sense on a posix-compliant
-/// system, implement it on HostInfoPosix, and not on HostInfoBase with a
-/// default implementation. This way, users of HostInfo are required to think
-/// about the implications of calling a particular method and if used in a
-/// context where the method doesn't make sense, will generate a compiler error.
+/// Not all hosts provide the same functionality. It is important that
+/// methods only be implemented at the lowest level at which they make sense.
+/// It should be up to the clients of the class to ensure that they not
+/// attempt to call a method which doesn't make sense for a particular
+/// platform. For example, when implementing a method that only makes sense
+/// on a posix-compliant system, implement it on HostInfoPosix, and not on
+/// HostInfoBase with a default implementation. This way, users of HostInfo
+/// are required to think about the implications of calling a particular
+/// method and if used in a context where the method doesn't make sense, will
+/// generate a compiler error.
///
//----------------------------------------------------------------------
diff --git a/include/lldb/Host/HostInfoBase.h b/include/lldb/Host/HostInfoBase.h
index 52648d2031fc..b2567b296277 100644
--- a/include/lldb/Host/HostInfoBase.h
+++ b/include/lldb/Host/HostInfoBase.h
@@ -63,25 +63,39 @@ public:
static llvm::Optional<ArchitectureKind> ParseArchitectureKind(llvm::StringRef kind);
- //------------------------------------------------------------------
- /// Find a resource files that are related to LLDB.
- ///
- /// Operating systems have different ways of storing shared
- /// libraries and related resources. This function abstracts the
- /// access to these paths.
- ///
- /// @param[in] path_type
- /// The type of LLDB resource path you are looking for. If the
- /// enumeration ends with "Dir", then only the \a file_spec's
- /// directory member gets filled in.
- ///
- /// @param[in] file_spec
- /// A file spec that gets filled in with the appropriate path.
- ///
- /// @return
- /// \b true if \a resource_path was resolved, \a false otherwise.
- //------------------------------------------------------------------
- static bool GetLLDBPath(lldb::PathType type, FileSpec &file_spec);
+ /// Returns the directory containing the lldb shared library. Only the
+ /// directory member of the FileSpec is filled in.
+ static FileSpec GetShlibDir();
+
+ /// Returns the directory containing the support executables (debugserver,
+ /// ...). Only the directory member of the FileSpec is filled in.
+ static FileSpec GetSupportExeDir();
+
+ /// Returns the directory containing the lldb headers. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetHeaderDir();
+
+ /// Returns the directory containing the python modules. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetPythonDir();
+
+ /// Returns the directory containing the system plugins. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetSystemPluginDir();
+
+ /// Returns the directory containing the user plugins. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetUserPluginDir();
+
+ /// Returns the proces temporary directory. This directory will be cleaned up
+ /// when this process exits. Only the directory member of the FileSpec is
+ /// filled in.
+ static FileSpec GetProcessTempDir();
+
+ /// Returns the global temporary directory. This directory will **not** be
+ /// cleaned up when this process exits. Only the directory member of the
+ /// FileSpec is filled in.
+ static FileSpec GetGlobalTempDir();
//---------------------------------------------------------------------------
/// If the triple does not specify the vendor, os, and environment parts, we
@@ -98,7 +112,6 @@ protected:
static bool ComputeTempFileBaseDirectory(FileSpec &file_spec);
static bool ComputeHeaderDirectory(FileSpec &file_spec);
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
- static bool ComputeClangDirectory(FileSpec &file_spec);
static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
diff --git a/include/lldb/Host/HostProcess.h b/include/lldb/Host/HostProcess.h
index dfc997bd81f7..626ebab7ce68 100644
--- a/include/lldb/Host/HostProcess.h
+++ b/include/lldb/Host/HostProcess.h
@@ -15,17 +15,17 @@
//----------------------------------------------------------------------
/// @class HostInfo HostInfo.h "lldb/Host/HostProcess.h"
-/// @brief A class that represents a running process on the host machine.
+/// A class that represents a running process on the host machine.
///
/// HostProcess allows querying and manipulation of processes running on the
-/// host machine. It is not intended to be represent a process which is
-/// being debugged, although the native debug engine of a platform may likely
-/// back inferior processes by a HostProcess.
+/// host machine. It is not intended to be represent a process which is being
+/// debugged, although the native debug engine of a platform may likely back
+/// inferior processes by a HostProcess.
///
/// HostProcess is implemented using static polymorphism so that on any given
-/// platform, an instance of HostProcess will always be able to bind statically
-/// to the concrete Process implementation for that platform. See HostInfo
-/// for more details.
+/// platform, an instance of HostProcess will always be able to bind
+/// statically to the concrete Process implementation for that platform. See
+/// HostInfo for more details.
///
//----------------------------------------------------------------------
diff --git a/include/lldb/Host/HostThread.h b/include/lldb/Host/HostThread.h
index 0d2fbe6045af..120776283aa4 100644
--- a/include/lldb/Host/HostThread.h
+++ b/include/lldb/Host/HostThread.h
@@ -22,7 +22,7 @@ class HostNativeThreadBase;
//----------------------------------------------------------------------
/// @class HostInfo HostInfo.h "lldb/Host/HostThread.h"
-/// @brief A class that represents a thread running inside of a process on the
+/// A class that represents a thread running inside of a process on the
/// local machine.
///
/// HostThread allows querying and manipulation of threads running on the host
diff --git a/include/lldb/Host/MainLoop.h b/include/lldb/Host/MainLoop.h
index c59a5aa5b0e8..13d1ff0212fa 100644
--- a/include/lldb/Host/MainLoop.h
+++ b/include/lldb/Host/MainLoop.h
@@ -21,12 +21,12 @@
namespace lldb_private {
-// Implementation of the MainLoopBase class. It can monitor file descriptors for
-// readability using ppoll, kqueue, poll or WSAPoll. On Windows it only supports
-// polling sockets, and will not work on generic file handles or pipes. On
-// systems without kqueue or ppoll handling singnals is not supported. In
-// addition to the common base, this class provides the ability to invoke a
-// given handler when a signal is received.
+// Implementation of the MainLoopBase class. It can monitor file descriptors
+// for readability using ppoll, kqueue, poll or WSAPoll. On Windows it only
+// supports polling sockets, and will not work on generic file handles or
+// pipes. On systems without kqueue or ppoll handling singnals is not
+// supported. In addition to the common base, this class provides the ability
+// to invoke a given handler when a signal is received.
//
// Since this class is primarily intended to be used for single-threaded
// processing, it does not attempt to perform any internal synchronisation and
@@ -49,13 +49,13 @@ public:
const Callback &callback,
Status &error) override;
- // Listening for signals from multiple MainLoop instances is perfectly safe as
- // long as they don't try to listen for the same signal. The callback function
- // is invoked when the control returns to the Run() function, not when the
- // hander is executed. This mean that you can treat the callback as a normal
- // function and perform things which would not be safe in a signal handler.
- // However, since the callback is not invoked synchronously, you cannot use
- // this mechanism to handle SIGSEGV and the like.
+ // Listening for signals from multiple MainLoop instances is perfectly safe
+ // as long as they don't try to listen for the same signal. The callback
+ // function is invoked when the control returns to the Run() function, not
+ // when the hander is executed. This mean that you can treat the callback as
+ // a normal function and perform things which would not be safe in a signal
+ // handler. However, since the callback is not invoked synchronously, you
+ // cannot use this mechanism to handle SIGSEGV and the like.
SignalHandleUP RegisterSignal(int signo, const Callback &callback,
Status &error);
diff --git a/include/lldb/Host/MainLoopBase.h b/include/lldb/Host/MainLoopBase.h
index a87d262e9452..bf01ba16db0e 100644
--- a/include/lldb/Host/MainLoopBase.h
+++ b/include/lldb/Host/MainLoopBase.h
@@ -18,21 +18,17 @@
namespace lldb_private {
// The purpose of this class is to enable multiplexed processing of data from
-// different sources
-// without resorting to multi-threading. Clients can register IOObjects, which
-// will be monitored
-// for readability, and when they become ready, the specified callback will be
-// invoked.
-// Monitoring for writability is not supported, but can be easily added if
-// needed.
+// different sources without resorting to multi-threading. Clients can register
+// IOObjects, which will be monitored for readability, and when they become
+// ready, the specified callback will be invoked. Monitoring for writability is
+// not supported, but can be easily added if needed.
//
// The RegisterReadObject function return a handle, which controls the duration
-// of the monitoring. When
-// this handle is destroyed, the callback is deregistered.
+// of the monitoring. When this handle is destroyed, the callback is
+// deregistered.
//
// This class simply defines the interface common for all platforms, actual
-// implementations are
-// platform-specific.
+// implementations are platform-specific.
class MainLoopBase {
private:
class ReadHandle;
@@ -52,8 +48,7 @@ public:
}
// Waits for registered events and invoke the proper callbacks. Returns when
- // all callbacks
- // deregister themselves or when someone requests termination.
+ // all callbacks deregister themselves or when someone requests termination.
virtual Status Run() { llvm_unreachable("Not implemented"); }
// Requests the exit of the Run() function.
diff --git a/include/lldb/Host/MonitoringProcessLauncher.h b/include/lldb/Host/MonitoringProcessLauncher.h
index 9ad36e90a779..341284800a4e 100644
--- a/include/lldb/Host/MonitoringProcessLauncher.h
+++ b/include/lldb/Host/MonitoringProcessLauncher.h
@@ -24,6 +24,9 @@ public:
explicit MonitoringProcessLauncher(
std::unique_ptr<ProcessLauncher> delegate_launcher);
+ /// Launch the process specified in launch_info. The monitoring callback in
+ /// launch_info must be set, and it will be called when the process
+ /// terminates.
HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info,
Status &error) override;
diff --git a/include/lldb/Host/PosixApi.h b/include/lldb/Host/PosixApi.h
index d5c48dd6d170..dae2bb480091 100644
--- a/include/lldb/Host/PosixApi.h
+++ b/include/lldb/Host/PosixApi.h
@@ -11,13 +11,14 @@
#define liblldb_Host_PosixApi_h
// This file defines platform specific functions, macros, and types necessary
-// to provide a minimum level of compatibility across all platforms to rely
-// on various posix api functionality.
+// to provide a minimum level of compatibility across all platforms to rely on
+// various posix api functionality.
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h"
#else
#include <unistd.h>
+#include <csignal>
#endif
#endif
diff --git a/include/lldb/Host/Predicate.h b/include/lldb/Host/Predicate.h
index 3ee27e74b4ba..d8128e71c53e 100644
--- a/include/lldb/Host/Predicate.h
+++ b/include/lldb/Host/Predicate.h
@@ -20,6 +20,7 @@
// Other libraries and framework includes
// Project includes
+#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-defines.h"
//#define DB_PTHREAD_LOG_EVENTS
@@ -38,8 +39,8 @@ typedef enum {
//----------------------------------------------------------------------
/// @class Predicate Predicate.h "lldb/Host/Predicate.h"
-/// @brief A C++ wrapper class for providing threaded access to a value
-/// of type T.
+/// A C++ wrapper class for providing threaded access to a value of
+/// type T.
///
/// A templatized class that provides multi-threaded access to a value
/// of type T. Threads can efficiently wait for bits within T to be set
@@ -118,169 +119,39 @@ public:
}
//------------------------------------------------------------------
- /// Set some bits in \a m_value.
+ /// Wait for Cond(m_value) to be true.
///
- /// Logically set the bits \a bits in the contained \a m_value in a
- /// thread safe way and broadcast if needed.
+ /// Waits in a thread safe way for Cond(m_value) to be true. If Cond(m_value)
+ /// is already true, this function will return without waiting.
///
- /// @param[in] bits
- /// The bits to set in \a m_value.
+ /// It is possible for the value to be changed between the time the value is
+ /// set and the time the waiting thread wakes up. If the value no longer
+ /// satisfies the condition when the waiting thread wakes up, it will go back
+ /// into a wait state. It may be necessary for the calling code to use
+ /// additional thread synchronization methods to detect transitory states.
///
- /// @param[in] broadcast_type
- /// A value indicating when and if to broadcast. See the
- /// PredicateBroadcastType enumeration for details.
- ///
- /// @see Predicate::Broadcast()
- //------------------------------------------------------------------
- void SetValueBits(T bits, PredicateBroadcastType broadcast_type) {
- std::lock_guard<std::mutex> guard(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, broadcast_type = %i)\n", __FUNCTION__, bits,
- broadcast_type);
-#endif
- const T old_value = m_value;
- m_value |= bits;
-
- Broadcast(old_value, broadcast_type);
- }
-
- //------------------------------------------------------------------
- /// Reset some bits in \a m_value.
- ///
- /// Logically reset (clear) the bits \a bits in the contained
- /// \a m_value in a thread safe way and broadcast if needed.
- ///
- /// @param[in] bits
- /// The bits to clear in \a m_value.
- ///
- /// @param[in] broadcast_type
- /// A value indicating when and if to broadcast. See the
- /// PredicateBroadcastType enumeration for details.
- ///
- /// @see Predicate::Broadcast()
- //------------------------------------------------------------------
- void ResetValueBits(T bits, PredicateBroadcastType broadcast_type) {
- std::lock_guard<std::mutex> guard(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, broadcast_type = %i)\n", __FUNCTION__, bits,
- broadcast_type);
-#endif
- const T old_value = m_value;
- m_value &= ~bits;
-
- Broadcast(old_value, broadcast_type);
- }
-
- //------------------------------------------------------------------
- /// Wait for bits to be set in \a m_value.
- ///
- /// Waits in a thread safe way for any bits in \a bits to get
- /// logically set in \a m_value. If any bits are already set in
- /// \a m_value, this function will return without waiting.
- ///
- /// It is possible for the value to be changed between the time
- /// the bits are set and the time the waiting thread wakes up.
- /// If the bits are no longer set when the waiting thread wakes
- /// up, it will go back into a wait state. It may be necessary
- /// for the calling code to use additional thread synchronization
- /// methods to detect transitory states.
- ///
- /// @param[in] bits
- /// The bits we are waiting to be set in \a m_value.
- ///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
- ///
- /// @return
- /// Any bits of the requested bits that actually were set within
- /// the time specified. Zero if a timeout or unrecoverable error
- /// occurred.
- //------------------------------------------------------------------
- T WaitForSetValueBits(T bits, const std::chrono::microseconds &timeout =
- std::chrono::microseconds(0)) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, bits, timeout.count(), m_value);
-#endif
- while ((m_value & bits) == 0) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout)
- break;
- }
- }
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x), m_value = 0x%8.8x, returning 0x%8.8x\n",
- __FUNCTION__, bits, m_value, m_value & bits);
-#endif
-
- return m_value & bits;
- }
-
- //------------------------------------------------------------------
- /// Wait for bits to be reset in \a m_value.
- ///
- /// Waits in a thread safe way for any bits in \a bits to get
- /// logically reset in \a m_value. If all bits are already reset in
- /// \a m_value, this function will return without waiting.
- ///
- /// It is possible for the value to be changed between the time
- /// the bits are reset and the time the waiting thread wakes up.
- /// If the bits are no set when the waiting thread wakes up, it will
- /// go back into a wait state. It may be necessary for the calling
- /// code to use additional thread synchronization methods to detect
- /// transitory states.
- ///
- /// @param[in] bits
- /// The bits we are waiting to be reset in \a m_value.
+ /// @param[in] Cond
+ /// The condition we want \a m_value satisfy.
///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
+ /// @param[in] timeout
+ /// How long to wait for the condition to hold.
///
/// @return
- /// Zero on successful waits, or non-zero if a timeout or
- /// unrecoverable error occurs.
+ /// @li m_value if Cond(m_value) is true.
+ /// @li None otherwise (timeout occurred).
//------------------------------------------------------------------
- T WaitForResetValueBits(T bits, const std::chrono::microseconds &timeout =
- std::chrono::microseconds(0)) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
+ template <typename C>
+ llvm::Optional<T> WaitFor(C Cond, const Timeout<std::micro> &timeout) {
std::unique_lock<std::mutex> lock(m_mutex);
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, bits, timeout.count(), m_value);
-#endif
- while ((m_value & bits) != 0) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout)
- break;
- }
+ auto RealCond = [&] { return Cond(m_value); };
+ if (!timeout) {
+ m_condition.wait(lock, RealCond);
+ return m_value;
}
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x), m_value = 0x%8.8x, returning 0x%8.8x\n",
- __FUNCTION__, bits, m_value, m_value & bits);
-#endif
- return m_value & bits;
+ if (m_condition.wait_for(lock, *timeout, RealCond))
+ return m_value;
+ return llvm::None;
}
-
//------------------------------------------------------------------
/// Wait for \a m_value to be equal to \a value.
///
@@ -298,124 +169,17 @@ public:
/// @param[in] value
/// The value we want \a m_value to be equal to.
///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
- ///
- /// @param[out] timed_out
- /// If not null, set to true if we return because of a time out,
- /// and false if the value was set.
+ /// @param[in] timeout
+ /// How long to wait for the condition to hold.
///
/// @return
/// @li \b true if the \a m_value is equal to \a value
- /// @li \b false otherwise
+ /// @li \b false otherwise (timeout occurred)
//------------------------------------------------------------------
- bool WaitForValueEqualTo(T value, const std::chrono::microseconds &timeout =
- std::chrono::microseconds(0),
- bool *timed_out = nullptr) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (value = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, value, timeout.count(), m_value);
-#endif
- if (timed_out)
- *timed_out = false;
-
- while (m_value != value) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout) {
- if (timed_out)
- *timed_out = true;
- break;
- }
- }
- }
-
- return m_value == value;
- }
-
- //------------------------------------------------------------------
- /// Wait for \a m_value to be equal to \a value and then set it to
- /// a new value.
- ///
- /// Waits in a thread safe way for \a m_value to be equal to \a
- /// value and then sets \a m_value to \a new_value. If \a m_value
- /// is already equal to \a value, this function will immediately
- /// set \a m_value to \a new_value and return without waiting.
- ///
- /// It is possible for the value to be changed between the time
- /// the value is set and the time the waiting thread wakes up.
- /// If the value no longer matches the requested value when the
- /// waiting thread wakes up, it will go back into a wait state. It
- /// may be necessary for the calling code to use additional thread
- /// synchronization methods to detect transitory states.
- ///
- /// @param[in] value
- /// The value we want \a m_value to be equal to.
- ///
- /// @param[in] new_value
- /// The value to which \a m_value will be set if \b true is
- /// returned.
- ///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
- ///
- /// @param[out] timed_out
- /// If not null, set to true if we return because of a time out,
- /// and false if the value was set.
- ///
- /// @return
- /// @li \b true if the \a m_value became equal to \a value
- /// @li \b false otherwise
- //------------------------------------------------------------------
- bool WaitForValueEqualToAndSetValueTo(
- T wait_value, T new_value,
- const std::chrono::microseconds &timeout = std::chrono::microseconds(0),
- bool *timed_out = nullptr) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (wait_value = 0x%8.8x, new_value = 0x%8.8x, timeout = %llu), "
- "m_value = 0x%8.8x\n",
- __FUNCTION__, wait_value, new_value, timeout.count(), m_value);
-#endif
- if (timed_out)
- *timed_out = false;
-
- while (m_value != wait_value) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout) {
- if (timed_out)
- *timed_out = true;
- break;
- }
- }
- }
-
- if (m_value == wait_value) {
- m_value = new_value;
- return true;
- }
-
- return false;
+ bool WaitForValueEqualTo(T value,
+ const Timeout<std::micro> &timeout = llvm::None) {
+ return WaitFor([&value](T current) { return value == current; }, timeout) !=
+ llvm::None;
}
//------------------------------------------------------------------
@@ -435,51 +199,23 @@ public:
/// @param[in] value
/// The value we want \a m_value to not be equal to.
///
- /// @param[out] new_value
- /// The new value if \b true is returned.
- ///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
+ /// @param[in] timeout
+ /// How long to wait for the condition to hold.
///
/// @return
- /// @li \b true if the \a m_value is equal to \a value
- /// @li \b false otherwise
+ /// @li m_value if m_value != value
+ /// @li None otherwise (timeout occurred).
//------------------------------------------------------------------
- bool WaitForValueNotEqualTo(
- T value, T &new_value,
- const std::chrono::microseconds &timeout = std::chrono::microseconds(0)) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (value = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, value, timeout.count(), m_value);
-#endif
- while (m_value == value) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout)
- break;
- }
- }
-
- if (m_value != value) {
- new_value = m_value;
- return true;
- }
- return false;
+ llvm::Optional<T>
+ WaitForValueNotEqualTo(T value,
+ const Timeout<std::micro> &timeout = llvm::None) {
+ return WaitFor([&value](T current) { return value != current; }, timeout);
}
protected:
//----------------------------------------------------------------------
- // pthread condition and mutex variable to control access and allow
- // blocking between the main thread and the spotlight index thread.
+ // pthread condition and mutex variable to control access and allow blocking
+ // between the main thread and the spotlight index thread.
//----------------------------------------------------------------------
T m_value; ///< The templatized value T that we are protecting access to
mutable std::mutex m_mutex; ///< The mutex to use when accessing the data
diff --git a/include/lldb/Host/ProcessRunLock.h b/include/lldb/Host/ProcessRunLock.h
index 7044fdbd9ef9..6f39eea716e8 100644
--- a/include/lldb/Host/ProcessRunLock.h
+++ b/include/lldb/Host/ProcessRunLock.h
@@ -26,9 +26,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ProcessRunLock ProcessRunLock.h "lldb/Host/ProcessRunLock.h"
-/// @brief A class used to prevent the process from starting while other
-/// threads are accessing its data, and prevent access to its data while
-/// it is running.
+/// A class used to prevent the process from starting while other
+/// threads are accessing its data, and prevent access to its data while it is
+/// running.
//----------------------------------------------------------------------
class ProcessRunLock {
diff --git a/include/lldb/Host/PseudoTerminal.h b/include/lldb/Host/PseudoTerminal.h
index 00c0da6f3315..858bd35f73a6 100644
--- a/include/lldb/Host/PseudoTerminal.h
+++ b/include/lldb/Host/PseudoTerminal.h
@@ -19,10 +19,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class PseudoTerminal PseudoTerminal.h "lldb/Host/PseudoTerminal.h"
-/// @brief A pseudo terminal helper class.
+/// A pseudo terminal helper class.
///
-/// The pseudo terminal class abstracts the use of pseudo terminals on
-/// the host system.
+/// The pseudo terminal class abstracts the use of pseudo terminals on the
+/// host system.
//----------------------------------------------------------------------
class PseudoTerminal {
public:
@@ -33,19 +33,17 @@ public:
//------------------------------------------------------------------
/// Default constructor
///
- /// Constructs this object with invalid master and slave file
- /// descriptors.
+ /// Constructs this object with invalid master and slave file descriptors.
//------------------------------------------------------------------
PseudoTerminal();
//------------------------------------------------------------------
/// Destructor
///
- /// The destructor will close the master and slave file descriptors
- /// if they are valid and ownership has not been released using
- /// one of:
- /// @li PseudoTerminal::ReleaseMasterFileDescriptor()
- /// @li PseudoTerminal::ReleaseSaveFileDescriptor()
+ /// The destructor will close the master and slave file descriptors if they
+ /// are valid and ownership has not been released using one of: @li
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() @li
+ /// PseudoTerminal::ReleaseSaveFileDescriptor()
//------------------------------------------------------------------
~PseudoTerminal();
@@ -62,20 +60,18 @@ public:
//------------------------------------------------------------------
/// Fork a child process that uses pseudo terminals for its stdio.
///
- /// In the parent process, a call to this function results in a pid
- /// being returned. If the pid is valid, the master file descriptor
- /// can be used for read/write access to stdio of the child process.
+ /// In the parent process, a call to this function results in a pid being
+ /// returned. If the pid is valid, the master file descriptor can be used
+ /// for read/write access to stdio of the child process.
///
- /// In the child process the stdin/stdout/stderr will already be
- /// routed to the slave pseudo terminal and the master file
- /// descriptor will be closed as it is no longer needed by the child
- /// process.
+ /// In the child process the stdin/stdout/stderr will already be routed to
+ /// the slave pseudo terminal and the master file descriptor will be closed
+ /// as it is no longer needed by the child process.
///
- /// This class will close the file descriptors for the master/slave
- /// when the destructor is called. The file handles can be released
- /// using either:
- /// @li PseudoTerminal::ReleaseMasterFileDescriptor()
- /// @li PseudoTerminal::ReleaseSaveFileDescriptor()
+ /// This class will close the file descriptors for the master/slave when the
+ /// destructor is called. The file handles can be released using either: @li
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() @li
+ /// PseudoTerminal::ReleaseSaveFileDescriptor()
///
/// @param[out] error
/// An pointer to an error that can describe any errors that
@@ -91,10 +87,10 @@ public:
//------------------------------------------------------------------
/// The master file descriptor accessor.
///
- /// This object retains ownership of the master file descriptor when
- /// this accessor is used. Users can call the member function
- /// PseudoTerminal::ReleaseMasterFileDescriptor() if this
- /// object should release ownership of the slave file descriptor.
+ /// This object retains ownership of the master file descriptor when this
+ /// accessor is used. Users can call the member function
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() if this object should
+ /// release ownership of the slave file descriptor.
///
/// @return
/// The master file descriptor, or PseudoTerminal::invalid_fd
@@ -107,10 +103,10 @@ public:
//------------------------------------------------------------------
/// The slave file descriptor accessor.
///
- /// This object retains ownership of the slave file descriptor when
- /// this accessor is used. Users can call the member function
- /// PseudoTerminal::ReleaseSlaveFileDescriptor() if this
- /// object should release ownership of the slave file descriptor.
+ /// This object retains ownership of the slave file descriptor when this
+ /// accessor is used. Users can call the member function
+ /// PseudoTerminal::ReleaseSlaveFileDescriptor() if this object should
+ /// release ownership of the slave file descriptor.
///
/// @return
/// The slave file descriptor, or PseudoTerminal::invalid_fd
@@ -146,12 +142,12 @@ public:
/// Open the first available pseudo terminal.
///
/// Opens the first available pseudo terminal with \a oflag as the
- /// permissions. The opened master file descriptor is stored in this
- /// object and can be accessed by calling the
- /// PseudoTerminal::GetMasterFileDescriptor() accessor. Clients
- /// can call the PseudoTerminal::ReleaseMasterFileDescriptor()
- /// accessor function if they wish to use the master file descriptor
- /// beyond the lifespan of this object.
+ /// permissions. The opened master file descriptor is stored in this object
+ /// and can be accessed by calling the
+ /// PseudoTerminal::GetMasterFileDescriptor() accessor. Clients can call the
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() accessor function if they
+ /// wish to use the master file descriptor beyond the lifespan of this
+ /// object.
///
/// If this object still has a valid master file descriptor when its
/// destructor is called, it will close it.
@@ -169,8 +165,8 @@ public:
/// successfully opened.
/// @li \b false if anything goes wrong.
///
- /// @see PseudoTerminal::GetMasterFileDescriptor()
- /// @see PseudoTerminal::ReleaseMasterFileDescriptor()
+ /// @see PseudoTerminal::GetMasterFileDescriptor() @see
+ /// PseudoTerminal::ReleaseMasterFileDescriptor()
//------------------------------------------------------------------
bool OpenFirstAvailableMaster(int oflag, char *error_str, size_t error_len);
@@ -178,12 +174,12 @@ public:
/// Open the slave for the current master pseudo terminal.
///
/// A master pseudo terminal should already be valid prior to
- /// calling this function. The opened slave file descriptor is
- /// stored in this object and can be accessed by calling the
- /// PseudoTerminal::GetSlaveFileDescriptor() accessor. Clients
- /// can call the PseudoTerminal::ReleaseSlaveFileDescriptor()
- /// accessor function if they wish to use the slave file descriptor
- /// beyond the lifespan of this object.
+ /// calling this function. The opened slave file descriptor is stored in
+ /// this object and can be accessed by calling the
+ /// PseudoTerminal::GetSlaveFileDescriptor() accessor. Clients can call the
+ /// PseudoTerminal::ReleaseSlaveFileDescriptor() accessor function if they
+ /// wish to use the slave file descriptor beyond the lifespan of this
+ /// object.
///
/// If this object still has a valid slave file descriptor when its
/// destructor is called, it will close it.
@@ -200,19 +196,19 @@ public:
/// successfully opened.
/// @li \b false if anything goes wrong.
///
- /// @see PseudoTerminal::OpenFirstAvailableMaster()
- /// @see PseudoTerminal::GetSlaveFileDescriptor()
- /// @see PseudoTerminal::ReleaseSlaveFileDescriptor()
+ /// @see PseudoTerminal::OpenFirstAvailableMaster() @see
+ /// PseudoTerminal::GetSlaveFileDescriptor() @see
+ /// PseudoTerminal::ReleaseSlaveFileDescriptor()
//------------------------------------------------------------------
bool OpenSlave(int oflag, char *error_str, size_t error_len);
//------------------------------------------------------------------
/// Release the master file descriptor.
///
- /// Releases ownership of the master pseudo terminal file descriptor
- /// without closing it. The destructor for this class will close the
- /// master file descriptor if the ownership isn't released using this
- /// call and the master file descriptor has been opened.
+ /// Releases ownership of the master pseudo terminal file descriptor without
+ /// closing it. The destructor for this class will close the master file
+ /// descriptor if the ownership isn't released using this call and the
+ /// master file descriptor has been opened.
///
/// @return
/// The master file descriptor, or PseudoTerminal::invalid_fd
@@ -223,10 +219,10 @@ public:
//------------------------------------------------------------------
/// Release the slave file descriptor.
///
- /// Release ownership of the slave pseudo terminal file descriptor
- /// without closing it. The destructor for this class will close the
- /// slave file descriptor if the ownership isn't released using this
- /// call and the slave file descriptor has been opened.
+ /// Release ownership of the slave pseudo terminal file descriptor without
+ /// closing it. The destructor for this class will close the slave file
+ /// descriptor if the ownership isn't released using this call and the slave
+ /// file descriptor has been opened.
///
/// @return
/// The slave file descriptor, or PseudoTerminal::invalid_fd
diff --git a/include/lldb/Host/Socket.h b/include/lldb/Host/Socket.h
index 37f468f23ce0..f6e51fd45679 100644
--- a/include/lldb/Host/Socket.h
+++ b/include/lldb/Host/Socket.h
@@ -60,10 +60,8 @@ public:
virtual Status Accept(Socket *&socket) = 0;
// Initialize a Tcp Socket object in listening mode. listen and accept are
- // implemented
- // separately because the caller may wish to manipulate or query the socket
- // after it is
- // initialized, but before entering a blocking accept.
+ // implemented separately because the caller may wish to manipulate or query
+ // the socket after it is initialized, but before entering a blocking accept.
static Status TcpListen(llvm::StringRef host_and_port,
bool child_processes_inherit, Socket *&socket,
Predicate<uint16_t> *predicate, int backlog = 5);
diff --git a/include/lldb/Host/SocketAddress.h b/include/lldb/Host/SocketAddress.h
index ebc6f4e57ee8..749a9c664c81 100644
--- a/include/lldb/Host/SocketAddress.h
+++ b/include/lldb/Host/SocketAddress.h
@@ -111,17 +111,16 @@ public:
uint16_t GetPort() const;
//------------------------------------------------------------------
- // Set the port if the socket address for the family has a port.
- // The family must be set correctly prior to calling this function.
+ // Set the port if the socket address for the family has a port. The family
+ // must be set correctly prior to calling this function.
//------------------------------------------------------------------
bool SetPort(uint16_t port);
//------------------------------------------------------------------
- // Set the socket address according to the first match from a call
- // to getaddrinfo() (or equivalent functions for systems that don't
- // have getaddrinfo(). If "addr_info_ptr" is not NULL, it will get
- // filled in with the match that was used to populate this socket
- // address.
+ // Set the socket address according to the first match from a call to
+ // getaddrinfo() (or equivalent functions for systems that don't have
+ // getaddrinfo(). If "addr_info_ptr" is not NULL, it will get filled in with
+ // the match that was used to populate this socket address.
//------------------------------------------------------------------
bool
getaddrinfo(const char *host, // Hostname ("foo.bar.com" or "foo" or IP
@@ -133,9 +132,9 @@ public:
int ai_protocol = 0, int ai_flags = 0);
//------------------------------------------------------------------
- // Quick way to set the SocketAddress to localhost given the family.
- // Returns true if successful, false if "family" doesn't support
- // localhost or if "family" is not supported by this class.
+ // Quick way to set the SocketAddress to localhost given the family. Returns
+ // true if successful, false if "family" doesn't support localhost or if
+ // "family" is not supported by this class.
//------------------------------------------------------------------
bool SetToLocalhost(sa_family_t family, uint16_t port);
@@ -190,11 +189,10 @@ public:
}
//------------------------------------------------------------------
- // Conversion operators to allow getting the contents of this class
- // as a pointer to the appropriate structure. This allows an instance
- // of this class to be used in calls that take one of the sockaddr
- // structure variants without having to manually use the correct
- // accessor function.
+ // Conversion operators to allow getting the contents of this class as a
+ // pointer to the appropriate structure. This allows an instance of this
+ // class to be used in calls that take one of the sockaddr structure variants
+ // without having to manually use the correct accessor function.
//------------------------------------------------------------------
operator struct sockaddr *() { return &m_socket_addr.sa; }
diff --git a/include/lldb/Host/StringConvert.h b/include/lldb/Host/StringConvert.h
index 05bd7808ecd4..d197df10d79e 100644
--- a/include/lldb/Host/StringConvert.h
+++ b/include/lldb/Host/StringConvert.h
@@ -24,7 +24,7 @@ namespace StringConvert {
//----------------------------------------------------------------------
/// @namespace StringConvert StringConvert.h "lldb/Host/StringConvert.h"
-/// @brief Utility classes for converting strings into Integers
+/// Utility classes for converting strings into Integers
//----------------------------------------------------------------------
int32_t ToSInt32(const char *s, int32_t fail_value = 0, int base = 0,
diff --git a/include/lldb/Host/Symbols.h b/include/lldb/Host/Symbols.h
index 5f8632d221f7..ce95d91497f8 100644
--- a/include/lldb/Host/Symbols.h
+++ b/include/lldb/Host/Symbols.h
@@ -29,16 +29,16 @@ public:
//----------------------------------------------------------------------
// Locate the executable file given a module specification.
//
- // Locating the file should happen only on the local computer or using
- // the current computers global settings.
+ // Locating the file should happen only on the local computer or using the
+ // current computers global settings.
//----------------------------------------------------------------------
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec);
//----------------------------------------------------------------------
// Locate the symbol file given a module specification.
//
- // Locating the file should happen only on the local computer or using
- // the current computers global settings.
+ // Locating the file should happen only on the local computer or using the
+ // current computers global settings.
//----------------------------------------------------------------------
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec);
@@ -51,10 +51,10 @@ public:
//
// Locating the file can try to download the file from a corporate build
// repository, or using any other means necessary to locate both the
- // unstripped object file and the debug symbols.
- // The force_lookup argument controls whether the external program is called
- // unconditionally to find the symbol file, or if the user's settings are
- // checked to see if they've enabled the external program before calling.
+ // unstripped object file and the debug symbols. The force_lookup argument
+ // controls whether the external program is called unconditionally to find
+ // the symbol file, or if the user's settings are checked to see if they've
+ // enabled the external program before calling.
//
//----------------------------------------------------------------------
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
diff --git a/include/lldb/Host/TaskPool.h b/include/lldb/Host/TaskPool.h
index 13076e7eb70b..fe1714151076 100644
--- a/include/lldb/Host/TaskPool.h
+++ b/include/lldb/Host/TaskPool.h
@@ -20,32 +20,27 @@
namespace lldb_private {
-// Global TaskPool class for running tasks in parallel on a set of worker thread
-// created the first
-// time the task pool is used. The TaskPool provide no guarantee about the order
-// the task will be run
-// and about what tasks will run in parallel. None of the task added to the task
-// pool should block
-// on something (mutex, future, condition variable) what will be set only by the
-// completion of an
-// other task on the task pool as they may run on the same thread sequentally.
+// Global TaskPool class for running tasks in parallel on a set of worker
+// thread created the first time the task pool is used. The TaskPool provide no
+// guarantee about the order the task will be run and about what tasks will run
+// in parallel. None of the task added to the task pool should block on
+// something (mutex, future, condition variable) what will be set only by the
+// completion of an other task on the task pool as they may run on the same
+// thread sequentally.
class TaskPool {
public:
// Add a new task to the task pool and return a std::future belonging to the
- // newly created task.
- // The caller of this function has to wait on the future for this task to
- // complete.
+ // newly created task. The caller of this function has to wait on the future
+ // for this task to complete.
template <typename F, typename... Args>
static std::future<typename std::result_of<F(Args...)>::type>
AddTask(F &&f, Args &&... args);
// Run all of the specified tasks on the task pool and wait until all of them
- // are finished
- // before returning. This method is intended to be used for small number tasks
- // where listing
- // them as function arguments is acceptable. For running large number of tasks
- // you should use
- // AddTask for each task and then call wait() on each returned future.
+ // are finished before returning. This method is intended to be used for
+ // small number tasks where listing them as function arguments is acceptable.
+ // For running large number of tasks you should use AddTask for each task and
+ // then call wait() on each returned future.
template <typename... T> static void RunTasks(T &&... tasks);
private:
diff --git a/include/lldb/Host/Terminal.h b/include/lldb/Host/Terminal.h
index f0d93ad24ed6..193b6d21d51e 100644
--- a/include/lldb/Host/Terminal.h
+++ b/include/lldb/Host/Terminal.h
@@ -44,7 +44,7 @@ protected:
//----------------------------------------------------------------------
/// @class State Terminal.h "lldb/Host/Terminal.h"
-/// @brief A terminal state saving/restoring class.
+/// A terminal state saving/restoring class.
///
/// This class can be used to remember the terminal state for a file
/// descriptor and later restore that state as it originally was.
@@ -64,9 +64,9 @@ public:
//------------------------------------------------------------------
/// Save the TTY state for \a fd.
///
- /// Save the current state of the TTY for the file descriptor "fd"
- /// and if "save_process_group" is true, attempt to save the process
- /// group info for the TTY.
+ /// Save the current state of the TTY for the file descriptor "fd" and if
+ /// "save_process_group" is true, attempt to save the process group info for
+ /// the TTY.
///
/// @param[in] fd
/// The file descriptor to save the state of.
@@ -84,8 +84,8 @@ public:
//------------------------------------------------------------------
/// Restore the TTY state to the cached state.
///
- /// Restore the state of the TTY using the cached values from a
- /// previous call to TerminalState::Save(int,bool).
+ /// Restore the state of the TTY using the cached values from a previous
+ /// call to TerminalState::Save(int,bool).
///
/// @return
/// Returns \b true if the TTY state was successfully restored,
@@ -147,7 +147,7 @@ protected:
//----------------------------------------------------------------------
/// @class TerminalStateSwitcher Terminal.h "lldb/Host/Terminal.h"
-/// @brief A TTY state switching class.
+/// A TTY state switching class.
///
/// This class can be used to remember 2 TTY states for a given file
/// descriptor and switch between the two states.
@@ -182,10 +182,9 @@ public:
bool Restore(uint32_t idx) const;
//------------------------------------------------------------------
- /// Save the TTY state information for the state at index \a idx.
- /// The TTY state is saved for the file descriptor \a fd and
- /// the process group information will also be saved if requested
- /// by \a save_process_group.
+ /// Save the TTY state information for the state at index \a idx. The TTY
+ /// state is saved for the file descriptor \a fd and the process group
+ /// information will also be saved if requested by \a save_process_group.
///
/// @param[in] idx
/// The index into the state array where the state should be
diff --git a/include/lldb/Host/XML.h b/include/lldb/Host/XML.h
index 96b5227305e1..5088f1f25b0d 100644
--- a/include/lldb/Host/XML.h
+++ b/include/lldb/Host/XML.h
@@ -82,6 +82,9 @@ public:
llvm::StringRef GetAttributeValue(const char *name,
const char *fail_value = nullptr) const;
+ bool GetAttributeValueAsUnsigned(const char *name, uint64_t &value,
+ uint64_t fail_value = 0, int base = 0) const;
+
XMLNode FindFirstChildElementWithName(const char *name) const;
XMLNode GetElementForPath(const NamePath &path);
@@ -97,8 +100,8 @@ public:
void ForEachSiblingElement(NodeCallback const &callback) const;
//----------------------------------------------------------------------
- // Iterate through only the sibling nodes that are elements and whose
- // name matches \a name.
+ // Iterate through only the sibling nodes that are elements and whose name
+ // matches \a name.
//----------------------------------------------------------------------
void ForEachSiblingElementWithName(const char *name,
NodeCallback const &callback) const;
@@ -134,8 +137,8 @@ public:
const char *url = "untitled.xml");
//----------------------------------------------------------------------
- // If \a name is nullptr, just get the root element node, else only return
- // a value XMLNode if the name of the root element matches \a name.
+ // If \a name is nullptr, just get the root element node, else only return a
+ // value XMLNode if the name of the root element matches \a name.
//----------------------------------------------------------------------
XMLNode GetRootElement(const char *required_name = nullptr);
@@ -173,12 +176,11 @@ public:
StructuredData::ObjectSP GetStructuredData();
protected:
- // Using a node returned from GetValueNode() extract its value as a
- // string (if possible). Array and dictionary nodes will return false
- // as they have no string value. Boolean nodes will return true and
- // \a value will be "true" or "false" as the string value comes from
- // the element name itself. All other nodes will return the text
- // content of the XMLNode.
+ // Using a node returned from GetValueNode() extract its value as a string
+ // (if possible). Array and dictionary nodes will return false as they have
+ // no string value. Boolean nodes will return true and \a value will be
+ // "true" or "false" as the string value comes from the element name itself.
+ // All other nodes will return the text content of the XMLNode.
static bool ExtractStringFromValueNode(const XMLNode &node,
std::string &value);
diff --git a/include/lldb/Host/common/GetOptInc.h b/include/lldb/Host/common/GetOptInc.h
index 4d5cab5cbec2..c69f7227a5cf 100644
--- a/include/lldb/Host/common/GetOptInc.h
+++ b/include/lldb/Host/common/GetOptInc.h
@@ -19,8 +19,8 @@
// option structure
struct option {
const char *name;
- // has_arg can't be an enum because some compilers complain about
- // type mismatches in all the code that assumes it is an int.
+ // has_arg can't be an enum because some compilers complain about type
+ // mismatches in all the code that assumes it is an int.
int has_arg;
int *flag;
int val;
diff --git a/include/lldb/Host/common/NativeBreakpoint.h b/include/lldb/Host/common/NativeBreakpoint.h
index 73639d64c9e8..681570aadef0 100644
--- a/include/lldb/Host/common/NativeBreakpoint.h
+++ b/include/lldb/Host/common/NativeBreakpoint.h
@@ -45,8 +45,8 @@ protected:
private:
bool m_enabled;
- // -----------------------------------------------------------
- // interface for NativeBreakpointList
+ // ----------------------------------------------------------- interface for
+ // NativeBreakpointList
// -----------------------------------------------------------
void AddRef();
int32_t DecRef();
diff --git a/include/lldb/Host/common/NativeProcessProtocol.h b/include/lldb/Host/common/NativeProcessProtocol.h
index bd8b8744b115..d96835d75839 100644
--- a/include/lldb/Host/common/NativeProcessProtocol.h
+++ b/include/lldb/Host/common/NativeProcessProtocol.h
@@ -69,8 +69,8 @@ public:
virtual Status Kill() = 0;
//------------------------------------------------------------------
- // Tells a process not to stop the inferior on given signals
- // and just reinject them back.
+ // Tells a process not to stop the inferior on given signals and just
+ // reinject them back.
//------------------------------------------------------------------
virtual Status IgnoreSignals(llvm::ArrayRef<int> signals);
@@ -421,33 +421,30 @@ protected:
int m_terminal_fd;
uint32_t m_stop_id = 0;
- // Set of signal numbers that LLDB directly injects back to inferior
- // without stopping it.
+ // Set of signal numbers that LLDB directly injects back to inferior without
+ // stopping it.
llvm::DenseSet<int> m_signals_to_ignore;
// lldb_private::Host calls should be used to launch a process for debugging,
- // and
- // then the process should be attached to. When attaching to a process
- // lldb_private::Host calls should be used to locate the process to attach to,
- // and then this function should be called.
+ // and then the process should be attached to. When attaching to a process
+ // lldb_private::Host calls should be used to locate the process to attach
+ // to, and then this function should be called.
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd,
NativeDelegate &delegate);
- // -----------------------------------------------------------
- // Internal interface for state handling
+ // ----------------------------------------------------------- Internal
+ // interface for state handling
// -----------------------------------------------------------
void SetState(lldb::StateType state, bool notify_delegates = true);
- // Derived classes need not implement this. It can be used as a
- // hook to clear internal caches that should be invalidated when
- // stop ids change.
+ // Derived classes need not implement this. It can be used as a hook to
+ // clear internal caches that should be invalidated when stop ids change.
//
- // Note this function is called with the state mutex obtained
- // by the caller.
+ // Note this function is called with the state mutex obtained by the caller.
virtual void DoStopIDBumped(uint32_t newBumpId);
- // -----------------------------------------------------------
- // Internal interface for software breakpoints
+ // ----------------------------------------------------------- Internal
+ // interface for software breakpoints
// -----------------------------------------------------------
Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint);
@@ -466,11 +463,6 @@ protected:
NativeThreadProtocol *GetThreadByIDUnlocked(lldb::tid_t tid);
- // -----------------------------------------------------------
- // Static helper methods for derived classes.
- // -----------------------------------------------------------
- static Status ResolveProcessArchitecture(lldb::pid_t pid, ArchSpec &arch);
-
private:
void SynchronouslyNotifyProcessStateChanged(lldb::StateType state);
};
diff --git a/include/lldb/Host/common/NativeRegisterContext.h b/include/lldb/Host/common/NativeRegisterContext.h
index a8c5fa17e264..26458db153c1 100644
--- a/include/lldb/Host/common/NativeRegisterContext.h
+++ b/include/lldb/Host/common/NativeRegisterContext.h
@@ -98,17 +98,14 @@ public:
virtual lldb::addr_t GetWatchpointAddress(uint32_t wp_index);
// MIPS Linux kernel returns a masked address (last 3bits are masked)
- // when a HW watchpoint is hit. However user may not have set a watchpoint
- // on this address. This function emulates the instruction at PC and
- // finds the base address used in the load/store instruction. This gives the
- // exact address used to read/write the variable being watched.
- // For example:
- // 'n' is at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at
- // 'm',
+ // when a HW watchpoint is hit. However user may not have set a watchpoint on
+ // this address. This function emulates the instruction at PC and finds the
+ // base address used in the load/store instruction. This gives the exact
+ // address used to read/write the variable being watched. For example: 'n' is
+ // at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at 'm',
// then watch exception is generated even when 'n' is read/written. This
- // function
- // returns address of 'n' so that client can check whether a watchpoint is set
- // on this address or not.
+ // function returns address of 'n' so that client can check whether a
+ // watchpoint is set on this address or not.
virtual lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index);
virtual bool HardwareSingleStep(bool enable);
diff --git a/include/lldb/Host/common/NativeThreadProtocol.h b/include/lldb/Host/common/NativeThreadProtocol.h
index 5609cdda4eea..6f4452c688e7 100644
--- a/include/lldb/Host/common/NativeThreadProtocol.h
+++ b/include/lldb/Host/common/NativeThreadProtocol.h
@@ -32,14 +32,6 @@ public:
virtual NativeRegisterContext &GetRegisterContext() = 0;
- virtual Status ReadRegister(uint32_t reg, RegisterValue &reg_value);
-
- virtual Status WriteRegister(uint32_t reg, const RegisterValue &reg_value);
-
- virtual Status SaveAllRegisters(lldb::DataBufferSP &data_sp);
-
- virtual Status RestoreAllRegisters(lldb::DataBufferSP &data_sp);
-
virtual bool GetStopReason(ThreadStopInfo &stop_info,
std::string &description) = 0;
diff --git a/include/lldb/Host/freebsd/HostInfoFreeBSD.h b/include/lldb/Host/freebsd/HostInfoFreeBSD.h
index 945ec835f778..5b3a18d21079 100644
--- a/include/lldb/Host/freebsd/HostInfoFreeBSD.h
+++ b/include/lldb/Host/freebsd/HostInfoFreeBSD.h
@@ -12,12 +12,13 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
class HostInfoFreeBSD : public HostInfoPosix {
public:
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static FileSpec GetProgramFileSpec();
diff --git a/include/lldb/Host/linux/HostInfoLinux.h b/include/lldb/Host/linux/HostInfoLinux.h
index d1f2e747b117..820d3bd17a2e 100644
--- a/include/lldb/Host/linux/HostInfoLinux.h
+++ b/include/lldb/Host/linux/HostInfoLinux.h
@@ -12,8 +12,8 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
-
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/VersionTuple.h"
#include <string>
@@ -30,7 +30,7 @@ private:
public:
static void Initialize();
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static llvm::StringRef GetDistributionId();
diff --git a/include/lldb/Host/macosx/HostInfoMacOSX.h b/include/lldb/Host/macosx/HostInfoMacOSX.h
index eee842beec87..d5b0bfd861c0 100644
--- a/include/lldb/Host/macosx/HostInfoMacOSX.h
+++ b/include/lldb/Host/macosx/HostInfoMacOSX.h
@@ -12,6 +12,7 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -26,7 +27,7 @@ private:
~HostInfoMacOSX();
public:
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static FileSpec GetProgramFileSpec();
@@ -36,8 +37,6 @@ protected:
static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
ArchSpec &arch_64);
static bool ComputeHeaderDirectory(FileSpec &file_spec);
- static bool ComputePythonDirectory(FileSpec &file_spec);
- static bool ComputeClangDirectory(FileSpec &file_spec);
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
};
diff --git a/include/lldb/Host/netbsd/HostInfoNetBSD.h b/include/lldb/Host/netbsd/HostInfoNetBSD.h
index 9ebff6ba6b0e..0d4de79d03b1 100644
--- a/include/lldb/Host/netbsd/HostInfoNetBSD.h
+++ b/include/lldb/Host/netbsd/HostInfoNetBSD.h
@@ -12,12 +12,13 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
class HostInfoNetBSD : public HostInfoPosix {
public:
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static FileSpec GetProgramFileSpec();
diff --git a/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h b/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
index b7e08eb33af7..0d125ca2c813 100644
--- a/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
+++ b/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
@@ -72,7 +72,7 @@ public:
lldb::IOObjectSP GetReadObject() override { return m_read_sp; }
- uint16_t GetListeningPort(uint32_t timeout_sec);
+ uint16_t GetListeningPort(const Timeout<std::micro> &timeout);
bool GetChildProcessesInherit() const;
void SetChildProcessesInherit(bool child_processes_inherit);
@@ -104,8 +104,8 @@ protected:
Predicate<uint16_t>
m_port_predicate; // Used when binding to port zero to wait for the thread
- // that creates the socket, binds and listens to resolve
- // the port number.
+ // that creates the socket, binds and listens to
+ // resolve the port number.
Pipe m_pipe;
std::recursive_mutex m_mutex;
diff --git a/include/lldb/Host/posix/HostInfoPosix.h b/include/lldb/Host/posix/HostInfoPosix.h
index 34994aea44fe..dda70f9f5a96 100644
--- a/include/lldb/Host/posix/HostInfoPosix.h
+++ b/include/lldb/Host/posix/HostInfoPosix.h
@@ -33,13 +33,12 @@ public:
static bool GetEnvironmentVar(const std::string &var_name, std::string &var);
+ static bool ComputePathRelativeToLibrary(FileSpec &file_spec,
+ llvm::StringRef dir);
+
protected:
static bool ComputeSupportExeDirectory(FileSpec &file_spec);
static bool ComputeHeaderDirectory(FileSpec &file_spec);
- static bool ComputePythonDirectory(FileSpec &file_spec);
- static bool ComputeClangDirectory(FileSpec &file_spec);
- static bool ComputePathRelativeToLibrary(FileSpec &file_spec,
- llvm::StringRef dir);
};
}
diff --git a/include/lldb/Host/posix/PipePosix.h b/include/lldb/Host/posix/PipePosix.h
index 8208b1b8bd6b..bb65a56abd00 100644
--- a/include/lldb/Host/posix/PipePosix.h
+++ b/include/lldb/Host/posix/PipePosix.h
@@ -17,7 +17,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class PipePosix PipePosix.h "lldb/Host/posix/PipePosix.h"
-/// @brief A posix-based implementation of Pipe, a class that abtracts
+/// A posix-based implementation of Pipe, a class that abtracts
/// unix style pipes.
///
/// A class that abstracts the LLDB core from host pipe functionality.
diff --git a/include/lldb/Host/windows/HostInfoWindows.h b/include/lldb/Host/windows/HostInfoWindows.h
index 9dfbf93591ed..24949e6001f7 100644
--- a/include/lldb/Host/windows/HostInfoWindows.h
+++ b/include/lldb/Host/windows/HostInfoWindows.h
@@ -12,6 +12,7 @@
#include "lldb/Host/HostInfoBase.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -29,7 +30,7 @@ public:
static size_t GetPageSize();
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static bool GetHostname(std::string &s);
@@ -38,9 +39,6 @@ public:
static bool GetEnvironmentVar(const std::string &var_name, std::string &var);
-protected:
- static bool ComputePythonDirectory(FileSpec &file_spec);
-
private:
static FileSpec m_program_filespec;
};
diff --git a/include/lldb/Host/windows/PipeWindows.h b/include/lldb/Host/windows/PipeWindows.h
index 86dec5a79d8e..e309c421a71c 100644
--- a/include/lldb/Host/windows/PipeWindows.h
+++ b/include/lldb/Host/windows/PipeWindows.h
@@ -17,7 +17,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Pipe PipeWindows.h "lldb/Host/windows/PipeWindows.h"
-/// @brief A windows-based implementation of Pipe, a class that abtracts
+/// A windows-based implementation of Pipe, a class that abtracts
/// unix style pipes.
///
/// A class that abstracts the LLDB core from host pipe functionality.
diff --git a/include/lldb/Host/windows/PosixApi.h b/include/lldb/Host/windows/PosixApi.h
index de70266a5efb..801107dadceb 100644
--- a/include/lldb/Host/windows/PosixApi.h
+++ b/include/lldb/Host/windows/PosixApi.h
@@ -11,7 +11,7 @@
#define liblldb_Host_windows_PosixApi_h
#include "llvm/Support/Compiler.h"
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
#error "windows/PosixApi.h being #included on non Windows system!"
#endif
diff --git a/include/lldb/Interpreter/CommandAlias.h b/include/lldb/Interpreter/CommandAlias.h
index 4658a1e444f4..01522bd6ecea 100644
--- a/include/lldb/Interpreter/CommandAlias.h
+++ b/include/lldb/Interpreter/CommandAlias.h
@@ -16,8 +16,9 @@
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/lldb-forward.h"
namespace lldb_private {
@@ -40,17 +41,11 @@ public:
bool WantsCompletion() override;
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override;
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
Options *GetOptions() override;
@@ -74,8 +69,8 @@ public:
OptionArgVectorSP GetOptionArguments() const { return m_option_args_sp; }
const char *GetOptionString() { return m_option_string.c_str(); }
- // this takes an alias - potentially nested (i.e. an alias to an alias)
- // and expands it all the way to a non-alias command
+ // this takes an alias - potentially nested (i.e. an alias to an alias) and
+ // expands it all the way to a non-alias command
std::pair<lldb::CommandObjectSP, OptionArgVectorSP> Desugar();
protected:
diff --git a/include/lldb/Interpreter/CommandCompletions.h b/include/lldb/Interpreter/CommandCompletions.h
index 8bac3e8639d7..d17864e05f3e 100644
--- a/include/lldb/Interpreter/CommandCompletions.h
+++ b/include/lldb/Interpreter/CommandCompletions.h
@@ -18,6 +18,7 @@
// Project includes
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/SearchFilter.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/lldb-private.h"
@@ -29,20 +30,13 @@ class CommandCompletions {
public:
//----------------------------------------------------------------------
// This is the command completion callback that is used to complete the
- // argument of the option
- // it is bound to (in the OptionDefinition table below). Return the total
- // number of matches.
+ // argument of the option it is bound to (in the OptionDefinition table
+ // below). Return the total number of matches.
//----------------------------------------------------------------------
- typedef int (*CompletionCallback)(
- CommandInterpreter &interpreter,
- llvm::StringRef completion_str, // This is the argument we are completing
- int match_start_point, // This is the point in the list of matches that
- // you should start returning elements
- int max_return_elements, // This is the number of matches requested.
- lldb_private::SearchFilter
- *searcher, // A search filter to limit the search...
- bool &word_complete,
- lldb_private::StringList &matches); // The array of matches we return.
+ typedef int (*CompletionCallback)(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ // A search filter to limit the search...
+ lldb_private::SearchFilter *searcher);
typedef enum {
eNoCompletion = 0u,
eSourceFileCompletion = (1u << 0),
@@ -54,9 +48,9 @@ public:
ePlatformPluginCompletion = (1u << 6),
eArchitectureCompletion = (1u << 7),
eVariablePathCompletion = (1u << 8),
- // This item serves two purposes. It is the last element in the enum,
- // so you can add custom enums starting from here in your Option class.
- // Also if you & in this bit the base code will not process the option.
+ // This item serves two purposes. It is the last element in the enum, so
+ // you can add custom enums starting from here in your Option class. Also
+ // if you & in this bit the base code will not process the option.
eCustomCompletion = (1u << 9)
} CommonCompletionTypes;
@@ -67,81 +61,55 @@ public:
static bool InvokeCommonCompletionCallbacks(
CommandInterpreter &interpreter, uint32_t completion_mask,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, SearchFilter *searcher, bool &word_complete,
- StringList &matches);
+ lldb_private::CompletionRequest &request, SearchFilter *searcher);
//----------------------------------------------------------------------
// These are the generic completer functions:
//----------------------------------------------------------------------
static int DiskFiles(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name, int match_start_point,
- int max_return_elements, SearchFilter *searcher,
- bool &word_complete, StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int DiskFiles(const llvm::Twine &partial_file_name,
StringList &matches, TildeExpressionResolver &Resolver);
static int DiskDirectories(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches);
+ CompletionRequest &request,
+ SearchFilter *searcher);
static int DiskDirectories(const llvm::Twine &partial_file_name,
StringList &matches,
TildeExpressionResolver &Resolver);
static int SourceFiles(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int Modules(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name, int match_start_point,
- int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int Symbols(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name, int match_start_point,
- int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int SettingsNames(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int PlatformPluginNames(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request,
+ SearchFilter *searcher);
static int ArchitectureNames(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request,
+ SearchFilter *searcher);
static int VariablePath(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
//----------------------------------------------------------------------
- // The Completer class is a convenient base class for building searchers
- // that go along with the SearchFilter passed to the standard Completer
- // functions.
+ // The Completer class is a convenient base class for building searchers that
+ // go along with the SearchFilter passed to the standard Completer functions.
//----------------------------------------------------------------------
class Completer : public Searcher {
public:
- Completer(CommandInterpreter &interpreter, llvm::StringRef completion_str,
- int match_start_point, int max_return_elements,
- StringList &matches);
+ Completer(CommandInterpreter &interpreter, CompletionRequest &request);
~Completer() override;
@@ -154,10 +122,7 @@ public:
protected:
CommandInterpreter &m_interpreter;
- std::string m_completion_str;
- int m_match_start_point;
- int m_max_return_elements;
- StringList &m_matches;
+ CompletionRequest &m_request;
private:
DISALLOW_COPY_AND_ASSIGN(Completer);
@@ -169,9 +134,7 @@ public:
class SourceFileCompleter : public Completer {
public:
SourceFileCompleter(CommandInterpreter &interpreter,
- bool include_support_files,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches);
+ bool include_support_files, CompletionRequest &request);
Searcher::Depth GetDepth() override;
@@ -197,8 +160,7 @@ public:
class ModuleCompleter : public Completer {
public:
ModuleCompleter(CommandInterpreter &interpreter,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches);
+ CompletionRequest &request);
Searcher::Depth GetDepth() override;
@@ -222,8 +184,7 @@ public:
class SymbolCompleter : public Completer {
public:
SymbolCompleter(CommandInterpreter &interpreter,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches);
+ CompletionRequest &request);
Searcher::Depth GetDepth() override;
diff --git a/include/lldb/Interpreter/CommandInterpreter.h b/include/lldb/Interpreter/CommandInterpreter.h
index 5e561f47946d..78f505c24754 100644
--- a/include/lldb/Interpreter/CommandInterpreter.h
+++ b/include/lldb/Interpreter/CommandInterpreter.h
@@ -19,11 +19,12 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Event.h"
#include "lldb/Core/IOHandler.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandAlias.h"
#include "lldb/Interpreter/CommandHistory.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h"
@@ -86,11 +87,10 @@ public:
m_add_to_history = value;
}
// These return the default behaviors if the behavior is not
- // eLazyBoolCalculate.
- // But I've also left the ivars public since for different ways of running the
- // interpreter you might want to force different defaults... In that case,
- // just grab
- // the LazyBool ivars directly and do what you want with eLazyBoolCalculate.
+ // eLazyBoolCalculate. But I've also left the ivars public since for
+ // different ways of running the interpreter you might want to force
+ // different defaults... In that case, just grab the LazyBool ivars directly
+ // and do what you want with eLazyBoolCalculate.
bool GetStopOnContinue() const { return DefaultToNo(m_stop_on_continue); }
void SetStopOnContinue(bool stop_on_continue) {
@@ -293,26 +293,19 @@ public:
CommandObject *GetCommandObjectForCommand(llvm::StringRef &command_line);
// This handles command line completion. You are given a pointer to the
- // command string buffer, to the current cursor,
- // and to the end of the string (in case it is not NULL terminated).
- // You also passed in an StringList object to fill with the returns.
- // The first element of the array will be filled with the string that you
- // would need to insert at
- // the cursor point to complete the cursor point to the longest common
- // matching prefix.
- // If you want to limit the number of elements returned, set
- // max_return_elements to the number of elements
- // you want returned. Otherwise set max_return_elements to -1.
- // If you want to start some way into the match list, then set
- // match_start_point to the desired start
- // point.
- // Returns:
- // -1 if the completion character should be inserted
- // -2 if the entire command line should be deleted and replaced with
- // matches.GetStringAtIndex(0)
+ // command string buffer, to the current cursor, and to the end of the string
+ // (in case it is not NULL terminated). You also passed in an StringList
+ // object to fill with the returns. The first element of the array will be
+ // filled with the string that you would need to insert at the cursor point
+ // to complete the cursor point to the longest common matching prefix. If you
+ // want to limit the number of elements returned, set max_return_elements to
+ // the number of elements you want returned. Otherwise set
+ // max_return_elements to -1. If you want to start some way into the match
+ // list, then set match_start_point to the desired start point. Returns: -1
+ // if the completion character should be inserted -2 if the entire command
+ // line should be deleted and replaced with matches.GetStringAtIndex(0)
// INT_MAX if the number of matches is > max_return_elements, but it is
- // expensive to compute.
- // Otherwise, returns the number of matches.
+ // expensive to compute. Otherwise, returns the number of matches.
//
// FIXME: Only max_return_elements == -1 is supported at present.
int HandleCompletion(const char *current_line, const char *cursor,
@@ -320,15 +313,9 @@ public:
int max_return_elements, StringList &matches);
// This version just returns matches, and doesn't compute the substring. It
- // is here so the
- // Help command can call it for the first argument.
- // word_complete tells whether the completions are considered a "complete"
- // response (so the
- // completer should complete the quote & put a space after the word.
- int HandleCompletionMatches(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ // is here so the Help command can call it for the first argument. It uses
+ // a CompletionRequest for simplicity reasons.
+ int HandleCompletionMatches(CompletionRequest &request);
int GetCommandNamesMatchingPartialString(const char *cmd_cstr,
bool include_aliases,
@@ -469,6 +456,30 @@ public:
void SetPromptOnQuit(bool b);
+ //------------------------------------------------------------------
+ /// Specify if the command interpreter should allow that the user can
+ /// specify a custom exit code when calling 'quit'.
+ //------------------------------------------------------------------
+ void AllowExitCodeOnQuit(bool allow);
+
+ //------------------------------------------------------------------
+ /// Sets the exit code for the quit command.
+ /// @param[in] exit_code
+ /// The exit code that the driver should return on exit.
+ /// @return True if the exit code was successfully set; false if the
+ /// interpreter doesn't allow custom exit codes.
+ /// @see AllowExitCodeOnQuit
+ //------------------------------------------------------------------
+ LLVM_NODISCARD bool SetQuitExitCode(int exit_code);
+
+ //------------------------------------------------------------------
+ /// Returns the exit code that the user has specified when running the
+ /// 'quit' command.
+ /// @param[out] exited
+ /// Set to true if the user has called quit with a custom exit code.
+ //------------------------------------------------------------------
+ int GetQuitExitCode(bool &exited) const;
+
void ResolveCommand(const char *command_line, CommandReturnObject &result);
bool GetStopCmdSourceOnError() const;
@@ -572,6 +583,12 @@ private:
uint32_t m_num_errors;
bool m_quit_requested;
bool m_stopped_for_crash;
+
+ // The exit code the user has requested when calling the 'quit' command.
+ // No value means the user hasn't set a custom exit code so far.
+ llvm::Optional<int> m_quit_exit_code;
+ // If the driver is accepts custom exit codes for the 'quit' command.
+ bool m_allow_exit_code = false;
};
} // namespace lldb_private
diff --git a/include/lldb/Interpreter/CommandObject.h b/include/lldb/Interpreter/CommandObject.h
index ff4c829e5c70..7afb18b2f598 100644
--- a/include/lldb/Interpreter/CommandObject.h
+++ b/include/lldb/Interpreter/CommandObject.h
@@ -20,9 +20,11 @@
// Project includes
#include "lldb/Utility/Flags.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
+#include "lldb/Interpreter/Options.h"
#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-private.h"
@@ -31,9 +33,8 @@ namespace lldb_private {
// This function really deals with CommandObjectLists, but we didn't make a
// CommandObjectList class, so I'm sticking it here. But we really should have
// such a class. Anyway, it looks up the commands in the map that match the
-// partial
-// string cmd_str, inserts the matches into matches, and returns the number
-// added.
+// partial string cmd_str, inserts the matches into matches, and returns the
+// number added.
template <typename ValueType>
int AddNamesMatchingPartialString(const std::map<std::string, ValueType> &in_map,
@@ -137,8 +138,8 @@ public:
void SetSyntax(llvm::StringRef str);
- // override this to return true if you want to enable the user to delete
- // the Command object from the Command dictionary (aliases have their own
+ // override this to return true if you want to enable the user to delete the
+ // Command object from the Command dictionary (aliases have their own
// deletion scheme, so they do not need to care about this)
virtual bool IsRemovable() const { return false; }
@@ -148,9 +149,9 @@ public:
virtual bool IsAlias() { return false; }
- // override this to return true if your command is somehow a "dash-dash"
- // form of some other command (e.g. po is expr -O --); this is a powerful
- // hint to the help system that one cannot pass options to this command
+ // override this to return true if your command is somehow a "dash-dash" form
+ // of some other command (e.g. po is expr -O --); this is a powerful hint to
+ // the help system that one cannot pass options to this command
virtual bool IsDashDashCommand() { return false; }
virtual lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd,
@@ -174,10 +175,9 @@ public:
virtual void GenerateHelpText(Stream &result);
- // this is needed in order to allow the SBCommand class to
- // transparently try and load subcommands - it will fail on
- // anything but a multiword command, but it avoids us doing
- // type checkings and casts
+ // this is needed in order to allow the SBCommand class to transparently try
+ // and load subcommands - it will fail on anything but a multiword command,
+ // but it avoids us doing type checkings and casts
virtual bool LoadSubCommand(llvm::StringRef cmd_name,
const lldb::CommandObjectSP &command_obj) {
return false;
@@ -185,9 +185,9 @@ public:
virtual bool WantsRawCommandString() = 0;
- // By default, WantsCompletion = !WantsRawCommandString.
- // Subclasses who want raw command string but desire, for example,
- // argument completion should override this method to return true.
+ // By default, WantsCompletion = !WantsRawCommandString. Subclasses who want
+ // raw command string but desire, for example, argument completion should
+ // override this method to return true.
virtual bool WantsCompletion() { return !WantsRawCommandString(); }
virtual Options *GetOptions();
@@ -209,10 +209,10 @@ public:
static const char *GetArgumentName(lldb::CommandArgumentType arg_type);
// Generates a nicely formatted command args string for help command output.
- // By default, all possible args are taken into account, for example,
- // '<expr | variable-name>'. This can be refined by passing a second arg
- // specifying which option set(s) we are interested, which could then, for
- // example, produce either '<expr>' or '<variable-name>'.
+ // By default, all possible args are taken into account, for example, '<expr
+ // | variable-name>'. This can be refined by passing a second arg specifying
+ // which option set(s) we are interested, which could then, for example,
+ // produce either '<expr>' or '<variable-name>'.
void GetFormattedCommandArguments(Stream &str,
uint32_t opt_set_mask = LLDB_OPT_SET_ALL);
@@ -223,44 +223,13 @@ public:
void SetCommandName(llvm::StringRef name);
//------------------------------------------------------------------
- /// The input array contains a parsed version of the line. The insertion
- /// point is given by cursor_index (the index in input of the word containing
- /// the cursor) and cursor_char_position (the position of the cursor in that
- /// word.)
/// This default version handles calling option argument completions and then
- /// calls
- /// HandleArgumentCompletion if the cursor is on an argument, not an option.
- /// Don't override this method, override HandleArgumentCompletion instead
- /// unless
- /// you have special reasons.
- ///
- /// @param[in] interpreter
- /// The command interpreter doing the completion.
- ///
- /// @param[in] input
- /// The command line parsed into words
- ///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] cursor_char_pos
- /// The character position of the cursor in its argument word.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// FIXME: Not yet implemented... If there is a match that is expensive
- /// to compute, these are
- /// here to allow you to compute the completions in batches. Start the
- /// completion from \amatch_start_point,
- /// and return \amatch_return_elements elements.
+ /// calls HandleArgumentCompletion if the cursor is on an argument, not an
+ /// option. Don't override this method, override HandleArgumentCompletion
+ /// instead unless you have special reasons.
///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will be inserted
- /// after the
- /// completion.) \bfalse otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
+ /// @param[in/out] request
+ /// The completion request that needs to be answered.
///
/// FIXME: This is the wrong return value, since we also need to make a
/// distinction between
@@ -269,10 +238,7 @@ public:
/// @return
/// \btrue if we were in an option, \bfalse otherwise.
//------------------------------------------------------------------
- virtual int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ virtual int HandleCompletion(CompletionRequest &request);
//------------------------------------------------------------------
/// The input array contains a parsed version of the line. The insertion
@@ -280,36 +246,10 @@ public:
/// the cursor) and cursor_char_position (the position of the cursor in that
/// word.)
/// We've constructed the map of options and their arguments as well if that
- /// is
- /// helpful for the completion.
- ///
- /// @param[in] interpreter
- /// The command interpreter doing the completion.
- ///
- /// @param[in] input
- /// The command line parsed into words
- ///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] cursor_char_pos
- /// The character position of the cursor in its argument word.
+ /// is helpful for the completion.
///
- /// @param[in] opt_element_vector
- /// The results of the options parse of \a input.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// See CommandObject::HandleCompletions for a description of how these
- /// work.
- ///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will be inserted
- /// after the
- /// completion.) \bfalse otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
+ /// @param[in/out] request
+ /// The completion request that needs to be answered.
///
/// FIXME: This is the wrong return value, since we also need to make a
/// distinction between
@@ -318,10 +258,9 @@ public:
/// @return
/// The number of completions.
//------------------------------------------------------------------
- virtual int HandleArgumentCompletion(
- Args &input, int &cursor_index, int &cursor_char_position,
- OptionElementVector &opt_element_vector, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
+ virtual int
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) {
return 0;
}
@@ -397,6 +336,10 @@ public:
CommandReturnObject &result) = 0;
protected:
+ bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result,
+ OptionGroupOptions &group_options,
+ ExecutionContext &exe_ctx);
+
virtual const char *GetInvalidTargetDescription() {
return "invalid target, create a target using the 'target create' command";
}
@@ -414,18 +357,16 @@ protected:
}
// This is for use in the command interpreter, when you either want the
- // selected target, or if no target
- // is present you want to prime the dummy target with entities that will be
- // copied over to new targets.
+ // selected target, or if no target is present you want to prime the dummy
+ // target with entities that will be copied over to new targets.
Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
Target *GetDummyTarget();
- // If a command needs to use the "current" thread, use this call.
- // Command objects will have an ExecutionContext to use, and that may or may
- // not have a thread in it. If it
- // does, you should use that by default, if not, then use the
- // ExecutionContext's target's selected thread, etc...
- // This call insulates you from the details of this calculation.
+ // If a command needs to use the "current" thread, use this call. Command
+ // objects will have an ExecutionContext to use, and that may or may not have
+ // a thread in it. If it does, you should use that by default, if not, then
+ // use the ExecutionContext's target's selected thread, etc... This call
+ // insulates you from the details of this calculation.
Thread *GetDefaultThread();
//------------------------------------------------------------------
@@ -492,7 +433,8 @@ public:
bool Execute(const char *args_string, CommandReturnObject &result) override;
protected:
- virtual bool DoExecute(const char *command, CommandReturnObject &result) = 0;
+ virtual bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) = 0;
bool WantsRawCommandString() override { return true; }
};
diff --git a/include/lldb/Interpreter/CommandObjectMultiword.h b/include/lldb/Interpreter/CommandObjectMultiword.h
index 947272f4212e..d9eff9a6e545 100644
--- a/include/lldb/Interpreter/CommandObjectMultiword.h
+++ b/include/lldb/Interpreter/CommandObjectMultiword.h
@@ -15,6 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/CompletionRequest.h"
namespace lldb_private {
@@ -56,10 +57,7 @@ public:
bool WantsRawCommandString() override { return false; }
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
const char *GetRepeatCommand(Args &current_command_args,
uint32_t index) override;
@@ -87,8 +85,8 @@ public:
~CommandObjectProxy() override;
- // Subclasses must provide a command object that will be transparently
- // used for this object.
+ // Subclasses must provide a command object that will be transparently used
+ // for this object.
virtual CommandObject *GetProxyCommandObject() = 0;
llvm::StringRef GetHelpLong() override;
@@ -121,17 +119,11 @@ public:
Options *GetOptions() override;
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
-
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
+
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
const char *GetRepeatCommand(Args &current_command_args,
uint32_t index) override;
diff --git a/include/lldb/Interpreter/CommandObjectRegexCommand.h b/include/lldb/Interpreter/CommandObjectRegexCommand.h
index 50dbebc21b1d..36c3f068bdf3 100644
--- a/include/lldb/Interpreter/CommandObjectRegexCommand.h
+++ b/include/lldb/Interpreter/CommandObjectRegexCommand.h
@@ -17,6 +17,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/RegularExpression.h"
namespace lldb_private {
@@ -40,13 +41,10 @@ public:
bool HasRegexEntries() const { return !m_entries.empty(); }
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override;
+ bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
struct Entry {
RegularExpression regex;
diff --git a/include/lldb/Interpreter/OptionArgParser.h b/include/lldb/Interpreter/OptionArgParser.h
new file mode 100644
index 000000000000..5ace7e5d0250
--- /dev/null
+++ b/include/lldb/Interpreter/OptionArgParser.h
@@ -0,0 +1,43 @@
+//===-- OptionArgParser.h ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
+#define LLDB_INTERPRETER_OPTIONARGPARSER_H
+
+#include "lldb/lldb-private-types.h"
+
+namespace lldb_private {
+
+struct OptionArgParser {
+ static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
+ llvm::StringRef s, lldb::addr_t fail_value,
+ Status *error);
+
+ static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
+
+ static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
+
+ static int64_t ToOptionEnum(llvm::StringRef s,
+ OptionEnumValueElement *enum_values,
+ int32_t fail_value, Status &error);
+
+ static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
+ lldb::ScriptLanguage fail_value,
+ bool *success_ptr);
+
+ // TODO: Use StringRef
+ static Status ToFormat(const char *s, lldb::Format &format,
+ size_t *byte_size_ptr); // If non-NULL, then a
+ // byte size can precede
+ // the format character
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_INTERPRETER_OPTIONARGPARSER_H
diff --git a/include/lldb/Interpreter/OptionGroupBoolean.h b/include/lldb/Interpreter/OptionGroupBoolean.h
index 53d08d79d67a..2489a648dd7e 100644
--- a/include/lldb/Interpreter/OptionGroupBoolean.h
+++ b/include/lldb/Interpreter/OptionGroupBoolean.h
@@ -24,9 +24,9 @@ namespace lldb_private {
class OptionGroupBoolean : public OptionGroup {
public:
- // When 'no_argument_toggle_default' is true, then setting the option
- // value does NOT require an argument, it sets the boolean value to the
- // inverse of the default value
+ // When 'no_argument_toggle_default' is true, then setting the option value
+ // does NOT require an argument, it sets the boolean value to the inverse of
+ // the default value
OptionGroupBoolean(uint32_t usage_mask, bool required,
const char *long_option, int short_option,
const char *usage_text, bool default_value,
diff --git a/include/lldb/Interpreter/OptionGroupPlatform.h b/include/lldb/Interpreter/OptionGroupPlatform.h
index e79662400279..cda4246f1b01 100644
--- a/include/lldb/Interpreter/OptionGroupPlatform.h
+++ b/include/lldb/Interpreter/OptionGroupPlatform.h
@@ -16,6 +16,7 @@
// Project includes
#include "lldb/Interpreter/Options.h"
#include "lldb/Utility/ConstString.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -28,8 +29,6 @@ class OptionGroupPlatform : public OptionGroup {
public:
OptionGroupPlatform(bool include_platform_option)
: OptionGroup(), m_platform_name(), m_sdk_sysroot(),
- m_os_version_major(UINT32_MAX), m_os_version_minor(UINT32_MAX),
- m_os_version_update(UINT32_MAX),
m_include_platform_option(include_platform_option) {}
~OptionGroupPlatform() override = default;
@@ -72,9 +71,7 @@ protected:
std::string m_platform_name;
ConstString m_sdk_sysroot;
ConstString m_sdk_build;
- uint32_t m_os_version_major;
- uint32_t m_os_version_minor;
- uint32_t m_os_version_update;
+ llvm::VersionTuple m_os_version;
bool m_include_platform_option;
};
diff --git a/include/lldb/Interpreter/OptionValue.h b/include/lldb/Interpreter/OptionValue.h
index 6008e1ea4411..4748e309c77e 100644
--- a/include/lldb/Interpreter/OptionValue.h
+++ b/include/lldb/Interpreter/OptionValue.h
@@ -15,6 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Core/FormatEntity.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-defines.h"
@@ -76,8 +77,8 @@ public:
//-----------------------------------------------------------------
virtual Type GetType() const = 0;
- // If this value is always hidden, the avoid showing any info on this
- // value, just show the info for the child values.
+ // If this value is always hidden, the avoid showing any info on this value,
+ // just show the info for the child values.
virtual bool ValueIsTransparent() const {
return GetType() == eTypeProperties;
}
@@ -100,9 +101,7 @@ public:
virtual lldb::OptionValueSP DeepCopy() const = 0;
virtual size_t AutoComplete(CommandInterpreter &interpreter,
- llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ CompletionRequest &request);
//-----------------------------------------------------------------
// Subclasses can override these functions
@@ -126,8 +125,8 @@ public:
virtual bool DumpQualifiedName(Stream &strm) const;
//-----------------------------------------------------------------
- // Subclasses should NOT override these functions as they use the
- // above functions to implement functionality
+ // Subclasses should NOT override these functions as they use the above
+ // functions to implement functionality
//-----------------------------------------------------------------
uint32_t GetTypeAsMask() { return 1u << GetType(); }
@@ -183,9 +182,8 @@ public:
CreateValueFromCStringForTypeMask(const char *value_cstr, uint32_t type_mask,
Status &error);
- // Get this value as a uint64_t value if it is encoded as a boolean,
- // uint64_t or int64_t. Other types will cause "fail_value" to be
- // returned
+ // Get this value as a uint64_t value if it is encoded as a boolean, uint64_t
+ // or int64_t. Other types will cause "fail_value" to be returned
uint64_t GetUInt64Value(uint64_t fail_value, bool *success_ptr);
OptionValueArch *GetAsArch();
@@ -339,10 +337,10 @@ protected:
void *m_baton;
bool m_value_was_set; // This can be used to see if a value has been set
// by a call to SetValueFromCString(). It is often
- // handy to know if an option value was set from
- // the command line or as a setting, versus if we
- // just have the default value that was already
- // populated in the option value.
+ // handy to know if an option value was set from the
+ // command line or as a setting, versus if we just have
+ // the default value that was already populated in the
+ // option value.
};
} // namespace lldb_private
diff --git a/include/lldb/Interpreter/OptionValueArch.h b/include/lldb/Interpreter/OptionValueArch.h
index d66448aa2bed..15b74ad17893 100644
--- a/include/lldb/Interpreter/OptionValueArch.h
+++ b/include/lldb/Interpreter/OptionValueArch.h
@@ -12,6 +12,7 @@
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/CompletionRequest.h"
namespace lldb_private {
@@ -57,9 +58,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ lldb_private::CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueArray.h b/include/lldb/Interpreter/OptionValueArray.h
index bbf4e371a893..44709d00763f 100644
--- a/include/lldb/Interpreter/OptionValueArray.h
+++ b/include/lldb/Interpreter/OptionValueArray.h
@@ -78,8 +78,8 @@ public:
}
bool AppendValue(const lldb::OptionValueSP &value_sp) {
- // Make sure the value_sp object is allowed to contain
- // values of the type passed in...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
m_values.push_back(value_sp);
return true;
@@ -88,8 +88,8 @@ public:
}
bool 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...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (idx < m_values.size())
m_values.insert(m_values.begin() + idx, value_sp);
@@ -101,8 +101,8 @@ public:
}
bool 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...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (idx < m_values.size()) {
m_values[idx] = value_sp;
diff --git a/include/lldb/Interpreter/OptionValueBoolean.h b/include/lldb/Interpreter/OptionValueBoolean.h
index 1ff84dd3367d..6d2a16e59597 100644
--- a/include/lldb/Interpreter/OptionValueBoolean.h
+++ b/include/lldb/Interpreter/OptionValueBoolean.h
@@ -50,9 +50,8 @@ public:
return true;
}
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueEnumeration.h b/include/lldb/Interpreter/OptionValueEnumeration.h
index 4aa8823e620f..08d6ac70de52 100644
--- a/include/lldb/Interpreter/OptionValueEnumeration.h
+++ b/include/lldb/Interpreter/OptionValueEnumeration.h
@@ -59,9 +59,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueFileSpec.h b/include/lldb/Interpreter/OptionValueFileSpec.h
index 293ecd0d8054..41a479e2fc9e 100644
--- a/include/lldb/Interpreter/OptionValueFileSpec.h
+++ b/include/lldb/Interpreter/OptionValueFileSpec.h
@@ -54,9 +54,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueFormatEntity.h b/include/lldb/Interpreter/OptionValueFormatEntity.h
index e5a65b7e7eb6..880e434dc5c0 100644
--- a/include/lldb/Interpreter/OptionValueFormatEntity.h
+++ b/include/lldb/Interpreter/OptionValueFormatEntity.h
@@ -45,9 +45,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueProperties.h b/include/lldb/Interpreter/OptionValueProperties.h
index 16d31aa4ea90..96bd93ab3d7b 100644
--- a/include/lldb/Interpreter/OptionValueProperties.h
+++ b/include/lldb/Interpreter/OptionValueProperties.h
@@ -75,15 +75,15 @@ public:
//---------------------------------------------------------------------
// Get the index of a property given its exact name in this property
- // collection, "name" can't be a path to a property path that refers
- // to a property within a property
+ // collection, "name" can't be a path to a property path that refers to a
+ // property within a property
//---------------------------------------------------------------------
virtual uint32_t GetPropertyIndex(const ConstString &name) const;
//---------------------------------------------------------------------
- // Get a property by exact name exists in this property collection, name
- // can not be a path to a property path that refers to a property within
- // a property
+ // Get a property by exact name exists in this property collection, name can
+ // not be a path to a property path that refers to a property within a
+ // property
//---------------------------------------------------------------------
virtual const Property *GetProperty(const ExecutionContext *exe_ctx,
bool will_modify,
diff --git a/include/lldb/Interpreter/OptionValueUInt64.h b/include/lldb/Interpreter/OptionValueUInt64.h
index be13ff073721..96404bed8e67 100644
--- a/include/lldb/Interpreter/OptionValueUInt64.h
+++ b/include/lldb/Interpreter/OptionValueUInt64.h
@@ -34,9 +34,9 @@ public:
//---------------------------------------------------------------------
// Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
- // inside of a lldb::OptionValueSP object if all goes well. If the
- // string isn't a uint64_t value or any other error occurs, return an
- // empty lldb::OptionValueSP and fill error in with the correct stuff.
+ // inside of a lldb::OptionValueSP object if all goes well. If the string
+ // isn't a uint64_t value or any other error occurs, return an empty
+ // lldb::OptionValueSP and fill error in with the correct stuff.
//---------------------------------------------------------------------
static lldb::OptionValueSP Create(const char *, Status &) = delete;
static lldb::OptionValueSP Create(llvm::StringRef value_str, Status &error);
diff --git a/include/lldb/Interpreter/OptionValueUUID.h b/include/lldb/Interpreter/OptionValueUUID.h
index 6e0aeebb0e99..950efb518d5a 100644
--- a/include/lldb/Interpreter/OptionValueUUID.h
+++ b/include/lldb/Interpreter/OptionValueUUID.h
@@ -61,9 +61,8 @@ public:
void SetCurrentValue(const UUID &value) { m_uuid = value; }
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
protected:
UUID m_uuid;
diff --git a/include/lldb/Interpreter/Options.h b/include/lldb/Interpreter/Options.h
index 87121005575a..316bf568fd92 100644
--- a/include/lldb/Interpreter/Options.h
+++ b/include/lldb/Interpreter/Options.h
@@ -17,7 +17,9 @@
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/Status.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-private.h"
@@ -25,6 +27,24 @@
namespace lldb_private {
+struct Option;
+
+typedef std::vector<std::tuple<std::string, int, std::string>> OptionArgVector;
+typedef std::shared_ptr<OptionArgVector> OptionArgVectorSP;
+
+struct OptionArgElement {
+ enum { eUnrecognizedArg = -1, eBareDash = -2, eBareDoubleDash = -3 };
+
+ OptionArgElement(int defs_index, int pos, int arg_pos)
+ : opt_defs_index(defs_index), opt_pos(pos), opt_arg_pos(arg_pos) {}
+
+ int opt_defs_index;
+ int opt_pos;
+ int opt_arg_pos;
+};
+
+typedef std::vector<OptionArgElement> OptionElementVector;
+
static inline bool isprint8(int ch) {
if (ch & 0xffffff00u)
return false;
@@ -33,90 +53,18 @@ static inline bool isprint8(int ch) {
//----------------------------------------------------------------------
/// @class Options Options.h "lldb/Interpreter/Options.h"
-/// @brief A command line option parsing protocol class.
+/// A command line option parsing protocol class.
///
-/// Options is designed to be subclassed to contain all needed
-/// options for a given command. The options can be parsed by calling:
-/// \code
-/// Status Args::ParseOptions (Options &);
-/// \endcode
+/// Options is designed to be subclassed to contain all needed options for a
+/// given command. The options can be parsed by calling the Parse function.
///
-/// The options are specified using the format defined for the libc
-/// options parsing function getopt_long_only:
-/// \code
+/// The options are specified using the format defined for the libc options
+/// parsing function getopt_long_only: \code
/// #include <getopt.h>
/// int getopt_long_only(int argc, char * const *argv, const char
/// *optstring, const struct option *longopts, int *longindex);
/// \endcode
///
-/// Example code:
-/// \code
-/// #include <getopt.h>
-/// #include <string>
-///
-/// class CommandOptions : public Options
-/// {
-/// public:
-/// virtual struct option *
-/// GetLongOptions() {
-/// return g_options;
-/// }
-///
-/// virtual Status
-/// SetOptionValue (uint32_t option_idx, int option_val, const char
-/// *option_arg)
-/// {
-/// Status error;
-/// switch (option_val)
-/// {
-/// case 'g': debug = true; break;
-/// case 'v': verbose = true; break;
-/// case 'l': log_file = option_arg; break;
-/// case 'f': log_flags = strtoull(option_arg, nullptr, 0); break;
-/// default:
-/// error.SetErrorStringWithFormat("unrecognized short option
-/// %c", option_val);
-/// break;
-/// }
-///
-/// return error;
-/// }
-///
-/// CommandOptions (CommandInterpreter &interpreter) : debug (true),
-/// verbose (false), log_file (), log_flags (0)
-/// {}
-///
-/// bool debug;
-/// bool verbose;
-/// std::string log_file;
-/// uint32_t log_flags;
-///
-/// static struct option g_options[];
-///
-/// };
-///
-/// struct option CommandOptions::g_options[] =
-/// {
-/// { "debug", no_argument, nullptr, 'g' },
-/// { "log-file", required_argument, nullptr, 'l' },
-/// { "log-flags", required_argument, nullptr, 'f' },
-/// { "verbose", no_argument, nullptr, 'v' },
-/// { nullptr, 0, nullptr, 0 }
-/// };
-///
-/// int main (int argc, const char **argv, const char **envp)
-/// {
-/// CommandOptions options;
-/// Args main_command;
-/// main_command.SetArguments(argc, argv, false);
-/// main_command.ParseOptions(options);
-///
-/// if (options.verbose)
-/// {
-/// std::cout << "verbose is on" << std::endl;
-/// }
-/// }
-/// \endcode
//----------------------------------------------------------------------
class Options {
public:
@@ -143,9 +91,9 @@ public:
bool VerifyOptions(CommandReturnObject &result);
- // Verify that the options given are in the options table and can
- // be used together, but there may be some required options that are
- // missing (used to verify options that get folded into command aliases).
+ // Verify that the options given are in the options table and can be used
+ // together, but there may be some required options that are missing (used to
+ // verify options that get folded into command aliases).
bool VerifyPartialOptions(CommandReturnObject &result);
void OutputFormattedUsageText(Stream &strm,
@@ -157,20 +105,50 @@ public:
bool SupportsLongOption(const char *long_option);
- // The following two pure virtual functions must be defined by every
- // class that inherits from this class.
+ // The following two pure virtual functions must be defined by every class
+ // that inherits from this class.
virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() {
return llvm::ArrayRef<OptionDefinition>();
}
- // Call this prior to parsing any options. This call will call the
- // subclass OptionParsingStarting() and will avoid the need for all
+ // Call this prior to parsing any options. This call will call the subclass
+ // OptionParsingStarting() and will avoid the need for all
// OptionParsingStarting() function instances from having to call the
- // Option::OptionParsingStarting() like they did before. This was error
- // prone and subclasses shouldn't have to do it.
+ // Option::OptionParsingStarting() like they did before. This was error prone
+ // and subclasses shouldn't have to do it.
void NotifyOptionParsingStarting(ExecutionContext *execution_context);
+ //------------------------------------------------------------------
+ /// Parse the provided arguments.
+ ///
+ /// The parsed options are set via calls to SetOptionValue. In case of a
+ /// successful parse, the function returns a copy of the input arguments
+ /// with the parsed options removed. Otherwise, it returns an error.
+ ///
+ /// param[in] platform_sp
+ /// The platform used for option validation. This is necessary
+ /// because an empty execution_context is not enough to get us
+ /// to a reasonable platform. If the platform isn't given,
+ /// we'll try to get it from the execution context. If we can't
+ /// get it from the execution context, we'll skip validation.
+ ///
+ /// param[in] require_validation
+ /// When true, it will fail option parsing if validation could
+ /// not occur due to not having a platform.
+ //------------------------------------------------------------------
+ llvm::Expected<Args> Parse(const Args &args,
+ ExecutionContext *execution_context,
+ lldb::PlatformSP platform_sp,
+ bool require_validation);
+
+ llvm::Expected<Args> ParseAlias(const Args &args,
+ OptionArgVector *option_arg_vector,
+ std::string &input_line);
+
+ OptionElementVector ParseForCompletion(const Args &args,
+ uint32_t cursor_index);
+
Status NotifyOptionParsingFinished(ExecutionContext *execution_context);
//------------------------------------------------------------------
@@ -196,99 +174,48 @@ public:
ExecutionContext *execution_context) = 0;
//------------------------------------------------------------------
- /// Handles the generic bits of figuring out whether we are in an
- /// option, and if so completing it.
- ///
- /// @param[in] input
- /// The command line parsed into words
+ /// Handles the generic bits of figuring out whether we are in an option,
+ /// and if so completing it.
///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] char_pos
- /// The character position of the cursor in its argument word.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// See CommandObject::HandleCompletions for a description of
- /// how these work.
+ /// @param[in/out] request
+ /// The completion request that we need to act upon.
///
/// @param[in] interpreter
/// The interpreter that's doing the completing.
///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will be
- /// inserted after the completion.) \b false otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
- ///
/// FIXME: This is the wrong return value, since we also need to
- /// make a distinction between total number of matches, and the
- /// window the user wants returned.
+ /// make a distinction between total number of matches, and the window the
+ /// user wants returned.
///
/// @return
/// \btrue if we were in an option, \bfalse otherwise.
//------------------------------------------------------------------
- bool HandleOptionCompletion(Args &input, OptionElementVector &option_map,
- int cursor_index, int char_pos,
- int match_start_point, int max_return_elements,
- CommandInterpreter &interpreter,
- bool &word_complete,
- lldb_private::StringList &matches);
+ bool HandleOptionCompletion(lldb_private::CompletionRequest &request,
+ OptionElementVector &option_map,
+ CommandInterpreter &interpreter);
//------------------------------------------------------------------
- /// Handles the generic bits of figuring out whether we are in an
- /// option, and if so completing it.
- ///
- /// @param[in] interpreter
- /// The command interpreter doing the completion.
- ///
- /// @param[in] input
- /// The command line parsed into words
- ///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] char_pos
- /// The character position of the cursor in its argument word.
+ /// Handles the generic bits of figuring out whether we are in an option,
+ /// and if so completing it.
///
- /// @param[in] opt_element_vector
- /// The results of the options parse of \a input.
- ///
- /// @param[in] opt_element_index
- /// The position in \a opt_element_vector of the word in \a
- /// input containing the cursor.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// See CommandObject::HandleCompletions for a description of
- /// how these work.
+ /// @param[in/out] request
+ /// The completion request that we need to act upon.
///
/// @param[in] interpreter
- /// The command interpreter in which we're doing completion.
- ///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will
- /// be inserted after the completion.) \bfalse otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
+ /// The command interpreter doing the completion.
///
/// FIXME: This is the wrong return value, since we also need to
- /// make a distinction between total number of matches, and the
- /// window the user wants returned.
+ /// make a distinction between total number of matches, and the window the
+ /// user wants returned.
///
/// @return
/// \btrue if we were in an option, \bfalse otherwise.
//------------------------------------------------------------------
virtual bool
- HandleOptionArgumentCompletion(Args &input, int cursor_index, int char_pos,
+ HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request,
OptionElementVector &opt_element_vector,
- int opt_element_index, int match_start_point,
- int max_return_elements,
- CommandInterpreter &interpreter,
- bool &word_complete, StringList &matches);
+ int opt_element_index,
+ CommandInterpreter &interpreter);
protected:
// This is a set of options expressed as indexes into the options table for
@@ -319,14 +246,14 @@ protected:
void OptionsSetUnion(const OptionSet &set_a, const OptionSet &set_b,
OptionSet &union_set);
- // Subclasses must reset their option values prior to starting a new
- // option parse. Each subclass must override this function and revert
- // all option settings to default values.
+ // Subclasses must reset their option values prior to starting a new option
+ // parse. Each subclass must override this function and revert all option
+ // settings to default values.
virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
- // If subclasses need to know when the options are done being parsed
- // they can implement this function to do extra checking
+ // If subclasses need to know when the options are done being parsed they
+ // can implement this function to do extra checking
Status error;
return error;
}
@@ -347,8 +274,8 @@ public:
virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
- // If subclasses need to know when the options are done being parsed
- // they can implement this function to do extra checking
+ // If subclasses need to know when the options are done being parsed they
+ // can implement this function to do extra checking
Status error;
return error;
}
@@ -364,8 +291,8 @@ public:
//----------------------------------------------------------------------
/// Append options from a OptionGroup class.
///
- /// Append all options from \a group using the exact same option groups
- /// that each option is defined with.
+ /// Append all options from \a group using the exact same option groups that
+ /// each option is defined with.
///
/// @param[in] group
/// A group of options to take option values from and copy their
@@ -376,9 +303,9 @@ public:
//----------------------------------------------------------------------
/// Append options from a OptionGroup class.
///
- /// Append options from \a group that have a usage mask that has any bits
- /// in "src_mask" set. After the option definition is copied into the
- /// options definitions in this class, set the usage_mask to "dst_mask".
+ /// Append options from \a group that have a usage mask that has any bits in
+ /// "src_mask" set. After the option definition is copied into the options
+ /// definitions in this class, set the usage_mask to "dst_mask".
///
/// @param[in] group
/// A group of options to take option values from and copy their
diff --git a/include/lldb/Interpreter/ScriptInterpreter.h b/include/lldb/Interpreter/ScriptInterpreter.h
index 335231cb29ec..d2189edd04a6 100644
--- a/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/include/lldb/Interpreter/ScriptInterpreter.h
@@ -96,13 +96,13 @@ public:
virtual bool Interrupt() { return false; }
virtual bool ExecuteOneLine(
- const char *command, CommandReturnObject *result,
+ llvm::StringRef command, CommandReturnObject *result,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) = 0;
virtual void ExecuteInterpreterLoop() = 0;
virtual bool ExecuteOneLineWithReturn(
- const char *in_string, ScriptReturnType return_type, void *ret_value,
+ llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
return true;
}
@@ -343,7 +343,7 @@ public:
}
virtual bool
- RunScriptBasedCommand(const char *impl_function, const char *args,
+ RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj,
Status &error,
@@ -351,12 +351,11 @@ public:
return false;
}
- virtual bool
- RunScriptBasedCommand(StructuredData::GenericSP impl_obj_sp, const char *args,
- ScriptedCommandSynchronicity synchronicity,
- lldb_private::CommandReturnObject &cmd_retobj,
- Status &error,
- const lldb_private::ExecutionContext &exe_ctx) {
+ virtual bool RunScriptBasedCommand(
+ StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
+ ScriptedCommandSynchronicity synchronicity,
+ lldb_private::CommandReturnObject &cmd_retobj, Status &error,
+ const lldb_private::ExecutionContext &exe_ctx) {
return false;
}
diff --git a/include/lldb/Symbol/Block.h b/include/lldb/Symbol/Block.h
index a5387cca21c5..1664362431f9 100644
--- a/include/lldb/Symbol/Block.h
+++ b/include/lldb/Symbol/Block.h
@@ -30,21 +30,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Block Block.h "lldb/Symbol/Block.h"
-/// @brief A class that describes a single lexical block.
+/// A class that describes a single lexical block.
///
/// A Function object owns a BlockList object which owns one or more
-/// Block objects. The BlockList object contains a section offset
-/// address range, and Block objects contain one or more ranges
-/// which are offsets into that range. Blocks are can have discontiguous
-/// ranges within the BlockList address range, and each block can
-/// contain child blocks each with their own sets of ranges.
+/// Block objects. The BlockList object contains a section offset address
+/// range, and Block objects contain one or more ranges which are offsets into
+/// that range. Blocks are can have discontiguous ranges within the BlockList
+/// address range, and each block can contain child blocks each with their own
+/// sets of ranges.
///
-/// Each block has a variable list that represents local, argument, and
-/// static variables that are scoped to the block.
+/// Each block has a variable list that represents local, argument, and static
+/// variables that are scoped to the block.
///
-/// Inlined functions are represented by attaching a
-/// InlineFunctionInfo shared pointer object to a block. Inlined
-/// functions are represented as named blocks.
+/// Inlined functions are represented by attaching a InlineFunctionInfo shared
+/// pointer object to a block. Inlined functions are represented as named
+/// blocks.
//----------------------------------------------------------------------
class Block : public UserID, public SymbolContextScope {
public:
@@ -54,10 +54,9 @@ public:
//------------------------------------------------------------------
/// Construct with a User ID \a uid, \a depth.
///
- /// Initialize this block with the specified UID \a uid. The
- /// \a depth in the \a block_list is used to represent the parent,
- /// sibling, and child block information and also allows for partial
- /// parsing at the block level.
+ /// Initialize this block with the specified UID \a uid. The \a depth in the
+ /// \a block_list is used to represent the parent, sibling, and child block
+ /// information and also allows for partial parsing at the block level.
///
/// @param[in] uid
/// The UID for a given block. This value is given by the
@@ -146,8 +145,7 @@ public:
bool Contains(const Range &range) const;
//------------------------------------------------------------------
- /// Check if this object contains "block" as a child block at any
- /// depth.
+ /// Check if this object contains "block" as a child block at any depth.
///
/// @param[in] block
/// A potential child block.
@@ -256,8 +254,8 @@ public:
lldb::VariableListSP GetBlockVariableList(bool can_create);
//------------------------------------------------------------------
- /// Get the variable list for this block and optionally all child
- /// blocks if \a get_child_variables is \b true.
+ /// Get the variable list for this block and optionally all child blocks if
+ /// \a get_child_variables is \b true.
///
/// @param[in] get_child_variables
/// If \b true, all variables from all child blocks will be
@@ -286,8 +284,8 @@ public:
VariableList *variable_list);
//------------------------------------------------------------------
- /// Appends the variables from this block, and optionally from all
- /// parent blocks, to \a variable_list.
+ /// Appends the variables from this block, and optionally from all parent
+ /// blocks, to \a variable_list.
///
/// @param[in] can_create
/// If \b true, the variables can be parsed if they already
@@ -334,8 +332,8 @@ public:
//------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Returns the cost of this object plus any owned objects from the
- /// ranges, variables, and inline function information.
+ /// Returns the cost of this object plus any owned objects from the ranges,
+ /// variables, and inline function information.
///
/// @return
/// The number of bytes that this object occupies in memory.
@@ -374,9 +372,8 @@ public:
//------------------------------------------------------------------
/// Set accessor for the variable list.
///
- /// Called by the SymbolFile plug-ins after they have parsed the
- /// variable lists and are ready to hand ownership of the list over
- /// to this object.
+ /// Called by the SymbolFile plug-ins after they have parsed the variable
+ /// lists and are ready to hand ownership of the list over to this object.
///
/// @param[in] variable_list_sp
/// A shared pointer to a VariableList.
@@ -403,8 +400,8 @@ public:
uint32_t GetRangeIndexContainingAddress(const Address &addr);
//------------------------------------------------------------------
- // Since blocks might have multiple discontiguous address ranges,
- // we need to be able to get at any of the address ranges in a block.
+ // Since blocks might have multiple discontiguous address ranges, we need to
+ // be able to get at any of the address ranges in a block.
//------------------------------------------------------------------
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range);
diff --git a/include/lldb/Symbol/ClangASTContext.h b/include/lldb/Symbol/ClangASTContext.h
index 2d2c804eb025..9364149d98e7 100644
--- a/include/lldb/Symbol/ClangASTContext.h
+++ b/include/lldb/Symbol/ClangASTContext.h
@@ -253,6 +253,9 @@ public:
&type_fields,
bool packed = false);
+ static bool IsOperator(const char *name,
+ clang::OverloadedOperatorKind &op_kind);
+
//------------------------------------------------------------------
// Structure, Unions, Classes
//------------------------------------------------------------------
@@ -302,6 +305,9 @@ public:
lldb::AccessType access_type, const char *class_name,
int kind, const TemplateParameterInfos &infos);
+ clang::TemplateTemplateParmDecl *
+ CreateTemplateTemplateParmDecl(const char *template_name);
+
clang::ClassTemplateSpecializationDecl *CreateClassTemplateSpecializationDecl(
clang::DeclContext *decl_ctx,
clang::ClassTemplateDecl *class_template_decl, int kind,
@@ -632,8 +638,7 @@ public:
//----------------------------------------------------------------------
// Using the current type, create a new typedef to that type using
- // "typedef_name"
- // as the name and "decl_ctx" as the decl context.
+ // "typedef_name" as the name and "decl_ctx" as the decl context.
static CompilerType
CreateTypedefType(const CompilerType &type, const char *typedef_name,
const CompilerDeclContext &compiler_decl_ctx);
@@ -650,8 +655,7 @@ public:
GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) override;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override;
CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type,
@@ -763,8 +767,8 @@ public:
bool &child_is_base_class, bool &child_is_deref_of_parent,
ValueObject *valobj, uint64_t &language_flags) override;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
bool omit_empty_base_classes) override;
@@ -794,8 +798,8 @@ public:
CompilerType GetTypeForFormatters(void *type) override;
#define LLDB_INVALID_DECL_LEVEL UINT32_MAX
- // LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if
- // child_decl_ctx could not be found in decl_ctx.
+ // LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if child_decl_ctx
+ // could not be found in decl_ctx.
uint32_t CountDeclLevels(clang::DeclContext *frame_decl_ctx,
clang::DeclContext *child_decl_ctx,
ConstString *child_name = nullptr,
@@ -821,6 +825,7 @@ public:
clang::CXXMethodDecl *
AddMethodToCXXRecordType(lldb::opaque_compiler_type_t type, const char *name,
+ const char *mangled_name,
const CompilerType &method_type,
lldb::AccessType access, bool is_virtual,
bool is_static, bool is_inline, bool is_explicit,
@@ -885,13 +890,13 @@ public:
// Pointers & References
//------------------------------------------------------------------
- // Call this function using the class type when you want to make a
- // member pointer type to pointee_type.
+ // Call this function using the class type when you want to make a member
+ // pointer type to pointee_type.
static CompilerType CreateMemberPointerType(const CompilerType &type,
const CompilerType &pointee_type);
- // Converts "s" to a floating point value and place resulting floating
- // point bytes in the "dst" buffer.
+ // Converts "s" to a floating point value and place resulting floating point
+ // bytes in the "dst" buffer.
size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
size_t dst_size) override;
diff --git a/include/lldb/Symbol/ClangASTImporter.h b/include/lldb/Symbol/ClangASTImporter.h
index 6823ad748282..52a164a1d2dd 100644
--- a/include/lldb/Symbol/ClangASTImporter.h
+++ b/include/lldb/Symbol/ClangASTImporter.h
@@ -250,13 +250,12 @@ private:
// recorded and placed into the decls_to_deport set.
//
// A call to "ExecuteDeportWorkQueues" completes all the Decls that
- // are in decls_to_deport, adding any Decls it sees along the way that
- // it hasn't already deported. It proceeds until decls_to_deport is
- // empty.
+ // are in decls_to_deport, adding any Decls it sees along the way that it
+ // hasn't already deported. It proceeds until decls_to_deport is empty.
//
- // These calls must be paired. Leaving a minion in deport mode or
- // trying to start deport minion with a new pair of queues will result
- // in an assertion failure.
+ // These calls must be paired. Leaving a minion in deport mode or trying
+ // to start deport minion with a new pair of queues will result in an
+ // assertion failure.
void
InitDeportWorkQueues(std::set<clang::NamedDecl *> *decls_to_deport,
diff --git a/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h b/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
index 61bbc122dd5f..ef0010314e1d 100644
--- a/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
+++ b/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
@@ -60,21 +60,21 @@ public:
//------------------------------------------------------------------
clang::Decl *GetExternalDecl(uint32_t ID) override {
- // This method only needs to be implemented if the AST source ever
- // passes back decl sets as VisibleDeclaration objects.
+ // This method only needs to be implemented if the AST source ever passes
+ // back decl sets as VisibleDeclaration objects.
return nullptr;
}
clang::Stmt *GetExternalDeclStmt(uint64_t Offset) override {
- // This operation is meant to be used via a LazyOffsetPtr. It only
- // needs to be implemented if the AST source uses methods like
+ // This operation is meant to be used via a LazyOffsetPtr. It only needs
+ // to be implemented if the AST source uses methods like
// FunctionDecl::setLazyBody when building decls.
return nullptr;
}
clang::Selector GetExternalSelector(uint32_t ID) override {
- // This operation only needs to be implemented if the AST source
- // returns non-zero for GetNumKnownSelectors().
+ // This operation only needs to be implemented if the AST source returns
+ // non-zero for GetNumKnownSelectors().
return clang::Selector();
}
diff --git a/include/lldb/Symbol/CompactUnwindInfo.h b/include/lldb/Symbol/CompactUnwindInfo.h
index 630067241735..711420f66a46 100644
--- a/include/lldb/Symbol/CompactUnwindInfo.h
+++ b/include/lldb/Symbol/CompactUnwindInfo.h
@@ -22,23 +22,18 @@
namespace lldb_private {
// Compact Unwind info is an unwind format used on Darwin. The unwind
-// instructions
-// for typical compiler-generated functions can be expressed in a 32-bit
-// encoding.
-// The format includes a two-level index so the unwind information for a
-// function
-// can be found by two binary searches in the section. It can represent both
-// stack frames that use a frame-pointer register and frameless functions, on
-// i386/x86_64 for instance. When a function is too complex to be represented
-// in
-// the compact unwind format, it calls out to eh_frame unwind instructions.
+// instructions for typical compiler-generated functions can be expressed in a
+// 32-bit encoding. The format includes a two-level index so the unwind
+// information for a function can be found by two binary searches in the
+// section. It can represent both stack frames that use a frame-pointer
+// register and frameless functions, on i386/x86_64 for instance. When a
+// function is too complex to be represented in the compact unwind format, it
+// calls out to eh_frame unwind instructions.
// On Mac OS X / iOS, a function will have either a compact unwind
-// representation
-// or an eh_frame representation. If lldb is going to benefit from the
-// compiler's
-// description about saved register locations, it must be able to read both
-// sources of information.
+// representation or an eh_frame representation. If lldb is going to benefit
+// from the compiler's description about saved register locations, it must be
+// able to read both sources of information.
class CompactUnwindInfo {
public:
@@ -54,9 +49,8 @@ private:
// The top level index entries of the compact unwind info
// (internal representation of struct
// unwind_info_section_header_index_entry)
- // There are relatively few of these (one per 500/1000 functions, depending on
- // format) so
- // creating them on first scan will not be too costly.
+ // There are relatively few of these (one per 500/1000 functions, depending
+ // on format) so creating them on first scan will not be too costly.
struct UnwindIndex {
uint32_t function_offset; // The offset of the first function covered by
// this index
@@ -84,8 +78,7 @@ private:
};
// An internal object used to store the information we retrieve about a
- // function --
- // the encoding bits and possibly the LSDA/personality function.
+ // function -- the encoding bits and possibly the LSDA/personality function.
struct FunctionInfo {
uint32_t encoding; // compact encoding 32-bit value for this function
Address lsda_address; // the address of the LSDA data for this function
diff --git a/include/lldb/Symbol/CompileUnit.h b/include/lldb/Symbol/CompileUnit.h
index e7a1ebc8c00f..b816439cee13 100644
--- a/include/lldb/Symbol/CompileUnit.h
+++ b/include/lldb/Symbol/CompileUnit.h
@@ -21,16 +21,16 @@
namespace lldb_private {
//----------------------------------------------------------------------
/// @class CompileUnit CompileUnit.h "lldb/Symbol/CompileUnit.h"
-/// @brief A class that describes a compilation unit.
+/// A class that describes a compilation unit.
///
/// A representation of a compilation unit, or compiled source file.
-/// The UserID of the compile unit is specified by the SymbolFile
-/// plug-in and can have any value as long as the value is unique
-/// within the Module that owns this compile units.
+/// The UserID of the compile unit is specified by the SymbolFile plug-in and
+/// can have any value as long as the value is unique within the Module that
+/// owns this compile units.
///
-/// Each compile unit has a list of functions, global and static
-/// variables, support file list (include files and inlined source
-/// files), and a line table.
+/// Each compile unit has a list of functions, global and static variables,
+/// support file list (include files and inlined source files), and a line
+/// table.
//----------------------------------------------------------------------
class CompileUnit : public std::enable_shared_from_this<CompileUnit>,
public ModuleChild,
@@ -41,9 +41,9 @@ public:
//------------------------------------------------------------------
/// Construct with a module, path, UID and language.
///
- /// Initialize the compile unit given the owning \a module, a path
- /// to convert into a FileSpec, the SymbolFile plug-in supplied
- /// \a uid, and the source language type.
+ /// Initialize the compile unit given the owning \a module, a path to
+ /// convert into a FileSpec, the SymbolFile plug-in supplied \a uid, and the
+ /// source language type.
///
/// @param[in] module
/// The parent module that owns this compile unit. This value
@@ -81,9 +81,9 @@ public:
//------------------------------------------------------------------
/// Construct with a module, file spec, UID and language.
///
- /// Initialize the compile unit given the owning \a module, a path
- /// to convert into a FileSpec, the SymbolFile plug-in supplied
- /// \a uid, and the source language type.
+ /// Initialize the compile unit given the owning \a module, a path to
+ /// convert into a FileSpec, the SymbolFile plug-in supplied \a uid, and the
+ /// source language type.
///
/// @param[in] module
/// The parent module that owns this compile unit. This value
@@ -127,8 +127,8 @@ public:
//------------------------------------------------------------------
/// Add a function to this compile unit.
///
- /// Typically called by the SymbolFile plug-ins as they partially
- /// parse the debug information.
+ /// Typically called by the SymbolFile plug-ins as they partially parse the
+ /// debug information.
///
/// @param[in] function_sp
/// A shared pointer to the Function object.
@@ -163,13 +163,12 @@ public:
void GetDescription(Stream *s, lldb::DescriptionLevel level) const;
//------------------------------------------------------------------
- /// Get a shared pointer to a function in this compile unit by
- /// index.
+ /// Get a shared pointer to a function in this compile unit by index.
///
- /// Typically called when iterating though all functions in a
- /// compile unit after all functions have been parsed. This provides
- /// raw access to the function shared pointer list and will not
- /// cause the SymbolFile plug-in to parse any unparsed functions.
+ /// Typically called when iterating though all functions in a compile unit
+ /// after all functions have been parsed. This provides raw access to the
+ /// function shared pointer list and will not cause the SymbolFile plug-in
+ /// to parse any unparsed functions.
///
/// @param[in] idx
/// An index into the function list.
@@ -195,16 +194,15 @@ public:
//------------------------------------------------------------------
/// Find the line entry by line and optional inlined file spec.
///
- /// Finds the first line entry that has an index greater than
- /// \a start_idx that matches \a line. If \a file_spec_ptr
- /// is NULL, then the search matches line entries whose file matches
- /// the file for the compile unit. If \a file_spec_ptr is
- /// not NULL, line entries must match the specified file spec (for
- /// inlined line table entries).
+ /// Finds the first line entry that has an index greater than \a start_idx
+ /// that matches \a line. If \a file_spec_ptr is NULL, then the search
+ /// matches line entries whose file matches the file for the compile unit.
+ /// If \a file_spec_ptr is not NULL, line entries must match the specified
+ /// file spec (for inlined line table entries).
///
- /// Multiple calls to this function can find all entries that match
- /// a given file and line by starting with \a start_idx equal to zero,
- /// and calling this function back with the return value + 1.
+ /// Multiple calls to this function can find all entries that match a given
+ /// file and line by starting with \a start_idx equal to zero, and calling
+ /// this function back with the return value + 1.
///
/// @param[in] start_idx
/// The zero based index at which to start looking for matches.
@@ -237,10 +235,9 @@ public:
//------------------------------------------------------------------
/// Get the line table for the compile unit.
///
- /// Called by clients and the SymbolFile plug-in. The SymbolFile
- /// plug-ins use this function to determine if the line table has
- /// be parsed yet. Clients use this function to get the line table
- /// from a compile unit.
+ /// Called by clients and the SymbolFile plug-in. The SymbolFile plug-ins
+ /// use this function to determine if the line table has be parsed yet.
+ /// Clients use this function to get the line table from a compile unit.
///
/// @return
/// The line table object pointer, or NULL if this line table
@@ -253,8 +250,8 @@ public:
//------------------------------------------------------------------
/// Get the compile unit's support file list.
///
- /// The support file list is used by the line table, and any objects
- /// that have valid Declaration objects.
+ /// The support file list is used by the line table, and any objects that
+ /// have valid Declaration objects.
///
/// @return
/// A support file list object.
@@ -264,8 +261,8 @@ public:
//------------------------------------------------------------------
/// Get the compile unit's imported module list.
///
- /// This reports all the imports that the compile unit made,
- /// including the current module.
+ /// This reports all the imports that the compile unit made, including the
+ /// current module.
///
/// @return
/// A list of imported module names.
@@ -275,9 +272,8 @@ public:
//------------------------------------------------------------------
/// Get the SymbolFile plug-in user data.
///
- /// SymbolFile plug-ins can store user data to internal state or
- /// objects to quickly allow them to parse more information for a
- /// given object.
+ /// SymbolFile plug-ins can store user data to internal state or objects to
+ /// quickly allow them to parse more information for a given object.
///
/// @return
/// The user data stored with the CompileUnit when it was
@@ -288,9 +284,9 @@ public:
//------------------------------------------------------------------
/// Get the variable list for a compile unit.
///
- /// Called by clients to get the variable list for a compile unit.
- /// The variable list will contain all global and static variables
- /// that were defined at the compile unit level.
+ /// Called by clients to get the variable list for a compile unit. The
+ /// variable list will contain all global and static variables that were
+ /// defined at the compile unit level.
///
/// @param[in] can_create
/// If \b true, the variable list will be parsed on demand. If
@@ -309,9 +305,8 @@ public:
//------------------------------------------------------------------
/// Finds a function by user ID.
///
- /// Typically used by SymbolFile plug-ins when partially parsing
- /// the debug information to see if the function has been parsed
- /// yet.
+ /// Typically used by SymbolFile plug-ins when partially parsing the debug
+ /// information to see if the function has been parsed yet.
///
/// @param[in] uid
/// The user ID of the function to find. This value is supplied
@@ -328,10 +323,9 @@ public:
//------------------------------------------------------------------
/// Set the line table for the compile unit.
///
- /// Called by the SymbolFile plug-in when if first parses the line
- /// table and hands ownership of the line table to this object. The
- /// compile unit owns the line table object and will delete the
- /// object when it is deleted.
+ /// Called by the SymbolFile plug-in when if first parses the line table and
+ /// hands ownership of the line table to this object. The compile unit owns
+ /// the line table object and will delete the object when it is deleted.
///
/// @param[in] line_table
/// A line table object pointer that this object now owns.
@@ -343,9 +337,8 @@ public:
//------------------------------------------------------------------
/// Set accessor for the variable list.
///
- /// Called by the SymbolFile plug-ins after they have parsed the
- /// variable lists and are ready to hand ownership of the list over
- /// to this object.
+ /// Called by the SymbolFile plug-ins after they have parsed the variable
+ /// lists and are ready to hand ownership of the list over to this object.
///
/// @param[in] variable_list_sp
/// A shared pointer to a VariableList.
@@ -355,9 +348,8 @@ public:
//------------------------------------------------------------------
/// Resolve symbol contexts by file and line.
///
- /// Given a file in \a file_spec, and a line number, find all
- /// instances and append them to the supplied symbol context list
- /// \a sc_list.
+ /// Given a file in \a file_spec, and a line number, find all instances and
+ /// append them to the supplied symbol context list \a sc_list.
///
/// @param[in] file_spec
/// A file specification. If \a file_spec contains no directory
@@ -405,10 +397,10 @@ public:
//------------------------------------------------------------------
/// Get whether compiler optimizations were enabled for this compile unit
///
- /// "optimized" means that the debug experience may be difficult
- /// for the user to understand. Variables may not be available when
- /// the developer would expect them, stepping through the source lines
- /// in the function may appear strange, etc.
+ /// "optimized" means that the debug experience may be difficult for the
+ /// user to understand. Variables may not be available when the developer
+ /// would expect them, stepping through the source lines in the function may
+ /// appear strange, etc.
///
/// @return
/// Returns 'true' if this compile unit was compiled with
diff --git a/include/lldb/Symbol/CompilerType.h b/include/lldb/Symbol/CompilerType.h
index 70d56db7fc21..1170832a7396 100644
--- a/include/lldb/Symbol/CompilerType.h
+++ b/include/lldb/Symbol/CompilerType.h
@@ -28,13 +28,12 @@ class DataExtractor;
//----------------------------------------------------------------------
// A class that can carry around a clang ASTContext and a opaque clang
-// QualType. A clang::QualType can be easily reconstructed from an
-// opaque clang type and often the ASTContext is needed when doing
-// various type related tasks, so this class allows both items to travel
-// in a single very lightweight class that can be used. There are many
-// static equivalents of the member functions that allow the ASTContext
-// and the opaque clang QualType to be specified for ease of use and
-// to avoid code duplication.
+// QualType. A clang::QualType can be easily reconstructed from an opaque clang
+// type and often the ASTContext is needed when doing various type related
+// tasks, so this class allows both items to travel in a single very
+// lightweight class that can be used. There are many static equivalents of the
+// member functions that allow the ASTContext and the opaque clang QualType to
+// be specified for ease of use and to avoid code duplication.
//----------------------------------------------------------------------
class CompilerType {
public:
@@ -206,8 +205,7 @@ public:
CompilerType GetFullyUnqualifiedType() const;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount() const;
CompilerType GetFunctionArgumentTypeAtIndex(size_t idx) const;
@@ -220,14 +218,14 @@ public:
//----------------------------------------------------------------------
// If this type is a reference to a type (L value or R value reference),
- // return a new type with the reference removed, else return the current
- // type itself.
+ // return a new type with the reference removed, else return the current type
+ // itself.
//----------------------------------------------------------------------
CompilerType GetNonReferenceType() const;
//----------------------------------------------------------------------
- // If this type is a pointer type, return the type that the pointer
- // points to, else return an invalid type.
+ // If this type is a pointer type, return the type that the pointer points
+ // to, else return an invalid type.
//----------------------------------------------------------------------
CompilerType GetPointeeType() const;
@@ -237,44 +235,44 @@ public:
CompilerType GetPointerType() const;
//----------------------------------------------------------------------
- // Return a new CompilerType that is a L value reference to this type if
- // this type is valid and the type system supports L value references,
- // else return an invalid type.
+ // Return a new CompilerType that is a L value reference to this type if this
+ // type is valid and the type system supports L value references, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType GetLValueReferenceType() const;
//----------------------------------------------------------------------
- // Return a new CompilerType that is a R value reference to this type if
- // this type is valid and the type system supports R value references,
- // else return an invalid type.
+ // Return a new CompilerType that is a R value reference to this type if this
+ // type is valid and the type system supports R value references, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType GetRValueReferenceType() const;
//----------------------------------------------------------------------
- // Return a new CompilerType adds a const modifier to this type if
- // this type is valid and the type system supports const modifiers,
- // else return an invalid type.
+ // Return a new CompilerType adds a const modifier to this type if this type
+ // is valid and the type system supports const modifiers, else return an
+ // invalid type.
//----------------------------------------------------------------------
CompilerType AddConstModifier() const;
//----------------------------------------------------------------------
- // Return a new CompilerType adds a volatile modifier to this type if
- // this type is valid and the type system supports volatile modifiers,
- // else return an invalid type.
+ // Return a new CompilerType adds a volatile modifier to this type if this
+ // type is valid and the type system supports volatile modifiers, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType AddVolatileModifier() const;
//----------------------------------------------------------------------
- // Return a new CompilerType adds a restrict modifier to this type if
- // this type is valid and the type system supports restrict modifiers,
- // else return an invalid type.
+ // Return a new CompilerType adds a restrict modifier to this type if this
+ // type is valid and the type system supports restrict modifiers, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType AddRestrictModifier() const;
//----------------------------------------------------------------------
- // Create a typedef to this type using "name" as the name of the typedef
- // this type is valid and the type system supports typedefs, else return
- // an invalid type.
+ // Create a typedef to this type using "name" as the name of the typedef this
+ // type is valid and the type system supports typedefs, else return an
+ // invalid type.
//----------------------------------------------------------------------
CompilerType CreateTypedef(const char *name,
const CompilerDeclContext &decl_ctx) const;
@@ -311,8 +309,8 @@ public:
//----------------------------------------------------------------------
// If this type is an enumeration, iterate through all of its enumerators
- // using a callback. If the callback returns true, keep iterating, else
- // abort the iteration.
+ // using a callback. If the callback returns true, keep iterating, else abort
+ // the iteration.
//----------------------------------------------------------------------
void ForEachEnumerator(
std::function<bool(const CompilerType &integer_type,
@@ -351,8 +349,8 @@ public:
bool &child_is_deref_of_parent, ValueObject *valobj,
uint64_t &language_flags) const;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
uint32_t GetIndexOfChildWithName(const char *name,
bool omit_empty_base_classes) const;
@@ -385,8 +383,8 @@ public:
// Pointers & References
//------------------------------------------------------------------
- // Converts "s" to a floating point value and place resulting floating
- // point bytes in the "dst" buffer.
+ // Converts "s" to a floating point value and place resulting floating point
+ // bytes in the "dst" buffer.
size_t ConvertStringToFloatValue(const char *s, uint8_t *dst,
size_t dst_size) const;
diff --git a/include/lldb/Symbol/DWARFCallFrameInfo.h b/include/lldb/Symbol/DWARFCallFrameInfo.h
index a1bd1bc8b1c9..133c66d4ae4f 100644
--- a/include/lldb/Symbol/DWARFCallFrameInfo.h
+++ b/include/lldb/Symbol/DWARFCallFrameInfo.h
@@ -25,12 +25,12 @@
namespace lldb_private {
-// DWARFCallFrameInfo is a class which can read eh_frame and DWARF
-// Call Frame Information FDEs. It stores little information internally.
-// Only two APIs are exported - one to find the high/low pc values
-// of a function given a text address via the information in the
-// eh_frame / debug_frame, and one to generate an UnwindPlan based
-// on the FDE in the eh_frame / debug_frame section.
+// DWARFCallFrameInfo is a class which can read eh_frame and DWARF Call Frame
+// Information FDEs. It stores little information internally. Only two APIs
+// are exported - one to find the high/low pc values of a function given a text
+// address via the information in the eh_frame / debug_frame, and one to
+// generate an UnwindPlan based on the FDE in the eh_frame / debug_frame
+// section.
class DWARFCallFrameInfo {
public:
@@ -40,13 +40,13 @@ public:
~DWARFCallFrameInfo() = default;
- // Locate an AddressRange that includes the provided Address in this
- // object's eh_frame/debug_info
- // Returns true if a range is found to cover that address.
+ // Locate an AddressRange that includes the provided Address in this object's
+ // eh_frame/debug_info Returns true if a range is found to cover that
+ // address.
bool GetAddressRange(Address addr, AddressRange &range);
- // Return an UnwindPlan based on the call frame information encoded
- // in the FDE of this DWARFCallFrameInfo section.
+ // Return an UnwindPlan based on the call frame information encoded in the
+ // FDE of this DWARFCallFrameInfo section.
bool GetUnwindPlan(Address addr, UnwindPlan &unwind_plan);
typedef RangeVector<lldb::addr_t, uint32_t> FunctionAddressAndSizeVector;
@@ -55,12 +55,11 @@ public:
// Build a vector of file address and size for all functions in this Module
// based on the eh_frame FDE entries.
//
- // The eh_frame information can be a useful source of file address and size of
- // the functions in a Module. Often a binary's non-exported symbols are
- // stripped
- // before shipping so lldb won't know the start addr / size of many functions
- // in the Module. But the eh_frame can help to give the addresses of these
- // stripped symbols, at least.
+ // The eh_frame information can be a useful source of file address and size
+ // of the functions in a Module. Often a binary's non-exported symbols are
+ // stripped before shipping so lldb won't know the start addr / size of many
+ // functions in the Module. But the eh_frame can help to give the addresses
+ // of these stripped symbols, at least.
//
// @param[out] function_info
// A vector provided by the caller is filled out. May be empty if no
@@ -112,10 +111,9 @@ private:
typedef std::map<dw_offset_t, CIESP> cie_map_t;
- // Start address (file address), size, offset of FDE location
- // used for finding an FDE for a given File address; the start address field
- // is
- // an offset into an individual Module.
+ // Start address (file address), size, offset of FDE location used for
+ // finding an FDE for a given File address; the start address field is an
+ // offset into an individual Module.
typedef RangeDataVector<lldb::addr_t, uint32_t, dw_offset_t> FDEEntryMap;
bool IsEHFrame() const;
@@ -133,8 +131,8 @@ private:
void GetCFIData();
// Applies the specified DWARF opcode to the given row. This function handle
- // the commands
- // operates only on a single row (these are the ones what can appear both in
+ // the commands operates only on a single row (these are the ones what can
+ // appear both in
// CIE and in FDE).
// Returns true if the opcode is handled and false otherwise.
bool HandleCommonDwarfOpcode(uint8_t primary_opcode, uint8_t extended_opcode,
diff --git a/include/lldb/Symbol/DeclVendor.h b/include/lldb/Symbol/DeclVendor.h
index f0ce9157cfa5..d1ccb4191cbc 100644
--- a/include/lldb/Symbol/DeclVendor.h
+++ b/include/lldb/Symbol/DeclVendor.h
@@ -20,9 +20,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-// The Decl vendor class is intended as a generic interface to search
-// for named declarations that are not necessarily backed by a specific
-// symbol file.
+// The Decl vendor class is intended as a generic interface to search for named
+// declarations that are not necessarily backed by a specific symbol file.
//----------------------------------------------------------------------
class DeclVendor {
public:
diff --git a/include/lldb/Symbol/Declaration.h b/include/lldb/Symbol/Declaration.h
index 581176e23961..b654988bccd2 100644
--- a/include/lldb/Symbol/Declaration.h
+++ b/include/lldb/Symbol/Declaration.h
@@ -17,13 +17,12 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Declaration Declaration.h "lldb/Symbol/Declaration.h"
-/// @brief A class that describes the declaration location of a
+/// A class that describes the declaration location of a
/// lldb object.
///
-/// The declarations include the file specification, line number, and
-/// the column info and can help track where functions, blocks, inlined
-/// functions, types, variables, any many other debug core objects were
-/// declared.
+/// The declarations include the file specification, line number, and the
+/// column info and can help track where functions, blocks, inlined functions,
+/// types, variables, any many other debug core objects were declared.
//----------------------------------------------------------------------
class Declaration {
public:
@@ -92,8 +91,8 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Sets the file specification to be empty, and the line and column
- /// to zero.
+ /// Sets the file specification to be empty, and the line and column to
+ /// zero.
//------------------------------------------------------------------
void Clear() {
m_file.Clear();
@@ -106,9 +105,9 @@ public:
//------------------------------------------------------------------
/// Compare two declaration objects.
///
- /// Compares the two file specifications from \a lhs and \a rhs. If
- /// the file specifications are equal, then continue to compare the
- /// line number and column numbers respectively.
+ /// Compares the two file specifications from \a lhs and \a rhs. If the file
+ /// specifications are equal, then continue to compare the line number and
+ /// column numbers respectively.
///
/// @param[in] lhs
/// The Left Hand Side const Declaration object reference.
@@ -126,8 +125,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
diff --git a/include/lldb/Symbol/FuncUnwinders.h b/include/lldb/Symbol/FuncUnwinders.h
index 27f42cf425b2..ae8bcc892ce4 100644
--- a/include/lldb/Symbol/FuncUnwinders.h
+++ b/include/lldb/Symbol/FuncUnwinders.h
@@ -12,8 +12,8 @@ class UnwindTable;
class FuncUnwinders {
public:
- // FuncUnwinders objects are used to track UnwindPlans for a function
- // (named or not - really just an address range)
+ // FuncUnwinders objects are used to track UnwindPlans for a function (named
+ // or not - really just an address range)
// We'll record four different UnwindPlans for each address range:
//
@@ -28,8 +28,8 @@ public:
// available for some reason.
// Additionally, FuncUnwinds object can be asked where the prologue
- // instructions are finished for migrating breakpoints past the
- // stack frame setup instructions when we don't have line table information.
+ // instructions are finished for migrating breakpoints past the stack frame
+ // setup instructions when we don't have line table information.
FuncUnwinders(lldb_private::UnwindTable &unwind_table, AddressRange range);
@@ -38,10 +38,8 @@ public:
// current_offset is the byte offset into the function.
// 0 means no instructions have executed yet. -1 means the offset is unknown.
// On architectures where the pc points to the next instruction that will
- // execute, this
- // offset value will have already been decremented by 1 to stay within the
- // bounds of the
- // correct function body.
+ // execute, this offset value will have already been decremented by 1 to stay
+ // within the bounds of the correct function body.
lldb::UnwindPlanSP GetUnwindPlanAtCallSite(Target &target,
int current_offset);
@@ -69,24 +67,19 @@ public:
// A function may have a Language Specific Data Area specified -- a block of
// data in
// the object file which is used in the processing of an exception throw /
- // catch.
- // If any of the UnwindPlans have the address of the LSDA region for this
- // function,
- // this will return it.
+ // catch. If any of the UnwindPlans have the address of the LSDA region for
+ // this function, this will return it.
Address GetLSDAAddress(Target &target);
// A function may have a Personality Routine associated with it -- used in the
// processing of throwing an exception. If any of the UnwindPlans have the
- // address of the personality routine, this will return it. Read the
- // target-pointer
- // at this address to get the personality function address.
+ // address of the personality routine, this will return it. Read the target-
+ // pointer at this address to get the personality function address.
Address GetPersonalityRoutinePtrAddress(Target &target);
// The following methods to retrieve specific unwind plans should rarely be
- // used.
- // Instead, clients should ask for the *behavior* they are looking for, using
- // one
- // of the above UnwindPlan retrieval methods.
+ // used. Instead, clients should ask for the *behavior* they are looking for,
+ // using one of the above UnwindPlan retrieval methods.
lldb::UnwindPlanSP GetAssemblyUnwindPlan(Target &target, Thread &thread,
int current_offset);
@@ -116,11 +109,11 @@ public:
private:
lldb::UnwindAssemblySP GetUnwindAssemblyProfiler(Target &target);
- // Do a simplistic comparison for the register restore rule for getting
- // the caller's pc value on two UnwindPlans -- returns LazyBoolYes if
- // they have the same unwind rule for the pc, LazyBoolNo if they do not
- // have the same unwind rule for the pc, and LazyBoolCalculate if it was
- // unable to determine this for some reason.
+ // Do a simplistic comparison for the register restore rule for getting the
+ // caller's pc value on two UnwindPlans -- returns LazyBoolYes if they have
+ // the same unwind rule for the pc, LazyBoolNo if they do not have the same
+ // unwind rule for the pc, and LazyBoolCalculate if it was unable to
+ // determine this for some reason.
lldb_private::LazyBool CompareUnwindPlansForIdenticalInitialPCLocation(
Thread &thread, const lldb::UnwindPlanSP &a, const lldb::UnwindPlanSP &b);
@@ -143,8 +136,8 @@ private:
lldb::UnwindPlanSP m_unwind_plan_arch_default_sp;
lldb::UnwindPlanSP m_unwind_plan_arch_default_at_func_entry_sp;
- // Fetching the UnwindPlans can be expensive - if we've already attempted
- // to get one & failed, don't try again.
+ // Fetching the UnwindPlans can be expensive - if we've already attempted to
+ // get one & failed, don't try again.
bool m_tried_unwind_plan_assembly : 1, m_tried_unwind_plan_eh_frame : 1,
m_tried_unwind_plan_debug_frame : 1,
m_tried_unwind_plan_eh_frame_augmented : 1,
diff --git a/include/lldb/Symbol/Function.h b/include/lldb/Symbol/Function.h
index 9d376007a411..28c6b4857b10 100644
--- a/include/lldb/Symbol/Function.h
+++ b/include/lldb/Symbol/Function.h
@@ -21,10 +21,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FunctionInfo Function.h "lldb/Symbol/Function.h"
-/// @brief A class that contains generic function information.
+/// A class that contains generic function information.
///
-/// This provides generic function information that gets reused between
-/// inline functions and function types.
+/// This provides generic function information that gets reused between inline
+/// functions and function types.
//----------------------------------------------------------------------
class FunctionInfo {
public:
@@ -67,8 +67,8 @@ public:
//------------------------------------------------------------------
/// Compare two function information objects.
///
- /// First compares the method names, and if equal, then compares
- /// the declaration information.
+ /// First compares the method names, and if equal, then compares the
+ /// declaration information.
///
/// @param[in] lhs
/// The Left Hand Side const FunctionInfo object reference.
@@ -86,8 +86,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -141,13 +141,13 @@ protected:
//----------------------------------------------------------------------
/// @class InlineFunctionInfo Function.h "lldb/Symbol/Function.h"
-/// @brief A class that describes information for an inlined function.
+/// A class that describes information for an inlined function.
//----------------------------------------------------------------------
class InlineFunctionInfo : public FunctionInfo {
public:
//------------------------------------------------------------------
- /// Construct with the function method name, mangled name, and
- /// optional declaration information.
+ /// Construct with the function method name, mangled name, and optional
+ /// declaration information.
///
/// @param[in] name
/// A C string name for the method name for this function. This
@@ -171,8 +171,8 @@ public:
const Declaration *call_decl_ptr);
//------------------------------------------------------------------
- /// Construct with the function method name, mangled name, and
- /// optional declaration information.
+ /// Construct with the function method name, mangled name, and optional
+ /// declaration information.
///
/// @param[in] name
/// A name for the method name for this function. This value
@@ -202,8 +202,8 @@ public:
//------------------------------------------------------------------
/// Compare two inlined function information objects.
///
- /// First compares the FunctionInfo objects, and if equal,
- /// compares the mangled names.
+ /// First compares the FunctionInfo objects, and if equal, compares the
+ /// mangled names.
///
/// @param[in] lhs
/// The Left Hand Side const InlineFunctionInfo object
@@ -223,8 +223,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -292,17 +292,15 @@ private:
//----------------------------------------------------------------------
/// @class Function Function.h "lldb/Symbol/Function.h"
-/// @brief A class that describes a function.
+/// A class that describes a function.
///
-/// Functions belong to CompileUnit objects (Function::m_comp_unit),
-/// have unique user IDs (Function::UserID), know how to reconstruct
-/// their symbol context (Function::SymbolContextScope), have a
-/// specific function type (Function::m_type_uid), have a simple
-/// method name (FunctionInfo::m_name), be declared at a specific
-/// location (FunctionInfo::m_declaration), possibly have mangled
-/// names (Function::m_mangled), an optional return type
-/// (Function::m_type), and contains lexical blocks
-/// (Function::m_blocks).
+/// Functions belong to CompileUnit objects (Function::m_comp_unit), have
+/// unique user IDs (Function::UserID), know how to reconstruct their symbol
+/// context (Function::SymbolContextScope), have a specific function type
+/// (Function::m_type_uid), have a simple method name (FunctionInfo::m_name),
+/// be declared at a specific location (FunctionInfo::m_declaration), possibly
+/// have mangled names (Function::m_mangled), an optional return type
+/// (Function::m_type), and contains lexical blocks (Function::m_blocks).
///
/// The function information is split into a few pieces:
/// @li The concrete instance information
@@ -311,15 +309,14 @@ private:
/// The abstract information is found in the function type (Type) that
/// describes a function information, return type and parameter types.
///
-/// The concrete information is the address range information and
-/// specific locations for an instance of this function.
+/// The concrete information is the address range information and specific
+/// locations for an instance of this function.
//----------------------------------------------------------------------
class Function : public UserID, public SymbolContextScope {
public:
//------------------------------------------------------------------
- /// Construct with a compile unit, function UID, function type UID,
- /// optional mangled name, function type, and a section offset
- /// based address range.
+ /// Construct with a compile unit, function UID, function type UID, optional
+ /// mangled name, function type, and a section offset based address range.
///
/// @param[in] comp_unit
/// The compile unit to which this function belongs.
@@ -352,9 +349,8 @@ public:
Type *func_type, const AddressRange &range);
//------------------------------------------------------------------
- /// Construct with a compile unit, function UID, function type UID,
- /// optional mangled name, function type, and a section offset
- /// based address range.
+ /// Construct with a compile unit, function UID, function type UID, optional
+ /// mangled name, function type, and a section offset based address range.
///
/// @param[in] comp_unit
/// The compile unit to which this function belongs.
@@ -408,10 +404,10 @@ public:
lldb::LanguageType GetLanguage() const;
//------------------------------------------------------------------
- /// Find the file and line number of the source location of the start
- /// of the function. This will use the declaration if present and fall
- /// back on the line table if that fails. So there may NOT be a line
- /// table entry for this source file/line combo.
+ /// Find the file and line number of the source location of the start of the
+ /// function. This will use the declaration if present and fall back on the
+ /// line table if that fails. So there may NOT be a line table entry for
+ /// this source file/line combo.
///
/// @param[out] source_file
/// The source file.
@@ -422,8 +418,8 @@ public:
void GetStartLineSourceInfo(FileSpec &source_file, uint32_t &line_no);
//------------------------------------------------------------------
- /// Find the file and line number of the source location of the end
- /// of the function.
+ /// Find the file and line number of the source location of the end of the
+ /// function.
///
///
/// @param[out] source_file
@@ -497,8 +493,8 @@ public:
CompilerDeclContext GetDeclContext();
//------------------------------------------------------------------
- /// Get accessor for the type that describes the function
- /// return value type, and parameter types.
+ /// Get accessor for the type that describes the function return value type,
+ /// and parameter types.
///
/// @return
/// A type object pointer.
@@ -506,8 +502,8 @@ public:
Type *GetType();
//------------------------------------------------------------------
- /// Get const accessor for the type that describes the function
- /// return value type, and parameter types.
+ /// Get const accessor for the type that describes the function return value
+ /// type, and parameter types.
///
/// @return
/// A const type object pointer.
@@ -518,10 +514,8 @@ public:
//------------------------------------------------------------------
/// Get the size of the prologue instructions for this function. The
- /// "prologue"
- /// instructions include any instructions given line number 0 immediately
- /// following
- /// the prologue end.
+ /// "prologue" instructions include any instructions given line number 0
+ /// immediately following the prologue end.
///
/// @return
/// The size of the prologue.
@@ -531,8 +525,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -567,10 +561,10 @@ public:
///
/// The debug information may provide information about whether this
/// function was compiled with optimization or not. In this case,
- /// "optimized" means that the debug experience may be difficult
- /// for the user to understand. Variables may not be available when
- /// the developer would expect them, stepping through the source lines
- /// in the function may appear strange, etc.
+ /// "optimized" means that the debug experience may be difficult for the
+ /// user to understand. Variables may not be available when the developer
+ /// would expect them, stepping through the source lines in the function may
+ /// appear strange, etc.
///
/// @return
/// Returns 'true' if this function was compiled with
@@ -582,10 +576,10 @@ public:
//------------------------------------------------------------------
/// Get whether this function represents a 'top-level' function
///
- /// The concept of a top-level function is language-specific, mostly
- /// meant to represent the notion of scripting-style code that has
- /// global visibility of the variables/symbols/functions/...
- /// defined within the containing file/module
+ /// The concept of a top-level function is language-specific, mostly meant
+ /// to represent the notion of scripting-style code that has global
+ /// visibility of the variables/symbols/functions/... defined within the
+ /// containing file/module
///
/// If stopped in a top-level function, LLDB will expose global variables
/// as-if locals in the 'frame variable' command
diff --git a/include/lldb/Symbol/GoASTContext.h b/include/lldb/Symbol/GoASTContext.h
index ee111942c205..29c8cdceacff 100644
--- a/include/lldb/Symbol/GoASTContext.h
+++ b/include/lldb/Symbol/GoASTContext.h
@@ -216,8 +216,7 @@ public:
CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type) override;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override;
CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type,
@@ -294,8 +293,8 @@ public:
bool &child_is_base_class, bool &child_is_deref_of_parent,
ValueObject *valobj, uint64_t &language_flags) override;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
uint32_t