Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:52

0001 //===- JITLoaderGDB.h - Register objects via GDB JIT interface -*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Register objects for access by debuggers via the GDB JIT interface.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H
0014 #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H
0015 
0016 #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
0017 #include "llvm/Support/Compiler.h"
0018 #include <cstdint>
0019 
0020 // Keep in sync with gdb/gdb/jit.h
0021 extern "C" {
0022 
0023 typedef enum {
0024   JIT_NOACTION = 0,
0025   JIT_REGISTER_FN,
0026   JIT_UNREGISTER_FN
0027 } jit_actions_t;
0028 
0029 struct jit_code_entry {
0030   struct jit_code_entry *next_entry;
0031   struct jit_code_entry *prev_entry;
0032   const char *symfile_addr;
0033   uint64_t symfile_size;
0034 };
0035 
0036 struct jit_descriptor {
0037   uint32_t version;
0038   // This should be jit_actions_t, but we want to be specific about the
0039   // bit-width.
0040   uint32_t action_flag;
0041   struct jit_code_entry *relevant_entry;
0042   struct jit_code_entry *first_entry;
0043 };
0044 }
0045 
0046 extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
0047 llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size);
0048 
0049 extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
0050 llvm_orc_registerJITLoaderGDBAllocAction(const char *Data, size_t Size);
0051 
0052 #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H