28 case llvm::Triple::Darwin:
29 case llvm::Triple::MacOSX:
30 case llvm::Triple::IOS:
31 case llvm::Triple::TvOS:
32 case llvm::Triple::WatchOS:
33 case llvm::Triple::BridgeOS:
34 case llvm::Triple::DriverKit:
35 case llvm::Triple::XROS:
39 case llvm::Triple::Linux:
49 LLDB_LOG(log,
"AssertFrameRecognizer::GetAbortLocation Unsupported OS");
67 case llvm::Triple::Darwin:
68 case llvm::Triple::MacOSX:
69 case llvm::Triple::IOS:
70 case llvm::Triple::TvOS:
71 case llvm::Triple::WatchOS:
72 case llvm::Triple::BridgeOS:
73 case llvm::Triple::DriverKit:
74 case llvm::Triple::XROS:
78 case llvm::Triple::Linux:
85 LLDB_LOG(log,
"AssertFrameRecognizer::GetAssertLocation Unsupported OS");
102 std::make_shared<AssertFrameRecognizer>(),
108 std::string module_re =
"^";
115 std::string symbol_re =
"^(";
116 for (
auto it = location.
symbols.cbegin(); it != location.
symbols.cend();
118 if (it != location.
symbols.cbegin())
120 symbol_re += it->GetStringRef();
123 symbol_re +=
")(@.*)?$";
125 std::make_shared<AssertFrameRecognizer>(),
126 std::make_shared<RegularExpression>(std::move(module_re)),
127 std::make_shared<RegularExpression>(std::move(symbol_re)),
136 ThreadSP thread_sp = frame_sp->GetThread();
137 ProcessSP process_sp = thread_sp->GetProcess();
138 Target &target = process_sp->GetTarget();
145 const uint32_t frames_to_fetch = 6;
146 const uint32_t last_frame_index = frames_to_fetch - 1;
150 for (uint32_t frame_index = 0; frame_index < frames_to_fetch; frame_index++) {
151 prev_frame_sp = thread_sp->GetStackFrameAtIndex(frame_index);
153 if (!prev_frame_sp) {
155 LLDB_LOG(log,
"Abort Recognizer: Hit unwinding bound ({} frames)!",
161 prev_frame_sp->GetSymbolContext(eSymbolContextEverything);
169 if (llvm::is_contained(location.
symbols, func_name)) {
175 StackFrameSP most_relevant_frame_sp = thread_sp->GetStackFrameAtIndex(
176 std::min(frame_index + 1, last_frame_index));
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
llvm::Triple & GetTriple()
Architecture triple accessor.
lldb::RecognizedStackFrameSP RecognizeFrame(lldb::StackFrameSP frame_sp) override
Holds the stack frame where the assert is called from.
AssertRecognizedStackFrame(lldb::StackFrameSP most_relevant_frame_sp)
lldb::StackFrameSP m_most_relevant_frame
lldb::StackFrameSP GetMostRelevantFrame() override
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const ConstString & GetFilename() const
Filename string const get accessor.
A plug-in interface definition class for debugging a process.
Target & GetTarget()
Get the target object pointer for this module.
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.
Defines a symbol context baton that can be handed other debug core functions.
ConstString GetFunctionName(Mangled::NamePreference preference=Mangled::ePreferDemangled) const
Find a name of the innermost function for the symbol context.
lldb::ModuleSP module_sp
The Module for a given query.
StackFrameRecognizerManager & GetFrameRecognizerManager()
const ArchSpec & GetArchitecture() const
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
void RegisterAssertFrameRecognizer(Process *process)
Registers the assert stack frame recognizer.
bool GetAbortLocation(llvm::Triple::OSType os, SymbolLocation &location)
Fetches the abort frame location depending on the current platform.
bool GetAssertLocation(llvm::Triple::OSType os, SymbolLocation &location)
Fetches the assert frame location depending on the current platform.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::RecognizedStackFrame > RecognizedStackFrameSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::Process > ProcessSP
Stores a function module spec, symbol name and possibly an alternate symbol name.
std::vector< ConstString > symbols