Tamas Berghammer 963ce483b8 Add support for the DWP debug info format
Summary:
The DWP (DWARF package) format is used to pack multiple dwo files
generated by split-dwarf into a single ELF file to make distributing
them easier. It is part of the DWARFv5 spec and can be generated by
dwp or llvm-dwp from a set of dwo files.

Caviats:
* Only the new version of the dwp format is supported (v2 in GNU
  numbering schema and v5 in the DWARF spec). The old version (v1) is
  already deprecated but binutils 2.24 still generates that one.
* Combining DWP files with module debugging is not yet supported.

Subscribers: emaste, mgorny, aprantl

Differential Revision: https://reviews.llvm.org/D36062

llvm-svn: 311775
2017-08-25 13:56:14 +00:00

54 lines
1.6 KiB
C++

//===-- SymbolFileDWARFDwp.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
#define SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_
// C Includes
// C++ Includes
#include <memory>
// Other libraries and framework includes
#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
// Project includes
#include "lldb/Core/Module.h"
#include "DWARFDataExtractor.h"
#include "SymbolFileDWARFDwo.h"
class SymbolFileDWARFDwp {
public:
static std::unique_ptr<SymbolFileDWARFDwp>
Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec);
std::unique_ptr<SymbolFileDWARFDwo>
GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu, uint64_t dwo_id);
bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data);
private:
explicit SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
lldb::ObjectFileSP obj_file);
bool LoadRawSectionData(lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data);
lldb::ObjectFileSP m_obj_file;
std::mutex m_sections_mutex;
std::map<lldb::SectionType, lldb_private::DWARFDataExtractor> m_sections;
llvm::DWARFUnitIndex m_debug_cu_index;
std::map<uint64_t, const llvm::DWARFUnitIndex::Entry *> m_debug_cu_index_map;
};
#endif // SymbolFileDWARFDwp_SymbolFileDWARFDwp_h_