mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-10 16:23:05 +00:00
Fix QT build (hopefully)
This commit is contained in:
parent
33dee2d287
commit
eeb9667726
@ -315,7 +315,40 @@ const char *SymbolMap::GetDescription(unsigned int address) const
|
||||
return descriptionTemp;
|
||||
}
|
||||
|
||||
std::vector<SymbolEntry> SymbolMap::GetAllSymbols(SymbolType symmask)
|
||||
{
|
||||
std::vector<SymbolEntry> result;
|
||||
|
||||
if (symmask & ST_FUNCTION)
|
||||
{
|
||||
for (auto it = functions.begin(); it != functions.end(); it++)
|
||||
{
|
||||
SymbolEntry entry;
|
||||
entry.address = it->first;
|
||||
entry.size = GetFunctionSize(entry.address);
|
||||
const char* name = GetLabelName(entry.address);
|
||||
if (name != NULL)
|
||||
entry.name = name;
|
||||
result.push_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (symmask & ST_DATA)
|
||||
{
|
||||
for (auto it = data.begin(); it != data.end(); it++)
|
||||
{
|
||||
SymbolEntry entry;
|
||||
entry.address = it->first;
|
||||
entry.size = GetDataSize(entry.address);
|
||||
const char* name = GetLabelName(entry.address);
|
||||
if (name != NULL)
|
||||
entry.name = name;
|
||||
result.push_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void SymbolMap::AddFunction(const char* name, u32 address, u32 size)
|
||||
|
@ -36,6 +36,13 @@ struct SymbolInfo {
|
||||
u32 size;
|
||||
};
|
||||
|
||||
struct SymbolEntry
|
||||
{
|
||||
std::string name;
|
||||
u32 address;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
enum DataType { DATATYPE_NONE, DATATYPE_BYTE, DATATYPE_HALFWORD, DATATYPE_WORD };
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -57,6 +64,7 @@ public:
|
||||
bool GetSymbolInfo(SymbolInfo *info, u32 address, SymbolType symmask = ST_FUNCTION) const;
|
||||
u32 GetNextSymbolAddress(u32 address, SymbolType symmask);
|
||||
const char *GetDescription(unsigned int address) const;
|
||||
std::vector<SymbolEntry> GetAllSymbols(SymbolType symmask);
|
||||
|
||||
#ifdef _WIN32
|
||||
void FillSymbolListBox(HWND listbox, SymbolType symType) const;
|
||||
|
@ -144,7 +144,7 @@ void QtHost::PrepareShutdown()
|
||||
|
||||
void QtHost::AddSymbol(std::string name, u32 addr, u32 size, int type=0)
|
||||
{
|
||||
symbolMap.AddSymbol(name.c_str(), addr, size, (SymbolType)type);
|
||||
|
||||
}
|
||||
|
||||
bool QtHost::IsDebuggingEnabled()
|
||||
|
@ -200,20 +200,20 @@ void CtrlDisAsmView::RunToHere()
|
||||
|
||||
void CtrlDisAsmView::RenameFunction()
|
||||
{
|
||||
int sym = symbolMap.GetSymbolNum(selection);
|
||||
if (sym != -1)
|
||||
{
|
||||
QString name = symbolMap.GetSymbolName(sym);
|
||||
bool ok;
|
||||
QString newname = QInputDialog::getText(this, tr("New function name"),
|
||||
tr("New function name:"), QLineEdit::Normal,
|
||||
name, &ok);
|
||||
if (ok && !newname.isEmpty())
|
||||
{
|
||||
symbolMap.SetSymbolName(sym,newname.toStdString().c_str());
|
||||
redraw();
|
||||
parentWindow->NotifyMapLoaded();
|
||||
}
|
||||
u32 funcBegin = symbolMap.GetFunctionStart(curAddress);
|
||||
if (funcBegin != -1)
|
||||
{
|
||||
QString name = symbolMap.GetLabelName(funcBegin);
|
||||
bool ok;
|
||||
QString newname = QInputDialog::getText(this, tr("New function name"),
|
||||
tr("New function name:"), QLineEdit::Normal,
|
||||
name, &ok);
|
||||
if (ok && !newname.isEmpty())
|
||||
{
|
||||
symbolMap.SetLabelName(newname.toStdString().c_str(),funcBegin);
|
||||
redraw();
|
||||
parentWindow->NotifyMapLoaded();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -145,7 +145,7 @@ void CtrlMemView::paintEvent(QPaintEvent *)
|
||||
|
||||
case MV_SYMBOLS:
|
||||
{
|
||||
textPen.setColor(0x0000FF);
|
||||
/* textPen.setColor(0x0000FF);
|
||||
painter.setPen(textPen);
|
||||
int fn = symbolMap.GetSymbolNum(address);
|
||||
if (fn==-1)
|
||||
@ -174,7 +174,7 @@ void CtrlMemView::paintEvent(QPaintEvent *)
|
||||
sprintf(temp, "%04x [%s]", value, symbolMap.GetSymbolName(symbolnum));
|
||||
}
|
||||
|
||||
painter.drawText(85,rowY1 - 2 + rowHeight, temp);
|
||||
painter.drawText(85,rowY1 - 2 + rowHeight, temp);*/
|
||||
break;
|
||||
}
|
||||
case MV_MAX: break;
|
||||
|
@ -287,15 +287,13 @@ void Debugger_Disasm::FillFunctions()
|
||||
item->setData(Qt::UserRole, 0x02000000);
|
||||
ui->FuncList->addItem(item);
|
||||
|
||||
for(int i = 0; i < symbolMap.GetNumSymbols(); i++)
|
||||
{
|
||||
if(symbolMap.GetSymbolType(i) & ST_FUNCTION)
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString("%1 (%2)").arg(symbolMap.GetSymbolName(i)).arg(symbolMap.GetSymbolSize(i)));
|
||||
item->setData(Qt::UserRole, symbolMap.GetAddress(i));
|
||||
ui->FuncList->addItem(item);
|
||||
}
|
||||
std::vector<SymbolEntry> symbols = symbolMap.GetAllSymbols(ST_FUNCTION);
|
||||
for(int i = 0; i < (int)symbols.size(); i++)
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString("%1 (%2)").arg(QString::fromStdString(symbols[i].name)).arg(symbols[i].size));
|
||||
item->setData(Qt::UserRole, symbols[i].address);
|
||||
ui->FuncList->addItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,16 +59,14 @@ void Debugger_Memory::NotifyMapLoaded()
|
||||
item->setData(Qt::UserRole, 0x80000000);
|
||||
ui->symbols->addItem(item);
|
||||
|
||||
for(int i = 0; i < symbolMap.GetNumSymbols(); i++)
|
||||
{
|
||||
if(symbolMap.GetSymbolType(i) & ST_DATA)
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString(symbolMap.GetSymbolName(i)) + " ("+ QString::number(symbolMap.GetSymbolSize(i)) +")");
|
||||
item->setData(Qt::UserRole, symbolMap.GetAddress(i));
|
||||
ui->symbols->addItem(item);
|
||||
}
|
||||
}
|
||||
std::vector<SymbolEntry> symbols = symbolMap.GetAllSymbols(ST_DATA);
|
||||
for(int i = 0; i < (int)symbols.size(); i++)
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem();
|
||||
item->setText(QString("%1 (%2)").arg(QString::fromStdString(symbols[i].name)).arg(symbols[i].size));
|
||||
item->setData(Qt::UserRole, symbols[i].address);
|
||||
ui->symbols->addItem(item);
|
||||
}
|
||||
|
||||
ui->regions->clear();
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user