LLDB mainline
AssertFrameRecognizer.h
Go to the documentation of this file.
1//===-- AssertFrameRecognizer.cpp -------------------------------*- C++ -*-===//
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_TARGET_ASSERTFRAMERECOGNIZER_H
10#define LLDB_TARGET_ASSERTFRAMERECOGNIZER_H
11
12#include "lldb/Target/Process.h"
16
17#include <tuple>
18
19namespace lldb_private {
20
21/// Registers the assert stack frame recognizer.
22///
23/// \param[in] process
24/// The process that is currently asserting. This will give us information on
25/// the target and the platform.
26void RegisterAssertFrameRecognizer(Process *process);
27
28/// \class AssertRecognizedStackFrame
29///
30/// Holds the stack frame where the assert is called from.
32public:
33 AssertRecognizedStackFrame(lldb::StackFrameSP most_relevant_frame_sp);
34 lldb::StackFrameSP GetMostRelevantFrame() override;
35
36private:
37 lldb::StackFrameSP m_most_relevant_frame;
38};
39
40/// \class AssertFrameRecognizer
41///
42/// When a thread stops, it checks depending on the platform if the top frame is
43/// an abort stack frame. If so, it looks for an assert stack frame in the upper
44/// frames and set it as the most relavant frame when found.
46public:
47 std::string GetName() override { return "Assert StackFrame Recognizer"; }
48 lldb::RecognizedStackFrameSP
49 RecognizeFrame(lldb::StackFrameSP frame_sp) override;
50};
51
52} // namespace lldb_private
53
54#endif // LLDB_TARGET_ASSERTFRAMERECOGNIZER_H
When a thread stops, it checks depending on the platform if the top frame is an abort stack frame.
lldb::RecognizedStackFrameSP RecognizeFrame(lldb::StackFrameSP frame_sp) override
Holds the stack frame where the assert is called from.
lldb::StackFrameSP GetMostRelevantFrame() override
This class provides extra information about a stack frame that was provided by a specific stack frame...
A base class for frame recognizers.
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
void RegisterAssertFrameRecognizer(Process *process)
Registers the assert stack frame recognizer.