Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- PDBContext.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 #ifndef LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
0010 #define LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
0011 
0012 #include "llvm/DebugInfo/DIContext.h"
0013 #include "llvm/DebugInfo/PDB/IPDBSession.h"
0014 #include <cstdint>
0015 #include <memory>
0016 #include <string>
0017 
0018 namespace llvm {
0019 
0020 namespace object {
0021 class COFFObjectFile;
0022 } // end namespace object
0023 
0024 namespace pdb {
0025 
0026   /// PDBContext
0027   /// This data structure is the top level entity that deals with PDB debug
0028   /// information parsing.  This data structure exists only when there is a
0029   /// need for a transparent interface to different debug information formats
0030   /// (e.g. PDB and DWARF).  More control and power over the debug information
0031   /// access can be had by using the PDB interfaces directly.
0032   class PDBContext : public DIContext {
0033   public:
0034     PDBContext(const object::COFFObjectFile &Object,
0035                std::unique_ptr<IPDBSession> PDBSession);
0036     PDBContext(PDBContext &) = delete;
0037     PDBContext &operator=(PDBContext &) = delete;
0038 
0039     static bool classof(const DIContext *DICtx) {
0040       return DICtx->getKind() == CK_PDB;
0041     }
0042 
0043     void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override;
0044 
0045     DILineInfo getLineInfoForAddress(
0046         object::SectionedAddress Address,
0047         DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
0048     DILineInfo
0049     getLineInfoForDataAddress(object::SectionedAddress Address) override;
0050     DILineInfoTable getLineInfoForAddressRange(
0051         object::SectionedAddress Address, uint64_t Size,
0052         DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
0053     DIInliningInfo getInliningInfoForAddress(
0054         object::SectionedAddress Address,
0055         DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
0056 
0057     std::vector<DILocal>
0058     getLocalsForAddress(object::SectionedAddress Address) override;
0059 
0060   private:
0061     std::string getFunctionName(uint64_t Address, DINameKind NameKind) const;
0062     std::unique_ptr<IPDBSession> Session;
0063   };
0064 
0065 } // end namespace pdb
0066 
0067 } // end namespace llvm
0068 
0069 #endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H