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>(),
95 std::string module_re =
"^";
102 std::string symbol_re =
"^(";
103 for (
auto it = location.
symbols.cbegin(); it != location.
symbols.cend();
105 if (it != location.
symbols.cbegin())
107 symbol_re += it->GetStringRef();
110 symbol_re +=
")(@.*)?$";
112 std::make_shared<AssertFrameRecognizer>(),
113 std::make_shared<RegularExpression>(std::move(module_re)),
114 std::make_shared<RegularExpression>(std::move(symbol_re)),
122 ThreadSP thread_sp = frame_sp->GetThread();
123 ProcessSP process_sp = thread_sp->GetProcess();
124 Target &target = process_sp->GetTarget();
131 const uint32_t frames_to_fetch = 6;
132 const uint32_t last_frame_index = frames_to_fetch - 1;
136 for (uint32_t frame_index = 0; frame_index < frames_to_fetch; frame_index++) {
137 prev_frame_sp = thread_sp->GetStackFrameAtIndex(frame_index);
139 if (!prev_frame_sp) {
141 LLDB_LOG(log,
"Abort Recognizer: Hit unwinding bound ({1} frames)!",
147 prev_frame_sp->GetSymbolContext(eSymbolContextEverything);
155 if (llvm::is_contained(location.
symbols, func_name)) {
161 StackFrameSP most_relevant_frame_sp = thread_sp->GetStackFrameAtIndex(
162 std::min(frame_index + 1, last_frame_index));
176 : 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, bool first_instruction_only=true)
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