1 //===-- StoppointCallbackContext.h ------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_StoppointCallbackContext_h_
11 #define liblldb_StoppointCallbackContext_h_
12 
13 #include "lldb/lldb-private.h"
14 #include "lldb/Target/ExecutionContext.h"
15 
16 namespace lldb_private {
17 
18 //----------------------------------------------------------------------
19 /// @class StoppointCallbackContext StoppointCallbackContext.h "lldb/Breakpoint/StoppointCallbackContext.h"
20 /// @brief Class holds the information that a breakpoint callback needs to evaluate this stop.
21 //----------------------------------------------------------------------
22 
23 //----------------------------------------------------------------------
24 /// General Outline:
25 /// When we hit a breakpoint we need to package up whatever information is needed
26 /// to evaluate breakpoint commands and conditions.  This class is the container of
27 /// that information.
28 //----------------------------------------------------------------------
29 
30 class StoppointCallbackContext
31 {
32 public:
33     StoppointCallbackContext();
34 
35     StoppointCallbackContext(Event *event, const ExecutionContext &exe_ctx, bool synchronously = false);
36 
37     //------------------------------------------------------------------
38     /// Clear the object's state.
39     ///
40     /// Sets the event, process and thread to NULL, and the frame index to an
41     /// invalid value.
42     //------------------------------------------------------------------
43     void
44     Clear ();
45 
46     //------------------------------------------------------------------
47     // Member variables
48     //------------------------------------------------------------------
49     Event *event;               // This is the event, the callback can modify this to indicate
50                                 // the meaning of the breakpoint hit
51     ExecutionContextRef exe_ctx_ref; // This tells us where we have stopped, what thread.
52     bool is_synchronous;        // Is the callback being executed synchronously with the breakpoint,
53                                 // or asynchronously as the event is retrieved?
54 };
55 
56 } // namespace lldb_private
57 
58 #endif  // liblldb_StoppointCallbackContext_h_
59