blob: 39b4e5004ebfb1ba0b9da5dce7d60e79406f057a [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- SBTarget.cpp --------------------------------------------*- 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
Eli Friedman7a62c8b2010-06-09 07:44:37 +000010#include "lldb/API/SBTarget.h"
Chris Lattner24943d22010-06-08 16:52:24 +000011
12#include "lldb/lldb-include.h"
13
14#include "lldb/API/SBFileSpec.h"
15#include "lldb/API/SBModule.h"
Caroline Tice98f930f2010-09-20 05:20:02 +000016#include "lldb/API/SBStream.h"
Chris Lattner24943d22010-06-08 16:52:24 +000017#include "lldb/Breakpoint/BreakpointID.h"
18#include "lldb/Breakpoint/BreakpointIDList.h"
19#include "lldb/Breakpoint/BreakpointList.h"
20#include "lldb/Breakpoint/BreakpointLocation.h"
21#include "lldb/Core/Address.h"
22#include "lldb/Core/AddressResolver.h"
23#include "lldb/Core/AddressResolverName.h"
Jim Ingham84cdc152010-06-15 19:49:27 +000024#include "lldb/Interpreter/Args.h"
Chris Lattner24943d22010-06-08 16:52:24 +000025#include "lldb/Core/ArchSpec.h"
26#include "lldb/Core/Debugger.h"
27#include "lldb/Core/Disassembler.h"
28#include "lldb/Core/FileSpec.h"
29#include "lldb/Core/RegularExpression.h"
30#include "lldb/Core/SearchFilter.h"
31#include "lldb/Core/STLUtils.h"
32#include "lldb/Target/Process.h"
33#include "lldb/Target/Target.h"
34#include "lldb/Target/TargetList.h"
35
36#include "lldb/Interpreter/CommandReturnObject.h"
37#include "../source/Commands/CommandObjectBreakpoint.h"
38
Eli Friedman7a62c8b2010-06-09 07:44:37 +000039#include "lldb/API/SBDebugger.h"
40#include "lldb/API/SBProcess.h"
41#include "lldb/API/SBListener.h"
42#include "lldb/API/SBBreakpoint.h"
Chris Lattner24943d22010-06-08 16:52:24 +000043
44using namespace lldb;
45using namespace lldb_private;
46
47#define DEFAULT_DISASM_BYTE_SIZE 32
48
49//----------------------------------------------------------------------
50// SBTarget constructor
51//----------------------------------------------------------------------
52SBTarget::SBTarget ()
53{
54}
55
56SBTarget::SBTarget (const SBTarget& rhs) :
Greg Clayton63094e02010-06-23 01:19:29 +000057 m_opaque_sp (rhs.m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +000058{
59}
60
61SBTarget::SBTarget(const TargetSP& target_sp) :
Greg Clayton63094e02010-06-23 01:19:29 +000062 m_opaque_sp (target_sp)
Chris Lattner24943d22010-06-08 16:52:24 +000063{
64}
65
66const SBTarget&
67SBTarget::Assign (const SBTarget& rhs)
68{
69 if (this != &rhs)
70 {
Greg Clayton63094e02010-06-23 01:19:29 +000071 m_opaque_sp = rhs.m_opaque_sp;
Chris Lattner24943d22010-06-08 16:52:24 +000072 }
73 return *this;
74}
75
76
77//----------------------------------------------------------------------
78// Destructor
79//----------------------------------------------------------------------
80SBTarget::~SBTarget()
81{
82}
83
84bool
85SBTarget::IsValid () const
86{
Greg Clayton63094e02010-06-23 01:19:29 +000087 return m_opaque_sp.get() != NULL;
Chris Lattner24943d22010-06-08 16:52:24 +000088}
89
90SBProcess
91SBTarget::GetProcess ()
92{
93 SBProcess sb_process;
Greg Clayton63094e02010-06-23 01:19:29 +000094 if (m_opaque_sp)
95 sb_process.SetProcess (m_opaque_sp->GetProcessSP());
Chris Lattner24943d22010-06-08 16:52:24 +000096 return sb_process;
97}
98
Greg Clayton63094e02010-06-23 01:19:29 +000099SBDebugger
100SBTarget::GetDebugger () const
101{
102 SBDebugger debugger;
103 if (m_opaque_sp)
104 debugger.reset (m_opaque_sp->GetDebugger().GetSP());
105 return debugger;
106}
107
Chris Lattner24943d22010-06-08 16:52:24 +0000108SBProcess
Chris Lattner24943d22010-06-08 16:52:24 +0000109SBTarget::LaunchProcess
110(
111 char const **argv,
112 char const **envp,
113 const char *tty,
Greg Clayton452bf612010-08-31 18:35:14 +0000114 uint32_t launch_flags,
Chris Lattner24943d22010-06-08 16:52:24 +0000115 bool stop_at_entry
116)
117{
Greg Clayton1a3083a2010-10-06 03:53:16 +0000118 SBProcess sb_process;
119 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000120 {
Greg Clayton1a3083a2010-10-06 03:53:16 +0000121 // When launching, we always want to create a new process
122 sb_process.SetProcess (m_opaque_sp->CreateProcess (m_opaque_sp->GetDebugger().GetListener()));
123
124 if (sb_process.IsValid())
Chris Lattner24943d22010-06-08 16:52:24 +0000125 {
Greg Clayton1a3083a2010-10-06 03:53:16 +0000126 Error error (sb_process->Launch (argv, envp, launch_flags, tty, tty, tty));
127 if (error.Success())
Chris Lattner24943d22010-06-08 16:52:24 +0000128 {
Greg Clayton1a3083a2010-10-06 03:53:16 +0000129 // We we are stopping at the entry point, we can return now!
130 if (stop_at_entry)
131 return sb_process;
132
133 // Make sure we are stopped at the entry
134 StateType state = sb_process->WaitForProcessToStop (NULL);
Chris Lattner24943d22010-06-08 16:52:24 +0000135 if (state == eStateStopped)
Greg Clayton1a3083a2010-10-06 03:53:16 +0000136 {
137 // resume the process to skip the entry point
138 error = sb_process->Resume();
139 if (error.Success())
140 {
141 // If we are doing synchronous mode, then wait for the
142 // process to stop yet again!
143 if (m_opaque_sp->GetDebugger().GetAsyncExecution () == false)
144 sb_process->WaitForProcessToStop (NULL);
145 }
146 }
Chris Lattner24943d22010-06-08 16:52:24 +0000147 }
148 }
149 }
Greg Clayton1a3083a2010-10-06 03:53:16 +0000150 return sb_process;
Chris Lattner24943d22010-06-08 16:52:24 +0000151}
152
153SBFileSpec
154SBTarget::GetExecutable ()
155{
156 SBFileSpec exe_file_spec;
Greg Clayton63094e02010-06-23 01:19:29 +0000157 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000158 {
Greg Clayton63094e02010-06-23 01:19:29 +0000159 ModuleSP exe_module_sp (m_opaque_sp->GetExecutableModule ());
Chris Lattner24943d22010-06-08 16:52:24 +0000160 if (exe_module_sp)
161 exe_file_spec.SetFileSpec (exe_module_sp->GetFileSpec());
162 }
163 return exe_file_spec;
164}
165
166
167bool
168SBTarget::DeleteTargetFromList (TargetList *list)
169{
Greg Clayton63094e02010-06-23 01:19:29 +0000170 if (m_opaque_sp)
171 return list->DeleteTarget (m_opaque_sp);
Chris Lattner24943d22010-06-08 16:52:24 +0000172 else
173 return false;
174}
175
176bool
Chris Lattner24943d22010-06-08 16:52:24 +0000177SBTarget::operator == (const SBTarget &rhs) const
178{
Greg Clayton63094e02010-06-23 01:19:29 +0000179 return m_opaque_sp.get() == rhs.m_opaque_sp.get();
Chris Lattner24943d22010-06-08 16:52:24 +0000180}
181
182bool
183SBTarget::operator != (const SBTarget &rhs) const
184{
Greg Clayton63094e02010-06-23 01:19:29 +0000185 return m_opaque_sp.get() != rhs.m_opaque_sp.get();
Chris Lattner24943d22010-06-08 16:52:24 +0000186}
187
188lldb_private::Target *
Greg Clayton63094e02010-06-23 01:19:29 +0000189SBTarget::operator ->() const
Chris Lattner24943d22010-06-08 16:52:24 +0000190{
Greg Clayton63094e02010-06-23 01:19:29 +0000191 return m_opaque_sp.get();
Chris Lattner24943d22010-06-08 16:52:24 +0000192}
Greg Clayton63094e02010-06-23 01:19:29 +0000193
194lldb_private::Target *
195SBTarget::get() const
Chris Lattner24943d22010-06-08 16:52:24 +0000196{
Greg Clayton63094e02010-06-23 01:19:29 +0000197 return m_opaque_sp.get();
198}
199
200void
201SBTarget::reset (const lldb::TargetSP& target_sp)
202{
203 m_opaque_sp = target_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000204}
205
206SBBreakpoint
207SBTarget::BreakpointCreateByLocation (const char *file, uint32_t line)
208{
209 SBBreakpoint sb_bp;
210 if (file != NULL && line != 0)
211 sb_bp = BreakpointCreateByLocation (SBFileSpec (file), line);
212 return sb_bp;
213}
214
215SBBreakpoint
216SBTarget::BreakpointCreateByLocation (const SBFileSpec &sb_file_spec, uint32_t line)
217{
218 SBBreakpoint sb_bp;
Greg Clayton63094e02010-06-23 01:19:29 +0000219 if (m_opaque_sp.get() && line != 0)
220 *sb_bp = m_opaque_sp->CreateBreakpoint (NULL, *sb_file_spec, line, true, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000221 return sb_bp;
222}
223
224SBBreakpoint
225SBTarget::BreakpointCreateByName (const char *symbol_name, const char *module_name)
226{
227 SBBreakpoint sb_bp;
Greg Clayton63094e02010-06-23 01:19:29 +0000228 if (m_opaque_sp.get() && symbol_name && symbol_name[0])
Chris Lattner24943d22010-06-08 16:52:24 +0000229 {
230 if (module_name && module_name[0])
231 {
232 FileSpec module_file_spec(module_name);
Jim Ingham7ec03bd2010-09-30 21:21:43 +0000233 *sb_bp = m_opaque_sp->CreateBreakpoint (&module_file_spec, symbol_name, eFunctionNameTypeFull | eFunctionNameTypeBase, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000234 }
235 else
236 {
Jim Ingham7ec03bd2010-09-30 21:21:43 +0000237 *sb_bp = m_opaque_sp->CreateBreakpoint (NULL, symbol_name, eFunctionNameTypeFull | eFunctionNameTypeBase, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000238 }
239 }
240 return sb_bp;
241}
242
243SBBreakpoint
244SBTarget::BreakpointCreateByRegex (const char *symbol_name_regex, const char *module_name)
245{
246 SBBreakpoint sb_bp;
Greg Clayton63094e02010-06-23 01:19:29 +0000247 if (m_opaque_sp.get() && symbol_name_regex && symbol_name_regex[0])
Chris Lattner24943d22010-06-08 16:52:24 +0000248 {
249 RegularExpression regexp(symbol_name_regex);
250
251 if (module_name && module_name[0])
252 {
253 FileSpec module_file_spec(module_name);
254
Greg Clayton63094e02010-06-23 01:19:29 +0000255 *sb_bp = m_opaque_sp->CreateBreakpoint (&module_file_spec, regexp, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000256 }
257 else
258 {
Greg Clayton63094e02010-06-23 01:19:29 +0000259 *sb_bp = m_opaque_sp->CreateBreakpoint (NULL, regexp, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000260 }
261 }
262 return sb_bp;
263}
264
265
266
267SBBreakpoint
268SBTarget::BreakpointCreateByAddress (addr_t address)
269{
270 SBBreakpoint sb_bp;
Greg Clayton63094e02010-06-23 01:19:29 +0000271 if (m_opaque_sp.get())
272 *sb_bp = m_opaque_sp->CreateBreakpoint (address, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000273 return sb_bp;
274}
275
Chris Lattner24943d22010-06-08 16:52:24 +0000276SBBreakpoint
277SBTarget::FindBreakpointByID (break_id_t bp_id)
278{
279 SBBreakpoint sb_breakpoint;
Greg Clayton63094e02010-06-23 01:19:29 +0000280 if (m_opaque_sp && bp_id != LLDB_INVALID_BREAK_ID)
281 *sb_breakpoint = m_opaque_sp->GetBreakpointByID (bp_id);
Chris Lattner24943d22010-06-08 16:52:24 +0000282 return sb_breakpoint;
283}
284
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000285uint32_t
286SBTarget::GetNumBreakpoints () const
287{
288 if (m_opaque_sp)
289 return m_opaque_sp->GetBreakpointList().GetSize();
290 return 0;
291}
292
293SBBreakpoint
294SBTarget::GetBreakpointAtIndex (uint32_t idx) const
295{
296 SBBreakpoint sb_breakpoint;
297 if (m_opaque_sp)
298 *sb_breakpoint = m_opaque_sp->GetBreakpointList().GetBreakpointAtIndex(idx);
299 return sb_breakpoint;
300}
Chris Lattner24943d22010-06-08 16:52:24 +0000301
302bool
303SBTarget::BreakpointDelete (break_id_t bp_id)
304{
Greg Clayton63094e02010-06-23 01:19:29 +0000305 if (m_opaque_sp)
306 return m_opaque_sp->RemoveBreakpointByID (bp_id);
Chris Lattner24943d22010-06-08 16:52:24 +0000307 return false;
308}
309
310bool
311SBTarget::EnableAllBreakpoints ()
312{
Greg Clayton63094e02010-06-23 01:19:29 +0000313 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000314 {
Greg Clayton63094e02010-06-23 01:19:29 +0000315 m_opaque_sp->EnableAllBreakpoints ();
Chris Lattner24943d22010-06-08 16:52:24 +0000316 return true;
317 }
318 return false;
319}
320
321bool
322SBTarget::DisableAllBreakpoints ()
323{
Greg Clayton63094e02010-06-23 01:19:29 +0000324 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000325 {
Greg Clayton63094e02010-06-23 01:19:29 +0000326 m_opaque_sp->DisableAllBreakpoints ();
Chris Lattner24943d22010-06-08 16:52:24 +0000327 return true;
328 }
329 return false;
330}
331
332bool
333SBTarget::DeleteAllBreakpoints ()
334{
Greg Clayton63094e02010-06-23 01:19:29 +0000335 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000336 {
Greg Clayton63094e02010-06-23 01:19:29 +0000337 m_opaque_sp->RemoveAllBreakpoints ();
Chris Lattner24943d22010-06-08 16:52:24 +0000338 return true;
339 }
340 return false;
341}
342
343
344uint32_t
345SBTarget::GetNumModules () const
346{
Greg Clayton63094e02010-06-23 01:19:29 +0000347 if (m_opaque_sp)
348 return m_opaque_sp->GetImages().GetSize();
Chris Lattner24943d22010-06-08 16:52:24 +0000349 return 0;
350}
351
Greg Clayton43490d12010-07-30 20:12:55 +0000352void
353SBTarget::Clear ()
354{
355 m_opaque_sp.reset();
356}
357
358
Chris Lattner24943d22010-06-08 16:52:24 +0000359SBModule
360SBTarget::FindModule (const SBFileSpec &sb_file_spec)
361{
362 SBModule sb_module;
Greg Clayton63094e02010-06-23 01:19:29 +0000363 if (m_opaque_sp && sb_file_spec.IsValid())
364 sb_module.SetModule (m_opaque_sp->GetImages().FindFirstModuleForFileSpec (*sb_file_spec, NULL));
Chris Lattner24943d22010-06-08 16:52:24 +0000365 return sb_module;
366}
367
368SBModule
369SBTarget::GetModuleAtIndex (uint32_t idx)
370{
371 SBModule sb_module;
Greg Clayton63094e02010-06-23 01:19:29 +0000372 if (m_opaque_sp)
373 sb_module.SetModule(m_opaque_sp->GetImages().GetModuleAtIndex(idx));
Chris Lattner24943d22010-06-08 16:52:24 +0000374 return sb_module;
375}
376
377
378SBBroadcaster
379SBTarget::GetBroadcaster () const
380{
Greg Clayton63094e02010-06-23 01:19:29 +0000381 SBBroadcaster broadcaster(m_opaque_sp.get(), false);
Chris Lattner24943d22010-06-08 16:52:24 +0000382 return broadcaster;
383}
384
385void
Greg Clayton70436352010-06-30 23:03:03 +0000386SBTarget::Disassemble (lldb::addr_t start_addr, lldb::addr_t end_addr, const char *module_name)
Chris Lattner24943d22010-06-08 16:52:24 +0000387{
Greg Clayton70436352010-06-30 23:03:03 +0000388 if (start_addr == LLDB_INVALID_ADDRESS)
Chris Lattner24943d22010-06-08 16:52:24 +0000389 return;
390
Greg Clayton63094e02010-06-23 01:19:29 +0000391 FILE *out = m_opaque_sp->GetDebugger().GetOutputFileHandle();
Chris Lattner24943d22010-06-08 16:52:24 +0000392 if (out == NULL)
393 return;
394
Greg Clayton63094e02010-06-23 01:19:29 +0000395 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000396 {
Greg Clayton70436352010-06-30 23:03:03 +0000397 ModuleSP module_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000398 if (module_name != NULL)
399 {
Greg Clayton70436352010-06-30 23:03:03 +0000400 FileSpec module_file_spec (module_name);
401 module_sp = m_opaque_sp->GetImages().FindFirstModuleForFileSpec (module_file_spec, NULL);
Chris Lattner24943d22010-06-08 16:52:24 +0000402 }
Greg Clayton70436352010-06-30 23:03:03 +0000403
404 AddressRange range;
405
406 // Make sure the process object is alive if we have one (it might be
407 // created but we might not be launched yet).
Greg Claytoneea26402010-09-14 23:36:40 +0000408
Greg Clayton1a3083a2010-10-06 03:53:16 +0000409 Process *sb_process = m_opaque_sp->GetProcessSP().get();
410 if (sb_process && !sb_process->IsAlive())
411 sb_process = NULL;
Greg Clayton70436352010-06-30 23:03:03 +0000412
413 // If we are given a module, then "start_addr" is a file address in
414 // that module.
415 if (module_sp)
416 {
417 if (!module_sp->ResolveFileAddress (start_addr, range.GetBaseAddress()))
418 range.GetBaseAddress().SetOffset(start_addr);
419 }
Greg Claytoneea26402010-09-14 23:36:40 +0000420 else if (m_opaque_sp->GetSectionLoadList().IsEmpty() == false)
Greg Clayton70436352010-06-30 23:03:03 +0000421 {
422 // We don't have a module, se we need to figure out if "start_addr"
423 // resolves to anything in a running process.
Greg Claytoneea26402010-09-14 23:36:40 +0000424 if (!m_opaque_sp->GetSectionLoadList().ResolveLoadAddress (start_addr, range.GetBaseAddress()))
Greg Clayton70436352010-06-30 23:03:03 +0000425 range.GetBaseAddress().SetOffset(start_addr);
426 }
427 else
428 {
429 if (m_opaque_sp->GetImages().ResolveFileAddress (start_addr, range.GetBaseAddress()))
430 range.GetBaseAddress().SetOffset(start_addr);
431 }
Chris Lattner24943d22010-06-08 16:52:24 +0000432
433 // For now, we need a process; the disassembly functions insist. If we don't have one already,
434 // make one.
435
Greg Clayton70436352010-06-30 23:03:03 +0000436 ExecutionContext exe_ctx;
Chris Lattner24943d22010-06-08 16:52:24 +0000437
Greg Clayton1a3083a2010-10-06 03:53:16 +0000438 if (sb_process)
439 sb_process->CalculateExecutionContext(exe_ctx);
Greg Clayton70436352010-06-30 23:03:03 +0000440 else
Greg Claytona830adb2010-10-04 01:05:56 +0000441 m_opaque_sp->CalculateExecutionContext(exe_ctx);
Chris Lattner24943d22010-06-08 16:52:24 +0000442
Greg Clayton70436352010-06-30 23:03:03 +0000443 if (end_addr == LLDB_INVALID_ADDRESS || end_addr < start_addr)
444 range.SetByteSize( DEFAULT_DISASM_BYTE_SIZE);
445 else
446 range.SetByteSize(end_addr - start_addr);
Chris Lattner24943d22010-06-08 16:52:24 +0000447
Greg Clayton70436352010-06-30 23:03:03 +0000448 StreamFile out_stream (out);
Chris Lattner24943d22010-06-08 16:52:24 +0000449
Greg Clayton70436352010-06-30 23:03:03 +0000450 Disassembler::Disassemble (m_opaque_sp->GetDebugger(),
451 m_opaque_sp->GetArchitecture(),
452 exe_ctx,
453 range,
454 3,
455 false,
456 out_stream);
Chris Lattner24943d22010-06-08 16:52:24 +0000457 }
458}
459
460void
461SBTarget::Disassemble (const char *function_name, const char *module_name)
462{
463 if (function_name == NULL)
464 return;
465
Greg Clayton63094e02010-06-23 01:19:29 +0000466 FILE *out = m_opaque_sp->GetDebugger().GetOutputFileHandle();
Chris Lattner24943d22010-06-08 16:52:24 +0000467 if (out == NULL)
468 return;
469
Greg Clayton63094e02010-06-23 01:19:29 +0000470 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000471 {
Greg Clayton70436352010-06-30 23:03:03 +0000472 Disassembler *disassembler = Disassembler::FindPlugin (m_opaque_sp->GetArchitecture());
Chris Lattner24943d22010-06-08 16:52:24 +0000473 if (disassembler == NULL)
474 return;
475
Greg Clayton70436352010-06-30 23:03:03 +0000476 ModuleSP module_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000477 if (module_name != NULL)
Chris Lattner24943d22010-06-08 16:52:24 +0000478 {
Greg Clayton70436352010-06-30 23:03:03 +0000479 FileSpec module_file_spec (module_name);
480 module_sp = m_opaque_sp->GetImages().FindFirstModuleForFileSpec (module_file_spec, NULL);
Chris Lattner24943d22010-06-08 16:52:24 +0000481 }
Greg Clayton70436352010-06-30 23:03:03 +0000482
483 ExecutionContext exe_ctx;
484
485 // Make sure the process object is alive if we have one (it might be
486 // created but we might not be launched yet).
Greg Clayton1a3083a2010-10-06 03:53:16 +0000487 Process *sb_process = m_opaque_sp->GetProcessSP().get();
488 if (sb_process && !sb_process->IsAlive())
489 sb_process = NULL;
Greg Clayton70436352010-06-30 23:03:03 +0000490
Greg Clayton1a3083a2010-10-06 03:53:16 +0000491 if (sb_process)
492 sb_process->CalculateExecutionContext(exe_ctx);
Greg Clayton70436352010-06-30 23:03:03 +0000493 else
Greg Claytona830adb2010-10-04 01:05:56 +0000494 m_opaque_sp->CalculateExecutionContext(exe_ctx);
Greg Clayton70436352010-06-30 23:03:03 +0000495
496
497 StreamFile out_stream (out);
498
499 Disassembler::Disassemble (m_opaque_sp->GetDebugger(),
500 m_opaque_sp->GetArchitecture(),
501 exe_ctx,
502 ConstString (function_name),
503 module_sp.get(),
504 3,
505 false,
506 out_stream);
Chris Lattner24943d22010-06-08 16:52:24 +0000507 }
508}
Caroline Tice98f930f2010-09-20 05:20:02 +0000509
510bool
511SBTarget::GetDescription (SBStream &description)
512{
513 if (m_opaque_sp)
Caroline Ticee7a566e2010-09-20 16:21:41 +0000514 {
Caroline Ticee49ec182010-09-22 23:01:29 +0000515 description.ref();
Caroline Tice98f930f2010-09-20 05:20:02 +0000516 m_opaque_sp->Dump (description.get());
Caroline Ticee7a566e2010-09-20 16:21:41 +0000517 }
Caroline Tice98f930f2010-09-20 05:20:02 +0000518 else
519 description.Printf ("No value");
520
521 return true;
522}