aboutsummaryrefslogtreecommitdiffstats
path: root/include/lldb/Target
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/Target
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/Target')
-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
41 files changed, 1428 insertions, 1510 deletions
diff --git a/include/lldb/Target/ABI.h b/include/lldb/Target/ABI.h
index 0418d683af63..343b3a749597 100644
--- a/include/lldb/Target/ABI.h
+++ b/include/lldb/Target/ABI.h
@@ -82,8 +82,7 @@ public:
protected:
// This is the method the ABI will call to actually calculate the return
- // value.
- // Don't put it in a persistent value object, that will be done by the
+ // value. Don't put it in a persistent value object, that will be done by the
// ABI::GetReturnValueObject.
virtual lldb::ValueObjectSP
GetReturnValueObjectImpl(Thread &thread, CompilerType &ast_type) const = 0;
@@ -118,17 +117,17 @@ public:
// restrictions (4, 8 or 16 byte aligned), and zero is usually not allowed.
// This function should return true if "cfa" is valid call frame address for
// the ABI, and false otherwise. This is used by the generic stack frame
- // unwinding
- // code to help determine when a stack ends.
+ // unwinding code to help determine when a stack ends.
virtual bool CallFrameAddressIsValid(lldb::addr_t cfa) = 0;
- // Validates a possible PC value and returns true if an opcode can be at "pc".
+ // Validates a possible PC value and returns true if an opcode can be at
+ // "pc".
virtual bool CodeAddressIsValid(lldb::addr_t pc) = 0;
virtual lldb::addr_t FixCodeAddress(lldb::addr_t pc) {
- // Some targets might use bits in a code address to indicate
- // a mode switch. ARM uses bit zero to signify a code address is
- // thumb, so any ARM ABI plug-ins would strip those bits.
+ // Some targets might use bits in a code address to indicate a mode switch.
+ // ARM uses bit zero to signify a code address is thumb, so any ARM ABI
+ // plug-ins would strip those bits.
return pc;
}
diff --git a/include/lldb/Target/DynamicLoader.h b/include/lldb/Target/DynamicLoader.h
index b5890662d4e5..de9c4e233b0c 100644
--- a/include/lldb/Target/DynamicLoader.h
+++ b/include/lldb/Target/DynamicLoader.h
@@ -48,24 +48,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class DynamicLoader DynamicLoader.h "lldb/Target/DynamicLoader.h"
-/// @brief A plug-in interface definition class for dynamic loaders.
+/// A plug-in interface definition class for dynamic loaders.
///
/// Dynamic loader plug-ins track image (shared library) loading and
-/// unloading. The class is initialized given a live process that is
-/// halted at its entry point or just after attaching.
+/// unloading. The class is initialized given a live process that is halted at
+/// its entry point or just after attaching.
///
-/// Dynamic loader plug-ins can track the process by registering
-/// callbacks using the:
-/// Process::RegisterNotificationCallbacks (const Notifications&)
+/// Dynamic loader plug-ins can track the process by registering callbacks
+/// using the: Process::RegisterNotificationCallbacks (const Notifications&)
/// function.
///
-/// Breakpoints can also be set in the process which can register
-/// functions that get called using:
-/// Process::BreakpointSetCallback (lldb::user_id_t, BreakpointHitCallback, void
-/// *).
-/// These breakpoint callbacks return a boolean value that indicates if
-/// the process should continue or halt and should return the global
-/// setting for this using:
+/// Breakpoints can also be set in the process which can register functions
+/// that get called using: Process::BreakpointSetCallback (lldb::user_id_t,
+/// BreakpointHitCallback, void *). These breakpoint callbacks return a
+/// boolean value that indicates if the process should continue or halt and
+/// should return the global setting for this using:
/// DynamicLoader::StopWhenImagesChange() const.
//----------------------------------------------------------------------
class DynamicLoader : public PluginInterface {
@@ -73,9 +70,8 @@ public:
//------------------------------------------------------------------
/// Find a dynamic loader plugin for a given process.
///
- /// Scans the installed DynamicLoader plug-ins and tries to find
- /// an instance that can be used to track image changes in \a
- /// process.
+ /// Scans the installed DynamicLoader plug-ins and tries to find an instance
+ /// that can be used to track image changes in \a process.
///
/// @param[in] process
/// The process for which to try and locate a dynamic loader
@@ -95,45 +91,44 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
virtual ~DynamicLoader() override;
//------------------------------------------------------------------
/// Called after attaching a process.
///
- /// Allow DynamicLoader plug-ins to execute some code after
- /// attaching to a process.
+ /// Allow DynamicLoader plug-ins to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach() = 0;
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow DynamicLoader plug-ins to execute some code after
- /// the process has stopped for the first time on launch.
+ /// Allow DynamicLoader plug-ins to execute some code after the process has
+ /// stopped for the first time on launch.
//------------------------------------------------------------------
virtual void DidLaunch() = 0;
//------------------------------------------------------------------
- /// Helper function that can be used to detect when a process has
- /// called exec and is now a new and different process. This can
- /// be called when necessary to try and detect the exec. The process
- /// might be able to answer this question, but sometimes it might
- /// not be able and the dynamic loader often knows what the program
- /// entry point is. So the process and the dynamic loader can work
- /// together to detect this.
+ /// Helper function that can be used to detect when a process has called
+ /// exec and is now a new and different process. This can be called when
+ /// necessary to try and detect the exec. The process might be able to
+ /// answer this question, but sometimes it might not be able and the dynamic
+ /// loader often knows what the program entry point is. So the process and
+ /// the dynamic loader can work together to detect this.
//------------------------------------------------------------------
virtual bool ProcessDidExec() { return false; }
//------------------------------------------------------------------
/// Get whether the process should stop when images change.
///
- /// When images (executables and shared libraries) get loaded or
- /// unloaded, often debug sessions will want to try and resolve or
- /// unresolve breakpoints that are set in these images. Any
- /// breakpoints set by DynamicLoader plug-in instances should
- /// return this value to ensure consistent debug session behaviour.
+ /// When images (executables and shared libraries) get loaded or unloaded,
+ /// often debug sessions will want to try and resolve or unresolve
+ /// breakpoints that are set in these images. Any breakpoints set by
+ /// DynamicLoader plug-in instances should return this value to ensure
+ /// consistent debug session behaviour.
///
/// @return
/// Returns \b true if the process should stop when images
@@ -144,11 +139,11 @@ public:
//------------------------------------------------------------------
/// Set whether the process should stop when images change.
///
- /// When images (executables and shared libraries) get loaded or
- /// unloaded, often debug sessions will want to try and resolve or
- /// unresolve breakpoints that are set in these images. The default
- /// is set so that the process stops when images change, but this
- /// can be overridden using this function callback.
+ /// When images (executables and shared libraries) get loaded or unloaded,
+ /// often debug sessions will want to try and resolve or unresolve
+ /// breakpoints that are set in these images. The default is set so that the
+ /// process stops when images change, but this can be overridden using this
+ /// function callback.
///
/// @param[in] stop
/// Boolean value that indicates whether the process should stop
@@ -157,8 +152,8 @@ public:
void SetStopWhenImagesChange(bool stop);
//------------------------------------------------------------------
- /// Provides a plan to step through the dynamic loader trampoline
- /// for the current state of \a thread.
+ /// Provides a plan to step through the dynamic loader trampoline for the
+ /// current state of \a thread.
///
///
/// @param[in] stop_others
@@ -173,12 +168,9 @@ public:
//------------------------------------------------------------------
/// Some dynamic loaders provide features where there are a group of symbols
- /// "equivalent to"
- /// a given symbol one of which will be chosen when the symbol is bound. If
- /// you want to
- /// set a breakpoint on one of these symbols, you really need to set it on all
- /// the
- /// equivalent symbols.
+ /// "equivalent to" a given symbol one of which will be chosen when the
+ /// symbol is bound. If you want to set a breakpoint on one of these
+ /// symbols, you really need to set it on all the equivalent symbols.
///
///
/// @param[in] original_symbol
@@ -201,13 +193,12 @@ public:
}
//------------------------------------------------------------------
- /// Ask if it is ok to try and load or unload an shared library
- /// (image).
+ /// Ask if it is ok to try and load or unload an shared library (image).
///
- /// The dynamic loader often knows when it would be ok to try and
- /// load or unload a shared library. This function call allows the
- /// dynamic loader plug-ins to check any current dyld state to make
- /// sure it is an ok time to load a shared library.
+ /// The dynamic loader often knows when it would be ok to try and load or
+ /// unload a shared library. This function call allows the dynamic loader
+ /// plug-ins to check any current dyld state to make sure it is an ok time
+ /// to load a shared library.
///
/// @return
/// \b true if it is currently ok to try and load a shared
@@ -216,20 +207,20 @@ public:
virtual Status CanLoadImage() = 0;
//------------------------------------------------------------------
- /// Ask if the eh_frame information for the given SymbolContext should
- /// be relied on even when it's the first frame in a stack unwind.
+ /// Ask if the eh_frame information for the given SymbolContext should be
+ /// relied on even when it's the first frame in a stack unwind.
///
- /// The CFI instructions from the eh_frame section are normally only
- /// valid at call sites -- places where a program could throw an
- /// exception and need to unwind out. But some Modules may be known
- /// to the system as having reliable eh_frame information at all call
- /// sites. This would be the case if the Module's contents are largely
- /// hand-written assembly with hand-written eh_frame information.
- /// Normally when unwinding from a function at the beginning of a stack
- /// unwind lldb will examine the assembly instructions to understand
- /// how the stack frame is set up and where saved registers are stored.
- /// But with hand-written assembly this is not reliable enough -- we need
- /// to consult those function's hand-written eh_frame information.
+ /// The CFI instructions from the eh_frame section are normally only valid
+ /// at call sites -- places where a program could throw an exception and
+ /// need to unwind out. But some Modules may be known to the system as
+ /// having reliable eh_frame information at all call sites. This would be
+ /// the case if the Module's contents are largely hand-written assembly with
+ /// hand-written eh_frame information. Normally when unwinding from a
+ /// function at the beginning of a stack unwind lldb will examine the
+ /// assembly instructions to understand how the stack frame is set up and
+ /// where saved registers are stored. But with hand-written assembly this is
+ /// not reliable enough -- we need to consult those function's hand-written
+ /// eh_frame information.
///
/// @return
/// \b True if the symbol context should use eh_frame instructions
@@ -271,17 +262,17 @@ public:
//------------------------------------------------------------------
/// Get information about the shared cache for a process, if possible.
///
- /// On some systems (e.g. Darwin based systems), a set of libraries
- /// that are common to most processes may be put in a single region
- /// of memory and mapped into every process, this is called the
- /// shared cache, as a performance optimization.
+ /// On some systems (e.g. Darwin based systems), a set of libraries that are
+ /// common to most processes may be put in a single region of memory and
+ /// mapped into every process, this is called the shared cache, as a
+ /// performance optimization.
///
/// Many targets will not have the concept of a shared cache.
///
- /// Depending on how the DynamicLoader gathers information about the
- /// shared cache, it may be able to only return basic information -
- /// like the UUID of the cache - or it may be able to return additional
- /// information about the cache.
+ /// Depending on how the DynamicLoader gathers information about the shared
+ /// cache, it may be able to only return basic information - like the UUID
+ /// of the cache - or it may be able to return additional information about
+ /// the cache.
///
/// @param[out] base_address
/// The base address (load address) of the shared cache.
@@ -356,8 +347,8 @@ protected:
// Return -1 if the read fails, otherwise return the result as an int64_t.
int64_t ReadUnsignedIntWithSizeInBytes(lldb::addr_t addr, int size_in_bytes);
- // Read a pointer from memory at the given addr.
- // Return LLDB_INVALID_ADDRESS if the read fails.
+ // Read a pointer from memory at the given addr. Return LLDB_INVALID_ADDRESS
+ // if the read fails.
lldb::addr_t ReadPointer(lldb::addr_t addr);
// Calls into the Process protected method LoadOperatingSystemPlugin:
diff --git a/include/lldb/Target/ExecutionContext.h b/include/lldb/Target/ExecutionContext.h
index 04af3ebc278d..70eba3654dec 100644
--- a/include/lldb/Target/ExecutionContext.h
+++ b/include/lldb/Target/ExecutionContext.h
@@ -22,61 +22,59 @@
namespace lldb_private {
//===----------------------------------------------------------------------===//
-/// Execution context objects refer to objects in the execution of the
-/// program that is being debugged. The consist of one or more of the
-/// following objects: target, process, thread, and frame. Many objects
-/// in the debugger need to track different executions contexts. For
-/// example, a local function variable might have an execution context
-/// that refers to a stack frame. A global or static variable might
-/// refer to a target since a stack frame isn't required in order to
-/// evaluate a global or static variable (a process isn't necessarily
-/// needed for a global variable since we might be able to read the
-/// variable value from a data section in one of the object files in
+/// Execution context objects refer to objects in the execution of the program
+/// that is being debugged. The consist of one or more of the following
+/// objects: target, process, thread, and frame. Many objects in the debugger
+/// need to track different executions contexts. For example, a local function
+/// variable might have an execution context that refers to a stack frame. A
+/// global or static variable might refer to a target since a stack frame
+/// isn't required in order to evaluate a global or static variable (a process
+/// isn't necessarily needed for a global variable since we might be able to
+/// read the variable value from a data section in one of the object files in
/// a target). There are two types of objects that hold onto execution
-/// contexts: ExecutionContextRef and ExecutionContext. Both of these
-/// objects are described below.
+/// contexts: ExecutionContextRef and ExecutionContext. Both of these objects
+/// are described below.
///
-/// Not all objects in an ExectionContext objects will be valid. If you want
-/// to refer strongly (ExectionContext) or weakly (ExectionContextRef) to
-/// a process, then only the process and target references will be valid.
-/// For threads, only the thread, process and target references will be
-/// filled in. For frames, all of the objects will be filled in.
+/// Not all objects in an ExecutionContext objects will be valid. If you want
+/// to refer strongly (ExecutionContext) or weakly (ExecutionContextRef) to a
+/// process, then only the process and target references will be valid. For
+/// threads, only the thread, process and target references will be filled in.
+/// For frames, all of the objects will be filled in.
///
-/// These classes are designed to be used as baton objects that get passed
-/// to a wide variety of functions that require execution contexts.
+/// These classes are designed to be used as baton objects that get passed to
+/// a wide variety of functions that require execution contexts.
//===----------------------------------------------------------------------===//
//----------------------------------------------------------------------
/// @class ExecutionContextRef ExecutionContext.h
/// "lldb/Target/ExecutionContext.h"
-/// @brief A class that holds a weak reference to an execution context.
+/// A class that holds a weak reference to an execution context.
///
-/// ExecutionContextRef objects are designed to hold onto an execution
-/// context that might change over time. For example, if an object wants
-/// to refer to a stack frame, it should hold onto an ExecutionContextRef
-/// to a frame object. The backing object that represents the stack frame
-/// might change over time and instances of this object can track the logical
-/// object that refers to a frame even if it does change.
+/// ExecutionContextRef objects are designed to hold onto an execution context
+/// that might change over time. For example, if an object wants to refer to a
+/// stack frame, it should hold onto an ExecutionContextRef to a frame object.
+/// The backing object that represents the stack frame might change over time
+/// and instances of this object can track the logical object that refers to a
+/// frame even if it does change.
///
/// These objects also don't keep execution objects around longer than they
-/// should since they use weak pointers. For example if an object refers
-/// to a stack frame and a stack frame is no longer in a thread, then a
-/// ExecutionContextRef object that refers to that frame will not be able
-/// to get a shared pointer to those objects since they are no longer around.
+/// should since they use weak pointers. For example if an object refers to a
+/// stack frame and a stack frame is no longer in a thread, then a
+/// ExecutionContextRef object that refers to that frame will not be able to
+/// get a shared pointer to those objects since they are no longer around.
///
-/// ExecutionContextRef objects can also be used as objects in classes
-/// that want to track a "previous execution context". Since the weak
-/// references to the execution objects (target, process, thread and frame)
-/// don't keep these objects around, they are safe to keep around.
+/// ExecutionContextRef objects can also be used as objects in classes that
+/// want to track a "previous execution context". Since the weak references to
+/// the execution objects (target, process, thread and frame) don't keep these
+/// objects around, they are safe to keep around.
///
-/// The general rule of thumb is all long lived objects that want to
-/// refer to execution contexts should use ExecutionContextRef objects.
-/// The ExecutionContext class is used to temporarily get shared
-/// pointers to any execution context objects that are still around
-/// so they are guaranteed to exist during a function that requires the
-/// objects. ExecutionContext objects should NOT be used for long term
-/// storage since they will keep objects alive with extra shared pointer
-/// references to these objects.
+/// The general rule of thumb is all long lived objects that want to refer to
+/// execution contexts should use ExecutionContextRef objects. The
+/// ExecutionContext class is used to temporarily get shared pointers to any
+/// execution context objects that are still around so they are guaranteed to
+/// exist during a function that requires the objects. ExecutionContext
+/// objects should NOT be used for long term storage since they will keep
+/// objects alive with extra shared pointer references to these objects.
//----------------------------------------------------------------------
class ExecutionContextRef {
public:
@@ -93,9 +91,9 @@ public:
//------------------------------------------------------------------
/// Construct using an ExecutionContext object that might be nullptr.
///
- /// If \a exe_ctx_ptr is valid, then make weak references to any
- /// valid objects in the ExecutionContext, otherwise no weak
- /// references to any execution context objects will be made.
+ /// If \a exe_ctx_ptr is valid, then make weak references to any valid
+ /// objects in the ExecutionContext, otherwise no weak references to any
+ /// execution context objects will be made.
//------------------------------------------------------------------
ExecutionContextRef(const ExecutionContext *exe_ctx_ptr);
@@ -107,38 +105,37 @@ public:
ExecutionContextRef(const ExecutionContext &exe_ctx);
//------------------------------------------------------------------
- /// Construct using the target and all the selected items inside of it
- /// (the process and its selected thread, and the thread's selected
- /// frame). If there is no selected thread, default to the first thread
- /// If there is no selected frame, default to the first frame.
+ /// Construct using the target and all the selected items inside of it (the
+ /// process and its selected thread, and the thread's selected frame). If
+ /// there is no selected thread, default to the first thread If there is no
+ /// selected frame, default to the first frame.
//------------------------------------------------------------------
ExecutionContextRef(Target *target, bool adopt_selected);
//------------------------------------------------------------------
/// Construct using an execution context scope.
///
- /// If the ExecutionContextScope object is valid and refers to a frame,
- /// make weak references too the frame, thread, process and target.
- /// If the ExecutionContextScope object is valid and refers to a thread,
- /// make weak references too the thread, process and target.
- /// If the ExecutionContextScope object is valid and refers to a process,
- /// make weak references too the process and target.
- /// If the ExecutionContextScope object is valid and refers to a target,
- /// make weak references too the target.
+ /// If the ExecutionContextScope object is valid and refers to a frame, make
+ /// weak references too the frame, thread, process and target. If the
+ /// ExecutionContextScope object is valid and refers to a thread, make weak
+ /// references too the thread, process and target. If the
+ /// ExecutionContextScope object is valid and refers to a process, make weak
+ /// references too the process and target. If the ExecutionContextScope
+ /// object is valid and refers to a target, make weak references too the
+ /// target.
//------------------------------------------------------------------
ExecutionContextRef(ExecutionContextScope *exe_scope);
//------------------------------------------------------------------
/// Construct using an execution context scope.
///
- /// If the ExecutionContextScope object refers to a frame,
- /// make weak references too the frame, thread, process and target.
- /// If the ExecutionContextScope object refers to a thread,
- /// make weak references too the thread, process and target.
- /// If the ExecutionContextScope object refers to a process,
- /// make weak references too the process and target.
- /// If the ExecutionContextScope object refers to a target,
- /// make weak references too the target.
+ /// If the ExecutionContextScope object refers to a frame, make weak
+ /// references too the frame, thread, process and target. If the
+ /// ExecutionContextScope object refers to a thread, make weak references
+ /// too the thread, process and target. If the ExecutionContextScope object
+ /// refers to a process, make weak references too the process and target. If
+ /// the ExecutionContextScope object refers to a target, make weak
+ /// references too the target.
//------------------------------------------------------------------
ExecutionContextRef(ExecutionContextScope &exe_scope);
@@ -167,33 +164,33 @@ public:
void Clear();
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the target
- /// referenced in \a target_sp.
+ /// Set accessor that creates a weak reference to the target referenced in
+ /// \a target_sp.
///
- /// If \a target_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous target weak
- /// reference contained in this object will be reset.
+ /// If \a target_sp is valid this object will create a weak reference to
+ /// that object, otherwise any previous target weak reference contained in
+ /// this object will be reset.
///
- /// Only the weak reference to the target will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the target's process, use
- /// the ExecutionContextRef::SetContext() functions.
+ /// Only the weak reference to the target will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the target's process, use the
+ /// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::TargetSP &, bool)
//------------------------------------------------------------------
void SetTargetSP(const lldb::TargetSP &target_sp);
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the process
- /// referenced in \a process_sp.
+ /// Set accessor that creates a weak reference to the process referenced in
+ /// \a process_sp.
///
- /// If \a process_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous process weak
- /// reference contained in this object will be reset.
+ /// If \a process_sp is valid this object will create a weak reference to
+ /// that object, otherwise any previous process weak reference contained in
+ /// this object will be reset.
///
- /// Only the weak reference to the process will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the target, use the
+ /// Only the weak reference to the process will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the target, use the
/// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::ProcessSP &)
@@ -201,34 +198,34 @@ public:
void SetProcessSP(const lldb::ProcessSP &process_sp);
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the thread
- /// referenced in \a thread_sp.
+ /// Set accessor that creates a weak reference to the thread referenced in
+ /// \a thread_sp.
///
- /// If \a thread_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous thread weak
- /// reference contained in this object will be reset.
+ /// If \a thread_sp is valid this object will create a weak reference to
+ /// that object, otherwise any previous thread weak reference contained in
+ /// this object will be reset.
///
- /// Only the weak reference to the thread will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the thread's process and
- /// target, use the ExecutionContextRef::SetContext() functions.
+ /// Only the weak reference to the thread will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the thread's process and target, use the
+ /// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::ThreadSP &)
//------------------------------------------------------------------
void SetThreadSP(const lldb::ThreadSP &thread_sp);
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the frame
- /// referenced in \a frame_sp.
+ /// Set accessor that creates a weak reference to the frame referenced in \a
+ /// frame_sp.
///
- /// If \a frame_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous frame weak
- /// reference contained in this object will be reset.
+ /// If \a frame_sp is valid this object will create a weak reference to that
+ /// object, otherwise any previous frame weak reference contained in this
+ /// object will be reset.
///
- /// Only the weak reference to the frame will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the frame's thread, process
- /// and target, use the ExecutionContextRef::SetContext() functions.
+ /// Only the weak reference to the frame will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the frame's thread, process and target, use the
+ /// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::StackFrameSP &)
//------------------------------------------------------------------
@@ -281,28 +278,25 @@ public:
//------------------------------------------------------------------
/// Create an ExecutionContext object from this object.
///
- /// Create strong references to any execution context objects that
- /// are still valid. Any of the returned shared pointers in the
- /// ExecutionContext objects is not guaranteed to be valid.
- /// @returns
+ /// Create strong references to any execution context objects that are still
+ /// valid. Any of the returned shared pointers in the ExecutionContext
+ /// objects is not guaranteed to be valid. @returns
/// An execution context object that has strong references to
/// any valid weak references in this object.
//------------------------------------------------------------------
ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const;
//------------------------------------------------------------------
- /// Returns true if this object has a weak reference to a thread.
- /// The return value is only an indication of whether this object has
- /// a weak reference and does not indicate whether the weak reference
- /// is valid or not.
+ /// Returns true if this object has a weak reference to a thread. The return
+ /// value is only an indication of whether this object has a weak reference
+ /// and does not indicate whether the weak reference is valid or not.
//------------------------------------------------------------------
bool HasThreadRef() const { return m_tid != LLDB_INVALID_THREAD_ID; }
//------------------------------------------------------------------
- /// Returns true if this object has a weak reference to a frame.
- /// The return value is only an indication of whether this object has
- /// a weak reference and does not indicate whether the weak reference
- /// is valid or not.
+ /// Returns true if this object has a weak reference to a frame. The return
+ /// value is only an indication of whether this object has a weak reference
+ /// and does not indicate whether the weak reference is valid or not.
//------------------------------------------------------------------
bool HasFrameRef() const { return m_stack_id.IsValid(); }
@@ -327,25 +321,25 @@ protected:
};
//----------------------------------------------------------------------
-/// @class ExecutionContext ExecutionContext.h "lldb/Target/ExecutionContext.h"
-/// @brief A class that contains an execution context.
+/// @class ExecutionContext ExecutionContext.h
+/// "lldb/Target/ExecutionContext.h"
+/// A class that contains an execution context.
///
-/// This baton object can be passed into any function that requires
-/// a context that specifies a target, process, thread and frame.
-/// These objects are designed to be used for short term execution
-/// context object storage while a function might be trying to evaluate
-/// something that requires a thread or frame. ExecutionContextRef
-/// objects can be used to initialize one of these objects to turn
-/// the weak execution context object references to the target, process,
-/// thread and frame into strong references (shared pointers) so that
-/// functions can guarantee that these objects won't go away in the
+/// This baton object can be passed into any function that requires a context
+/// that specifies a target, process, thread and frame. These objects are
+/// designed to be used for short term execution context object storage while
+/// a function might be trying to evaluate something that requires a thread or
+/// frame. ExecutionContextRef objects can be used to initialize one of these
+/// objects to turn the weak execution context object references to the
+/// target, process, thread and frame into strong references (shared pointers)
+/// so that functions can guarantee that these objects won't go away in the
/// middle of a function.
///
-/// ExecutionContext objects should be used as short lived objects
-/// (typically on the stack) in order to lock down an execution context
-/// for local use and for passing down to other functions that also
-/// require specific contexts. They should NOT be used for long term
-/// storage, for long term storage use ExecutionContextRef objects.
+/// ExecutionContext objects should be used as short lived objects (typically
+/// on the stack) in order to lock down an execution context for local use and
+/// for passing down to other functions that also require specific contexts.
+/// They should NOT be used for long term storage, for long term storage use
+/// ExecutionContextRef objects.
//----------------------------------------------------------------------
class ExecutionContext {
public:
@@ -384,8 +378,7 @@ public:
bool thread_and_frame_only_if_stopped = false);
// These two variants take in a locker, and grab the target, lock the API
- // mutex into locker, then
- // fill in the rest of the shared pointers.
+ // mutex into locker, then fill in the rest of the shared pointers.
ExecutionContext(const ExecutionContextRef &exe_ctx_ref,
std::unique_lock<std::recursive_mutex> &locker);
ExecutionContext(const ExecutionContextRef *exe_ctx_ref,
@@ -441,14 +434,14 @@ public:
/// Returns a pointer to the target object.
///
/// The returned pointer might be nullptr. Calling HasTargetScope(),
- /// HasProcessScope(), HasThreadScope(), or HasFrameScope()
- /// can help to pre-validate this pointer so that this accessor can
- /// freely be used without having to check for nullptr each time.
+ /// HasProcessScope(), HasThreadScope(), or HasFrameScope() can help to pre-
+ /// validate this pointer so that this accessor can freely be used without
+ /// having to check for nullptr each time.
///
- /// @see ExecutionContext::HasTargetScope() const
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasTargetScope() const @see
+ /// ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Target *GetTargetPtr() const;
@@ -456,13 +449,13 @@ public:
/// Returns a pointer to the process object.
///
/// The returned pointer might be nullptr. Calling HasProcessScope(),
- /// HasThreadScope(), or HasFrameScope() can help to pre-validate
- /// this pointer so that this accessor can freely be used without
- /// having to check for nullptr each time.
+ /// HasThreadScope(), or HasFrameScope() can help to pre-validate this
+ /// pointer so that this accessor can freely be used without having to check
+ /// for nullptr each time.
///
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Process *GetProcessPtr() const;
@@ -470,21 +463,21 @@ public:
/// Returns a pointer to the thread object.
///
/// The returned pointer might be nullptr. Calling HasThreadScope() or
- /// HasFrameScope() can help to pre-validate this pointer so that
- /// this accessor can freely be used without having to check for
- /// nullptr each time.
+ /// HasFrameScope() can help to pre-validate this pointer so that this
+ /// accessor can freely be used without having to check for nullptr each
+ /// time.
///
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Thread *GetThreadPtr() const { return m_thread_sp.get(); }
//------------------------------------------------------------------
/// Returns a pointer to the frame object.
///
- /// The returned pointer might be nullptr. Calling HasFrameScope(),
- /// can help to pre-validate this pointer so that this accessor can
- /// freely be used without having to check for nullptr each time.
+ /// The returned pointer might be nullptr. Calling HasFrameScope(), can help
+ /// to pre-validate this pointer so that this accessor can freely be used
+ /// without having to check for nullptr each time.
///
/// @see ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
@@ -494,14 +487,13 @@ public:
/// Returns a reference to the target object.
///
/// Clients should call HasTargetScope(), HasProcessScope(),
- /// HasThreadScope(), or HasFrameScope() prior to calling this
- /// function to ensure that this ExecutionContext object contains
- /// a valid target.
+ /// HasThreadScope(), or HasFrameScope() prior to calling this function to
+ /// ensure that this ExecutionContext object contains a valid target.
///
- /// @see ExecutionContext::HasTargetScope() const
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasTargetScope() const @see
+ /// ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Target &GetTargetRef() const;
@@ -509,33 +501,32 @@ public:
/// Returns a reference to the process object.
///
/// Clients should call HasProcessScope(), HasThreadScope(), or
- /// HasFrameScope() prior to calling this function to ensure that
- /// this ExecutionContext object contains a valid target.
+ /// HasFrameScope() prior to calling this function to ensure that this
+ /// ExecutionContext object contains a valid target.
///
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Process &GetProcessRef() const;
//------------------------------------------------------------------
/// Returns a reference to the thread object.
///
- /// Clients should call HasThreadScope(), or HasFrameScope() prior
- /// to calling this function to ensure that this ExecutionContext
- /// object contains a valid target.
+ /// Clients should call HasThreadScope(), or HasFrameScope() prior to
+ /// calling this function to ensure that this ExecutionContext object
+ /// contains a valid target.
///
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Thread &GetThreadRef() const;
//------------------------------------------------------------------
/// Returns a reference to the thread object.
///
- /// Clients should call HasFrameScope() prior to calling this
- /// function to ensure that this ExecutionContext object contains
- /// a valid target.
+ /// Clients should call HasFrameScope() prior to calling this function to
+ /// ensure that this ExecutionContext object contains a valid target.
///
/// @see ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
@@ -596,8 +587,8 @@ public:
void SetTargetPtr(Target *target);
//------------------------------------------------------------------
- /// Set accessor to set only the process shared pointer from a
- /// process pointer.
+ /// Set accessor to set only the process shared pointer from a process
+ /// pointer.
//------------------------------------------------------------------
void SetProcessPtr(Process *process);
@@ -608,50 +599,47 @@ public:
void SetThreadPtr(Thread *thread);
//------------------------------------------------------------------
- /// Set accessor to set only the frame shared pointer from a frame
- /// pointer.
+ /// Set accessor to set only the frame shared pointer from a frame pointer.
//------------------------------------------------------------------
void SetFramePtr(StackFrame *frame);
//------------------------------------------------------------------
// Set the execution context using a target shared pointer.
//
- // If "target_sp" is valid, sets the target context to match and
- // if "get_process" is true, sets the process shared pointer if
- // the target currently has a process.
+ // If "target_sp" is valid, sets the target context to match and if
+ // "get_process" is true, sets the process shared pointer if the target
+ // currently has a process.
//------------------------------------------------------------------
void SetContext(const lldb::TargetSP &target_sp, bool get_process);
//------------------------------------------------------------------
// Set the execution context using a process shared pointer.
//
- // If "process_sp" is valid, then set the process and target in this
- // context. Thread and frame contexts will be cleared.
- // If "process_sp" is not valid, all shared pointers are reset.
+ // If "process_sp" is valid, then set the process and target in this context.
+ // Thread and frame contexts will be cleared. If "process_sp" is not valid,
+ // all shared pointers are reset.
//------------------------------------------------------------------
void SetContext(const lldb::ProcessSP &process_sp);
//------------------------------------------------------------------
// Set the execution context using a thread shared pointer.
//
- // If "thread_sp" is valid, then set the thread, process and target
- // in this context. The frame context will be cleared.
- // If "thread_sp" is not valid, all shared pointers are reset.
+ // If "thread_sp" is valid, then set the thread, process and target in this
+ // context. The frame context will be cleared. If "thread_sp" is not valid,
+ // all shared pointers are reset.
//------------------------------------------------------------------
void SetContext(const lldb::ThreadSP &thread_sp);
//------------------------------------------------------------------
// Set the execution context using a frame shared pointer.
//
- // If "frame_sp" is valid, then set the frame, thread, process and
- // target in this context
- // If "frame_sp" is not valid, all shared pointers are reset.
+ // If "frame_sp" is valid, then set the frame, thread, process and target in
+ // this context If "frame_sp" is not valid, all shared pointers are reset.
//------------------------------------------------------------------
void SetContext(const lldb::StackFrameSP &frame_sp);
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target.
+ /// Returns true the ExecutionContext object contains a valid target.
///
/// This function can be called after initializing an ExecutionContext
/// object, and if it returns true, calls to GetTargetPtr() and
@@ -660,36 +648,35 @@ public:
bool HasTargetScope() const;
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target and process.
+ /// Returns true the ExecutionContext object contains a valid target and
+ /// process.
///
/// This function can be called after initializing an ExecutionContext
/// object, and if it returns true, calls to GetTargetPtr() and
- /// GetTargetRef(), GetProcessPtr(), and GetProcessRef(), do not
- /// need to be checked for validity.
+ /// GetTargetRef(), GetProcessPtr(), and GetProcessRef(), do not need to be
+ /// checked for validity.
//------------------------------------------------------------------
bool HasProcessScope() const;
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target, process, and thread.
+ /// Returns true the ExecutionContext object contains a valid target,
+ /// process, and thread.
///
/// This function can be called after initializing an ExecutionContext
- /// object, and if it returns true, calls to GetTargetPtr(),
- /// GetTargetRef(), GetProcessPtr(), GetProcessRef(), GetThreadPtr(),
- /// and GetThreadRef() do not need to be checked for validity.
+ /// object, and if it returns true, calls to GetTargetPtr(), GetTargetRef(),
+ /// GetProcessPtr(), GetProcessRef(), GetThreadPtr(), and GetThreadRef() do
+ /// not need to be checked for validity.
//------------------------------------------------------------------
bool HasThreadScope() const;
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target, process, thread and frame.
+ /// Returns true the ExecutionContext object contains a valid target,
+ /// process, thread and frame.
///
/// This function can be called after initializing an ExecutionContext
- /// object, and if it returns true, calls to GetTargetPtr(),
- /// GetTargetRef(), GetProcessPtr(), GetProcessRef(), GetThreadPtr(),
- /// GetThreadRef(), GetFramePtr(), and GetFrameRef() do not need
- /// to be checked for validity.
+ /// object, and if it returns true, calls to GetTargetPtr(), GetTargetRef(),
+ /// GetProcessPtr(), GetProcessRef(), GetThreadPtr(), GetThreadRef(),
+ /// GetFramePtr(), and GetFrameRef() do not need to be checked for validity.
//------------------------------------------------------------------
bool HasFrameScope() const;
diff --git a/include/lldb/Target/ExecutionContextScope.h b/include/lldb/Target/ExecutionContextScope.h
index 36d3d9de49b0..b73ca576bd8a 100644
--- a/include/lldb/Target/ExecutionContextScope.h
+++ b/include/lldb/Target/ExecutionContextScope.h
@@ -20,22 +20,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ExecutionContextScope ExecutionContextScope.h
-/// "lldb/Symbol/ExecutionContextScope.h"
-/// @brief Inherit from this if your object can reconstruct its
+/// "lldb/Symbol/ExecutionContextScope.h" Inherit from this if your object can
+/// reconstruct its
/// execution context.
///
-/// Many objects that have pointers back to parent execution context
-/// objects can inherit from this pure virtual class can reconstruct
-/// their execution context without having to keep a complete
-/// ExecutionContext object in the object state. Examples of these
-/// objects include: Process, Thread, RegisterContext and StackFrame.
+/// Many objects that have pointers back to parent execution context objects
+/// can inherit from this pure virtual class can reconstruct their execution
+/// context without having to keep a complete ExecutionContext object in the
+/// object state. Examples of these objects include: Process, Thread,
+/// RegisterContext and StackFrame.
///
-/// Objects can contain a valid pointer to an instance of this so they
-/// can reconstruct the execution context.
+/// Objects can contain a valid pointer to an instance of this so they can
+/// reconstruct the execution context.
///
-/// Objects that adhere to this protocol can reconstruct enough of a
-/// execution context to allow functions that take a execution contexts
-/// to be called.
+/// Objects that adhere to this protocol can reconstruct enough of a execution
+/// context to allow functions that take a execution contexts to be called.
//----------------------------------------------------------------------
class ExecutionContextScope {
public:
@@ -52,9 +51,9 @@ public:
//------------------------------------------------------------------
/// Reconstruct the object's execution context into \a sc.
///
- /// The object should fill in as much of the ExecutionContextScope as it
- /// can so function calls that require a execution context can be made
- /// for the given object.
+ /// The object should fill in as much of the ExecutionContextScope as it can
+ /// so function calls that require a execution context can be made for the
+ /// given object.
///
/// @param[out] exe_ctx
/// A reference to an execution context object that gets filled
diff --git a/include/lldb/Target/JITLoader.h b/include/lldb/Target/JITLoader.h
index 97f2a9796a80..56f1417eddb0 100644
--- a/include/lldb/Target/JITLoader.h
+++ b/include/lldb/Target/JITLoader.h
@@ -19,21 +19,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class JITLoader JITLoader.h "lldb/Target/JITLoader.h"
-/// @brief A plug-in interface definition class for JIT loaders.
+/// A plug-in interface definition class for JIT loaders.
///
-/// Plugins of this kind listen for code generated at runtime in the
-/// target. They are very similar to dynamic loader, with the difference
-/// that they do not have information about the target's dyld and
-/// that there may be multiple JITLoader plugins per process, while
-/// there is at most one DynamicLoader.
+/// Plugins of this kind listen for code generated at runtime in the target.
+/// They are very similar to dynamic loader, with the difference that they do
+/// not have information about the target's dyld and that there may be
+/// multiple JITLoader plugins per process, while there is at most one
+/// DynamicLoader.
//----------------------------------------------------------------------
class JITLoader : public PluginInterface {
public:
//------------------------------------------------------------------
/// Find a JIT loader plugin for a given process.
///
- /// Scans the installed DynamicLoader plug-ins and tries to find
- /// all applicable instances for the current process.
+ /// Scans the installed DynamicLoader plug-ins and tries to find all
+ /// applicable instances for the current process.
///
/// @param[in] process
/// The process for which to try and locate a JIT loader
@@ -52,22 +52,22 @@ public:
//------------------------------------------------------------------
/// Called after attaching a process.
///
- /// Allow JITLoader plug-ins to execute some code after
- /// attaching to a process.
+ /// Allow JITLoader plug-ins to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach() = 0;
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow JITLoader plug-ins to execute some code after
- /// the process has stopped for the first time on launch.
+ /// Allow JITLoader plug-ins to execute some code after the process has
+ /// stopped for the first time on launch.
//------------------------------------------------------------------
virtual void DidLaunch() = 0;
//------------------------------------------------------------------
- /// Called after a new shared object has been loaded so that it can
- /// be probed for JIT entry point hooks.
+ /// Called after a new shared object has been loaded so that it can be
+ /// probed for JIT entry point hooks.
//------------------------------------------------------------------
virtual void ModulesDidLoad(lldb_private::ModuleList &module_list) = 0;
diff --git a/include/lldb/Target/Language.h b/include/lldb/Target/Language.h
index f81679f78129..dd7db26f3ba6 100644
--- a/include/lldb/Target/Language.h
+++ b/include/lldb/Target/Language.h
@@ -184,19 +184,16 @@ public:
virtual const char *GetLanguageSpecificTypeLookupHelp();
// if an individual data formatter can apply to several types and cross a
- // language boundary
- // it makes sense for individual languages to want to customize the printing
- // of values of that
- // type by appending proper prefix/suffix information in language-specific
- // ways
+ // language boundary it makes sense for individual languages to want to
+ // customize the printing of values of that type by appending proper
+ // prefix/suffix information in language-specific ways
virtual bool GetFormatterPrefixSuffix(ValueObject &valobj,
ConstString type_hint,
std::string &prefix,
std::string &suffix);
// if a language has a custom format for printing variable declarations that
- // it wants LLDB to honor
- // it should return an appropriate closure here
+ // it wants LLDB to honor it should return an appropriate closure here
virtual DumpValueObjectOptions::DeclPrintingHelper GetDeclPrintingHelper();
virtual LazyBool IsLogicalTrue(ValueObject &valobj, Status &error);
@@ -206,11 +203,9 @@ public:
virtual bool IsNilReference(ValueObject &valobj);
// for a ValueObject of some "reference type", if the language provides a
- // technique
- // to decide whether the reference has ever been assigned to some object, this
- // method
- // will return true if such detection is possible, and if the reference has
- // never been assigned
+ // technique to decide whether the reference has ever been assigned to some
+ // object, this method will return true if such detection is possible, and if
+ // the reference has never been assigned
virtual bool IsUninitializedReference(ValueObject &valobj);
virtual bool GetFunctionDisplayName(const SymbolContext *sc,
diff --git a/include/lldb/Target/LanguageRuntime.h b/include/lldb/Target/LanguageRuntime.h
index 98db941669c7..6537a8f6dd55 100644
--- a/include/lldb/Target/LanguageRuntime.h
+++ b/include/lldb/Target/LanguageRuntime.h
@@ -85,26 +85,23 @@ public:
Address &address,
Value::ValueType &value_type) = 0;
- // This call should return a CompilerType given a generic type name
- // and an ExecutionContextScope in which one can actually fetch
- // any specialization information required.
+ // This call should return a CompilerType given a generic type name and an
+ // ExecutionContextScope in which one can actually fetch any specialization
+ // information required.
virtual CompilerType GetConcreteType(ExecutionContextScope *exe_scope,
ConstString abstract_type_name) {
return CompilerType();
}
// This should be a fast test to determine whether it is likely that this
- // value would
- // have a dynamic type.
+ // value would have a dynamic type.
virtual bool CouldHaveDynamicValue(ValueObject &in_value) = 0;
// The contract for GetDynamicTypeAndAddress() is to return a "bare-bones"
- // dynamic type
- // For instance, given a Base* pointer, GetDynamicTypeAndAddress() will return
- // the type of
- // Derived, not Derived*. The job of this API is to correct this misalignment
- // between the
- // static type and the discovered dynamic type
+ // dynamic type For instance, given a Base* pointer,
+ // GetDynamicTypeAndAddress() will return the type of Derived, not Derived*.
+ // The job of this API is to correct this misalignment between the static
+ // type and the discovered dynamic type
virtual TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name,
ValueObject &static_value) = 0;
@@ -144,18 +141,16 @@ public:
virtual void ModulesDidLoad(const ModuleList &module_list) {}
- // Called by the Clang expression evaluation engine to allow runtimes to alter
- // the set of target options provided to
- // the compiler.
- // If the options prototype is modified, runtimes must return true, false
- // otherwise.
+ // Called by the Clang expression evaluation engine to allow runtimes to
+ // alter the set of target options provided to the compiler. If the options
+ // prototype is modified, runtimes must return true, false otherwise.
virtual bool GetOverrideExprOptions(clang::TargetOptions &prototype) {
return false;
}
// Called by ClangExpressionParser::PrepareForExecution to query for any
- // custom LLVM IR passes
- // that need to be run before an expression is assembled and run.
+ // custom LLVM IR passes that need to be run before an expression is
+ // assembled and run.
virtual bool GetIRPasses(LLVMUserExpression::IRPasses &custom_passes) {
return false;
}
diff --git a/include/lldb/Target/Memory.h b/include/lldb/Target/Memory.h
index af6be15df9fb..16d7b256a78e 100644
--- a/include/lldb/Target/Memory.h
+++ b/include/lldb/Target/Memory.h
@@ -120,8 +120,8 @@ protected:
//----------------------------------------------------------------------
// A class that can track allocated memory and give out allocated memory
-// without us having to make an allocate/deallocate call every time we
-// need some memory in a process that is being debugged.
+// without us having to make an allocate/deallocate call every time we need
+// some memory in a process that is being debugged.
//----------------------------------------------------------------------
class AllocatedMemoryCache {
public:
diff --git a/include/lldb/Target/MemoryRegionInfo.h b/include/lldb/Target/MemoryRegionInfo.h
index 0824b2442acc..505ecfcfc5ae 100644
--- a/include/lldb/Target/MemoryRegionInfo.h
+++ b/include/lldb/Target/MemoryRegionInfo.h
@@ -25,7 +25,7 @@ public:
MemoryRegionInfo()
: m_range(), m_read(eDontKnow), m_write(eDontKnow), m_execute(eDontKnow),
- m_mapped(eDontKnow) {}
+ m_mapped(eDontKnow), m_flash(eDontKnow), m_blocksize(0) {}
~MemoryRegionInfo() {}
@@ -58,9 +58,17 @@ public:
void SetName(const char *name) { m_name = ConstString(name); }
+ OptionalBool GetFlash() const { return m_flash; }
+
+ void SetFlash(OptionalBool val) { m_flash = val; }
+
+ lldb::offset_t GetBlocksize() const { return m_blocksize; }
+
+ void SetBlocksize(lldb::offset_t blocksize) { m_blocksize = blocksize; }
+
//----------------------------------------------------------------------
- // Get permissions as a uint32_t that is a mask of one or more bits from
- // the lldb::Permissions
+ // Get permissions as a uint32_t that is a mask of one or more bits from the
+ // lldb::Permissions
//----------------------------------------------------------------------
uint32_t GetLLDBPermissions() const {
uint32_t permissions = 0;
@@ -74,8 +82,8 @@ public:
}
//----------------------------------------------------------------------
- // Set permissions from a uint32_t that contains one or more bits from
- // the lldb::Permissions
+ // Set permissions from a uint32_t that contains one or more bits from the
+ // lldb::Permissions
//----------------------------------------------------------------------
void SetLLDBPermissions(uint32_t permissions) {
m_read = (permissions & lldb::ePermissionsReadable) ? eYes : eNo;
@@ -98,6 +106,8 @@ protected:
OptionalBool m_execute;
OptionalBool m_mapped;
ConstString m_name;
+ OptionalBool m_flash;
+ lldb::offset_t m_blocksize;
};
}
diff --git a/include/lldb/Target/ModuleCache.h b/include/lldb/Target/ModuleCache.h
index 4959ee8ea0a3..a060937e0614 100644
--- a/include/lldb/Target/ModuleCache.h
+++ b/include/lldb/Target/ModuleCache.h
@@ -28,10 +28,10 @@ class UUID;
//----------------------------------------------------------------------
/// @class ModuleCache ModuleCache.h "lldb/Target/ModuleCache.h"
-/// @brief A module cache class.
+/// A module cache class.
///
-/// Caches locally modules that are downloaded from remote targets.
-/// Each cached module maintains 2 views:
+/// Caches locally modules that are downloaded from remote targets. Each
+/// cached module maintains 2 views:
/// - UUID view:
/// /${CACHE_ROOT}/${PLATFORM_NAME}/.cache/${UUID}/${MODULE_FILENAME}
/// - Sysroot view:
@@ -42,7 +42,8 @@ class UUID;
///
/// Example:
/// UUID view :
-/// /tmp/lldb/remote-linux/.cache/30C94DC6-6A1F-E951-80C3-D68D2B89E576-D5AE213C/libc.so.6
+/// /tmp/lldb/remote-
+/// linux/.cache/30C94DC6-6A1F-E951-80C3-D68D2B89E576-D5AE213C/libc.so.6
/// Sysroot view: /tmp/lldb/remote-linux/ubuntu/lib/x86_64-linux-gnu/libc.so.6
//----------------------------------------------------------------------
diff --git a/include/lldb/Target/ObjCLanguageRuntime.h b/include/lldb/Target/ObjCLanguageRuntime.h
index 97a2a731581a..6f8354ea3a27 100644
--- a/include/lldb/Target/ObjCLanguageRuntime.h
+++ b/include/lldb/Target/ObjCLanguageRuntime.h
@@ -48,10 +48,9 @@ public:
class ClassDescriptor;
typedef std::shared_ptr<ClassDescriptor> ClassDescriptorSP;
- // the information that we want to support retrieving from an ObjC class
- // this needs to be pure virtual since there are at least 2 different
- // implementations
- // of the runtime, and more might come
+ // the information that we want to support retrieving from an ObjC class this
+ // needs to be pure virtual since there are at least 2 different
+ // implementations of the runtime, and more might come
class ClassDescriptor {
public:
ClassDescriptor()
@@ -66,8 +65,8 @@ public:
virtual ClassDescriptorSP GetMetaclass() const = 0;
- // virtual if any implementation has some other version-specific rules
- // but for the known v1/v2 this is all that needs to be done
+ // virtual if any implementation has some other version-specific rules but
+ // for the known v1/v2 this is all that needs to be done
virtual bool IsKVO() {
if (m_is_kvo == eLazyBoolCalculate) {
const char *class_name = GetClassName().AsCString();
@@ -78,8 +77,8 @@ public:
return (m_is_kvo == eLazyBoolYes);
}
- // virtual if any implementation has some other version-specific rules
- // but for the known v1/v2 this is all that needs to be done
+ // virtual if any implementation has some other version-specific rules but
+ // for the known v1/v2 this is all that needs to be done
virtual bool IsCFType() {
if (m_is_cf == eLazyBoolCalculate) {
const char *class_name = GetClassName().AsCString();
@@ -268,15 +267,14 @@ public:
virtual DeclVendor *GetDeclVendor() { return nullptr; }
// Finds the byte offset of the child_type ivar in parent_type. If it can't
- // find the
- // offset, returns LLDB_INVALID_IVAR_OFFSET.
+ // find the offset, returns LLDB_INVALID_IVAR_OFFSET.
virtual size_t GetByteOffsetForIvar(CompilerType &parent_qual_type,
const char *ivar_name);
- // Given the name of an Objective-C runtime symbol (e.g., ivar offset symbol),
- // try to determine from the runtime what the value of that symbol would be.
- // Useful when the underlying binary is stripped.
+ // Given the name of an Objective-C runtime symbol (e.g., ivar offset
+ // symbol), try to determine from the runtime what the value of that symbol
+ // would be. Useful when the underlying binary is stripped.
virtual lldb::addr_t LookupRuntimeSymbol(const ConstString &name) {
return LLDB_INVALID_ADDRESS;
}
@@ -334,8 +332,7 @@ protected:
private:
// We keep a map of <Class,Selector>->Implementation so we don't have to call
- // the resolver
- // function over and over.
+ // the resolver function over and over.
// FIXME: We need to watch for the loading of Protocols, and flush the cache
// for any
diff --git a/include/lldb/Target/OperatingSystem.h b/include/lldb/Target/OperatingSystem.h
index 24ded3f69723..fe4fdee182f4 100644
--- a/include/lldb/Target/OperatingSystem.h
+++ b/include/lldb/Target/OperatingSystem.h
@@ -22,13 +22,13 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class OperatingSystem OperatingSystem.h "lldb/Target/OperatingSystem.h"
-/// @brief A plug-in interface definition class for halted OS helpers.
+/// A plug-in interface definition class for halted OS helpers.
///
/// Halted OS plug-ins can be used by any process to locate and create
/// OS objects, like threads, during the lifetime of a debug session.
/// This is commonly used when attaching to an operating system that is
-/// halted, such as when debugging over JTAG or connecting to low level
-/// kernel debug services.
+/// halted, such as when debugging over JTAG or connecting to low level kernel
+/// debug services.
//----------------------------------------------------------------------
class OperatingSystem : public PluginInterface {
@@ -36,9 +36,8 @@ public:
//------------------------------------------------------------------
/// Find a halted OS plugin for a given process.
///
- /// Scans the installed OperatingSystem plug-ins and tries to find
- /// an instance that matches the current target triple and
- /// executable.
+ /// Scans the installed OperatingSystem plug-ins and tries to find an
+ /// instance that matches the current target triple and executable.
///
/// @param[in] process
/// The process for which to try and locate a halted OS
diff --git a/include/lldb/Target/PathMappingList.h b/include/lldb/Target/PathMappingList.h
index b1b551f2d24d..a5ee3265a223 100644
--- a/include/lldb/Target/PathMappingList.h
+++ b/include/lldb/Target/PathMappingList.h
@@ -90,7 +90,7 @@ public:
bool RemapPath(llvm::StringRef path, std::string &new_path) const;
bool RemapPath(const char *, std::string &) const = delete;
- bool ReverseRemapPath(const ConstString &path, ConstString &new_path) const;
+ bool ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const;
//------------------------------------------------------------------
/// Finds a source file given a file spec using the path remappings.
diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h
index 6288a3ab684f..217b945d29cd 100644
--- a/include/lldb/Target/Platform.h
+++ b/include/lldb/Target/Platform.h
@@ -27,12 +27,10 @@
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-public.h"
-
-// TODO pull NativeDelegate class out of NativeProcessProtocol so we
-// can just forward ref the NativeDelegate rather than include it here.
-#include "lldb/Host/common/NativeProcessProtocol.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -57,7 +55,7 @@ typedef llvm::SmallVector<lldb::addr_t, 6> MmapArgList;
//----------------------------------------------------------------------
/// @class Platform Platform.h "lldb/Target/Platform.h"
-/// @brief A plug-in interface definition class for debug platform that
+/// A plug-in interface definition class for debug platform that
/// includes many platform abilities such as:
/// @li getting platform information such as supported architectures,
/// supported binary file formats and more
@@ -78,8 +76,8 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
~Platform() override;
@@ -92,13 +90,13 @@ public:
//------------------------------------------------------------------
/// Get the native host platform plug-in.
///
- /// There should only be one of these for each host that LLDB runs
- /// upon that should be statically compiled in and registered using
- /// preprocessor macros or other similar build mechanisms in a
+ /// There should only be one of these for each host that LLDB runs upon that
+ /// should be statically compiled in and registered using preprocessor
+ /// macros or other similar build mechanisms in a
/// PlatformSubclass::Initialize() function.
///
- /// This platform will be used as the default platform when launching
- /// or attaching to processes unless another platform is specified.
+ /// This platform will be used as the default platform when launching or
+ /// attaching to processes unless another platform is specified.
//------------------------------------------------------------------
static lldb::PlatformSP GetHostPlatform();
@@ -127,8 +125,8 @@ public:
//------------------------------------------------------------------
/// Find a platform plugin for a given process.
///
- /// Scans the installed Platform plug-ins and tries to find
- /// an instance that can be used for \a process
+ /// Scans the installed Platform plug-ins and tries to find an instance that
+ /// can be used for \a process
///
/// @param[in] process
/// The process for which to try and locate a platform
@@ -142,19 +140,17 @@ public:
// FindPlugin (Process *process, const ConstString &plugin_name);
//------------------------------------------------------------------
- /// Set the target's executable based off of the existing
- /// architecture information in \a target given a path to an
- /// executable \a exe_file.
+ /// Set the target's executable based off of the existing architecture
+ /// information in \a target given a path to an executable \a exe_file.
///
- /// Each platform knows the architectures that it supports and can
- /// select the correct architecture slice within \a exe_file by
- /// inspecting the architecture in \a target. If the target had an
- /// architecture specified, then in can try and obey that request
- /// and optionally fail if the architecture doesn't match up.
- /// If no architecture is specified, the platform should select the
- /// default architecture from \a exe_file. Any application bundles
- /// or executable wrappers can also be inspected for the actual
- /// application binary within the bundle that should be used.
+ /// Each platform knows the architectures that it supports and can select
+ /// the correct architecture slice within \a exe_file by inspecting the
+ /// architecture in \a target. If the target had an architecture specified,
+ /// then in can try and obey that request and optionally fail if the
+ /// architecture doesn't match up. If no architecture is specified, the
+ /// platform should select the default architecture from \a exe_file. Any
+ /// application bundles or executable wrappers can also be inspected for the
+ /// actual application binary within the bundle that should be used.
///
/// @return
/// Returns \b true if this Platform plug-in was able to find
@@ -167,10 +163,10 @@ public:
//------------------------------------------------------------------
/// Find a symbol file given a symbol file module specification.
///
- /// Each platform might have tricks to find symbol files for an
- /// executable given information in a symbol file ModuleSpec. Some
- /// platforms might also support symbol files that are bundles and
- /// know how to extract the right symbol file given a bundle.
+ /// Each platform might have tricks to find symbol files for an executable
+ /// given information in a symbol file ModuleSpec. Some platforms might also
+ /// support symbol files that are bundles and know how to extract the right
+ /// symbol file given a bundle.
///
/// @param[in] target
/// The target in which we are trying to resolve the symbol file.
@@ -215,9 +211,8 @@ public:
FileSpec &sym_file);
//------------------------------------------------------------------
- /// Resolves the FileSpec to a (possibly) remote path. Remote
- /// platforms must override this to resolve to a path on the remote
- /// side.
+ /// Resolves the FileSpec to a (possibly) remote path. Remote platforms must
+ /// override this to resolve to a path on the remote side.
//------------------------------------------------------------------
virtual bool ResolveRemotePath(const FileSpec &platform_path,
FileSpec &resolved_platform_path);
@@ -225,17 +220,15 @@ public:
//------------------------------------------------------------------
/// Get the OS version from a connected platform.
///
- /// Some platforms might not be connected to a remote platform, but
- /// can figure out the OS version for a process. This is common for
- /// simulator platforms that will run native programs on the current
- /// host, but the simulator might be simulating a different OS. The
- /// \a process parameter might be specified to help to determine
- /// the OS version.
+ /// Some platforms might not be connected to a remote platform, but can
+ /// figure out the OS version for a process. This is common for simulator
+ /// platforms that will run native programs on the current host, but the
+ /// simulator might be simulating a different OS. The \a process parameter
+ /// might be specified to help to determine the OS version.
//------------------------------------------------------------------
- virtual bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update,
- Process *process = nullptr);
+ virtual llvm::VersionTuple GetOSVersion(Process *process = nullptr);
- bool SetOSVersion(uint32_t major, uint32_t minor, uint32_t update);
+ bool SetOSVersion(llvm::VersionTuple os_version);
bool GetOSBuildString(std::string &s);
@@ -253,19 +246,19 @@ public:
//------------------------------------------------------------------
/// Report the current status for this platform.
///
- /// The returned string usually involves returning the OS version
- /// (if available), and any SDK directory that might be being used
- /// for local file caching, and if connected a quick blurb about
- /// what this platform is connected to.
+ /// The returned string usually involves returning the OS version (if
+ /// available), and any SDK directory that might be being used for local
+ /// file caching, and if connected a quick blurb about what this platform is
+ /// connected to.
//------------------------------------------------------------------
virtual void GetStatus(Stream &strm);
//------------------------------------------------------------------
// Subclasses must be able to fetch the current OS version
//
- // Remote classes must be connected for this to succeed. Local
- // subclasses don't need to override this function as it will just
- // call the HostInfo::GetOSVersion().
+ // Remote classes must be connected for this to succeed. Local subclasses
+ // don't need to override this function as it will just call the
+ // HostInfo::GetOSVersion().
//------------------------------------------------------------------
virtual bool GetRemoteOSVersion() { return false; }
@@ -295,8 +288,8 @@ public:
//------------------------------------------------------------------
/// Locate a file for a platform.
///
- /// The default implementation of this function will return the same
- /// file patch in \a local_file as was in \a platform_file.
+ /// The default implementation of this function will return the same file
+ /// patch in \a local_file as was in \a platform_file.
///
/// @param[in] platform_file
/// The platform file path to locate and cache locally.
@@ -326,8 +319,8 @@ public:
//----------------------------------------------------------------------
// Locate the scripting resource 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.
//----------------------------------------------------------------------
virtual FileSpecList
LocateExecutableScriptingResources(Target *target, Module &module,
@@ -347,8 +340,8 @@ public:
virtual Status DisconnectRemote();
//------------------------------------------------------------------
- /// Get the platform's supported architectures in the order in which
- /// they should be searched.
+ /// Get the platform's supported architectures in the order in which they
+ /// should be searched.
///
/// @param[in] idx
/// A zero based architecture index
@@ -368,14 +361,14 @@ public:
BreakpointSite *bp_site);
//------------------------------------------------------------------
- /// Launch a new process on a platform, not necessarily for
- /// debugging, it could be just for running the process.
+ /// Launch a new process on a platform, not necessarily for debugging, it
+ /// could be just for running the process.
//------------------------------------------------------------------
virtual 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
@@ -388,28 +381,27 @@ public:
virtual Status KillProcess(const lldb::pid_t pid);
//------------------------------------------------------------------
- /// Lets a platform answer if it is compatible with a given
- /// architecture and the target triple contained within.
+ /// Lets a platform answer if it is compatible with a given architecture and
+ /// the target triple contained within.
//------------------------------------------------------------------
virtual bool IsCompatibleArchitecture(const ArchSpec &arch,
bool exact_arch_match,
ArchSpec *compatible_arch_ptr);
//------------------------------------------------------------------
- /// Not all platforms will support debugging a process by spawning
- /// somehow halted for a debugger (specified using the
- /// "eLaunchFlagDebug" launch flag) and then attaching. If your
- /// platform doesn't support this, override this function and return
- /// false.
+ /// Not all platforms will support debugging a process by spawning somehow
+ /// halted for a debugger (specified using the "eLaunchFlagDebug" launch
+ /// flag) and then attaching. If your platform doesn't support this,
+ /// override this function and return false.
//------------------------------------------------------------------
virtual bool CanDebugProcess() { return true; }
//------------------------------------------------------------------
- /// Subclasses do not need to implement this function as it uses
- /// the Platform::LaunchProcess() followed by Platform::Attach ().
- /// Remote platforms will want to subclass this function in order
- /// to be able to intercept STDIO and possibly launch a separate
- /// process that will debug the debuggee.
+ /// Subclasses do not need to implement this function as it uses the
+ /// Platform::LaunchProcess() followed by Platform::Attach (). Remote
+ /// platforms will want to subclass this function in order to be able to
+ /// intercept STDIO and possibly launch a separate process that will debug
+ /// the debuggee.
//------------------------------------------------------------------
virtual lldb::ProcessSP
DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
@@ -426,11 +418,11 @@ public:
//------------------------------------------------------------------
/// Attach to an existing process using a process ID.
///
- /// Each platform subclass needs to implement this function and
- /// attempt to attach to the process with the process ID of \a pid.
- /// The platform subclass should return an appropriate ProcessSP
- /// subclass that is attached to the process, or an empty shared
- /// pointer with an appropriate error.
+ /// Each platform subclass needs to implement this function and attempt to
+ /// attach to the process with the process ID of \a pid. The platform
+ /// subclass should return an appropriate ProcessSP subclass that is
+ /// attached to the process, or an empty shared pointer with an appropriate
+ /// error.
///
/// @param[in] pid
/// The process ID that we should attempt to attach to.
@@ -451,12 +443,11 @@ public:
//------------------------------------------------------------------
/// Attach to an existing process by process name.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. It will first call
- /// Process::WillAttach (const char *) and if that returns \b
- /// true, Process::DoAttach (const char *) will be called to
- /// actually do the attach. If DoAttach returns \b true, then
- /// Process::DidAttach() will be called.
+ /// This function is not meant to be overridden by Process subclasses. It
+ /// will first call Process::WillAttach (const char *) and if that returns
+ /// \b true, Process::DoAttach (const char *) will be called to actually do
+ /// the attach. If DoAttach returns \b true, then Process::DidAttach() will
+ /// be called.
///
/// @param[in] process_name
/// A process name to match against the current process list.
@@ -471,8 +462,8 @@ public:
// Status &error) = 0;
//------------------------------------------------------------------
- // The base class Platform will take care of the host platform.
- // Subclasses will need to fill in the remote case.
+ // The base class Platform will take care of the host platform. Subclasses
+ // will need to fill in the remote case.
//------------------------------------------------------------------
virtual uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
ProcessInstanceInfoList &proc_infos);
@@ -480,15 +471,15 @@ public:
virtual bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info);
//------------------------------------------------------------------
- // Set a breakpoint on all functions that can end up creating a thread
- // for this platform. This is needed when running expressions and
- // also for process control.
+ // Set a breakpoint on all functions that can end up creating a thread for
+ // this platform. This is needed when running expressions and also for
+ // process control.
//------------------------------------------------------------------
virtual lldb::BreakpointSP SetThreadCreationBreakpoint(Target &target);
//------------------------------------------------------------------
- // Given a target, find the local SDK directory if one exists on the
- // current host.
+ // Given a target, find the local SDK directory if one exists on the current
+ // host.
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetSDKDirectory(lldb_private::Target &target) {
@@ -517,9 +508,9 @@ public:
}
//---------------------------------------------------------------------------
- /// If the triple contains not specify the vendor, os, and environment parts,
- /// we "augment" these using information from the platform and return the
- /// resulting ArchSpec object.
+ /// If the triple contains not specify the vendor, os, and environment
+ /// parts, we "augment" these using information from the platform and return
+ /// the resulting ArchSpec object.
//---------------------------------------------------------------------------
ArchSpec GetAugmentedArchSpec(llvm::StringRef triple);
@@ -537,8 +528,8 @@ public:
void SetSDKBuild(const ConstString &sdk_build) { m_sdk_build = sdk_build; }
- // Override this to return true if your platform supports Clang modules.
- // You may also need to override AddClangModuleCompilationOptions to pass the
+ // Override this to return true if your platform supports Clang modules. You
+ // may also need to override AddClangModuleCompilationOptions to pass the
// right Clang flags for your platform.
virtual bool SupportsModules() { return false; }
@@ -553,9 +544,8 @@ public:
bool SetWorkingDirectory(const FileSpec &working_dir);
// There may be modules that we don't want to find by default for operations
- // like "setting breakpoint by name".
- // The platform will return "true" from this call if the passed in module
- // happens to be one of these.
+ // like "setting breakpoint by name". The platform will return "true" from
+ // this call if the passed in module happens to be one of these.
virtual bool
ModuleIsExcludedForUnconstrainedSearches(Target &target,
@@ -610,11 +600,11 @@ public:
//----------------------------------------------------------------------
/// Install a file or directory to the remote system.
///
- /// Install is similar to Platform::PutFile(), but it differs in that if
- /// an application/framework/shared library is installed on a remote
- /// platform and the remote platform requires something to be done to
- /// register the application/framework/shared library, then this extra
- /// registration can be done.
+ /// Install is similar to Platform::PutFile(), but it differs in that if an
+ /// application/framework/shared library is installed on a remote platform
+ /// and the remote platform requires something to be done to register the
+ /// application/framework/shared library, then this extra registration can
+ /// be done.
///
/// @param[in] src
/// The source file/directory to install on the remote system.
@@ -633,7 +623,7 @@ public:
//----------------------------------------------------------------------
virtual Status Install(const FileSpec &src, const FileSpec &dst);
- virtual size_t GetEnvironment(StringList &environment);
+ virtual Environment GetEnvironment();
virtual bool GetFileExists(const lldb_private::FileSpec &file_spec);
@@ -687,8 +677,7 @@ public:
// the process to exit
std::string
*command_output, // Pass nullptr if you don't want the command output
- uint32_t timeout_sec); // Timeout in seconds to wait for shell program to
- // finish
+ const Timeout<std::micro> &timeout);
virtual void SetLocalCacheDirectory(const char *local);
@@ -710,12 +699,12 @@ public:
//------------------------------------------------------------------
/// Locate a queue name given a thread's qaddr
///
- /// On a system using libdispatch ("Grand Central Dispatch") style
- /// queues, a thread may be associated with a GCD queue or not,
- /// and a queue may be associated with multiple threads.
- /// The process/thread must provide a way to find the "dispatch_qaddr"
- /// for each thread, and from that dispatch_qaddr this Platform method
- /// will locate the queue name and provide that.
+ /// On a system using libdispatch ("Grand Central Dispatch") style queues, a
+ /// thread may be associated with a GCD queue or not, and a queue may be
+ /// associated with multiple threads. The process/thread must provide a way
+ /// to find the "dispatch_qaddr" for each thread, and from that
+ /// dispatch_qaddr this Platform method will locate the queue name and
+ /// provide that.
///
/// @param[in] process
/// A process is required for reading memory.
@@ -736,12 +725,12 @@ public:
//------------------------------------------------------------------
/// Locate a queue ID given a thread's qaddr
///
- /// On a system using libdispatch ("Grand Central Dispatch") style
- /// queues, a thread may be associated with a GCD queue or not,
- /// and a queue may be associated with multiple threads.
- /// The process/thread must provide a way to find the "dispatch_qaddr"
- /// for each thread, and from that dispatch_qaddr this Platform method
- /// will locate the queue ID and provide that.
+ /// On a system using libdispatch ("Grand Central Dispatch") style queues, a
+ /// thread may be associated with a GCD queue or not, and a queue may be
+ /// associated with multiple threads. The process/thread must provide a way
+ /// to find the "dispatch_qaddr" for each thread, and from that
+ /// dispatch_qaddr this Platform method will locate the queue ID and provide
+ /// that.
///
/// @param[in] process
/// A process is required for reading memory.
@@ -761,12 +750,12 @@ public:
//------------------------------------------------------------------
/// Provide a list of trap handler function names for this platform
///
- /// The unwinder needs to treat trap handlers specially -- the stack
- /// frame may not be aligned correctly for a trap handler (the kernel
- /// often won't perturb the stack pointer, or won't re-align it properly,
- /// in the process of calling the handler) and the frame above the handler
- /// needs to be treated by the unwinder's "frame 0" rules instead of its
- /// "middle of the stack frame" rules.
+ /// The unwinder needs to treat trap handlers specially -- the stack frame
+ /// may not be aligned correctly for a trap handler (the kernel often won't
+ /// perturb the stack pointer, or won't re-align it properly, in the process
+ /// of calling the handler) and the frame above the handler needs to be
+ /// treated by the unwinder's "frame 0" rules instead of its "middle of the
+ /// stack frame" rules.
///
/// In a user process debugging scenario, the list of trap handlers is
/// typically just "_sigtramp".
@@ -782,12 +771,11 @@ public:
virtual const std::vector<ConstString> &GetTrapHandlerSymbolNames();
//------------------------------------------------------------------
- /// Find a support executable that may not live within in the
- /// standard locations related to LLDB.
+ /// Find a support executable that may not live within in the standard
+ /// locations related to LLDB.
///
- /// Executable might exist within the Platform SDK directories, or
- /// in standard tool directories within the current IDE that is
- /// running LLDB.
+ /// Executable might exist within the Platform SDK directories, or in
+ /// standard tool directories within the current IDE that is running LLDB.
///
/// @param[in] basename
/// The basename of the executable to locate in the current
@@ -801,19 +789,17 @@ public:
//------------------------------------------------------------------
/// Allow the platform to set preferred memory cache line size. If non-zero
- /// (and the user
- /// has not set cache line size explicitly), this value will be used as the
- /// cache line
- /// size for memory reads.
+ /// (and the user has not set cache line size explicitly), this value will
+ /// be used as the cache line size for memory reads.
//------------------------------------------------------------------
virtual uint32_t GetDefaultMemoryCacheLineSize() { return 0; }
//------------------------------------------------------------------
/// Load a shared library into this process.
///
- /// Try and load a shared library into the current process. This
- /// call might fail in the dynamic loader plug-in says it isn't safe
- /// to try and load shared libraries at the moment.
+ /// Try and load a shared library into the current process. This call might
+ /// fail in the dynamic loader plug-in says it isn't safe to try and load
+ /// shared libraries at the moment.
///
/// @param[in] process
/// The process to load the image.
@@ -846,9 +832,49 @@ public:
const lldb_private::FileSpec &remote_file,
lldb_private::Status &error);
+ //------------------------------------------------------------------
+ /// Load a shared library specified by base name into this process,
+ /// looking by hand along a set of paths.
+ ///
+ /// @param[in] process
+ /// The process to load the image.
+ ///
+ /// @param[in] library_name
+ /// The name of the library to look for. If library_name is an
+ /// absolute path, the basename will be extracted and searched for
+ /// along the paths. This emulates the behavior of the loader when
+ /// given an install name and a set (e.g. DYLD_LIBRARY_PATH provided) of
+ /// alternate paths.
+ ///
+ /// @param[in] path_list
+ /// The list of paths to use to search for the library. First
+ /// match wins.
+ ///
+ /// @param[out] error
+ /// An error object that gets filled in with any errors that
+ /// might occur when trying to load the shared library.
+ ///
+ /// @param[out] loaded_path
+ /// If non-null, the path to the dylib that was successfully loaded
+ /// is stored in this path.
+ ///
+ /// @return
+ /// A token that represents the shared library which can be
+ /// passed to UnloadImage. A value of
+ /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared
+ /// library can't be opened.
+ //------------------------------------------------------------------
+ uint32_t LoadImageUsingPaths(lldb_private::Process *process,
+ const lldb_private::FileSpec &library_name,
+ const std::vector<std::string> &paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_path);
+
virtual uint32_t DoLoadImage(lldb_private::Process *process,
const lldb_private::FileSpec &remote_file,
- lldb_private::Status &error);
+ const std::vector<std::string> *paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_path = nullptr);
virtual Status UnloadImage(lldb_private::Process *process,
uint32_t image_token);
@@ -856,8 +882,8 @@ public:
//------------------------------------------------------------------
/// Connect to all processes waiting for a debugger to attach
///
- /// If the platform have a list of processes waiting for a debugger
- /// to connect to them then connect to all of these pending processes.
+ /// If the platform have a list of processes waiting for a debugger to
+ /// connect to them then connect to all of these pending processes.
///
/// @param[in] debugger
/// The debugger used for the connect.
@@ -874,11 +900,11 @@ public:
protected:
bool m_is_host;
- // Set to true when we are able to actually set the OS version while
- // being connected. For remote platforms, we might set the version ahead
- // of time before we actually connect and this version might change when
- // we actually connect to a remote platform. For the host platform this
- // will be set to the once we call HostInfo::GetOSVersion().
+ // Set to true when we are able to actually set the OS version while being
+ // connected. For remote platforms, we might set the version ahead of time
+ // before we actually connect and this version might change when we actually
+ // connect to a remote platform. For the host platform this will be set to
+ // the once we call HostInfo::GetOSVersion().
bool m_os_version_set_while_connected;
bool m_system_arch_set_while_connected;
ConstString
@@ -888,9 +914,7 @@ protected:
// modules that have no install path set
std::string m_remote_url;
std::string m_name;
- uint32_t m_major_os_version;
- uint32_t m_minor_os_version;
- uint32_t m_update_os_version;
+ llvm::VersionTuple m_os_version;
ArchSpec
m_system_arch; // The architecture of the kernel or the remote platform
typedef std::map<uint32_t, ConstString> IDToNameMap;
@@ -915,23 +939,22 @@ protected:
//------------------------------------------------------------------
/// Ask the Platform subclass to fill in the list of trap handler names
///
- /// For most Unix user process environments, this will be a single
- /// function name, _sigtramp. More specialized environments may have
- /// additional handler names. The unwinder code needs to know when a
- /// trap handler is on the stack because the unwind rules for the frame
- /// that caused the trap are different.
+ /// For most Unix user process environments, this will be a single function
+ /// name, _sigtramp. More specialized environments may have additional
+ /// handler names. The unwinder code needs to know when a trap handler is
+ /// on the stack because the unwind rules for the frame that caused the trap
+ /// are different.
///
- /// The base class Platform ivar m_trap_handlers should be updated by
- /// the Platform subclass when this method is called. If there are no
+ /// The base class Platform ivar m_trap_handlers should be updated by the
+ /// Platform subclass when this method is called. If there are no
/// predefined trap handlers, this method may be a no-op.
//------------------------------------------------------------------
virtual void CalculateTrapHandlerSymbolNames() = 0;
const char *GetCachedUserName(uint32_t uid) {
std::lock_guard<std::mutex> guard(m_mutex);
- // return the empty string if our string is NULL
- // so we can tell when things were in the negative
- // cached (didn't find a valid user name, don't keep
+ // return the empty string if our string is NULL so we can tell when things
+ // were in the negative cached (didn't find a valid user name, don't keep
// trying)
const auto pos = m_uid_map.find(uid);
return ((pos != m_uid_map.end()) ? pos->second.AsCString("") : nullptr);
@@ -961,9 +984,8 @@ protected:
const char *GetCachedGroupName(uint32_t gid) {
std::lock_guard<std::mutex> guard(m_mutex);
- // return the empty string if our string is NULL
- // so we can tell when things were in the negative
- // cached (didn't find a valid group name, don't keep
+ // return the empty string if our string is NULL so we can tell when things
+ // were in the negative cached (didn't find a valid group name, don't keep
// trying)
const auto pos = m_gid_map.find(gid);
return ((pos != m_gid_map.end()) ? pos->second.AsCString("") : nullptr);
@@ -1057,11 +1079,10 @@ public:
//------------------------------------------------------------------
/// Select the active platform.
///
- /// In order to debug remotely, other platform's can be remotely
- /// connected to and set as the selected platform for any subsequent
- /// debugging. This allows connection to remote targets and allows
- /// the ability to discover process info, launch and attach to remote
- /// processes.
+ /// In order to debug remotely, other platform's can be remotely connected
+ /// to and set as the selected platform for any subsequent debugging. This
+ /// allows connection to remote targets and allows the ability to discover
+ /// process info, launch and attach to remote processes.
//------------------------------------------------------------------
lldb::PlatformSP GetSelectedPlatform() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h
index 16f37f4dd5dc..66ac5a692522 100644
--- a/include/lldb/Target/Process.h
+++ b/include/lldb/Target/Process.h
@@ -38,6 +38,7 @@
#include "lldb/Host/HostThread.h"
#include "lldb/Host/ProcessRunLock.h"
#include "lldb/Interpreter/Options.h"
+#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/InstrumentationRuntime.h"
#include "lldb/Target/Memory.h"
@@ -53,6 +54,7 @@
#include "lldb/lldb-private.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -113,8 +115,8 @@ typedef std::shared_ptr<ProcessProperties> ProcessPropertiesSP;
//----------------------------------------------------------------------
// ProcessInstanceInfo
//
-// Describes an existing process and any discoverable information that
-// pertains to that process.
+// Describes an existing process and any discoverable information that pertains
+// to that process.
//----------------------------------------------------------------------
class ProcessInstanceInfo : public ProcessInfo {
public:
@@ -278,7 +280,8 @@ protected:
class ProcessLaunchCommandOptions : public Options {
public:
ProcessLaunchCommandOptions() : Options() {
- // Keep default values of all options in one place: OptionParsingStarting ()
+ // Keep default values of all options in one place: OptionParsingStarting
+ // ()
OptionParsingStarting(nullptr);
}
@@ -316,7 +319,8 @@ public:
NameMatch process_name_match_type)
: m_match_info(), m_name_match_type(process_name_match_type),
m_match_all_users(false) {
- m_match_info.GetExecutableFile().SetFile(process_name, false);
+ m_match_info.GetExecutableFile().SetFile(process_name, false,
+ FileSpec::Style::native);
}
ProcessInstanceInfo &GetProcessInfo() { return m_match_info; }
@@ -388,10 +392,8 @@ protected:
};
// This class tracks the Modification state of the process. Things that can
-// currently modify
-// the program are running the program (which will up the StopID) and writing
-// memory (which
-// will up the MemoryID.)
+// currently modify the program are running the program (which will up the
+// StopID) and writing memory (which will up the MemoryID.)
// FIXME: Should we also include modification of register states?
class ProcessModID {
@@ -498,7 +500,7 @@ inline bool operator!=(const ProcessModID &lhs, const ProcessModID &rhs) {
//----------------------------------------------------------------------
/// @class Process Process.h "lldb/Target/Process.h"
-/// @brief A plug-in interface definition class for debugging a process.
+/// A plug-in interface definition class for debugging a process.
//----------------------------------------------------------------------
class Process : public std::enable_shared_from_this<Process>,
public ProcessProperties,
@@ -539,12 +541,11 @@ public:
enum Warnings { eWarningsOptimization = 1 };
typedef Range<lldb::addr_t, lldb::addr_t> LoadRange;
- // We use a read/write lock to allow on or more clients to
- // access the process state while the process is stopped (reader).
- // We lock the write lock to control access to the process
- // while it is running (readers, or clients that want the process
- // stopped can block waiting for the process to stop, or just
- // try to lock it to see if they can immediately access the stopped
+ // We use a read/write lock to allow on or more clients to access the process
+ // state while the process is stopped (reader). We lock the write lock to
+ // control access to the process while it is running (readers, or clients
+ // that want the process stopped can block waiting for the process to stop,
+ // or just try to lock it to see if they can immediately access the stopped
// process. If the try read lock fails, then the process is running.
typedef ProcessRunLock::ProcessRunLocker StopLocker;
@@ -560,8 +561,8 @@ public:
/// A notification structure that can be used by clients to listen
/// for changes in a process's lifetime.
///
-/// @see RegisterNotificationCallbacks (const Notifications&)
-/// @see UnregisterNotificationCallbacks (const Notifications&)
+/// @see RegisterNotificationCallbacks (const Notifications&) @see
+/// UnregisterNotificationCallbacks (const Notifications&)
//------------------------------------------------------------------
#ifndef SWIG
typedef struct {
@@ -657,8 +658,8 @@ public:
Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp);
//------------------------------------------------------------------
- /// Construct with a shared pointer to a target, the Process listener,
- /// and the appropriate UnixSignalsSP for the process.
+ /// Construct with a shared pointer to a target, the Process listener, and
+ /// the appropriate UnixSignalsSP for the process.
//------------------------------------------------------------------
Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
const lldb::UnixSignalsSP &unix_signals_sp);
@@ -666,8 +667,8 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
~Process() override;
@@ -678,12 +679,12 @@ public:
static const ProcessPropertiesSP &GetGlobalProperties();
//------------------------------------------------------------------
- /// Find a Process plug-in that can debug \a module using the
- /// currently selected architecture.
+ /// Find a Process plug-in that can debug \a module using the currently
+ /// selected architecture.
///
- /// Scans all loaded plug-in interfaces that implement versions of
- /// the Process plug-in interface and returns the first instance
- /// that can debug the file.
+ /// Scans all loaded plug-in interfaces that implement versions of the
+ /// Process plug-in interface and returns the first instance that can debug
+ /// the file.
///
/// @param[in] module_sp
/// The module shared pointer that this process will debug.
@@ -704,11 +705,10 @@ public:
/// Static function that can be used with the \b host function
/// Host::StartMonitoringChildProcess ().
///
- /// This function can be used by lldb_private::Process subclasses
- /// when they want to watch for a local process and have its exit
- /// status automatically set when the host child process exits.
- /// Subclasses should call Host::StartMonitoringChildProcess ()
- /// with:
+ /// This function can be used by lldb_private::Process subclasses when they
+ /// want to watch for a local process and have its exit status automatically
+ /// set when the host child process exits. Subclasses should call
+ /// Host::StartMonitoringChildProcess () with:
/// callback = Process::SetHostProcessExitStatus
/// pid = Process::GetID()
/// monitor_signals = false
@@ -728,9 +728,9 @@ public:
//------------------------------------------------------------------
/// Check if a plug-in instance can debug the file in \a module.
///
- /// Each plug-in is given a chance to say whether it can debug
- /// the file in \a module. If the Process plug-in instance can
- /// debug a file on the current system, it should return \b true.
+ /// Each plug-in is given a chance to say whether it can debug the file in
+ /// \a module. If the Process plug-in instance can debug a file on the
+ /// current system, it should return \b true.
///
/// @return
/// Returns \b true if this Process plug-in instance can
@@ -742,8 +742,8 @@ public:
//------------------------------------------------------------------
/// This object is about to be destroyed, do any necessary cleanup.
///
- /// Subclasses that override this method should always call this
- /// superclass method.
+ /// Subclasses that override this method should always call this superclass
+ /// method.
//------------------------------------------------------------------
virtual void Finalize();
@@ -757,13 +757,13 @@ public:
bool IsValid() const { return !m_finalize_called; }
//------------------------------------------------------------------
- /// Return a multi-word command object that can be used to expose
- /// plug-in specific commands.
+ /// Return a multi-word command object that can be used to expose plug-in
+ /// specific commands.
///
/// This object will be used to resolve plug-in commands and can be
/// triggered by a call to:
///
- /// (lldb) process commmand <args>
+ /// (lldb) process command <args>
///
/// @return
/// A CommandObject which can be one of the concrete subclasses
@@ -775,16 +775,15 @@ public:
//------------------------------------------------------------------
/// Launch a new process.
///
- /// Launch a new process by spawning a new process using the
- /// target object's executable module's file as the file to launch.
+ /// Launch a new process by spawning a new process using the target object's
+ /// executable module's file as the file to launch.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. It will first call Process::WillLaunch (Module *)
- /// and if that returns \b true, Process::DoLaunch (Module*,
- /// char const *[],char const *[],const char *,const char *,
- /// const char *) will be called to actually do the launching. If
- /// DoLaunch returns \b true, then Process::DidLaunch() will be
- /// called.
+ /// This function is not meant to be overridden by Process subclasses. It
+ /// will first call Process::WillLaunch (Module *) and if that returns \b
+ /// true, Process::DoLaunch (Module*, char const *[],char const *[],const
+ /// char *,const char *, const char *) will be called to actually do the
+ /// launching. If DoLaunch returns \b true, then Process::DidLaunch() will
+ /// be called.
///
/// @param[in] launch_info
/// Details regarding the environment, STDIN/STDOUT/STDERR
@@ -807,13 +806,48 @@ public:
}
//------------------------------------------------------------------
+ // FUTURE WORK: GetLoadImageUtilityFunction are the first use we've
+ // had of having other plugins cache data in the Process. This is handy for
+ // long-living plugins - like the Platform - which manage interactions whose
+ // lifetime is governed by the Process lifetime. If we find we need to do
+ // this more often, we should construct a general solution to the problem.
+ // The consensus suggestion was that we have a token based registry in the
+ // Process. Some undecided questions are (1) who manages the tokens. It's
+ // probably best that you add the element and get back a token that
+ // represents it. That will avoid collisions. But there may be some utility
+ // in the registerer controlling the token? (2) whether the thing added
+ // should be simply owned by Process, and just go away when it does (3)
+ // whether the registree should be notified of the Process' demise.
+ //
+ // We are postponing designing this till we have at least a second use case.
+ //------------------------------------------------------------------
+ //------------------------------------------------------------------
+ /// Get the cached UtilityFunction that assists in loading binary images
+ /// into the process.
+ ///
+ /// @param[in] platform
+ /// The platform fetching the UtilityFunction.
+ /// @param[in] factory
+ /// A function that will be called only once per-process in a
+ /// thread-safe way to create the UtilityFunction if it has not
+ /// been initialized yet.
+ ///
+ /// @return
+ /// The cached utility function or null if the platform is not the
+ /// same as the target's platform.
+ //------------------------------------------------------------------
+ UtilityFunction *GetLoadImageUtilityFunction(
+ Platform *platform,
+ llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory);
+
+ //------------------------------------------------------------------
/// Get the dynamic loader plug-in for this process.
///
- /// The default action is to let the DynamicLoader plug-ins check
- /// the main executable and the DynamicLoader will select itself
- /// automatically. Subclasses can override this if inspecting the
- /// executable is not desired, or if Process subclasses can only
- /// use a specific DynamicLoader plug-in.
+ /// The default action is to let the DynamicLoader plug-ins check the main
+ /// executable and the DynamicLoader will select itself automatically.
+ /// Subclasses can override this if inspecting the executable is not
+ /// desired, or if Process subclasses can only use a specific DynamicLoader
+ /// plug-in.
//------------------------------------------------------------------
virtual DynamicLoader *GetDynamicLoader();
@@ -828,11 +862,11 @@ public:
virtual const lldb::DataBufferSP GetAuxvData();
//------------------------------------------------------------------
- /// Sometimes processes know how to retrieve and load shared libraries.
- /// This is normally done by DynamicLoader plug-ins, but sometimes the
- /// connection to the process allows retrieving this information. The
- /// dynamic loader plug-ins can use this function if they can't
- /// determine the current shared library load state.
+ /// Sometimes processes know how to retrieve and load shared libraries. This
+ /// is normally done by DynamicLoader plug-ins, but sometimes the connection
+ /// to the process allows retrieving this information. The dynamic loader
+ /// plug-ins can use this function if they can't determine the current
+ /// shared library load state.
///
/// @return
/// The number of shared libraries that were loaded
@@ -857,11 +891,10 @@ public:
//------------------------------------------------------------------
/// Attach to an existing process using the process attach info.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. It will first call WillAttach (lldb::pid_t)
- /// or WillAttach (const char *), and if that returns \b
- /// true, DoAttach (lldb::pid_t) or DoAttach (const char *) will
- /// be called to actually do the attach. If DoAttach returns \b
+ /// This function is not meant to be overridden by Process subclasses. It
+ /// will first call WillAttach (lldb::pid_t) or WillAttach (const char *),
+ /// and if that returns \b true, DoAttach (lldb::pid_t) or DoAttach (const
+ /// char *) will be called to actually do the attach. If DoAttach returns \b
/// true, then Process::DidAttach() will be called.
///
/// @param[in] pid
@@ -896,12 +929,11 @@ public:
//------------------------------------------------------------------
/// Get the image information address for the current process.
///
- /// Some runtimes have system functions that can help dynamic
- /// loaders locate the dynamic loader information needed to observe
- /// shared libraries being loaded or unloaded. This function is
- /// in the Process interface (as opposed to the DynamicLoader
- /// interface) to ensure that remote debugging can take advantage of
- /// this functionality.
+ /// Some runtimes have system functions that can help dynamic loaders locate
+ /// the dynamic loader information needed to observe shared libraries being
+ /// loaded or unloaded. This function is in the Process interface (as
+ /// opposed to the DynamicLoader interface) to ensure that remote debugging
+ /// can take advantage of this functionality.
///
/// @return
/// The address of the dynamic loader information, or
@@ -913,17 +945,16 @@ public:
//------------------------------------------------------------------
/// Called when the process is about to broadcast a public stop.
///
- /// There are public and private stops. Private stops are when the
- /// process is doing things like stepping and the client doesn't
- /// need to know about starts and stop that implement a thread plan.
- /// Single stepping over a source line in code might end up being
- /// implemented by one or more process starts and stops. Public stops
- /// are when clients will be notified that the process is stopped.
- /// These events typically trigger UI updates (thread stack frames to
- /// be displayed, variables to be displayed, and more). This function
- /// can be overriden and allows process subclasses to do something
- /// before the eBroadcastBitStateChanged event is sent to public
- /// clients.
+ /// There are public and private stops. Private stops are when the process
+ /// is doing things like stepping and the client doesn't need to know about
+ /// starts and stop that implement a thread plan. Single stepping over a
+ /// source line in code might end up being implemented by one or more
+ /// process starts and stops. Public stops are when clients will be notified
+ /// that the process is stopped. These events typically trigger UI updates
+ /// (thread stack frames to be displayed, variables to be displayed, and
+ /// more). This function can be overriden and allows process subclasses to
+ /// do something before the eBroadcastBitStateChanged event is sent to
+ /// public clients.
//------------------------------------------------------------------
virtual void WillPublicStop() {}
@@ -946,8 +977,8 @@ public:
//------------------------------------------------------------------
/// Unregister for process and thread notifications.
///
-/// Clients can unregister notification callbacks by passing a copy of
-/// the original baton and callbacks in \a callbacks.
+/// Clients can unregister notification callbacks by passing a copy of the
+/// original baton and callbacks in \a callbacks.
///
/// @param[in] callbacks
/// A structure that contains the notification baton and
@@ -967,25 +998,24 @@ public:
// Built in Process Control functions
//==================================================================
//------------------------------------------------------------------
- /// Resumes all of a process's threads as configured using the
- /// Thread run control functions.
+ /// Resumes all of a process's threads as configured using the Thread run
+ /// control functions.
///
- /// Threads for a process should be updated with one of the run
- /// control actions (resume, step, or suspend) that they should take
- /// when the process is resumed. If no run control action is given
- /// to a thread it will be resumed by default.
+ /// Threads for a process should be updated with one of the run control
+ /// actions (resume, step, or suspend) that they should take when the
+ /// process is resumed. If no run control action is given to a thread it
+ /// will be resumed by default.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. This function will take care of disabling any
- /// breakpoints that threads may be stopped at, single stepping, and
- /// re-enabling breakpoints, and enabling the basic flow control
- /// that the plug-in instances need not worry about.
+ /// This function is not meant to be overridden by Process subclasses. This
+ /// function will take care of disabling any breakpoints that threads may be
+ /// stopped at, single stepping, and re-enabling breakpoints, and enabling
+ /// the basic flow control that the plug-in instances need not worry about.
///
- /// N.B. This function also sets the Write side of the Run Lock,
- /// which is unset when the corresponding stop event is pulled off
- /// the Public Event Queue. If you need to resume the process without
- /// setting the Run Lock, use PrivateResume (though you should only do
- /// that from inside the Process class.
+ /// N.B. This function also sets the Write side of the Run Lock, which is
+ /// unset when the corresponding stop event is pulled off the Public Event
+ /// Queue. If you need to resume the process without setting the Run Lock,
+ /// use PrivateResume (though you should only do that from inside the
+ /// Process class.
///
/// @return
/// Returns an error object.
@@ -1001,11 +1031,10 @@ public:
//------------------------------------------------------------------
/// Halts a running process.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
- /// If the process is successfully halted, a eStateStopped
- /// process event with GetInterrupted will be broadcast. If false, we will
- /// halt the process with no events generated by the halt.
+ /// This function is not meant to be overridden by Process subclasses. If
+ /// the process is successfully halted, a eStateStopped process event with
+ /// GetInterrupted will be broadcast. If false, we will halt the process
+ /// with no events generated by the halt.
///
/// @param[in] clear_thread_plans
/// If true, when the process stops, clear all thread plans.
@@ -1023,8 +1052,7 @@ public:
//------------------------------------------------------------------
/// Detaches from a running or stopped process.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
+ /// This function is not meant to be overridden by Process subclasses.
///
/// @param[in] keep_stopped
/// If true, don't resume the process on detach.
@@ -1035,11 +1063,10 @@ public:
Status Detach(bool keep_stopped);
//------------------------------------------------------------------
- /// Kills the process and shuts down all threads that were spawned
- /// to track and monitor the process.
+ /// Kills the process and shuts down all threads that were spawned to track
+ /// and monitor the process.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
+ /// This function is not meant to be overridden by Process subclasses.
///
/// @param[in] force_kill
/// Whether lldb should force a kill (instead of a detach) from
@@ -1057,8 +1084,7 @@ public:
//------------------------------------------------------------------
/// Sends a process a UNIX signal \a signal.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
+ /// This function is not meant to be overridden by Process subclasses.
///
/// @return
/// Returns an error object.
@@ -1076,8 +1102,7 @@ public:
//------------------------------------------------------------------
/// Called before attaching to a process.
///
- /// Allow Process plug-ins to execute some code before attaching a
- /// process.
+ /// Allow Process plug-ins to execute some code before attaching a process.
///
/// @return
/// Returns an error object.
@@ -1087,8 +1112,7 @@ public:
//------------------------------------------------------------------
/// Called before attaching to a process.
///
- /// Allow Process plug-ins to execute some code before attaching a
- /// process.
+ /// Allow Process plug-ins to execute some code before attaching a process.
///
/// @return
/// Returns an error object.
@@ -1173,33 +1197,31 @@ public:
/// If you can figure out the process architecture after attach, fill it
/// in here.
///
- /// Allow Process plug-ins to execute some code after attaching to
- /// a process.
+ /// Allow Process plug-ins to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach(ArchSpec &process_arch) { process_arch.Clear(); }
//------------------------------------------------------------------
/// Called after a process re-execs itself.
///
- /// Allow Process plug-ins to execute some code after a process has
- /// exec'ed itself. Subclasses typically should override DoDidExec()
- /// as the lldb_private::Process class needs to remove its dynamic
- /// loader, runtime, ABI and other plug-ins, as well as unload all
- /// shared libraries.
+ /// Allow Process plug-ins to execute some code after a process has exec'ed
+ /// itself. Subclasses typically should override DoDidExec() as the
+ /// lldb_private::Process class needs to remove its dynamic loader, runtime,
+ /// ABI and other plug-ins, as well as unload all shared libraries.
//------------------------------------------------------------------
virtual void DidExec();
//------------------------------------------------------------------
- /// Subclasses of Process should implement this function if they
- /// need to do anything after a process exec's itself.
+ /// Subclasses of Process should implement this function if they need to do
+ /// anything after a process exec's itself.
//------------------------------------------------------------------
virtual void DoDidExec() {}
//------------------------------------------------------------------
/// Called before launching to a process.
///
- /// Allow Process plug-ins to execute some code before launching a
- /// process.
+ /// Allow Process plug-ins to execute some code before launching a process.
///
/// @return
/// Returns an error object.
@@ -1209,9 +1231,9 @@ public:
//------------------------------------------------------------------
/// Launch a new process.
///
- /// Launch a new process by spawning a new process using
- /// \a exe_module's file as the file to launch. Launch details are
- /// provided in \a launch_info.
+ /// Launch a new process by spawning a new process using \a exe_module's
+ /// file as the file to launch. Launch details are provided in \a
+ /// launch_info.
///
/// @param[in] exe_module
/// The module from which to extract the file specification and
@@ -1236,16 +1258,14 @@ public:
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow Process plug-ins to execute some code after launching
- /// a process.
+ /// Allow Process plug-ins to execute some code after launching a process.
//------------------------------------------------------------------
virtual void DidLaunch() {}
//------------------------------------------------------------------
/// Called before resuming to a process.
///
- /// Allow Process plug-ins to execute some code before resuming a
- /// process.
+ /// Allow Process plug-ins to execute some code before resuming a process.
///
/// @return
/// Returns an error object.
@@ -1253,13 +1273,13 @@ public:
virtual Status WillResume() { return Status(); }
//------------------------------------------------------------------
- /// Resumes all of a process's threads as configured using the
- /// Thread run control functions.
+ /// Resumes all of a process's threads as configured using the Thread run
+ /// control functions.
///
- /// Threads for a process should be updated with one of the run
- /// control actions (resume, step, or suspend) that they should take
- /// when the process is resumed. If no run control action is given
- /// to a thread it will be resumed by default.
+ /// Threads for a process should be updated with one of the run control
+ /// actions (resume, step, or suspend) that they should take when the
+ /// process is resumed. If no run control action is given to a thread it
+ /// will be resumed by default.
///
/// @return
/// Returns \b true if the process successfully resumes using
@@ -1280,16 +1300,14 @@ public:
//------------------------------------------------------------------
/// Called after resuming a process.
///
- /// Allow Process plug-ins to execute some code after resuming
- /// a process.
+ /// Allow Process plug-ins to execute some code after resuming a process.
//------------------------------------------------------------------
virtual void DidResume() {}
//------------------------------------------------------------------
/// Called before halting to a process.
///
- /// Allow Process plug-ins to execute some code before halting a
- /// process.
+ /// Allow Process plug-ins to execute some code before halting a process.
///
/// @return
/// Returns an error object.
@@ -1300,13 +1318,10 @@ public:
/// Halts a running process.
///
/// DoHalt must produce one and only one stop StateChanged event if it
- /// actually
- /// stops the process. If the stop happens through some natural event (for
- /// instance a SIGSTOP), then forwarding that event will do. Otherwise, you
- /// must
- /// generate the event manually. This function is called from the context of
- /// the
- /// private state thread.
+ /// actually stops the process. If the stop happens through some natural
+ /// event (for instance a SIGSTOP), then forwarding that event will do.
+ /// Otherwise, you must generate the event manually. This function is called
+ /// from the context of the private state thread.
///
/// @param[out] caused_stop
/// If true, then this Halt caused the stop, otherwise, the
@@ -1327,16 +1342,15 @@ public:
//------------------------------------------------------------------
/// Called after halting a process.
///
- /// Allow Process plug-ins to execute some code after halting
- /// a process.
+ /// Allow Process plug-ins to execute some code after halting a process.
//------------------------------------------------------------------
virtual void DidHalt() {}
//------------------------------------------------------------------
/// Called before detaching from a process.
///
- /// Allow Process plug-ins to execute some code before detaching
- /// from a process.
+ /// Allow Process plug-ins to execute some code before detaching from a
+ /// process.
///
/// @return
/// Returns an error object.
@@ -1361,8 +1375,8 @@ public:
//------------------------------------------------------------------
/// Called after detaching from a process.
///
- /// Allow Process plug-ins to execute some code after detaching
- /// from a process.
+ /// Allow Process plug-ins to execute some code after detaching from a
+ /// process.
//------------------------------------------------------------------
virtual void DidDetach() {}
@@ -1371,8 +1385,8 @@ public:
//------------------------------------------------------------------
/// Called before sending a signal to a process.
///
- /// Allow Process plug-ins to execute some code before sending a
- /// signal to a process.
+ /// Allow Process plug-ins to execute some code before sending a signal to a
+ /// process.
///
/// @return
/// Returns no error if it is safe to proceed with a call to
@@ -1406,8 +1420,8 @@ public:
//------------------------------------------------------------------
/// Called after sending a signal to a process.
///
- /// Allow Process plug-ins to execute some code after sending a
- /// signal to a process.
+ /// Allow Process plug-ins to execute some code after sending a signal to a
+ /// process.
//------------------------------------------------------------------
virtual void DidSignal() {}
@@ -1417,45 +1431,28 @@ public:
/// event is taken from the queue...
///
/// This callback is called as the event
- /// is about to be queued up to allow Process plug-ins to execute
- /// some code prior to clients being notified that a process was
- /// stopped. Common operations include updating the thread list,
- /// invalidating any thread state (registers, stack, etc) prior to
- /// letting the notification go out.
+ /// is about to be queued up to allow Process plug-ins to execute some code
+ /// prior to clients being notified that a process was stopped. Common
+ /// operations include updating the thread list, invalidating any thread
+ /// state (registers, stack, etc) prior to letting the notification go out.
///
//------------------------------------------------------------------
virtual void RefreshStateAfterStop() = 0;
//------------------------------------------------------------------
- /// Sometimes the connection to a process can detect the host OS
- /// version that the process is running on. The current platform
- /// should be checked first in case the platform is connected, but
- /// clients can fall back onto this function if the platform fails
- /// to identify the host OS version. The platform should be checked
- /// first in case you are running a simulator platform that might
- /// itself be running natively, but have different heuristics for
- /// figuring out which OS is is emulating.
- ///
- /// @param[out] major
- /// The major OS version, or UINT32_MAX if it can't be determined
- ///
- /// @param[out] minor
- /// The minor OS version, or UINT32_MAX if it can't be determined
- ///
- /// @param[out] update
- /// The update OS version, or UINT32_MAX if it can't be determined
+ /// Sometimes the connection to a process can detect the host OS version
+ /// that the process is running on. The current platform should be checked
+ /// first in case the platform is connected, but clients can fall back onto
+ /// this function if the platform fails to identify the host OS version. The
+ /// platform should be checked first in case you are running a simulator
+ /// platform that might itself be running natively, but have different
+ /// heuristics for figuring out which OS is is emulating.
///
/// @return
- /// Returns \b true if the host OS version info was filled in
- /// and \b false otherwise.
+ /// Returns the version tuple of the host OS. In case of failure an empty
+ /// VersionTuple is returner.
//------------------------------------------------------------------
- virtual bool GetHostOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
- major = UINT32_MAX;
- minor = UINT32_MAX;
- update = UINT32_MAX;
- return false;
- }
+ virtual llvm::VersionTuple GetHostOSVersion() { return llvm::VersionTuple(); }
//------------------------------------------------------------------
/// Get the target object pointer for this module.
@@ -1464,7 +1461,7 @@ public:
/// A Target object pointer to the target that owns this
/// module.
//------------------------------------------------------------------
- Target &GetTarget() { return *m_target_sp.lock(); }
+ Target &GetTarget() { return *m_target_wp.lock(); }
//------------------------------------------------------------------
/// Get the const target object pointer for this module.
@@ -1473,17 +1470,17 @@ public:
/// A const Target object pointer to the target that owns this
/// module.
//------------------------------------------------------------------
- const Target &GetTarget() const { return *m_target_sp.lock(); }
+ const Target &GetTarget() const { return *m_target_wp.lock(); }
//------------------------------------------------------------------
/// Flush all data in the process.
///
- /// Flush the memory caches, all threads, and any other cached data
- /// in the process.
+ /// Flush the memory caches, all threads, and any other cached data in the
+ /// process.
///
- /// This function can be called after a world changing event like
- /// adding a new symbol file, or after the process makes a large
- /// context switch (from boot ROM to booted into an OS).
+ /// This function can be called after a world changing event like adding a
+ /// new symbol file, or after the process makes a large context switch (from
+ /// boot ROM to booted into an OS).
//------------------------------------------------------------------
void Flush();
@@ -1516,22 +1513,23 @@ public:
//------------------------------------------------------------------
// Notify this process class that modules got loaded.
//
- // If subclasses override this method, they must call this version
- // before doing anything in the subclass version of the function.
+ // If subclasses override this method, they must call this version before
+ // doing anything in the subclass version of the function.
//------------------------------------------------------------------
virtual void ModulesDidLoad(ModuleList &module_list);
//------------------------------------------------------------------
/// Retrieve the list of shared libraries that are loaded for this process
- /// This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10,
- /// pre-watchOS 3 systems. The following two methods are for newer versions
- /// of those OSes.
+ /// This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre-
+ /// watchOS 3 systems. The following two methods are for newer versions of
+ /// those OSes.
///
/// For certain platforms, the time it takes for the DynamicLoader plugin to
/// read all of the shared libraries out of memory over a slow communication
/// channel may be too long. In that instance, the gdb-remote stub may be
- /// able to retrieve the necessary information about the solibs out of memory
- /// and return a concise summary sufficient for the DynamicLoader plugin.
+ /// able to retrieve the necessary information about the solibs out of
+ /// memory and return a concise summary sufficient for the DynamicLoader
+ /// plugin.
///
/// @param [in] image_list_address
/// The address where the table of shared libraries is stored in memory,
@@ -1555,16 +1553,14 @@ public:
}
// On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
- // return
- // the full list of loaded shared libraries without needing any input.
+ // return the full list of loaded shared libraries without needing any input.
virtual lldb_private::StructuredData::ObjectSP
GetLoadedDynamicLibrariesInfos() {
return StructuredData::ObjectSP();
}
// On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
- // return
- // information about binaries given their load addresses.
+ // return information about binaries given their load addresses.
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(
const std::vector<lldb::addr_t> &load_addresses) {
return StructuredData::ObjectSP();
@@ -1574,21 +1570,20 @@ public:
// Get information about the library shared cache, if that exists
//
// On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
- // return
- // information about the library shared cache (a set of standard libraries
- // that are
- // loaded at the same location for all processes on a system) in use.
+ // return information about the library shared cache (a set of standard
+ // libraries that are loaded at the same location for all processes on a
+ // system) in use.
//------------------------------------------------------------------
virtual lldb_private::StructuredData::ObjectSP GetSharedCacheInfo() {
return StructuredData::ObjectSP();
}
//------------------------------------------------------------------
- /// Print a user-visible warning about a module being built with optimization
+ /// Print a user-visible warning about a module being built with
+ /// optimization
///
- /// Prints a async warning message to the user one time per Module
- /// where a function is found that was compiled with optimization, per
- /// Process.
+ /// Prints a async warning message to the user one time per Module where a
+ /// function is found that was compiled with optimization, per Process.
///
/// @param [in] sc
/// A SymbolContext with eSymbolContextFunction and eSymbolContextModule
@@ -1648,13 +1643,12 @@ public:
//------------------------------------------------------------------
/// Set accessor for the process exit status (return code).
///
- /// Sometimes a child exits and the exit can be detected by global
- /// functions (signal handler for SIGCHLD for example). This
- /// accessor allows the exit status to be set from an external
- /// source.
+ /// Sometimes a child exits and the exit can be detected by global functions
+ /// (signal handler for SIGCHLD for example). This accessor allows the exit
+ /// status to be set from an external source.
///
- /// Setting this will cause a eStateExited event to be posted to
- /// the process event queue.
+ /// Setting this will cause a eStateExited event to be posted to the process
+ /// event queue.
///
/// @param[in] exit_status
/// The value for the process's return code.
@@ -1673,11 +1667,10 @@ public:
virtual bool IsAlive();
//------------------------------------------------------------------
- /// Before lldb detaches from a process, it warns the user that they are about
- /// to lose their debug session.
- /// In some cases, this warning doesn't need to be emitted -- for instance,
- /// with core file debugging where
- /// the user can reconstruct the "state" by simply re-running the debugger on
+ /// Before lldb detaches from a process, it warns the user that they are
+ /// about to lose their debug session. In some cases, this warning doesn't
+ /// need to be emitted -- for instance, with core file debugging where the
+ /// user can reconstruct the "state" by simply re-running the debugger on
/// the core file.
///
/// @return
@@ -1688,10 +1681,9 @@ public:
//------------------------------------------------------------------
/// Actually do the reading of memory from a process.
///
- /// Subclasses must override this function and can return fewer
- /// bytes than requested when memory requests are too large. This
- /// class will break up the memory requests and keep advancing the
- /// arguments along as needed.
+ /// Subclasses must override this function and can return fewer bytes than
+ /// requested when memory requests are too large. This class will break up
+ /// the memory requests and keep advancing the arguments along as needed.
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start reading
@@ -1704,8 +1696,15 @@ public:
/// A byte buffer that is at least \a size bytes long that
/// will receive the memory bytes.
///
+ /// @param[out] error
+ /// An error that indicates the success or failure of this
+ /// operation. If error indicates success (error.Success()),
+ /// then the value returned can be trusted, otherwise zero
+ /// will be returned.
+ ///
/// @return
/// The number of bytes that were actually read into \a buf.
+ /// Zero is returned in the case of an error.
//------------------------------------------------------------------
virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
Status &error) = 0;
@@ -1713,13 +1712,12 @@ public:
//------------------------------------------------------------------
/// Read of memory from a process.
///
- /// This function will read memory from the current process's
- /// address space and remove any traps that may have been inserted
- /// into the memory.
+ /// This function will read memory from the current process's address space
+ /// and remove any traps that may have been inserted into the memory.
///
- /// This function is not meant to be overridden by Process
- /// subclasses, the subclasses should implement
- /// Process::DoReadMemory (lldb::addr_t, size_t, void *).
+ /// This function is not meant to be overridden by Process subclasses, the
+ /// subclasses should implement Process::DoReadMemory (lldb::addr_t, size_t,
+ /// void *).
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start reading
@@ -1732,12 +1730,18 @@ public:
/// @param[in] size
/// The number of bytes to read.
///
+ /// @param[out] error
+ /// An error that indicates the success or failure of this
+ /// operation. If error indicates success (error.Success()),
+ /// then the value returned can be trusted, otherwise zero
+ /// will be returned.
+ ///
/// @return
/// The number of bytes that were actually read into \a buf. If
/// the returned number is greater than zero, yet less than \a
/// size, then this function will get called again with \a
/// vm_addr, \a buf, and \a size updated appropriately. Zero is
- /// returned to indicate an error.
+ /// returned in the case of an error.
//------------------------------------------------------------------
virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
Status &error);
@@ -1745,12 +1749,12 @@ public:
//------------------------------------------------------------------
/// Read a NULL terminated string from memory
///
- /// This function will read a cache page at a time until a NULL
- /// string terminator is found. It will stop reading if an aligned
- /// sequence of NULL termination \a type_width bytes is not found
- /// before reading \a cstr_max_len bytes. The results are always
- /// guaranteed to be NULL terminated, and that no more than
- /// (max_bytes - type_width) bytes will be read.
+ /// This function will read a cache page at a time until a NULL string
+ /// terminator is found. It will stop reading if an aligned sequence of NULL
+ /// termination \a type_width bytes is not found before reading \a
+ /// cstr_max_len bytes. The results are always guaranteed to be NULL
+ /// terminated, and that no more than (max_bytes - type_width) bytes will be
+ /// read.
///
/// @param[in] vm_addr
/// The virtual load address to start the memory read.
@@ -1779,9 +1783,9 @@ public:
///
/// This function will read a cache page at a time until the NULL
/// C string terminator is found. It will stop reading if the NULL
- /// termination byte isn't found before reading \a cstr_max_len
- /// bytes, and the results are always guaranteed to be NULL
- /// terminated (at most cstr_max_len - 1 bytes will be read).
+ /// termination byte isn't found before reading \a cstr_max_len bytes, and
+ /// the results are always guaranteed to be NULL terminated (at most
+ /// cstr_max_len - 1 bytes will be read).
//------------------------------------------------------------------
size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr,
size_t cstr_max_len, Status &error);
@@ -1793,8 +1797,8 @@ public:
Status &error);
//------------------------------------------------------------------
- /// Reads an unsigned integer of the specified byte size from
- /// process memory.
+ /// Reads an unsigned integer of the specified byte size from process
+ /// memory.
///
/// @param[in] load_addr
/// A load address of the integer to read.
@@ -1862,13 +1866,12 @@ public:
//------------------------------------------------------------------
/// Write all or part of a scalar value to memory.
///
- /// The value contained in \a scalar will be swapped to match the
- /// byte order of the process that is being debugged. If \a size is
- /// less than the size of scalar, the least significant \a size bytes
- /// from scalar will be written. If \a size is larger than the byte
- /// size of scalar, then the extra space will be padded with zeros
- /// and the scalar value will be placed in the least significant
- /// bytes in memory.
+ /// The value contained in \a scalar will be swapped to match the byte order
+ /// of the process that is being debugged. If \a size is less than the size
+ /// of scalar, the least significant \a size bytes from scalar will be
+ /// written. If \a size is larger than the byte size of scalar, then the
+ /// extra space will be padded with zeros and the scalar value will be
+ /// placed in the least significant bytes in memory.
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start writing
@@ -1901,13 +1904,13 @@ public:
//------------------------------------------------------------------
/// Write memory to a process.
///
- /// This function will write memory to the current process's
- /// address space and maintain any traps that might be present due
- /// to software breakpoints.
+ /// This function will write memory to the current process's address space
+ /// and maintain any traps that might be present due to software
+ /// breakpoints.
///
- /// This function is not meant to be overridden by Process
- /// subclasses, the subclasses should implement
- /// Process::DoWriteMemory (lldb::addr_t, size_t, void *).
+ /// This function is not meant to be overridden by Process subclasses, the
+ /// subclasses should implement Process::DoWriteMemory (lldb::addr_t,
+ /// size_t, void *).
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start writing
@@ -1930,9 +1933,9 @@ public:
//------------------------------------------------------------------
/// Actually allocate memory in the process.
///
- /// This function will allocate memory in the process's address
- /// space. This can't rely on the generic function calling mechanism,
- /// since that requires this function.
+ /// This function will allocate memory in the process's address space. This
+ /// can't rely on the generic function calling mechanism, since that
+ /// requires this function.
///
/// @param[in] size
/// The size of the allocation requested.
@@ -1950,12 +1953,14 @@ public:
return LLDB_INVALID_ADDRESS;
}
+ virtual Status WriteObjectFile(std::vector<ObjectFile::LoadableData> entries);
+
//------------------------------------------------------------------
/// The public interface to allocating memory in the process.
///
- /// This function will allocate memory in the process's address
- /// space. This can't rely on the generic function calling mechanism,
- /// since that requires this function.
+ /// This function will allocate memory in the process's address space. This
+ /// can't rely on the generic function calling mechanism, since that
+ /// requires this function.
///
/// @param[in] size
/// The size of the allocation requested.
@@ -1979,9 +1984,9 @@ public:
/// The public interface to allocating memory in the process, this also
/// clears the allocated memory.
///
- /// This function will allocate memory in the process's address
- /// space. This can't rely on the generic function calling mechanism,
- /// since that requires this function.
+ /// This function will allocate memory in the process's address space. This
+ /// can't rely on the generic function calling mechanism, since that
+ /// requires this function.
///
/// @param[in] size
/// The size of the allocation requested.
@@ -2023,18 +2028,18 @@ public:
/// Locate the memory region that contains load_addr.
///
/// If load_addr is within the address space the process has mapped
- /// range_info will be filled in with the start and end of that range
- /// as well as the permissions for that range and range_info.GetMapped
- /// will return true.
+ /// range_info will be filled in with the start and end of that range as
+ /// well as the permissions for that range and range_info.GetMapped will
+ /// return true.
///
- /// If load_addr is outside any mapped region then range_info will
- /// have its start address set to load_addr and the end of the
- /// range will indicate the start of the next mapped range or be
- /// set to LLDB_INVALID_ADDRESS if there are no valid mapped ranges
- /// between load_addr and the end of the process address space.
+ /// If load_addr is outside any mapped region then range_info will have its
+ /// start address set to load_addr and the end of the range will indicate
+ /// the start of the next mapped range or be set to LLDB_INVALID_ADDRESS if
+ /// there are no valid mapped ranges between load_addr and the end of the
+ /// process address space.
///
- /// GetMemoryRegionInfo will only return an error if it is
- /// unimplemented for the current process.
+ /// GetMemoryRegionInfo will only return an error if it is unimplemented for
+ /// the current process.
///
/// @param[in] load_addr
/// The load address to query the range_info for.
@@ -2087,9 +2092,9 @@ public:
//------------------------------------------------------------------
/// Attempt to get the attributes for a region of memory in the process.
///
- /// It may be possible for the remote debug server to inspect attributes
- /// for a region of memory in the process, such as whether there is a
- /// valid page of memory at a given address or whether that page is
+ /// It may be possible for the remote debug server to inspect attributes for
+ /// a region of memory in the process, such as whether there is a valid page
+ /// of memory at a given address or whether that page is
/// readable/writable/executable by the process.
///
/// @param[in] load_addr
@@ -2109,8 +2114,8 @@ public:
uint32_t &permissions);
//------------------------------------------------------------------
- /// Determines whether executing JIT-compiled code in this process
- /// is possible.
+ /// Determines whether executing JIT-compiled code in this process is
+ /// possible.
///
/// @return
/// True if execution of JIT code is possible; false otherwise.
@@ -2118,8 +2123,7 @@ public:
bool CanJIT();
//------------------------------------------------------------------
- /// Sets whether executing JIT-compiled code in this process
- /// is possible.
+ /// Sets whether executing JIT-compiled code in this process is possible.
///
/// @param[in] can_jit
/// True if execution of JIT code is possible; false otherwise.
@@ -2127,8 +2131,8 @@ public:
void SetCanJIT(bool can_jit);
//------------------------------------------------------------------
- /// Determines whether executing function calls using the interpreter
- /// is possible for this process.
+ /// Determines whether executing function calls using the interpreter is
+ /// possible for this process.
///
/// @return
/// True if possible; false otherwise.
@@ -2136,8 +2140,8 @@ public:
bool CanInterpretFunctionCalls() { return m_can_interpret_function_calls; }
//------------------------------------------------------------------
- /// Sets whether executing function calls using the interpreter
- /// is possible for this process.
+ /// Sets whether executing function calls using the interpreter is possible
+ /// for this process.
///
/// @param[in] can_interpret_function_calls
/// True if possible; false otherwise.
@@ -2147,8 +2151,8 @@ public:
}
//------------------------------------------------------------------
- /// Sets whether executing code in this process is possible.
- /// This could be either through JIT or interpreting.
+ /// Sets whether executing code in this process is possible. This could be
+ /// either through JIT or interpreting.
///
/// @param[in] can_run_code
/// True if execution of code is possible; false otherwise.
@@ -2158,8 +2162,8 @@ public:
//------------------------------------------------------------------
/// Actually deallocate memory in the process.
///
- /// This function will deallocate memory in the process's address
- /// space that was allocated with AllocateMemory.
+ /// This function will deallocate memory in the process's address space that
+ /// was allocated with AllocateMemory.
///
/// @param[in] ptr
/// A return value from AllocateMemory, pointing to the memory you
@@ -2179,8 +2183,8 @@ public:
//------------------------------------------------------------------
/// The public interface to deallocating memory in the process.
///
- /// This function will deallocate memory in the process's address
- /// space that was allocated with AllocateMemory.
+ /// This function will deallocate memory in the process's address space that
+ /// was allocated with AllocateMemory.
///
/// @param[in] ptr
/// A return value from AllocateMemory, pointing to the memory you
@@ -2194,20 +2198,19 @@ public:
//------------------------------------------------------------------
/// Get any available STDOUT.
///
- /// Calling this method is a valid operation only if all of the
- /// following conditions are true:
- /// 1) The process was launched, and not attached to.
- /// 2) The process was not launched with eLaunchFlagDisableSTDIO.
- /// 3) The process was launched without supplying a valid file path
+ /// Calling this method is a valid operation only if all of the following
+ /// conditions are true: 1) The process was launched, and not attached to.
+ /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
+ /// process was launched without supplying a valid file path
/// for STDOUT.
///
- /// Note that the implementation will probably need to start a read
- /// thread in the background to make sure that the pipe is drained
- /// and the STDOUT buffered appropriately, to prevent the process
- /// from deadlocking trying to write to a full buffer.
+ /// Note that the implementation will probably need to start a read thread
+ /// in the background to make sure that the pipe is drained and the STDOUT
+ /// buffered appropriately, to prevent the process from deadlocking trying
+ /// to write to a full buffer.
///
- /// Events will be queued indicating that there is STDOUT available
- /// that can be retrieved using this function.
+ /// Events will be queued indicating that there is STDOUT available that can
+ /// be retrieved using this function.
///
/// @param[out] buf
/// A buffer that will receive any STDOUT bytes that are
@@ -2226,20 +2229,19 @@ public:
//------------------------------------------------------------------
/// Get any available STDERR.
///
- /// Calling this method is a valid operation only if all of the
- /// following conditions are true:
- /// 1) The process was launched, and not attached to.
- /// 2) The process was not launched with eLaunchFlagDisableSTDIO.
- /// 3) The process was launched without supplying a valid file path
+ /// Calling this method is a valid operation only if all of the following
+ /// conditions are true: 1) The process was launched, and not attached to.
+ /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
+ /// process was launched without supplying a valid file path
/// for STDERR.
///
- /// Note that the implementation will probably need to start a read
- /// thread in the background to make sure that the pipe is drained
- /// and the STDERR buffered appropriately, to prevent the process
- /// from deadlocking trying to write to a full buffer.
+ /// Note that the implementation will probably need to start a read thread
+ /// in the background to make sure that the pipe is drained and the STDERR
+ /// buffered appropriately, to prevent the process from deadlocking trying
+ /// to write to a full buffer.
///
- /// Events will be queued indicating that there is STDERR available
- /// that can be retrieved using this function.
+ /// Events will be queued indicating that there is STDERR available that can
+ /// be retrieved using this function.
///
/// @param[in] buf
/// A buffer that will receive any STDERR bytes that are
@@ -2258,11 +2260,10 @@ public:
//------------------------------------------------------------------
/// Puts data into this process's STDIN.
///
- /// Calling this method is a valid operation only if all of the
- /// following conditions are true:
- /// 1) The process was launched, and not attached to.
- /// 2) The process was not launched with eLaunchFlagDisableSTDIO.
- /// 3) The process was launched without supplying a valid file path
+ /// Calling this method is a valid operation only if all of the following
+ /// conditions are true: 1) The process was launched, and not attached to.
+ /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
+ /// process was launched without supplying a valid file path
/// for STDIN.
///
/// @param[in] buf
@@ -2320,9 +2321,9 @@ public:
}
// This is implemented completely using the lldb::Process API. Subclasses
- // don't need to implement this function unless the standard flow of
- // read existing opcode, write breakpoint opcode, verify breakpoint opcode
- // doesn't work for a specific process plug-in.
+ // don't need to implement this function unless the standard flow of read
+ // existing opcode, write breakpoint opcode, verify breakpoint opcode doesn't
+ // work for a specific process plug-in.
virtual Status EnableSoftwareBreakpoint(BreakpointSite *bp_site);
// This is implemented completely using the lldb::Process API. Subclasses
@@ -2346,8 +2347,8 @@ public:
Status EnableBreakpointSiteByID(lldb::user_id_t break_id);
- // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove
- // themselves from the owner's list of this breakpoint sites.
+ // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove themselves
+ // from the owner's list of this breakpoint sites.
void RemoveOwnerFromBreakpointSite(lldb::user_id_t owner_id,
lldb::user_id_t owner_loc_id,
lldb::BreakpointSiteSP &bp_site_sp);
@@ -2369,11 +2370,10 @@ public:
ThreadList &GetThreadList() { return m_thread_list; }
- // When ExtendedBacktraces are requested, the HistoryThreads that are
- // created need an owner -- they're saved here in the Process. The
- // threads in this list are not iterated over - driver programs need to
- // request the extended backtrace calls starting from a root concrete
- // thread one by one.
+ // When ExtendedBacktraces are requested, the HistoryThreads that are created
+ // need an owner -- they're saved here in the Process. The threads in this
+ // list are not iterated over - driver programs need to request the extended
+ // backtrace calls starting from a root concrete thread one by one.
ThreadList &GetExtendedThreadList() { return m_extended_thread_list; }
ThreadList::ThreadIterable Threads() { return m_thread_list.Threads(); }
@@ -2385,10 +2385,9 @@ public:
// Returns true if an index id has been assigned to a thread.
bool HasAssignedIndexIDToThread(uint64_t sb_thread_id);
- // Given a thread_id, it will assign a more reasonable index id for display to
- // the user.
- // If the thread_id has previously been assigned, the same index id will be
- // used.
+ // Given a thread_id, it will assign a more reasonable index id for display
+ // to the user. If the thread_id has previously been assigned, the same index
+ // id will be used.
uint32_t AssignIndexIDToThread(uint64_t thread_id);
//------------------------------------------------------------------
@@ -2413,13 +2412,11 @@ public:
lldb::StateType GetNextEvent(lldb::EventSP &event_sp);
// Returns the process state when it is stopped. If specified, event_sp_ptr
- // is set to the event which triggered the stop. If wait_always = false,
- // and the process is already stopped, this function returns immediately.
- // If the process is hijacked and use_run_lock is true (the default), then
- // this
+ // is set to the event which triggered the stop. If wait_always = false, and
+ // the process is already stopped, this function returns immediately. If the
+ // process is hijacked and use_run_lock is true (the default), then this
// function releases the run lock after the stop. Setting use_run_lock to
- // false
- // will avoid this behavior.
+ // false will avoid this behavior.
lldb::StateType
WaitForProcessToStop(const Timeout<std::micro> &timeout,
lldb::EventSP *event_sp_ptr = nullptr,
@@ -2433,14 +2430,13 @@ public:
/// Waits for the process state to be running within a given msec timeout.
///
/// The main purpose of this is to implement an interlock waiting for
- /// HandlePrivateEvent
- /// to push an IOHandler.
+ /// HandlePrivateEvent to push an IOHandler.
///
- /// @param[in] timeout_msec
+ /// @param[in] timeout
/// The maximum time length to wait for the process to transition to the
- /// eStateRunning state, specified in milliseconds.
+ /// eStateRunning state.
//--------------------------------------------------------------------------------------
- void SyncIOHandler(uint32_t iohandler_id, uint64_t timeout_msec);
+ void SyncIOHandler(uint32_t iohandler_id, const Timeout<std::micro> &timeout);
lldb::StateType GetStateChangedEvents(
lldb::EventSP &event_sp, const Timeout<std::micro> &timeout,
@@ -2448,8 +2444,8 @@ public:
hijack_listener); // Pass an empty ListenerSP to use builtin listener
//--------------------------------------------------------------------------------------
- /// Centralize the code that handles and prints descriptions for process state
- /// changes.
+ /// Centralize the code that handles and prints descriptions for process
+ /// state changes.
///
/// @param[in] event_sp
/// The process state changed event
@@ -2494,8 +2490,8 @@ public:
/// event, then make a new listener, set to listen to process events, and
/// then call this with that listener. Then you will have to wait on that
/// listener explicitly for events (rather than using the GetNextEvent &
- /// WaitFor*
- /// calls above. Be sure to call RestoreProcessEvents when you are done.
+ /// WaitFor* calls above. Be sure to call RestoreProcessEvents when you are
+ /// done.
///
/// @param[in] listener
/// This is the new listener to whom all process events will be delivered.
@@ -2577,27 +2573,26 @@ public:
void SetSTDIOFileDescriptor(int file_descriptor);
//------------------------------------------------------------------
- // Add a permanent region of memory that should never be read or
- // written to. This can be used to ensure that memory reads or writes
- // to certain areas of memory never end up being sent to the
- // DoReadMemory or DoWriteMemory functions which can improve
- // performance.
+ // Add a permanent region of memory that should never be read or written to.
+ // This can be used to ensure that memory reads or writes to certain areas of
+ // memory never end up being sent to the DoReadMemory or DoWriteMemory
+ // functions which can improve performance.
//------------------------------------------------------------------
void AddInvalidMemoryRegion(const LoadRange &region);
//------------------------------------------------------------------
- // Remove a permanent region of memory that should never be read or
- // written to that was previously added with AddInvalidMemoryRegion.
+ // Remove a permanent region of memory that should never be read or written
+ // to that was previously added with AddInvalidMemoryRegion.
//------------------------------------------------------------------
bool RemoveInvalidMemoryRange(const LoadRange &region);
//------------------------------------------------------------------
// If the setup code of a thread plan needs to do work that might involve
- // calling a function in the target, it should not do that work directly
- // in one of the thread plan functions (DidPush/WillResume) because
- // such work needs to be handled carefully. Instead, put that work in
- // a PreResumeAction callback, and register it with the process. It will
- // get done before the actual "DoResume" gets called.
+ // calling a function in the target, it should not do that work directly in
+ // one of the thread plan functions (DidPush/WillResume) because such work
+ // needs to be handled carefully. Instead, put that work in a
+ // PreResumeAction callback, and register it with the process. It will get
+ // done before the actual "DoResume" gets called.
//------------------------------------------------------------------
typedef bool(PreResumeActionCallback)(void *);
@@ -2623,10 +2618,10 @@ public:
GetInstrumentationRuntime(lldb::InstrumentationRuntimeType type);
//------------------------------------------------------------------
- /// Try to fetch the module specification for a module with the
- /// given file name and architecture. Process sub-classes have to
- /// override this method if they support platforms where the
- /// Platform object can't get the module spec for all module.
+ /// Try to fetch the module specification for a module with the given file
+ /// name and architecture. Process sub-classes have to override this method
+ /// if they support platforms where the Platform object can't get the module
+ /// spec for all module.
///
/// @param[in] module_file_spec
/// The file name of the module to get specification for.
@@ -2650,8 +2645,8 @@ public:
//------------------------------------------------------------------
/// Try to find the load address of a file.
- /// The load address is defined as the address of the first memory
- /// region what contains data mapped from the specified file.
+ /// The load address is defined as the address of the first memory region
+ /// what contains data mapped from the specified file.
///
/// @param[in] file
/// The name of the file whose load address we are looking for
@@ -2678,12 +2673,11 @@ public:
//------------------------------------------------------------------
/// Find the next branch instruction to set a breakpoint on
///
- /// When instruction stepping through a source line, instead of
- /// stepping through each instruction, we can put a breakpoint on
- /// the next branch instruction (within the range of instructions
- /// we are stepping through) and continue the process to there,
- /// yielding significant performance benefits over instruction
- /// stepping.
+ /// When instruction stepping through a source line, instead of stepping
+ /// through each instruction, we can put a breakpoint on the next branch
+ /// instruction (within the range of instructions we are stepping through)
+ /// and continue the process to there, yielding significant performance
+ /// benefits over instruction stepping.
///
/// @param[in] default_stop_addr
/// The address of the instruction where lldb would put a
@@ -2710,8 +2704,8 @@ public:
/// The default implementation here will always return an error indiciating
/// the feature is unsupported.
///
- /// StructuredDataPlugin implementations will call this to configure
- /// a feature that has been reported as being supported.
+ /// StructuredDataPlugin implementations will call this to configure a
+ /// feature that has been reported as being supported.
///
/// @param[in] type_name
/// The StructuredData type name as previously discovered by
@@ -2733,13 +2727,12 @@ public:
const StructuredData::ObjectSP &config_sp);
//------------------------------------------------------------------
- /// Broadcasts the given structured data object from the given
- /// plugin.
+ /// Broadcasts the given structured data object from the given plugin.
///
- /// StructuredDataPlugin instances can use this to optionally
- /// broadcast any of their data if they want to make it available
- /// for clients. The data will come in on the structured data
- /// event bit (eBroadcastBitStructuredData).
+ /// StructuredDataPlugin instances can use this to optionally broadcast any
+ /// of their data if they want to make it available for clients. The data
+ /// will come in on the structured data event bit
+ /// (eBroadcastBitStructuredData).
///
/// @param[in] object_sp
/// The structured data object to broadcast.
@@ -2752,12 +2745,12 @@ public:
const lldb::StructuredDataPluginSP &plugin_sp);
//------------------------------------------------------------------
- /// Returns the StructuredDataPlugin associated with a given type
- /// name, if there is one.
+ /// Returns the StructuredDataPlugin associated with a given type name, if
+ /// there is one.
///
/// There will only be a plugin for a given StructuredDataType if the
- /// debugged process monitor claims that the feature is supported.
- /// This is one way to tell whether a feature is available.
+ /// debugged process monitor claims that the feature is supported. This is
+ /// one way to tell whether a feature is available.
///
/// @return
/// The plugin if one is available for the specified feature;
@@ -2767,17 +2760,14 @@ public:
GetStructuredDataPlugin(const ConstString &type_name) const;
//------------------------------------------------------------------
- /// Starts tracing with the configuration provided in options. To
- /// enable tracing on the complete process the thread_id in the
- /// options should be set to LLDB_INVALID_THREAD_ID. The API returns
- /// a user_id which is needed by other API's that manipulate the
- /// trace instance.
- /// The handling of erroneous or unsupported configuration is left
- /// to the trace technology implementations in the server, as they
- /// could be returned as an error, or rounded to a valid
- /// configuration to start tracing. In the later case the
- /// GetTraceConfig should supply the actual used trace
- /// configuration.
+ /// Starts tracing with the configuration provided in options. To enable
+ /// tracing on the complete process the thread_id in the options should be
+ /// set to LLDB_INVALID_THREAD_ID. The API returns a user_id which is needed
+ /// by other API's that manipulate the trace instance. The handling of
+ /// erroneous or unsupported configuration is left to the trace technology
+ /// implementations in the server, as they could be returned as an error, or
+ /// rounded to a valid configuration to start tracing. In the later case the
+ /// GetTraceConfig should supply the actual used trace configuration.
//------------------------------------------------------------------
virtual lldb::user_id_t StartTrace(const TraceOptions &options,
Status &error) {
@@ -2786,25 +2776,23 @@ public:
}
//------------------------------------------------------------------
- /// Stops the tracing instance leading to deletion of the trace
- /// data. The tracing instance is identified by the user_id which
- /// is obtained when tracing was started from the StartTrace.
- /// In case tracing of the complete process needs to be stopped
- /// the thread_id should be set to LLDB_INVALID_THREAD_ID.
- /// In the other case that tracing on an individual thread needs
- /// to be stopped a thread_id can be supplied.
+ /// Stops the tracing instance leading to deletion of the trace data. The
+ /// tracing instance is identified by the user_id which is obtained when
+ /// tracing was started from the StartTrace. In case tracing of the complete
+ /// process needs to be stopped the thread_id should be set to
+ /// LLDB_INVALID_THREAD_ID. In the other case that tracing on an individual
+ /// thread needs to be stopped a thread_id can be supplied.
//------------------------------------------------------------------
virtual Status StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id) {
return Status("Not implemented");
}
//------------------------------------------------------------------
- /// Provides the trace data as raw bytes. A buffer needs to be
- /// supplied to copy the trace data. The exact behavior of this API
- /// may vary across trace technology, as some may support partial
- /// reading of the trace data from a specified offset while some
- /// may not. The thread_id should be used to select a particular
- /// thread for trace extraction.
+ /// Provides the trace data as raw bytes. A buffer needs to be supplied to
+ /// copy the trace data. The exact behavior of this API may vary across
+ /// trace technology, as some may support partial reading of the trace data
+ /// from a specified offset while some may not. The thread_id should be used
+ /// to select a particular thread for trace extraction.
//------------------------------------------------------------------
virtual Status GetData(lldb::user_id_t uid, lldb::tid_t thread_id,
llvm::MutableArrayRef<uint8_t> &buffer,
@@ -2823,12 +2811,12 @@ public:
//------------------------------------------------------------------
/// API to obtain the trace configuration used by a trace instance.
- /// Configurations that may be specific to some trace technology
- /// should be stored in the custom parameters. The options are
- /// transported to the server, which shall interpret accordingly.
- /// The thread_id can be specified in the options to obtain the
- /// configuration used by a specific thread. The thread_id specified
- /// should also match the uid otherwise an error will be returned.
+ /// Configurations that may be specific to some trace technology should be
+ /// stored in the custom parameters. The options are transported to the
+ /// server, which shall interpret accordingly. The thread_id can be
+ /// specified in the options to obtain the configuration used by a specific
+ /// thread. The thread_id specified should also match the uid otherwise an
+ /// error will be returned.
//------------------------------------------------------------------
virtual Status GetTraceConfig(lldb::user_id_t uid, TraceOptions &options) {
return Status("Not implemented");
@@ -2840,8 +2828,8 @@ protected:
lldb::StateType GetPrivateState();
//------------------------------------------------------------------
- /// The "private" side of resuming a process. This doesn't alter the
- /// state of m_run_lock, but just causes the process to resume.
+ /// The "private" side of resuming a process. This doesn't alter the state
+ /// of m_run_lock, but just causes the process to resume.
///
/// @return
/// An Status object describing the success or failure of the resume.
@@ -2858,16 +2846,16 @@ protected:
///
/// A facility for printing a warning to the user once per repeat_key.
///
- /// warning_type is from the Process::Warnings enums.
- /// repeat_key is a pointer value that will be used to ensure that the
- /// warning message is not printed multiple times. For instance, with a
- /// warning about a function being optimized, you can pass the CompileUnit
- /// pointer to have the warning issued for only the first function in a
- /// CU, or the Function pointer to have it issued once for every function,
- /// or a Module pointer to have it issued once per Module.
+ /// warning_type is from the Process::Warnings enums. repeat_key is a
+ /// pointer value that will be used to ensure that the warning message is
+ /// not printed multiple times. For instance, with a warning about a
+ /// function being optimized, you can pass the CompileUnit pointer to have
+ /// the warning issued for only the first function in a CU, or the Function
+ /// pointer to have it issued once for every function, or a Module pointer
+ /// to have it issued once per Module.
///
- /// Classes outside Process should call a specific PrintWarning method
- /// so that the warning strings are all centralized in Process, instead of
+ /// Classes outside Process should call a specific PrintWarning method so
+ /// that the warning strings are all centralized in Process, instead of
/// calling PrintWarning() directly.
///
/// @param [in] warning_type
@@ -2885,15 +2873,14 @@ protected:
const char *fmt, ...) __attribute__((format(printf, 4, 5)));
//------------------------------------------------------------------
- // NextEventAction provides a way to register an action on the next
- // event that is delivered to this process. There is currently only
- // one next event action allowed in the process at one time. If a
- // new "NextEventAction" is added while one is already present, the
- // old action will be discarded (with HandleBeingUnshipped called
- // after it is discarded.)
+ // NextEventAction provides a way to register an action on the next event
+ // that is delivered to this process. There is currently only one next event
+ // action allowed in the process at one time. If a new "NextEventAction" is
+ // added while one is already present, the old action will be discarded (with
+ // HandleBeingUnshipped called after it is discarded.)
//
- // If you want to resume the process as a result of a resume action,
- // call RequestResume, don't call Resume directly.
+ // If you want to resume the process as a result of a resume action, call
+ // RequestResume, don't call Resume directly.
//------------------------------------------------------------------
class NextEventAction {
public:
@@ -2949,18 +2936,17 @@ protected:
void ForceNextEventDelivery() { m_force_next_event_delivery = true; }
//------------------------------------------------------------------
- /// Loads any plugins associated with asynchronous structured data
- /// and maps the relevant supported type name to the plugin.
+ /// Loads any plugins associated with asynchronous structured data and maps
+ /// the relevant supported type name to the plugin.
///
- /// Processes can receive asynchronous structured data from the
- /// process monitor. This method will load and map any structured
- /// data plugins that support the given set of supported type names.
- /// Later, if any of these features are enabled, the process monitor
- /// is free to generate asynchronous structured data. The data must
- /// come in as a single \b StructuredData::Dictionary. That dictionary
- /// must have a string field named 'type', with a value that equals
- /// the relevant type name string (one of the values in
- /// \b supported_type_names).
+ /// Processes can receive asynchronous structured data from the process
+ /// monitor. This method will load and map any structured data plugins that
+ /// support the given set of supported type names. Later, if any of these
+ /// features are enabled, the process monitor is free to generate
+ /// asynchronous structured data. The data must come in as a single \b
+ /// StructuredData::Dictionary. That dictionary must have a string field
+ /// named 'type', with a value that equals the relevant type name string
+ /// (one of the values in \b supported_type_names).
///
/// @param[in] supported_type_names
/// An array of zero or more type names. Each must be unique.
@@ -2973,10 +2959,9 @@ protected:
//------------------------------------------------------------------
/// Route the incoming structured data dictionary to the right plugin.
///
- /// The incoming structured data must be a dictionary, and it must
- /// have a key named 'type' that stores a string value. The string
- /// value must be the name of the structured data feature that
- /// knows how to handle it.
+ /// The incoming structured data must be a dictionary, and it must have a
+ /// key named 'type' that stores a string value. The string value must be
+ /// the name of the structured data feature that knows how to handle it.
///
/// @param[in] object_sp
/// When non-null and pointing to a dictionary, the 'type'
@@ -3022,7 +3007,7 @@ protected:
//------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
- std::weak_ptr<Target> m_target_sp; ///< The target that owns this process.
+ std::weak_ptr<Target> m_target_wp; ///< The target that owns this process.
ThreadSafeValue<lldb::StateType> m_public_state;
ThreadSafeValue<lldb::StateType>
m_private_state; // The actual state of our process
@@ -3107,11 +3092,11 @@ protected:
bool m_currently_handling_do_on_removals;
bool m_resume_requested; // If m_currently_handling_event or
// m_currently_handling_do_on_removals are true,
- // Resume will only request a resume, using this flag
- // to check.
+ // Resume will only request a resume, using this
+ // flag to check.
bool m_finalizing; // This is set at the beginning of Process::Finalize() to
- // stop functions from looking up or creating things during
- // a finalize call
+ // stop functions from looking up or creating things
+ // during a finalize call
bool m_finalize_called; // This is set at the end of Process::Finalize()
bool m_clear_thread_plans_on_stop;
bool m_force_next_event_delivery;
@@ -3129,6 +3114,9 @@ protected:
StructuredDataPluginMap m_structured_data_plugin_map;
enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
+
+ std::unique_ptr<UtilityFunction> m_dlopen_utility_func_up;
+ std::once_flag m_dlopen_utility_func_flag_once;
size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;
@@ -3160,12 +3148,9 @@ private:
static lldb::thread_result_t PrivateStateThread(void *arg);
// The starts up the private state thread that will watch for events from the
- // debugee.
- // Pass true for is_secondary_thread in the case where you have to temporarily
- // spin up a
- // secondary state thread to handle events from a hand-called function on the
- // primary
- // private state thread.
+ // debugee. Pass true for is_secondary_thread in the case where you have to
+ // temporarily spin up a secondary state thread to handle events from a hand-
+ // called function on the primary private state thread.
lldb::thread_result_t RunPrivateStateThread(bool is_secondary_thread);
@@ -3178,8 +3163,7 @@ protected:
const Timeout<std::micro> &timeout);
// This waits for both the state change broadcaster, and the control
- // broadcaster.
- // If control_only, it only waits for the control broadcaster.
+ // broadcaster. If control_only, it only waits for the control broadcaster.
bool GetEventsPrivate(lldb::EventSP &event_sp,
const Timeout<std::micro> &timeout, bool control_only);
@@ -3220,14 +3204,12 @@ protected:
private:
//------------------------------------------------------------------
- /// This is the part of the event handling that for a process event.
- /// It decides what to do with the event and returns true if the
- /// event needs to be propagated to the user, and false otherwise.
- /// If the event is not propagated, this call will most likely set
- /// the target to executing again.
- /// There is only one place where this call should be called,
- /// HandlePrivateEvent.
- /// Don't call it from anywhere else...
+ /// This is the part of the event handling that for a process event. It
+ /// decides what to do with the event and returns true if the event needs to
+ /// be propagated to the user, and false otherwise. If the event is not
+ /// propagated, this call will most likely set the target to executing
+ /// again. There is only one place where this call should be called,
+ /// HandlePrivateEvent. Don't call it from anywhere else...
///
/// @param[in] event_ptr
/// This is the event we are handling.
diff --git a/include/lldb/Target/ProcessInfo.h b/include/lldb/Target/ProcessInfo.h
index 4077abf89baf..0e0d8548feb6 100644
--- a/include/lldb/Target/ProcessInfo.h
+++ b/include/lldb/Target/ProcessInfo.h
@@ -11,8 +11,9 @@
#define liblldb_ProcessInfo_h_
// LLDB headers
-#include "lldb/Interpreter/Args.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/Environment.h"
#include "lldb/Utility/FileSpec.h"
namespace lldb_private {
@@ -20,9 +21,9 @@ namespace lldb_private {
// ProcessInfo
//
// A base class for information for a process. This can be used to fill
-// out information for a process prior to launching it, or it can be
-// used for an instance of a process and can be filled in with the
-// existing values for that process.
+// out information for a process prior to launching it, or it can be used for
+// an instance of a process and can be filled in with the existing values for
+// that process.
//----------------------------------------------------------------------
class ProcessInfo {
public:
@@ -81,18 +82,16 @@ public:
void SetArguments(char const **argv, bool first_arg_is_executable);
- Args &GetEnvironmentEntries() { return m_environment; }
-
- const Args &GetEnvironmentEntries() const { return m_environment; }
+ Environment &GetEnvironment() { return m_environment; }
+ const Environment &GetEnvironment() const { return m_environment; }
protected:
FileSpec m_executable;
std::string m_arg0; // argv[0] if supported. If empty, then use m_executable.
- // Not all process plug-ins support specifying an argv[0]
- // that differs from the resolved platform executable
- // (which is in m_executable)
+ // Not all process plug-ins support specifying an argv[0] that differs from
+ // the resolved platform executable (which is in m_executable)
Args m_arguments; // All program arguments except argv[0]
- Args m_environment;
+ Environment m_environment;
uint32_t m_uid;
uint32_t m_gid;
ArchSpec m_arch;
diff --git a/include/lldb/Target/ProcessLaunchInfo.h b/include/lldb/Target/ProcessLaunchInfo.h
index fc715f28544d..92c517a3e460 100644
--- a/include/lldb/Target/ProcessLaunchInfo.h
+++ b/include/lldb/Target/ProcessLaunchInfo.h
@@ -107,13 +107,18 @@ public:
return m_monitor_callback;
}
+ /// A Monitor callback which does not take any action on process events. Use
+ /// this if you don't need to take any particular action when the process
+ /// terminates, but you still need to reap it.
+ static bool NoOpMonitorCallback(lldb::pid_t pid, bool exited, int signal,
+ int status);
+
bool GetMonitorSignals() const { return m_monitor_signals; }
// If the LaunchInfo has a monitor callback, then arrange to monitor the
- // process.
- // Return true if the LaunchInfo has taken care of monitoring the process, and
- // false if the
- // caller might want to monitor the process themselves.
+ // process. Return true if the LaunchInfo has taken care of monitoring the
+ // process, and false if the caller might want to monitor the process
+ // themselves.
bool MonitorProcess() const;
diff --git a/include/lldb/Target/ProcessStructReader.h b/include/lldb/Target/ProcessStructReader.h
index cfc8fe11a39a..8f1445ae8c1b 100644
--- a/include/lldb/Target/ProcessStructReader.h
+++ b/include/lldb/Target/ProcessStructReader.h
@@ -16,6 +16,7 @@
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Status.h"
diff --git a/include/lldb/Target/Queue.h b/include/lldb/Target/Queue.h
index 2df4d54a89b6..62cc3ccf2e2f 100644
--- a/include/lldb/Target/Queue.h
+++ b/include/lldb/Target/Queue.h
@@ -22,15 +22,14 @@ namespace lldb_private {
//------------------------------------------------------------------
// Queue:
-// This class represents a libdispatch aka Grand Central Dispatch
-// queue in the process.
+// This class represents a libdispatch aka Grand Central Dispatch queue in the
+// process.
//
// A program using libdispatch will create queues, put work items
-// (functions, blocks) on the queues. The system will create /
-// reassign pthreads to execute the work items for the queues. A
-// serial queue will be associated with a single thread (or possibly
-// no thread, if it is not doing any work). A concurrent queue may
-// be associated with multiple threads.
+// (functions, blocks) on the queues. The system will create / reassign
+// pthreads to execute the work items for the queues. A serial queue will be
+// associated with a single thread (or possibly no thread, if it is not doing
+// any work). A concurrent queue may be associated with multiple threads.
//------------------------------------------------------------------
class Queue : public std::enable_shared_from_this<Queue> {
diff --git a/include/lldb/Target/QueueItem.h b/include/lldb/Target/QueueItem.h
index acbf94e1b0f9..76bcea36a2fa 100644
--- a/include/lldb/Target/QueueItem.h
+++ b/include/lldb/Target/QueueItem.h
@@ -29,12 +29,11 @@ namespace lldb_private {
//------------------------------------------------------------------
// QueueItem:
-// This class represents a work item enqueued on a libdispatch aka
-// Grand Central Dispatch (GCD) queue. Most often, this will be a
-// function or block.
-// "enqueued" here means that the work item has been added to a queue
-// but it has not yet started executing. When it is "dequeued",
-// execution of the item begins.
+// This class represents a work item enqueued on a libdispatch aka Grand
+// Central Dispatch (GCD) queue. Most often, this will be a function or block.
+// "enqueued" here means that the work item has been added to a queue but it
+// has not yet started executing. When it is "dequeued", execution of the item
+// begins.
//------------------------------------------------------------------
class QueueItem : public std::enable_shared_from_this<QueueItem> {
diff --git a/include/lldb/Target/QueueList.h b/include/lldb/Target/QueueList.h
index 91cf3eb6d4c2..b35de13aa1e5 100644
--- a/include/lldb/Target/QueueList.h
+++ b/include/lldb/Target/QueueList.h
@@ -21,12 +21,11 @@ namespace lldb_private {
//------------------------------------------------------------------
// QueueList:
-// This is the container for libdispatch aka Grand Central Dispatch
-// Queue objects.
+// This is the container for libdispatch aka Grand Central Dispatch Queue
+// objects.
//
-// Each Process will have a QueueList. When the process execution is
-// paused, the QueueList may be populated with Queues by the
-// SystemRuntime.
+// Each Process will have a QueueList. When the process execution is paused,
+// the QueueList may be populated with Queues by the SystemRuntime.
//------------------------------------------------------------------
class QueueList {
diff --git a/include/lldb/Target/RegisterCheckpoint.h b/include/lldb/Target/RegisterCheckpoint.h
index 578cf25eef25..e4b407124c9f 100644
--- a/include/lldb/Target/RegisterCheckpoint.h
+++ b/include/lldb/Target/RegisterCheckpoint.h
@@ -16,20 +16,19 @@
namespace lldb_private {
-// Inherit from UserID in case pushing/popping all register values can be
-// done using a 64 bit integer that holds a baton/cookie instead of actually
-// having to read all register values into a buffer
+// Inherit from UserID in case pushing/popping all register values can be done
+// using a 64 bit integer that holds a baton/cookie instead of actually having
+// to read all register values into a buffer
class RegisterCheckpoint : public UserID {
public:
enum class Reason {
// An expression is about to be run on the thread if the protocol that
// talks to the debuggee supports checkpointing the registers using a
- // push/pop then the UserID base class in the RegisterCheckpoint can
- // be used to store the baton/cookie that refers to the remote saved
- // state.
+ // push/pop then the UserID base class in the RegisterCheckpoint can be
+ // used to store the baton/cookie that refers to the remote saved state.
eExpression,
- // The register checkpoint wants the raw register bytes, so they must
- // be read into m_data_sp, or the save/restore checkpoint should fail.
+ // The register checkpoint wants the raw register bytes, so they must be
+ // read into m_data_sp, or the save/restore checkpoint should fail.
eDataBackup
};
diff --git a/include/lldb/Target/RegisterContext.h b/include/lldb/Target/RegisterContext.h
index c438a0cd12cf..73a2930fd2b5 100644
--- a/include/lldb/Target/RegisterContext.h
+++ b/include/lldb/Target/RegisterContext.h
@@ -63,16 +63,14 @@ public:
}
// These two functions are used to implement "push" and "pop" of register
- // states. They are used primarily
- // for expression evaluation, where we need to push a new state (storing the
- // old one in data_sp) and then
- // restoring the original state by passing the data_sp we got from
- // ReadAllRegisters to WriteAllRegisterValues.
- // ReadAllRegisters will do what is necessary to return a coherent set of
- // register values for this thread, which
- // may mean e.g. interrupting a thread that is sitting in a kernel trap. That
- // is a somewhat disruptive operation,
- // so these API's should only be used when this behavior is needed.
+ // states. They are used primarily for expression evaluation, where we need
+ // to push a new state (storing the old one in data_sp) and then restoring
+ // the original state by passing the data_sp we got from ReadAllRegisters to
+ // WriteAllRegisterValues. ReadAllRegisters will do what is necessary to
+ // return a coherent set of register values for this thread, which may mean
+ // e.g. interrupting a thread that is sitting in a kernel trap. That is a
+ // somewhat disruptive operation, so these API's should only be used when
+ // this behavior is needed.
virtual bool
ReadAllRegisterValues(lldb_private::RegisterCheckpoint &reg_checkpoint);
diff --git a/include/lldb/Target/RegisterNumber.h b/include/lldb/Target/RegisterNumber.h
index 5649c8022ee7..1a0ab49bdce3 100644
--- a/include/lldb/Target/RegisterNumber.h
+++ b/include/lldb/Target/RegisterNumber.h
@@ -26,8 +26,8 @@ public:
// This constructor plus the init() method below allow for the placeholder
// creation of an invalid object initially, possibly to be filled in. It
- // would be more consistent to have three Set* methods to set the three
- // data that the object needs.
+ // would be more consistent to have three Set* methods to set the three data
+ // that the object needs.
RegisterNumber();
void init(lldb_private::Thread &thread, lldb::RegisterKind kind,
diff --git a/include/lldb/Target/SectionLoadHistory.h b/include/lldb/Target/SectionLoadHistory.h
index e1db141ea9e3..0ed335a9d040 100644
--- a/include/lldb/Target/SectionLoadHistory.h
+++ b/include/lldb/Target/SectionLoadHistory.h
@@ -23,8 +23,8 @@ namespace lldb_private {
class SectionLoadHistory {
public:
enum : unsigned {
- // Pass eStopIDNow to any function that takes a stop ID to get
- // the current value.
+ // Pass eStopIDNow to any function that takes a stop ID to get the current
+ // value.
eStopIDNow = UINT32_MAX
};
//------------------------------------------------------------------
@@ -33,8 +33,8 @@ public:
SectionLoadHistory() : m_stop_id_to_section_load_list(), m_mutex() {}
~SectionLoadHistory() {
- // Call clear since this takes a lock and clears the section load list
- // in case another thread is currently using this section load list
+ // Call clear since this takes a lock and clears the section load list in
+ // case another thread is currently using this section load list
Clear();
}
@@ -59,14 +59,14 @@ public:
bool warn_multiple = false);
// The old load address should be specified when unloading to ensure we get
- // the correct instance of the section as a shared library could be loaded
- // at more than one location.
+ // the correct instance of the section as a shared library could be loaded at
+ // more than one location.
bool SetSectionUnloaded(uint32_t stop_id, const lldb::SectionSP &section_sp,
lldb::addr_t load_addr);
// Unload all instances of a section. This function can be used on systems
- // that don't support multiple copies of the same shared library to be
- // loaded at the same time.
+ // that don't support multiple copies of the same shared library to be loaded
+ // at the same time.
size_t SetSectionUnloaded(uint32_t stop_id,
const lldb::SectionSP &section_sp);
diff --git a/include/lldb/Target/SectionLoadList.h b/include/lldb/Target/SectionLoadList.h
index beb345b71290..1156c686df17 100644
--- a/include/lldb/Target/SectionLoadList.h
+++ b/include/lldb/Target/SectionLoadList.h
@@ -34,8 +34,8 @@ public:
SectionLoadList(const SectionLoadList &rhs);
~SectionLoadList() {
- // Call clear since this takes a lock and clears the section load list
- // in case another thread is currently using this section load list
+ // Call clear since this takes a lock and clears the section load list in
+ // case another thread is currently using this section load list
Clear();
}
@@ -55,14 +55,14 @@ public:
bool warn_multiple = false);
// The old load address should be specified when unloading to ensure we get
- // the correct instance of the section as a shared library could be loaded
- // at more than one location.
+ // the correct instance of the section as a shared library could be loaded at
+ // more than one location.
bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
lldb::addr_t load_addr);
// Unload all instances of a section. This function can be used on systems
- // that don't support multiple copies of the same shared library to be
- // loaded at the same time.
+ // that don't support multiple copies of the same shared library to be loaded
+ // at the same time.
size_t SetSectionUnloaded(const lldb::SectionSP &section_sp);
void Dump(Stream &s, Target *target);
diff --git a/include/lldb/Target/StackFrame.h b/include/lldb/Target/StackFrame.h
index d97043578ce9..ce9b16227672 100644
--- a/include/lldb/Target/StackFrame.h
+++ b/include/lldb/Target/StackFrame.h
@@ -32,7 +32,7 @@ namespace lldb_private {
/// @class StackFrame StackFrame.h "lldb/Target/StackFrame.h"
///
-/// @brief This base class provides an interface to stack frames.
+/// This base class provides an interface to stack frames.
///
/// StackFrames may have a Canonical Frame Address (CFA) or not.
/// A frame may have a plain pc value or it may have a pc value + stop_id
@@ -59,10 +59,10 @@ public:
///
/// This is the one constructor that doesn't take a RegisterContext
/// parameter. This ctor may be called when creating a history StackFrame;
- /// these are used if we've collected a stack trace of pc addresses at
- /// some point in the past. We may only have pc values. We may have pc
- /// values and the stop_id when the stack trace was recorded. We may have a
- /// CFA, or more likely, we won't.
+ /// these are used if we've collected a stack trace of pc addresses at some
+ /// point in the past. We may only have pc values. We may have pc values
+ /// and the stop_id when the stack trace was recorded. We may have a CFA,
+ /// or more likely, we won't.
///
/// @param [in] thread_sp
/// The Thread that this frame belongs to.
@@ -165,9 +165,9 @@ public:
/// Provide a SymbolContext for this StackFrame's current pc value.
///
/// The StackFrame maintains this SymbolContext and adds additional
- /// information
- /// to it on an as-needed basis. This helps to avoid different functions
- /// looking up symbolic information for a given pc value multiple times.
+ /// information to it on an as-needed basis. This helps to avoid different
+ /// functions looking up symbolic information for a given pc value multiple
+ /// times.
///
/// @params [in] resolve_scope
/// Flags from the SymbolContextItem enumerated type which specify what
@@ -182,9 +182,9 @@ public:
//------------------------------------------------------------------
/// Return the Canonical Frame Address (DWARF term) for this frame.
///
- /// The CFA is typically the value of the stack pointer register before
- /// the call invocation is made. It will not change during the lifetime
- /// of a stack frame. It is often not the same thing as the frame pointer
+ /// The CFA is typically the value of the stack pointer register before the
+ /// call invocation is made. It will not change during the lifetime of a
+ /// stack frame. It is often not the same thing as the frame pointer
/// register value.
///
/// Live StackFrames will always have a CFA but other types of frames may
@@ -220,9 +220,8 @@ public:
//------------------------------------------------------------------
/// Get the current lexical scope block for this StackFrame, if possible.
///
- /// If debug information is available for this stack frame, return a
- /// pointer to the innermost lexical Block that the frame is currently
- /// executing.
+ /// If debug information is available for this stack frame, return a pointer
+ /// to the innermost lexical Block that the frame is currently executing.
///
/// @return
/// A pointer to the current Block. nullptr is returned if this can
@@ -251,11 +250,12 @@ public:
}
//------------------------------------------------------------------
- /// Retrieve the list of variables that are in scope at this StackFrame's pc.
+ /// Retrieve the list of variables that are in scope at this StackFrame's
+ /// pc.
///
/// A frame that is not live may return an empty VariableList for a given
- /// pc value even though variables would be available at this point if
- /// it were a live stack frame.
+ /// pc value even though variables would be available at this point if it
+ /// were a live stack frame.
///
/// @param[in] get_file_globals
/// Whether to also retrieve compilation-unit scoped variables
@@ -268,11 +268,12 @@ public:
VariableList *GetVariableList(bool get_file_globals);
//------------------------------------------------------------------
- /// Retrieve the list of variables that are in scope at this StackFrame's pc.
+ /// Retrieve the list of variables that are in scope at this StackFrame's
+ /// pc.
///
/// A frame that is not live may return an empty VariableListSP for a
- /// given pc value even though variables would be available at this point
- /// if it were a live stack frame.
+ /// given pc value even though variables would be available at this point if
+ /// it were a live stack frame.
///
/// @param[in] get_file_globals
/// Whether to also retrieve compilation-unit scoped variables
@@ -287,8 +288,8 @@ public:
bool must_have_valid_location = false);
//------------------------------------------------------------------
- /// Create a ValueObject for a variable name / pathname, possibly
- /// including simple dereference/child selection syntax.
+ /// Create a ValueObject for a variable name / pathname, possibly including
+ /// simple dereference/child selection syntax.
///
/// @param[in] var_expr
/// The string specifying a variable to base the VariableObject off
@@ -327,8 +328,8 @@ public:
bool HasDebugInformation();
//------------------------------------------------------------------
- /// Return the disassembly for the instructions of this StackFrame's function
- /// as a single C string.
+ /// Return the disassembly for the instructions of this StackFrame's
+ /// function as a single C string.
///
/// @return
// C string with the assembly instructions for this function.
@@ -366,8 +367,8 @@ public:
void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths);
//------------------------------------------------------------------
- /// Print a description of this stack frame and/or the source context/assembly
- /// for this stack frame.
+ /// Print a description of this stack frame and/or the source
+ /// context/assembly for this stack frame.
///
/// @param[in] strm
/// The Stream to send the output to.
@@ -392,9 +393,9 @@ public:
bool show_unique = false, const char *frame_marker = nullptr);
//------------------------------------------------------------------
- /// Query whether this frame is a concrete frame on the call stack,
- /// or if it is an inlined frame derived from the debug information
- /// and presented by the debugger.
+ /// Query whether this frame is a concrete frame on the call stack, or if it
+ /// is an inlined frame derived from the debug information and presented by
+ /// the debugger.
///
/// @return
/// true if this is an inlined frame.
@@ -402,7 +403,8 @@ public:
bool IsInlined();
//------------------------------------------------------------------
- /// Query this frame to find what frame it is in this Thread's StackFrameList.
+ /// Query this frame to find what frame it is in this Thread's
+ /// StackFrameList.
///
/// @return
/// StackFrame index 0 indicates the currently-executing function. Inline
@@ -411,8 +413,8 @@ public:
uint32_t GetFrameIndex() const;
//------------------------------------------------------------------
- /// Query this frame to find what frame it is in this Thread's StackFrameList,
- /// not counting inlined frames.
+ /// Query this frame to find what frame it is in this Thread's
+ /// StackFrameList, not counting inlined frames.
///
/// @return
/// StackFrame index 0 indicates the currently-executing function. Inline
@@ -442,8 +444,7 @@ public:
//------------------------------------------------------------------
/// Add an arbitrary Variable object (e.g. one that specifics a global or
- /// static)
- /// to a StackFrame's list of ValueObjects.
+ /// static) to a StackFrame's list of ValueObjects.
///
/// @params [in] variable_sp
/// The Variable to base this ValueObject on
@@ -460,8 +461,8 @@ public:
lldb::DynamicValueType use_dynamic);
//------------------------------------------------------------------
- /// Query this frame to determine what the default language should be
- /// when parsing expressions given the execution context.
+ /// Query this frame to determine what the default language should be when
+ /// parsing expressions given the execution context.
///
/// @return
/// The language of the frame if known, else lldb::eLanguageTypeUnknown.
@@ -469,8 +470,7 @@ public:
lldb::LanguageType GetLanguage();
// similar to GetLanguage(), but is allowed to take a potentially incorrect
- // guess
- // if exact information is not available
+ // guess if exact information is not available
lldb::LanguageType GuessLanguage();
//------------------------------------------------------------------
@@ -488,8 +488,8 @@ public:
//------------------------------------------------------------------
/// Attempt to reconstruct the ValueObject for the address contained in a
- /// given register plus an offset. The ExpressionPath should indicate how to
- /// get to this value using "frame variable."
+ /// given register plus an offset. The ExpressionPath should indicate how
+ /// to get to this value using "frame variable."
///
/// @params [in] reg
/// The name of the register.
diff --git a/include/lldb/Target/StackID.h b/include/lldb/Target/StackID.h
index 7b7e9e5187b6..51e51a6c0741 100644
--- a/include/lldb/Target/StackID.h
+++ b/include/lldb/Target/StackID.h
@@ -81,20 +81,20 @@ protected:
lldb::addr_t
m_pc; // The pc value for the function/symbol for this frame. This will
// only get used if the symbol scope is nullptr (the code where we are
- // stopped is not represented by any function or symbol in any
- // shared library).
+ // stopped is not represented by any function or symbol in any shared
+ // library).
lldb::addr_t m_cfa; // The call frame address (stack pointer) value
// at the beginning of the function that uniquely
- // identifies this frame (along with m_symbol_scope below)
+ // identifies this frame (along with m_symbol_scope
+ // below)
SymbolContextScope *
m_symbol_scope; // If nullptr, there is no block or symbol for this frame.
// If not nullptr, this will either be the scope for the
- // lexical block for the frame, or the scope
- // for the symbol. Symbol context scopes are
- // always be unique pointers since the are part
- // of the Block and Symbol objects and can easily
- // be used to tell if a stack ID is the same as
- // another.
+ // lexical block for the frame, or the scope for the
+ // symbol. Symbol context scopes are always be unique
+ // pointers since the are part of the Block and Symbol
+ // objects and can easily be used to tell if a stack ID
+ // is the same as another.
};
bool operator==(const StackID &lhs, const StackID &rhs);
diff --git a/include/lldb/Target/StopInfo.h b/include/lldb/Target/StopInfo.h
index c99877cbd8ab..b25bf7dd3d5d 100644
--- a/include/lldb/Target/StopInfo.h
+++ b/include/lldb/Target/StopInfo.h
@@ -40,12 +40,10 @@ public:
lldb::ThreadSP GetThread() const { return m_thread_wp.lock(); }
- // The value of the StopInfo depends on the StopReason.
- // StopReason Meaning
- // ----------------------------------------------
- // eStopReasonBreakpoint BreakpointSiteID
- // eStopReasonSignal Signal number
- // eStopReasonWatchpoint WatchpointLocationID
+ // The value of the StopInfo depends on the StopReason. StopReason
+ // Meaning ----------------------------------------------
+ // eStopReasonBreakpoint BreakpointSiteID eStopReasonSignal
+ // Signal number eStopReasonWatchpoint WatchpointLocationID
// eStopReasonPlanComplete No significance
uint64_t GetValue() const { return m_value; }
@@ -53,10 +51,8 @@ public:
virtual lldb::StopReason GetStopReason() const = 0;
// ShouldStopSynchronous will get called before any thread plans are
- // consulted, and if it says we should
- // resume the target, then we will just immediately resume. This should not
- // run any code in or resume the
- // target.
+ // consulted, and if it says we should resume the target, then we will just
+ // immediately resume. This should not run any code in or resume the target.
virtual bool ShouldStopSynchronous(Event *event_ptr) { return true; }
@@ -88,14 +84,11 @@ public:
virtual bool IsValidForOperatingSystemThread(Thread &thread) { return true; }
// Sometimes the thread plan logic will know that it wants a given stop to
- // stop or not,
- // regardless of what the ordinary logic for that StopInfo would dictate. The
- // main example
- // of this is the ThreadPlanCallFunction, which for instance knows - based on
- // how that particular
- // expression was executed - whether it wants all breakpoints to auto-continue
- // or not.
- // Use OverrideShouldStop on the StopInfo to implement this.
+ // stop or not, regardless of what the ordinary logic for that StopInfo would
+ // dictate. The main example of this is the ThreadPlanCallFunction, which
+ // for instance knows - based on how that particular expression was executed
+ // - whether it wants all breakpoints to auto-continue or not. Use
+ // OverrideShouldStop on the StopInfo to implement this.
void OverrideShouldStop(bool override_value) {
m_override_should_stop = override_value ? eLazyBoolYes : eLazyBoolNo;
@@ -159,15 +152,13 @@ protected:
virtual bool DoShouldNotify(Event *event_ptr) { return false; }
- // Stop the thread by default. Subclasses can override this to allow
- // the thread to continue if desired. The ShouldStop method should not do
- // anything
- // that might run code. If you need to run code when deciding whether to stop
- // at this StopInfo, that must be done in the PerformAction.
+ // Stop the thread by default. Subclasses can override this to allow the
+ // thread to continue if desired. The ShouldStop method should not do
+ // anything that might run code. If you need to run code when deciding
+ // whether to stop at this StopInfo, that must be done in the PerformAction.
// The PerformAction will always get called before the ShouldStop. This is
- // done by the
- // ProcessEventData::DoOnRemoval, though the ThreadPlanBase needs to consult
- // this later on.
+ // done by the ProcessEventData::DoOnRemoval, though the ThreadPlanBase needs
+ // to consult this later on.
virtual bool ShouldStop(Event *event_ptr) { return true; }
//------------------------------------------------------------------
@@ -185,14 +176,13 @@ protected:
StructuredData::ObjectSP
m_extended_info; // The extended info for this stop info
- // This determines whether the target has run since this stop info.
- // N.B. running to evaluate a user expression does not count.
+ // This determines whether the target has run since this stop info. N.B.
+ // running to evaluate a user expression does not count.
bool HasTargetRunSinceMe();
// MakeStopInfoValid is necessary to allow saved stop infos to resurrect
- // themselves as valid.
- // It should only be used by Thread::RestoreThreadStateFromCheckpoint and to
- // make sure the one-step
+ // themselves as valid. It should only be used by
+ // Thread::RestoreThreadStateFromCheckpoint and to make sure the one-step
// needed for before-the-fact watchpoints does not prevent us from stopping
void MakeStopInfoValid();
diff --git a/include/lldb/Target/SystemRuntime.h b/include/lldb/Target/SystemRuntime.h
index 8c6c2ece967f..06cc3ec2d012 100644
--- a/include/lldb/Target/SystemRuntime.h
+++ b/include/lldb/Target/SystemRuntime.h
@@ -29,20 +29,20 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class SystemRuntime SystemRuntime.h "lldb/Target/SystemRuntime.h"
-/// @brief A plug-in interface definition class for system runtimes.
+/// A plug-in interface definition class for system runtimes.
///
/// The system runtime plugins can collect information from the system
-/// libraries during a Process' lifetime and provide information about
-/// how objects/threads were originated.
+/// libraries during a Process' lifetime and provide information about how
+/// objects/threads were originated.
///
-/// For instance, a system runtime plugin use a breakpoint when threads
-/// are created to record the backtrace of where that thread was created.
-/// Later, when backtracing the created thread, it could extend the backtrace
-/// to show where it was originally created from.
+/// For instance, a system runtime plugin use a breakpoint when threads are
+/// created to record the backtrace of where that thread was created. Later,
+/// when backtracing the created thread, it could extend the backtrace to show
+/// where it was originally created from.
///
-/// The plugin will insert its own breakpoint when Created and start collecting
-/// information. Later when it comes time to augment a Thread, it can be
-/// asked to provide that information.
+/// The plugin will insert its own breakpoint when Created and start
+/// collecting information. Later when it comes time to augment a Thread, it
+/// can be asked to provide that information.
///
//----------------------------------------------------------------------
@@ -51,9 +51,8 @@ public:
//------------------------------------------------------------------
/// Find a system runtime plugin for a given process.
///
- /// Scans the installed SystemRuntime plugins and tries to find
- /// an instance that can be used to track image changes in \a
- /// process.
+ /// Scans the installed SystemRuntime plugins and tries to find an instance
+ /// that can be used to track image changes in \a process.
///
/// @param[in] process
/// The process for which to try and locate a system runtime
@@ -69,60 +68,60 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// by the plug-in instance.
//------------------------------------------------------------------
~SystemRuntime() override;
//------------------------------------------------------------------
/// Called after attaching to a process.
///
- /// Allow the SystemRuntime plugin to execute some code after attaching
- /// to a process.
+ /// Allow the SystemRuntime plugin to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach();
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow the SystemRuntime plugin to execute some code after launching
- /// a process.
+ /// Allow the SystemRuntime plugin to execute some code after launching a
+ /// process.
//------------------------------------------------------------------
virtual void DidLaunch();
//------------------------------------------------------------------
/// Called when modules have been loaded in the process.
///
- /// Allow the SystemRuntime plugin to enable logging features in the
- /// system runtime libraries.
+ /// Allow the SystemRuntime plugin to enable logging features in the system
+ /// runtime libraries.
//------------------------------------------------------------------
virtual void ModulesDidLoad(lldb_private::ModuleList &module_list);
//------------------------------------------------------------------
/// Called before detaching from a process.
///
- /// This will give a SystemRuntime plugin a chance to free any resources
- /// in the inferior process before we detach.
+ /// This will give a SystemRuntime plugin a chance to free any resources in
+ /// the inferior process before we detach.
//------------------------------------------------------------------
virtual void Detach();
//------------------------------------------------------------------
- /// Return a list of thread origin extended backtraces that may
- /// be available.
+ /// Return a list of thread origin extended backtraces that may be
+ /// available.
///
/// A System Runtime may be able to provide a backtrace of when this
- /// thread was originally created. Furthermore, it may be able to
- /// provide that extended backtrace for different styles of creation.
- /// On a system with both pthreads and libdispatch, aka Grand Central
- /// Dispatch, queues, the system runtime may be able to provide the
- /// pthread creation of the thread and it may also be able to provide
- /// the backtrace of when this GCD queue work block was enqueued.
- /// The caller may request these different origins by name.
- ///
- /// The names will be provided in the order that they are most likely
- /// to be requested. For instance, a most natural order may be to
- /// request the GCD libdispatch queue origin. If there is none, then
- /// request the pthread origin.
+ /// thread was originally created. Furthermore, it may be able to provide
+ /// that extended backtrace for different styles of creation. On a system
+ /// with both pthreads and libdispatch, aka Grand Central Dispatch, queues,
+ /// the system runtime may be able to provide the pthread creation of the
+ /// thread and it may also be able to provide the backtrace of when this GCD
+ /// queue work block was enqueued. The caller may request these different
+ /// origins by name.
+ ///
+ /// The names will be provided in the order that they are most likely to be
+ /// requested. For instance, a most natural order may be to request the GCD
+ /// libdispatch queue origin. If there is none, then request the pthread
+ /// origin.
///
/// @return
/// A vector of ConstStrings with names like "pthread" or "libdispatch".
@@ -135,13 +134,12 @@ public:
/// Return a Thread which shows the origin of this thread's creation.
///
/// This likely returns a HistoryThread which shows how thread was
- /// originally created (e.g. "pthread" type), or how the work that
- /// is currently executing on it was originally enqueued (e.g.
- /// "libdispatch" type).
+ /// originally created (e.g. "pthread" type), or how the work that is
+ /// currently executing on it was originally enqueued (e.g. "libdispatch"
+ /// type).
///
- /// There may be a chain of thread-origins; it may be informative to
- /// the end user to query the returned ThreadSP for its origins as
- /// well.
+ /// There may be a chain of thread-origins; it may be informative to the end
+ /// user to query the returned ThreadSP for its origins as well.
///
/// @param [in] thread
/// The thread to examine.
@@ -168,8 +166,8 @@ public:
/// a libdispatch queue in the future, or it represents a function/block
/// that is currently executing on a thread.
///
- /// This method will report a thread backtrace of the function that
- /// enqueued it originally, if possible.
+ /// This method will report a thread backtrace of the function that enqueued
+ /// it originally, if possible.
///
/// @param [in] queue_item_sp
/// The QueueItem that we are getting an extended backtrace for.
@@ -189,10 +187,11 @@ public:
}
//------------------------------------------------------------------
- /// Populate the Process' QueueList with libdispatch / GCD queues that exist.
+ /// Populate the Process' QueueList with libdispatch / GCD queues that
+ /// exist.
///
- /// When process execution is paused, the SystemRuntime may be called to fill
- /// in the list of Queues that currently exist.
+ /// When process execution is paused, the SystemRuntime may be called to
+ /// fill in the list of Queues that currently exist.
///
/// @param [out] queue_list
/// This QueueList will be cleared, and any queues that currently exist
@@ -205,12 +204,10 @@ public:
/// Get the queue name for a thread given a thread's dispatch_qaddr.
///
/// On systems using libdispatch queues, a thread may be associated with a
- /// queue.
- /// There will be a call to get the thread's dispatch_qaddr. At the
- /// dispatch_qaddr
- /// we will find the address of this thread's dispatch_queue_t structure.
- /// Given the address of the dispatch_queue_t structure for a thread,
- /// get the queue name and return it.
+ /// queue. There will be a call to get the thread's dispatch_qaddr. At the
+ /// dispatch_qaddr we will find the address of this thread's
+ /// dispatch_queue_t structure. Given the address of the dispatch_queue_t
+ /// structure for a thread, get the queue name and return it.
///
/// @param [in] dispatch_qaddr
/// The address of the dispatch_qaddr pointer for this thread.
@@ -229,12 +226,10 @@ public:
/// dispatch_qaddr.
///
/// On systems using libdispatch queues, a thread may be associated with a
- /// queue.
- /// There will be a call to get the thread's dispatch_qaddr. At the
- /// dispatch_qaddr
- /// we will find the address of this thread's dispatch_queue_t structure.
- /// Given the address of the dispatch_queue_t structure for a thread,
- /// get the queue ID and return it.
+ /// queue. There will be a call to get the thread's dispatch_qaddr. At the
+ /// dispatch_qaddr we will find the address of this thread's
+ /// dispatch_queue_t structure. Given the address of the dispatch_queue_t
+ /// structure for a thread, get the queue ID and return it.
///
/// @param [in] dispatch_qaddr
/// The address of the dispatch_qaddr pointer for this thread.
@@ -252,10 +247,8 @@ public:
/// dispatch_qaddr.
///
/// On systems using libdispatch queues, a thread may be associated with a
- /// queue.
- /// There will be a call to get the thread's dispatch_qaddr.
- /// Given the thread's dispatch_qaddr, find the libdispatch_queue_t address
- /// and
+ /// queue. There will be a call to get the thread's dispatch_qaddr. Given
+ /// the thread's dispatch_qaddr, find the libdispatch_queue_t address and
/// return it.
///
/// @param [in] dispatch_qaddr
@@ -274,8 +267,8 @@ public:
/// Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.
///
/// Retrieve the Queue kind - either eQueueKindSerial or
- /// eQueueKindConcurrent, indicating that this queue processes work
- /// items serially or concurrently.
+ /// eQueueKindConcurrent, indicating that this queue processes work items
+ /// serially or concurrently.
///
/// @return
/// The Queue kind, if it could be read, else eQueueKindUnknown.
@@ -288,8 +281,8 @@ public:
/// Get the pending work items for a libdispatch Queue
///
/// If this system/process is using libdispatch and the runtime can do so,
- /// retrieve the list of pending work items for the specified Queue and
- /// add it to the Queue.
+ /// retrieve the list of pending work items for the specified Queue and add
+ /// it to the Queue.
///
/// @param [in] queue
/// The queue of interest.
@@ -300,8 +293,8 @@ public:
/// Complete the fields in a QueueItem
///
/// PopulatePendingItemsForQueue() may not fill in all of the QueueItem
- /// details; when the remaining fields are needed, they will be
- /// fetched by call this method.
+ /// details; when the remaining fields are needed, they will be fetched by
+ /// call this method.
///
/// @param [in] queue_item
/// The QueueItem that we will be completing.
@@ -316,8 +309,7 @@ public:
//------------------------------------------------------------------
/// Add key-value pairs to the StructuredData dictionary object with
/// information debugserver may need when constructing the
- /// jThreadExtendedInfo
- /// packet.
+ /// jThreadExtendedInfo packet.
///
/// @param [out] dict
/// Dictionary to which key-value pairs should be added; they will
diff --git a/include/lldb/Target/Target.h b/include/lldb/Target/Target.h
index a5d200069810..75af8e80d2e5 100644
--- a/include/lldb/Target/Target.h
+++ b/include/lldb/Target/Target.h
@@ -35,6 +35,7 @@
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Target/SectionLoadHistory.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-public.h"
@@ -102,9 +103,6 @@ public:
const char *GetDisassemblyFlavor() const;
- // void
- // SetDisassemblyFlavor(const char *flavor);
-
InlineStrategy GetInlineStrategy() const;
llvm::StringRef GetArg0() const;
@@ -115,9 +113,8 @@ public:
void SetRunArguments(const Args &args);
- size_t GetEnvironmentAsArgs(Args &env) const;
-
- void SetEnvironmentFromArgs(const Args &env);
+ Environment GetEnvironment() const;
+ void SetEnvironment(Environment env);
bool GetSkipPrologue() const;
@@ -235,8 +232,8 @@ class EvaluateExpressionOptions {
public:
// MSVC has a bug here that reports C4268: 'const' static/global data
// initialized with compiler generated default constructor fills the object
-// with zeros.
-// Confirmed that MSVC is *not* zero-initializing, it's just a bogus warning.
+// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
+// bogus warning.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4268)
@@ -353,8 +350,7 @@ public:
}
// Allows the expression contents to be remapped to point to the specified
- // file and line
- // using #line directives.
+ // file and line using #line directives.
void SetPoundLine(const char *path, uint32_t line) const {
if (path && path[0]) {
m_pound_line_file = path;
@@ -401,8 +397,8 @@ private:
Timeout<std::micro> m_one_thread_timeout = llvm::None;
lldb::ExpressionCancelCallback m_cancel_callback = nullptr;
void *m_cancel_callback_baton = nullptr;
- // If m_pound_line_file is not empty and m_pound_line_line is non-zero,
- // use #line %u "%s" before the expression content to remap where the source
+ // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
+ // #line %u "%s" before the expression content to remap where the source
// originates
mutable std::string m_pound_line_file;
mutable uint32_t m_pound_line_line;
@@ -490,9 +486,6 @@ public:
static void SetDefaultArchitecture(const ArchSpec &arch);
- // void
- // UpdateInstanceName ();
-
lldb::ModuleSP GetSharedModule(const ModuleSpec &module_spec,
Status *error_ptr = nullptr);
@@ -563,9 +556,8 @@ public:
LazyBool move_to_nearest_code);
// Use this to create breakpoint that matches regex against the source lines
- // in files given in source_file_list:
- // If function_names is non-empty, also filter by function after the matches
- // are made.
+ // in files given in source_file_list: If function_names is non-empty, also
+ // filter by function after the matches are made.
lldb::BreakpointSP CreateSourceRegexBreakpoint(
const FileSpecList *containingModules,
const FileSpecList *source_file_list,
@@ -589,8 +581,8 @@ public:
// Use this to create a function breakpoint by regexp in
// containingModule/containingSourceFiles, or all modules if it is nullptr
- // When "skip_prologue is set to eLazyBoolCalculate, we use the current target
- // setting, else we use the values passed in
+ // When "skip_prologue is set to eLazyBoolCalculate, we use the current
+ // target setting, else we use the values passed in
lldb::BreakpointSP CreateFuncRegexBreakpoint(
const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles, RegularExpression &func_regexp,
@@ -598,10 +590,10 @@ public:
bool internal, bool request_hardware);
// Use this to create a function breakpoint by name in containingModule, or
- // all modules if it is nullptr
- // When "skip_prologue is set to eLazyBoolCalculate, we use the current target
- // setting, else we use the values passed in.
- // func_name_type_mask is or'ed values from the FunctionNameType enum.
+ // all modules if it is nullptr When "skip_prologue is set to
+ // eLazyBoolCalculate, we use the current target setting, else we use the
+ // values passed in. func_name_type_mask is or'ed values from the
+ // FunctionNameType enum.
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
const char *func_name,
@@ -618,11 +610,10 @@ public:
Status *additional_args_error = nullptr);
// This is the same as the func_name breakpoint except that you can specify a
- // vector of names. This is cheaper
- // than a regular expression breakpoint in the case where you just want to set
- // a breakpoint on a set of names
- // you already know.
- // func_name_type_mask is or'ed values from the FunctionNameType enum.
+ // vector of names. This is cheaper than a regular expression breakpoint in
+ // the case where you just want to set a breakpoint on a set of names you
+ // already know. func_name_type_mask is or'ed values from the
+ // FunctionNameType enum.
lldb::BreakpointSP
CreateBreakpoint(const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
@@ -741,14 +732,14 @@ public:
/// Take \a load_addr and potentially add any address bits that are
/// needed to make the address callable. For ARM this can set bit
/// zero (if it already isn't) if \a load_addr is a thumb function.
- /// If \a addr_class is set to eAddressClassInvalid, then the address
+ /// If \a addr_class is set to AddressClass::eInvalid, then the address
/// adjustment will always happen. If it is set to an address class
/// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
/// returned.
//------------------------------------------------------------------
lldb::addr_t GetCallableLoadAddress(
lldb::addr_t load_addr,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
+ AddressClass addr_class = AddressClass::eInvalid) const;
//------------------------------------------------------------------
/// Get \a load_addr as an opcode for this target.
@@ -757,22 +748,20 @@ public:
/// needed to make the address point to an opcode. For ARM this can
/// clear bit zero (if it already isn't) if \a load_addr is a
/// thumb function and load_addr is in code.
- /// If \a addr_class is set to eAddressClassInvalid, then the address
+ /// If \a addr_class is set to AddressClass::eInvalid, then the address
/// adjustment will always happen. If it is set to an address class
/// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
/// returned.
//------------------------------------------------------------------
lldb::addr_t GetOpcodeLoadAddress(
lldb::addr_t load_addr,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
-
- // Get load_addr as breakable load address for this target.
- // Take a addr and check if for any reason there is a better address than this
- // to put a breakpoint on.
- // If there is then return that address.
- // For MIPS, if instruction at addr is a delay slot instruction then this
- // method will find the address of its
- // previous instruction and return that address.
+ AddressClass addr_class = AddressClass::eInvalid) const;
+
+ // Get load_addr as breakable load address for this target. Take a addr and
+ // check if for any reason there is a better address than this to put a
+ // breakpoint on. If there is then return that address. For MIPS, if
+ // instruction at addr is a delay slot instruction then this method will find
+ // the address of its previous instruction and return that address.
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr);
void ModulesDidLoad(ModuleList &module_list);
@@ -949,7 +938,7 @@ public:
bool MergeArchitecture(const ArchSpec &arch_spec);
- Architecture *GetArchitecturePlugin() { return m_arch.GetPlugin(); }
+ Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
Debugger &GetDebugger() { return m_debugger; }
@@ -957,12 +946,12 @@ public:
Status &error);
// Reading memory through the target allows us to skip going to the process
- // for reading memory if possible and it allows us to try and read from
- // any constant sections in our object files on disk. If you always want
- // live program memory, read straight from the process. If you possibly
- // want to read from const sections in object files, read from the target.
- // This version of ReadMemory will try and read memory from the process
- // if the process is alive. The order is:
+ // for reading memory if possible and it allows us to try and read from any
+ // constant sections in our object files on disk. If you always want live
+ // program memory, read straight from the process. If you possibly want to
+ // read from const sections in object files, read from the target. This
+ // version of ReadMemory will try and read memory from the process if the
+ // process is alive. The order is:
// 1 - if (prefer_file_cache == true) then read from object file cache
// 2 - if there is a valid process, try and read from its memory
// 3 - if (prefer_file_cache == false) then read from object file cache
@@ -993,13 +982,6 @@ public:
return m_section_load_history.GetCurrentSectionLoadList();
}
- // const SectionLoadList&
- // GetSectionLoadList() const
- // {
- // return const_cast<SectionLoadHistory
- // *>(&m_section_load_history)->GetCurrentSectionLoadList();
- // }
-
static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
const SymbolContext *sc_ptr);
@@ -1025,9 +1007,8 @@ public:
PersistentExpressionState *
GetPersistentExpressionStateForLanguage(lldb::LanguageType language);
- // Creates a UserExpression for the given language, the rest of the parameters
- // have the
- // same meaning as for the UserExpression constructor.
+ // Creates a UserExpression for the given language, the rest of the
+ // parameters have the same meaning as for the UserExpression constructor.
// Returns a new-ed object which the caller owns.
UserExpression *GetUserExpressionForLanguage(
@@ -1035,10 +1016,9 @@ public:
Expression::ResultType desired_type,
const EvaluateExpressionOptions &options, Status &error);
- // Creates a FunctionCaller for the given language, the rest of the parameters
- // have the
- // same meaning as for the FunctionCaller constructor. Since a FunctionCaller
- // can't be
+ // Creates a FunctionCaller for the given language, the rest of the
+ // parameters have the same meaning as for the FunctionCaller constructor.
+ // Since a FunctionCaller can't be
// IR Interpreted, it makes no sense to call this with an
// ExecutionContextScope that lacks
// a Process.
@@ -1051,8 +1031,7 @@ public:
const char *name, Status &error);
// Creates a UtilityFunction for the given language, the rest of the
- // parameters have the
- // same meaning as for the UtilityFunction constructor.
+ // parameters have the same meaning as for the UtilityFunction constructor.
// Returns a new-ed object which the caller owns.
UtilityFunction *GetUtilityFunctionForLanguage(const char *expr,
@@ -1065,8 +1044,8 @@ public:
lldb::ClangASTImporterSP GetClangASTImporter();
//----------------------------------------------------------------------
- // Install any files through the platform that need be to installed
- // prior to launching or attaching.
+ // Install any files through the platform that need be to installed prior to
+ // launching or attaching.
//----------------------------------------------------------------------
Status Install(ProcessLaunchInfo *launch_info);
@@ -1091,10 +1070,10 @@ public:
void ClearAllLoadedSections();
// Since expressions results can persist beyond the lifetime of a process,
- // and the const expression results are available after a process is gone,
- // we provide a way for expressions to be evaluated from the Target itself.
- // If an expression is going to be run, then it should have a frame filled
- // in in th execution context.
+ // and the const expression results are available after a process is gone, we
+ // provide a way for expressions to be evaluated from the Target itself. If
+ // an expression is going to be run, then it should have a frame filled in in
+ // th execution context.
lldb::ExpressionResults EvaluateExpression(
llvm::StringRef expression, ExecutionContextScope *exe_scope,
lldb::ValueObjectSP &result_valobj_sp,
@@ -1103,6 +1082,11 @@ public:
lldb::ExpressionVariableSP GetPersistentVariable(const ConstString &name);
+ /// Return the next available number for numbered persistent variables.
+ unsigned GetNextPersistentVariableIndex() {
+ return m_next_persistent_variable_index++;
+ }
+
lldb::addr_t GetPersistentSymbol(const ConstString &name);
//------------------------------------------------------------------
@@ -1148,17 +1132,15 @@ public:
bool m_active;
// Use CreateStopHook to make a new empty stop hook. The GetCommandPointer
- // and fill it with commands,
- // and SetSpecifier to set the specifier shared pointer (can be null, that
- // will match anything.)
+ // and fill it with commands, and SetSpecifier to set the specifier shared
+ // pointer (can be null, that will match anything.)
StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
friend class Target;
};
typedef std::shared_ptr<StopHook> StopHookSP;
- // Add an empty stop hook to the Target's stop hook list, and returns a shared
- // pointer to it in new_hook.
- // Returns the id of the new hook.
+ // Add an empty stop hook to the Target's stop hook list, and returns a
+ // shared pointer to it in new_hook. Returns the id of the new hook.
StopHookSP CreateStopHook();
void RunStopHooks();
@@ -1173,9 +1155,6 @@ public:
bool GetSuppressStopHooks() { return m_suppress_stop_hooks; }
- // StopHookSP &
- // GetStopHookByIndex (size_t index);
- //
bool RemoveStopHookByID(lldb::user_id_t uid);
void RemoveAllStopHooks();
@@ -1275,9 +1254,9 @@ protected:
lldb::BreakpointSP m_last_created_breakpoint;
WatchpointList m_watchpoint_list;
lldb::WatchpointSP m_last_created_watchpoint;
- // We want to tightly control the process destruction process so
- // we can correctly tear down everything that we need to, so the only
- // class that knows about the process lifespan is this target class.
+ // We want to tightly control the process destruction process so we can
+ // correctly tear down everything that we need to, so the only class that
+ // knows about the process lifespan is this target class.
lldb::ProcessSP m_process_sp;
lldb::SearchFilterSP m_search_filter_sp;
PathMappingList m_image_search_paths;
@@ -1297,10 +1276,33 @@ protected:
bool m_valid;
bool m_suppress_stop_hooks;
bool m_is_dummy_target;
+ unsigned m_next_persistent_variable_index = 0;
static void ImageSearchPathsChanged(const PathMappingList &path_list,
void *baton);
+ //------------------------------------------------------------------
+ // Utilities for `statistics` command.
+ //------------------------------------------------------------------
+private:
+ std::vector<uint32_t> m_stats_storage;
+ bool m_collecting_stats = false;
+
+public:
+ void SetCollectingStats(bool v) { m_collecting_stats = v; }
+
+ bool GetCollectingStats() { return m_collecting_stats; }
+
+ void IncrementStats(lldb_private::StatisticKind key) {
+ if (!GetCollectingStats())
+ return;
+ lldbassert(key < lldb_private::StatisticKind::StatisticMax &&
+ "invalid statistics!");
+ m_stats_storage[key] += 1;
+ }
+
+ std::vector<uint32_t> GetStatistics() { return m_stats_storage; }
+
private:
//------------------------------------------------------------------
/// Construct with optional file and arch.
diff --git a/include/lldb/Target/Thread.h b/include/lldb/Target/Thread.h
index 1b0b6ef557e8..9ce73e0cbeff 100644
--- a/include/lldb/Target/Thread.h
+++ b/include/lldb/Target/Thread.h
@@ -214,8 +214,8 @@ public:
// This function is called on all the threads before "ShouldResume" and
// "WillResume" in case a thread needs to change its state before the
- // ThreadList polls all the threads to figure out which ones actually
- // will get to run and how.
+ // ThreadList polls all the threads to figure out which ones actually will
+ // get to run and how.
void SetupForResume();
// Do not override this function, it is for thread plan logic only
@@ -224,8 +224,8 @@ public:
// Override this to do platform specific tasks before resume.
virtual void WillResume(lldb::StateType resume_state) {}
- // This clears generic thread state after a resume. If you subclass this,
- // be sure to call it.
+ // This clears generic thread state after a resume. If you subclass this, be
+ // sure to call it.
virtual void DidResume();
// This notifies the thread when a private stop occurs.
@@ -244,14 +244,10 @@ public:
void Flush();
// Return whether this thread matches the specification in ThreadSpec. This
- // is a virtual
- // method because at some point we may extend the thread spec with a platform
- // specific
- // dictionary of attributes, which then only the platform specific Thread
- // implementation
- // would know how to match. For now, this just calls through to the
- // ThreadSpec's
- // ThreadPassesBasicTests method.
+ // is a virtual method because at some point we may extend the thread spec
+ // with a platform specific dictionary of attributes, which then only the
+ // platform specific Thread implementation would know how to match. For now,
+ // this just calls through to the ThreadSpec's ThreadPassesBasicTests method.
virtual bool MatchesSpec(const ThreadSpec *spec);
lldb::StopInfoSP GetStopInfo();
@@ -261,9 +257,8 @@ public:
bool StopInfoIsUpToDate() const;
// This sets the stop reason to a "blank" stop reason, so you can call
- // functions on the thread
- // without having the called function run with whatever stop reason you
- // stopped with.
+ // functions on the thread without having the called function run with
+ // whatever stop reason you stopped with.
void SetStopInfoToNothing();
bool ThreadStoppedForAReason();
@@ -492,16 +487,15 @@ public:
virtual void ClearBackingThread() {
// Subclasses can use this function if a thread is actually backed by
// another thread. This is currently used for the OperatingSystem plug-ins
- // where they might have a thread that is in memory, yet its registers
- // are available through the lldb_private::Thread subclass for the current
+ // where they might have a thread that is in memory, yet its registers are
+ // available through the lldb_private::Thread subclass for the current
// lldb_private::Process class. Since each time the process stops the
- // backing
- // threads for memory threads can change, we need a way to clear the backing
- // thread for all memory threads each time we stop.
+ // backing threads for memory threads can change, we need a way to clear
+ // the backing thread for all memory threads each time we stop.
}
- // If stop_format is true, this will be the form used when we print stop info.
- // If false, it will be the form we use for thread list and co.
+ // If stop_format is true, this will be the form used when we print stop
+ // info. If false, it will be the form we use for thread list and co.
void DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx,
bool stop_format);
@@ -607,30 +601,24 @@ public:
// Thread Plan Providers:
// This section provides the basic thread plans that the Process control
// machinery uses to run the target. ThreadPlan.h provides more details on
- // how this mechanism works.
- // The thread provides accessors to a set of plans that perform basic
- // operations.
- // The idea is that particular Platform plugins can override these methods to
- // provide the implementation of these basic operations appropriate to their
- // environment.
+ // how this mechanism works. The thread provides accessors to a set of plans
+ // that perform basic operations. The idea is that particular Platform
+ // plugins can override these methods to provide the implementation of these
+ // basic operations appropriate to their environment.
//
// NB: All the QueueThreadPlanXXX providers return Shared Pointers to
// Thread plans. This is useful so that you can modify the plans after
// creation in ways specific to that plan type. Also, it is often necessary
- // for
- // ThreadPlans that utilize other ThreadPlans to implement their task to keep
- // a shared
- // pointer to the sub-plan.
- // But besides that, the shared pointers should only be held onto by entities
- // who live no longer
- // than the thread containing the ThreadPlan.
+ // for ThreadPlans that utilize other ThreadPlans to implement their task to
+ // keep a shared pointer to the sub-plan. But besides that, the shared
+ // pointers should only be held onto by entities who live no longer than the
+ // thread containing the ThreadPlan.
// FIXME: If this becomes a problem, we can make a version that just returns a
// pointer,
// which it is clearly unsafe to hold onto, and a shared pointer version, and
- // only allow
- // ThreadPlan and Co. to use the latter. That is made more annoying to do
- // because there's
- // no elegant way to friend a method to all sub-classes of a given class.
+ // only allow ThreadPlan and Co. to use the latter. That is made more
+ // annoying to do because there's no elegant way to friend a method to all
+ // sub-classes of a given class.
//
//------------------------------------------------------------------
@@ -717,9 +705,8 @@ public:
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
// Helper function that takes a LineEntry to step, insted of an AddressRange.
- // This may combine multiple
- // LineEntries of the same source line number to step over a longer address
- // range in a single operation.
+ // This may combine multiple LineEntries of the same source line number to
+ // step over a longer address range in a single operation.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange(
bool abort_other_plans, const LineEntry &line_entry,
const SymbolContext &addr_context, lldb::RunMode stop_other_threads,
@@ -779,9 +766,8 @@ public:
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
// Helper function that takes a LineEntry to step, insted of an AddressRange.
- // This may combine multiple
- // LineEntries of the same source line number to step over a longer address
- // range in a single operation.
+ // This may combine multiple LineEntries of the same source line number to
+ // step over a longer address range in a single operation.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange(
bool abort_other_plans, const LineEntry &line_entry,
const SymbolContext &addr_context, const char *step_in_target,
@@ -1115,23 +1101,22 @@ public:
void SetTracer(lldb::ThreadPlanTracerSP &tracer_sp);
//------------------------------------------------------------------
- // Get the thread index ID. The index ID that is guaranteed to not
- // be re-used by a process. They start at 1 and increase with each
- // new thread. This allows easy command line access by a unique ID
- // that is easier to type than the actual system thread ID.
+ // Get the thread index ID. The index ID that is guaranteed to not be re-used
+ // by a process. They start at 1 and increase with each new thread. This
+ // allows easy command line access by a unique ID that is easier to type than
+ // the actual system thread ID.
//------------------------------------------------------------------
uint32_t GetIndexID() const;
//------------------------------------------------------------------
// Get the originating thread's index ID.
- // In the case of an "extended" thread -- a thread which represents
- // the stack that enqueued/spawned work that is currently executing --
- // we need to provide the IndexID of the thread that actually did
- // this work. We don't want to just masquerade as that thread's IndexID
- // by using it in our own IndexID because that way leads to madness -
- // but the driver program which is iterating over extended threads
- // may ask for the OriginatingThreadID to display that information
- // to the user.
+ // In the case of an "extended" thread -- a thread which represents the stack
+ // that enqueued/spawned work that is currently executing -- we need to
+ // provide the IndexID of the thread that actually did this work. We don't
+ // want to just masquerade as that thread's IndexID by using it in our own
+ // IndexID because that way leads to madness - but the driver program which
+ // is iterating over extended threads may ask for the OriginatingThreadID to
+ // display that information to the user.
// Normal threads will return the same thing as GetIndexID();
//------------------------------------------------------------------
virtual uint32_t GetExtendedBacktraceOriginatingIndexID() {
@@ -1139,10 +1124,10 @@ public:
}
//------------------------------------------------------------------
- // The API ID is often the same as the Thread::GetID(), but not in
- // all cases. Thread::GetID() is the user visible thread ID that
- // clients would want to see. The API thread ID is the thread ID
- // that is used when sending data to/from the debugging protocol.
+ // The API ID is often the same as the Thread::GetID(), but not in all cases.
+ // Thread::GetID() is the user visible thread ID that clients would want to
+ // see. The API thread ID is the thread ID that is used when sending data
+ // to/from the debugging protocol.
//------------------------------------------------------------------
virtual lldb::user_id_t GetProtocolID() const { return GetID(); }
@@ -1171,9 +1156,9 @@ public:
uint32_t num_frames_with_source);
// We need a way to verify that even though we have a thread in a shared
- // pointer that the object itself is still valid. Currently this won't be
- // the case if DestroyThread() was called. DestroyThread is called when
- // a thread has been removed from the Process' thread list.
+ // pointer that the object itself is still valid. Currently this won't be the
+ // case if DestroyThread() was called. DestroyThread is called when a thread
+ // has been removed from the Process' thread list.
bool IsValid() const { return !m_destroy_called; }
// Sets and returns a valid stop info based on the process stop ID and the
@@ -1194,8 +1179,8 @@ public:
//----------------------------------------------------------------------
// Ask the thread subclass to set its stop info.
//
- // Thread subclasses should call Thread::SetStopInfo(...) with the
- // reason the thread stopped.
+ // Thread subclasses should call Thread::SetStopInfo(...) with the reason the
+ // thread stopped.
//
// @return
// True if Thread::SetStopInfo(...) was called, false otherwise.
@@ -1206,10 +1191,10 @@ public:
// Gets the temporary resume state for a thread.
//
// This value gets set in each thread by complex debugger logic in
- // Thread::ShouldResume() and an appropriate thread resume state will get
- // set in each thread every time the process is resumed prior to calling
- // Process::DoResume(). The lldb_private::Process subclass should adhere
- // to the thread resume state request which will be one of:
+ // Thread::ShouldResume() and an appropriate thread resume state will get set
+ // in each thread every time the process is resumed prior to calling
+ // Process::DoResume(). The lldb_private::Process subclass should adhere to
+ // the thread resume state request which will be one of:
//
// eStateRunning - thread will resume when process is resumed
// eStateStepping - thread should step 1 instruction and stop when process
@@ -1257,10 +1242,9 @@ protected:
friend class StackFrame;
friend class OperatingSystem;
- // This is necessary to make sure thread assets get destroyed while the thread
- // is still in good shape
- // to call virtual thread methods. This must be called by classes that derive
- // from Thread in their destructor.
+ // This is necessary to make sure thread assets get destroyed while the
+ // thread is still in good shape to call virtual thread methods. This must
+ // be called by classes that derive from Thread in their destructor.
virtual void DestroyThread();
void PushPlan(lldb::ThreadPlanSP &plan_sp);
@@ -1286,8 +1270,7 @@ protected:
virtual bool IsOperatingSystemPluginThread() const { return false; }
// Subclasses that have a way to get an extended info dictionary for this
- // thread should
- // fill
+ // thread should fill
virtual lldb_private::StructuredData::ObjectSP FetchThreadExtendedInfo() {
return StructuredData::ObjectSP();
}
@@ -1307,7 +1290,8 @@ protected:
lldb::StopInfoSP m_stop_info_sp; ///< The private stop reason for this thread
uint32_t m_stop_info_stop_id; // This is the stop id for which the StopInfo is
// valid. Can use this so you know that
- // the thread's m_stop_info_sp is current and you don't have to fetch it again
+ // the thread's m_stop_info_sp is current and you don't have to fetch it
+ // again
uint32_t m_stop_info_override_stop_id; // The stop ID containing the last time
// the stop info was checked against
// the stop info override
diff --git a/include/lldb/Target/ThreadCollection.h b/include/lldb/Target/ThreadCollection.h
index e3965b57e7a6..dd5e81c1af48 100644
--- a/include/lldb/Target/ThreadCollection.h
+++ b/include/lldb/Target/ThreadCollection.h
@@ -39,9 +39,9 @@ public:
void InsertThread(const lldb::ThreadSP &thread_sp, uint32_t idx);
- // Note that "idx" is not the same as the "thread_index". It is a zero
- // based index to accessing the current threads, whereas "thread_index"
- // is a unique index assigned
+ // Note that "idx" is not the same as the "thread_index". It is a zero based
+ // index to accessing the current threads, whereas "thread_index" is a unique
+ // index assigned
lldb::ThreadSP GetThreadAtIndex(uint32_t idx);
virtual ThreadIterable Threads() {
diff --git a/include/lldb/Target/ThreadList.h b/include/lldb/Target/ThreadList.h
index 2ebcd0b0e2c9..6285cb1e0fb4 100644
--- a/include/lldb/Target/ThreadList.h
+++ b/include/lldb/Target/ThreadList.h
@@ -43,9 +43,8 @@ public:
lldb::ThreadSP GetSelectedThread();
// Manage the thread to use for running expressions. This is usually the
- // Selected thread,
- // but sometimes (e.g. when evaluating breakpoint conditions & stop hooks) it
- // isn't.
+ // Selected thread, but sometimes (e.g. when evaluating breakpoint conditions
+ // & stop hooks) it isn't.
class ExpressionExecutionThreadPusher {
public:
ExpressionExecutionThreadPusher(ThreadList &thread_list, lldb::tid_t tid)
@@ -83,9 +82,9 @@ public:
void Destroy();
- // Note that "idx" is not the same as the "thread_index". It is a zero
- // based index to accessing the current threads, whereas "thread_index"
- // is a unique index assigned
+ // Note that "idx" is not the same as the "thread_index". It is a zero based
+ // index to accessing the current threads, whereas "thread_index" is a unique
+ // index assigned
lldb::ThreadSP GetThreadAtIndex(uint32_t idx, bool can_update = true);
lldb::ThreadSP FindThreadByID(lldb::tid_t tid, bool can_update = true);
@@ -102,6 +101,8 @@ public:
lldb::ThreadSP GetThreadSPForThreadPtr(Thread *thread_ptr);
+ lldb::ThreadSP GetBackingThread(const lldb::ThreadSP &real_thread);
+
bool ShouldStop(Event *event_ptr);
Vote ShouldReportStop(Event *event_ptr);
diff --git a/include/lldb/Target/ThreadPlan.h b/include/lldb/Target/ThreadPlan.h
index acc63ffe562b..7591fa9c9d07 100644
--- a/include/lldb/Target/ThreadPlan.h
+++ b/include/lldb/Target/ThreadPlan.h
@@ -340,9 +340,8 @@ class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
public:
typedef enum { eAllThreads, eSomeThreads, eThisThread } ThreadScope;
- // We use these enums so that we can cast a base thread plan to it's real type
- // without having to resort
- // to dynamic casting.
+ // We use these enums so that we can cast a base thread plan to it's real
+ // type without having to resort to dynamic casting.
typedef enum {
eKindGeneric,
eKindNull,
@@ -432,9 +431,8 @@ public:
virtual bool ShouldAutoContinue(Event *event_ptr) { return false; }
- // Whether a "stop class" event should be reported to the "outside world". In
- // general
- // if a thread plan is active, events should not be reported.
+ // Whether a "stop class" event should be reported to the "outside world".
+ // In general if a thread plan is active, events should not be reported.
virtual Vote ShouldReportStop(Event *event_ptr);
@@ -445,8 +443,7 @@ public:
virtual bool StopOthers();
// This is the wrapper for DoWillResume that does generic ThreadPlan logic,
- // then
- // calls DoWillResume.
+ // then calls DoWillResume.
bool WillResume(lldb::StateType resume_state, bool current_plan);
virtual bool WillStop() = 0;
@@ -468,8 +465,8 @@ public:
virtual bool MischiefManaged();
virtual void ThreadDestroyed() {
- // Any cleanup that a plan might want to do in case the thread goes away
- // in the middle of the plan being queued on a thread can be done here.
+ // Any cleanup that a plan might want to do in case the thread goes away in
+ // the middle of the plan being queued on a thread can be done here.
}
bool GetPrivate() { return m_plan_private; }
@@ -509,39 +506,35 @@ public:
}
// Some thread plans hide away the actual stop info which caused any
- // particular stop. For
- // instance the ThreadPlanCallFunction restores the original stop reason so
- // that stopping and
- // calling a few functions won't lose the history of the run.
- // This call can be implemented to get you back to the real stop info.
+ // particular stop. For instance the ThreadPlanCallFunction restores the
+ // original stop reason so that stopping and calling a few functions won't
+ // lose the history of the run. This call can be implemented to get you back
+ // to the real stop info.
virtual lldb::StopInfoSP GetRealStopInfo() { return m_thread.GetStopInfo(); }
// If the completion of the thread plan stepped out of a function, the return
- // value of the function
- // might have been captured by the thread plan (currently only
- // ThreadPlanStepOut does this.)
- // If so, the ReturnValueObject can be retrieved from here.
+ // value of the function might have been captured by the thread plan
+ // (currently only ThreadPlanStepOut does this.) If so, the ReturnValueObject
+ // can be retrieved from here.
virtual lldb::ValueObjectSP GetReturnValueObject() {
return lldb::ValueObjectSP();
}
// If the thread plan managing the evaluation of a user expression lives
- // longer than the command
- // that instigated the expression (generally because the expression evaluation
- // hit a breakpoint, and
- // the user regained control at that point) a subsequent process control
- // command step/continue/etc. might
- // complete the expression evaluations. If so, the result of the expression
- // evaluation will show up here.
+ // longer than the command that instigated the expression (generally because
+ // the expression evaluation hit a breakpoint, and the user regained control
+ // at that point) a subsequent process control command step/continue/etc.
+ // might complete the expression evaluations. If so, the result of the
+ // expression evaluation will show up here.
virtual lldb::ExpressionVariableSP GetExpressionVariable() {
return lldb::ExpressionVariableSP();
}
- // If a thread plan stores the state before it was run, then you might
- // want to restore the state when it is done. This will do that job.
- // This is mostly useful for artificial plans like CallFunction plans.
+ // If a thread plan stores the state before it was run, then you might want
+ // to restore the state when it is done. This will do that job. This is
+ // mostly useful for artificial plans like CallFunction plans.
virtual bool RestoreThreadState() {
// Nothing to do in general.
@@ -585,8 +578,7 @@ protected:
ThreadPlan *GetPreviousPlan() { return m_thread.GetPreviousPlan(this); }
// This forwards the private Thread::GetPrivateStopInfo which is generally
- // what
- // ThreadPlan's need to know.
+ // what ThreadPlan's need to know.
lldb::StopInfoSP GetPrivateStopInfo() {
return m_thread.GetPrivateStopInfo();
@@ -638,10 +630,10 @@ private:
//----------------------------------------------------------------------
// ThreadPlanNull:
-// Threads are assumed to always have at least one plan on the plan stack.
-// This is put on the plan stack when a thread is destroyed so that if you
-// accidentally access a thread after it is destroyed you won't crash.
-// But asking questions of the ThreadPlanNull is definitely an error.
+// Threads are assumed to always have at least one plan on the plan stack. This
+// is put on the plan stack when a thread is destroyed so that if you
+// accidentally access a thread after it is destroyed you won't crash. But
+// asking questions of the ThreadPlanNull is definitely an error.
//----------------------------------------------------------------------
class ThreadPlanNull : public ThreadPlan {
diff --git a/include/lldb/Target/ThreadPlanCallFunction.h b/include/lldb/Target/ThreadPlanCallFunction.h
index 1c75b0a3645c..56bfc819320c 100644
--- a/include/lldb/Target/ThreadPlanCallFunction.h
+++ b/include/lldb/Target/ThreadPlanCallFunction.h
@@ -24,9 +24,8 @@ namespace lldb_private {
class ThreadPlanCallFunction : public ThreadPlan {
// Create a thread plan to call a function at the address passed in the
- // "function"
- // argument. If you plan to call GetReturnValueObject, then pass in the
- // return type, otherwise just pass in an invalid CompilerType.
+ // "function" argument. If you plan to call GetReturnValueObject, then pass
+ // in the return type, otherwise just pass in an invalid CompilerType.
public:
ThreadPlanCallFunction(Thread &thread, const Address &function,
const CompilerType &return_type,
@@ -69,27 +68,23 @@ public:
return m_return_valobj_sp;
}
- // Return the stack pointer that the function received
- // on entry. Any stack address below this should be
- // considered invalid after the function has been
- // cleaned up.
+ // Return the stack pointer that the function received on entry. Any stack
+ // address below this should be considered invalid after the function has
+ // been cleaned up.
lldb::addr_t GetFunctionStackPointer() { return m_function_sp; }
- // Classes that derive from FunctionCaller, and implement
- // their own WillPop methods should call this so that the
- // thread state gets restored if the plan gets discarded.
+ // Classes that derive from FunctionCaller, and implement their own WillPop
+ // methods should call this so that the thread state gets restored if the
+ // plan gets discarded.
void WillPop() override;
// If the thread plan stops mid-course, this will be the stop reason that
- // interrupted us.
- // Once DoTakedown is called, this will be the real stop reason at the end of
- // the function call.
- // If it hasn't been set for one or the other of these reasons, we'll return
- // the PrivateStopReason.
- // This is needed because we want the CallFunction thread plans not to show up
- // as the stop reason.
- // But if something bad goes wrong, it is nice to be able to tell the user
- // what really happened.
+ // interrupted us. Once DoTakedown is called, this will be the real stop
+ // reason at the end of the function call. If it hasn't been set for one or
+ // the other of these reasons, we'll return the PrivateStopReason. This is
+ // needed because we want the CallFunction thread plans not to show up as the
+ // stop reason. But if something bad goes wrong, it is nice to be able to
+ // tell the user what really happened.
lldb::StopInfoSP GetRealStopInfo() override {
if (m_real_stop_info_sp)
@@ -140,9 +135,9 @@ protected:
Thread::ThreadStateCheckpoint m_stored_thread_state;
lldb::StopInfoSP
m_real_stop_info_sp; // In general we want to hide call function
- // thread plans, but for reporting purposes,
- // it's nice to know the real stop reason.
- // This gets set in DoTakedown.
+ // thread plans, but for reporting purposes, it's
+ // nice to know the real stop reason. This gets set
+ // in DoTakedown.
StreamString m_constructor_errors;
lldb::ValueObjectSP m_return_valobj_sp; // If this contains a valid pointer,
// use the ABI to extract values when
diff --git a/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h b/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
index 1c67ddd5cdda..d58f7f050dbe 100644
--- a/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
+++ b/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
@@ -27,11 +27,9 @@ namespace lldb_private {
class ThreadPlanCallFunctionUsingABI : public ThreadPlanCallFunction {
// Create a thread plan to call a function at the address passed in the
- // "function"
- // argument, this function is executed using register manipulation instead of
- // JIT.
- // Class derives from ThreadPlanCallFunction and differs by calling a
- // alternative
+ // "function" argument, this function is executed using register manipulation
+ // instead of JIT. Class derives from ThreadPlanCallFunction and differs by
+ // calling a alternative
// ABI interface ABI::PrepareTrivialCall() which provides more detailed
// information.
public:
diff --git a/include/lldb/Target/ThreadPlanShouldStopHere.h b/include/lldb/Target/ThreadPlanShouldStopHere.h
index 60c0e3866707..030d5e434bd9 100644
--- a/include/lldb/Target/ThreadPlanShouldStopHere.h
+++ b/include/lldb/Target/ThreadPlanShouldStopHere.h
@@ -19,20 +19,16 @@
namespace lldb_private {
// This is an interface that ThreadPlans can adopt to allow flexible
-// modifications of the behavior
-// when a thread plan comes to a place where it would ordinarily stop. If such
-// modification makes
-// sense for your plan, inherit from this class, and when you would be about to
-// stop (in your ShouldStop
-// method), call InvokeShouldStopHereCallback, passing in the frame comparison
-// between where the step operation
-// started and where you arrived. If it returns true, then QueueStepOutFromHere
-// will queue the plan
-// to execute instead of stopping.
+// modifications of the behavior when a thread plan comes to a place where it
+// would ordinarily stop. If such modification makes sense for your plan,
+// inherit from this class, and when you would be about to stop (in your
+// ShouldStop method), call InvokeShouldStopHereCallback, passing in the frame
+// comparison between where the step operation started and where you arrived.
+// If it returns true, then QueueStepOutFromHere will queue the plan to execute
+// instead of stopping.
//
// The classic example of the use of this is ThreadPlanStepInRange not stopping
-// in frames that have
-// no debug information.
+// in frames that have no debug information.
//
// This class also defines a set of flags to control general aspects of this
// "ShouldStop" behavior.
@@ -82,11 +78,9 @@ public:
virtual ~ThreadPlanShouldStopHere();
// Set the ShouldStopHere callbacks. Pass in null to clear them and have no
- // special behavior (though you
- // can also call ClearShouldStopHereCallbacks for that purpose. If you pass
- // in a valid pointer, it will
- // adopt the non-null fields, and any null fields will be set to the default
- // values.
+ // special behavior (though you can also call ClearShouldStopHereCallbacks
+ // for that purpose. If you pass in a valid pointer, it will adopt the non-
+ // null fields, and any null fields will be set to the default values.
void
SetShouldStopHereCallbacks(const ThreadPlanShouldStopHereCallbacks *callbacks,
diff --git a/include/lldb/Target/ThreadPlanStepOverBreakpoint.h b/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
index 969c008f67d1..e799ec5a44ff 100644
--- a/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
+++ b/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
@@ -31,6 +31,7 @@ public:
bool StopOthers() override;
lldb::StateType GetPlanRunState() override;
bool WillStop() override;
+ void WillPop() override;
bool MischiefManaged() override;
void ThreadDestroyed() override;
void SetAutoContinue(bool do_it);
diff --git a/include/lldb/Target/ThreadPlanStepRange.h b/include/lldb/Target/ThreadPlanStepRange.h
index ffb27d02e2d0..65bc1671cb1e 100644
--- a/include/lldb/Target/ThreadPlanStepRange.h
+++ b/include/lldb/Target/ThreadPlanStepRange.h
@@ -58,10 +58,9 @@ protected:
size_t &insn_offset);
// Pushes a plan to proceed through the next section of instructions in the
- // range - usually just a RunToAddress
- // plan to run to the next branch. Returns true if it pushed such a plan. If
- // there was no available 'quick run'
- // plan, then just single step.
+ // range - usually just a RunToAddress plan to run to the next branch.
+ // Returns true if it pushed such a plan. If there was no available 'quick
+ // run' plan, then just single step.
bool SetNextBranchBreakpoint();
void ClearNextBranchBreakpoint();
diff --git a/include/lldb/Target/UnixSignals.h b/include/lldb/Target/UnixSignals.h
index a209f3549aed..7ec683585f8e 100644
--- a/include/lldb/Target/UnixSignals.h
+++ b/include/lldb/Target/UnixSignals.h
@@ -63,8 +63,7 @@ public:
// These provide an iterator through the signals available on this system.
// Call GetFirstSignalNumber to get the first entry, then iterate on
- // GetNextSignalNumber
- // till you get back LLDB_INVALID_SIGNAL_NUMBER.
+ // GetNextSignalNumber till you get back LLDB_INVALID_SIGNAL_NUMBER.
int32_t GetFirstSignalNumber() const;
int32_t GetNextSignalNumber(int32_t current_signal) const;
@@ -76,13 +75,10 @@ public:
ConstString GetShortName(ConstString name) const;
// We assume that the elements of this object are constant once it is
- // constructed,
- // since a process should never need to add or remove symbols as it runs. So
- // don't
- // call these functions anywhere but the constructor of your subclass of
- // UnixSignals or in
- // your Process Plugin's GetUnixSignals method before you return the
- // UnixSignal object.
+ // constructed, since a process should never need to add or remove symbols as
+ // it runs. So don't call these functions anywhere but the constructor of
+ // your subclass of UnixSignals or in your Process Plugin's GetUnixSignals
+ // method before you return the UnixSignal object.
void AddSignal(int signo, const char *name, bool default_suppress,
bool default_stop, bool default_notify,
@@ -90,15 +86,14 @@ public:
void RemoveSignal(int signo);
- // Returns a current version of the data stored in this class.
- // Version gets incremented each time Set... method is called.
+ // Returns a current version of the data stored in this class. Version gets
+ // incremented each time Set... method is called.
uint64_t GetVersion() const;
- // Returns a vector of signals that meet criteria provided in arguments.
- // Each should_[suppress|stop|notify] flag can be
- // None - no filtering by this flag
- // true - only signals that have it set to true are returned
- // false - only signals that have it set to true are returned
+ // Returns a vector of signals that meet criteria provided in arguments. Each
+ // should_[suppress|stop|notify] flag can be None - no filtering by this
+ // flag true - only signals that have it set to true are returned false -
+ // only signals that have it set to true are returned
std::vector<int32_t> GetFilteredSignals(llvm::Optional<bool> should_suppress,
llvm::Optional<bool> should_stop,
llvm::Optional<bool> should_notify);
@@ -126,10 +121,10 @@ protected:
collection m_signals;
- // This version gets incremented every time something is changing in
- // this class, including when we call AddSignal from the constructor.
- // So after the object is constructed m_version is going to be > 0
- // if it has at least one signal registered in it.
+ // This version gets incremented every time something is changing in this
+ // class, including when we call AddSignal from the constructor. So after the
+ // object is constructed m_version is going to be > 0 if it has at least one
+ // signal registered in it.
uint64_t m_version = 0;
// GDBRemote signals need to be copyable.