Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===- BTFContext.h ---------------------------------------------*- 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 // BTFContext interface is used by llvm-objdump tool to print source
0010 // code alongside disassembly.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_DEBUGINFO_BTF_BTFCONTEXT_H
0015 #define LLVM_DEBUGINFO_BTF_BTFCONTEXT_H
0016 
0017 #include "llvm/DebugInfo/BTF/BTFParser.h"
0018 #include "llvm/DebugInfo/DIContext.h"
0019 
0020 namespace llvm {
0021 
0022 class BTFContext final : public DIContext {
0023   BTFParser BTF;
0024 
0025 public:
0026   BTFContext() : DIContext(CK_BTF) {}
0027 
0028   void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override {
0029     // This function is called from objdump when --dwarf=? option is set.
0030     // BTF is no DWARF, so ignore this operation for now.
0031   }
0032 
0033   DILineInfo getLineInfoForAddress(
0034       object::SectionedAddress Address,
0035       DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
0036 
0037   DILineInfo
0038   getLineInfoForDataAddress(object::SectionedAddress Address) override;
0039 
0040   DILineInfoTable getLineInfoForAddressRange(
0041       object::SectionedAddress Address, uint64_t Size,
0042       DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
0043 
0044   DIInliningInfo getInliningInfoForAddress(
0045       object::SectionedAddress Address,
0046       DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
0047 
0048   std::vector<DILocal>
0049   getLocalsForAddress(object::SectionedAddress Address) override;
0050 
0051   static std::unique_ptr<BTFContext> create(
0052       const object::ObjectFile &Obj,
0053       std::function<void(Error)> ErrorHandler = WithColor::defaultErrorHandler);
0054 };
0055 
0056 } // end namespace llvm
0057 
0058 #endif // LLVM_DEBUGINFO_BTF_BTFCONTEXT_H