]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h
There is no Python in the FreeBSD base system
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / JITLoader / GDB / JITLoaderGDB.h
1 //===-- JITLoaderGDB.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_JITLoaderGDB_h_
11 #define liblldb_JITLoaderGDB_h_
12
13 // C Includes
14 // C++ Includes
15 #include <map>
16 #include <vector>
17 #include <string>
18
19 #include "lldb/Target/JITLoader.h"
20 #include "lldb/Target/Process.h"
21
22 class JITLoaderGDB : public lldb_private::JITLoader
23 {
24 public:
25     //------------------------------------------------------------------
26     // Static Functions
27     //------------------------------------------------------------------
28     static void
29     Initialize();
30
31     static void
32     Terminate();
33
34     static lldb_private::ConstString
35     GetPluginNameStatic();
36
37     static const char *
38     GetPluginDescriptionStatic();
39
40     static lldb::JITLoaderSP
41     CreateInstance (lldb_private::Process *process, bool force);
42
43     JITLoaderGDB (lldb_private::Process *process);
44
45     virtual
46     ~JITLoaderGDB ();
47
48     //------------------------------------------------------------------
49     // PluginInterface protocol
50     //------------------------------------------------------------------
51     virtual lldb_private::ConstString
52     GetPluginName();
53
54     virtual uint32_t
55     GetPluginVersion();
56
57     //------------------------------------------------------------------
58     // JITLoader interface
59     //------------------------------------------------------------------
60     virtual void
61     DidAttach ();
62
63     virtual void
64     DidLaunch ();
65
66     virtual void
67     ModulesDidLoad (lldb_private::ModuleList &module_list);
68
69 private:
70     lldb::addr_t
71     GetSymbolAddress(lldb_private::ModuleList &module_list,
72                      const lldb_private::ConstString &name,
73                      lldb::SymbolType symbol_type) const;
74
75     void
76     SetJITBreakpoint(lldb_private::ModuleList &module_list);
77
78     bool
79     DidSetJITBreakpoint() const;
80
81     bool
82     ReadJITDescriptor(bool all_entries);
83
84     static bool
85     JITDebugBreakpointHit(void *baton,
86                           lldb_private::StoppointCallbackContext *context,
87                           lldb::user_id_t break_id,
88                           lldb::user_id_t break_loc_id);
89
90     static void
91     ProcessStateChangedCallback(void *baton,
92                                 lldb_private::Process *process,
93                                 lldb::StateType state);
94
95     // A collection of in-memory jitted object addresses and their corresponding modules
96     typedef std::map<lldb::addr_t, const lldb::ModuleSP> JITObjectMap;
97     JITObjectMap m_jit_objects;
98
99     lldb::user_id_t m_jit_break_id;
100     lldb::addr_t m_jit_descriptor_addr;
101
102 };
103
104 #endif