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 #ifndef PARENTVISITOR_H
0019 #define PARENTVISITOR_H
0020 
0021 #include "elfnodevisitor.h"
0022 
0023 #include <QPair>
0024 
0025 class ElfModel;
0026 
0027 class ParentVisitor : public ElfNodeVisitor<QPair<ElfNodeVariant*, int>>
0028 {
0029 public:
0030     explicit ParentVisitor(const ElfModel* model);
0031 
0032 protected:
0033     using ElfNodeVisitor<QPair<ElfNodeVariant*, int>>::doVisit;
0034     type doVisit(ElfFile* file, int) const override;
0035     type doVisit(ElfSection* section, int) const override;
0036     type doVisit(ElfGNUSymbolVersionDefinition* verDef, int) const override;
0037     type doVisit(ElfGNUSymbolVersionRequirement *verNeed, int) const override;
0038     type doVisit(ElfGotEntry *entry, int) const override;
0039     type doVisit(ElfPltEntry *entry, int) const override;
0040     type doVisit(ElfSymbolTableEntry *symbold, int) const override;
0041 #if HAVE_DWARF
0042     type doVisit(DwarfInfo* info, int) const override;
0043     type doVisit(DwarfDie* die, int) const override;
0044 #endif
0045 
0046 private:
0047     type makeParent(void* payload, ElfNodeVariant::Type type, int row) const;
0048 
0049     const ElfModel* const m_model;
0050 };
0051 
0052 #endif // PARENTVISITOR_H