Stephen Hines | c6ca60f | 2023-05-09 02:19:22 -0700 | [diff] [blame^] | 1 | //===-- StoppointCallbackContext.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_BREAKPOINT_STOPPOINTCALLBACKCONTEXT_H |
| 10 | #define LLDB_BREAKPOINT_STOPPOINTCALLBACKCONTEXT_H |
| 11 | |
| 12 | #include "lldb/Target/ExecutionContext.h" |
| 13 | #include "lldb/lldb-private.h" |
| 14 | |
| 15 | namespace lldb_private { |
| 16 | |
| 17 | /// \class StoppointCallbackContext StoppointCallbackContext.h |
| 18 | /// "lldb/Breakpoint/StoppointCallbackContext.h" Class holds the information |
| 19 | /// that a breakpoint callback needs to evaluate this stop. |
| 20 | |
| 21 | /// General Outline: |
| 22 | /// When we hit a breakpoint we need to package up whatever information is |
| 23 | /// needed to evaluate breakpoint commands and conditions. This class is the |
| 24 | /// container of that information. |
| 25 | |
| 26 | class StoppointCallbackContext { |
| 27 | public: |
| 28 | StoppointCallbackContext(); |
| 29 | |
| 30 | StoppointCallbackContext(Event *event, const ExecutionContext &exe_ctx, |
| 31 | bool synchronously = false); |
| 32 | |
| 33 | /// Clear the object's state. |
| 34 | /// |
| 35 | /// Sets the event, process and thread to NULL, and the frame index to an |
| 36 | /// invalid value. |
| 37 | void Clear(); |
| 38 | |
| 39 | // Member variables |
| 40 | Event *event = nullptr; // This is the event, the callback can modify this to |
| 41 | // indicate the meaning of the breakpoint hit |
| 42 | ExecutionContextRef |
| 43 | exe_ctx_ref; // This tells us where we have stopped, what thread. |
| 44 | bool is_synchronous = |
| 45 | false; // Is the callback being executed synchronously with the |
| 46 | // breakpoint, |
| 47 | // or asynchronously as the event is retrieved? |
| 48 | }; |
| 49 | |
| 50 | } // namespace lldb_private |
| 51 | |
| 52 | #endif // LLDB_BREAKPOINT_STOPPOINTCALLBACKCONTEXT_H |