LLDB  mainline
ItaniumABILanguageRuntime.cpp
Go to the documentation of this file.
1 //===-- ItaniumABILanguageRuntime.cpp --------------------------------------*-
2 //C++ -*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
11 
13 #include "lldb/Core/Mangled.h"
14 #include "lldb/Core/Module.h"
16 #include "lldb/Core/ValueObject.h"
25 #include "lldb/Symbol/Symbol.h"
26 #include "lldb/Symbol/SymbolFile.h"
27 #include "lldb/Symbol/TypeList.h"
28 #include "lldb/Target/Process.h"
31 #include "lldb/Target/StopInfo.h"
32 #include "lldb/Target/Target.h"
33 #include "lldb/Target/Thread.h"
35 #include "lldb/Utility/Log.h"
36 #include "lldb/Utility/Scalar.h"
37 #include "lldb/Utility/Status.h"
38 
39 #include <vector>
40 
41 using namespace lldb;
42 using namespace lldb_private;
43 
44 static const char *vtable_demangled_prefix = "vtable for ";
45 
46 bool ItaniumABILanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
47  const bool check_cxx = true;
48  const bool check_objc = false;
49  return in_value.GetCompilerType().IsPossibleDynamicType(NULL, check_cxx,
50  check_objc);
51 }
52 
53 TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
54  ValueObject &in_value, lldb::addr_t original_ptr,
55  lldb::addr_t vtable_load_addr) {
56  if (m_process && vtable_load_addr != LLDB_INVALID_ADDRESS) {
57  // Find the symbol that contains the "vtable_load_addr" address
58  Address vtable_addr;
59  Target &target = m_process->GetTarget();
60  if (!target.GetSectionLoadList().IsEmpty()) {
61  if (target.GetSectionLoadList().ResolveLoadAddress(vtable_load_addr,
62  vtable_addr)) {
63  // See if we have cached info for this type already
64  TypeAndOrName type_info = GetDynamicTypeInfo(vtable_addr);
65  if (type_info)
66  return type_info;
67 
68  SymbolContext sc;
70  vtable_addr, eSymbolContextSymbol, sc);
71  Symbol *symbol = sc.symbol;
72  if (symbol != NULL) {
73  const char *name =
74  symbol->GetMangled()
75  .GetDemangledName(lldb::eLanguageTypeC_plus_plus)
76  .AsCString();
77  if (name && strstr(name, vtable_demangled_prefix) == name) {
78  Log *log(
80  if (log)
81  log->Printf("0x%16.16" PRIx64
82  ": static-type = '%s' has vtable symbol '%s'\n",
83  original_ptr, in_value.GetTypeName().GetCString(),
84  name);
85  // We are a C++ class, that's good. Get the class name and look it
86  // up:
87  const char *class_name = name + strlen(vtable_demangled_prefix);
88  // We know the class name is absolute, so tell FindTypes that by
89  // prefixing it with the root namespace:
90  std::string lookup_name("::");
91  lookup_name.append(class_name);
92 
93  type_info.SetName(class_name);
94  const bool exact_match = true;
95  TypeList class_types;
96 
97  uint32_t num_matches = 0;
98  // First look in the module that the vtable symbol came from and
99  // look for a single exact match.
100  llvm::DenseSet<SymbolFile *> searched_symbol_files;
101  if (sc.module_sp) {
102  num_matches = sc.module_sp->FindTypes(
103  ConstString(lookup_name), exact_match, 1,
104  searched_symbol_files, class_types);
105  }
106 
107  // If we didn't find a symbol, then move on to the entire module
108  // list in the target and get as many unique matches as possible
109  if (num_matches == 0) {
110  num_matches = target.GetImages().FindTypes(
111  nullptr, ConstString(lookup_name), exact_match, UINT32_MAX,
112  searched_symbol_files, class_types);
113  }
114 
115  lldb::TypeSP type_sp;
116  if (num_matches == 0) {
117  if (log)
118  log->Printf("0x%16.16" PRIx64 ": is not dynamic\n",
119  original_ptr);
120  return TypeAndOrName();
121  }
122  if (num_matches == 1) {
123  type_sp = class_types.GetTypeAtIndex(0);
124  if (type_sp) {
125  if (ClangASTContext::IsCXXClassType(
126  type_sp->GetForwardCompilerType())) {
127  if (log)
128  log->Printf(
129  "0x%16.16" PRIx64
130  ": static-type = '%s' has dynamic type: uid={0x%" PRIx64
131  "}, type-name='%s'\n",
132  original_ptr, in_value.GetTypeName().AsCString(),
133  type_sp->GetID(), type_sp->GetName().GetCString());
134  type_info.SetTypeSP(type_sp);
135  }
136  }
137  } else if (num_matches > 1) {
138  size_t i;
139  if (log) {
140  for (i = 0; i < num_matches; i++) {
141  type_sp = class_types.GetTypeAtIndex(i);
142  if (type_sp) {
143  if (log)
144  log->Printf(
145  "0x%16.16" PRIx64
146  ": static-type = '%s' has multiple matching dynamic "
147  "types: uid={0x%" PRIx64 "}, type-name='%s'\n",
148  original_ptr, in_value.GetTypeName().AsCString(),
149  type_sp->GetID(), type_sp->GetName().GetCString());
150  }
151  }
152  }
153 
154  for (i = 0; i < num_matches; i++) {
155  type_sp = class_types.GetTypeAtIndex(i);
156  if (type_sp) {
157  if (ClangASTContext::IsCXXClassType(
158  type_sp->GetForwardCompilerType())) {
159  if (log)
160  log->Printf(
161  "0x%16.16" PRIx64 ": static-type = '%s' has multiple "
162  "matching dynamic types, picking "
163  "this one: uid={0x%" PRIx64
164  "}, type-name='%s'\n",
165  original_ptr, in_value.GetTypeName().AsCString(),
166  type_sp->GetID(), type_sp->GetName().GetCString());
167  type_info.SetTypeSP(type_sp);
168  }
169  }
170  }
171 
172  if (log && i == num_matches) {
173  log->Printf(
174  "0x%16.16" PRIx64
175  ": static-type = '%s' has multiple matching dynamic "
176  "types, didn't find a C++ match\n",
177  original_ptr, in_value.GetTypeName().AsCString());
178  }
179  }
180  if (type_info)
181  SetDynamicTypeInfo(vtable_addr, type_info);
182  return type_info;
183  }
184  }
185  }
186  }
187  }
188  return TypeAndOrName();
189 }
190 
191 bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
192  ValueObject &in_value, lldb::DynamicValueType use_dynamic,
193  TypeAndOrName &class_type_or_name, Address &dynamic_address,
194  Value::ValueType &value_type) {
195  // For Itanium, if the type has a vtable pointer in the object, it will be at
196  // offset 0 in the object. That will point to the "address point" within the
197  // vtable (not the beginning of the vtable.) We can then look up the symbol
198  // containing this "address point" and that symbol's name demangled will
199  // contain the full class name. The second pointer above the "address point"
200  // is the "offset_to_top". We'll use that to get the start of the value
201  // object which holds the dynamic type.
202  //
203 
204  class_type_or_name.Clear();
205  value_type = Value::ValueType::eValueTypeScalar;
206 
207  // Only a pointer or reference type can have a different dynamic and static
208  // type:
209  if (!CouldHaveDynamicValue(in_value))
210  return false;
211 
212  // First job, pull out the address at 0 offset from the object.
213  AddressType address_type;
214  lldb::addr_t original_ptr = in_value.GetPointerValue(&address_type);
215  if (original_ptr == LLDB_INVALID_ADDRESS)
216  return false;
217 
218  ExecutionContext exe_ctx(in_value.GetExecutionContextRef());
219 
220  Process *process = exe_ctx.GetProcessPtr();
221 
222  if (process == nullptr)
223  return false;
224 
225  Status error;
226  const lldb::addr_t vtable_address_point =
227  process->ReadPointerFromMemory(original_ptr, error);
228 
229  if (!error.Success() || vtable_address_point == LLDB_INVALID_ADDRESS)
230  return false;
231 
232  class_type_or_name = GetTypeInfoFromVTableAddress(in_value, original_ptr,
233  vtable_address_point);
234 
235  if (!class_type_or_name)
236  return false;
237 
238  CompilerType type = class_type_or_name.GetCompilerType();
239  // There can only be one type with a given name, so we've just found
240  // duplicate definitions, and this one will do as well as any other. We
241  // don't consider something to have a dynamic type if it is the same as
242  // the static type. So compare against the value we were handed.
243  if (!type)
244  return true;
245 
246  if (ClangASTContext::AreTypesSame(in_value.GetCompilerType(), type)) {
247  // The dynamic type we found was the same type, so we don't have a
248  // dynamic type here...
249  return false;
250  }
251 
252  // The offset_to_top is two pointers above the vtable pointer.
253  const uint32_t addr_byte_size = process->GetAddressByteSize();
254  const lldb::addr_t offset_to_top_location =
255  vtable_address_point - 2 * addr_byte_size;
256  // Watch for underflow, offset_to_top_location should be less than
257  // vtable_address_point
258  if (offset_to_top_location >= vtable_address_point)
259  return false;
260  const int64_t offset_to_top = process->ReadSignedIntegerFromMemory(
261  offset_to_top_location, addr_byte_size, INT64_MIN, error);
262 
263  if (offset_to_top == INT64_MIN)
264  return false;
265  // So the dynamic type is a value that starts at offset_to_top above
266  // the original address.
267  lldb::addr_t dynamic_addr = original_ptr + offset_to_top;
268  if (!process->GetTarget().GetSectionLoadList().ResolveLoadAddress(
269  dynamic_addr, dynamic_address)) {
270  dynamic_address.SetRawAddress(dynamic_addr);
271  }
272  return true;
273 }
274 
275 TypeAndOrName ItaniumABILanguageRuntime::FixUpDynamicType(
276  const TypeAndOrName &type_and_or_name, ValueObject &static_value) {
277  CompilerType static_type(static_value.GetCompilerType());
278  Flags static_type_flags(static_type.GetTypeInfo());
279 
280  TypeAndOrName ret(type_and_or_name);
281  if (type_and_or_name.HasType()) {
282  // The type will always be the type of the dynamic object. If our parent's
283  // type was a pointer, then our type should be a pointer to the type of the
284  // dynamic object. If a reference, then the original type should be
285  // okay...
286  CompilerType orig_type = type_and_or_name.GetCompilerType();
287  CompilerType corrected_type = orig_type;
288  if (static_type_flags.AllSet(eTypeIsPointer))
289  corrected_type = orig_type.GetPointerType();
290  else if (static_type_flags.AllSet(eTypeIsReference))
291  corrected_type = orig_type.GetLValueReferenceType();
292  ret.SetCompilerType(corrected_type);
293  } else {
294  // If we are here we need to adjust our dynamic type name to include the
295  // correct & or * symbol
296  std::string corrected_name(type_and_or_name.GetName().GetCString());
297  if (static_type_flags.AllSet(eTypeIsPointer))
298  corrected_name.append(" *");
299  else if (static_type_flags.AllSet(eTypeIsReference))
300  corrected_name.append(" &");
301  // the parent type should be a correctly pointer'ed or referenc'ed type
302  ret.SetCompilerType(static_type);
303  ret.SetName(corrected_name.c_str());
304  }
305  return ret;
306 }
307 
308 bool ItaniumABILanguageRuntime::IsVTableName(const char *name) {
309  if (name == NULL)
310  return false;
311 
312  // Can we maybe ask Clang about this?
313  return strstr(name, "_vptr$") == name;
314 }
315 
316 // Static Functions
318 ItaniumABILanguageRuntime::CreateInstance(Process *process,
319  lldb::LanguageType language) {
320  // FIXME: We have to check the process and make sure we actually know that
321  // this process supports
322  // the Itanium ABI.
323  if (language == eLanguageTypeC_plus_plus ||
324  language == eLanguageTypeC_plus_plus_03 ||
325  language == eLanguageTypeC_plus_plus_11 ||
326  language == eLanguageTypeC_plus_plus_14)
327  return new ItaniumABILanguageRuntime(process);
328  else
329  return NULL;
330 }
331 
333 public:
335  : CommandObjectParsed(interpreter, "demangle",
336  "Demangle a C++ mangled name.",
337  "language cplusplus demangle") {
339  CommandArgumentData index_arg;
340 
341  // Define the first (and only) variant of this arg.
342  index_arg.arg_type = eArgTypeSymbol;
343  index_arg.arg_repetition = eArgRepeatPlus;
344 
345  // There is only one variant this argument could be; put it into the
346  // argument entry.
347  arg.push_back(index_arg);
348 
349  // Push the data for the first argument into the m_arguments vector.
350  m_arguments.push_back(arg);
351  }
352 
353  ~CommandObjectMultiwordItaniumABI_Demangle() override = default;
354 
355 protected:
356  bool DoExecute(Args &command, CommandReturnObject &result) override {
357  bool demangled_any = false;
358  bool error_any = false;
359  for (auto &entry : command.entries()) {
360  if (entry.ref.empty())
361  continue;
362 
363  // the actual Mangled class should be strict about this, but on the
364  // command line if you're copying mangled names out of 'nm' on Darwin,
365  // they will come out with an extra underscore - be willing to strip this
366  // on behalf of the user. This is the moral equivalent of the -_/-n
367  // options to c++filt
368  auto name = entry.ref;
369  if (name.startswith("__Z"))
370  name = name.drop_front();
371 
372  Mangled mangled(name, true);
373  if (mangled.GuessLanguage() == lldb::eLanguageTypeC_plus_plus) {
374  ConstString demangled(
375  mangled.GetDisplayDemangledName(lldb::eLanguageTypeC_plus_plus));
376  demangled_any = true;
377  result.AppendMessageWithFormat("%s ---> %s\n", entry.ref.str().c_str(),
378  demangled.GetCString());
379  } else {
380  error_any = true;
381  result.AppendErrorWithFormat("%s is not a valid C++ mangled name\n",
382  entry.ref.str().c_str());
383  }
384  }
385 
386  result.SetStatus(
387  error_any ? lldb::eReturnStatusFailed
388  : (demangled_any ? lldb::eReturnStatusSuccessFinishResult
390  return result.Succeeded();
391  }
392 };
393 
395 public:
398  interpreter, "cplusplus",
399  "Commands for operating on the C++ language runtime.",
400  "cplusplus <subcommand> [<subcommand-options>]") {
401  LoadSubCommand(
402  "demangle",
403  CommandObjectSP(
405  }
406 
407  ~CommandObjectMultiwordItaniumABI() override = default;
408 };
409 
410 void ItaniumABILanguageRuntime::Initialize() {
411  PluginManager::RegisterPlugin(
412  GetPluginNameStatic(), "Itanium ABI for the C++ language", CreateInstance,
413  [](CommandInterpreter &interpreter) -> lldb::CommandObjectSP {
414  return CommandObjectSP(
415  new CommandObjectMultiwordItaniumABI(interpreter));
416  });
417 }
418 
419 void ItaniumABILanguageRuntime::Terminate() {
420  PluginManager::UnregisterPlugin(CreateInstance);
421 }
422 
423 lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginNameStatic() {
424  static ConstString g_name("itanium");
425  return g_name;
426 }
427 
428 // PluginInterface protocol
429 lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginName() {
430  return GetPluginNameStatic();
431 }
432 
433 uint32_t ItaniumABILanguageRuntime::GetPluginVersion() { return 1; }
434 
435 BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
436  Breakpoint *bkpt, bool catch_bp, bool throw_bp) {
437  return CreateExceptionResolver(bkpt, catch_bp, throw_bp, false);
438 }
439 
440 BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
441  Breakpoint *bkpt, bool catch_bp, bool throw_bp, bool for_expressions) {
442  // One complication here is that most users DON'T want to stop at
443  // __cxa_allocate_expression, but until we can do anything better with
444  // predicting unwinding the expression parser does. So we have two forms of
445  // the exception breakpoints, one for expressions that leaves out
446  // __cxa_allocate_exception, and one that includes it. The
447  // SetExceptionBreakpoints does the latter, the CreateExceptionBreakpoint in
448  // the runtime the former.
449  static const char *g_catch_name = "__cxa_begin_catch";
450  static const char *g_throw_name1 = "__cxa_throw";
451  static const char *g_throw_name2 = "__cxa_rethrow";
452  static const char *g_exception_throw_name = "__cxa_allocate_exception";
453  std::vector<const char *> exception_names;
454  exception_names.reserve(4);
455  if (catch_bp)
456  exception_names.push_back(g_catch_name);
457 
458  if (throw_bp) {
459  exception_names.push_back(g_throw_name1);
460  exception_names.push_back(g_throw_name2);
461  }
462 
463  if (for_expressions)
464  exception_names.push_back(g_exception_throw_name);
465 
466  BreakpointResolverSP resolver_sp(new BreakpointResolverName(
467  bkpt, exception_names.data(), exception_names.size(),
468  eFunctionNameTypeBase, eLanguageTypeUnknown, 0, eLazyBoolNo));
469 
470  return resolver_sp;
471 }
472 
473 lldb::SearchFilterSP ItaniumABILanguageRuntime::CreateExceptionSearchFilter() {
474  Target &target = m_process->GetTarget();
475 
476  if (target.GetArchitecture().GetTriple().getVendor() == llvm::Triple::Apple) {
477  // Limit the number of modules that are searched for these breakpoints for
478  // Apple binaries.
479  FileSpecList filter_modules;
480  filter_modules.Append(FileSpec("libc++abi.dylib"));
481  filter_modules.Append(FileSpec("libSystem.B.dylib"));
482  return target.GetSearchFilterForModuleList(&filter_modules);
483  } else {
484  return LanguageRuntime::CreateExceptionSearchFilter();
485  }
486 }
487 
488 lldb::BreakpointSP ItaniumABILanguageRuntime::CreateExceptionBreakpoint(
489  bool catch_bp, bool throw_bp, bool for_expressions, bool is_internal) {
490  Target &target = m_process->GetTarget();
491  FileSpecList filter_modules;
492  BreakpointResolverSP exception_resolver_sp =
493  CreateExceptionResolver(NULL, catch_bp, throw_bp, for_expressions);
494  SearchFilterSP filter_sp(CreateExceptionSearchFilter());
495  const bool hardware = false;
496  const bool resolve_indirect_functions = false;
497  return target.CreateBreakpoint(filter_sp, exception_resolver_sp, is_internal,
498  hardware, resolve_indirect_functions);
499 }
500 
501 void ItaniumABILanguageRuntime::SetExceptionBreakpoints() {
502  if (!m_process)
503  return;
504 
505  const bool catch_bp = false;
506  const bool throw_bp = true;
507  const bool is_internal = true;
508  const bool for_expressions = true;
509 
510  // For the exception breakpoints set by the Expression parser, we'll be a
511  // little more aggressive and stop at exception allocation as well.
512 
513  if (m_cxx_exception_bp_sp) {
514  m_cxx_exception_bp_sp->SetEnabled(true);
515  } else {
516  m_cxx_exception_bp_sp = CreateExceptionBreakpoint(
517  catch_bp, throw_bp, for_expressions, is_internal);
518  if (m_cxx_exception_bp_sp)
519  m_cxx_exception_bp_sp->SetBreakpointKind("c++ exception");
520  }
521 }
522 
523 void ItaniumABILanguageRuntime::ClearExceptionBreakpoints() {
524  if (!m_process)
525  return;
526 
527  if (m_cxx_exception_bp_sp) {
528  m_cxx_exception_bp_sp->SetEnabled(false);
529  }
530 }
531 
532 bool ItaniumABILanguageRuntime::ExceptionBreakpointsAreSet() {
533  return m_cxx_exception_bp_sp && m_cxx_exception_bp_sp->IsEnabled();
534 }
535 
536 bool ItaniumABILanguageRuntime::ExceptionBreakpointsExplainStop(
537  lldb::StopInfoSP stop_reason) {
538  if (!m_process)
539  return false;
540 
541  if (!stop_reason || stop_reason->GetStopReason() != eStopReasonBreakpoint)
542  return false;
543 
544  uint64_t break_site_id = stop_reason->GetValue();
545  return m_process->GetBreakpointSiteList().BreakpointSiteContainsBreakpoint(
546  break_site_id, m_cxx_exception_bp_sp->GetID());
547 }
548 
549 ValueObjectSP ItaniumABILanguageRuntime::GetExceptionObjectForThread(
550  ThreadSP thread_sp) {
551  if (!thread_sp->SafeToCallFunctions())
552  return {};
553 
554  ClangASTContext *clang_ast_context =
555  m_process->GetTarget().GetScratchClangASTContext();
556  CompilerType voidstar =
557  clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
558 
559  DiagnosticManager diagnostics;
560  ExecutionContext exe_ctx;
562 
563  options.SetUnwindOnError(true);
564  options.SetIgnoreBreakpoints(true);
565  options.SetStopOthers(true);
566  options.SetTimeout(m_process->GetUtilityExpressionTimeout());
567  options.SetTryAllThreads(false);
568  thread_sp->CalculateExecutionContext(exe_ctx);
569 
570  const ModuleList &modules = m_process->GetTarget().GetImages();
571  SymbolContextList contexts;
572  SymbolContext context;
573 
575  ConstString("__cxa_current_exception_type"), eSymbolTypeCode, contexts);
576  contexts.GetContextAtIndex(0, context);
577  Address addr = context.symbol->GetAddress();
578 
579  Status error;
580  FunctionCaller *function_caller =
581  m_process->GetTarget().GetFunctionCallerForLanguage(
582  eLanguageTypeC, voidstar, addr, ValueList(), "caller", error);
583 
584  ExpressionResults func_call_ret;
585  Value results;
586  func_call_ret = function_caller->ExecuteFunction(exe_ctx, nullptr, options,
587  diagnostics, results);
588  if (func_call_ret != eExpressionCompleted || !error.Success()) {
589  return ValueObjectSP();
590  }
591 
592  size_t ptr_size = m_process->GetAddressByteSize();
593  addr_t result_ptr = results.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
594  addr_t exception_addr =
595  m_process->ReadPointerFromMemory(result_ptr - ptr_size, error);
596 
597  lldb_private::formatters::InferiorSizedWord exception_isw(exception_addr,
598  *m_process);
599  ValueObjectSP exception = ValueObject::CreateValueObjectFromData(
600  "exception", exception_isw.GetAsData(m_process->GetByteOrder()), exe_ctx,
601  voidstar);
602  exception = exception->GetDynamicValue(eDynamicDontRunTarget);
603 
604  return exception;
605 }
606 
607 TypeAndOrName ItaniumABILanguageRuntime::GetDynamicTypeInfo(
608  const lldb_private::Address &vtable_addr) {
609  std::lock_guard<std::mutex> locker(m_dynamic_type_map_mutex);
610  DynamicTypeCache::const_iterator pos = m_dynamic_type_map.find(vtable_addr);
611  if (pos == m_dynamic_type_map.end())
612  return TypeAndOrName();
613  else
614  return pos->second;
615 }
616 
617 void ItaniumABILanguageRuntime::SetDynamicTypeInfo(
618  const lldb_private::Address &vtable_addr, const TypeAndOrName &type_info) {
619  std::lock_guard<std::mutex> locker(m_dynamic_type_map_mutex);
620  m_dynamic_type_map[vtable_addr] = type_info;
621 }
lldb::ExpressionResults ExecuteFunction(ExecutionContext &exe_ctx, lldb::addr_t *args_addr_ptr, const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager, Value &results)
Run the function this FunctionCaller was created with.
void SetIgnoreBreakpoints(bool ignore=false)
Definition: Target.h:289
std::vector< CommandArgumentData > CommandArgumentEntry
A command line argument class.
Definition: Args.h:32
#define LIBLLDB_LOG_OBJECT
Definition: Logging.h:25
CompilerType GetCompilerType()
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
Definition: TypeList.cpp:66
Defines a list of symbol context objects.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
const ArchSpec & GetArchitecture() const
Definition: Target.h:941
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:224
Sometimes you can find the name of the type corresponding to an object, but we don&#39;t have debug infor...
Definition: Type.h:396
CompilerType GetCompilerType() const
Definition: Type.h:410
llvm::ArrayRef< ArgEntry > entries() const
Definition: Args.h:123
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
virtual ConstString GetTypeName()
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition: Breakpoint.h:78
void SetUnwindOnError(bool unwind=false)
Definition: Target.h:285
A file utility class.
Definition: FileSpec.h:55
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void SetName(ConstString type_name)
Definition: Type.cpp:726
bool DoExecute(Args &command, CommandReturnObject &result) override
Address GetAddress() const
Definition: Symbol.h:72
lldb::addr_t GetPointerValue(AddressType *address_type=nullptr)
Symbol * symbol
The Symbol for a given query.
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:431
CommandObjectMultiwordItaniumABI(CommandInterpreter &interpreter)
#define UINT32_MAX
Definition: lldb-defines.h:31
#define LLDB_INVALID_ADDRESS
Invalid value definitions.
Definition: lldb-defines.h:85
void SetTimeout(const Timeout< std::micro > &timeout)
Definition: Target.h:306
LanguageType
Programming language type.
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:57
A collection class for Module objects.
Definition: ModuleList.h:91
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1012
void SetCompilerType(TypeSystem *type_system, lldb::opaque_compiler_type_t type)
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
size_t FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list, bool append=false) const
Definition: ModuleList.cpp:457
Encapsulates a function that can be called.
unsigned long long ULongLong(unsigned long long fail_value=0) const
Definition: Scalar.cpp:1566
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
A plug-in interface definition class for debugging a process.
Definition: Process.h:353
const ExecutionContextRef & GetExecutionContextRef() const
Definition: ValueObject.h:353
bool Success() const
Test for success condition.
Definition: Status.cpp:287
void SetRawAddress(lldb::addr_t addr)
Definition: Address.h:425
A section + offset based address class.
Definition: Address.h:80
CompilerType GetPointerType() const
CompilerType GetLValueReferenceType() const
void SetTypeSP(lldb::TypeSP type_sp)
Definition: Type.cpp:734
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address
Definition: ModuleList.cpp:662
static const char * vtable_demangled_prefix
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
DataExtractor GetAsData(lldb::ByteOrder byte_order=lldb::eByteOrderInvalid) const
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition: Target.h:899
void SetStopOthers(bool stop_others=true)
Definition: Target.h:322
A class to manage flags.
Definition: Flags.h:22
uint64_t addr_t
Definition: lldb-types.h:83
A uniqued constant string class.
Definition: ConstString.h:38
Unknown or invalid language value.
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:247
CommandObjectMultiwordItaniumABI_Demangle(CommandInterpreter &interpreter)
Non-standardized C, such as K&R.
lldb::ModuleSP module_sp
The Module for a given query.
Definition: SBAddress.h:15
void SetTryAllThreads(bool try_others=true)
Definition: Target.h:318
ConstString GetName() const
Definition: Type.cpp:718
"lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on a given function name...
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition: Target.cpp:515
const Scalar & GetScalar() const
Definition: Value.h:178
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
bool HasType() const
Definition: Type.h:426
void Printf(const char *format,...) __attribute__((format(printf
Definition: Log.cpp:113
size_t FindTypes(Module *search_first, ConstString name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet< SymbolFile *> &searched_symbol_files, TypeList &types) const
Find types by name.
Definition: ModuleList.cpp:536
CompilerType GetBasicType(lldb::BasicType type)
void SetStatus(lldb::ReturnStatus status)
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
Definition: Target.cpp:325
An error handling class.
Definition: Status.h:44
Mangled & GetMangled()
Definition: Symbol.h:120