##// END OF EJS Templates
Elf Symbol enumeration working, elf update buggy!
Elf Symbol enumeration working, elf update buggy!

File last commit:

r42:302baaf8abc1 default
r42:302baaf8abc1 default
Show More
elffilewidget.cpp
81 lines | 2.6 KiB | text/x-c | CppLexer
/ src / common / elf / elffilewidget.cpp
ElfFile classes WIP.
r35 #include "elffilewidget.h"
#include "ui_elffilewidget.h"
Elf Symbol enumeration working, elf update buggy!
r42 #include <QtWidgets/QTableWidgetItem>
ElfFile classes WIP.
r35
elfFileWidget::elfFileWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::elfFileWidget)
{
ui->setupUi(this);
}
elfFileWidget::~elfFileWidget()
{
delete ui;
}
Jeandet Alexis
ElfFile classes WIP.
r36
void elfFileWidget::updateElfFile(ElfFile *file)
{
this->p_elf = file;
if(p_elf->isopened() && p_elf->iself())
{
this->ui->classLabel->setText(p_elf->getClass());
this->ui->VersionLabel->setText(QString::number(p_elf->getVersion()));
this->ui->machineLabel->setText(p_elf->getArchitecture());
this->ui->endiannesLabel->setText(p_elf->getEndianness());
ElfFile classes WIP.
r37 this->ui->abiLabel->setText(p_elf->getABI());
ElfFile classes WIP....
r40 this->ui->entryPointLabel->setText(QString("0x%1").arg((uint)p_elf->getEntryPointAddress(),8,16));
this->ui->typeLabel->setText(p_elf->getType());
this->ui->sectionCountLabel->setText(QString::number(p_elf->getSectionCount()));
Jeandet Alexis
Elf Symbol enumeration WIP.
r41 this->ui->symbolCountLabel->setText(QString::number(p_elf->getSymbolCount()));
Jeandet Alexis
ElfFile classes WIP.
r36 }
Elf Symbol enumeration working, elf update buggy!
r42 updateSymbols();
}
void elfFileWidget::updateSymbols()
{
this->ui->symbolsList->clear();
this->ui->symbolsList->setRowCount(p_elf->getSymbolCount());
this->ui->symbolsList->setHorizontalHeaderLabels(QStringList()<<"Value"<<"Size"<<"Type"<<"Link"<<"Section"<<"Name");
for(int i=0;i<p_elf->getSymbolCount();i++)
{
QTableWidgetItem *newItem = new QTableWidgetItem(QString("0x%1").arg(p_elf->getSymbolAddress(i),8,16));
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
this->ui->symbolsList->setItem(i, 0, newItem);
newItem = new QTableWidgetItem(QString("0x%1").arg(p_elf->getSymbolSize(i),8,16));
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
this->ui->symbolsList->setItem(i, 1, newItem);
newItem = new QTableWidgetItem(p_elf->getSymbolType(i));
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
this->ui->symbolsList->setItem(i, 2, newItem);
newItem = new QTableWidgetItem(p_elf->getSymbolLinkType(i));
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
this->ui->symbolsList->setItem(i, 3, newItem);
newItem = new QTableWidgetItem(p_elf->getSymbolSectionName(i));
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
this->ui->symbolsList->setItem(i, 4, newItem);
newItem = new QTableWidgetItem(p_elf->getSymbolName(i));
newItem->setFlags(newItem->flags() ^ Qt::ItemIsEditable);
this->ui->symbolsList->setItem(i, 5, newItem);
}
this->ui->symbolsList->resizeColumnsToContents();
Jeandet Alexis
ElfFile classes WIP.
r36 }
ElfFile classes WIP.
r37