]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/Target.h
Upgrade our copies of clang, llvm, lldb and compiler-rt to 3.8.0
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / Target.h
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 #include <list>
16 #include <map>
17 #include <memory>
18 #include <string>
19 #include <vector>
20
21 // Other libraries and framework includes
22 // Project includes
23 #include "lldb/lldb-public.h"
24 #include "lldb/Breakpoint/BreakpointList.h"
25 #include "lldb/Breakpoint/WatchpointList.h"
26 #include "lldb/Core/ArchSpec.h"
27 #include "lldb/Core/Broadcaster.h"
28 #include "lldb/Core/Disassembler.h"
29 #include "lldb/Core/ModuleList.h"
30 #include "lldb/Core/UserSettingsController.h"
31 #include "lldb/Expression/Expression.h"
32 #include "lldb/Symbol/TypeSystem.h"
33 #include "lldb/Target/ExecutionContextScope.h"
34 #include "lldb/Target/PathMappingList.h"
35 #include "lldb/Target/ProcessLaunchInfo.h"
36 #include "lldb/Target/SectionLoadHistory.h"
37
38 namespace lldb_private {
39
40 extern OptionEnumValueElement g_dynamic_value_types[];
41
42 typedef enum InlineStrategy
43 {
44     eInlineBreakpointsNever = 0,
45     eInlineBreakpointsHeaders,
46     eInlineBreakpointsAlways
47 } InlineStrategy;
48
49 typedef enum LoadScriptFromSymFile
50 {
51     eLoadScriptFromSymFileTrue,
52     eLoadScriptFromSymFileFalse,
53     eLoadScriptFromSymFileWarn
54 } LoadScriptFromSymFile;
55
56 //----------------------------------------------------------------------
57 // TargetProperties
58 //----------------------------------------------------------------------
59 class TargetProperties : public Properties
60 {
61 public:
62     TargetProperties(Target *target);
63
64     ~TargetProperties() override;
65     
66     ArchSpec
67     GetDefaultArchitecture () const;
68     
69     void
70     SetDefaultArchitecture (const ArchSpec& arch);
71
72     bool
73     GetMoveToNearestCode () const;
74
75     lldb::DynamicValueType
76     GetPreferDynamicValue() const;
77
78     bool
79     SetPreferDynamicValue (lldb::DynamicValueType d);
80
81     bool
82     GetDisableASLR () const;
83     
84     void
85     SetDisableASLR (bool b);
86     
87     bool
88     GetDetachOnError () const;
89     
90     void
91     SetDetachOnError (bool b);
92     
93     bool
94     GetDisableSTDIO () const;
95     
96     void
97     SetDisableSTDIO (bool b);
98     
99     const char *
100     GetDisassemblyFlavor() const;
101
102 //    void
103 //    SetDisassemblyFlavor(const char *flavor);
104     
105     InlineStrategy
106     GetInlineStrategy () const;
107
108     const char *
109     GetArg0 () const;
110     
111     void
112     SetArg0 (const char *arg);
113
114     bool
115     GetRunArguments (Args &args) const;
116     
117     void
118     SetRunArguments (const Args &args);
119     
120     size_t
121     GetEnvironmentAsArgs (Args &env) const;
122
123     void
124     SetEnvironmentFromArgs (const Args &env);
125
126     bool
127     GetSkipPrologue() const;
128     
129     PathMappingList &
130     GetSourcePathMap () const;
131     
132     FileSpecList &
133     GetExecutableSearchPaths ();
134
135     FileSpecList &
136     GetDebugFileSearchPaths ();
137     
138     FileSpecList &
139     GetClangModuleSearchPaths ();
140     
141     bool
142     GetEnableAutoImportClangModules () const;
143     
144     bool
145     GetEnableSyntheticValue () const;
146     
147     uint32_t
148     GetMaximumNumberOfChildrenToDisplay() const;
149     
150     uint32_t
151     GetMaximumSizeOfStringSummary() const;
152
153     uint32_t
154     GetMaximumMemReadSize () const;
155     
156     FileSpec
157     GetStandardInputPath () const;
158     
159     void
160     SetStandardInputPath (const char *path);
161     
162     FileSpec
163     GetStandardOutputPath () const;
164     
165     void
166     SetStandardOutputPath (const char *path);
167     
168     FileSpec
169     GetStandardErrorPath () const;
170     
171     void
172     SetStandardErrorPath (const char *path);
173     
174     bool
175     GetBreakpointsConsultPlatformAvoidList ();
176     
177     lldb::LanguageType
178     GetLanguage () const;
179
180     const char *
181     GetExpressionPrefixContentsAsCString ();
182
183     bool
184     GetUseHexImmediates() const;
185
186     bool
187     GetUseFastStepping() const;
188     
189     bool
190     GetDisplayExpressionsInCrashlogs () const;
191
192     LoadScriptFromSymFile
193     GetLoadScriptFromSymbolFile() const;
194
195     Disassembler::HexImmediateStyle
196     GetHexImmediateStyle() const;
197     
198     MemoryModuleLoadLevel
199     GetMemoryModuleLoadLevel() const;
200
201     bool
202     GetUserSpecifiedTrapHandlerNames (Args &args) const;
203
204     void
205     SetUserSpecifiedTrapHandlerNames (const Args &args);
206
207     bool
208     GetNonStopModeEnabled () const;
209
210     void
211     SetNonStopModeEnabled (bool b);
212
213     bool
214     GetDisplayRuntimeSupportValues () const;
215     
216     void
217     SetDisplayRuntimeSupportValues (bool b);
218
219     const ProcessLaunchInfo &
220     GetProcessLaunchInfo();
221
222     void
223     SetProcessLaunchInfo(const ProcessLaunchInfo &launch_info);
224
225 private:
226     //------------------------------------------------------------------
227     // Callbacks for m_launch_info.
228     //------------------------------------------------------------------
229     static void Arg0ValueChangedCallback(void *target_property_ptr, OptionValue *);
230     static void RunArgsValueChangedCallback(void *target_property_ptr, OptionValue *);
231     static void EnvVarsValueChangedCallback(void *target_property_ptr, OptionValue *);
232     static void InheritEnvValueChangedCallback(void *target_property_ptr, OptionValue *);
233     static void InputPathValueChangedCallback(void *target_property_ptr, OptionValue *);
234     static void OutputPathValueChangedCallback(void *target_property_ptr, OptionValue *);
235     static void ErrorPathValueChangedCallback(void *target_property_ptr, OptionValue *);
236     static void DetachOnErrorValueChangedCallback(void *target_property_ptr, OptionValue *);
237     static void DisableASLRValueChangedCallback(void *target_property_ptr, OptionValue *);
238     static void DisableSTDIOValueChangedCallback(void *target_property_ptr, OptionValue *);
239
240     //------------------------------------------------------------------
241     // Member variables.
242     //------------------------------------------------------------------
243     ProcessLaunchInfo m_launch_info;
244 };
245
246 class EvaluateExpressionOptions
247 {
248 public:
249     static const uint32_t default_timeout = 500000;
250     EvaluateExpressionOptions() :
251         m_execution_policy(eExecutionPolicyOnlyWhenNeeded),
252         m_language (lldb::eLanguageTypeUnknown),
253         m_prefix (), // A prefix specific to this expression that is added after the prefix from the settings (if any)
254         m_coerce_to_id (false),
255         m_unwind_on_error (true),
256         m_ignore_breakpoints (false),
257         m_keep_in_memory (false),
258         m_try_others (true),
259         m_stop_others (true),
260         m_debug (false),
261         m_trap_exceptions (true),
262         m_generate_debug_info (false),
263         m_result_is_internal (false),
264         m_use_dynamic (lldb::eNoDynamicValues),
265         m_timeout_usec (default_timeout),
266         m_one_thread_timeout_usec (0),
267         m_cancel_callback (nullptr),
268         m_cancel_callback_baton (nullptr)
269     {
270     }
271     
272     ExecutionPolicy
273     GetExecutionPolicy () const
274     {
275         return m_execution_policy;
276     }
277     
278     void
279     SetExecutionPolicy (ExecutionPolicy policy = eExecutionPolicyAlways)
280     {
281         m_execution_policy = policy;
282     }
283     
284     lldb::LanguageType
285     GetLanguage() const
286     {
287         return m_language;
288     }
289     
290     void
291     SetLanguage(lldb::LanguageType language)
292     {
293         m_language = language;
294     }
295     
296     bool
297     DoesCoerceToId () const
298     {
299         return m_coerce_to_id;
300     }
301
302     const char *
303     GetPrefix () const
304     {
305         return (m_prefix.empty() ? nullptr : m_prefix.c_str());
306     }
307
308     void
309     SetPrefix (const char *prefix)
310     {
311         if (prefix && prefix[0])
312             m_prefix = prefix;
313         else
314             m_prefix.clear();
315     }
316
317     void
318     SetCoerceToId (bool coerce = true)
319     {
320         m_coerce_to_id = coerce;
321     }
322     
323     bool
324     DoesUnwindOnError () const
325     {
326         return m_unwind_on_error;
327     }
328     
329     void
330     SetUnwindOnError (bool unwind = false)
331     {
332         m_unwind_on_error = unwind;
333     }
334     
335     bool
336     DoesIgnoreBreakpoints () const
337     {
338         return m_ignore_breakpoints;
339     }
340     
341     void
342     SetIgnoreBreakpoints (bool ignore = false)
343     {
344         m_ignore_breakpoints = ignore;
345     }
346     
347     bool
348     DoesKeepInMemory () const
349     {
350         return m_keep_in_memory;
351     }
352     
353     void
354     SetKeepInMemory (bool keep = true)
355     {
356         m_keep_in_memory = keep;
357     }
358     
359     lldb::DynamicValueType
360     GetUseDynamic () const
361     {
362         return m_use_dynamic;
363     }
364     
365     void
366     SetUseDynamic (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget)
367     {
368         m_use_dynamic = dynamic;
369     }
370     
371     uint32_t
372     GetTimeoutUsec () const
373     {
374         return m_timeout_usec;
375     }
376     
377     void
378     SetTimeoutUsec (uint32_t timeout = 0)
379     {
380         m_timeout_usec = timeout;
381     }
382     
383     uint32_t
384     GetOneThreadTimeoutUsec () const
385     {
386         return m_one_thread_timeout_usec;
387     }
388     
389     void
390     SetOneThreadTimeoutUsec (uint32_t timeout = 0)
391     {
392         m_one_thread_timeout_usec = timeout;
393     }
394     
395     bool
396     GetTryAllThreads () const
397     {
398         return m_try_others;
399     }
400     
401     void
402     SetTryAllThreads (bool try_others = true)
403     {
404         m_try_others = try_others;
405     }
406     
407     bool
408     GetStopOthers () const
409     {
410         return m_stop_others;
411     }
412     
413     void
414     SetStopOthers (bool stop_others = true)
415     {
416         m_stop_others = stop_others;
417     }
418     
419     bool
420     GetDebug() const
421     {
422         return m_debug;
423     }
424     
425     void
426     SetDebug(bool b)
427     {
428         m_debug = b;
429         if (m_debug)
430             m_generate_debug_info = true;
431     }
432     
433     bool
434     GetGenerateDebugInfo() const
435     {
436         return m_generate_debug_info;
437     }
438     
439     void
440     SetGenerateDebugInfo(bool b)
441     {
442         m_generate_debug_info = b;
443     }
444     
445     bool
446     GetColorizeErrors () const
447     {
448         return m_ansi_color_errors;
449     }
450     
451     void
452     SetColorizeErrors (bool b)
453     {
454         m_ansi_color_errors = b;
455     }
456     
457     bool
458     GetTrapExceptions() const
459     {
460         return m_trap_exceptions;
461     }
462     
463     void
464     SetTrapExceptions (bool b)
465     {
466         m_trap_exceptions = b;
467     }
468     
469     bool
470     GetREPLEnabled() const
471     {
472         return m_repl;
473     }
474     
475     void
476     SetREPLEnabled (bool b)
477     {
478         m_repl = b;
479     }
480     
481     void
482     SetCancelCallback (lldb::ExpressionCancelCallback callback, void *baton)
483     {
484         m_cancel_callback_baton = baton;
485         m_cancel_callback = callback;
486     }
487     
488     bool
489     InvokeCancelCallback (lldb::ExpressionEvaluationPhase phase) const
490     {
491         return ((m_cancel_callback != nullptr) ? m_cancel_callback(phase, m_cancel_callback_baton) : false);
492     }
493     
494     // Allows the expression contents to be remapped to point to the specified file and line
495     // using #line directives.
496     void
497     SetPoundLine (const char *path, uint32_t line) const
498     {
499         if (path && path[0])
500         {
501             m_pound_line_file = path;
502             m_pound_line_line = line;
503         }
504         else
505         {
506             m_pound_line_file.clear();
507             m_pound_line_line = 0;
508         }
509     }
510     
511     const char *
512     GetPoundLineFilePath () const
513     {
514         return (m_pound_line_file.empty() ? nullptr : m_pound_line_file.c_str());
515     }
516     
517     uint32_t
518     GetPoundLineLine () const
519     {
520         return m_pound_line_line;
521     }
522
523     void
524     SetResultIsInternal (bool b)
525     {
526         m_result_is_internal = b;
527     }
528
529     bool
530     GetResultIsInternal () const
531     {
532         return m_result_is_internal;
533     }
534
535 private:
536     ExecutionPolicy m_execution_policy;
537     lldb::LanguageType m_language;
538     std::string m_prefix;
539     bool m_coerce_to_id;
540     bool m_unwind_on_error;
541     bool m_ignore_breakpoints;
542     bool m_keep_in_memory;
543     bool m_try_others;
544     bool m_stop_others;
545     bool m_debug;
546     bool m_trap_exceptions;
547     bool m_repl;
548     bool m_generate_debug_info;
549     bool m_ansi_color_errors;
550     bool m_result_is_internal;
551     lldb::DynamicValueType m_use_dynamic;
552     uint32_t m_timeout_usec;
553     uint32_t m_one_thread_timeout_usec;
554     lldb::ExpressionCancelCallback m_cancel_callback;
555     void *m_cancel_callback_baton;
556     // If m_pound_line_file is not empty and m_pound_line_line is non-zero,
557     // use #line %u "%s" before the expression content to remap where the source
558     // originates
559     mutable std::string m_pound_line_file;
560     mutable uint32_t m_pound_line_line;
561 };
562
563 //----------------------------------------------------------------------
564 // Target
565 //----------------------------------------------------------------------
566 class Target :
567     public std::enable_shared_from_this<Target>,
568     public TargetProperties,
569     public Broadcaster,
570     public ExecutionContextScope,
571     public ModuleList::Notifier
572 {
573 public:
574     friend class TargetList;
575
576     //------------------------------------------------------------------
577     /// Broadcaster event bits definitions.
578     //------------------------------------------------------------------
579     enum
580     {
581         eBroadcastBitBreakpointChanged  = (1 << 0),
582         eBroadcastBitModulesLoaded      = (1 << 1),
583         eBroadcastBitModulesUnloaded    = (1 << 2),
584         eBroadcastBitWatchpointChanged  = (1 << 3),
585         eBroadcastBitSymbolsLoaded      = (1 << 4)
586     };
587     
588     // These two functions fill out the Broadcaster interface:
589     
590     static ConstString &GetStaticBroadcasterClass ();
591
592     ConstString &GetBroadcasterClass() const override
593     {
594         return GetStaticBroadcasterClass();
595     }
596
597     // This event data class is for use by the TargetList to broadcast new target notifications.
598     class TargetEventData : public EventData
599     {
600     public:
601         TargetEventData (const lldb::TargetSP &target_sp);
602
603         TargetEventData (const lldb::TargetSP &target_sp, const ModuleList &module_list);
604
605         ~TargetEventData() override;
606
607         static const ConstString &
608         GetFlavorString ();
609
610         const ConstString &
611         GetFlavor() const override
612         {
613             return TargetEventData::GetFlavorString ();
614         }
615
616         void
617         Dump(Stream *s) const override;
618
619         static const TargetEventData *
620         GetEventDataFromEvent (const Event *event_ptr);
621
622         static lldb::TargetSP
623         GetTargetFromEvent (const Event *event_ptr);
624
625         static ModuleList
626         GetModuleListFromEvent (const Event *event_ptr);
627
628         const lldb::TargetSP &
629         GetTarget() const
630         {
631             return m_target_sp;
632         }
633
634         const ModuleList &
635         GetModuleList() const
636         {
637             return m_module_list;
638         }
639
640     private:
641         lldb::TargetSP m_target_sp;
642         ModuleList     m_module_list;
643
644         DISALLOW_COPY_AND_ASSIGN (TargetEventData);
645     };
646     
647     ~Target() override;
648
649     static void
650     SettingsInitialize ();
651
652     static void
653     SettingsTerminate ();
654
655     static FileSpecList
656     GetDefaultExecutableSearchPaths ();
657
658     static FileSpecList
659     GetDefaultDebugFileSearchPaths ();
660     
661     static FileSpecList
662     GetDefaultClangModuleSearchPaths ();
663
664     static ArchSpec
665     GetDefaultArchitecture ();
666
667     static void
668     SetDefaultArchitecture (const ArchSpec &arch);
669
670 //    void
671 //    UpdateInstanceName ();
672
673     lldb::ModuleSP
674     GetSharedModule(const ModuleSpec &module_spec,
675                     Error *error_ptr = nullptr);
676
677     //----------------------------------------------------------------------
678     // Settings accessors
679     //----------------------------------------------------------------------
680
681     static const lldb::TargetPropertiesSP &
682     GetGlobalProperties();
683
684     Mutex &
685     GetAPIMutex ()
686     {
687         return m_mutex;
688     }
689
690     void
691     DeleteCurrentProcess ();
692
693     void
694     CleanupProcess ();
695
696     //------------------------------------------------------------------
697     /// Dump a description of this object to a Stream.
698     ///
699     /// Dump a description of the contents of this object to the
700     /// supplied stream \a s. The dumped content will be only what has
701     /// been loaded or parsed up to this point at which this function
702     /// is called, so this is a good way to see what has been parsed
703     /// in a target.
704     ///
705     /// @param[in] s
706     ///     The stream to which to dump the object description.
707     //------------------------------------------------------------------
708     void
709     Dump (Stream *s, lldb::DescriptionLevel description_level);
710
711     const lldb::ProcessSP &
712     CreateProcess (Listener &listener, 
713                    const char *plugin_name,
714                    const FileSpec *crash_file);
715
716     const lldb::ProcessSP &
717     GetProcessSP () const;
718
719     bool
720     IsValid()
721     {
722         return m_valid;
723     }
724
725     void
726     Destroy();
727     
728     Error
729     Launch (ProcessLaunchInfo &launch_info,
730             Stream *stream);  // Optional stream to receive first stop info
731
732     Error
733     Attach (ProcessAttachInfo &attach_info,
734             Stream *stream);  // Optional stream to receive first stop info
735
736     //------------------------------------------------------------------
737     // This part handles the breakpoints.
738     //------------------------------------------------------------------
739
740     BreakpointList &
741     GetBreakpointList(bool internal = false);
742
743     const BreakpointList &
744     GetBreakpointList(bool internal = false) const;
745     
746     lldb::BreakpointSP
747     GetLastCreatedBreakpoint ()
748     {
749         return m_last_created_breakpoint;
750     }
751
752     lldb::BreakpointSP
753     GetBreakpointByID (lldb::break_id_t break_id);
754
755     // Use this to create a file and line breakpoint to a given module or all module it is nullptr
756     lldb::BreakpointSP
757     CreateBreakpoint (const FileSpecList *containingModules,
758                       const FileSpec &file,
759                       uint32_t line_no,
760                       LazyBool check_inlines,
761                       LazyBool skip_prologue,
762                       bool internal,
763                       bool request_hardware,
764                       LazyBool move_to_nearest_code);
765
766     // Use this to create breakpoint that matches regex against the source lines in files given in source_file_list:
767     lldb::BreakpointSP
768     CreateSourceRegexBreakpoint (const FileSpecList *containingModules,
769                                  const FileSpecList *source_file_list,
770                                  RegularExpression &source_regex,
771                                  bool internal,
772                                  bool request_hardware,
773                                  LazyBool move_to_nearest_code);
774
775     // Use this to create a breakpoint from a load address
776     lldb::BreakpointSP
777     CreateBreakpoint (lldb::addr_t load_addr,
778                       bool internal,
779                       bool request_hardware);
780
781     // Use this to create a breakpoint from a load address and a module file spec
782     lldb::BreakpointSP
783     CreateAddressInModuleBreakpoint (lldb::addr_t file_addr,
784                                      bool internal,
785                                      const FileSpec *file_spec,
786                                      bool request_hardware);
787
788     // Use this to create Address breakpoints:
789     lldb::BreakpointSP
790     CreateBreakpoint (const Address &addr,
791                       bool internal,
792                       bool request_hardware);
793
794     // Use this to create a function breakpoint by regexp in containingModule/containingSourceFiles, or all modules if it is nullptr
795     // When "skip_prologue is set to eLazyBoolCalculate, we use the current target 
796     // setting, else we use the values passed in
797     lldb::BreakpointSP
798     CreateFuncRegexBreakpoint (const FileSpecList *containingModules,
799                                const FileSpecList *containingSourceFiles,
800                                RegularExpression &func_regexp,
801                                lldb::LanguageType requested_language,
802                                LazyBool skip_prologue,
803                                bool internal,
804                                bool request_hardware);
805
806     // Use this to create a function breakpoint by name in containingModule, or all modules if it is nullptr
807     // When "skip_prologue is set to eLazyBoolCalculate, we use the current target 
808     // setting, else we use the values passed in.
809     // func_name_type_mask is or'ed values from the FunctionNameType enum.
810     lldb::BreakpointSP
811     CreateBreakpoint (const FileSpecList *containingModules,
812                       const FileSpecList *containingSourceFiles,
813                       const char *func_name,
814                       uint32_t func_name_type_mask, 
815                       lldb::LanguageType language,
816                       LazyBool skip_prologue,
817                       bool internal,
818                       bool request_hardware);
819                       
820     lldb::BreakpointSP
821     CreateExceptionBreakpoint(enum lldb::LanguageType language,
822                               bool catch_bp,
823                               bool throw_bp,
824                               bool internal,
825                               Args *additional_args = nullptr,
826                               Error *additional_args_error = nullptr);
827     
828     // This is the same as the func_name breakpoint except that you can specify a vector of names.  This is cheaper
829     // than a regular expression breakpoint in the case where you just want to set a breakpoint on a set of names
830     // you already know.
831     // func_name_type_mask is or'ed values from the FunctionNameType enum.
832     lldb::BreakpointSP
833     CreateBreakpoint (const FileSpecList *containingModules,
834                       const FileSpecList *containingSourceFiles,
835                       const char *func_names[],
836                       size_t num_names, 
837                       uint32_t func_name_type_mask, 
838                       lldb::LanguageType language,
839                       LazyBool skip_prologue,
840                       bool internal,
841                       bool request_hardware);
842
843     lldb::BreakpointSP
844     CreateBreakpoint (const FileSpecList *containingModules,
845                       const FileSpecList *containingSourceFiles,
846                       const std::vector<std::string> &func_names,
847                       uint32_t func_name_type_mask,
848                       lldb::LanguageType language,
849                       LazyBool skip_prologue,
850                       bool internal,
851                       bool request_hardware);
852
853     // Use this to create a general breakpoint:
854     lldb::BreakpointSP
855     CreateBreakpoint (lldb::SearchFilterSP &filter_sp,
856                       lldb::BreakpointResolverSP &resolver_sp,
857                       bool internal,
858                       bool request_hardware,
859                       bool resolve_indirect_symbols);
860
861     // Use this to create a watchpoint:
862     lldb::WatchpointSP
863     CreateWatchpoint (lldb::addr_t addr,
864                       size_t size,
865                       const CompilerType *type,
866                       uint32_t kind,
867                       Error &error);
868
869     lldb::WatchpointSP
870     GetLastCreatedWatchpoint ()
871     {
872         return m_last_created_watchpoint;
873     }
874
875     WatchpointList &
876     GetWatchpointList()
877     {
878         return m_watchpoint_list;
879     }
880
881     void
882     RemoveAllBreakpoints (bool internal_also = false);
883
884     void
885     DisableAllBreakpoints (bool internal_also = false);
886
887     void
888     EnableAllBreakpoints (bool internal_also = false);
889
890     bool
891     DisableBreakpointByID (lldb::break_id_t break_id);
892
893     bool
894     EnableBreakpointByID (lldb::break_id_t break_id);
895
896     bool
897     RemoveBreakpointByID (lldb::break_id_t break_id);
898
899     // The flag 'end_to_end', default to true, signifies that the operation is
900     // performed end to end, for both the debugger and the debuggee.
901
902     bool
903     RemoveAllWatchpoints (bool end_to_end = true);
904
905     bool
906     DisableAllWatchpoints (bool end_to_end = true);
907
908     bool
909     EnableAllWatchpoints (bool end_to_end = true);
910
911     bool
912     ClearAllWatchpointHitCounts ();
913
914     bool
915     ClearAllWatchpointHistoricValues ();
916     
917     bool
918     IgnoreAllWatchpoints (uint32_t ignore_count);
919
920     bool
921     DisableWatchpointByID (lldb::watch_id_t watch_id);
922
923     bool
924     EnableWatchpointByID (lldb::watch_id_t watch_id);
925
926     bool
927     RemoveWatchpointByID (lldb::watch_id_t watch_id);
928
929     bool
930     IgnoreWatchpointByID (lldb::watch_id_t watch_id, uint32_t ignore_count);
931
932     //------------------------------------------------------------------
933     /// Get \a load_addr as a callable code load address for this target
934     ///
935     /// Take \a load_addr and potentially add any address bits that are 
936     /// needed to make the address callable. For ARM this can set bit
937     /// zero (if it already isn't) if \a load_addr is a thumb function.
938     /// If \a addr_class is set to eAddressClassInvalid, then the address
939     /// adjustment will always happen. If it is set to an address class
940     /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be 
941     /// returned.
942     //------------------------------------------------------------------
943     lldb::addr_t
944     GetCallableLoadAddress (lldb::addr_t load_addr, lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
945
946     //------------------------------------------------------------------
947     /// Get \a load_addr as an opcode for this target.
948     ///
949     /// Take \a load_addr and potentially strip any address bits that are 
950     /// needed to make the address point to an opcode. For ARM this can 
951     /// clear bit zero (if it already isn't) if \a load_addr is a 
952     /// thumb function and load_addr is in code.
953     /// If \a addr_class is set to eAddressClassInvalid, then the address
954     /// adjustment will always happen. If it is set to an address class
955     /// that doesn't have code in it, LLDB_INVALID_ADDRESS will be 
956     /// returned.
957     //------------------------------------------------------------------
958     lldb::addr_t
959     GetOpcodeLoadAddress (lldb::addr_t load_addr, lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
960
961     // Get load_addr as breakable load address for this target.
962     // Take a addr and check if for any reason there is a better address than this to put a breakpoint on.
963     // If there is then return that address.
964     // For MIPS, if instruction at addr is a delay slot instruction then this method will find the address of its
965     // previous instruction and return that address.
966     lldb::addr_t
967     GetBreakableLoadAddress (lldb::addr_t addr);
968
969     void
970     ModulesDidLoad (ModuleList &module_list);
971
972     void
973     ModulesDidUnload (ModuleList &module_list, bool delete_locations);
974     
975     void
976     SymbolsDidLoad (ModuleList &module_list);
977     
978     void
979     ClearModules(bool delete_locations);
980
981     //------------------------------------------------------------------
982     /// Called as the last function in Process::DidExec().
983     ///
984     /// Process::DidExec() will clear a lot of state in the process,
985     /// then try to reload a dynamic loader plugin to discover what
986     /// binaries are currently available and then this function should
987     /// be called to allow the target to do any cleanup after everything
988     /// has been figured out. It can remove breakpoints that no longer
989     /// make sense as the exec might have changed the target
990     /// architecture, and unloaded some modules that might get deleted.
991     //------------------------------------------------------------------
992     void
993     DidExec ();
994     
995     //------------------------------------------------------------------
996     /// Gets the module for the main executable.
997     ///
998     /// Each process has a notion of a main executable that is the file
999     /// that will be executed or attached to. Executable files can have
1000     /// dependent modules that are discovered from the object files, or
1001     /// discovered at runtime as things are dynamically loaded.
1002     ///
1003     /// @return
1004     ///     The shared pointer to the executable module which can
1005     ///     contains a nullptr Module object if no executable has been
1006     ///     set.
1007     ///
1008     /// @see DynamicLoader
1009     /// @see ObjectFile::GetDependentModules (FileSpecList&)
1010     /// @see Process::SetExecutableModule(lldb::ModuleSP&)
1011     //------------------------------------------------------------------
1012     lldb::ModuleSP
1013     GetExecutableModule ();
1014
1015     Module*
1016     GetExecutableModulePointer ();
1017
1018     //------------------------------------------------------------------
1019     /// Set the main executable module.
1020     ///
1021     /// Each process has a notion of a main executable that is the file
1022     /// that will be executed or attached to. Executable files can have
1023     /// dependent modules that are discovered from the object files, or
1024     /// discovered at runtime as things are dynamically loaded.
1025     ///
1026     /// Setting the executable causes any of the current dependant
1027     /// image information to be cleared and replaced with the static
1028     /// dependent image information found by calling
1029     /// ObjectFile::GetDependentModules (FileSpecList&) on the main
1030     /// executable and any modules on which it depends. Calling
1031     /// Process::GetImages() will return the newly found images that
1032     /// were obtained from all of the object files.
1033     ///
1034     /// @param[in] module_sp
1035     ///     A shared pointer reference to the module that will become
1036     ///     the main executable for this process.
1037     ///
1038     /// @param[in] get_dependent_files
1039     ///     If \b true then ask the object files to track down any
1040     ///     known dependent files.
1041     ///
1042     /// @see ObjectFile::GetDependentModules (FileSpecList&)
1043     /// @see Process::GetImages()
1044     //------------------------------------------------------------------
1045     void
1046     SetExecutableModule (lldb::ModuleSP& module_sp, bool get_dependent_files);
1047
1048     bool
1049     LoadScriptingResources(std::list<Error>& errors,
1050                            Stream* feedback_stream = nullptr,
1051                            bool continue_on_error = true)
1052     {
1053         return m_images.LoadScriptingResourcesInTarget(this,errors,feedback_stream,continue_on_error);
1054     }
1055     
1056     //------------------------------------------------------------------
1057     /// Get accessor for the images for this process.
1058     ///
1059     /// Each process has a notion of a main executable that is the file
1060     /// that will be executed or attached to. Executable files can have
1061     /// dependent modules that are discovered from the object files, or
1062     /// discovered at runtime as things are dynamically loaded. After
1063     /// a main executable has been set, the images will contain a list
1064     /// of all the files that the executable depends upon as far as the
1065     /// object files know. These images will usually contain valid file
1066     /// virtual addresses only. When the process is launched or attached
1067     /// to, the DynamicLoader plug-in will discover where these images
1068     /// were loaded in memory and will resolve the load virtual
1069     /// addresses is each image, and also in images that are loaded by
1070     /// code.
1071     ///
1072     /// @return
1073     ///     A list of Module objects in a module list.
1074     //------------------------------------------------------------------
1075     const ModuleList&
1076     GetImages () const
1077     {
1078         return m_images;
1079     }
1080     
1081     ModuleList&
1082     GetImages ()
1083     {
1084         return m_images;
1085     }
1086     
1087     //------------------------------------------------------------------
1088     /// Return whether this FileSpec corresponds to a module that should be considered for general searches.
1089     ///
1090     /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1091     /// and any module that returns \b true will not be searched.  Note the
1092     /// SearchFilterForUnconstrainedSearches is the search filter that
1093     /// gets used in the CreateBreakpoint calls when no modules is provided.
1094     ///
1095     /// The target call at present just consults the Platform's call of the
1096     /// same name.
1097     /// 
1098     /// @param[in] module_sp
1099     ///     A shared pointer reference to the module that checked.
1100     ///
1101     /// @return \b true if the module should be excluded, \b false otherwise.
1102     //------------------------------------------------------------------
1103     bool
1104     ModuleIsExcludedForUnconstrainedSearches (const FileSpec &module_spec);
1105     
1106     //------------------------------------------------------------------
1107     /// Return whether this module should be considered for general searches.
1108     ///
1109     /// This API will be consulted by the SearchFilterForUnconstrainedSearches
1110     /// and any module that returns \b true will not be searched.  Note the
1111     /// SearchFilterForUnconstrainedSearches is the search filter that
1112     /// gets used in the CreateBreakpoint calls when no modules is provided.
1113     ///
1114     /// The target call at present just consults the Platform's call of the
1115     /// same name.
1116     ///
1117     /// FIXME: When we get time we should add a way for the user to set modules that they
1118     /// don't want searched, in addition to or instead of the platform ones.
1119     /// 
1120     /// @param[in] module_sp
1121     ///     A shared pointer reference to the module that checked.
1122     ///
1123     /// @return \b true if the module should be excluded, \b false otherwise.
1124     //------------------------------------------------------------------
1125     bool
1126     ModuleIsExcludedForUnconstrainedSearches (const lldb::ModuleSP &module_sp);
1127
1128     const ArchSpec &
1129     GetArchitecture () const
1130     {
1131         return m_arch;
1132     }
1133     
1134     //------------------------------------------------------------------
1135     /// Set the architecture for this target.
1136     ///
1137     /// If the current target has no Images read in, then this just sets the architecture, which will
1138     /// be used to select the architecture of the ExecutableModule when that is set.
1139     /// If the current target has an ExecutableModule, then calling SetArchitecture with a different
1140     /// architecture from the currently selected one will reset the ExecutableModule to that slice
1141     /// of the file backing the ExecutableModule.  If the file backing the ExecutableModule does not
1142     /// contain a fork of this architecture, then this code will return false, and the architecture
1143     /// won't be changed.
1144     /// If the input arch_spec is the same as the already set architecture, this is a no-op.
1145     ///
1146     /// @param[in] arch_spec
1147     ///     The new architecture.
1148     ///
1149     /// @return
1150     ///     \b true if the architecture was successfully set, \bfalse otherwise.
1151     //------------------------------------------------------------------
1152     bool
1153     SetArchitecture (const ArchSpec &arch_spec);
1154
1155     bool
1156     MergeArchitecture (const ArchSpec &arch_spec);
1157
1158     Debugger &
1159     GetDebugger ()
1160     {
1161         return m_debugger;
1162     }
1163
1164     size_t
1165     ReadMemoryFromFileCache (const Address& addr, 
1166                              void *dst, 
1167                              size_t dst_len, 
1168                              Error &error);
1169
1170     // Reading memory through the target allows us to skip going to the process
1171     // for reading memory if possible and it allows us to try and read from 
1172     // any constant sections in our object files on disk. If you always want
1173     // live program memory, read straight from the process. If you possibly 
1174     // want to read from const sections in object files, read from the target.
1175     // This version of ReadMemory will try and read memory from the process
1176     // if the process is alive. The order is:
1177     // 1 - if (prefer_file_cache == true) then read from object file cache
1178     // 2 - if there is a valid process, try and read from its memory
1179     // 3 - if (prefer_file_cache == false) then read from object file cache
1180     size_t
1181     ReadMemory(const Address& addr,
1182                bool prefer_file_cache,
1183                void *dst,
1184                size_t dst_len,
1185                Error &error,
1186                lldb::addr_t *load_addr_ptr = nullptr);
1187     
1188     size_t
1189     ReadCStringFromMemory (const Address& addr, std::string &out_str, Error &error);
1190     
1191     size_t
1192     ReadCStringFromMemory (const Address& addr, char *dst, size_t dst_max_len, Error &result_error);
1193     
1194     size_t
1195     ReadScalarIntegerFromMemory (const Address& addr, 
1196                                  bool prefer_file_cache,
1197                                  uint32_t byte_size, 
1198                                  bool is_signed, 
1199                                  Scalar &scalar, 
1200                                  Error &error);
1201
1202     uint64_t
1203     ReadUnsignedIntegerFromMemory (const Address& addr, 
1204                                    bool prefer_file_cache,
1205                                    size_t integer_byte_size, 
1206                                    uint64_t fail_value, 
1207                                    Error &error);
1208
1209     bool
1210     ReadPointerFromMemory (const Address& addr, 
1211                            bool prefer_file_cache,
1212                            Error &error,
1213                            Address &pointer_addr);
1214
1215     SectionLoadList&
1216     GetSectionLoadList()
1217     {
1218         return m_section_load_history.GetCurrentSectionLoadList();
1219     }
1220
1221 //    const SectionLoadList&
1222 //    GetSectionLoadList() const
1223 //    {
1224 //        return const_cast<SectionLoadHistory *>(&m_section_load_history)->GetCurrentSectionLoadList();
1225 //    }
1226
1227     static Target *
1228     GetTargetFromContexts (const ExecutionContext *exe_ctx_ptr, 
1229                            const SymbolContext *sc_ptr);
1230
1231     //------------------------------------------------------------------
1232     // lldb::ExecutionContextScope pure virtual functions
1233     //------------------------------------------------------------------
1234     lldb::TargetSP
1235     CalculateTarget() override;
1236     
1237     lldb::ProcessSP
1238     CalculateProcess() override;
1239     
1240     lldb::ThreadSP
1241     CalculateThread() override;
1242     
1243     lldb::StackFrameSP
1244     CalculateStackFrame() override;
1245
1246     void
1247     CalculateExecutionContext(ExecutionContext &exe_ctx) override;
1248
1249     PathMappingList &
1250     GetImageSearchPathList ();
1251     
1252     TypeSystem *
1253     GetScratchTypeSystemForLanguage (Error *error, lldb::LanguageType language, bool create_on_demand = true);
1254     
1255     PersistentExpressionState *
1256     GetPersistentExpressionStateForLanguage (lldb::LanguageType language);
1257     
1258     // Creates a UserExpression for the given language, the rest of the parameters have the
1259     // same meaning as for the UserExpression constructor.
1260     // Returns a new-ed object which the caller owns.
1261     
1262     UserExpression *
1263     GetUserExpressionForLanguage(const char *expr,
1264                                  const char *expr_prefix,
1265                                  lldb::LanguageType language,
1266                                  Expression::ResultType desired_type,
1267                                  const EvaluateExpressionOptions &options,
1268                                  Error &error);
1269     
1270     // Creates a FunctionCaller for the given language, the rest of the parameters have the
1271     // same meaning as for the FunctionCaller constructor.  Since a FunctionCaller can't be
1272     // IR Interpreted, it makes no sense to call this with an ExecutionContextScope that lacks
1273     // a Process.
1274     // Returns a new-ed object which the caller owns.
1275     
1276     FunctionCaller *
1277     GetFunctionCallerForLanguage (lldb::LanguageType language,
1278                                   const CompilerType &return_type,
1279                                   const Address& function_address,
1280                                   const ValueList &arg_value_list,
1281                                   const char *name,
1282                                   Error &error);
1283     
1284     // Creates a UtilityFunction for the given language, the rest of the parameters have the
1285     // same meaning as for the UtilityFunction constructor.
1286     // Returns a new-ed object which the caller owns.
1287     
1288     UtilityFunction *
1289     GetUtilityFunctionForLanguage (const char *expr,
1290                                    lldb::LanguageType language,
1291                                    const char *name,
1292                                    Error &error);
1293
1294     ClangASTContext *
1295     GetScratchClangASTContext(bool create_on_demand=true);
1296     
1297     lldb::ClangASTImporterSP
1298     GetClangASTImporter();
1299     
1300     //----------------------------------------------------------------------
1301     // Install any files through the platform that need be to installed
1302     // prior to launching or attaching.
1303     //----------------------------------------------------------------------
1304     Error
1305     Install(ProcessLaunchInfo *launch_info);
1306     
1307     bool
1308     ResolveFileAddress (lldb::addr_t load_addr,
1309                         Address &so_addr);
1310     
1311     bool
1312     ResolveLoadAddress (lldb::addr_t load_addr,
1313                         Address &so_addr,
1314                         uint32_t stop_id = SectionLoadHistory::eStopIDNow);
1315     
1316     bool
1317     SetSectionLoadAddress (const lldb::SectionSP &section,
1318                            lldb::addr_t load_addr,
1319                            bool warn_multiple = false);
1320
1321     size_t
1322     UnloadModuleSections (const lldb::ModuleSP &module_sp);
1323
1324     size_t
1325     UnloadModuleSections (const ModuleList &module_list);
1326
1327     bool
1328     SetSectionUnloaded (const lldb::SectionSP &section_sp);
1329
1330     bool
1331     SetSectionUnloaded (const lldb::SectionSP &section_sp, lldb::addr_t load_addr);
1332     
1333     void
1334     ClearAllLoadedSections ();
1335
1336     // Since expressions results can persist beyond the lifetime of a process,
1337     // and the const expression results are available after a process is gone,
1338     // we provide a way for expressions to be evaluated from the Target itself.
1339     // If an expression is going to be run, then it should have a frame filled
1340     // in in th execution context. 
1341     lldb::ExpressionResults
1342     EvaluateExpression (const char *expression,
1343                         ExecutionContextScope *exe_scope,
1344                         lldb::ValueObjectSP &result_valobj_sp,
1345                         const EvaluateExpressionOptions& options = EvaluateExpressionOptions());
1346
1347     lldb::ExpressionVariableSP
1348     GetPersistentVariable(const ConstString &name);
1349     
1350     lldb::addr_t
1351     GetPersistentSymbol(const ConstString &name);
1352     
1353     //------------------------------------------------------------------
1354     // Target Stop Hooks
1355     //------------------------------------------------------------------
1356     class StopHook : public UserID
1357     {
1358     public:
1359         StopHook (const StopHook &rhs);
1360
1361         ~StopHook ();
1362
1363         StringList *
1364         GetCommandPointer ()
1365         {
1366             return &m_commands;
1367         }
1368         
1369         const StringList &
1370         GetCommands()
1371         {
1372             return m_commands;
1373         }
1374         
1375         lldb::TargetSP &
1376         GetTarget()
1377         {
1378             return m_target_sp;
1379         }
1380         
1381         void
1382         SetCommands (StringList &in_commands)
1383         {
1384             m_commands = in_commands;
1385         }
1386         
1387         // Set the specifier.  The stop hook will own the specifier, and is responsible for deleting it when we're done.
1388         void
1389         SetSpecifier (SymbolContextSpecifier *specifier);
1390         
1391         SymbolContextSpecifier *
1392         GetSpecifier ()
1393         {
1394             return m_specifier_sp.get();
1395         }
1396         
1397         // Set the Thread Specifier.  The stop hook will own the thread specifier, and is responsible for deleting it when we're done.
1398         void
1399         SetThreadSpecifier (ThreadSpec *specifier);
1400         
1401         ThreadSpec *
1402         GetThreadSpecifier()
1403         {
1404             return m_thread_spec_ap.get();
1405         }
1406         
1407         bool
1408         IsActive()
1409         {
1410             return m_active;
1411         }
1412         
1413         void
1414         SetIsActive (bool is_active)
1415         {
1416             m_active = is_active;
1417         }
1418         
1419         void
1420         GetDescription (Stream *s, lldb::DescriptionLevel level) const;
1421         
1422     private:
1423         lldb::TargetSP m_target_sp;
1424         StringList   m_commands;
1425         lldb::SymbolContextSpecifierSP m_specifier_sp;
1426         std::unique_ptr<ThreadSpec> m_thread_spec_ap;
1427         bool m_active;
1428         
1429         // Use CreateStopHook to make a new empty stop hook. The GetCommandPointer and fill it with commands,
1430         // and SetSpecifier to set the specifier shared pointer (can be null, that will match anything.)
1431         StopHook (lldb::TargetSP target_sp, lldb::user_id_t uid);
1432         friend class Target;
1433     };
1434     typedef std::shared_ptr<StopHook> StopHookSP;
1435     
1436     // Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook.  
1437     // Returns the id of the new hook.        
1438     StopHookSP
1439     CreateStopHook ();
1440     
1441     void
1442     RunStopHooks ();
1443     
1444     size_t
1445     GetStopHookSize();
1446     
1447     bool
1448     SetSuppresStopHooks (bool suppress)
1449     {
1450         bool old_value = m_suppress_stop_hooks;
1451         m_suppress_stop_hooks = suppress;
1452         return old_value;
1453     }
1454     
1455     bool
1456     GetSuppressStopHooks ()
1457     {
1458         return m_suppress_stop_hooks;
1459     }
1460
1461 //    StopHookSP &
1462 //    GetStopHookByIndex (size_t index);
1463 //    
1464     bool
1465     RemoveStopHookByID (lldb::user_id_t uid);
1466     
1467     void
1468     RemoveAllStopHooks ();
1469     
1470     StopHookSP
1471     GetStopHookByID (lldb::user_id_t uid);
1472     
1473     bool
1474     SetStopHookActiveStateByID (lldb::user_id_t uid, bool active_state);
1475     
1476     void
1477     SetAllStopHooksActiveState (bool active_state);
1478     
1479     size_t GetNumStopHooks () const
1480     {
1481         return m_stop_hooks.size();
1482     }
1483     
1484     StopHookSP
1485     GetStopHookAtIndex (size_t index)
1486     {
1487         if (index >= GetNumStopHooks())
1488             return StopHookSP();
1489         StopHookCollection::iterator pos = m_stop_hooks.begin();
1490         
1491         while (index > 0)
1492         {
1493             pos++;
1494             index--;
1495         }
1496         return (*pos).second;
1497     }
1498     
1499     lldb::PlatformSP
1500     GetPlatform ()
1501     {
1502         return m_platform_sp;
1503     }
1504
1505     void
1506     SetPlatform (const lldb::PlatformSP &platform_sp)
1507     {
1508         m_platform_sp = platform_sp;
1509     }
1510
1511     SourceManager &
1512     GetSourceManager ();
1513     
1514     ClangModulesDeclVendor *
1515     GetClangModulesDeclVendor ();
1516
1517     //------------------------------------------------------------------
1518     // Methods.
1519     //------------------------------------------------------------------
1520     lldb::SearchFilterSP
1521     GetSearchFilterForModule (const FileSpec *containingModule);
1522
1523     lldb::SearchFilterSP
1524     GetSearchFilterForModuleList (const FileSpecList *containingModuleList);
1525     
1526     lldb::SearchFilterSP
1527     GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles);
1528     
1529     lldb::REPLSP
1530     GetREPL (Error &err, lldb::LanguageType language, const char *repl_options, bool can_create);
1531     
1532     void
1533     SetREPL (lldb::LanguageType language, lldb::REPLSP repl_sp);
1534
1535 protected:
1536     //------------------------------------------------------------------
1537     /// Implementing of ModuleList::Notifier.
1538     //------------------------------------------------------------------
1539     
1540     void
1541     ModuleAdded(const ModuleList& module_list, const lldb::ModuleSP& module_sp) override;
1542     
1543     void
1544     ModuleRemoved(const ModuleList& module_list, const lldb::ModuleSP& module_sp) override;
1545     
1546     void
1547     ModuleUpdated(const ModuleList& module_list,
1548                   const lldb::ModuleSP& old_module_sp,
1549                   const lldb::ModuleSP& new_module_sp) override;
1550     void
1551     WillClearList(const ModuleList& module_list) override;
1552
1553     //------------------------------------------------------------------
1554     // Member variables.
1555     //------------------------------------------------------------------
1556     Debugger &      m_debugger;
1557     lldb::PlatformSP m_platform_sp;     ///< The platform for this target.
1558     Mutex           m_mutex;            ///< An API mutex that is used by the lldb::SB* classes make the SB interface thread safe
1559     ArchSpec        m_arch;
1560     ModuleList      m_images;           ///< The list of images for this process (shared libraries and anything dynamically loaded).
1561     SectionLoadHistory m_section_load_history;
1562     BreakpointList  m_breakpoint_list;
1563     BreakpointList  m_internal_breakpoint_list;
1564     lldb::BreakpointSP m_last_created_breakpoint;
1565     WatchpointList  m_watchpoint_list;
1566     lldb::WatchpointSP m_last_created_watchpoint;
1567     // We want to tightly control the process destruction process so
1568     // we can correctly tear down everything that we need to, so the only
1569     // class that knows about the process lifespan is this target class.
1570     lldb::ProcessSP m_process_sp;
1571     lldb::SearchFilterSP  m_search_filter_sp;
1572     PathMappingList m_image_search_paths;
1573     TypeSystemMap m_scratch_type_system_map;
1574     
1575     typedef std::map<lldb::LanguageType, lldb::REPLSP> REPLMap;
1576     REPLMap m_repl_map;
1577     
1578     lldb::ClangASTImporterSP m_ast_importer_sp;
1579     lldb::ClangModulesDeclVendorUP m_clang_modules_decl_vendor_ap;
1580
1581     lldb::SourceManagerUP m_source_manager_ap;
1582
1583     typedef std::map<lldb::user_id_t, StopHookSP> StopHookCollection;
1584     StopHookCollection      m_stop_hooks;
1585     lldb::user_id_t         m_stop_hook_next_id;
1586     bool                    m_valid;
1587     bool                    m_suppress_stop_hooks;
1588     bool                    m_is_dummy_target;
1589     
1590     static void
1591     ImageSearchPathsChanged (const PathMappingList &path_list,
1592                              void *baton);
1593
1594 private:
1595     //------------------------------------------------------------------
1596     /// Construct with optional file and arch.
1597     ///
1598     /// This member is private. Clients must use
1599     /// TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1600     /// so all targets can be tracked from the central target list.
1601     ///
1602     /// @see TargetList::CreateTarget(const FileSpec*, const ArchSpec*)
1603     //------------------------------------------------------------------
1604     Target (Debugger &debugger,
1605             const ArchSpec &target_arch,
1606             const lldb::PlatformSP &platform_sp,
1607             bool is_dummy_target);
1608
1609     // Helper function.
1610     bool
1611     ProcessIsValid ();
1612
1613     // Copy breakpoints, stop hooks and so forth from the dummy target:
1614     void
1615     PrimeFromDummyTarget(Target *dummy_target);
1616
1617     void
1618     AddBreakpoint(lldb::BreakpointSP breakpoint_sp, bool internal);
1619
1620     DISALLOW_COPY_AND_ASSIGN (Target);
1621 };
1622
1623 } // namespace lldb_private
1624
1625 #endif // liblldb_Target_h_