48 lines · c
1//===-- VerboseTrapFrameRecognizer.h --------------------------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_C_PLUS_PLUS_VERBOSETRAPFRAMERECOGNIZER_H10#define LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_C_PLUS_PLUS_VERBOSETRAPFRAMERECOGNIZER_H11 12#include "lldb/Target/StackFrameRecognizer.h"13 14namespace lldb_private {15 16void RegisterVerboseTrapFrameRecognizer(Process &process);17 18/// Holds the stack frame that caused the Verbose trap and the inlined stop19/// reason message.20class VerboseTrapRecognizedStackFrame : public RecognizedStackFrame {21public:22 VerboseTrapRecognizedStackFrame(lldb::StackFrameSP most_relevant_frame_sp,23 std::string stop_desc);24 25 lldb::StackFrameSP GetMostRelevantFrame() override;26 27private:28 lldb::StackFrameSP m_most_relevant_frame;29};30 31/// When a thread stops, it checks the current frame contains a32/// Verbose Trap diagnostic. If so, it returns a \a33/// VerboseTrapRecognizedStackFrame holding the diagnostic a stop reason34/// description with and the parent frame as the most relavant frame.35class VerboseTrapFrameRecognizer : public StackFrameRecognizer {36public:37 std::string GetName() override {38 return "Verbose Trap StackFrame Recognizer";39 }40 41 lldb::RecognizedStackFrameSP42 RecognizeFrame(lldb::StackFrameSP frame) override;43};44 45} // namespace lldb_private46 47#endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_C_PLUS_PLUS_VERBOSETRAPFRAMERECOGNIZER_H48