Target.h revision 47dc457387b690c5e4df1c0c7dd8c4337b92e630
1//===-- Target.h ------------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_Target_h_
11#define liblldb_Target_h_
12
13// C Includes
14// C++ Includes
15
16// Other libraries and framework includes
17// Project includes
18#include "lldb/lldb-public.h"
19#include "lldb/Breakpoint/BreakpointList.h"
20#include "lldb/Breakpoint/BreakpointLocationCollection.h"
21#include "lldb/Breakpoint/WatchpointLocationList.h"
22#include "lldb/Core/Broadcaster.h"
23#include "lldb/Core/Event.h"
24#include "lldb/Core/ModuleList.h"
25#include "lldb/Core/UserSettingsController.h"
26#include "lldb/Core/SourceManager.h"
27#include "lldb/Expression/ClangPersistentVariables.h"
28#include "lldb/Interpreter/NamedOptionValue.h"
29#include "lldb/Symbol/SymbolContext.h"
30#include "lldb/Target/ABI.h"
31#include "lldb/Target/ExecutionContextScope.h"
32#include "lldb/Target/PathMappingList.h"
33#include "lldb/Target/SectionLoadList.h"
34
35#include "lldb/API/SBTarget.h"
36
37namespace lldb_private {
38
39//----------------------------------------------------------------------
40// TargetInstanceSettings
41//----------------------------------------------------------------------
42class TargetInstanceSettings : public InstanceSettings
43{
44public:
45    static OptionEnumValueElement g_dynamic_value_types[];
46
47    TargetInstanceSettings (UserSettingsController &owner, bool live_instance = true, const char *name = NULL);
48
49    TargetInstanceSettings (const TargetInstanceSettings &rhs);
50
51    virtual
52    ~TargetInstanceSettings ();
53
54    TargetInstanceSettings&
55    operator= (const TargetInstanceSettings &rhs);
56
57    void
58    UpdateInstanceSettingsVariable (const ConstString &var_name,
59                                    const char *index_value,
60                                    const char *value,
61                                    const ConstString &instance_name,
62                                    const SettingEntry &entry,
63                                    VarSetOperationType op,
64                                    Error &err,
65                                    bool pending);
66
67    bool
68    GetInstanceSettingsValue (const SettingEntry &entry,
69                              const ConstString &var_name,
70                              StringList &value,
71                              Error *err);
72
73    lldb::DynamicValueType
74    GetPreferDynamicValue()
75    {
76        return (lldb::DynamicValueType) g_dynamic_value_types[m_prefer_dynamic_value].value;
77    }
78
79    bool
80    GetSkipPrologue()
81    {
82        return m_skip_prologue;
83    }
84
85    PathMappingList &
86    GetSourcePathMap ()
87    {
88        return m_source_map;
89    }
90
91    uint32_t
92    GetMaximumNumberOfChildrenToDisplay()
93    {
94        return m_max_children_display;
95    }
96    uint32_t
97    GetMaximumSizeOfStringSummary()
98    {
99        return m_max_strlen_length;
100    }
101
102protected:
103
104    void
105    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
106                          bool pending);
107
108    const ConstString
109    CreateInstanceName ();
110
111    OptionValueFileSpec m_expr_prefix_file;
112    lldb::DataBufferSP m_expr_prefix_contents_sp;
113    int                m_prefer_dynamic_value;
114    OptionValueBoolean m_skip_prologue;
115    PathMappingList m_source_map;
116    uint32_t m_max_children_display;
117    uint32_t m_max_strlen_length;
118
119
120};
121
122//----------------------------------------------------------------------
123// Target
124//----------------------------------------------------------------------
125class Target :
126    public Broadcaster,
127    public ExecutionContextScope,
128    public TargetInstanceSettings
129{
130public:
131    friend class TargetList;
132
133    //------------------------------------------------------------------
134    /// Broadcaster event bits definitions.
135    //------------------------------------------------------------------
136    enum
137    {
138        eBroadcastBitBreakpointChanged  = (1 << 0),
139        eBroadcastBitModulesLoaded      = (1 << 1),
140        eBroadcastBitModulesUnloaded    = (1 << 2)
141    };
142
143    static void
144    SettingsInitialize ();
145
146    static void
147    SettingsTerminate ();
148
149    static lldb::UserSettingsControllerSP &
150    GetSettingsController ();
151
152    static ArchSpec
153    GetDefaultArchitecture ();
154
155    static void
156    SetDefaultArchitecture (const ArchSpec &arch);
157
158    void
159    UpdateInstanceName ();
160
161    lldb::ModuleSP
162    GetSharedModule (const FileSpec& file_spec,
163                     const ArchSpec& arch,
164                     const lldb_private::UUID *uuid = NULL,
165                     const ConstString *object_name = NULL,
166                     off_t object_offset = 0,
167                     Error *error_ptr = NULL);
168private:
169    //------------------------------------------------------------------
170    /// Construct with optional file and arch.
171    ///
172    /// This member is private. Clients must use
173    /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
174    /// so all targets can be tracked from the central target list.
175    ///
176    /// @see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
177    //------------------------------------------------------------------
178    Target (Debugger &debugger,
179            const ArchSpec &target_arch,
180            const lldb::PlatformSP &platform_sp);
181
182public:
183    ~Target();
184
185    Mutex &
186    GetAPIMutex ()
187    {
188        return m_mutex;
189    }
190
191    void
192    DeleteCurrentProcess ();
193
194    //------------------------------------------------------------------
195    /// Dump a description of this object to a Stream.
196    ///
197    /// Dump a description of the contents of this object to the
198    /// supplied stream \a s. The dumped content will be only what has
199    /// been loaded or parsed up to this point at which this function
200    /// is called, so this is a good way to see what has been parsed
201    /// in a target.
202    ///
203    /// @param[in] s
204    ///     The stream to which to dump the object descripton.
205    //------------------------------------------------------------------
206    void
207    Dump (Stream *s, lldb::DescriptionLevel description_level);
208
209    const lldb::ProcessSP &
210    CreateProcess (Listener &listener, const char *plugin_name = NULL);
211
212    const lldb::ProcessSP &
213    GetProcessSP () const;
214
215    lldb::TargetSP
216    GetSP();
217
218    void
219    Destroy();
220
221    //------------------------------------------------------------------
222    // This part handles the breakpoints.
223    //------------------------------------------------------------------
224
225    BreakpointList &
226    GetBreakpointList(bool internal = false);
227
228    const BreakpointList &
229    GetBreakpointList(bool internal = false) const;
230
231    lldb::BreakpointSP
232    GetLastCreatedBreakpoint ()
233    {
234        return m_last_created_breakpoint;
235    }
236
237    lldb::BreakpointSP
238    GetBreakpointByID (lldb::break_id_t break_id);
239
240    // Use this to create a file and line breakpoint to a given module or all module it is NULL
241    lldb::BreakpointSP
242    CreateBreakpoint (const FileSpec *containingModule,
243                      const FileSpec &file,
244                      uint32_t line_no,
245                      bool check_inlines,
246                      bool internal = false);
247
248    // Use this to create a breakpoint from a load address
249    lldb::BreakpointSP
250    CreateBreakpoint (lldb::addr_t load_addr,
251                      bool internal = false);
252
253    // Use this to create Address breakpoints:
254    lldb::BreakpointSP
255    CreateBreakpoint (Address &addr,
256                      bool internal = false);
257
258    // Use this to create a function breakpoint by regexp in containingModule, or all modules if it is NULL
259    // When "skip_prologue is set to eLazyBoolCalculate, we use the current target
260    // setting, else we use the values passed in
261    lldb::BreakpointSP
262    CreateBreakpoint (const FileSpec *containingModule,
263                      RegularExpression &func_regexp,
264                      bool internal = false,
265                      LazyBool skip_prologue = eLazyBoolCalculate);
266
267    // Use this to create a function breakpoint by name in containingModule, or all modules if it is NULL
268    // When "skip_prologue is set to eLazyBoolCalculate, we use the current target
269    // setting, else we use the values passed in
270    lldb::BreakpointSP
271    CreateBreakpoint (const FileSpec *containingModule,
272                      const char *func_name,
273                      uint32_t func_name_type_mask,
274                      bool internal = false,
275                      LazyBool skip_prologue = eLazyBoolCalculate);
276
277    // Use this to create a general breakpoint:
278    lldb::BreakpointSP
279    CreateBreakpoint (lldb::SearchFilterSP &filter_sp,
280                      lldb::BreakpointResolverSP &resolver_sp,
281                      bool internal = false);
282
283    // Use this to create a watchpoint location:
284    lldb::WatchpointLocationSP
285    CreateWatchpointLocation (lldb::addr_t addr,
286                              size_t size,
287                              uint32_t type);
288
289    WatchpointLocationList &
290    GetWatchpointLocationList()
291    {
292        return m_watchpoint_location_list;
293    }
294
295    void
296    RemoveAllBreakpoints (bool internal_also = false);
297
298    void
299    DisableAllBreakpoints (bool internal_also = false);
300
301    void
302    EnableAllBreakpoints (bool internal_also = false);
303
304    bool
305    DisableBreakpointByID (lldb::break_id_t break_id);
306
307    bool
308    EnableBreakpointByID (lldb::break_id_t break_id);
309
310    bool
311    RemoveBreakpointByID (lldb::break_id_t break_id);
312
313    void
314    ModulesDidLoad (ModuleList &module_list);
315
316    void
317    ModulesDidUnload (ModuleList &module_list);
318
319
320    //------------------------------------------------------------------
321    /// Get \a load_addr as a callable code load address for this target
322    ///
323    /// Take \a load_addr and potentially add any address bits that are
324    /// needed to make the address callable. For ARM this can set bit
325    /// zero (if it already isn't) if \a load_addr is a thumb function.
326    /// If \a addr_class is set to eAddressClassInvalid, then the address
327    /// adjustment will always happen. If it is set to an address class
328    /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
329    /// returned.
330    //------------------------------------------------------------------
331    lldb::addr_t
332    GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class = lldb_private::eAddressClassInvalid) const;
333
334    //------------------------------------------------------------------
335    /// Get \a load_addr as an opcode for this target.
336    ///
337    /// Take \a load_addr and potentially strip any address bits that are
338    /// needed to make the address point to an opcode. For ARM this can
339    /// clear bit zero (if it already isn't) if \a load_addr is a
340    /// thumb function and load_addr is in code.
341    /// If \a addr_class is set to eAddressClassInvalid, then the address
342    /// adjustment will always happen. If it is set to an address class
343    /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
344    /// returned.
345    //------------------------------------------------------------------
346    lldb::addr_t
347    GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class = lldb_private::eAddressClassInvalid) const;
348
349protected:
350    void
351    ModuleAdded (lldb::ModuleSP &module_sp);
352
353    void
354    ModuleUpdated (lldb::ModuleSP &old_module_sp, lldb::ModuleSP &new_module_sp);
355
356public:
357    //------------------------------------------------------------------
358    /// Gets the module for the main executable.
359    ///
360    /// Each process has a notion of a main executable that is the file
361    /// that will be executed or attached to. Executable files can have
362    /// dependent modules that are discovered from the object files, or
363    /// discovered at runtime as things are dynamically loaded.
364    ///
365    /// @return
366    ///     The shared pointer to the executable module which can
367    ///     contains a NULL Module object if no executable has been
368    ///     set.
369    ///
370    /// @see DynamicLoader
371    /// @see ObjectFile::GetDependentModules (FileSpecList&)
372    /// @see Process::SetExecutableModule(lldb::ModuleSP&)
373    //------------------------------------------------------------------
374    lldb::ModuleSP
375    GetExecutableModule ();
376
377    Module*
378    GetExecutableModulePointer ();
379
380    //------------------------------------------------------------------
381    /// Set the main executable module.
382    ///
383    /// Each process has a notion of a main executable that is the file
384    /// that will be executed or attached to. Executable files can have
385    /// dependent modules that are discovered from the object files, or
386    /// discovered at runtime as things are dynamically loaded.
387    ///
388    /// Setting the executable causes any of the current dependant
389    /// image information to be cleared and replaced with the static
390    /// dependent image information found by calling
391    /// ObjectFile::GetDependentModules (FileSpecList&) on the main
392    /// executable and any modules on which it depends. Calling
393    /// Process::GetImages() will return the newly found images that
394    /// were obtained from all of the object files.
395    ///
396    /// @param[in] module_sp
397    ///     A shared pointer reference to the module that will become
398    ///     the main executable for this process.
399    ///
400    /// @param[in] get_dependent_files
401    ///     If \b true then ask the object files to track down any
402    ///     known dependent files.
403    ///
404    /// @see ObjectFile::GetDependentModules (FileSpecList&)
405    /// @see Process::GetImages()
406    //------------------------------------------------------------------
407    void
408    SetExecutableModule (lldb::ModuleSP& module_sp, bool get_dependent_files);
409
410    //------------------------------------------------------------------
411    /// Get accessor for the images for this process.
412    ///
413    /// Each process has a notion of a main executable that is the file
414    /// that will be executed or attached to. Executable files can have
415    /// dependent modules that are discovered from the object files, or
416    /// discovered at runtime as things are dynamically loaded. After
417    /// a main executable has been set, the images will contain a list
418    /// of all the files that the executable depends upon as far as the
419    /// object files know. These images will usually contain valid file
420    /// virtual addresses only. When the process is launched or attached
421    /// to, the DynamicLoader plug-in will discover where these images
422    /// were loaded in memory and will resolve the load virtual
423    /// addresses is each image, and also in images that are loaded by
424    /// code.
425    ///
426    /// @return
427    ///     A list of Module objects in a module list.
428    //------------------------------------------------------------------
429    ModuleList&
430    GetImages ()
431    {
432        return m_images;
433    }
434
435    const ModuleList&
436    GetImages () const
437    {
438        return m_images;
439    }
440
441    ArchSpec &
442    GetArchitecture ()
443    {
444        return m_arch;
445    }
446
447    const ArchSpec &
448    GetArchitecture () const
449    {
450        return m_arch;
451    }
452
453    //------------------------------------------------------------------
454    /// Set the architecture for this target.
455    ///
456    /// If the current target has no Images read in, then this just sets the architecture, which will
457    /// be used to select the architecture of the ExecutableModule when that is set.
458    /// If the current target has an ExecutableModule, then calling SetArchitecture with a different
459    /// architecture from the currently selected one will reset the ExecutableModule to that slice
460    /// of the file backing the ExecutableModule.  If the file backing the ExecutableModule does not
461    /// contain a fork of this architecture, then this code will return false, and the architecture
462    /// won't be changed.
463    /// If the input arch_spec is the same as the already set architecture, this is a no-op.
464    ///
465    /// @param[in] arch_spec
466    ///     The new architecture.
467    ///
468    /// @return
469    ///     \b true if the architecture was successfully set, \bfalse otherwise.
470    //------------------------------------------------------------------
471    bool
472    SetArchitecture (const ArchSpec &arch_spec);
473
474    Debugger &
475    GetDebugger ()
476    {
477        return m_debugger;
478    }
479
480    size_t
481    ReadMemoryFromFileCache (const Address& addr,
482                             void *dst,
483                             size_t dst_len,
484                             Error &error);
485
486    // Reading memory through the target allows us to skip going to the process
487    // for reading memory if possible and it allows us to try and read from
488    // any constant sections in our object files on disk. If you always want
489    // live program memory, read straight from the process. If you possibly
490    // want to read from const sections in object files, read from the target.
491    // This version of ReadMemory will try and read memory from the process
492    // if the process is alive. The order is:
493    // 1 - if (prefer_file_cache == true) then read from object file cache
494    // 2 - if there is a valid process, try and read from its memory
495    // 3 - if (prefer_file_cache == false) then read from object file cache
496    size_t
497    ReadMemory (const Address& addr,
498                bool prefer_file_cache,
499                void *dst,
500                size_t dst_len,
501                Error &error,
502                lldb::addr_t *load_addr_ptr = NULL);
503
504    size_t
505    ReadScalarIntegerFromMemory (const Address& addr,
506                                 bool prefer_file_cache,
507                                 uint32_t byte_size,
508                                 bool is_signed,
509                                 Scalar &scalar,
510                                 Error &error);
511
512    uint64_t
513    ReadUnsignedIntegerFromMemory (const Address& addr,
514                                   bool prefer_file_cache,
515                                   size_t integer_byte_size,
516                                   uint64_t fail_value,
517                                   Error &error);
518
519    bool
520    ReadPointerFromMemory (const Address& addr,
521                           bool prefer_file_cache,
522                           Error &error,
523                           Address &pointer_addr);
524
525    SectionLoadList&
526    GetSectionLoadList()
527    {
528        return m_section_load_list;
529    }
530
531    const SectionLoadList&
532    GetSectionLoadList() const
533    {
534        return m_section_load_list;
535    }
536
537
538    //------------------------------------------------------------------
539    /// Load a module in this target by at the section file addresses
540    /// with an optional constant slide applied to each section.
541    ///
542    /// This function will load all top level sections at their file
543    /// addresses and apply an optional constant slide amount to each
544    /// section. This can be used to easily load a module at the same
545    /// addresses that are contained in the object file (trust that
546    /// the addresses in an object file are the correct load addresses).
547    ///
548    /// @param[in] module
549    ///     The module to load.
550    ///
551    /// @param[in] slide
552    ///     A constant slide to add to each file address as each section
553    ///     is being loaded.
554    ///
555    /// @return
556    ///     \b true if loading the module at the specified address
557    ///     causes a section to be loaded when it previously wasn't, or
558    ///     if a section changes load address. Returns \b false if
559    ///     the sections were all already loaded at these addresses.
560    //------------------------------------------------------------------
561    bool
562    LoadModuleWithSlide (Module *module, lldb::addr_t slide);
563
564    static Target *
565    GetTargetFromContexts (const ExecutionContext *exe_ctx_ptr,
566                           const SymbolContext *sc_ptr);
567
568    //------------------------------------------------------------------
569    // lldb::ExecutionContextScope pure virtual functions
570    //------------------------------------------------------------------
571    virtual Target *
572    CalculateTarget ();
573
574    virtual Process *
575    CalculateProcess ();
576
577    virtual Thread *
578    CalculateThread ();
579
580    virtual StackFrame *
581    CalculateStackFrame ();
582
583    virtual void
584    CalculateExecutionContext (ExecutionContext &exe_ctx);
585
586    PathMappingList &
587    GetImageSearchPathList ();
588
589    ClangASTContext *
590    GetScratchClangASTContext();
591
592    const char *
593    GetExpressionPrefixContentsAsCString ();
594
595    // Since expressions results can persist beyond the lifetime of a process,
596    // and the const expression results are available after a process is gone,
597    // we provide a way for expressions to be evaluated from the Target itself.
598    // If an expression is going to be run, then it should have a frame filled
599    // in in th execution context.
600    ExecutionResults
601    EvaluateExpression (const char *expression,
602                        StackFrame *frame,
603                        lldb_private::ExecutionPolicy execution_policy,
604                        bool unwind_on_error,
605                        bool keep_in_memory,
606                        lldb::DynamicValueType use_dynamic,
607                        lldb::ValueObjectSP &result_valobj_sp);
608
609    ClangPersistentVariables &
610    GetPersistentVariables()
611    {
612        return m_persistent_variables;
613    }
614
615    //------------------------------------------------------------------
616    // Target Stop Hooks
617    //------------------------------------------------------------------
618    class StopHook : public UserID
619    {
620    public:
621        ~StopHook ();
622
623        StopHook (const StopHook &rhs);
624
625        StringList *
626        GetCommandPointer ()
627        {
628            return &m_commands;
629        }
630
631        const StringList &
632        GetCommands()
633        {
634            return m_commands;
635        }
636
637        lldb::TargetSP &
638        GetTarget()
639        {
640            return m_target_sp;
641        }
642
643        void
644        SetCommands (StringList &in_commands)
645        {
646            m_commands = in_commands;
647        }
648
649        // Set the specifier.  The stop hook will own the specifier, and is responsible for deleting it when we're done.
650        void
651        SetSpecifier (SymbolContextSpecifier *specifier)
652        {
653            m_specifier_sp.reset (specifier);
654        }
655
656        SymbolContextSpecifier *
657        GetSpecifier ()
658        {
659            return m_specifier_sp.get();
660        }
661
662        // Set the Thread Specifier.  The stop hook will own the thread specifier, and is responsible for deleting it when we're done.
663        void
664        SetThreadSpecifier (ThreadSpec *specifier);
665
666        ThreadSpec *
667        GetThreadSpecifier()
668        {
669            return m_thread_spec_ap.get();
670        }
671
672        bool
673        IsActive()
674        {
675            return m_active;
676        }
677
678        void
679        SetIsActive (bool is_active)
680        {
681            m_active = is_active;
682        }
683
684        void
685        GetDescription (Stream *s, lldb::DescriptionLevel level) const;
686
687    private:
688        lldb::TargetSP m_target_sp;
689        StringList   m_commands;
690        lldb::SymbolContextSpecifierSP m_specifier_sp;
691        std::auto_ptr<ThreadSpec> m_thread_spec_ap;
692        bool m_active;
693
694        // Use AddStopHook to make a new empty stop hook.  The GetCommandPointer and fill it with commands,
695        // and SetSpecifier to set the specifier shared pointer (can be null, that will match anything.)
696        StopHook (lldb::TargetSP target_sp, lldb::user_id_t uid);
697        friend class Target;
698    };
699    typedef lldb::SharedPtr<StopHook>::Type StopHookSP;
700
701    // Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook.
702    // Returns the id of the new hook.
703    lldb::user_id_t
704    AddStopHook (StopHookSP &new_hook);
705
706    void
707    RunStopHooks ();
708
709    size_t
710    GetStopHookSize();
711
712    bool
713    SetSuppresStopHooks (bool suppress)
714    {
715        bool old_value = m_suppress_stop_hooks;
716        m_suppress_stop_hooks = suppress;
717        return old_value;
718    }
719
720    bool
721    GetSuppressStopHooks ()
722    {
723        return m_suppress_stop_hooks;
724    }
725
726//    StopHookSP &
727//    GetStopHookByIndex (size_t index);
728//
729    bool
730    RemoveStopHookByID (lldb::user_id_t uid);
731
732    void
733    RemoveAllStopHooks ();
734
735    StopHookSP
736    GetStopHookByID (lldb::user_id_t uid);
737
738    bool
739    SetStopHookActiveStateByID (lldb::user_id_t uid, bool active_state);
740
741    void
742    SetAllStopHooksActiveState (bool active_state);
743
744    size_t GetNumStopHooks () const
745    {
746        return m_stop_hooks.size();
747    }
748
749    StopHookSP
750    GetStopHookAtIndex (size_t index)
751    {
752        if (index >= GetNumStopHooks())
753            return StopHookSP();
754        StopHookCollection::iterator pos = m_stop_hooks.begin();
755
756        while (index > 0)
757        {
758            pos++;
759            index--;
760        }
761        return (*pos).second;
762    }
763
764    lldb::PlatformSP
765    GetPlatform ()
766    {
767        return m_platform_sp;
768    }
769
770    SourceManager &
771    GetSourceManager ()
772    {
773        return m_source_manager;
774    }
775
776    //------------------------------------------------------------------
777    // Target::SettingsController
778    //------------------------------------------------------------------
779    class SettingsController : public UserSettingsController
780    {
781    public:
782        SettingsController ();
783
784        virtual
785        ~SettingsController ();
786
787        bool
788        SetGlobalVariable (const ConstString &var_name,
789                           const char *index_value,
790                           const char *value,
791                           const SettingEntry &entry,
792                           const VarSetOperationType op,
793                           Error&err);
794
795        bool
796        GetGlobalVariable (const ConstString &var_name,
797                           StringList &value,
798                           Error &err);
799
800        static SettingEntry global_settings_table[];
801        static SettingEntry instance_settings_table[];
802
803        ArchSpec &
804        GetArchitecture ()
805        {
806            return m_default_architecture;
807        }
808    protected:
809
810        lldb::InstanceSettingsSP
811        CreateInstanceSettings (const char *instance_name);
812
813    private:
814
815        // Class-wide settings.
816        ArchSpec m_default_architecture;
817
818        DISALLOW_COPY_AND_ASSIGN (SettingsController);
819    };
820
821
822protected:
823    friend class lldb::SBTarget;
824
825    //------------------------------------------------------------------
826    // Member variables.
827    //------------------------------------------------------------------
828    Debugger &      m_debugger;
829    lldb::PlatformSP m_platform_sp;     ///< The platform for this target.
830    Mutex           m_mutex;            ///< An API mutex that is used by the lldb::SB* classes make the SB interface thread safe
831    ArchSpec        m_arch;
832    ModuleList      m_images;           ///< The list of images for this process (shared libraries and anything dynamically loaded).
833    SectionLoadList m_section_load_list;
834    BreakpointList  m_breakpoint_list;
835    BreakpointList  m_internal_breakpoint_list;
836    lldb::BreakpointSP m_last_created_breakpoint;
837    WatchpointLocationList  m_watchpoint_location_list;
838    // We want to tightly control the process destruction process so
839    // we can correctly tear down everything that we need to, so the only
840    // class that knows about the process lifespan is this target class.
841    lldb::ProcessSP m_process_sp;
842    lldb::SearchFilterSP  m_search_filter_sp;
843    PathMappingList m_image_search_paths;
844    std::auto_ptr<ClangASTContext> m_scratch_ast_context_ap;
845    ClangPersistentVariables m_persistent_variables;      ///< These are the persistent variables associated with this process for the expression parser.
846
847    SourceManager m_source_manager;
848
849    typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
850    StopHookCollection      m_stop_hooks;
851    lldb::user_id_t         m_stop_hook_next_id;
852    bool                    m_suppress_stop_hooks;
853
854    //------------------------------------------------------------------
855    // Methods.
856    //------------------------------------------------------------------
857    lldb::SearchFilterSP
858    GetSearchFilterForModule (const FileSpec *containingModule);
859
860    static void
861    ImageSearchPathsChanged (const PathMappingList &path_list,
862                             void *baton);
863
864private:
865    DISALLOW_COPY_AND_ASSIGN (Target);
866};
867
868} // namespace lldb_private
869
870#endif  // liblldb_Target_h_
871