[Lldb-commits] [lldb] r337459 - ELF: Replace the header-extension unit test with a lit one

Davide Italiano via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 19 14:27:27 PDT 2018


Nevermind, wrong commit.
On Wed, Sep 19, 2018 at 2:26 PM Davide Italiano <dccitaliano at gmail.com> wrote:
>
> Pavel, I guess this one is yours.
> http://green.lab.llvm.org/green/job/lldb-cmake-clang-6.0.1//484/console
>
> Mind to fix?
>
> FAILED: tools/lldb/unittests/ObjectFile/ELF/ObjectFileELFTests : &&
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/host-compiler/bin/clang++
> -fPIC -fvisibility-inlines-hidden -Werror=date-time
> -Werror=unguarded-availability-new -std=c++11 -fmodules
> -fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/module.cache
> -fcxx-modules -Wall -Wextra -Wno-unused-parameter -Wwrite-strings
> -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long
> -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor
> -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color
> -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing
> -Wno-deprecated-register -Wno-vla-extension -O3
> -Wl,-search_paths_first -Wl,-headerpad_max_install_names
> -Wl,-dead_strip
> tools/lldb/unittests/ObjectFile/ELF/CMakeFiles/ObjectFileELFTests.dir/TestObjectFileELF.cpp.o
> -o tools/lldb/unittests/ObjectFile/ELF/ObjectFileELFTests
> -F/System/Library/PrivateFrameworks lib/libLLVMSupport.a
> lib/libgtest_main.a lib/libgtest.a lib/liblldbPluginObjectFileELF.a
> lib/liblldbPluginSymbolVendorELF.a lib/liblldbCore.a
> lib/liblldbUtilityHelpers.a -lpthread lib/liblldbHost.a
> lib/liblldbSymbol.a lib/liblldbTarget.a lib/liblldbBreakpoint.a
> lib/liblldbDataFormatters.a lib/liblldbExpression.a
> lib/liblldbInterpreter.a lib/liblldbPluginProcessUtility.a
> lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a
> lib/liblldbHostMacOSXObjCXX.a lib/liblldbPluginExpressionParserClang.a
> lib/liblldbPluginExpressionParserGo.a
> lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a
> lib/liblldbPluginObjectFileJIT.a lib/liblldbCommands.a
> lib/liblldbPluginClangCommon.a lib/liblldbPluginAppleObjCRuntime.a
> lib/liblldbCore.a lib/liblldbHost.a lib/liblldbSymbol.a
> lib/liblldbTarget.a lib/liblldbBreakpoint.a
> lib/liblldbDataFormatters.a lib/liblldbExpression.a
> lib/liblldbInterpreter.a lib/liblldbPluginProcessUtility.a
> lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a
> lib/liblldbHostMacOSXObjCXX.a lib/liblldbPluginExpressionParserClang.a
> lib/liblldbPluginExpressionParserGo.a
> lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a
> lib/liblldbPluginObjectFileJIT.a lib/liblldbCommands.a
> lib/liblldbPluginClangCommon.a lib/liblldbPluginAppleObjCRuntime.a
> lib/liblldbCore.a lib/liblldbHost.a lib/liblldbSymbol.a
> lib/liblldbTarget.a lib/liblldbBreakpoint.a
> lib/liblldbDataFormatters.a lib/liblldbExpression.a
> lib/liblldbInterpreter.a lib/liblldbPluginProcessUtility.a
> lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a
> lib/liblldbHostMacOSXObjCXX.a lib/liblldbPluginExpressionParserClang.a
> lib/liblldbPluginExpressionParserGo.a
> lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a
> lib/liblldbPluginObjectFileJIT.a lib/liblldbCommands.a
> lib/liblldbPluginClangCommon.a lib/liblldbPluginAppleObjCRuntime.a
> lib/liblldbCore.a lib/liblldbHost.a lib/liblldbSymbol.a
> lib/liblldbTarget.a lib/liblldbBreakpoint.a
> lib/liblldbDataFormatters.a lib/liblldbExpression.a
> lib/liblldbInterpreter.a lib/liblldbPluginProcessUtility.a
> lib/liblldbPluginCPlusPlusLanguage.a lib/liblldbPluginObjCLanguage.a
> lib/liblldbHostMacOSXObjCXX.a lib/liblldbPluginExpressionParserClang.a
> lib/liblldbPluginExpressionParserGo.a
> lib/liblldbPluginSymbolFileDWARF.a lib/liblldbPluginSymbolFilePDB.a
> lib/liblldbPluginObjectFileJIT.a lib/liblldbCommands.a
> lib/liblldbPluginClangCommon.a lib/liblldbPluginAppleObjCRuntime.a
> lib/libclangCodeGen.a lib/libLLVMCoroutines.a lib/libLLVMCoverage.a
> lib/libLLVMLTO.a lib/libLLVMObjCARCOpts.a lib/libLLVMPasses.a
> lib/libLLVMCodeGen.a lib/libclangRewriteFrontend.a
> lib/libclangFrontend.a lib/libclangDriver.a lib/libclangParse.a
> lib/libLLVMOption.a lib/libclangSerialization.a lib/libclangSema.a
> lib/libclangEdit.a lib/libclangAnalysis.a lib/libclangASTMatchers.a
> lib/libclangRewrite.a lib/libLLVMipo.a lib/libLLVMBitWriter.a
> lib/libLLVMIRReader.a lib/libLLVMAsmParser.a
> lib/libLLVMInstrumentation.a lib/libLLVMLinker.a
> lib/libLLVMScalarOpts.a lib/libLLVMAggressiveInstCombine.a
> lib/libLLVMInstCombine.a lib/libLLVMVectorize.a
> lib/libLLVMTransformUtils.a lib/libLLVMMCJIT.a
> lib/libLLVMExecutionEngine.a lib/libLLVMRuntimeDyld.a
> lib/libLLVMTarget.a lib/libLLVMAnalysis.a lib/libLLVMProfileData.a
> lib/libLLVMDebugInfoDWARF.a lib/libLLVMDebugInfoPDB.a
> lib/libLLVMObject.a lib/libLLVMBitReader.a lib/libLLVMMCParser.a
> lib/liblldbBase.a lib/libclangAST.a lib/libclangLex.a
> lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMMC.a
> lib/libLLVMDebugInfoCodeView.a lib/libLLVMDebugInfoMSF.a
> lib/liblldbUtility.a lib/libLLVMBinaryFormat.a lib/libLLVMSupport.a
> -lz -lm lib/libLLVMDemangle.a -ledit /usr/lib/libpython2.7.dylib
> -lxml2 -framework Foundation -framework CoreFoundation -framework
> CoreServices -framework Security -framework DebugSymbols
> /usr/lib/libcurses.dylib /usr/lib/libform.dylib
> /usr/lib/libpanel.dylib -lcurses && cd
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/tools/lldb/unittests/ObjectFile/ELF
> && /usr/local/Cellar/cmake/3.11.4/bin/cmake -E make_directory
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/tools/lldb/unittests/ObjectFile/ELF/./Inputs
> && cd /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/tools/lldb/unittests/ObjectFile/ELF
> && /usr/local/Cellar/cmake/3.11.4/bin/cmake -E copy
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/llvm/tools/lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/tools/lldb/unittests/ObjectFile/ELF/./Inputs
> && cd /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/tools/lldb/unittests/ObjectFile/ELF
> && /usr/local/Cellar/cmake/3.11.4/bin/cmake -E copy
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/llvm/tools/lldb/unittests/ObjectFile/ELF/Inputs/sections-resolve-consistently.yaml
> /Users/buildslave/jenkins/workspace/lldb-cmake-clang-6.0.1/lldb-build/tools/lldb/unittests/ObjectFile/ELF/./Inputs
> Undefined symbols for architecture x86_64:
> "std::__1::basic_ostream<char, std::__1::char_traits<char>
> >::operator<<(std::nullptr_t)", referenced from:
> std::__1::basic_string<char, std::__1::char_traits<char>,
> std::__1::allocator<char> >
> testing::PrintToString<std::nullptr_t>(std::nullptr_t const&) in
> TestObjectFileELF.cpp.o ld: symbol(s) not found for architecture
> x86_64
> On Thu, Jul 19, 2018 at 7:43 AM Pavel Labath via lldb-commits
> <lldb-commits at lists.llvm.org> wrote:
> >
> > Author: labath
> > Date: Thu Jul 19 07:38:30 2018
> > New Revision: 337459
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=337459&view=rev
> > Log:
> > ELF: Replace the header-extension unit test with a lit one
> >
> > The new test checks that we are actually able to read data from these
> > kinds of elf headers correctly instead of just that we read the section
> > number correctly. It is also easier to figure out what's going on in the
> > test.
> >
> > Added:
> >     lldb/trunk/lit/Modules/elf-many-sections.s
> > Removed:
> >     lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp
> > Modified:
> >     lldb/trunk/lit/Modules/lit.local.cfg
> >     lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt
> >
> > Added: lldb/trunk/lit/Modules/elf-many-sections.s
> > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/elf-many-sections.s?rev=337459&view=auto
> > ==============================================================================
> > --- lldb/trunk/lit/Modules/elf-many-sections.s (added)
> > +++ lldb/trunk/lit/Modules/elf-many-sections.s Thu Jul 19 07:38:30 2018
> > @@ -0,0 +1,72 @@
> > +# REQUIRES: x86
> > +# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
> > +# RUN: lldb-test object-file %t | FileCheck %s
> > +
> > +## Check that we are able to parse ELF files with more than SHN_LORESERVE
> > +## sections. This generates a file that contains 64k sections from
> > +## aaaaaaaa..dddddddd, plus a couple of standard ones (.strtab, etc.)
> > +## Check the number is correct plus the names of a couple of chosen sections.
> > +
> > +# CHECK: Showing 65541 sections
> > +# CHECK: Name: aaaaaaaa
> > +# CHECK: Name: bbbbbbbb
> > +# CHECK: Name: cccccccc
> > +# CHECK: Name: abcdabcd
> > +# CHECK: Name: dddddddd
> > +
> > +.macro gen_sections4 x
> > +  .section a\x
> > +  .section b\x
> > +  .section c\x
> > +  .section d\x
> > +.endm
> > +
> > +.macro gen_sections16 x
> > +  gen_sections4 a\x
> > +  gen_sections4 b\x
> > +  gen_sections4 c\x
> > +  gen_sections4 d\x
> > +.endm
> > +
> > +.macro gen_sections64 x
> > +  gen_sections16 a\x
> > +  gen_sections16 b\x
> > +  gen_sections16 c\x
> > +  gen_sections16 d\x
> > +.endm
> > +
> > +.macro gen_sections256 x
> > +  gen_sections64 a\x
> > +  gen_sections64 b\x
> > +  gen_sections64 c\x
> > +  gen_sections64 d\x
> > +.endm
> > +
> > +.macro gen_sections1024 x
> > +  gen_sections256 a\x
> > +  gen_sections256 b\x
> > +  gen_sections256 c\x
> > +  gen_sections256 d\x
> > +.endm
> > +
> > +.macro gen_sections4096 x
> > +  gen_sections1024 a\x
> > +  gen_sections1024 b\x
> > +  gen_sections1024 c\x
> > +  gen_sections1024 d\x
> > +.endm
> > +
> > +.macro gen_sections16384 x
> > +  gen_sections4096 a\x
> > +  gen_sections4096 b\x
> > +  gen_sections4096 c\x
> > +  gen_sections4096 d\x
> > +.endm
> > +
> > +gen_sections16384 a
> > +gen_sections16384 b
> > +gen_sections16384 c
> > +gen_sections16384 d
> > +
> > +.global _start
> > +_start:
> >
> > Modified: lldb/trunk/lit/Modules/lit.local.cfg
> > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Modules/lit.local.cfg?rev=337459&r1=337458&r2=337459&view=diff
> > ==============================================================================
> > --- lldb/trunk/lit/Modules/lit.local.cfg (original)
> > +++ lldb/trunk/lit/Modules/lit.local.cfg Thu Jul 19 07:38:30 2018
> > @@ -1 +1 @@
> > -config.suffixes = ['.yaml']
> > +config.suffixes = ['.s', '.yaml']
> >
> > Modified: lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt
> > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt?rev=337459&r1=337458&r2=337459&view=diff
> > ==============================================================================
> > --- lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt (original)
> > +++ lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt Thu Jul 19 07:38:30 2018
> > @@ -1,5 +1,4 @@
> >  add_lldb_unittest(ObjectFileELFTests
> > -  TestELFHeader.cpp
> >    TestObjectFileELF.cpp
> >
> >    LINK_LIBS
> >
> > Removed: lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp
> > URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp?rev=337458&view=auto
> > ==============================================================================
> > --- lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp (original)
> > +++ lldb/trunk/unittests/ObjectFile/ELF/TestELFHeader.cpp (removed)
> > @@ -1,62 +0,0 @@
> > -//===-- TestELFHeader.cpp ---------------------------------------*- C++ -*-===//
> > -//
> > -//
> > -//                     The LLVM Compiler Infrastructure
> > -//
> > -// This file is distributed under the University of Illinois Open Source
> > -// License. See LICENSE.TXT for details.
> > -//
> > -//===----------------------------------------------------------------------===//
> > -
> > -#include "Plugins/ObjectFile/ELF/ELFHeader.h"
> > -#include "lldb/Utility/DataExtractor.h"
> > -#include "gtest/gtest.h"
> > -
> > -using namespace lldb;
> > -using namespace lldb_private;
> > -
> > -
> > -TEST(ELFHeader, ParseHeaderExtension) {
> > -  uint8_t data[] = {
> > -      // e_ident
> > -      0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
> > -      0x00, 0x00, 0x00, 0x00,
> > -
> > -      // e_type, e_machine, e_version, e_entry
> > -      0x03, 0x00, 0x3e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x90, 0x48, 0x40, 0x00,
> > -      0x00, 0x00, 0x00, 0x00,
> > -
> > -      // e_phoff, e_shoff
> > -      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
> > -      0x00, 0x00, 0x00, 0x00,
> > -
> > -      // e_flags, e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum,
> > -      // e_shstrndx
> > -      0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x38, 0x00, 0xff, 0xff, 0x40, 0x00,
> > -      0x00, 0x00, 0xff, 0xff,
> > -
> > -      // sh_name, sh_type, sh_flags
> > -      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> > -      0x00, 0x00, 0x00, 0x00,
> > -
> > -      // sh_addr, sh_offset
> > -      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> > -      0x00, 0x00, 0x00, 0x00,
> > -
> > -      // sh_size, sh_link, sh_info
> > -      0x23, 0x45, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x56, 0x78, 0x00,
> > -      0x12, 0x34, 0x56, 0x00,
> > -
> > -      // sh_addralign, sh_entsize
> > -      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> > -      0x00, 0x00, 0x00, 0x00,
> > -  };
> > -
> > -  DataExtractor extractor(data, sizeof data, eByteOrderLittle, 8);
> > -  elf::ELFHeader header;
> > -  offset_t offset = 0;
> > -  ASSERT_TRUE(header.Parse(extractor, &offset));
> > -  EXPECT_EQ(0x563412u, header.e_phnum);
> > -  EXPECT_EQ(0x785634u, header.e_shstrndx);
> > -  EXPECT_EQ(0x674523u, header.e_shnum);
> > -}
> >
> >
> > _______________________________________________
> > lldb-commits mailing list
> > lldb-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


More information about the lldb-commits mailing list