diff options
| author | Zachary Turner <zturner@google.com> | 2015-03-03 19:23:09 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2015-03-03 19:23:09 +0000 |
| commit | 32abc6edac8fb7d4cb9472bf00246dba19d1d47b (patch) | |
| tree | 24da0fc148a5a3c83587d8afbfee4c432ab88dac | |
| parent | fff8e7f6ba1e05d4c45df6923609a73e0300db1f (diff) | |
| download | bcm5719-llvm-32abc6edac8fb7d4cb9472bf00246dba19d1d47b.tar.gz bcm5719-llvm-32abc6edac8fb7d4cb9472bf00246dba19d1d47b.zip | |
Reduce header footprint of Target.h
This continues the effort to reduce header footprint and improve
build speed by removing clang and other unnecessary headers
from Target.h. In one case, some headers were included solely
for the purpose of declaring a nested class in Target, which was
not needed by anybody outside the class. In this case the
definition and implementation of the nested class were isolated
in the .cpp file so the header could be removed.
llvm-svn: 231107
26 files changed, 130 insertions, 132 deletions
diff --git a/lldb/include/lldb/Breakpoint/Watchpoint.h b/lldb/include/lldb/Breakpoint/Watchpoint.h index 9bb03b9a91e..926e0b506f3 100644 --- a/lldb/include/lldb/Breakpoint/Watchpoint.h +++ b/lldb/include/lldb/Breakpoint/Watchpoint.h @@ -20,10 +20,11 @@ // Project includes #include "lldb/lldb-private.h" -#include "lldb/Target/Target.h" -#include "lldb/Core/UserID.h" #include "lldb/Breakpoint/WatchpointOptions.h" #include "lldb/Breakpoint/StoppointLocation.h" +#include "lldb/Core/UserID.h" +#include "lldb/Symbol/ClangASTType.h" +#include "lldb/Target/Target.h" namespace lldb_private { diff --git a/lldb/include/lldb/Expression/ClangASTSource.h b/lldb/include/lldb/Expression/ClangASTSource.h index 23977fc8231..028bfb3666f 100644 --- a/lldb/include/lldb/Expression/ClangASTSource.h +++ b/lldb/include/lldb/Expression/ClangASTSource.h @@ -15,6 +15,7 @@ #include "clang/Basic/IdentifierTable.h" #include "lldb/Symbol/ClangExternalASTSourceCommon.h" #include "lldb/Symbol/ClangASTImporter.h" +#include "lldb/Symbol/ClangASTType.h" #include "lldb/Target/Target.h" #include "llvm/ADT/SmallSet.h" diff --git a/lldb/include/lldb/Target/Target.h b/lldb/include/lldb/Target/Target.h index 971269804a8..78b74d5e424 100644 --- a/lldb/include/lldb/Target/Target.h +++ b/lldb/include/lldb/Target/Target.h @@ -18,22 +18,12 @@ // Project includes #include "lldb/lldb-public.h" #include "lldb/Breakpoint/BreakpointList.h" -#include "lldb/Breakpoint/BreakpointLocationCollection.h" #include "lldb/Breakpoint/WatchpointList.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Broadcaster.h" #include "lldb/Core/Disassembler.h" -#include "lldb/Core/Event.h" #include "lldb/Core/ModuleList.h" #include "lldb/Core/UserSettingsController.h" -#include "lldb/Expression/ClangModulesDeclVendor.h" -#include "lldb/Expression/ClangPersistentVariables.h" -#include "lldb/Interpreter/Args.h" -#include "lldb/Interpreter/OptionValueBoolean.h" -#include "lldb/Interpreter/OptionValueEnumeration.h" -#include "lldb/Interpreter/OptionValueFileSpec.h" -#include "lldb/Symbol/SymbolContext.h" -#include "lldb/Target/ABI.h" #include "lldb/Target/ExecutionContextScope.h" #include "lldb/Target/PathMappingList.h" #include "lldb/Target/ProcessLaunchInfo.h" @@ -228,8 +218,6 @@ private: ProcessLaunchInfo m_launch_info; }; -typedef std::shared_ptr<TargetProperties> TargetPropertiesSP; - class EvaluateExpressionOptions { public: @@ -506,43 +494,6 @@ public: { return GetStaticBroadcasterClass(); } - - // This event data class is for use by the TargetList to broadcast new target notifications. - class TargetEventData : public EventData - { - public: - - static const ConstString & - GetFlavorString (); - - virtual const ConstString & - GetFlavor () const; - - TargetEventData (const lldb::TargetSP &new_target_sp); - - lldb::TargetSP & - GetTarget() - { - return m_target_sp; - } - - virtual - ~TargetEventData(); - - virtual void - Dump (Stream *s) const; - - static const lldb::TargetSP - GetTargetFromEvent (const lldb::EventSP &event_sp); - - static const TargetEventData * - GetEventDataFromEvent (const Event *event_sp); - - private: - lldb::TargetSP m_target_sp; - - DISALLOW_COPY_AND_ASSIGN (TargetEventData); - }; static void SettingsInitialize (); @@ -550,9 +501,6 @@ public: static void SettingsTerminate (); -// static lldb::UserSettingsControllerSP & -// GetSettingsController (); - static FileSpecList GetDefaultExecutableSearchPaths (); @@ -576,7 +524,7 @@ public: // Settings accessors //---------------------------------------------------------------------- - static const TargetPropertiesSP & + static const lldb::TargetPropertiesSP & GetGlobalProperties(); @@ -1226,10 +1174,7 @@ public: const EvaluateExpressionOptions& options = EvaluateExpressionOptions()); ClangPersistentVariables & - GetPersistentVariables() - { - return m_persistent_variables; - } + GetPersistentVariables(); //------------------------------------------------------------------ // Target Stop Hooks @@ -1267,10 +1212,7 @@ public: // Set the specifier. The stop hook will own the specifier, and is responsible for deleting it when we're done. void - SetSpecifier (SymbolContextSpecifier *specifier) - { - m_specifier_sp.reset (specifier); - } + SetSpecifier (SymbolContextSpecifier *specifier); SymbolContextSpecifier * GetSpecifier () @@ -1431,13 +1373,13 @@ protected: lldb::ProcessSP m_process_sp; lldb::SearchFilterSP m_search_filter_sp; PathMappingList m_image_search_paths; - std::unique_ptr<ClangASTContext> m_scratch_ast_context_ap; - std::unique_ptr<ClangASTSource> m_scratch_ast_source_ap; - std::unique_ptr<ClangASTImporter> m_ast_importer_ap; - std::unique_ptr<ClangModulesDeclVendor> m_clang_modules_decl_vendor_ap; - ClangPersistentVariables m_persistent_variables; ///< These are the persistent variables associated with this process for the expression parser. + lldb::ClangASTContextUP m_scratch_ast_context_ap; + lldb::ClangASTSourceUP m_scratch_ast_source_ap; + lldb::ClangASTImporterUP m_ast_importer_ap; + lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap; + lldb::ClangPersistentVariablesUP m_persistent_variables; ///< These are the persistent variables associated with this process for the expression parser. - std::unique_ptr<SourceManager> m_source_manager_ap; + lldb::SourceManagerUP m_source_manager_ap; typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection; StopHookCollection m_stop_hooks; diff --git a/lldb/include/lldb/lldb-forward.h b/lldb/include/lldb/lldb-forward.h index 7cf80e3298e..b478fdef551 100644 --- a/lldb/include/lldb/lldb-forward.h +++ b/lldb/include/lldb/lldb-forward.h @@ -58,6 +58,7 @@ class ClangExpressionVariableList; class ClangExpressionVariableList; class ClangExpressionVariables; class ClangFunction; +class ClangModulesDeclVendor; class ClangPersistentVariables; class ClangUserExpression; class ClangUtilityFunction; @@ -232,6 +233,7 @@ class QueueItem; class QueueImpl; class Target; class TargetList; +class TargetProperties; class Thread; class ThreadCollection; class ThreadList; @@ -302,7 +304,11 @@ namespace lldb { typedef std::shared_ptr<lldb_private::BreakpointResolver> BreakpointResolverSP; typedef std::shared_ptr<lldb_private::Broadcaster> BroadcasterSP; typedef std::unique_ptr<lldb_private::ClangASTContext> ClangASTContextUP; + typedef std::unique_ptr<lldb_private::ClangASTImporter> ClangASTImporterUP; + typedef std::unique_ptr<lldb_private::ClangASTSource> ClangASTSourceUP; typedef std::shared_ptr<lldb_private::ClangExpressionVariable> ClangExpressionVariableSP; + typedef std::unique_ptr<lldb_private::ClangModulesDeclVendor> ClangModulesDeclVendorUP; + typedef std::unique_ptr<lldb_private::ClangPersistentVariables> ClangPersistentVariablesUP; typedef std::shared_ptr<lldb_private::CommandObject> CommandObjectSP; typedef std::shared_ptr<lldb_private::Communication> CommunicationSP; typedef std::shared_ptr<lldb_private::Connection> ConnectionSP; @@ -375,6 +381,7 @@ namespace lldb { typedef std::shared_ptr<lldb_private::SectionLoadList> SectionLoadListSP; typedef std::shared_ptr<lldb_private::SearchFilter> SearchFilterSP; typedef std::shared_ptr<lldb_private::Settings> SettingsSP; + typedef std::unique_ptr<lldb_private::SourceManager> SourceManagerUP; typedef std::shared_ptr<lldb_private::StackFrame> StackFrameSP; typedef std::unique_ptr<lldb_private::StackFrame> StackFrameUP; typedef std::weak_ptr<lldb_private::StackFrame> StackFrameWP; @@ -394,6 +401,7 @@ namespace lldb { typedef std::shared_ptr<lldb_private::SyntheticChildrenFrontEnd> SyntheticChildrenFrontEndSP; typedef std::shared_ptr<lldb_private::Target> TargetSP; typedef std::weak_ptr<lldb_private::Target> TargetWP; + typedef std::shared_ptr<lldb_private::TargetProperties> TargetPropertiesSP; typedef std::shared_ptr<lldb_private::Thread> ThreadSP; typedef std::weak_ptr<lldb_private::Thread> ThreadWP; typedef std::shared_ptr<lldb_private::ThreadCollection> ThreadCollectionSP; diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp index d6e32b60059..f95fcb8b398 100644 --- a/lldb/source/API/SBAddress.cpp +++ b/lldb/source/API/SBAddress.cpp @@ -14,7 +14,9 @@ #include "lldb/Core/Address.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" +#include "lldb/Core/StreamString.h" #include "lldb/Host/Mutex.h" +#include "lldb/Symbol/LineEntry.h" #include "lldb/Target/Target.h" diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 94f76b39d2a..b67d12ebe5a 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -50,9 +50,9 @@ #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Symbol/VariableList.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/LanguageRuntime.h" #include "lldb/Target/Process.h" - #include "lldb/Target/Target.h" #include "lldb/Target/TargetList.h" diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index b0fe42bc244..58d8fcab760 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -27,6 +27,7 @@ #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Variable.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index e36809f485f..cb4715a8180 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -21,6 +21,7 @@ #include "lldb/Breakpoint/BreakpointLocation.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/Options.h" +#include "lldb/Interpreter/OptionValueBoolean.h" #include "lldb/Interpreter/OptionValueString.h" #include "lldb/Interpreter/OptionValueUInt64.h" #include "lldb/Core/RegularExpression.h" diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index 81b79b8cd8b..6d3f5e7b34c 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -25,6 +25,7 @@ #include "lldb/Interpreter/Options.h" #include "lldb/Interpreter/OptionGroupFormat.h" #include "lldb/Interpreter/OptionValueArray.h" +#include "lldb/Interpreter/OptionValueBoolean.h" #include "lldb/Interpreter/OptionValueUInt64.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index b9e4942caef..febcc55d0dd 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -50,6 +50,7 @@ #include "lldb/Symbol/SymbolVendor.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Symbol/VariableList.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/StackFrame.h" diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 015603ddf58..30932920cb3 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -16,6 +16,7 @@ #include "lldb/Expression/ASTDumper.h" #include "lldb/Expression/ClangASTSource.h" #include "lldb/Expression/ClangExpression.h" +#include "lldb/Expression/ClangModulesDeclVendor.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangNamespaceDecl.h" #include "lldb/Symbol/Function.h" diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index e3027378422..5dc5ca53839 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -22,6 +22,7 @@ #include "lldb/Core/ValueObjectVariable.h" #include "lldb/Expression/ASTDumper.h" #include "lldb/Expression/ClangASTSource.h" +#include "lldb/Expression/ClangModulesDeclVendor.h" #include "lldb/Expression/ClangPersistentVariables.h" #include "lldb/Expression/Materializer.h" #include "lldb/Host/Endian.h" diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp index 5035e9d8bb1..61f9b3d441c 100644 --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp @@ -15,6 +15,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Symbol/Symbol.h" +#include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 434c8453fbb..679c199a6ed 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -21,6 +21,7 @@ #include "lldb/Symbol/Function.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/ObjCLanguageRuntime.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp index a504e801daa..d341d67d448 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp @@ -16,6 +16,7 @@ #include "lldb/Core/Module.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Symbol.h" +#include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp index fdef1026f3c..1cebdca8cc3 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp @@ -14,6 +14,7 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" +#include "lldb/Target/Platform.h" #include "lldb/Core/Section.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Process.h" diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp index cd303cb0768..b9c71ad1ba4 100644 --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -16,10 +16,11 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/Section.h" #include "lldb/Core/StreamString.h" +#include "lldb/Symbol/SymbolContext.h" +#include "lldb/Symbol/SymbolVendor.h" #include "lldb/Target/Process.h" #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" -#include "lldb/Symbol/SymbolVendor.h" #include "JITLoaderGDB.h" diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp index e37dde44e23..cb2bb02ec94 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -30,6 +30,7 @@ #include "lldb/Host/FileSpec.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/Symbol.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp index fc592e60d86..02d3ecd7b3c 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp @@ -12,6 +12,7 @@ #include "lldb/Symbol/FuncUnwinders.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/Thread.h" #include "lldb/Target/Target.h" #include "lldb/Target/Process.h" diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp index dd81e574d50..010e3f0bebe 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -17,6 +17,7 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" diff --git a/lldb/source/Target/ObjCLanguageRuntime.cpp b/lldb/source/Target/ObjCLanguageRuntime.cpp index 3d7a9021343..9ed2f26f786 100644 --- a/lldb/source/Target/ObjCLanguageRuntime.cpp +++ b/lldb/source/Target/ObjCLanguageRuntime.cpp @@ -15,6 +15,7 @@ #include "lldb/Core/Timer.h" #include "lldb/Core/ValueObject.h" #include "lldb/Symbol/ClangASTContext.h" +#include "lldb/Symbol/SymbolContext.h" #include "lldb/Symbol/Type.h" #include "lldb/Symbol/TypeList.h" #include "lldb/Target/ObjCLanguageRuntime.h" diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 34e1b65f054..40f6bdf4015 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -35,6 +35,7 @@ #include "lldb/Core/ValueObject.h" #include "lldb/Expression/ClangASTSource.h" #include "lldb/Expression/ClangUserExpression.h" +#include "lldb/Expression/ClangModulesDeclVendor.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Host.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -54,6 +55,76 @@ using namespace lldb; using namespace lldb_private; +namespace { +// This event data class is for use by the TargetList to broadcast new target notifications. +class TargetEventData : public EventData +{ +public: + TargetEventData(const lldb::TargetSP &new_target_sp) + : EventData() + , m_target_sp(new_target_sp) + { + } + + virtual ~TargetEventData() + { + } + + static const ConstString & + GetFlavorString() + { + static ConstString g_flavor("Target::TargetEventData"); + return g_flavor; + } + + virtual const ConstString & + GetFlavor() const + { + return GetFlavorString(); + } + + lldb::TargetSP & + GetTarget() + { + return m_target_sp; + } + + virtual void + Dump(Stream *s) const + { + } + + static const lldb::TargetSP + GetTargetFromEvent(const lldb::EventSP &event_sp) + { + TargetSP target_sp; + + const TargetEventData *data = GetEventDataFromEvent (event_sp.get()); + if (data) + target_sp = data->m_target_sp; + + return target_sp; + } + + static const TargetEventData * + GetEventDataFromEvent(const Event *event_ptr) + { + if (event_ptr) + { + const EventData *event_data = event_ptr->GetData(); + if (event_data && event_data->GetFlavor() == TargetEventData::GetFlavorString()) + return static_cast <const TargetEventData *> (event_ptr->GetData()); + } + return nullptr; + } + +private: + lldb::TargetSP m_target_sp; + + DISALLOW_COPY_AND_ASSIGN (TargetEventData); +}; +} + ConstString & Target::GetStaticBroadcasterClass () { @@ -83,7 +154,7 @@ Target::Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::Plat m_scratch_ast_context_ap (), m_scratch_ast_source_ap (), m_ast_importer_ap (), - m_persistent_variables (), + m_persistent_variables (new ClangPersistentVariables), m_source_manager_ap(), m_stop_hooks (), m_stop_hook_next_id (0), @@ -226,7 +297,7 @@ Target::Destroy() m_last_created_watchpoint.reset(); m_search_filter_sp.reset(); m_image_search_paths.Clear(notify); - m_persistent_variables.Clear(); + m_persistent_variables->Clear(); m_stop_hooks.clear(); m_stop_hook_next_id = 0; m_suppress_stop_hooks = false; @@ -1953,7 +2024,7 @@ Target::EvaluateExpression lldb::ClangExpressionVariableSP persistent_var_sp; // Only check for persistent variables the expression starts with a '$' if (expr_cstr[0] == '$') - persistent_var_sp = m_persistent_variables.GetVariable (expr_cstr); + persistent_var_sp = m_persistent_variables->GetVariable (expr_cstr); if (persistent_var_sp) { @@ -1977,6 +2048,12 @@ Target::EvaluateExpression return execution_results; } +ClangPersistentVariables & +Target::GetPersistentVariables() +{ + return *m_persistent_variables; +} + lldb::addr_t Target::GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const { @@ -2723,6 +2800,12 @@ Target::StopHook::~StopHook () } void +Target::StopHook::SetSpecifier(SymbolContextSpecifier *specifier) +{ + m_specifier_sp.reset(specifier); +} + +void Target::StopHook::SetThreadSpecifier (ThreadSpec *specifier) { m_thread_spec_ap.reset (specifier); @@ -3521,61 +3604,3 @@ TargetProperties::DisableSTDIOValueChangedCallback(void *target_property_ptr, Op else this_->m_launch_info.GetFlags().Clear(lldb::eLaunchFlagDisableSTDIO); } - -//---------------------------------------------------------------------- -// Target::TargetEventData -//---------------------------------------------------------------------- -const ConstString & -Target::TargetEventData::GetFlavorString () -{ - static ConstString g_flavor ("Target::TargetEventData"); - return g_flavor; -} - -const ConstString & -Target::TargetEventData::GetFlavor () const -{ - return TargetEventData::GetFlavorString (); -} - -Target::TargetEventData::TargetEventData (const lldb::TargetSP &new_target_sp) : - EventData(), - m_target_sp (new_target_sp) -{ -} - -Target::TargetEventData::~TargetEventData() -{ - -} - -void -Target::TargetEventData::Dump (Stream *s) const -{ - -} - -const TargetSP -Target::TargetEventData::GetTargetFromEvent (const lldb::EventSP &event_sp) -{ - TargetSP target_sp; - - const TargetEventData *data = GetEventDataFromEvent (event_sp.get()); - if (data) - target_sp = data->m_target_sp; - - return target_sp; -} - -const Target::TargetEventData * -Target::TargetEventData::GetEventDataFromEvent (const Event *event_ptr) -{ - if (event_ptr) - { - const EventData *event_data = event_ptr->GetData(); - if (event_data && event_data->GetFlavor() == TargetEventData::GetFlavorString()) - return static_cast <const TargetEventData *> (event_ptr->GetData()); - } - return NULL; -} - diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 6fd5cdf0d15..f127ae1b410 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -21,6 +21,7 @@ #include "lldb/Host/Host.h" #include "lldb/Interpreter/OptionValueFileSpecList.h" #include "lldb/Symbol/Function.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/DynamicLoader.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/ObjCLanguageRuntime.h" diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index 5a3ebd7b128..d6c5a5cf774 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -22,6 +22,7 @@ #include "lldb/Core/Module.h" #include "lldb/Core/Stream.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/LanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp index 0ded99b3091..17bd0f7323c 100644 --- a/lldb/source/Target/ThreadPlanStepOut.cpp +++ b/lldb/source/Target/ThreadPlanStepOut.cpp @@ -21,6 +21,7 @@ #include "lldb/Symbol/Block.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Type.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/StopInfo.h" diff --git a/lldb/source/Target/ThreadPlanTracer.cpp b/lldb/source/Target/ThreadPlanTracer.cpp index 59978c6f8fe..e97bdd4532d 100644 --- a/lldb/source/Target/ThreadPlanTracer.cpp +++ b/lldb/source/Target/ThreadPlanTracer.cpp @@ -26,6 +26,7 @@ #include "lldb/Core/StreamFile.h" #include "lldb/Core/Value.h" #include "lldb/Symbol/TypeList.h" +#include "lldb/Target/ABI.h" #include "lldb/Target/RegisterContext.h" #include "lldb/Target/Thread.h" #include "lldb/Target/Process.h" |

