The class only supports a single DWARF unit (needed for my new test), and it reimplements chunks of object and symbol file classes. We can just make it use the real thing, save some LOC and get the full feature set. Differential Revision: https://reviews.llvm.org/D90393
27 lines
1.0 KiB
C++
27 lines
1.0 KiB
C++
//===-- YAMLModuleTester.cpp ----------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "TestingSupport/Symbol/YAMLModuleTester.h"
|
|
#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
|
|
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
|
|
#include "TestingSupport/TestUtilities.h"
|
|
#include "lldb/Core/Section.h"
|
|
#include "llvm/ObjectYAML/DWARFEmitter.h"
|
|
|
|
using namespace lldb_private;
|
|
|
|
YAMLModuleTester::YAMLModuleTester(llvm::StringRef yaml_data) {
|
|
llvm::Expected<TestFile> File = TestFile::fromYaml(yaml_data);
|
|
EXPECT_THAT_EXPECTED(File, llvm::Succeeded());
|
|
|
|
m_module_sp = std::make_shared<Module>(File->moduleSpec());
|
|
auto &symfile = *llvm::cast<SymbolFileDWARF>(m_module_sp->GetSymbolFile());
|
|
|
|
m_dwarf_unit = symfile.DebugInfo().GetUnitAtIndex(0);
|
|
}
|