diff options
author | Zachary Turner <zturner@google.com> | 2015-03-03 21:51:25 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-03-03 21:51:25 +0000 |
commit | 93749ab3cfff19115bf46d6424939cfddba906cc (patch) | |
tree | 295c3c7a3aea4ff8c8103e0ea57e87fe9c82441f | |
parent | 49cfb8166598aad9b1785c3ec614ebdf75e037f8 (diff) | |
download | bcm5719-llvm-93749ab3cfff19115bf46d6424939cfddba906cc.tar.gz bcm5719-llvm-93749ab3cfff19115bf46d6424939cfddba906cc.zip |
Further reduce the header footprint of Process.h
No functional change here, only deletes unnecessary headers
and moves one function's body from the .h file to the .cpp.
llvm-svn: 231145
12 files changed, 96 insertions, 68 deletions
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 38d79c15b39..091d3f3ec98 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -28,33 +28,26 @@ #include "lldb/Core/Communication.h" #include "lldb/Core/Error.h" #include "lldb/Core/Event.h" -#include "lldb/Core/RangeMap.h" -#include "lldb/Core/StringList.h" #include "lldb/Core/ThreadSafeValue.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/UserSettingsController.h" #include "lldb/Breakpoint/BreakpointSiteList.h" -#include "lldb/Expression/IRDynamicChecks.h" -#include "lldb/Host/FileSpec.h" -#include "lldb/Host/Host.h" #include "lldb/Host/HostThread.h" #include "lldb/Host/ProcessRunLock.h" -#include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/Options.h" #include "lldb/Target/ExecutionContextScope.h" -#include "lldb/Target/JITLoaderList.h" #include "lldb/Target/Memory.h" -#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/ProcessInfo.h" #include "lldb/Target/ProcessLaunchInfo.h" #include "lldb/Target/QueueList.h" #include "lldb/Target/ThreadList.h" -#include "lldb/Target/UnixSignals.h" -#include "lldb/Utility/PseudoTerminal.h" #include "lldb/Target/InstrumentationRuntime.h" namespace lldb_private { +template <typename B, typename S> +struct Range; + //---------------------------------------------------------------------- // ProcessProperties //---------------------------------------------------------------------- @@ -1369,18 +1362,10 @@ public: Signal (int signal); void - SetUnixSignals (const UnixSignalsSP &signals_sp) - { - assert (signals_sp && "null signals_sp"); - m_unix_signals_sp = signals_sp; - } + SetUnixSignals (const UnixSignalsSP &signals_sp); UnixSignals & - GetUnixSignals () - { - assert (m_unix_signals_sp && "null m_unix_signals_sp"); - return *m_unix_signals_sp; - } + GetUnixSignals (); //================================================================== // Plug-in Process Control Overrides @@ -2398,33 +2383,8 @@ public: /// Returns true if it was able to determine the attributes of the /// memory region. False if not. //------------------------------------------------------------------ - virtual bool - GetLoadAddressPermissions (lldb::addr_t load_addr, uint32_t &permissions) - { - MemoryRegionInfo range_info; - permissions = 0; - Error error (GetMemoryRegionInfo (load_addr, range_info)); - if (!error.Success()) - return false; - if (range_info.GetReadable() == MemoryRegionInfo::eDontKnow - || range_info.GetWritable() == MemoryRegionInfo::eDontKnow - || range_info.GetExecutable() == MemoryRegionInfo::eDontKnow) - { - return false; - } - - if (range_info.GetReadable() == MemoryRegionInfo::eYes) - permissions |= lldb::ePermissionsReadable; - - if (range_info.GetWritable() == MemoryRegionInfo::eYes) - permissions |= lldb::ePermissionsWritable; - - if (range_info.GetExecutable() == MemoryRegionInfo::eYes) - permissions |= lldb::ePermissionsExecutable; - - return true; - } + GetLoadAddressPermissions (lldb::addr_t load_addr, uint32_t &permissions); //------------------------------------------------------------------ /// Determines whether executing JIT-compiled code in this process @@ -2905,10 +2865,7 @@ public: return m_dynamic_checkers_ap.get(); } - void SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers) - { - m_dynamic_checkers_ap.reset(dynamic_checkers); - } + void SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers); //------------------------------------------------------------------ /// Call this to set the lldb in the mode where it breaks on new thread @@ -3009,15 +2966,9 @@ public: void ClearPreResumeActions (); - + ProcessRunLock & - GetRunLock () - { - if (m_private_state_thread.EqualsThread(Host::GetCurrentThread())) - return m_private_run_lock; - else - return m_public_run_lock; - } + GetRunLock (); public: virtual Error @@ -3149,7 +3100,7 @@ protected: Broadcaster m_private_state_control_broadcaster; // This is the control broadcaster, used to pause, resume & stop the private state thread. Listener m_private_state_listener; // This is the listener for the private state thread. Predicate<bool> m_private_state_control_wait; /// This Predicate is used to signal that a control operation is complete. - HostThread m_private_state_thread; // Thread ID for the thread that watches internal state events + HostThread m_private_state_thread; ///< Thread ID for the thread that watches internal state events ProcessModID m_mod_id; ///< Tracks the state of the process over stops and other alterations. uint32_t m_process_unique_id; ///< Each lldb_private::Process class that is created gets a unique integer ID that increments with each new instance uint32_t m_thread_index_id; ///< Each thread is created with a 1 based index that won't get re-used. @@ -3169,11 +3120,11 @@ protected: std::vector<lldb::addr_t> m_image_tokens; Listener &m_listener; BreakpointSiteList m_breakpoint_site_list; ///< This is the list of breakpoint locations we intend to insert in the target. - std::unique_ptr<DynamicLoader> m_dyld_ap; - std::unique_ptr<JITLoaderList> m_jit_loaders_ap; - std::unique_ptr<DynamicCheckerFunctions> m_dynamic_checkers_ap; ///< The functions used by the expression parser to validate data that expressions use. - std::unique_ptr<OperatingSystem> m_os_ap; - std::unique_ptr<SystemRuntime> m_system_runtime_ap; + lldb::DynamicLoaderUP m_dyld_ap; + lldb::JITLoaderListUP m_jit_loaders_ap; + lldb::DynamicCheckerFunctionsUP m_dynamic_checkers_ap; ///< The functions used by the expression parser to validate data that expressions use. + lldb::OperatingSystemUP m_os_ap; + lldb::SystemRuntimeUP m_system_runtime_ap; UnixSignalsSP m_unix_signals_sp; /// This is the current signal set for this process. lldb::ABISP m_abi_sp; lldb::IOHandlerSP m_process_input_reader; diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index b478fdef551..3d10eeaf8a7 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -83,6 +83,7 @@ class Debugger; class Declaration; class Disassembler; struct DumpValueObjectOptions; +class DynamicCheckerFunctions; class DynamicLoader; class Editline; class EmulateInstruction; @@ -112,8 +113,9 @@ class IOHandler; class IOObject; class IRExecutionUnit; class JITLoader; +class JITLoaderList; class LanguageRuntime; -class SystemRuntime; +class MemoryRegionInfo; class LineTable; class Listener; class Log; @@ -211,6 +213,7 @@ class StreamFile; class StreamString; class StringList; struct StringSummaryFormat; +class SystemRuntime; class TypeSummaryImpl; class TypeSummaryOptions; class Symbol; @@ -318,7 +321,9 @@ namespace lldb { typedef std::shared_ptr<lldb_private::Debugger> DebuggerSP; typedef std::weak_ptr<lldb_private::Debugger> DebuggerWP; typedef std::shared_ptr<lldb_private::Disassembler> DisassemblerSP; + typedef std::unique_ptr<lldb_private::DynamicCheckerFunctions> DynamicCheckerFunctionsUP; typedef std::shared_ptr<lldb_private::DynamicLoader> DynamicLoaderSP; + typedef std::unique_ptr<lldb_private::DynamicLoader> DynamicLoaderUP; typedef std::shared_ptr<lldb_private::Event> EventSP; typedef std::shared_ptr<lldb_private::ExecutionContextRef> ExecutionContextRefSP; typedef std::shared_ptr<lldb_private::File> FileSP; @@ -330,8 +335,10 @@ namespace lldb { typedef std::shared_ptr<lldb_private::IOHandler> IOHandlerSP; typedef std::shared_ptr<lldb_private::IOObject> IOObjectSP; typedef std::shared_ptr<lldb_private::JITLoader> JITLoaderSP; + typedef std::unique_ptr<lldb_private::JITLoaderList> JITLoaderListUP; typedef std::shared_ptr<lldb_private::LanguageRuntime> LanguageRuntimeSP; typedef std::shared_ptr<lldb_private::SystemRuntime> SystemRuntimeSP; + typedef std::unique_ptr<lldb_private::SystemRuntime> SystemRuntimeUP; typedef std::shared_ptr<lldb_private::LineTable> LineTableSP; typedef std::shared_ptr<lldb_private::Listener> ListenerSP; typedef std::shared_ptr<lldb_private::LogChannel> LogChannelSP; @@ -342,6 +349,7 @@ namespace lldb { typedef std::weak_ptr<lldb_private::ObjectFile> ObjectFileWP; typedef std::shared_ptr<lldb_private::ObjectFileJITDelegate> ObjectFileJITDelegateSP; typedef std::weak_ptr<lldb_private::ObjectFileJITDelegate> ObjectFileJITDelegateWP; + typedef std::unique_ptr<lldb_private::OperatingSystem> OperatingSystemUP; typedef std::shared_ptr<lldb_private::OptionValue> OptionValueSP; typedef std::weak_ptr<lldb_private::OptionValue> OptionValueWP; typedef std::shared_ptr<lldb_private::OptionValueArch> OptionValueArchSP; diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 9fe0d029496..03dab63a3e5 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -21,12 +21,13 @@ #include "lldb/Core/StreamFile.h" #include "lldb/Core/StructuredData.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Symbol/SymbolContext.h" +#include "lldb/Symbol/CompileUnit.h" #include "lldb/Target/SystemRuntime.h" #include "lldb/Target/Thread.h" #include "lldb/Target/Process.h" #include "lldb/Target/Queue.h" -#include "lldb/Symbol/SymbolContext.h" -#include "lldb/Symbol/CompileUnit.h" +#include "lldb/Target/UnixSignals.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/ThreadPlan.h" diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 85206d4a1a5..487a97915a8 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -32,6 +32,7 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" +#include "lldb/Target/UnixSignals.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 21a28a672fc..b1553cca63a 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -30,6 +30,7 @@ #include "lldb/Symbol/ClangNamespaceDecl.h" #include "lldb/Symbol/DWARFCallFrameInfo.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index 46161635461..fcfda216231 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -28,6 +28,7 @@ #include "lldb/Host/ThreadLauncher.h" #include "lldb/Target/Thread.h" #include "lldb/Target/RegisterContext.h" +#include "lldb/Target/UnixSignals.h" #include "lldb/Utility/PseudoTerminal.h" #include "Plugins/Process/POSIX/CrashReason.h" diff --git a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp index ce3f0201eab..7770b1470f3 100644 --- a/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/ProcessWindows.cpp @@ -31,6 +31,7 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/DynamicLoader.h" #include "lldb/Target/FileAction.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 4fb039740ef..45939f4b8f6 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -31,6 +31,7 @@ #include "lldb/Host/StringConvert.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/Target.h" +#include "lldb/Target/MemoryRegionInfo.h" // Project includes #include "Utility/StringExtractorGDBRemote.h" diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 833040bdf67..d3ad8380a28 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -37,6 +37,7 @@ #include "lldb/Host/StringConvert.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/FileAction.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" #include "lldb/Host/common/NativeRegisterContext.h" diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 5c70cb5427c..6309f7511a4 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -21,6 +21,7 @@ #include "lldb/Target/StopInfo.h" #include "lldb/Target/SystemRuntime.h" #include "lldb/Target/Target.h" +#include "lldb/Target/UnixSignals.h" #include "lldb/Target/Unwind.h" #include "ProcessGDBRemote.h" diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 2a76e88f2bb..eb6db2521d5 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -23,6 +23,7 @@ #include "lldb/Core/State.h" #include "lldb/Core/StreamFile.h" #include "lldb/Expression/ClangUserExpression.h" +#include "lldb/Expression/IRDynamicChecks.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" @@ -33,8 +34,11 @@ #include "lldb/Symbol/Symbol.h" #include "lldb/Target/ABI.h" #include "lldb/Target/DynamicLoader.h" +#include "lldb/Target/InstrumentationRuntime.h" #include "lldb/Target/JITLoader.h" +#include "lldb/Target/JITLoaderList.h" #include "lldb/Target/MemoryHistory.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/OperatingSystem.h" #include "lldb/Target/LanguageRuntime.h" #include "lldb/Target/CPPLanguageRuntime.h" @@ -48,7 +52,7 @@ #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanBase.h" -#include "lldb/Target/InstrumentationRuntime.h" +#include "lldb/Target/UnixSignals.h" #include "Plugins/Process/Utility/InferiorCallPOSIX.h" using namespace lldb; @@ -2083,6 +2087,12 @@ Process::IsPossibleDynamicValue (ValueObject& in_value) return objc_runtime ? objc_runtime->CouldHaveDynamicValue(in_value) : false; } +void +Process::SetDynamicCheckers(DynamicCheckerFunctions *dynamic_checkers) +{ + m_dynamic_checkers_ap.reset(dynamic_checkers); +} + BreakpointSiteList & Process::GetBreakpointSiteList() { @@ -2979,6 +2989,33 @@ Process::ReadModuleFromMemory (const FileSpec& file_spec, return ModuleSP(); } +bool +Process::GetLoadAddressPermissions (lldb::addr_t load_addr, uint32_t &permissions) +{ + MemoryRegionInfo range_info; + permissions = 0; + Error error (GetMemoryRegionInfo (load_addr, range_info)); + if (!error.Success()) + return false; + if (range_info.GetReadable() == MemoryRegionInfo::eDontKnow + || range_info.GetWritable() == MemoryRegionInfo::eDontKnow + || range_info.GetExecutable() == MemoryRegionInfo::eDontKnow) + { + return false; + } + + if (range_info.GetReadable() == MemoryRegionInfo::eYes) + permissions |= lldb::ePermissionsReadable; + + if (range_info.GetWritable() == MemoryRegionInfo::eYes) + permissions |= lldb::ePermissionsWritable; + + if (range_info.GetExecutable() == MemoryRegionInfo::eYes) + permissions |= lldb::ePermissionsExecutable; + + return true; +} + Error Process::EnableWatchpoint (Watchpoint *watchpoint, bool notify) { @@ -3982,6 +4019,20 @@ Process::Signal (int signal) return error; } +void +Process::SetUnixSignals (const UnixSignalsSP &signals_sp) +{ + assert (signals_sp && "null signals_sp"); + m_unix_signals_sp = signals_sp; +} + +UnixSignals & +Process::GetUnixSignals () +{ + assert (m_unix_signals_sp && "null m_unix_signals_sp"); + return *m_unix_signals_sp; +} + lldb::ByteOrder Process::GetByteOrder () const { @@ -6280,6 +6331,15 @@ Process::ClearPreResumeActions () m_pre_resume_actions.clear(); } +ProcessRunLock & +Process::GetRunLock() +{ + if (m_private_state_thread.EqualsThread(Host::GetCurrentThread())) + return m_private_run_lock; + else + return m_public_run_lock; +} + void Process::Flush () { diff --git a/lldb/source/Target/ThreadPlanCallUserExpression.cpp b/lldb/source/Target/ThreadPlanCallUserExpression.cpp index 90b8cf81171..aead3091b08 100644 --- a/lldb/source/Target/ThreadPlanCallUserExpression.cpp +++ b/lldb/source/Target/ThreadPlanCallUserExpression.cpp @@ -21,6 +21,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Stream.h" #include "lldb/Expression/ClangUserExpression.h" +#include "lldb/Expression/IRDynamicChecks.h" #include "lldb/Host/HostInfo.h" #include "lldb/Target/LanguageRuntime.h" #include "lldb/Target/Process.h" |