blob: 2ecc957d2a2857ab0d083bf1a986ff753d7e2650 [file] [log] [blame]
//===-- AssertFrameRecognizer.cpp -------------------------------*- C++ -*-===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "lldb/Target/Process.h"
#include "lldb/Target/StackFrameRecognizer.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
#include <tuple>
namespace lldb_private {
/// Registers the assert stack frame recognizer.
/// \param[in] process
/// The process that is currently asserting. This will give us information on
/// the target and the platform.
void RegisterAssertFrameRecognizer(Process *process);
/// \class AssertRecognizedStackFrame
/// Holds the stack frame where the assert is called from.
class AssertRecognizedStackFrame : public RecognizedStackFrame {
AssertRecognizedStackFrame(lldb::StackFrameSP most_relevant_frame_sp);
lldb::StackFrameSP GetMostRelevantFrame() override;
lldb::StackFrameSP m_most_relevant_frame;
/// \class AssertFrameRecognizer
/// When a thread stops, it checks depending on the platform if the top frame is
/// an abort stack frame. If so, it looks for an assert stack frame in the upper
/// frames and set it as the most relavant frame when found.
class AssertFrameRecognizer : public StackFrameRecognizer {
std::string GetName() override { return "Assert StackFrame Recognizer"; }
RecognizeFrame(lldb::StackFrameSP frame_sp) override;
} // namespace lldb_private