57 #if !defined(_MSC_VER) 58 asm volatile(
"":::
"memory");
66 struct RegisteredObjectInfo {
67 RegisteredObjectInfo() {}
71 :
Size(Size), Entry(Entry), Obj(std::move(Obj)) {}
80 RegisteredObjectBufferMap;
89 RegisteredObjectBufferMap ObjectBufferMap;
93 GDBJITRegistrationListener() : ObjectBufferMap() {}
97 ~GDBJITRegistrationListener()
override;
102 void notifyObjectLoaded(ObjectKey K,
const ObjectFile &Obj,
108 void notifyFreeingObject(ObjectKey K)
override;
114 void deregisterObjectInternal(RegisteredObjectBufferMap::iterator
I);
137 GDBJITRegistrationListener::~GDBJITRegistrationListener() {
140 for (RegisteredObjectBufferMap::iterator
I = ObjectBufferMap.begin(),
141 E = ObjectBufferMap.end();
145 deregisterObjectInternal(
I);
147 ObjectBufferMap.clear();
150 void GDBJITRegistrationListener::notifyObjectLoaded(
164 assert(ObjectBufferMap.find(K) == ObjectBufferMap.end() &&
165 "Second attempt to perform debug registration.");
170 "Allocation failed when registering a JIT entry!\n");
172 JITCodeEntry->symfile_addr = Buffer;
173 JITCodeEntry->symfile_size =
Size;
176 RegisteredObjectInfo(Size, JITCodeEntry, std::move(DebugObj));
177 NotifyDebugger(JITCodeEntry);
181 void GDBJITRegistrationListener::notifyFreeingObject(ObjectKey K) {
183 RegisteredObjectBufferMap::iterator
I = ObjectBufferMap.find(K);
185 if (I != ObjectBufferMap.end()) {
186 deregisterObjectInternal(I);
187 ObjectBufferMap.erase(I);
191 void GDBJITRegistrationListener::deregisterObjectInternal(
192 RegisteredObjectBufferMap::iterator
I) {
221 JITCodeEntry =
nullptr;
231 return &*GDBRegListener;
Information about the loaded object.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
JITEventListener - Abstract interface for use by the JIT to notify clients about significant events d...
static JITEventListener * createGDBRegistrationListener()
This class is the base class for all object file types.
#define LLVM_ATTRIBUTE_NOINLINE
const char * symfile_addr
struct jit_descriptor __jit_debug_descriptor
MemoryBufferRef getMemoryBufferRef() const
struct jit_code_entry * first_entry
Instances of this class acquire a given Mutex Lock when constructed and hold that lock until destruct...
size_t getBufferSize() const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVM_ATTRIBUTE_NOINLINE void __jit_debug_register_code()
virtual object::OwningBinary< object::ObjectFile > getObjectForDebug(const object::ObjectFile &Obj) const =0
struct jit_code_entry * prev_entry
struct jit_code_entry * next_entry
LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void)
LLVMAttributeRef wrap(Attribute Attr)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const char * getBufferStart() const
struct LLVMOpaqueJITEventListener * LLVMJITEventListenerRef
struct jit_code_entry * relevant_entry
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...