LLDB mainline
CPPLanguageRuntime.cpp
Go to the documentation of this file.
1//===-- CPPLanguageRuntime.cpp---------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include <cstring>
10#include <iostream>
11
12#include <memory>
13
14#include "CPPLanguageRuntime.h"
17
18#include "llvm/ADT/StringRef.h"
19
20#include "lldb/Symbol/Block.h"
23
27#include "lldb/Target/ABI.h"
35#include "lldb/Utility/Timer.h"
36
37using namespace lldb;
38using namespace lldb_private;
39
41
43// Artificial coroutine-related variables emitted by clang.
44static ConstString g_promise = ConstString("__promise");
45static ConstString g_coro_frame = ConstString("__coro_frame");
46
47char CPPLanguageRuntime::ID = 0;
48
49/// A frame recognizer that is installed to hide libc++ implementation
50/// details from the backtrace.
52 std::array<RegularExpression, 2> m_hidden_regex;
54
56 bool ShouldHide() override { return true; }
57 };
58
59public:
62 // internal implementation details in the `std::` namespace
63 // std::__1::__function::__alloc_func<void (*)(), std::__1::allocator<void (*)()>, void ()>::operator()[abi:ne200000]
64 // std::__1::__function::__func<void (*)(), std::__1::allocator<void (*)()>, void ()>::operator()
65 // std::__1::__function::__value_func<void ()>::operator()[abi:ne200000]() const
66 // std::__2::__function::__policy_invoker<void (int, int)>::__call_impl[abi:ne200000]<std::__2::__function::__default_alloc_func<int (*)(int, int), int (int, int)>>
67 // std::__1::__invoke[abi:ne200000]<void (*&)()>
68 // std::__1::__invoke_void_return_wrapper<void, true>::__call[abi:ne200000]<void (*&)()>
69 RegularExpression{R"(^std::__[^:]*::__)"},
70 // internal implementation details in the `std::ranges` namespace
71 // std::__1::ranges::__sort::__sort_fn_impl[abi:ne200000]<std::__1::__wrap_iter<int*>, std::__1::__wrap_iter<int*>, bool (*)(int, int), std::__1::identity>
72 RegularExpression{R"(^std::__[^:]*::ranges::__)"},
73 },
75
76 std::string GetName() override { return "libc++ frame recognizer"; }
77
80 if (!frame_sp)
81 return {};
82 const auto &sc = frame_sp->GetSymbolContext(lldb::eSymbolContextFunction);
83 if (!sc.function)
84 return {};
85
86 // Check if we have a regex match
88 if (!r.Execute(sc.function->GetNameNoArguments()))
89 continue;
90
91 // Only hide this frame if the immediate caller is also within libc++.
92 lldb::ThreadSP thread_sp = frame_sp->GetThread();
93 if (!thread_sp)
94 return {};
95 lldb::StackFrameSP parent_frame_sp =
96 thread_sp->GetStackFrameAtIndex(frame_sp->GetFrameIndex() + 1);
97 if (!parent_frame_sp)
98 return {};
99 const auto &parent_sc =
100 parent_frame_sp->GetSymbolContext(lldb::eSymbolContextFunction);
101 if (!parent_sc.function)
102 return {};
103 if (parent_sc.function->GetNameNoArguments().GetStringRef().starts_with(
104 "std::"))
105 return m_hidden_frame;
106 }
107
108 return {};
109 }
110};
111
113 : LanguageRuntime(process), m_itanium_runtime(process) {
114 if (process) {
117 std::make_shared<RegularExpression>("^std::__[^:]*::"),
118 /*mangling_preference=*/Mangled::ePreferDemangledWithoutArguments,
119 /*first_instruction_only=*/false);
120
122 }
123}
124
126 return name == g_this || name == g_promise || name == g_coro_frame;
127}
128
130 ValueObject &object) {
131 // C++ has no generic way to do this.
132 return llvm::createStringError("C++ does not support object descriptions");
133}
134
135llvm::Error
137 ExecutionContextScope *exe_scope) {
138 // C++ has no generic way to do this.
139 return llvm::createStringError("C++ does not support object descriptions");
140}
141
142bool contains_lambda_identifier(llvm::StringRef &str_ref) {
143 return str_ref.contains("$_") || str_ref.contains("'lambda'");
144}
145
147line_entry_helper(Target &target, const SymbolContext &sc, Symbol *symbol,
148 llvm::StringRef first_template_param_sref, bool has_invoke) {
149
151
152 Address address = sc.GetFunctionOrSymbolAddress();
153
154 Address addr;
155 if (target.ResolveLoadAddress(address.GetCallableLoadAddress(&target),
156 addr)) {
157 LineEntry line_entry;
158 addr.CalculateSymbolContextLineEntry(line_entry);
159
160 if (contains_lambda_identifier(first_template_param_sref) || has_invoke) {
161 // Case 1 and 2
162 optional_info.callable_case = lldb_private::CPPLanguageRuntime::
163 LibCppStdFunctionCallableCase::Lambda;
164 } else {
165 // Case 3
166 optional_info.callable_case = lldb_private::CPPLanguageRuntime::
167 LibCppStdFunctionCallableCase::CallableObject;
168 }
169
170 optional_info.callable_symbol = *symbol;
171 optional_info.callable_line_entry = line_entry;
172 optional_info.callable_address = addr;
173 }
174
175 return optional_info;
176}
177
180 lldb::ValueObjectSP &valobj_sp) {
182
183 LibCppStdFunctionCallableInfo optional_info;
184
185 if (!valobj_sp)
186 return optional_info;
187
188 // Member __f_ has type __base*, the contents of which will hold:
189 // 1) a vtable entry which may hold type information needed to discover the
190 // lambda being called
191 // 2) possibly hold a pointer to the callable object
192 // e.g.
193 //
194 // (lldb) frame var -R f_display
195 // (std::__1::function<void (int)>) f_display = {
196 // __buf_ = {
197 // …
198 // }
199 // __f_ = 0x00007ffeefbffa00
200 // }
201 // (lldb) memory read -fA 0x00007ffeefbffa00
202 // 0x7ffeefbffa00: ... `vtable for std::__1::__function::__func<void (*) ...
203 // 0x7ffeefbffa08: ... `print_num(int) at std_function_cppreference_exam ...
204 //
205 // We will be handling five cases below, std::function is wrapping:
206 //
207 // 1) a lambda we know at compile time. We will obtain the name of the lambda
208 // from the first template pameter from __func's vtable. We will look up
209 // the lambda's operator()() and obtain the line table entry.
210 // 2) a lambda we know at runtime. A pointer to the lambdas __invoke method
211 // will be stored after the vtable. We will obtain the lambdas name from
212 // this entry and lookup operator()() and obtain the line table entry.
213 // 3) a callable object via operator()(). We will obtain the name of the
214 // object from the first template parameter from __func's vtable. We will
215 // look up the objects operator()() and obtain the line table entry.
216 // 4) a member function. A pointer to the function will stored after the
217 // we will obtain the name from this pointer.
218 // 5) a free function. A pointer to the function will stored after the vtable
219 // we will obtain the name from this pointer.
220 ValueObjectSP member_f_(valobj_sp->GetChildMemberWithName("__f_"));
221
222 if (member_f_) {
223 ValueObjectSP sub_member_f_(member_f_->GetChildMemberWithName("__f_"));
224
225 if (sub_member_f_)
226 member_f_ = sub_member_f_;
227 }
228
229 if (!member_f_)
230 return optional_info;
231
232 lldb::addr_t member_f_pointer_value = member_f_->GetValueAsUnsigned(0);
233
234 optional_info.member_f_pointer_value = member_f_pointer_value;
235
236 if (!member_f_pointer_value)
237 return optional_info;
238
239 ExecutionContext exe_ctx(valobj_sp->GetExecutionContextRef());
240 Process *process = exe_ctx.GetProcessPtr();
241
242 if (process == nullptr)
243 return optional_info;
244
245 uint32_t address_size = process->GetAddressByteSize();
246 Status status;
247
248 // First item pointed to by __f_ should be the pointer to the vtable for
249 // a __base object.
250 lldb::addr_t vtable_address =
251 process->ReadPointerFromMemory(member_f_pointer_value, status);
252
253 if (status.Fail())
254 return optional_info;
255
256 lldb::addr_t vtable_address_first_entry =
257 process->ReadPointerFromMemory(vtable_address + address_size, status);
258
259 if (status.Fail())
260 return optional_info;
261
262 lldb::addr_t address_after_vtable = member_f_pointer_value + address_size;
263 // As commented above we may not have a function pointer but if we do we will
264 // need it.
265 lldb::addr_t possible_function_address =
266 process->ReadPointerFromMemory(address_after_vtable, status);
267
268 if (status.Fail())
269 return optional_info;
270
271 Target &target = process->GetTarget();
272
273 if (!target.HasLoadedSections())
274 return optional_info;
275
276 Address vtable_first_entry_resolved;
277
278 if (!target.ResolveLoadAddress(vtable_address_first_entry,
279 vtable_first_entry_resolved))
280 return optional_info;
281
282 Address vtable_addr_resolved;
283 SymbolContext sc;
284 Symbol *symbol = nullptr;
285
286 if (!target.ResolveLoadAddress(vtable_address, vtable_addr_resolved))
287 return optional_info;
288
290 vtable_addr_resolved, eSymbolContextEverything, sc);
291 symbol = sc.symbol;
292
293 if (symbol == nullptr)
294 return optional_info;
295
296 llvm::StringRef vtable_name(symbol->GetName().GetStringRef());
297 bool found_expected_start_string =
298 vtable_name.starts_with("vtable for std::__1::__function::__func<");
299
300 if (!found_expected_start_string)
301 return optional_info;
302
303 // Given case 1 or 3 we have a vtable name, we are want to extract the first
304 // template parameter
305 //
306 // ... __func<main::$_0, std::__1::allocator<main::$_0> ...
307 // ^^^^^^^^^
308 //
309 // We could see names such as:
310 // main::$_0
311 // Bar::add_num2(int)::'lambda'(int)
312 // Bar
313 //
314 // We do this by find the first < and , and extracting in between.
315 //
316 // This covers the case of the lambda known at compile time.
317 size_t first_open_angle_bracket = vtable_name.find('<') + 1;
318 size_t first_comma = vtable_name.find(',');
319
320 llvm::StringRef first_template_parameter =
321 vtable_name.slice(first_open_angle_bracket, first_comma);
322
323 Address function_address_resolved;
324
325 // Setup for cases 2, 4 and 5 we have a pointer to a function after the
326 // vtable. We will use a process of elimination to drop through each case
327 // and obtain the data we need.
328 if (target.ResolveLoadAddress(possible_function_address,
329 function_address_resolved)) {
331 function_address_resolved, eSymbolContextEverything, sc);
332 symbol = sc.symbol;
333 }
334
335 // These conditions are used several times to simplify statements later on.
336 bool has_invoke =
337 (symbol ? symbol->GetName().GetStringRef().contains("__invoke") : false);
338 auto calculate_symbol_context_helper = [](auto &t,
339 SymbolContextList &sc_list) {
340 SymbolContext sc;
341 t->CalculateSymbolContext(&sc);
342 sc_list.Append(sc);
343 };
344
345 // Case 2
346 if (has_invoke) {
348 calculate_symbol_context_helper(symbol, scl);
349
350 return line_entry_helper(target, scl[0], symbol, first_template_parameter,
351 has_invoke);
352 }
353
354 // Case 4 or 5
355 if (symbol && !symbol->GetName().GetStringRef().starts_with("vtable for") &&
356 !contains_lambda_identifier(first_template_parameter) && !has_invoke) {
357 optional_info.callable_case =
359 optional_info.callable_address = function_address_resolved;
360 optional_info.callable_symbol = *symbol;
361
362 return optional_info;
363 }
364
365 std::string func_to_match = first_template_parameter.str();
366
367 auto it = CallableLookupCache.find(func_to_match);
368 if (it != CallableLookupCache.end())
369 return it->second;
370
372
373 CompileUnit *vtable_cu =
374 vtable_first_entry_resolved.CalculateSymbolContextCompileUnit();
375 llvm::StringRef name_to_use = func_to_match;
376
377 // Case 3, we have a callable object instead of a lambda
378 //
379 // TODO
380 // We currently don't support this case a callable object may have multiple
381 // operator()() varying on const/non-const and number of arguments and we
382 // don't have a way to currently distinguish them so we will bail out now.
383 if (!contains_lambda_identifier(name_to_use))
384 return optional_info;
385
386 if (vtable_cu && !has_invoke) {
387 lldb::FunctionSP func_sp =
388 vtable_cu->FindFunction([name_to_use](const FunctionSP &f) {
389 auto name = f->GetName().GetStringRef();
390 if (name.starts_with(name_to_use) && name.contains("operator"))
391 return true;
392
393 return false;
394 });
395
396 if (func_sp) {
397 calculate_symbol_context_helper(func_sp, scl);
398 }
399 }
400
401 if (symbol == nullptr)
402 return optional_info;
403
404 // Case 1 or 3
405 if (scl.GetSize() >= 1) {
406 optional_info = line_entry_helper(target, scl[0], symbol,
407 first_template_parameter, has_invoke);
408 }
409
410 CallableLookupCache[func_to_match] = optional_info;
411
412 return optional_info;
413}
414
417 bool stop_others) {
418 ThreadPlanSP ret_plan_sp;
419
420 lldb::addr_t curr_pc = thread.GetRegisterContext()->GetPC();
421
422 TargetSP target_sp(thread.CalculateTarget());
423
424 if (!target_sp->HasLoadedSections())
425 return ret_plan_sp;
426
427 Address pc_addr_resolved;
428 SymbolContext sc;
429 Symbol *symbol;
430
431 if (!target_sp->ResolveLoadAddress(curr_pc, pc_addr_resolved))
432 return ret_plan_sp;
433
434 target_sp->GetImages().ResolveSymbolContextForAddress(
435 pc_addr_resolved, eSymbolContextEverything, sc);
436 symbol = sc.symbol;
437
438 if (symbol == nullptr)
439 return ret_plan_sp;
440
441 llvm::StringRef function_name(symbol->GetName().GetCString());
442
443 // Handling the case where we are attempting to step into std::function.
444 // The behavior will be that we will attempt to obtain the wrapped
445 // callable via FindLibCppStdFunctionCallableInfo() and if we find it we
446 // will return a ThreadPlanRunToAddress to the callable. Therefore we will
447 // step into the wrapped callable.
448 //
449 bool found_expected_start_string =
450 function_name.starts_with("std::__1::function<");
451
452 if (!found_expected_start_string)
453 return ret_plan_sp;
454
455 AddressRange range_of_curr_func;
456 sc.GetAddressRange(eSymbolContextEverything, 0, false, range_of_curr_func);
457
458 StackFrameSP frame = thread.GetStackFrameAtIndex(0);
459
460 if (frame) {
461 ValueObjectSP value_sp = frame->FindVariable(g_this);
462
465
467 value_sp->GetValueIsValid()) {
468 // We found the std::function wrapped callable and we have its address.
469 // We now create a ThreadPlan to run to the callable.
470 ret_plan_sp = std::make_shared<ThreadPlanRunToAddress>(
471 thread, callable_info.callable_address, stop_others);
472 return ret_plan_sp;
473 } else {
474 // We are in std::function but we could not obtain the callable.
475 // We create a ThreadPlan to keep stepping through using the address range
476 // of the current function.
477 ret_plan_sp = std::make_shared<ThreadPlanStepInRange>(
478 thread, range_of_curr_func, sc, nullptr, eOnlyThisThread,
480 return ret_plan_sp;
481 }
482 }
483
484 return ret_plan_sp;
485}
486
488 llvm::StringRef mangled_name =
490 // Virtual function overriding from a non-virtual base use a "Th" prefix.
491 // Virtual function overriding from a virtual base must use a "Tv" prefix.
492 // Virtual function overriding thunks with covariant returns use a "Tc"
493 // prefix.
494 return mangled_name.starts_with("_ZTh") || mangled_name.starts_with("_ZTv") ||
495 mangled_name.starts_with("_ZTc");
496}
497
499 const bool check_cxx = true;
500 const bool check_objc = false;
501 return in_value.GetCompilerType().IsPossibleDynamicType(nullptr, check_cxx,
502 check_objc);
503}
504
506 ValueObject &in_value, lldb::DynamicValueType use_dynamic,
507 TypeAndOrName &class_type_or_name, Address &dynamic_address,
508 Value::ValueType &value_type, llvm::ArrayRef<uint8_t> &local_buffer) {
509 class_type_or_name.Clear();
510 value_type = Value::ValueType::Scalar;
511
512 if (!CouldHaveDynamicValue(in_value))
513 return false;
514
515 return m_itanium_runtime.GetDynamicTypeAndAddress(
516 in_value, use_dynamic, class_type_or_name, dynamic_address, value_type);
517}
518
521 ValueObject &static_value) {
522 CompilerType static_type(static_value.GetCompilerType());
523 Flags static_type_flags(static_type.GetTypeInfo());
524
525 TypeAndOrName ret(type_and_or_name);
526 if (type_and_or_name.HasType()) {
527 // The type will always be the type of the dynamic object. If our parent's
528 // type was a pointer, then our type should be a pointer to the type of the
529 // dynamic object. If a reference, then the original type should be
530 // okay...
531 CompilerType orig_type = type_and_or_name.GetCompilerType();
532 CompilerType corrected_type = orig_type;
533 if (static_type_flags.AllSet(eTypeIsPointer))
534 corrected_type = orig_type.GetPointerType();
535 else if (static_type_flags.AllSet(eTypeIsReference))
536 corrected_type = orig_type.GetLValueReferenceType();
537 ret.SetCompilerType(corrected_type);
538 } else {
539 // If we are here we need to adjust our dynamic type name to include the
540 // correct & or * symbol
541 std::string corrected_name(type_and_or_name.GetName().GetCString());
542 if (static_type_flags.AllSet(eTypeIsPointer))
543 corrected_name.append(" *");
544 else if (static_type_flags.AllSet(eTypeIsReference))
545 corrected_name.append(" &");
546 // the parent type should be a correctly pointer'ed or referenc'ed type
547 ret.SetCompilerType(static_type);
548 ret.SetName(corrected_name.c_str());
549 }
550 return ret;
551}
552
555 lldb::LanguageType language) {
556 if (language == eLanguageTypeC_plus_plus ||
557 language == eLanguageTypeC_plus_plus_03 ||
558 language == eLanguageTypeC_plus_plus_11 ||
559 language == eLanguageTypeC_plus_plus_14)
560 return new CPPLanguageRuntime(process);
561 else
562 return nullptr;
563}
564
567 GetPluginNameStatic(), "C++ language runtime", CreateInstance,
568 [](CommandInterpreter &interpreter) -> lldb::CommandObjectSP {
569 return CommandObjectSP(new CommandObjectCPlusPlus(interpreter));
570 });
571}
572
576
577llvm::Expected<LanguageRuntime::VTableInfo>
579 return m_itanium_runtime.GetVTableInfo(in_value, check_type);
580}
581
584 bool catch_bp, bool throw_bp) {
585 return CreateExceptionResolver(bkpt, catch_bp, throw_bp, false);
586}
587
590 bool catch_bp, bool throw_bp,
591 bool for_expressions) {
592 std::vector<const char *> exception_names;
593 m_itanium_runtime.AppendExceptionBreakpointFunctions(
594 exception_names, catch_bp, throw_bp, for_expressions);
595
597 bkpt, exception_names.data(), exception_names.size(),
598 eFunctionNameTypeBase, eLanguageTypeUnknown, 0, eLazyBoolNo));
599
600 return resolver_sp;
601}
602
604 Target &target = m_process->GetTarget();
605
606 FileSpecList filter_modules;
607 m_itanium_runtime.AppendExceptionBreakpointFilterModules(filter_modules,
608 target);
609 return target.GetSearchFilterForModuleList(&filter_modules);
610}
611
613 bool catch_bp, bool throw_bp, bool for_expressions, bool is_internal) {
614 Target &target = m_process->GetTarget();
615 FileSpecList filter_modules;
616 BreakpointResolverSP exception_resolver_sp =
617 CreateExceptionResolver(nullptr, catch_bp, throw_bp, for_expressions);
619 const bool hardware = false;
620 const bool resolve_indirect_functions = false;
621 return target.CreateBreakpoint(filter_sp, exception_resolver_sp, is_internal,
622 hardware, resolve_indirect_functions);
623}
624
626 if (!m_process)
627 return;
628
629 const bool catch_bp = false;
630 const bool throw_bp = true;
631 const bool is_internal = true;
632 const bool for_expressions = true;
633
634 // For the exception breakpoints set by the Expression parser, we'll be a
635 // little more aggressive and stop at exception allocation as well.
636
638 m_cxx_exception_bp_sp->SetEnabled(true);
639 } else {
641 catch_bp, throw_bp, for_expressions, is_internal);
643 m_cxx_exception_bp_sp->SetBreakpointKind("c++ exception");
644 }
645}
646
648 if (!m_process)
649 return;
650
652 m_cxx_exception_bp_sp->SetEnabled(false);
653 }
654}
655
659
661 lldb::StopInfoSP stop_reason) {
662 if (!m_process)
663 return false;
664
665 if (!stop_reason || stop_reason->GetStopReason() != eStopReasonBreakpoint)
666 return false;
667
668 uint64_t break_site_id = stop_reason->GetValue();
669 return m_process->GetBreakpointSiteList().StopPointSiteContainsBreakpoint(
670 break_site_id, m_cxx_exception_bp_sp->GetID());
671}
672
675 return m_itanium_runtime.GetExceptionObjectForThread(std::move(thread_sp));
676}
static ConstString g_promise
static ConstString g_coro_frame
bool contains_lambda_identifier(llvm::StringRef &str_ref)
static ConstString g_this
CPPLanguageRuntime::LibCppStdFunctionCallableInfo line_entry_helper(Target &target, const SymbolContext &sc, Symbol *symbol, llvm::StringRef first_template_param_sref, bool has_invoke)
static char ID
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName)
#define LLDB_SCOPED_TIMER()
Definition Timer.h:83
A frame recognizer that is installed to hide libc++ implementation details from the backtrace.
lldb::RecognizedStackFrameSP RecognizeFrame(lldb::StackFrameSP frame_sp) override
RecognizedStackFrameSP m_hidden_frame
std::array< RegularExpression, 2 > m_hidden_regex
std::string GetName() override
A section + offset based address range class.
A section + offset based address class.
Definition Address.h:62
lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect=false) const
Get the load address as a callable code load address.
Definition Address.cpp:326
bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const
Definition Address.cpp:902
CompileUnit * CalculateSymbolContextCompileUnit() const
Definition Address.cpp:846
"lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on a given function name,...
llvm::Expected< LanguageRuntime::VTableInfo > GetVTableInfo(ValueObject &in_value, bool check_type) override
Get the vtable information for a given value.
TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name, ValueObject &static_value) override
bool CouldHaveDynamicValue(ValueObject &in_value) override
lldb::BreakpointSP CreateExceptionBreakpoint(bool catch_bp, bool throw_bp, bool for_expressions, bool is_internal)
static lldb_private::LanguageRuntime * CreateInstance(Process *process, lldb::LanguageType language)
llvm::Error GetObjectDescription(Stream &str, ValueObject &object) override
lldb::SearchFilterSP CreateExceptionSearchFilter() override
lldb::ValueObjectSP GetExceptionObjectForThread(lldb::ThreadSP thread_sp) override
bool IsSymbolARuntimeThunk(const Symbol &symbol) override
bool IsAllowedRuntimeValue(ConstString name) override
Identify whether a name is a runtime value that should not be hidden by from the user interface.
LibCppStdFunctionCallableInfo FindLibCppStdFunctionCallableInfo(lldb::ValueObjectSP &valobj_sp)
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread, bool stop_others) override
Obtain a ThreadPlan to get us into C++ constructs such as std::function.
lldb::BreakpointResolverSP CreateExceptionResolver(const lldb::BreakpointSP &bkpt, bool catch_bp, bool throw_bp) override
OperatorStringToCallableInfoMap CallableLookupCache
static llvm::StringRef GetPluginNameStatic()
bool GetDynamicTypeAndAddress(ValueObject &in_value, lldb::DynamicValueType use_dynamic, TypeAndOrName &class_type_or_name, Address &address, Value::ValueType &value_type, llvm::ArrayRef< uint8_t > &local_buffer) override
This call should return true if it could set the name and/or the type Sets address to the address of ...
bool ExceptionBreakpointsExplainStop(lldb::StopInfoSP stop_reason) override
A class that describes a compilation unit.
Definition CompileUnit.h:43
lldb::FunctionSP FindFunction(llvm::function_ref< bool(const lldb::FunctionSP &)> matching_lambda)
Find a function in the compile unit based on the predicate matching_lambda.
Generic representation of a type in a programming language.
bool IsPossibleDynamicType(CompilerType *target_type, bool check_cplusplus, bool check_objc) const
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
CompilerType GetLValueReferenceType() const
Return a new CompilerType that is a L value reference to this type if this type is valid and the type...
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
A uniqued constant string class.
Definition ConstString.h:40
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Process * GetProcessPtr() const
Returns a pointer to the process object.
A file collection class.
A class to manage flags.
Definition Flags.h:22
bool AllSet(ValueType mask) const
Test if all bits in mask are 1 in the current flags.
Definition Flags.h:83
@ ePreferDemangledWithoutArguments
Definition Mangled.h:39
ConstString GetMangledName() const
Mangled name get accessor.
Definition Mangled.h:152
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address&,uint32_t,SymbolContext&)
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
A plug-in interface definition class for debugging a process.
Definition Process.h:354
lldb::addr_t ReadPointerFromMemory(lldb::addr_t vm_addr, Status &error)
Definition Process.cpp:2334
uint32_t GetAddressByteSize() const
Definition Process.cpp:3725
Target & GetTarget()
Get the target object pointer for this module.
Definition Process.h:1250
This class provides extra information about a stack frame that was provided by a specific stack frame...
Process * m_process
Definition Runtime.h:29
void AddRecognizer(lldb::StackFrameRecognizerSP recognizer, ConstString module, llvm::ArrayRef< ConstString > symbols, Mangled::NamePreference symbol_mangling, bool first_instruction_only=true)
Add a new recognizer that triggers on a given symbol name.
A base class for frame recognizers.
An error handling class.
Definition Status.h:118
bool Fail() const
Test for error condition.
Definition Status.cpp:293
A stream class that can stream formatted output to a file.
Definition Stream.h:28
Defines a list of symbol context objects.
uint32_t GetSize() const
Get accessor for a symbol context list size.
Defines a symbol context baton that can be handed other debug core functions.
bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const
Get the address range contained within a symbol context.
Symbol * symbol
The Symbol for a given query.
Address GetFunctionOrSymbolAddress() const
Get the address of the function or symbol represented by this symbol context.
Mangled & GetMangled()
Definition Symbol.h:147
ConstString GetName() const
Definition Symbol.cpp:511
lldb::SearchFilterSP GetSearchFilterForModuleList(const FileSpecList *containingModuleList)
Definition Target.cpp:690
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
Definition Target.cpp:3322
StackFrameRecognizerManager & GetFrameRecognizerManager()
Definition Target.h:1702
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:489
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1141
Sometimes you can find the name of the type corresponding to an object, but we don't have debug infor...
Definition Type.h:779
void SetName(ConstString type_name)
Definition Type.cpp:902
CompilerType GetCompilerType() const
Definition Type.h:793
ConstString GetName() const
Definition Type.cpp:894
void SetCompilerType(CompilerType compiler_type)
Definition Type.cpp:922
bool HasType() const
Definition Type.h:811
CompilerType GetCompilerType()
ValueType
Type that describes Value::m_value.
Definition Value.h:41
@ Scalar
A raw scalar value.
Definition Value.h:45
A class that represents a running process on the host machine.
void RegisterVerboseTrapFrameRecognizer(Process &process)
std::shared_ptr< lldb_private::Function > FunctionSP
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::RecognizedStackFrame > RecognizedStackFrameSP
std::shared_ptr< lldb_private::SearchFilter > SearchFilterSP
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
LanguageType
Programming language type.
@ eLanguageTypeC_plus_plus_14
ISO C++:2014.
@ eLanguageTypeC_plus_plus_03
ISO C++:2003.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eLanguageTypeC_plus_plus_11
ISO C++:2011.
@ eLanguageTypeC_plus_plus
ISO C++:1998.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::StackFrameRecognizer > StackFrameRecognizerSP
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
uint64_t addr_t
Definition lldb-types.h:80
@ eStopReasonBreakpoint
std::shared_ptr< lldb_private::Target > TargetSP
bool ShouldHide() override
Controls whether this frame should be filtered out when displaying backtraces, for example.
A line table entry class.
Definition LineEntry.h:21