LLDB mainline
ThreadPlanCallOnFunctionExit.h
Go to the documentation of this file.
1//===-- ThreadPlanCallOnFunctionExit.h --------------------------*- 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_THREADPLANCALLONFUNCTIONEXIT_H
10#define LLDB_TARGET_THREADPLANCALLONFUNCTIONEXIT_H
11
13
14#include <functional>
15
16namespace lldb_private {
17
18// =============================================================================
19/// This thread plan calls a function object when the current function exits.
20// =============================================================================
21
23public:
24 /// Definition for the callback made when the currently executing thread
25 /// finishes executing its function.
26 using Callback = std::function<void()>;
27
28 ThreadPlanCallOnFunctionExit(Thread &thread, const Callback &callback);
29
30 void DidPush() override;
31
32 // ThreadPlan API
33
34 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
35
36 bool ValidatePlan(Stream *error) override;
37
38 bool ShouldStop(Event *event_ptr) override;
39
40 bool WillStop() override;
41
42protected:
43 bool DoPlanExplainsStop(Event *event_ptr) override;
44
46
47private:
50};
51}
52
53#endif // LLDB_TARGET_THREADPLANCALLONFUNCTIONEXIT_H
static llvm::raw_ostream & error(Stream &strm)
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
This thread plan calls a function object when the current function exits.
std::function< void()> Callback
Definition for the callback made when the currently executing thread finishes executing its function.
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
Definition: lldb-forward.h:444
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
StateType
Process and Thread States.