28 case llvm::Triple::Darwin:
29 case llvm::Triple::MacOSX:
33 case llvm::Triple::Linux:
43 LLDB_LOG(log,
"AssertFrameRecognizer::GetAbortLocation Unsupported OS");
61 case llvm::Triple::Darwin:
62 case llvm::Triple::MacOSX:
66 case llvm::Triple::Linux:
73 LLDB_LOG(log,
"AssertFrameRecognizer::GetAssertLocation Unsupported OS");
90 std::make_shared<AssertFrameRecognizer>(),
96 std::string module_re =
"^";
103 std::string symbol_re =
"^(";
104 for (
auto it = location.
symbols.cbegin(); it != location.
symbols.cend();
106 if (it != location.
symbols.cbegin())
108 symbol_re += it->GetStringRef();
111 symbol_re +=
")(@.*)?$";
113 std::make_shared<AssertFrameRecognizer>(),
114 std::make_shared<RegularExpression>(std::move(module_re)),
115 std::make_shared<RegularExpression>(std::move(symbol_re)),
124 ThreadSP thread_sp = frame_sp->GetThread();
125 ProcessSP process_sp = thread_sp->GetProcess();
126 Target &target = process_sp->GetTarget();
133 const uint32_t frames_to_fetch = 6;
134 const uint32_t last_frame_index = frames_to_fetch - 1;
138 for (uint32_t frame_index = 0; frame_index < frames_to_fetch; frame_index++) {
139 prev_frame_sp = thread_sp->GetStackFrameAtIndex(frame_index);
141 if (!prev_frame_sp) {
143 LLDB_LOG(log,
"Abort Recognizer: Hit unwinding bound ({1} frames)!",
149 prev_frame_sp->GetSymbolContext(eSymbolContextEverything);
157 if (llvm::is_contained(location.
symbols, func_name)) {
163 StackFrameSP most_relevant_frame_sp = thread_sp->GetStackFrameAtIndex(
164 std::min(frame_index + 1, last_frame_index));
178 : m_most_relevant_frame(most_relevant_frame_sp) {
#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