aboutsummaryrefslogtreecommitdiffstats
path: root/include/lldb/Target
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2014-02-18 16:23:10 +0000
committerEd Maste <emaste@FreeBSD.org>2014-02-18 16:23:10 +0000
commit866dcdacfe59f5f448e008fe2c4cb9dfcf72b2ec (patch)
tree95cb16075f0af1b3a05b9b84eb18dda8e6c903e9 /include/lldb/Target
parentde889deb2c386f2a7831befaf226e5c86685fa53 (diff)
downloadsrc-866dcdacfe59f5f448e008fe2c4cb9dfcf72b2ec.tar.gz
src-866dcdacfe59f5f448e008fe2c4cb9dfcf72b2ec.zip
Import lldb as of SVN r201577 (git 2bdc2f6)vendor/lldb/lldb-r201577
(A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/vendor/lldb/dist/; revision=262182 svn path=/vendor/lldb/lldb-r201577/; revision=262183; tag=vendor/lldb/lldb-r201577
Diffstat (limited to 'include/lldb/Target')
-rw-r--r--include/lldb/Target/DynamicLoader.h54
-rw-r--r--include/lldb/Target/ExecutionContext.h4
-rw-r--r--include/lldb/Target/Platform.h49
-rw-r--r--include/lldb/Target/Process.h149
-rw-r--r--include/lldb/Target/Queue.h189
-rw-r--r--include/lldb/Target/QueueItem.h244
-rw-r--r--include/lldb/Target/QueueList.h141
-rw-r--r--include/lldb/Target/SectionLoadHistory.h109
-rw-r--r--include/lldb/Target/SectionLoadList.h8
-rw-r--r--include/lldb/Target/SystemRuntime.h112
-rw-r--r--include/lldb/Target/Target.h60
-rw-r--r--include/lldb/Target/Thread.h52
-rw-r--r--include/lldb/Target/ThreadList.h2
-rw-r--r--include/lldb/Target/ThreadPlanStepInRange.h2
-rw-r--r--include/lldb/Target/UnwindAssembly.h3
15 files changed, 1114 insertions, 64 deletions
diff --git a/include/lldb/Target/DynamicLoader.h b/include/lldb/Target/DynamicLoader.h
index 272f64f33113..6652a5ec144f 100644
--- a/include/lldb/Target/DynamicLoader.h
+++ b/include/lldb/Target/DynamicLoader.h
@@ -246,6 +246,60 @@ public:
protected:
//------------------------------------------------------------------
+ // Utility methods for derived classes
+ //------------------------------------------------------------------
+
+ /// Checks to see if the target module has changed, updates the target
+ /// accordingly and returns the target executable module.
+ lldb::ModuleSP
+ GetTargetExecutable();
+
+ /// Updates the load address of every allocatable section in @p module.
+ ///
+ /// @param module The module to traverse.
+ ///
+ /// @param link_map_addr The virtual address of the link map for the @p module.
+ ///
+ /// @param base_addr The virtual base address @p module is loaded at.
+ virtual void
+ UpdateLoadedSections(lldb::ModuleSP module,
+ lldb::addr_t link_map_addr,
+ lldb::addr_t base_addr);
+
+ // Utility method so base classes can share implementation of UpdateLoadedSections
+ void
+ UpdateLoadedSectionsCommon(lldb::ModuleSP module,
+ lldb::addr_t base_addr);
+
+ /// Removes the loaded sections from the target in @p module.
+ ///
+ /// @param module The module to traverse.
+ virtual void
+ UnloadSections(const lldb::ModuleSP module);
+
+ // Utility method so base classes can share implementation of UnloadSections
+ void
+ UnloadSectionsCommon(const lldb::ModuleSP module);
+
+ /// Locates or creates a module given by @p file and updates/loads the
+ /// resulting module at the virtual base address @p base_addr.
+ lldb::ModuleSP
+ LoadModuleAtAddress(const lldb_private::FileSpec &file, lldb::addr_t link_map_addr, lldb::addr_t base_addr);
+
+ const lldb_private::SectionList *
+ GetSectionListFromModule(const lldb::ModuleSP module) const;
+
+ // Read an unsigned int of the given size from memory at the given addr.
+ // 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.
+ lldb::addr_t
+ ReadPointer(lldb::addr_t addr);
+
+ //------------------------------------------------------------------
// Member variables.
//------------------------------------------------------------------
Process* m_process; ///< The process that this dynamic loader plug-in is tracking.
diff --git a/include/lldb/Target/ExecutionContext.h b/include/lldb/Target/ExecutionContext.h
index 4038e70b0c56..f825c2e72e6d 100644
--- a/include/lldb/Target/ExecutionContext.h
+++ b/include/lldb/Target/ExecutionContext.h
@@ -298,7 +298,7 @@ public:
/// any valid weak references in this object.
//------------------------------------------------------------------
ExecutionContext
- Lock () const;
+ Lock (bool thread_and_frame_only_if_stopped) const;
//------------------------------------------------------------------
/// Returns true if this object has a weak reference to a thread.
@@ -402,7 +402,7 @@ public:
ExecutionContext (const lldb::ThreadWP &thread_wp);
ExecutionContext (const lldb::StackFrameWP &frame_wp);
ExecutionContext (const ExecutionContextRef &exe_ctx_ref);
- ExecutionContext (const ExecutionContextRef *exe_ctx_ref);
+ ExecutionContext (const ExecutionContextRef *exe_ctx_ref, 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.
diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h
index 355c0528bed8..80011fd120de 100644
--- a/include/lldb/Target/Platform.h
+++ b/include/lldb/Target/Platform.h
@@ -314,9 +314,9 @@ namespace lldb_private {
/// An error object.
//------------------------------------------------------------------
virtual Error
- GetFile (const FileSpec &platform_file,
- const UUID *uuid_ptr,
- FileSpec &local_file);
+ GetFileWithUUID (const FileSpec &platform_file,
+ const UUID *uuid_ptr,
+ FileSpec &local_file);
//----------------------------------------------------------------------
// Locate the scripting resource given a module specification.
@@ -835,6 +835,29 @@ namespace lldb_private {
return LLDB_INVALID_QUEUE_ID;
}
+ //------------------------------------------------------------------
+ /// 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.
+ ///
+ /// In a user process debugging scenario, the list of trap handlers is
+ /// typically just "_sigtramp".
+ ///
+ /// The Platform base class provides the m_trap_handlers ivar but it does
+ /// not populate it. Subclasses should add the names of the asynchronous
+ /// signal handler routines as needed. For most Unix platforms, add _sigtramp.
+ ///
+ /// @return
+ /// A list of symbol names. The list may be empty.
+ //------------------------------------------------------------------
+ virtual const std::vector<ConstString> &
+ GetTrapHandlerSymbolNames ();
+
protected:
bool m_is_host;
// Set to true when we are able to actually set the OS version while
@@ -867,6 +890,24 @@ namespace lldb_private {
std::string m_ssh_opts;
bool m_ignores_remote_hostname;
std::string m_local_cache_directory;
+ std::vector<ConstString> m_trap_handlers;
+ bool m_calculated_trap_handlers;
+
+ //------------------------------------------------------------------
+ /// 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.
+ ///
+ /// 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)
@@ -1115,7 +1156,9 @@ namespace lldb_private {
bool m_ssh;
std::string m_ssh_opts;
+
private:
+
DISALLOW_COPY_AND_ASSIGN(OptionGroupPlatformSSH);
};
diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h
index cda9b4f57118..f52b54da52cf 100644
--- a/include/lldb/Target/Process.h
+++ b/include/lldb/Target/Process.h
@@ -43,6 +43,7 @@
#include "lldb/Interpreter/Options.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/Memory.h"
+#include "lldb/Target/QueueList.h"
#include "lldb/Target/ThreadList.h"
#include "lldb/Target/UnixSignals.h"
#include "lldb/Utility/PseudoTerminal.h"
@@ -534,7 +535,8 @@ public:
m_resume_count (0),
m_monitor_callback (NULL),
m_monitor_callback_baton (NULL),
- m_monitor_signals (false)
+ m_monitor_signals (false),
+ m_hijack_listener_sp ()
{
}
@@ -553,7 +555,8 @@ public:
m_resume_count (0),
m_monitor_callback (NULL),
m_monitor_callback_baton (NULL),
- m_monitor_signals (false)
+ m_monitor_signals (false),
+ m_hijack_listener_sp ()
{
if (stdin_path)
{
@@ -780,6 +783,7 @@ public:
m_flags.Clear();
m_file_actions.clear();
m_resume_count = 0;
+ m_hijack_listener_sp.reset();
}
bool
@@ -799,6 +803,18 @@ public:
m_monitor_signals = monitor_signals;
}
+ Host::MonitorChildProcessCallback
+ GetMonitorProcessCallback ()
+ {
+ return m_monitor_callback;
+ }
+
+ const void*
+ GetMonitorProcessBaton () const
+ {
+ return m_monitor_callback_baton;
+ }
+
bool
MonitorProcess () const
{
@@ -818,6 +834,19 @@ public:
{
return m_pty;
}
+
+ lldb::ListenerSP
+ GetHijackListener () const
+ {
+ return m_hijack_listener_sp;
+ }
+
+ void
+ SetHijackListener (const lldb::ListenerSP &listener_sp)
+ {
+ m_hijack_listener_sp = listener_sp;
+ }
+
protected:
std::string m_working_dir;
@@ -830,7 +859,7 @@ protected:
Host::MonitorChildProcessCallback m_monitor_callback;
void *m_monitor_callback_baton;
bool m_monitor_signals;
-
+ lldb::ListenerSP m_hijack_listener_sp;
};
//----------------------------------------------------------------------
@@ -863,6 +892,7 @@ public:
ProcessInfo::operator= (launch_info);
SetProcessPluginName (launch_info.GetProcessPluginName());
SetResumeCount (launch_info.GetResumeCount());
+ SetHijackListener(launch_info.GetHijackListener());
}
bool
@@ -952,7 +982,22 @@ public:
return true;
return false;
}
+
+ lldb::ListenerSP
+ GetHijackListener () const
+ {
+ return m_hijack_listener_sp;
+ }
+
+ void
+ SetHijackListener (const lldb::ListenerSP &listener_sp)
+ {
+ m_hijack_listener_sp = listener_sp;
+ }
+
+
protected:
+ lldb::ListenerSP m_hijack_listener_sp;
std::string m_plugin_name;
uint32_t m_resume_count; // How many times do we resume after launching
bool m_wait_for_launch;
@@ -1366,10 +1411,11 @@ class Process :
public ExecutionContextScope,
public PluginInterface
{
-friend class ThreadList;
-friend class ClangFunction; // For WaitForStateChangeEventsPrivate
-friend class ProcessEventData;
-friend class StopInfo;
+ friend class ClangFunction; // For WaitForStateChangeEventsPrivate
+ friend class ProcessEventData;
+ friend class StopInfo;
+ friend class Target;
+ friend class ThreadList;
public:
@@ -2112,21 +2158,15 @@ public:
/// @param[in] process_name
/// The name of the process to attach to.
///
- /// @param[in] wait_for_launch
- /// If \b true, wait for the process to be launched and attach
- /// as soon as possible after it does launch. If \b false, then
- /// search for a matching process the currently exists.
- ///
/// @param[in] attach_info
/// Information on how to do the attach. For example, GetUserID()
/// will return the uid to attach as.
///
/// @return
- /// Returns \a pid if attaching was successful, or
- /// LLDB_INVALID_PROCESS_ID if attaching fails.
+ /// Returns an error object.
//------------------------------------------------------------------
virtual Error
- DoAttachToProcessWithName (const char *process_name, bool wait_for_launch, const ProcessAttachInfo &attach_info)
+ DoAttachToProcessWithName (const char *process_name, const ProcessAttachInfo &attach_info)
{
Error error;
error.SetErrorString("attach by name is not supported");
@@ -2225,7 +2265,7 @@ public:
//------------------------------------------------------------------
virtual Error
DoLaunch (Module *exe_module,
- const ProcessLaunchInfo &launch_info)
+ ProcessLaunchInfo &launch_info)
{
Error error;
error.SetErrorStringWithFormat("error: %s does not support launching processes", GetPluginName().GetCString());
@@ -2991,15 +3031,11 @@ public:
//------------------------------------------------------------------
virtual lldb::addr_t
- ResolveIndirectFunction(const Address *address, Error &error)
- {
- error.SetErrorStringWithFormat("error: %s does not support indirect functions in the debug process", GetPluginName().GetCString());
- return LLDB_INVALID_ADDRESS;
- }
+ ResolveIndirectFunction(const Address *address, Error &error);
virtual Error
- GetMemoryRegionInfo (lldb::addr_t load_addr,
- MemoryRegionInfo &range_info)
+ GetMemoryRegionInfo (lldb::addr_t load_addr,
+ MemoryRegionInfo &range_info)
{
Error error;
error.SetErrorString ("Process::GetMemoryRegionInfo() not supported");
@@ -3317,10 +3353,10 @@ public:
{
return m_thread_list.Threads();
}
-
+
uint32_t
GetNextThreadIndexID (uint64_t thread_id);
-
+
lldb::ThreadSP
CreateOSPluginThread (lldb::tid_t tid, lldb::addr_t context);
@@ -3334,6 +3370,27 @@ public:
AssignIndexIDToThread(uint64_t thread_id);
//------------------------------------------------------------------
+ // Queue Queries
+ //------------------------------------------------------------------
+
+ void
+ UpdateQueueListIfNeeded ();
+
+ QueueList &
+ GetQueueList ()
+ {
+ UpdateQueueListIfNeeded();
+ return m_queue_list;
+ }
+
+ QueueList::QueueIterable
+ Queues ()
+ {
+ UpdateQueueListIfNeeded();
+ return m_queue_list.Queues();
+ }
+
+ //------------------------------------------------------------------
// Event Handling
//------------------------------------------------------------------
lldb::StateType
@@ -3343,10 +3400,15 @@ public:
// is set to the event which triggered the stop. If wait_always = false,
// and the process is already stopped, this function returns immediately.
lldb::StateType
- WaitForProcessToStop (const TimeValue *timeout, lldb::EventSP *event_sp_ptr = NULL, bool wait_always = true);
+ WaitForProcessToStop (const TimeValue *timeout,
+ lldb::EventSP *event_sp_ptr = NULL,
+ bool wait_always = true,
+ Listener *hijack_listener = NULL);
lldb::StateType
- WaitForStateChangedEvents (const TimeValue *timeout, lldb::EventSP &event_sp);
+ WaitForStateChangedEvents (const TimeValue *timeout,
+ lldb::EventSP &event_sp,
+ Listener *hijack_listener); // Pass NULL to use builtin listener
Event *
PeekAtStateChangedEvents ();
@@ -3513,6 +3575,12 @@ public:
void
SetSTDIOFileDescriptor (int file_descriptor);
+ void
+ WatchForSTDIN (IOHandler &io_handler);
+
+ void
+ CancelWatchForSTDIN (bool exited);
+
//------------------------------------------------------------------
// 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
@@ -3645,6 +3713,12 @@ protected:
{
return IS_VALID_LLDB_HOST_THREAD(m_private_state_thread);
}
+
+ void
+ ForceNextEventDelivery()
+ {
+ m_force_next_event_delivery = true;
+ }
//------------------------------------------------------------------
// Type definitions
@@ -3685,6 +3759,8 @@ protected:
///< m_thread_list_real, but might be different if there is an OS plug-in creating memory threads
ThreadList m_extended_thread_list; ///< Owner for extended threads that may be generated, cleared on natural stops
uint32_t m_extended_thread_stop_id; ///< The natural stop id when extended_thread_list was last updated
+ QueueList m_queue_list; ///< The list of libdispatch queues at a given stop point
+ uint32_t m_queue_list_stop_id; ///< The natural stop id when queue list was last fetched
std::vector<Notifications> m_notifications; ///< The list of notifications that this process can deliver.
std::vector<lldb::addr_t> m_image_tokens;
Listener &m_listener;
@@ -3695,7 +3771,7 @@ protected:
std::unique_ptr<SystemRuntime> m_system_runtime_ap;
UnixSignals m_unix_signals; /// This is the current signal set for this process.
lldb::ABISP m_abi_sp;
- lldb::InputReaderSP m_process_input_reader;
+ lldb::IOHandlerSP m_process_input_reader;
Communication m_stdio_communication;
Mutex m_stdio_communication_mutex;
std::string m_stdout_data;
@@ -3715,7 +3791,9 @@ protected:
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.
bool m_finalize_called;
bool m_clear_thread_plans_on_stop;
+ bool m_force_next_event_delivery;
lldb::StateType m_last_broadcast_state; /// This helps with the Public event coalescing in ShouldBroadcastEvent.
+ std::map<lldb::addr_t,lldb::addr_t> m_resolved_indirect_addresses;
bool m_destroy_in_process;
enum {
@@ -3790,21 +3868,14 @@ protected:
STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len);
void
- PushProcessInputReader ();
+ PushProcessIOHandler ();
void
- PopProcessInputReader ();
+ PopProcessIOHandler ();
void
- ResetProcessInputReader ();
-
- static size_t
- ProcessInputReaderCallback (void *baton,
- InputReader &reader,
- lldb::InputReaderAction notification,
- const char *bytes,
- size_t bytes_len);
-
+ ResetProcessIOHandler ();
+
Error
HaltForDestroyOrDetach(lldb::EventSP &exit_event_sp);
diff --git a/include/lldb/Target/Queue.h b/include/lldb/Target/Queue.h
new file mode 100644
index 000000000000..32ee24aebc11
--- /dev/null
+++ b/include/lldb/Target/Queue.h
@@ -0,0 +1,189 @@
+//===-- Queue.h ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_Queue_h_
+#define liblldb_Queue_h_
+
+#include <vector>
+#include <string>
+
+#include "lldb/lldb-forward.h"
+#include "lldb/lldb-enumerations.h"
+#include "lldb/lldb-private.h"
+#include "lldb/Target/QueueItem.h"
+
+
+namespace lldb_private {
+
+//------------------------------------------------------------------
+// Queue:
+// 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.
+//------------------------------------------------------------------
+
+
+class Queue :
+ public std::enable_shared_from_this<Queue>
+{
+public:
+
+ Queue (lldb::ProcessSP process_sp, lldb::queue_id_t queue_id, const char *queue_name);
+
+ ~Queue ();
+
+ //------------------------------------------------------------------
+ /// Get the QueueID for this Queue
+ ///
+ /// A 64-bit ID number that uniquely identifies a queue at this particular
+ /// stop_id. Currently the libdispatch serialnum is used for the QueueID;
+ /// it is a number that starts at 1 for each process and increments with
+ /// each queue. A serialnum is not reused for a different queue in the
+ /// lifetime of that process execution.
+ ///
+ /// @return
+ /// The QueueID for this Queue.
+ //------------------------------------------------------------------
+ lldb::queue_id_t
+ GetID ();
+
+ //------------------------------------------------------------------
+ /// Get the name of this Queue
+ ///
+ /// @return
+ /// The name of the queue, if one is available.
+ /// A NULL pointer is returned if none is available.
+ //------------------------------------------------------------------
+ const char *
+ GetName ();
+
+ //------------------------------------------------------------------
+ /// Get the IndexID for this Queue
+ ///
+ /// This is currently the same as GetID(). If it changes in the future,
+ /// it will be a small integer value (starting with 1) assigned to
+ /// each queue that is seen during a Process lifetime.
+ ///
+ /// Both the GetID and GetIndexID are being retained for Queues to
+ /// maintain similar API to the Thread class, and allow for the
+ /// possibility of GetID changing to a different source in the future.
+ ///
+ /// @return
+ /// The IndexID for this queue.
+ //------------------------------------------------------------------
+ uint32_t
+ GetIndexID ();
+
+ //------------------------------------------------------------------
+ /// Return the threads currently associated with this queue
+ ///
+ /// Zero, one, or many threads may be executing code for a queue at
+ /// a given point in time. This call returns the list of threads
+ /// that are currently executing work for this queue.
+ ///
+ /// @return
+ /// The threads currently performing work for this queue
+ //------------------------------------------------------------------
+ std::vector<lldb::ThreadSP>
+ GetThreads ();
+
+ //------------------------------------------------------------------
+ /// Return the items that are currently enqueued
+ ///
+ /// "Enqueued" means that the item has been added to the queue to
+ /// be done, but has not yet been done. When the item is going to
+ /// be processed it is "dequeued".
+ ///
+ /// @return
+ /// The vector of enqueued items for this queue
+ //------------------------------------------------------------------
+ const std::vector<lldb::QueueItemSP> &
+ GetPendingItems();
+
+ lldb::ProcessSP
+ GetProcess() const
+ {
+ return m_process_wp.lock();
+ }
+
+ //------------------------------------------------------------------
+ /// Get the number of work items that this queue is currently running
+ ///
+ /// @return
+ /// The number of work items currently executing. For a serial
+ /// queue, this will be 0 or 1. For a concurrent queue, this
+ /// may be any number.
+ //------------------------------------------------------------------
+ uint32_t
+ GetNumRunningWorkItems () const;
+
+ //------------------------------------------------------------------
+ /// Get the number of work items enqueued on this queue
+ ///
+ /// @return
+ /// The number of work items currently enqueued, waiting to
+ /// execute.
+ //------------------------------------------------------------------
+ uint32_t
+ GetNumPendingWorkItems () const;
+
+ //------------------------------------------------------------------
+ /// Get the dispatch_queue_t structure address for this Queue
+ ///
+ /// Get the address in the inferior process' memory of this Queue's
+ /// dispatch_queue_t structure.
+ ///
+ /// @return
+ /// The address of the dispatch_queue_t structure, if known.
+ /// LLDB_INVALID_ADDRESS will be returned if it is unavailable.
+ //------------------------------------------------------------------
+ lldb::addr_t
+ GetLibdispatchQueueAddress () const;
+
+
+ void
+ SetNumRunningWorkItems (uint32_t count);
+
+ void
+ SetNumPendingWorkItems (uint32_t count);
+
+ void
+ SetLibdispatchQueueAddress (lldb::addr_t dispatch_queue_t_addr);
+
+ void
+ PushPendingQueueItem (lldb::QueueItemSP item)
+ {
+ m_pending_items.push_back (item);
+ }
+
+private:
+ //------------------------------------------------------------------
+ // For Queue only
+ //------------------------------------------------------------------
+
+ lldb::ProcessWP m_process_wp;
+ lldb::queue_id_t m_queue_id;
+ std::string m_queue_name;
+ uint32_t m_running_work_items_count;
+ uint32_t m_pending_work_items_count;
+ std::vector<lldb::QueueItemSP> m_pending_items;
+ lldb::addr_t m_dispatch_queue_t_addr; // address of libdispatch dispatch_queue_t for this Queue
+
+ DISALLOW_COPY_AND_ASSIGN (Queue);
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_Queue_h_
diff --git a/include/lldb/Target/QueueItem.h b/include/lldb/Target/QueueItem.h
new file mode 100644
index 000000000000..76270da3bee6
--- /dev/null
+++ b/include/lldb/Target/QueueItem.h
@@ -0,0 +1,244 @@
+//===-- QueueItem.h ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_QueueItem_h_
+#define liblldb_QueueItem_h_
+
+#include <vector>
+
+#include "lldb/lldb-private.h"
+#include "lldb/lldb-enumerations.h"
+
+#include "lldb/Core/Address.h"
+#include "lldb/Core/ConstString.h"
+
+
+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.
+//------------------------------------------------------------------
+
+
+class QueueItem :
+ public std::enable_shared_from_this<QueueItem>
+{
+public:
+
+ QueueItem (lldb::QueueSP queue_sp);
+
+ ~QueueItem ();
+
+ //------------------------------------------------------------------
+ /// Get the kind of work item this is
+ ///
+ /// @return
+ /// The type of work item that this QueueItem object
+ /// represents. eQueueItemKindUnknown may be returned.
+ //------------------------------------------------------------------
+ lldb::QueueItemKind
+ GetKind () const;
+
+ //------------------------------------------------------------------
+ /// Set the type of work item this is
+ ///
+ /// @param [in] item_kind
+ /// Set the kind of this work item object.
+ //------------------------------------------------------------------
+ void
+ SetKind (lldb::QueueItemKind item_kind);
+
+ //------------------------------------------------------------------
+ /// Get the code address that will be executed when this work item
+ /// is executed.
+ ///
+ /// @return
+ /// The address that will be invoked when this work item is
+ /// executed. Not all types of QueueItems will have an
+ /// address associated with them; check that the returned
+ /// Address is valid, or check that the WorkItemKind is a
+ /// kind that involves an address, such as eQueueItemKindFunction
+ /// or eQueueItemKindBlock.
+ //------------------------------------------------------------------
+ lldb_private::Address &
+ GetAddress ();
+
+ //------------------------------------------------------------------
+ /// Set the work item address for this object
+ ///
+ /// @param [in] addr
+ /// The address that will be invoked when this work item
+ /// is executed.
+ //------------------------------------------------------------------
+ void
+ SetAddress (lldb_private::Address addr);
+
+ //------------------------------------------------------------------
+ /// Check if this QueueItem object is valid
+ ///
+ /// If the weak pointer to the parent Queue cannot be revivified,
+ /// it is invalid.
+ ///
+ /// @return
+ /// True if this object is valid.
+ //------------------------------------------------------------------
+ bool
+ IsValid ()
+ {
+ return m_queue_wp.lock() != NULL;
+ }
+
+ //------------------------------------------------------------------
+ /// Get an extended backtrace thread for this queue item, if available
+ ///
+ /// If the backtrace/thread information was collected when this item
+ /// was enqueued, this call will provide it.
+ ///
+ /// @param [in] type
+ /// The type of extended backtrace being requested, e.g. "libdispatch"
+ /// or "pthread".
+ ///
+ /// @return
+ /// A thread shared pointer which will have a reference to an extended
+ /// thread if one was available.
+ //------------------------------------------------------------------
+ lldb::ThreadSP
+ GetExtendedBacktraceThread (ConstString type);
+
+ void
+ SetItemThatEnqueuedThis (lldb::addr_t address_of_item)
+ {
+ m_item_that_enqueued_this_ref = address_of_item;
+ }
+
+ lldb::addr_t
+ GetItemThatEnqueuedThis ()
+ {
+ return m_item_that_enqueued_this_ref;
+ }
+
+ void
+ SetEnqueueingThreadID (lldb::tid_t tid)
+ {
+ m_enqueueing_thread_id = tid;
+ }
+
+ lldb::tid_t
+ GetEnqueueingThreadID ()
+ {
+ return m_enqueueing_thread_id;
+ }
+
+ void
+ SetEnqueueingQueueID (lldb::queue_id_t qid)
+ {
+ m_enqueueing_queue_id = qid;
+ }
+
+ lldb::queue_id_t
+ GetEnqueueingQueueID ()
+ {
+ return m_enqueueing_queue_id;
+ }
+
+ void
+ SetTargetQueueID (lldb::queue_id_t qid)
+ {
+ m_target_queue_id = qid;
+ }
+
+ void
+ SetStopID (uint32_t stop_id)
+ {
+ m_stop_id = stop_id;
+ }
+
+ uint32_t
+ GetStopID ()
+ {
+ return m_stop_id;
+ }
+
+ void
+ SetEnqueueingBacktrace (std::vector<lldb::addr_t> backtrace)
+ {
+ m_backtrace = backtrace;
+ }
+
+ std::vector<lldb::addr_t> &
+ GetEnqueueingBacktrace ()
+ {
+ return m_backtrace;
+ }
+
+ void
+ SetThreadLabel (std::string thread_name)
+ {
+ m_thread_label = thread_name;
+ }
+
+ std::string
+ GetThreadLabel ()
+ {
+ return m_thread_label;
+ }
+
+ void
+ SetQueueLabel (std::string queue_name)
+ {
+ m_queue_label = queue_name;
+ }
+
+ std::string
+ GetQueueLabel ()
+ {
+ return m_queue_label;
+ }
+
+ void
+ SetTargetQueueLabel (std::string queue_name)
+ {
+ m_target_queue_label = queue_name;
+ }
+
+protected:
+ lldb::QueueWP m_queue_wp;
+ lldb::QueueItemKind m_kind;
+ lldb_private::Address m_address;
+
+ lldb::addr_t m_item_that_enqueued_this_ref; // a handle that we can pass into libBacktraceRecording
+ // to get the QueueItem that enqueued this item
+ lldb::tid_t m_enqueueing_thread_id; // thread that enqueued this item
+ lldb::queue_id_t m_enqueueing_queue_id; // Queue that enqueued this item, if it was a queue
+ lldb::queue_id_t m_target_queue_id;
+ uint32_t m_stop_id; // indicates when this backtrace was recorded in time
+ std::vector<lldb::addr_t> m_backtrace;
+ std::string m_thread_label;
+ std::string m_queue_label;
+ std::string m_target_queue_label;
+
+
+private:
+ //------------------------------------------------------------------
+ // For QueueItem only
+ //------------------------------------------------------------------
+
+ DISALLOW_COPY_AND_ASSIGN (QueueItem);
+
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_QueueItem_h_
diff --git a/include/lldb/Target/QueueList.h b/include/lldb/Target/QueueList.h
new file mode 100644
index 000000000000..964c1099233e
--- /dev/null
+++ b/include/lldb/Target/QueueList.h
@@ -0,0 +1,141 @@
+//===-- QueueList.h --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_QueueList_h_
+#define liblldb_QueueList_h_
+
+#include <vector>
+
+#include "lldb/lldb-private.h"
+#include "lldb/Core/UserID.h"
+#include "lldb/Utility/Iterable.h"
+
+
+namespace lldb_private {
+
+//------------------------------------------------------------------
+// QueueList:
+// 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.
+//------------------------------------------------------------------
+
+class QueueList
+{
+friend class Process;
+
+public:
+
+ QueueList (Process *process);
+
+ ~QueueList ();
+
+ //------------------------------------------------------------------
+ /// Get the number of libdispatch queues that are available
+ ///
+ /// @return
+ /// The number of queues that are stored in the QueueList.
+ //------------------------------------------------------------------
+ uint32_t
+ GetSize();
+
+ //------------------------------------------------------------------
+ /// Get the Queue at a given index number
+ ///
+ /// @param [in] idx
+ /// The index number (0-based) of the queue.
+ /// @return
+ /// The Queue at that index number.
+ //------------------------------------------------------------------
+ lldb::QueueSP
+ GetQueueAtIndex (uint32_t idx);
+
+ typedef std::vector<lldb::QueueSP> collection;
+ typedef LockingAdaptedIterable<collection, lldb::QueueSP, vector_adapter> QueueIterable;
+
+ //------------------------------------------------------------------
+ /// Iterate over the list of queues
+ ///
+ /// @return
+ /// An Iterable object which can be used to loop over the queues
+ /// that exist.
+ //------------------------------------------------------------------
+ QueueIterable
+ Queues ()
+ {
+ return QueueIterable(m_queues, m_mutex);
+ }
+
+ //------------------------------------------------------------------
+ /// Clear out the list of queues from the QueueList
+ //------------------------------------------------------------------
+ void
+ Clear();
+
+ //------------------------------------------------------------------
+ /// Add a Queue to the QueueList
+ ///
+ /// @param [in] queue
+ /// Used by the SystemRuntime to populate the QueueList
+ //------------------------------------------------------------------
+ void
+ AddQueue (lldb::QueueSP queue);
+
+ //------------------------------------------------------------------
+ /// Find a queue in the QueueList by QueueID
+ ///
+ /// @param [in] qid
+ /// The QueueID (same as returned by Thread::GetQueueID()) to find.
+ ///
+ /// @return
+ /// A QueueSP to the queue requested, if it is present in the QueueList.
+ /// An empty QueueSP willbe returned if this queue was not found.
+ //------------------------------------------------------------------
+ lldb::QueueSP
+ FindQueueByID (lldb::queue_id_t qid);
+
+ //------------------------------------------------------------------
+ /// Find a queue in the QueueList by IndexID
+ ///
+ /// @param [in] index_id
+ /// Find a queue by IndexID. This is an integer associated with each
+ /// unique queue seen during a debug session and will not be reused
+ /// for a different queue. Unlike the QueueID, a 64-bit value, this
+ /// will tend to be an integral value like 1 or 7.
+ ///
+ /// @return
+ /// A QueueSP to the queue requested, if it is present in the QueueList.
+ /// An empty QueueSP willbe returned if this queue was not found.
+ //------------------------------------------------------------------
+ lldb::QueueSP
+ FindQueueByIndexID (uint32_t index_id);
+
+ lldb_private::Mutex &
+ GetMutex ();
+
+protected:
+
+ //------------------------------------------------------------------
+ // Classes that inherit from Process can see and modify these
+ //------------------------------------------------------------------
+ Process *m_process; ///< The process that manages this queue list.
+ uint32_t m_stop_id; ///< The process stop ID that this queue list is valid for.
+ collection m_queues; ///< The queues for this process.
+ Mutex m_mutex;
+
+private:
+ QueueList ();
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_QueueList_h_
diff --git a/include/lldb/Target/SectionLoadHistory.h b/include/lldb/Target/SectionLoadHistory.h
new file mode 100644
index 000000000000..50dcfd3cc870
--- /dev/null
+++ b/include/lldb/Target/SectionLoadHistory.h
@@ -0,0 +1,109 @@
+//===-- SectionLoadHistory.h ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_SectionLoadHistory_h_
+#define liblldb_SectionLoadHistory_h_
+
+// C Includes
+// C++ Includes
+#include <map>
+
+// Project includes
+#include "lldb/lldb-public.h"
+#include "lldb/Host/Mutex.h"
+
+namespace lldb_private {
+
+class SectionLoadHistory
+{
+public:
+ enum {
+ // Pass eStopIDNow to any function that takes a stop ID to get
+ // the current value.
+ eStopIDNow = UINT32_MAX
+ };
+ //------------------------------------------------------------------
+ // Constructors and Destructors
+ //------------------------------------------------------------------
+ SectionLoadHistory () :
+ m_stop_id_to_section_load_list(),
+ m_mutex (Mutex::eMutexTypeRecursive)
+ {
+ }
+
+ ~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
+ Clear();
+ }
+
+ SectionLoadList &
+ GetCurrentSectionLoadList ();
+
+ bool
+ IsEmpty() const;
+
+ void
+ Clear ();
+
+ uint32_t
+ GetLastStopID() const;
+
+ // Get the section load address given a process stop ID
+ lldb::addr_t
+ GetSectionLoadAddress (uint32_t stop_id,
+ const lldb::SectionSP &section_sp);
+
+ bool
+ ResolveLoadAddress (uint32_t stop_id,
+ lldb::addr_t load_addr,
+ Address &so_addr);
+
+ bool
+ SetSectionLoadAddress (uint32_t stop_id,
+ const lldb::SectionSP &section_sp,
+ lldb::addr_t load_addr,
+ 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.
+ 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.
+ size_t
+ SetSectionUnloaded (uint32_t stop_id,
+ const lldb::SectionSP &section_sp);
+
+ void
+ Dump (Stream &s,
+ Target *target);
+
+protected:
+
+ SectionLoadList *
+ GetSectionLoadListForStopID (uint32_t stop_id, bool read_only);
+
+ typedef std::map<uint32_t, lldb::SectionLoadListSP> StopIDToSectionLoadList;
+ StopIDToSectionLoadList m_stop_id_to_section_load_list;
+ mutable Mutex m_mutex;
+
+private:
+ DISALLOW_COPY_AND_ASSIGN (SectionLoadHistory);
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_SectionLoadHistory_h_
diff --git a/include/lldb/Target/SectionLoadList.h b/include/lldb/Target/SectionLoadList.h
index ac05bf7a9cb4..6a9bbab93c98 100644
--- a/include/lldb/Target/SectionLoadList.h
+++ b/include/lldb/Target/SectionLoadList.h
@@ -36,6 +36,8 @@ public:
{
}
+ SectionLoadList (const SectionLoadList& rhs);
+
~SectionLoadList()
{
// Call clear since this takes a lock and clears the section load list
@@ -43,6 +45,9 @@ public:
Clear();
}
+ void
+ operator=(const SectionLoadList &rhs);
+
bool
IsEmpty() const;
@@ -79,9 +84,6 @@ protected:
addr_to_sect_collection m_addr_to_sect;
sect_to_addr_collection m_sect_to_addr;
mutable Mutex m_mutex;
-
-private:
- DISALLOW_COPY_AND_ASSIGN (SectionLoadList);
};
} // namespace lldb_private
diff --git a/include/lldb/Target/SystemRuntime.h b/include/lldb/Target/SystemRuntime.h
index 7a0703e6cc34..363ce122c4f3 100644
--- a/include/lldb/Target/SystemRuntime.h
+++ b/include/lldb/Target/SystemRuntime.h
@@ -20,9 +20,10 @@
#include "lldb/Core/ConstString.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/PluginInterface.h"
+#include "lldb/Target/QueueList.h"
+#include "lldb/Target/QueueItem.h"
#include "lldb/lldb-private.h"
-
namespace lldb_private {
//----------------------------------------------------------------------
@@ -103,6 +104,14 @@ public:
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.
+ //------------------------------------------------------------------
+ virtual void
+ Detach ();
//------------------------------------------------------------------
/// Return a list of thread origin extended backtraces that may
@@ -160,6 +169,107 @@ public:
virtual lldb::ThreadSP
GetExtendedBacktraceThread (lldb::ThreadSP thread, ConstString type);
+ //------------------------------------------------------------------
+ /// Get the extended backtrace thread for a QueueItem
+ ///
+ /// A QueueItem represents a function/block that will be executed on
+ /// 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.
+ ///
+ /// @param [in] queue_item_sp
+ /// The QueueItem that we are getting an extended backtrace for.
+ ///
+ /// @param [in] type
+ /// The type of extended backtrace to fetch. The types supported
+ /// are returned from SystemRuntime::GetExtendedBacktraceTypes.
+ ///
+ /// @return
+ /// If an extended backtrace is available, it is returned. Else
+ /// an empty ThreadSP is returned.
+ //------------------------------------------------------------------
+ virtual lldb::ThreadSP
+ GetExtendedBacktraceForQueueItem (lldb::QueueItemSP queue_item_sp, ConstString type)
+ {
+ return lldb::ThreadSP();
+ }
+
+ //------------------------------------------------------------------
+ /// 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.
+ ///
+ /// @param [out] queue_list
+ /// This QueueList will be cleared, and any queues that currently exist
+ /// will be added. An empty QueueList will be returned if no queues
+ /// exist or if this Systemruntime does not support libdispatch queues.
+ //------------------------------------------------------------------
+ virtual void
+ PopulateQueueList (lldb_private::QueueList &queue_list)
+ {
+ }
+
+ //------------------------------------------------------------------
+ /// 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.
+ ///
+ /// @param [in] dispatch_qaddr
+ /// The address of the dispatch_queue_t structure for this thread.
+ ///
+ /// @return
+ /// The string of this queue's name. An empty string is returned if the
+ /// name could not be found.
+ //------------------------------------------------------------------
+ virtual std::string
+ GetQueueNameFromThreadQAddress (lldb::addr_t dispatch_qaddr)
+ {
+ return "";
+ }
+
+ //------------------------------------------------------------------
+ /// Get the QueueID for the libdispatch queue given the 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 ID and return it.
+ ///
+ /// @param [in] dispatch_qaddr
+ /// The address of the dispatch_queue_t structure for this thread.
+ ///
+ /// @return
+ /// The queue ID, or if it could not be retrieved, LLDB_INVALID_QUEUE_ID.
+ //------------------------------------------------------------------
+ virtual lldb::queue_id_t
+ GetQueueIDFromThreadQAddress (lldb::addr_t dispatch_qaddr)
+ {
+ return LLDB_INVALID_QUEUE_ID;
+ }
+
+ //------------------------------------------------------------------
+ /// 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.
+ ///
+ /// @param [in] queue
+ /// The queue of interest.
+ //------------------------------------------------------------------
+ virtual void
+ PopulatePendingItemsForQueue (lldb_private::Queue *queue)
+ {
+ }
+
protected:
//------------------------------------------------------------------
// Member variables.
diff --git a/include/lldb/Target/Target.h b/include/lldb/Target/Target.h
index d874891a6aff..e65a511ab77a 100644
--- a/include/lldb/Target/Target.h
+++ b/include/lldb/Target/Target.h
@@ -35,7 +35,7 @@
#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/PathMappingList.h"
-#include "lldb/Target/SectionLoadList.h"
+#include "lldb/Target/SectionLoadHistory.h"
namespace lldb_private {
@@ -164,6 +164,9 @@ public:
bool
GetUseFastStepping() const;
+
+ bool
+ GetDisplayExpressionsInCrashlogs () const;
LoadScriptFromSymFile
GetLoadScriptFromSymbolFile() const;
@@ -174,6 +177,11 @@ public:
MemoryModuleLoadLevel
GetMemoryModuleLoadLevel() const;
+ bool
+ GetUserSpecifiedTrapHandlerNames (Args &args) const;
+
+ void
+ SetUserSpecifiedTrapHandlerNames (const Args &args);
};
typedef std::shared_ptr<TargetProperties> TargetPropertiesSP;
@@ -526,6 +534,10 @@ public:
void
Destroy();
+
+ Error
+ Launch (Listener &listener,
+ ProcessLaunchInfo &launch_info);
//------------------------------------------------------------------
// This part handles the breakpoints.
@@ -630,7 +642,8 @@ public:
CreateBreakpoint (lldb::SearchFilterSP &filter_sp,
lldb::BreakpointResolverSP &resolver_sp,
bool internal,
- bool request_hardware);
+ bool request_hardware,
+ bool resolve_indirect_symbols);
// Use this to create a watchpoint:
lldb::WatchpointSP
@@ -1001,14 +1014,14 @@ public:
SectionLoadList&
GetSectionLoadList()
{
- return m_section_load_list;
+ return m_section_load_history.GetCurrentSectionLoadList();
}
- const SectionLoadList&
- GetSectionLoadList() const
- {
- return m_section_load_list;
- }
+// const SectionLoadList&
+// GetSectionLoadList() const
+// {
+// return const_cast<SectionLoadHistory *>(&m_section_load_history)->GetCurrentSectionLoadList();
+// }
static Target *
GetTargetFromContexts (const ExecutionContext *exe_ctx_ptr,
@@ -1048,6 +1061,26 @@ public:
Error
Install(ProcessLaunchInfo *launch_info);
+
+ bool
+ ResolveLoadAddress (lldb::addr_t load_addr,
+ Address &so_addr,
+ uint32_t stop_id = SectionLoadHistory::eStopIDNow);
+
+ bool
+ SetSectionLoadAddress (const lldb::SectionSP &section,
+ lldb::addr_t load_addr,
+ bool warn_multiple = false);
+
+ bool
+ SetSectionUnloaded (const lldb::SectionSP &section_sp);
+
+ bool
+ SetSectionUnloaded (const lldb::SectionSP &section_sp, lldb::addr_t load_addr);
+
+ 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.
@@ -1144,7 +1177,7 @@ public:
std::unique_ptr<ThreadSpec> m_thread_spec_ap;
bool m_active;
- // Use AddStopHook to make a new empty stop hook. The GetCommandPointer and fill it with commands,
+ // 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.)
StopHook (lldb::TargetSP target_sp, lldb::user_id_t uid);
friend class Target;
@@ -1153,8 +1186,8 @@ public:
// 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.
- lldb::user_id_t
- AddStopHook (StopHookSP &new_hook);
+ StopHookSP
+ CreateStopHook ();
void
RunStopHooks ();
@@ -1250,7 +1283,7 @@ protected:
Mutex m_mutex; ///< An API mutex that is used by the lldb::SB* classes make the SB interface thread safe
ArchSpec m_arch;
ModuleList m_images; ///< The list of images for this process (shared libraries and anything dynamically loaded).
- SectionLoadList m_section_load_list;
+ SectionLoadHistory m_section_load_history;
BreakpointList m_breakpoint_list;
BreakpointList m_internal_breakpoint_list;
lldb::BreakpointSP m_last_created_breakpoint;
@@ -1260,7 +1293,6 @@ protected:
// 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;
- bool m_valid;
lldb::SearchFilterSP m_search_filter_sp;
PathMappingList m_image_search_paths;
std::unique_ptr<ClangASTContext> m_scratch_ast_context_ap;
@@ -1273,8 +1305,8 @@ protected:
typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
StopHookCollection m_stop_hooks;
lldb::user_id_t m_stop_hook_next_id;
+ bool m_valid;
bool m_suppress_stop_hooks;
- bool m_suppress_synthetic_value;
static void
ImageSearchPathsChanged (const PathMappingList &path_list,
diff --git a/include/lldb/Target/Thread.h b/include/lldb/Target/Thread.h
index 4f78b0fe6998..20687e977bff 100644
--- a/include/lldb/Target/Thread.h
+++ b/include/lldb/Target/Thread.h
@@ -44,6 +44,9 @@ public:
const RegularExpression *
GetSymbolsToAvoidRegexp();
+ FileSpecList &
+ GetLibrariesToAvoid() const;
+
bool
GetTraceEnabledState() const;
};
@@ -410,6 +413,55 @@ public:
DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx);
//------------------------------------------------------------------
+ /// Default implementation for stepping into.
+ ///
+ /// This function is designed to be used by commands where the
+ /// process is publicly stopped.
+ ///
+ /// @param[in] source_step
+ /// If true and the frame has debug info, then do a source level
+ /// step in, else do a single instruction step in.
+ ///
+ /// @param[in] avoid_code_without_debug_info
+ /// If \a true, then avoid stepping into code that doesn't have
+ /// debug info, else step into any code regardless of wether it
+ /// has debug info.
+ ///
+ /// @return
+ /// An error that describes anything that went wrong
+ //------------------------------------------------------------------
+ virtual Error
+ StepIn (bool source_step,
+ bool avoid_code_without_debug_info);
+
+ //------------------------------------------------------------------
+ /// Default implementation for stepping over.
+ ///
+ /// This function is designed to be used by commands where the
+ /// process is publicly stopped.
+ ///
+ /// @param[in] source_step
+ /// If true and the frame has debug info, then do a source level
+ /// step over, else do a single instruction step over.
+ ///
+ /// @return
+ /// An error that describes anything that went wrong
+ //------------------------------------------------------------------
+ virtual Error
+ StepOver (bool source_step);
+
+ //------------------------------------------------------------------
+ /// Default implementation for stepping out.
+ ///
+ /// This function is designed to be used by commands where the
+ /// process is publicly stopped.
+ ///
+ /// @return
+ /// An error that describes anything that went wrong
+ //------------------------------------------------------------------
+ virtual Error
+ StepOut ();
+ //------------------------------------------------------------------
/// Retrieves the per-thread data area.
/// Most OSs maintain a per-thread pointer (e.g. the FS register on
/// x64), which we return the value of here.
diff --git a/include/lldb/Target/ThreadList.h b/include/lldb/Target/ThreadList.h
index f4dfdb23ec0f..65d9b74098a6 100644
--- a/include/lldb/Target/ThreadList.h
+++ b/include/lldb/Target/ThreadList.h
@@ -45,6 +45,8 @@ public:
void
AddThread (const lldb::ThreadSP &thread_sp);
+ void
+ InsertThread (const lldb::ThreadSP &thread_sp, uint32_t idx);
// Return the selected thread if there is one. Otherwise, return the thread
// selected at index 0.
lldb::ThreadSP
diff --git a/include/lldb/Target/ThreadPlanStepInRange.h b/include/lldb/Target/ThreadPlanStepInRange.h
index dbc8446b2e18..2f741f179bd4 100644
--- a/include/lldb/Target/ThreadPlanStepInRange.h
+++ b/include/lldb/Target/ThreadPlanStepInRange.h
@@ -73,7 +73,7 @@ protected:
SetFlagsToDefault ();
bool
- FrameMatchesAvoidRegexp ();
+ FrameMatchesAvoidCriteria ();
private:
diff --git a/include/lldb/Target/UnwindAssembly.h b/include/lldb/Target/UnwindAssembly.h
index 6a4ae0c30f27..254382ac029d 100644
--- a/include/lldb/Target/UnwindAssembly.h
+++ b/include/lldb/Target/UnwindAssembly.h
@@ -17,10 +17,11 @@
namespace lldb_private {
class UnwindAssembly :
+ public std::enable_shared_from_this<UnwindAssembly>,
public PluginInterface
{
public:
- static UnwindAssembly*
+ static lldb::UnwindAssemblySP
FindPlugin (const ArchSpec &arch);
virtual