File indexing completed on 2024-05-12 05:43:33

0001 /*
0002     Copyright (C) 2013-2014 Volker Krause <vkrause@kde.org>
0003 
0004     This program is free software; you can redistribute it and/or modify it
0005     under the terms of the GNU Library General Public License as published by
0006     the Free Software Foundation; either version 2 of the License, or (at your
0007     option) any later version.
0008 
0009     This program is distributed in the hope that it will be useful, but WITHOUT
0010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
0012     License for more details.
0013 
0014     You should have received a copy of the GNU General Public License
0015     along with this program.  If not, see <https://www.gnu.org/licenses/>.
0016 */
0017 
0018 #include "rowcountvisitor.h"
0019 
0020 #include <elf/elffileset.h>
0021 #include <elf/elfgnusymbolversionrequirement.h>
0022 
0023 int RowCountVisitor::doVisit(ElfFileSet* fileSet, int) const
0024 {
0025     return fileSet->size();
0026 }
0027 
0028 int RowCountVisitor::doVisit(ElfFile* file, int) const
0029 {
0030     return file->sectionCount();
0031 }
0032 
0033 int RowCountVisitor::doVisit(ElfSymbolTableSection* symtab, int) const
0034 {
0035     return symtab->header()->entryCount();
0036 }
0037 
0038 int RowCountVisitor::doVisit(ElfDynamicSection* section, int) const
0039 {
0040     return section->header()->entryCount();
0041 }
0042 
0043 int RowCountVisitor::doVisit(ElfGNUSymbolVersionDefinitionsSection* section, int) const
0044 {
0045     return section->entryCount();
0046 }
0047 
0048 int RowCountVisitor::doVisit(ElfGNUSymbolVersionDefinition *verDef, int) const
0049 {
0050     return verDef->auxiliarySize();
0051 }
0052 
0053 int RowCountVisitor::doVisit(ElfGNUSymbolVersionRequirementsSection* section, int) const
0054 {
0055     return section->entryCount();
0056 }
0057 
0058 int RowCountVisitor::doVisit(ElfGNUSymbolVersionRequirement* verNeed, int) const
0059 {
0060     return verNeed->auxiliarySize();
0061 }
0062 
0063 int RowCountVisitor::doVisit(ElfGotSection* section, int) const
0064 {
0065     return section->entryCount();
0066 }
0067 
0068 int RowCountVisitor::doVisit(ElfNoteSection* section, int) const
0069 {
0070     return section->entryCount();
0071 }
0072 
0073 int RowCountVisitor::doVisit(ElfPltSection* section, int) const
0074 {
0075     return section->header()->entryCount();
0076 }
0077 
0078 int RowCountVisitor::doVisit(ElfRelocationSection* section, int) const
0079 {
0080     return section->header()->entryCount();
0081 }
0082 
0083 #if HAVE_DWARF
0084 int RowCountVisitor::doVisit(DwarfInfo* info, int) const
0085 {
0086     return info->compilationUnits().size();
0087 }
0088 
0089 int RowCountVisitor::doVisit(DwarfDie *die, int) const
0090 {
0091     return die->children().size();
0092 }
0093 #endif