LLDB
mainline
llvm-project
lldb
include
lldb
Target
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
"
13
#include "
lldb/Target/StackFrameRecognizer.h
"
14
#include "
lldb/Utility/ConstString.h
"
15
#include "
lldb/Utility/FileSpec.h
"
16
17
#include <tuple>
18
19
namespace
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.
26
void
RegisterAssertFrameRecognizer
(Process *process);
27
28
/// \class AssertRecognizedStackFrame
29
///
30
/// Holds the stack frame where the assert is called from.
31
class
AssertRecognizedStackFrame
:
public
RecognizedStackFrame
{
32
public
:
33
AssertRecognizedStackFrame
(lldb::StackFrameSP most_relevant_frame_sp);
34
lldb::StackFrameSP
GetMostRelevantFrame
()
override
;
35
36
private
:
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.
45
class
AssertFrameRecognizer
:
public
StackFrameRecognizer
{
46
public
:
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
lldb_private::StackFrameRecognizer
Definition:
StackFrameRecognizer.h:55
lldb_private::AssertRecognizedStackFrame::AssertRecognizedStackFrame
AssertRecognizedStackFrame(lldb::StackFrameSP most_relevant_frame_sp)
Definition:
AssertFrameRecognizer.cpp:185
lldb_private::AssertRecognizedStackFrame::m_most_relevant_frame
lldb::StackFrameSP m_most_relevant_frame
Definition:
AssertFrameRecognizer.h:37
lldb_private::AssertFrameRecognizer::GetName
std::string GetName() override
Definition:
AssertFrameRecognizer.h:47
Process.h
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition:
Plugins/CMakeLists.txt:40
lldb_private::RegisterAssertFrameRecognizer
void RegisterAssertFrameRecognizer(Process *process)
Registers the assert stack frame recognizer.
Definition:
AssertFrameRecognizer.cpp:91
lldb_private::RecognizedStackFrame
Definition:
StackFrameRecognizer.h:30
lldb_private
A class that represents a running process on the host machine.
Definition:
SBCommandInterpreterRunOptions.h:16
FileSpec.h
ConstString.h
lldb_private::AssertRecognizedStackFrame
Definition:
AssertFrameRecognizer.h:31
lldb_private::AssertFrameRecognizer::RecognizeFrame
lldb::RecognizedStackFrameSP RecognizeFrame(lldb::StackFrameSP frame_sp) override
Definition:
AssertFrameRecognizer.cpp:132
lldb_private::AssertFrameRecognizer
Definition:
AssertFrameRecognizer.h:45
StackFrameRecognizer.h
lldb_private::AssertRecognizedStackFrame::GetMostRelevantFrame
lldb::StackFrameSP GetMostRelevantFrame() override
Definition:
AssertFrameRecognizer.cpp:191
Generated on Wed Jul 20 2022 21:29:02 for LLDB by
1.8.17