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