]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/API/SBTarget.h
Vendor import of lldb release_39 branch r276489:
[FreeBSD/FreeBSD.git] / include / lldb / API / SBTarget.h
1 //===-- SBTarget.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 LLDB_SBTarget_h_
11 #define LLDB_SBTarget_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/API/SBDefines.h"
18 #include "lldb/API/SBAddress.h"
19 #include "lldb/API/SBAttachInfo.h"
20 #include "lldb/API/SBBroadcaster.h"
21 #include "lldb/API/SBFileSpec.h"
22 #include "lldb/API/SBFileSpecList.h"
23 #include "lldb/API/SBLaunchInfo.h"
24 #include "lldb/API/SBSymbolContextList.h"
25 #include "lldb/API/SBType.h"
26 #include "lldb/API/SBValue.h"
27 #include "lldb/API/SBWatchpoint.h"
28
29 namespace lldb {
30
31 class SBPlatform;
32
33 class LLDB_API SBTarget
34 {
35 public:
36     //------------------------------------------------------------------
37     // Broadcaster bits.
38     //------------------------------------------------------------------
39     enum
40     {
41         eBroadcastBitBreakpointChanged  = (1 << 0),
42         eBroadcastBitModulesLoaded      = (1 << 1),
43         eBroadcastBitModulesUnloaded    = (1 << 2),
44         eBroadcastBitWatchpointChanged  = (1 << 3),
45         eBroadcastBitSymbolsLoaded      = (1 << 4)
46     };
47
48     //------------------------------------------------------------------
49     // Constructors
50     //------------------------------------------------------------------
51     SBTarget ();
52
53     SBTarget (const lldb::SBTarget& rhs);
54
55     SBTarget (const lldb::TargetSP& target_sp);
56     
57     //------------------------------------------------------------------
58     // Destructor
59     //------------------------------------------------------------------
60     ~SBTarget();
61
62     const lldb::SBTarget&
63     operator = (const lldb::SBTarget& rhs);
64
65     bool
66     IsValid() const;
67
68     static bool
69     EventIsTargetEvent (const lldb::SBEvent &event);
70
71     static lldb::SBTarget
72     GetTargetFromEvent (const lldb::SBEvent &event);
73     
74     static uint32_t
75     GetNumModulesFromEvent (const lldb::SBEvent &event);
76
77     static lldb::SBModule
78     GetModuleAtIndexFromEvent (const uint32_t idx, const lldb::SBEvent &event);
79
80     static const char *
81     GetBroadcasterClassName ();
82
83     lldb::SBProcess
84     GetProcess ();
85
86     //------------------------------------------------------------------
87     /// Return the platform object associated with the target.
88     ///
89     /// After return, the platform object should be checked for
90     /// validity.
91     ///
92     /// @return
93     ///     A platform object.
94     //------------------------------------------------------------------
95     lldb::SBPlatform
96     GetPlatform ();
97
98     //------------------------------------------------------------------
99     /// Install any binaries that need to be installed.
100     ///
101     /// This function does nothing when debugging on the host system.
102     /// When connected to remote platforms, the target's main executable
103     /// and any modules that have their remote install path set will be
104     /// installed on the remote platform. If the main executable doesn't
105     /// have an install location set, it will be installed in the remote
106     /// platform's working directory.
107     ///
108     /// @return
109     ///     An error describing anything that went wrong during
110     ///     installation.
111     //------------------------------------------------------------------
112     SBError
113     Install();
114     
115     //------------------------------------------------------------------
116     /// Launch a new process.
117     ///
118     /// Launch a new process by spawning a new process using the
119     /// target object's executable module's file as the file to launch.
120     /// Arguments are given in \a argv, and the environment variables
121     /// are in \a envp. Standard input and output files can be
122     /// optionally re-directed to \a stdin_path, \a stdout_path, and
123     /// \a stderr_path.
124     ///
125     /// @param[in] listener
126     ///     An optional listener that will receive all process events.
127     ///     If \a listener is valid then \a listener will listen to all
128     ///     process events. If not valid, then this target's debugger
129     ///     (SBTarget::GetDebugger()) will listen to all process events. 
130     ///
131     /// @param[in] argv
132     ///     The argument array.
133     ///
134     /// @param[in] envp
135     ///     The environment array.
136     ///
137     /// @param[in] launch_flags
138     ///     Flags to modify the launch (@see lldb::LaunchFlags)
139     ///
140     /// @param[in] stdin_path
141     ///     The path to use when re-directing the STDIN of the new
142     ///     process. If all stdXX_path arguments are nullptr, a pseudo
143     ///     terminal will be used.
144     ///
145     /// @param[in] stdout_path
146     ///     The path to use when re-directing the STDOUT of the new
147     ///     process. If all stdXX_path arguments are nullptr, a pseudo
148     ///     terminal will be used.
149     ///
150     /// @param[in] stderr_path
151     ///     The path to use when re-directing the STDERR of the new
152     ///     process. If all stdXX_path arguments are nullptr, a pseudo
153     ///     terminal will be used.
154     ///
155     /// @param[in] working_directory
156     ///     The working directory to have the child process run in
157     ///
158     /// @param[in] launch_flags
159     ///     Some launch options specified by logical OR'ing 
160     ///     lldb::LaunchFlags enumeration values together.
161     ///
162     /// @param[in] stop_at_entry
163     ///     If false do not stop the inferior at the entry point.
164     ///
165     /// @param[out] error
166     ///     An error object. Contains the reason if there is some failure.
167     ///
168     /// @return
169     ///      A process object for the newly created process.
170     //------------------------------------------------------------------
171     lldb::SBProcess
172     Launch (SBListener &listener, 
173             char const **argv,
174             char const **envp,
175             const char *stdin_path,
176             const char *stdout_path,
177             const char *stderr_path,
178             const char *working_directory,
179             uint32_t launch_flags,   // See LaunchFlags
180             bool stop_at_entry,
181             lldb::SBError& error);
182
183     SBProcess
184     LoadCore (const char *core_file);
185
186     //------------------------------------------------------------------
187     /// Launch a new process with sensible defaults.
188     ///
189     /// @param[in] argv
190     ///     The argument array.
191     ///
192     /// @param[in] envp
193     ///     The environment array.
194     ///
195     /// @param[in] working_directory
196     ///     The working directory to have the child process run in
197     ///
198     /// Default: listener
199     ///     Set to the target's debugger (SBTarget::GetDebugger())
200     ///
201     /// Default: launch_flags
202     ///     Empty launch flags
203     ///
204     /// Default: stdin_path
205     /// Default: stdout_path
206     /// Default: stderr_path
207     ///     A pseudo terminal will be used.
208     ///
209     /// @return
210     ///      A process object for the newly created process.
211     //------------------------------------------------------------------
212     SBProcess
213     LaunchSimple (const char **argv, 
214                   const char **envp,
215                   const char *working_directory);
216     
217     SBProcess
218     Launch (SBLaunchInfo &launch_info, SBError& error);
219     
220     SBProcess
221     Attach (SBAttachInfo &attach_info, SBError& error);
222
223     //------------------------------------------------------------------
224     /// Attach to process with pid.
225     ///
226     /// @param[in] listener
227     ///     An optional listener that will receive all process events.
228     ///     If \a listener is valid then \a listener will listen to all
229     ///     process events. If not valid, then this target's debugger
230     ///     (SBTarget::GetDebugger()) will listen to all process events.
231     ///
232     /// @param[in] pid
233     ///     The process ID to attach to.
234     ///
235     /// @param[out] error
236     ///     An error explaining what went wrong if attach fails.
237     ///
238     /// @return
239     ///      A process object for the attached process.
240     //------------------------------------------------------------------
241     lldb::SBProcess
242     AttachToProcessWithID (SBListener &listener,
243                            lldb::pid_t pid,
244                            lldb::SBError& error);
245
246 #if defined(__APPLE__)
247     // We need to keep this around for a build or two since Xcode links
248     // to the 32 bit version of this function. We will take it out soon.
249     lldb::SBProcess
250     AttachToProcessWithID (SBListener &listener,
251                            ::pid_t pid,           // 32 bit int process ID
252                            lldb::SBError& error); // DEPRECATED 
253 #endif
254
255     //------------------------------------------------------------------
256     /// Attach to process with name.
257     ///
258     /// @param[in] listener
259     ///     An optional listener that will receive all process events.
260     ///     If \a listener is valid then \a listener will listen to all
261     ///     process events. If not valid, then this target's debugger
262     ///     (SBTarget::GetDebugger()) will listen to all process events.
263     ///
264     /// @param[in] name
265     ///     Basename of process to attach to.
266     ///
267     /// @param[in] wait_for
268     ///     If true wait for a new instance of 'name' to be launched.
269     ///
270     /// @param[out] error
271     ///     An error explaining what went wrong if attach fails.
272     ///
273     /// @return
274     ///      A process object for the attached process.
275     //------------------------------------------------------------------
276     lldb::SBProcess
277     AttachToProcessWithName (SBListener &listener,
278                              const char *name,
279                              bool wait_for,
280                              lldb::SBError& error);
281
282     //------------------------------------------------------------------
283     /// Connect to a remote debug server with url.
284     ///
285     /// @param[in] listener
286     ///     An optional listener that will receive all process events.
287     ///     If \a listener is valid then \a listener will listen to all
288     ///     process events. If not valid, then this target's debugger
289     ///     (SBTarget::GetDebugger()) will listen to all process events.
290     ///
291     /// @param[in] url
292     ///     The url to connect to, e.g., 'connect://localhost:12345'.
293     ///
294     /// @param[in] plugin_name
295     ///     The plugin name to be used; can be nullptr.
296     ///
297     /// @param[out] error
298     ///     An error explaining what went wrong if the connect fails.
299     ///
300     /// @return
301     ///      A process object for the connected process.
302     //------------------------------------------------------------------
303     lldb::SBProcess
304     ConnectRemote (SBListener &listener,
305                    const char *url,
306                    const char *plugin_name,
307                    SBError& error);
308     
309     lldb::SBFileSpec
310     GetExecutable ();
311
312     bool
313     AddModule (lldb::SBModule &module);
314
315     lldb::SBModule
316     AddModule (const char *path,
317                const char *triple,
318                const char *uuid);
319
320     lldb::SBModule
321     AddModule (const char *path,
322                const char *triple,
323                const char *uuid_cstr,
324                const char *symfile);
325     
326     lldb::SBModule
327     AddModule (const SBModuleSpec &module_spec);
328
329     uint32_t
330     GetNumModules () const;
331
332     lldb::SBModule
333     GetModuleAtIndex (uint32_t idx);
334
335     bool
336     RemoveModule (lldb::SBModule module);
337
338     lldb::SBDebugger
339     GetDebugger() const;
340
341     lldb::SBModule
342     FindModule (const lldb::SBFileSpec &file_spec);
343
344     lldb::ByteOrder
345     GetByteOrder ();
346
347     uint32_t
348     GetAddressByteSize();
349
350     const char *
351     GetTriple ();
352
353     //------------------------------------------------------------------
354     /// Architecture data byte width accessor
355     ///
356     /// @return
357     /// The size in 8-bit (host) bytes of a minimum addressable
358     /// unit from the Architecture's data bus
359     //------------------------------------------------------------------
360     uint32_t
361     GetDataByteSize ();
362
363     //------------------------------------------------------------------
364     /// Architecture code byte width accessor
365     ///
366     /// @return
367     /// The size in 8-bit (host) bytes of a minimum addressable
368     /// unit from the Architecture's code bus
369     //------------------------------------------------------------------
370     uint32_t
371     GetCodeByteSize ();
372
373     //------------------------------------------------------------------
374     /// Set the base load address for a module section.
375     ///
376     /// @param[in] section
377     ///     The section whose base load address will be set within this
378     ///     target.
379     ///
380     /// @param[in] section_base_addr
381     ///     The base address for the section.
382     ///
383     /// @return
384     ///      An error to indicate success, fail, and any reason for 
385     ///     failure.
386     //------------------------------------------------------------------
387     lldb::SBError
388     SetSectionLoadAddress (lldb::SBSection section,
389                            lldb::addr_t section_base_addr);
390     
391     //------------------------------------------------------------------
392     /// Clear the base load address for a module section.
393     ///
394     /// @param[in] section
395     ///     The section whose base load address will be cleared within
396     ///     this target.
397     ///
398     /// @return
399     ///      An error to indicate success, fail, and any reason for 
400     ///     failure.
401     //------------------------------------------------------------------
402     lldb::SBError
403     ClearSectionLoadAddress (lldb::SBSection section);
404     
405     //------------------------------------------------------------------
406     /// Slide all file addresses for all module sections so that \a module
407     /// appears to loaded at these slide addresses.
408     /// 
409     /// When you need all sections within a module to be loaded at a 
410     /// rigid slide from the addresses found in the module object file,
411     /// this function will allow you to easily and quickly slide all
412     /// module sections.
413     ///
414     /// @param[in] module
415     ///     The module to load.
416     ///
417     /// @param[in] sections_offset
418     ///     An offset that will be applied to all section file addresses
419     ///     (the virtual addresses found in the object file itself).
420     ///
421     /// @return
422     ///     An error to indicate success, fail, and any reason for 
423     ///     failure.
424     //------------------------------------------------------------------
425     lldb::SBError
426     SetModuleLoadAddress (lldb::SBModule module,
427                           int64_t sections_offset);
428
429     //------------------------------------------------------------------
430     /// Clear the section base load addresses for all sections in a module.
431     /// 
432     /// @param[in] module
433     ///     The module to unload.
434     ///
435     /// @return
436     ///     An error to indicate success, fail, and any reason for 
437     ///     failure.
438     //------------------------------------------------------------------
439     lldb::SBError
440     ClearModuleLoadAddress (lldb::SBModule module);
441
442     //------------------------------------------------------------------
443     /// Find functions by name.
444     ///
445     /// @param[in] name
446     ///     The name of the function we are looking for.
447     ///
448     /// @param[in] name_type_mask
449     ///     A logical OR of one or more FunctionNameType enum bits that
450     ///     indicate what kind of names should be used when doing the
451     ///     lookup. Bits include fully qualified names, base names,
452     ///     C++ methods, or ObjC selectors. 
453     ///     See FunctionNameType for more details.
454     ///
455     /// @return
456     ///     A lldb::SBSymbolContextList that gets filled in with all of 
457     ///     the symbol contexts for all the matches.
458     //------------------------------------------------------------------
459     lldb::SBSymbolContextList
460     FindFunctions (const char *name, 
461                    uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
462
463     //------------------------------------------------------------------
464     /// Find global and static variables by name.
465     ///
466     /// @param[in] name
467     ///     The name of the global or static variable we are looking
468     ///     for.
469     ///
470     /// @param[in] max_matches
471     ///     Allow the number of matches to be limited to \a max_matches.
472     ///
473     /// @return
474     ///     A list of matched variables in an SBValueList.
475     //------------------------------------------------------------------
476     lldb::SBValueList
477     FindGlobalVariables (const char *name, 
478                          uint32_t max_matches);
479
480     //------------------------------------------------------------------
481     /// Find the first global (or static) variable by name.
482     ///
483     /// @param[in] name
484     ///     The name of the global or static variable we are looking
485     ///     for.
486     ///
487     /// @return
488     ///     An SBValue that gets filled in with the found variable (if any).
489     //------------------------------------------------------------------
490     lldb::SBValue
491     FindFirstGlobalVariable (const char* name);
492
493     //------------------------------------------------------------------
494     /// Find global and static variables by pattern.
495     ///
496     /// @param[in] name
497     ///     The pattern to search for global or static variables
498     ///
499     /// @param[in] max_matches
500     ///     Allow the number of matches to be limited to \a max_matches.
501     /// 
502     /// @param[in] matchtype
503     ///     The match type to use.    
504     ///
505     /// @return
506     ///     A list of matched variables in an SBValueList.
507     //------------------------------------------------------------------
508     lldb::SBValueList
509         FindGlobalVariables(const char *name,
510                             uint32_t max_matches,
511                             MatchType matchtype);
512     
513     //------------------------------------------------------------------
514     /// Find global functions by their name with pattern matching.
515     ///
516     /// @param[in] name
517     ///     The pattern to search for global or static variables
518     ///
519     /// @param[in] max_matches
520     ///     Allow the number of matches to be limited to \a max_matches.
521     /// 
522     /// @param[in] matchtype
523     ///     The match type to use.    
524     ///
525     /// @return
526     ///     A list of matched variables in an SBValueList.
527     //------------------------------------------------------------------
528     lldb::SBSymbolContextList
529         FindGlobalFunctions(const char *name,
530                            uint32_t max_matches,
531                            MatchType matchtype);
532
533     void
534     Clear ();
535
536     //------------------------------------------------------------------
537     /// Resolve a current file address into a section offset address.
538     ///
539     /// @param[in] file_addr
540     ///
541     /// @return
542     ///     An SBAddress which will be valid if...
543     //------------------------------------------------------------------
544     lldb::SBAddress
545     ResolveFileAddress (lldb::addr_t file_addr);
546
547     //------------------------------------------------------------------
548     /// Resolve a current load address into a section offset address.
549     ///
550     /// @param[in] vm_addr
551     ///     A virtual address from the current process state that is to
552     ///     be translated into a section offset address.
553     ///
554     /// @return
555     ///     An SBAddress which will be valid if \a vm_addr was
556     ///     successfully resolved into a section offset address, or an
557     ///     invalid SBAddress if \a vm_addr doesn't resolve to a section
558     ///     in a module.
559     //------------------------------------------------------------------
560     lldb::SBAddress
561     ResolveLoadAddress (lldb::addr_t vm_addr);
562
563     //------------------------------------------------------------------
564     /// Resolve a current load address into a section offset address
565     /// using the process stop ID to identify a time in the past.
566     ///
567     /// @param[in] stop_id
568     ///     Each time a process stops, the process stop ID integer gets
569     ///     incremented. These stop IDs are used to identify past times
570     ///     and can be used in history objects as a cheap way to store
571     ///     the time at which the sample was taken. Specifying
572     ///     UINT32_MAX will always resolve the address using the
573     ///     currently loaded sections.
574     ///
575     /// @param[in] vm_addr
576     ///     A virtual address from the current process state that is to
577     ///     be translated into a section offset address.
578     ///
579     /// @return
580     ///     An SBAddress which will be valid if \a vm_addr was
581     ///     successfully resolved into a section offset address, or an
582     ///     invalid SBAddress if \a vm_addr doesn't resolve to a section
583     ///     in a module.
584     //------------------------------------------------------------------
585     lldb::SBAddress
586     ResolvePastLoadAddress (uint32_t stop_id, lldb::addr_t vm_addr);
587
588     SBSymbolContext
589     ResolveSymbolContextForAddress (const SBAddress& addr, 
590                                     uint32_t resolve_scope);
591
592     //------------------------------------------------------------------
593     /// Read target memory. If a target process is running then memory  
594     /// is read from here. Otherwise the memory is read from the object
595     /// files. For a target whose bytes are sized as a multiple of host
596     /// bytes, the data read back will preserve the target's byte order.
597     ///
598     /// @param[in] addr
599     ///     A target address to read from. 
600     ///
601     /// @param[out] buf
602     ///     The buffer to read memory into. 
603     ///
604     /// @param[in] size
605     ///     The maximum number of host bytes to read in the buffer passed
606     ///     into this call
607     ///
608     /// @param[out] error
609     ///     Error information is written here if the memory read fails.
610     ///
611     /// @return
612     ///     The amount of data read in host bytes.
613     //------------------------------------------------------------------
614     size_t
615     ReadMemory (const SBAddress addr, void *buf, size_t size, lldb::SBError &error);
616
617     lldb::SBBreakpoint
618     BreakpointCreateByLocation (const char *file, uint32_t line);
619
620     lldb::SBBreakpoint
621     BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line);
622
623     lldb::SBBreakpoint
624     BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line, lldb::addr_t offset);
625
626     lldb::SBBreakpoint
627     BreakpointCreateByName(const char *symbol_name, const char *module_name = nullptr);
628
629     // This version uses name_type_mask = eFunctionNameTypeAuto
630     lldb::SBBreakpoint
631     BreakpointCreateByName (const char *symbol_name, 
632                             const SBFileSpecList &module_list, 
633                             const SBFileSpecList &comp_unit_list);
634
635     lldb::SBBreakpoint
636     BreakpointCreateByName (const char *symbol_name,
637                             uint32_t name_type_mask,           // Logical OR one or more FunctionNameType enum bits
638                             const SBFileSpecList &module_list, 
639                             const SBFileSpecList &comp_unit_list);
640
641     lldb::SBBreakpoint
642     BreakpointCreateByName (const char *symbol_name,
643                             uint32_t name_type_mask,           // Logical OR one or more FunctionNameType enum bits
644                             lldb::LanguageType symbol_language,
645                             const SBFileSpecList &module_list, 
646                             const SBFileSpecList &comp_unit_list);
647
648     lldb::SBBreakpoint
649     BreakpointCreateByNames (const char *symbol_name[],
650                              uint32_t num_names,
651                              uint32_t name_type_mask,           // Logical OR one or more FunctionNameType enum bits
652                              const SBFileSpecList &module_list,
653                              const SBFileSpecList &comp_unit_list);
654
655     lldb::SBBreakpoint
656     BreakpointCreateByNames (const char *symbol_name[],
657                              uint32_t num_names,
658                              uint32_t name_type_mask,           // Logical OR one or more FunctionNameType enum bits
659                              lldb::LanguageType symbol_language,
660                              const SBFileSpecList &module_list,
661                              const SBFileSpecList &comp_unit_list);
662
663     lldb::SBBreakpoint
664     BreakpointCreateByNames (const char *symbol_name[],
665                              uint32_t num_names,
666                              uint32_t name_type_mask,           // Logical OR one or more FunctionNameType enum bits
667                              lldb::LanguageType symbol_language,
668                              lldb::addr_t offset,
669                              const SBFileSpecList &module_list,
670                              const SBFileSpecList &comp_unit_list);
671
672     lldb::SBBreakpoint
673     BreakpointCreateByRegex (const char *symbol_name_regex, const char *module_name = nullptr);
674     
675     lldb::SBBreakpoint
676     BreakpointCreateByRegex (const char *symbol_name_regex, 
677                              const SBFileSpecList &module_list, 
678                              const SBFileSpecList &comp_unit_list);
679     
680     lldb::SBBreakpoint
681     BreakpointCreateByRegex (const char *symbol_name_regex,
682                              lldb::LanguageType symbol_language,
683                              const SBFileSpecList &module_list, 
684                              const SBFileSpecList &comp_unit_list);
685     
686     lldb::SBBreakpoint
687     BreakpointCreateBySourceRegex(const char *source_regex,
688                                   const SBFileSpec &source_file,
689                                   const char *module_name = nullptr);
690
691     lldb::SBBreakpoint
692     BreakpointCreateBySourceRegex (const char *source_regex,
693                                    const SBFileSpecList &module_list,
694                                    const SBFileSpecList &source_file);
695     
696     lldb::SBBreakpoint
697     BreakpointCreateBySourceRegex (const char *source_regex,
698                                    const SBFileSpecList &module_list,
699                                    const SBFileSpecList &source_file,
700                                    const SBStringList  &func_names);
701     
702     lldb::SBBreakpoint
703     BreakpointCreateForException  (lldb::LanguageType language,
704                                    bool catch_bp,
705                                    bool throw_bp);
706
707     lldb::SBBreakpoint
708     BreakpointCreateByAddress (addr_t address);
709
710     lldb::SBBreakpoint
711     BreakpointCreateBySBAddress (SBAddress &address);
712
713     uint32_t
714     GetNumBreakpoints () const;
715
716     lldb::SBBreakpoint
717     GetBreakpointAtIndex (uint32_t idx) const;
718
719     bool
720     BreakpointDelete (break_id_t break_id);
721
722     lldb::SBBreakpoint
723     FindBreakpointByID (break_id_t break_id);
724
725     bool
726     EnableAllBreakpoints ();
727
728     bool
729     DisableAllBreakpoints ();
730
731     bool
732     DeleteAllBreakpoints ();
733
734     uint32_t
735     GetNumWatchpoints () const;
736
737     lldb::SBWatchpoint
738     GetWatchpointAtIndex (uint32_t idx) const;
739
740     bool
741     DeleteWatchpoint (lldb::watch_id_t watch_id);
742
743     lldb::SBWatchpoint
744     FindWatchpointByID (lldb::watch_id_t watch_id);
745
746     lldb::SBWatchpoint
747     WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write, SBError& error);
748
749     bool
750     EnableAllWatchpoints ();
751
752     bool
753     DisableAllWatchpoints ();
754
755     bool
756     DeleteAllWatchpoints ();
757
758     lldb::SBBroadcaster
759     GetBroadcaster () const;
760     
761     lldb::SBType
762     FindFirstType (const char* type);
763     
764     lldb::SBTypeList
765     FindTypes (const char* type);
766     
767     lldb::SBType
768     GetBasicType(lldb::BasicType type);
769     
770     lldb::SBValue
771     CreateValueFromAddress (const char *name, lldb::SBAddress addr, lldb::SBType type);
772
773     lldb::SBValue
774     CreateValueFromData (const char *name, lldb::SBData data, lldb::SBType type);
775
776     lldb::SBValue
777     CreateValueFromExpression (const char *name, const char* expr);
778     
779     SBSourceManager
780     GetSourceManager();
781     
782     lldb::SBInstructionList
783     ReadInstructions (lldb::SBAddress base_addr, uint32_t count);
784
785     lldb::SBInstructionList
786     ReadInstructions (lldb::SBAddress base_addr, uint32_t count, const char *flavor_string);
787
788     lldb::SBInstructionList
789     GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t size);
790     
791     // The "WithFlavor" is necessary to keep SWIG from getting confused about overloaded arguments when
792     // using the buf + size -> Python Object magic.
793     
794     lldb::SBInstructionList
795     GetInstructionsWithFlavor (lldb::SBAddress base_addr,  const char *flavor_string, const void *buf, size_t size);
796     
797     lldb::SBInstructionList
798     GetInstructions (lldb::addr_t base_addr, const void *buf, size_t size);
799
800     lldb::SBInstructionList
801     GetInstructionsWithFlavor (lldb::addr_t base_addr, const char *flavor_string, const void *buf, size_t size);
802
803     lldb::SBSymbolContextList
804     FindSymbols (const char *name,
805                  lldb::SymbolType type = eSymbolTypeAny);
806
807     bool
808     operator == (const lldb::SBTarget &rhs) const;
809
810     bool
811     operator != (const lldb::SBTarget &rhs) const;
812
813     bool
814     GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
815
816     lldb::SBValue
817     EvaluateExpression (const char *expr);
818
819     lldb::SBValue
820     EvaluateExpression (const char *expr, const SBExpressionOptions &options);
821
822     lldb::addr_t
823     GetStackRedZoneSize();
824
825     lldb::SBLaunchInfo
826     GetLaunchInfo () const;
827
828     void
829     SetLaunchInfo (const lldb::SBLaunchInfo &launch_info);
830     
831 protected:
832     friend class SBAddress;
833     friend class SBBlock;
834     friend class SBDebugger;
835     friend class SBExecutionContext;
836     friend class SBFunction;
837     friend class SBInstruction;
838     friend class SBModule;
839     friend class SBProcess;
840     friend class SBSection;
841     friend class SBSourceManager;
842     friend class SBSymbol;
843     friend class SBValue;
844
845     //------------------------------------------------------------------
846     // Constructors are private, use static Target::Create function to
847     // create an instance of this class.
848     //------------------------------------------------------------------
849
850     lldb::TargetSP
851     GetSP () const;
852
853     void
854     SetSP (const lldb::TargetSP& target_sp);
855
856 private:
857     lldb::TargetSP m_opaque_sp;
858 };
859
860 } // namespace lldb
861
862 #endif // LLDB_SBTarget_h_