Target.h revision fdf24efe672bf3fa041cdbebd2d7f406b11882bd
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    WatchpointLocationList &
284    GetWatchpointLocationList()
285    {
286        return m_watchpoint_location_list;
287    }
288
289    void
290    RemoveAllBreakpoints (bool internal_also = false);
291
292    void
293    DisableAllBreakpoints (bool internal_also = false);
294
295    void
296    EnableAllBreakpoints (bool internal_also = false);
297
298    bool
299    DisableBreakpointByID (lldb::break_id_t break_id);
300
301    bool
302    EnableBreakpointByID (lldb::break_id_t break_id);
303
304    bool
305    RemoveBreakpointByID (lldb::break_id_t break_id);
306
307    void
308    ModulesDidLoad (ModuleList &module_list);
309
310    void
311    ModulesDidUnload (ModuleList &module_list);
312
313
314    //------------------------------------------------------------------
315    /// Get \a load_addr as a callable code load address for this target
316    ///
317    /// Take \a load_addr and potentially add any address bits that are
318    /// needed to make the address callable. For ARM this can set bit
319    /// zero (if it already isn't) if \a load_addr is a thumb function.
320    /// If \a addr_class is set to eAddressClassInvalid, then the address
321    /// adjustment will always happen. If it is set to an address class
322    /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
323    /// returned.
324    //------------------------------------------------------------------
325    lldb::addr_t
326    GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class = lldb_private::eAddressClassInvalid) const;
327
328    //------------------------------------------------------------------
329    /// Get \a load_addr as an opcode for this target.
330    ///
331    /// Take \a load_addr and potentially strip any address bits that are
332    /// needed to make the address point to an opcode. For ARM this can
333    /// clear bit zero (if it already isn't) if \a load_addr is a
334    /// thumb function and load_addr is in code.
335    /// If \a addr_class is set to eAddressClassInvalid, then the address
336    /// adjustment will always happen. If it is set to an address class
337    /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
338    /// returned.
339    //------------------------------------------------------------------
340    lldb::addr_t
341    GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class = lldb_private::eAddressClassInvalid) const;
342
343protected:
344    void
345    ModuleAdded (lldb::ModuleSP &module_sp);
346
347    void
348    ModuleUpdated (lldb::ModuleSP &old_module_sp, lldb::ModuleSP &new_module_sp);
349
350public:
351    //------------------------------------------------------------------
352    /// Gets the module for the main executable.
353    ///
354    /// Each process has a notion of a main executable that is the file
355    /// that will be executed or attached to. Executable files can have
356    /// dependent modules that are discovered from the object files, or
357    /// discovered at runtime as things are dynamically loaded.
358    ///
359    /// @return
360    ///     The shared pointer to the executable module which can
361    ///     contains a NULL Module object if no executable has been
362    ///     set.
363    ///
364    /// @see DynamicLoader
365    /// @see ObjectFile::GetDependentModules (FileSpecList&)
366    /// @see Process::SetExecutableModule(lldb::ModuleSP&)
367    //------------------------------------------------------------------
368    lldb::ModuleSP
369    GetExecutableModule ();
370
371    Module*
372    GetExecutableModulePointer ();
373
374    //------------------------------------------------------------------
375    /// Set the main executable module.
376    ///
377    /// Each process has a notion of a main executable that is the file
378    /// that will be executed or attached to. Executable files can have
379    /// dependent modules that are discovered from the object files, or
380    /// discovered at runtime as things are dynamically loaded.
381    ///
382    /// Setting the executable causes any of the current dependant
383    /// image information to be cleared and replaced with the static
384    /// dependent image information found by calling
385    /// ObjectFile::GetDependentModules (FileSpecList&) on the main
386    /// executable and any modules on which it depends. Calling
387    /// Process::GetImages() will return the newly found images that
388    /// were obtained from all of the object files.
389    ///
390    /// @param[in] module_sp
391    ///     A shared pointer reference to the module that will become
392    ///     the main executable for this process.
393    ///
394    /// @param[in] get_dependent_files
395    ///     If \b true then ask the object files to track down any
396    ///     known dependent files.
397    ///
398    /// @see ObjectFile::GetDependentModules (FileSpecList&)
399    /// @see Process::GetImages()
400    //------------------------------------------------------------------
401    void
402    SetExecutableModule (lldb::ModuleSP& module_sp, bool get_dependent_files);
403
404    //------------------------------------------------------------------
405    /// Get accessor for the images for this process.
406    ///
407    /// Each process has a notion of a main executable that is the file
408    /// that will be executed or attached to. Executable files can have
409    /// dependent modules that are discovered from the object files, or
410    /// discovered at runtime as things are dynamically loaded. After
411    /// a main executable has been set, the images will contain a list
412    /// of all the files that the executable depends upon as far as the
413    /// object files know. These images will usually contain valid file
414    /// virtual addresses only. When the process is launched or attached
415    /// to, the DynamicLoader plug-in will discover where these images
416    /// were loaded in memory and will resolve the load virtual
417    /// addresses is each image, and also in images that are loaded by
418    /// code.
419    ///
420    /// @return
421    ///     A list of Module objects in a module list.
422    //------------------------------------------------------------------
423    ModuleList&
424    GetImages ()
425    {
426        return m_images;
427    }
428
429    const ModuleList&
430    GetImages () const
431    {
432        return m_images;
433    }
434
435    ArchSpec &
436    GetArchitecture ()
437    {
438        return m_arch;
439    }
440
441    const ArchSpec &
442    GetArchitecture () const
443    {
444        return m_arch;
445    }
446
447    //------------------------------------------------------------------
448    /// Set the architecture for this target.
449    ///
450    /// If the current target has no Images read in, then this just sets the architecture, which will
451    /// be used to select the architecture of the ExecutableModule when that is set.
452    /// If the current target has an ExecutableModule, then calling SetArchitecture with a different
453    /// architecture from the currently selected one will reset the ExecutableModule to that slice
454    /// of the file backing the ExecutableModule.  If the file backing the ExecutableModule does not
455    /// contain a fork of this architecture, then this code will return false, and the architecture
456    /// won't be changed.
457    /// If the input arch_spec is the same as the already set architecture, this is a no-op.
458    ///
459    /// @param[in] arch_spec
460    ///     The new architecture.
461    ///
462    /// @return
463    ///     \b true if the architecture was successfully set, \bfalse otherwise.
464    //------------------------------------------------------------------
465    bool
466    SetArchitecture (const ArchSpec &arch_spec);
467
468    Debugger &
469    GetDebugger ()
470    {
471        return m_debugger;
472    }
473
474    size_t
475    ReadMemoryFromFileCache (const Address& addr,
476                             void *dst,
477                             size_t dst_len,
478                             Error &error);
479
480    // Reading memory through the target allows us to skip going to the process
481    // for reading memory if possible and it allows us to try and read from
482    // any constant sections in our object files on disk. If you always want
483    // live program memory, read straight from the process. If you possibly
484    // want to read from const sections in object files, read from the target.
485    // This version of ReadMemory will try and read memory from the process
486    // if the process is alive. The order is:
487    // 1 - if (prefer_file_cache == true) then read from object file cache
488    // 2 - if there is a valid process, try and read from its memory
489    // 3 - if (prefer_file_cache == false) then read from object file cache
490    size_t
491    ReadMemory (const Address& addr,
492                bool prefer_file_cache,
493                void *dst,
494                size_t dst_len,
495                Error &error,
496                lldb::addr_t *load_addr_ptr = NULL);
497
498    size_t
499    ReadScalarIntegerFromMemory (const Address& addr,
500                                 bool prefer_file_cache,
501                                 uint32_t byte_size,
502                                 bool is_signed,
503                                 Scalar &scalar,
504                                 Error &error);
505
506    uint64_t
507    ReadUnsignedIntegerFromMemory (const Address& addr,
508                                   bool prefer_file_cache,
509                                   size_t integer_byte_size,
510                                   uint64_t fail_value,
511                                   Error &error);
512
513    bool
514    ReadPointerFromMemory (const Address& addr,
515                           bool prefer_file_cache,
516                           Error &error,
517                           Address &pointer_addr);
518
519    SectionLoadList&
520    GetSectionLoadList()
521    {
522        return m_section_load_list;
523    }
524
525    const SectionLoadList&
526    GetSectionLoadList() const
527    {
528        return m_section_load_list;
529    }
530
531
532    //------------------------------------------------------------------
533    /// Load a module in this target by at the section file addresses
534    /// with an optional constant slide applied to each section.
535    ///
536    /// This function will load all top level sections at their file
537    /// addresses and apply an optional constant slide amount to each
538    /// section. This can be used to easily load a module at the same
539    /// addresses that are contained in the object file (trust that
540    /// the addresses in an object file are the correct load addresses).
541    ///
542    /// @param[in] module
543    ///     The module to load.
544    ///
545    /// @param[in] slide
546    ///     A constant slide to add to each file address as each section
547    ///     is being loaded.
548    ///
549    /// @return
550    ///     \b true if loading the module at the specified address
551    ///     causes a section to be loaded when it previously wasn't, or
552    ///     if a section changes load address. Returns \b false if
553    ///     the sections were all already loaded at these addresses.
554    //------------------------------------------------------------------
555    bool
556    LoadModuleWithSlide (Module *module, lldb::addr_t slide);
557
558    static Target *
559    GetTargetFromContexts (const ExecutionContext *exe_ctx_ptr,
560                           const SymbolContext *sc_ptr);
561
562    //------------------------------------------------------------------
563    // lldb::ExecutionContextScope pure virtual functions
564    //------------------------------------------------------------------
565    virtual Target *
566    CalculateTarget ();
567
568    virtual Process *
569    CalculateProcess ();
570
571    virtual Thread *
572    CalculateThread ();
573
574    virtual StackFrame *
575    CalculateStackFrame ();
576
577    virtual void
578    CalculateExecutionContext (ExecutionContext &exe_ctx);
579
580    PathMappingList &
581    GetImageSearchPathList ();
582
583    ClangASTContext *
584    GetScratchClangASTContext();
585
586    const char *
587    GetExpressionPrefixContentsAsCString ();
588
589    // Since expressions results can persist beyond the lifetime of a process,
590    // and the const expression results are available after a process is gone,
591    // we provide a way for expressions to be evaluated from the Target itself.
592    // If an expression is going to be run, then it should have a frame filled
593    // in in th execution context.
594    ExecutionResults
595    EvaluateExpression (const char *expression,
596                        StackFrame *frame,
597                        bool unwind_on_error,
598                        bool keep_in_memory,
599                        lldb::DynamicValueType use_dynamic,
600                        lldb::ValueObjectSP &result_valobj_sp);
601
602    ClangPersistentVariables &
603    GetPersistentVariables()
604    {
605        return m_persistent_variables;
606    }
607
608    //------------------------------------------------------------------
609    // Target Stop Hooks
610    //------------------------------------------------------------------
611    class StopHook : public UserID
612    {
613    public:
614        ~StopHook ();
615
616        StopHook (const StopHook &rhs);
617
618        StringList *
619        GetCommandPointer ()
620        {
621            return &m_commands;
622        }
623
624        const StringList &
625        GetCommands()
626        {
627            return m_commands;
628        }
629
630        lldb::TargetSP &
631        GetTarget()
632        {
633            return m_target_sp;
634        }
635
636        void
637        SetCommands (StringList &in_commands)
638        {
639            m_commands = in_commands;
640        }
641
642        // Set the specifier.  The stop hook will own the specifier, and is responsible for deleting it when we're done.
643        void
644        SetSpecifier (SymbolContextSpecifier *specifier)
645        {
646            m_specifier_sp.reset (specifier);
647        }
648
649        SymbolContextSpecifier *
650        GetSpecifier ()
651        {
652            return m_specifier_sp.get();
653        }
654
655        // Set the Thread Specifier.  The stop hook will own the thread specifier, and is responsible for deleting it when we're done.
656        void
657        SetThreadSpecifier (ThreadSpec *specifier);
658
659        ThreadSpec *
660        GetThreadSpecifier()
661        {
662            return m_thread_spec_ap.get();
663        }
664
665        bool
666        IsActive()
667        {
668            return m_active;
669        }
670
671        void
672        SetIsActive (bool is_active)
673        {
674            m_active = is_active;
675        }
676
677        void
678        GetDescription (Stream *s, lldb::DescriptionLevel level) const;
679
680    private:
681        lldb::TargetSP m_target_sp;
682        StringList   m_commands;
683        lldb::SymbolContextSpecifierSP m_specifier_sp;
684        std::auto_ptr<ThreadSpec> m_thread_spec_ap;
685        bool m_active;
686
687        // Use AddStopHook to make a new empty stop hook.  The GetCommandPointer and fill it with commands,
688        // and SetSpecifier to set the specifier shared pointer (can be null, that will match anything.)
689        StopHook (lldb::TargetSP target_sp, lldb::user_id_t uid);
690        friend class Target;
691    };
692    typedef lldb::SharedPtr<StopHook>::Type StopHookSP;
693
694    // Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook.
695    // Returns the id of the new hook.
696    lldb::user_id_t
697    AddStopHook (StopHookSP &new_hook);
698
699    void
700    RunStopHooks ();
701
702    size_t
703    GetStopHookSize();
704
705    bool
706    SetSuppresStopHooks (bool suppress)
707    {
708        bool old_value = m_suppress_stop_hooks;
709        m_suppress_stop_hooks = suppress;
710        return old_value;
711    }
712
713    bool
714    GetSuppressStopHooks ()
715    {
716        return m_suppress_stop_hooks;
717    }
718
719//    StopHookSP &
720//    GetStopHookByIndex (size_t index);
721//
722    bool
723    RemoveStopHookByID (lldb::user_id_t uid);
724
725    void
726    RemoveAllStopHooks ();
727
728    StopHookSP
729    GetStopHookByID (lldb::user_id_t uid);
730
731    bool
732    SetStopHookActiveStateByID (lldb::user_id_t uid, bool active_state);
733
734    void
735    SetAllStopHooksActiveState (bool active_state);
736
737    size_t GetNumStopHooks () const
738    {
739        return m_stop_hooks.size();
740    }
741
742    StopHookSP
743    GetStopHookAtIndex (size_t index)
744    {
745        if (index >= GetNumStopHooks())
746            return StopHookSP();
747        StopHookCollection::iterator pos = m_stop_hooks.begin();
748
749        while (index > 0)
750        {
751            pos++;
752            index--;
753        }
754        return (*pos).second;
755    }
756
757    lldb::PlatformSP
758    GetPlatform ()
759    {
760        return m_platform_sp;
761    }
762
763    SourceManager &
764    GetSourceManager ()
765    {
766        return m_source_manager;
767    }
768
769    //------------------------------------------------------------------
770    // Target::SettingsController
771    //------------------------------------------------------------------
772    class SettingsController : public UserSettingsController
773    {
774    public:
775        SettingsController ();
776
777        virtual
778        ~SettingsController ();
779
780        bool
781        SetGlobalVariable (const ConstString &var_name,
782                           const char *index_value,
783                           const char *value,
784                           const SettingEntry &entry,
785                           const VarSetOperationType op,
786                           Error&err);
787
788        bool
789        GetGlobalVariable (const ConstString &var_name,
790                           StringList &value,
791                           Error &err);
792
793        static SettingEntry global_settings_table[];
794        static SettingEntry instance_settings_table[];
795
796        ArchSpec &
797        GetArchitecture ()
798        {
799            return m_default_architecture;
800        }
801    protected:
802
803        lldb::InstanceSettingsSP
804        CreateInstanceSettings (const char *instance_name);
805
806    private:
807
808        // Class-wide settings.
809        ArchSpec m_default_architecture;
810
811        DISALLOW_COPY_AND_ASSIGN (SettingsController);
812    };
813
814
815protected:
816    friend class lldb::SBTarget;
817
818    //------------------------------------------------------------------
819    // Member variables.
820    //------------------------------------------------------------------
821    Debugger &      m_debugger;
822    lldb::PlatformSP m_platform_sp;     ///< The platform for this target.
823    Mutex           m_mutex;            ///< An API mutex that is used by the lldb::SB* classes make the SB interface thread safe
824    ArchSpec        m_arch;
825    ModuleList      m_images;           ///< The list of images for this process (shared libraries and anything dynamically loaded).
826    SectionLoadList m_section_load_list;
827    BreakpointList  m_breakpoint_list;
828    BreakpointList  m_internal_breakpoint_list;
829    lldb::BreakpointSP m_last_created_breakpoint;
830    WatchpointLocationList  m_watchpoint_location_list;
831    // We want to tightly control the process destruction process so
832    // we can correctly tear down everything that we need to, so the only
833    // class that knows about the process lifespan is this target class.
834    lldb::ProcessSP m_process_sp;
835    lldb::SearchFilterSP  m_search_filter_sp;
836    PathMappingList m_image_search_paths;
837    std::auto_ptr<ClangASTContext> m_scratch_ast_context_ap;
838    ClangPersistentVariables m_persistent_variables;      ///< These are the persistent variables associated with this process for the expression parser.
839
840    SourceManager m_source_manager;
841
842    typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
843    StopHookCollection      m_stop_hooks;
844    lldb::user_id_t         m_stop_hook_next_id;
845    bool                    m_suppress_stop_hooks;
846
847    //------------------------------------------------------------------
848    // Methods.
849    //------------------------------------------------------------------
850    lldb::SearchFilterSP
851    GetSearchFilterForModule (const FileSpec *containingModule);
852
853    static void
854    ImageSearchPathsChanged (const PathMappingList &path_list,
855                             void *baton);
856
857private:
858    DISALLOW_COPY_AND_ASSIGN (Target);
859};
860
861} // namespace lldb_private
862
863#endif  // liblldb_Target_h_
864