mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
commit
ed13c21a37
18 changed files with 605 additions and 663 deletions
|
@ -139,13 +139,13 @@ void DisassemblyManager::analyze(u32 address, u32 size = 1024)
|
|||
}
|
||||
|
||||
SymbolInfo info;
|
||||
if (symbolMap.GetSymbolInfo(&info,address) && info.size >= 4)
|
||||
if (symbolMap.GetSymbolInfo(&info,address) && info.type == ST_FUNCTION)
|
||||
{
|
||||
DisassemblyFunction* function = new DisassemblyFunction(info.address,info.size);
|
||||
entries[info.address] = function;
|
||||
address = info.address+info.size;
|
||||
} else {
|
||||
u32 next = symbolMap.GetNextSymbolAddress(address+1);
|
||||
u32 next = symbolMap.GetNextSymbolAddress(address+1,ST_FUNCTION);
|
||||
|
||||
// let's just assume anything otuside a function is a normal opcode
|
||||
DisassemblyOpcode* opcode = new DisassemblyOpcode(address,(next-address)/4);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,15 +24,27 @@
|
|||
#include <map>
|
||||
|
||||
enum SymbolType {
|
||||
ST_NONE=0,
|
||||
ST_FUNCTION=1,
|
||||
ST_DATA=2
|
||||
ST_DATA=2,
|
||||
ST_ALL=3
|
||||
};
|
||||
|
||||
struct SymbolInfo {
|
||||
SymbolType type;
|
||||
u32 address;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
struct SymbolEntry
|
||||
{
|
||||
std::string name;
|
||||
u32 address;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
enum DataType { DATATYPE_NONE, DATATYPE_BYTE, DATATYPE_HALFWORD, DATATYPE_WORD };
|
||||
|
||||
#ifdef _WIN32
|
||||
struct HWND__;
|
||||
typedef struct HWND__ *HWND;
|
||||
|
@ -41,75 +53,64 @@ typedef struct HWND__ *HWND;
|
|||
class SymbolMap {
|
||||
public:
|
||||
SymbolMap() {}
|
||||
void Clear();
|
||||
void SortSymbols();
|
||||
|
||||
bool LoadSymbolMap(const char *filename);
|
||||
void SaveSymbolMap(const char *filename) const;
|
||||
bool LoadNocashSym(const char *ilename);
|
||||
void AddSymbol(const char *symbolname, unsigned int vaddress, size_t size, SymbolType symbol);
|
||||
void RemoveSymbolNum(int symbolnum);
|
||||
void Clear();
|
||||
void AnalyzeBackwards();
|
||||
int GetSymbolNum(unsigned int address, SymbolType symmask=ST_FUNCTION) const;
|
||||
|
||||
SymbolType GetSymbolType(u32 address) const;
|
||||
bool GetSymbolInfo(SymbolInfo *info, u32 address, SymbolType symmask = ST_FUNCTION) const;
|
||||
u32 GetNextSymbolAddress(u32 address);
|
||||
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 symmask=ST_FUNCTION) const;
|
||||
void FillSymbolComboBox(HWND listbox,SymbolType symmask=ST_FUNCTION) const;
|
||||
void FillListBoxBLinks(HWND listbox, int num) const;
|
||||
void FillSymbolListBox(HWND listbox, SymbolType symType) const;
|
||||
void FillSymbolComboBox(HWND listbox,SymbolType symType) const;
|
||||
#endif
|
||||
int GetNumSymbols() const;
|
||||
const char *GetSymbolName(int i) const;
|
||||
void SetSymbolName(int i, const char *newname);
|
||||
void SetSymbolSize(int i, int newSize);
|
||||
u32 GetSymbolSize(int i) const;
|
||||
u32 GetSymbolAddr(int i) const;
|
||||
SymbolType GetSymbolType(int i) const;
|
||||
int FindSymbol(const char *name) const;
|
||||
u32 GetAddress(int num) const;
|
||||
void IncreaseRunCount(int num);
|
||||
unsigned int GetRunCount(int num) const;
|
||||
void SortSymbols();
|
||||
|
||||
void UseFuncSignaturesFile(const char *filename, u32 maxAddress);
|
||||
void CompileFuncSignaturesFile(const char *filename) const;
|
||||
void AddFunction(const char* name, u32 address, u32 size);
|
||||
u32 GetFunctionStart(u32 address) const;
|
||||
int GetFunctionNum(u32 address) const;
|
||||
u32 GetFunctionSize(u32 startAddress) const;
|
||||
bool SetFunctionSize(u32 startAddress, u32 newSize);
|
||||
bool RemoveFunction(u32 startAddress, bool removeName);
|
||||
|
||||
const char* AddLabel(const char* name, u32 address);
|
||||
const char* GetLabelName(u32 address);
|
||||
void AddLabel(const char* name, u32 address);
|
||||
void SetLabelName(const char* name, u32 address);
|
||||
const char* GetLabelName(u32 address) const;
|
||||
bool GetLabelValue(const char* name, u32& dest);
|
||||
private:
|
||||
struct MapEntryUniqueInfo {
|
||||
u32 address;
|
||||
u32 vaddress;
|
||||
u32 size;
|
||||
SymbolType type;
|
||||
|
||||
bool operator < (const MapEntryUniqueInfo &other) const {
|
||||
return vaddress < other.vaddress;
|
||||
}
|
||||
void AddData(u32 address, u32 size, DataType type);
|
||||
u32 GetDataStart(u32 address) const;
|
||||
u32 GetDataSize(u32 startAddress) const;
|
||||
DataType GetDataType(u32 startAddress) const;
|
||||
private:
|
||||
void AssignFunctionIndices();
|
||||
|
||||
struct FunctionEntry
|
||||
{
|
||||
u32 size;
|
||||
int index;
|
||||
};
|
||||
|
||||
struct Label
|
||||
struct LabelEntry
|
||||
{
|
||||
char name[128];
|
||||
};
|
||||
|
||||
struct MapEntry : public MapEntryUniqueInfo {
|
||||
char name[128];
|
||||
u32 unknown;
|
||||
u32 runCount;
|
||||
|
||||
#ifdef BWLINKS
|
||||
std::vector <u32> backwardLinks;
|
||||
#endif
|
||||
void UndecorateName() {
|
||||
// TODO
|
||||
}
|
||||
struct DataEntry
|
||||
{
|
||||
DataType type;
|
||||
u32 size;
|
||||
};
|
||||
|
||||
std::map<u32,Label> labels;
|
||||
std::set<MapEntryUniqueInfo> uniqueEntries;
|
||||
std::vector<MapEntry> entries;
|
||||
std::map<u32, u32> entryRanges;
|
||||
|
||||
std::map<u32,FunctionEntry> functions;
|
||||
std::map<u32,LabelEntry> labels;
|
||||
std::map<u32,DataEntry> data;
|
||||
|
||||
mutable recursive_mutex lock_;
|
||||
};
|
||||
|
||||
|
|
|
@ -592,18 +592,18 @@ bool ElfReader::LoadSymbols()
|
|||
|
||||
if (bRelocate)
|
||||
value += sectionAddrs[sectionIndex];
|
||||
SymbolType symtype = ST_DATA;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case STT_OBJECT:
|
||||
symtype = ST_DATA; break;
|
||||
symbolMap.AddData(value,size,DATATYPE_BYTE);
|
||||
break;
|
||||
case STT_FUNC:
|
||||
symtype = ST_FUNCTION; break;
|
||||
symbolMap.AddFunction(name,value,size);
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
symbolMap.AddSymbol(name, value, size, symtype);
|
||||
hasSymbols = true;
|
||||
//...
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ public:
|
|||
// Add the symbol to the symbol map for debugging.
|
||||
char temp[256];
|
||||
sprintf(temp,"zz_%s", GetFuncName(func.moduleName, func.nid));
|
||||
symbolMap.AddSymbol(temp, func.stubAddr, 8, ST_FUNCTION);
|
||||
symbolMap.AddFunction(temp,func.stubAddr,8);
|
||||
|
||||
// Keep track and actually hook it up if possible.
|
||||
importedFuncs.push_back(func);
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace MIPSAnalyst {
|
|||
u32 addr;
|
||||
for (addr = startAddr; addr <= endAddr; addr+=4) {
|
||||
SymbolInfo syminfo;
|
||||
if (symbolMap.GetSymbolInfo(&syminfo, addr, ST_FUNCTION) && syminfo.size >= 4) {
|
||||
if (symbolMap.GetSymbolInfo(&syminfo, addr, ST_FUNCTION)) {
|
||||
addr = syminfo.address + syminfo.size;
|
||||
continue;
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ namespace MIPSAnalyst {
|
|||
(*iter).size = ((*iter).end-(*iter).start+4);
|
||||
char temp[256];
|
||||
sprintf(temp,"z_un_%08x",(*iter).start);
|
||||
symbolMap.AddSymbol(std::string(temp).c_str(), (*iter).start,(*iter).end-(*iter).start+4,ST_FUNCTION);
|
||||
symbolMap.AddFunction(temp,(*iter).start,(*iter).end-(*iter).start+4);
|
||||
}
|
||||
HashFunctions();
|
||||
}
|
||||
|
|
|
@ -221,8 +221,8 @@ void MIPSDebugInterface::toggleBreakpoint(unsigned int address)
|
|||
int MIPSDebugInterface::getColor(unsigned int address)
|
||||
{
|
||||
int colors[6] = {0xe0FFFF,0xFFe0e0,0xe8e8FF,0xFFe0FF,0xe0FFe0,0xFFFFe0};
|
||||
int n=symbolMap.GetSymbolNum(address);
|
||||
if (n==-1 || symbolMap.GetSymbolSize(n) < 4) return 0xFFFFFF;
|
||||
int n=symbolMap.GetFunctionNum(address);
|
||||
if (n==-1) return 0xFFFFFF;
|
||||
return colors[n%6];
|
||||
}
|
||||
const char *MIPSDebugInterface::getDescription(unsigned int address)
|
||||
|
|
|
@ -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();
|
||||
/*
|
||||
|
|
|
@ -497,10 +497,10 @@ void CtrlDisAsmView::onPaint(WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
if (line.params.size() != 0)
|
||||
TextOutA(hdc,pixelPositions.argumentsStart,rowY1+2,line.params.c_str(),line.params.size());
|
||||
TextOutA(hdc,pixelPositions.argumentsStart,rowY1+2,line.params.c_str(),(int)line.params.size());
|
||||
|
||||
SelectObject(hdc,boldfont);
|
||||
TextOutA(hdc,pixelPositions.opcodeStart,rowY1+2,line.name.c_str(),line.name.size());
|
||||
TextOutA(hdc,pixelPositions.opcodeStart,rowY1+2,line.name.c_str(),(int)line.name.size());
|
||||
SelectObject(hdc,font);
|
||||
|
||||
address += line.totalSize;
|
||||
|
@ -899,17 +899,17 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
|||
break;
|
||||
case ID_DISASM_RENAMEFUNCTION:
|
||||
{
|
||||
int sym = symbolMap.GetSymbolNum(curAddress);
|
||||
if (sym != -1)
|
||||
u32 funcBegin = symbolMap.GetFunctionStart(curAddress);
|
||||
if (funcBegin != -1)
|
||||
{
|
||||
char name[256];
|
||||
std::string newname;
|
||||
strncpy_s(name, symbolMap.GetSymbolName(sym),_TRUNCATE);
|
||||
strncpy_s(name, symbolMap.GetLabelName(funcBegin),_TRUNCATE);
|
||||
if (InputBox_GetString(MainWindow::GetHInstance(), MainWindow::GetHWND(), L"New function name", name, newname))
|
||||
{
|
||||
symbolMap.SetSymbolName(sym, newname.c_str());
|
||||
redraw();
|
||||
symbolMap.SetLabelName(newname.c_str(),funcBegin);
|
||||
SendMessage(GetParent(wnd),WM_DEB_MAPLOADED,0,0);
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -921,17 +921,19 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
|||
case ID_DISASM_REMOVEFUNCTION:
|
||||
{
|
||||
char statusBarTextBuff[256];
|
||||
int sym = symbolMap.GetSymbolNum(curAddress);
|
||||
if (sym != -1)
|
||||
u32 funcBegin = symbolMap.GetFunctionStart(curAddress);
|
||||
if (funcBegin != -1)
|
||||
{
|
||||
u32 funcBegin = symbolMap.GetAddress(sym);
|
||||
int prev = symbolMap.GetSymbolNum(funcBegin - 1);
|
||||
if (prev != -1)
|
||||
u32 prevBegin = symbolMap.GetFunctionStart(funcBegin-1);
|
||||
if (prevBegin != -1)
|
||||
{
|
||||
int expandedSize = symbolMap.GetSymbolSize(prev) + symbolMap.GetSymbolSize(sym);
|
||||
symbolMap.SetSymbolSize(prev, expandedSize);
|
||||
u32 expandedSize = symbolMap.GetFunctionSize(prevBegin)+symbolMap.GetFunctionSize(funcBegin);
|
||||
symbolMap.SetFunctionSize(prevBegin,expandedSize);
|
||||
}
|
||||
symbolMap.RemoveSymbolNum(sym);
|
||||
|
||||
symbolMap.RemoveFunction(funcBegin,true);
|
||||
symbolMap.SortSymbols();
|
||||
|
||||
SendMessage(GetParent(wnd), WM_DEB_MAPLOADED, 0, 0);
|
||||
}
|
||||
else
|
||||
|
@ -945,10 +947,10 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
|||
case ID_DISASM_ADDFUNCTION:
|
||||
{
|
||||
char statusBarTextBuff[256];
|
||||
int sym = symbolMap.GetSymbolNum(curAddress);
|
||||
if (sym != -1)
|
||||
u32 prevBegin = symbolMap.GetFunctionStart(curAddress);
|
||||
if (prevBegin != -1)
|
||||
{
|
||||
if (symbolMap.GetAddress(sym) == curAddress)
|
||||
if (prevBegin == curAddress)
|
||||
{
|
||||
snprintf(statusBarTextBuff,256, "WARNING: There's already a function entry point at this adress");
|
||||
SendMessage(GetParent(wnd), WM_DEB_SETSTATUSBARTEXT, 0, (LPARAM) statusBarTextBuff);
|
||||
|
@ -956,14 +958,15 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
|
|||
else
|
||||
{
|
||||
char symname[128];
|
||||
int prevSize = symbolMap.GetSymbolSize(sym);
|
||||
u32 prevAddr = symbolMap.GetSymbolAddr(sym);
|
||||
int newSize = curAddress - prevAddr;
|
||||
symbolMap.SetSymbolSize(sym, newSize);
|
||||
newSize = prevSize - newSize;
|
||||
u32 prevSize = symbolMap.GetFunctionSize(prevBegin);
|
||||
u32 newSize = curAddress-prevBegin;
|
||||
symbolMap.SetFunctionSize(prevBegin,newSize);
|
||||
|
||||
newSize = prevSize-newSize;
|
||||
snprintf(symname,128,"u_un_%08X",curAddress);
|
||||
symbolMap.AddSymbol(symname, curAddress, newSize, ST_FUNCTION);
|
||||
symbolMap.AddFunction(symname,curAddress,newSize);
|
||||
symbolMap.SortSymbols();
|
||||
|
||||
SendMessage(GetParent(wnd), WM_DEB_MAPLOADED, 0, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -300,24 +300,6 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam)
|
|||
SetTextColor(hdc,0x004000);
|
||||
TextOutA(hdc,77,rowY1,temp,(int)strlen(temp));
|
||||
}
|
||||
|
||||
/*
|
||||
}
|
||||
SetTextColor(hdc,0x007000);
|
||||
|
||||
TextOut(hdc,70,rowY1,dis,strlen(dis));
|
||||
if (desc[0]==0)
|
||||
strcpy(desc,debugger->getDescription(address));
|
||||
SetTextColor(hdc,0x0000FF);
|
||||
//char temp[256];
|
||||
//UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE);
|
||||
if (strlen(desc))
|
||||
TextOut(hdc,280,rowY1,desc,strlen(desc));
|
||||
if (debugger->isBreakpoint(address))
|
||||
{
|
||||
DrawIconEx(hdc,2,rowY1,breakPoint,32,32,0,0,DI_NORMAL);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
SelectObject(hdc,oldFont);
|
||||
|
|
|
@ -513,35 +513,6 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
|||
case IDC_MEMCHECK:
|
||||
SendMessage(m_hDlg,WM_COMMAND,ID_DEBUG_ADDBREAKPOINT,0);
|
||||
break;
|
||||
case IDC_UPDATECALLSTACK:
|
||||
{
|
||||
HWND hDlg = m_hDlg;
|
||||
HWND list = GetDlgItem(hDlg,IDC_CALLSTACK);
|
||||
ComboBox_ResetContent(list);
|
||||
|
||||
u32 pc = currentMIPS->pc;
|
||||
u32 ra = currentMIPS->r[MIPS_REG_RA];
|
||||
DWORD addr = Memory::ReadUnchecked_U32(pc);
|
||||
int count=1;
|
||||
ComboBox_SetItemData(list, ComboBox_AddString(list, ConvertUTF8ToWString(symbolMap.GetDescription(pc)).c_str()), pc);
|
||||
if (symbolMap.GetDescription(pc) != symbolMap.GetDescription(ra))
|
||||
{
|
||||
ComboBox_SetItemData(list, ComboBox_AddString(list, ConvertUTF8ToWString(symbolMap.GetDescription(ra)).c_str()), ra);
|
||||
count++;
|
||||
}
|
||||
//walk the stack chain
|
||||
while (addr != 0xFFFFFFFF && addr!=0 && count++<20)
|
||||
{
|
||||
DWORD fun = Memory::ReadUnchecked_U32(addr+4);
|
||||
const wchar_t *str = ConvertUTF8ToWString(symbolMap.GetDescription(fun)).c_str();
|
||||
if (wcslen(str) == 0)
|
||||
str = L"(unknown)";
|
||||
ComboBox_SetItemData(list, ComboBox_AddString(list,str), fun);
|
||||
addr = Memory::ReadUnchecked_U32(addr);
|
||||
}
|
||||
ComboBox_SetCurSel(list,0);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_GOTOPC:
|
||||
{
|
||||
|
@ -557,18 +528,10 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
|
||||
case IDC_BACKWARDLINKS:
|
||||
{
|
||||
HWND box = GetDlgItem(m_hDlg, IDC_FUNCTIONLIST);
|
||||
int funcnum = symbolMap.GetSymbolNum(ListBox_GetItemData(box,ListBox_GetCurSel(box)));
|
||||
if (funcnum!=-1)
|
||||
symbolMap.FillListBoxBLinks(box,funcnum);
|
||||
break;
|
||||
}
|
||||
|
||||
case IDC_ALLFUNCTIONS:
|
||||
{
|
||||
symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
|
||||
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_GOTOINT),ST_FUNCTION);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -817,6 +780,7 @@ void CDisasm::SetDebugMode(bool _bDebug, bool switchPC)
|
|||
void CDisasm::NotifyMapLoaded()
|
||||
{
|
||||
symbolMap.FillSymbolListBox(GetDlgItem(m_hDlg, IDC_FUNCTIONLIST),ST_FUNCTION);
|
||||
symbolMap.FillSymbolComboBox(GetDlgItem(m_hDlg, IDC_GOTOINT),ST_FUNCTION);
|
||||
CtrlDisAsmView *ptr = CtrlDisAsmView::getFrom(GetDlgItem(m_hDlg,IDC_DISASMVIEW));
|
||||
ptr->clearFunctions();
|
||||
ptr->redraw();
|
||||
|
|
|
@ -250,11 +250,6 @@ void WindowsHost::SaveSymbolMap()
|
|||
symbolMap.SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart.c_str(),".map").c_str());
|
||||
}
|
||||
|
||||
void WindowsHost::AddSymbol(std::string name, u32 addr, u32 size, int type=0)
|
||||
{
|
||||
symbolMap.AddSymbol(name.c_str(), addr, size, (SymbolType)type);
|
||||
}
|
||||
|
||||
bool WindowsHost::IsDebuggingEnabled()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
|
|
@ -40,8 +40,6 @@ public:
|
|||
virtual void UpdateScreen();
|
||||
void SetDebugMode(bool mode);
|
||||
|
||||
void AddSymbol(std::string name, u32 addr, u32 size, int type);
|
||||
|
||||
bool InitGL(std::string *error_message);
|
||||
void PollControllers(InputState &input_state);
|
||||
void ShutdownGL();
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#define IDC_STEPOVER 108
|
||||
#define IDC_TABDATATYPE 109
|
||||
#define IDC_CALLSTACK 110
|
||||
#define IDC_UPDATECALLSTACK 111
|
||||
#define ID_MEMVIEW_GOTOINDISASM 112
|
||||
#define ID_DISASM_DYNARECRESULTS 113
|
||||
#define IDI_PPSSPP 115
|
||||
|
@ -105,7 +104,6 @@
|
|||
#define IDC_GOTOLR 1070
|
||||
#define IDC_GOTOINT 1071
|
||||
#define IDC_MEMSORT 1073
|
||||
#define IDC_BACKWARDLINKS 1074
|
||||
#define IDC_ALLFUNCTIONS 1075
|
||||
#define IDC_RESULTS 1093
|
||||
#define IDC_SYMBOLS 1097
|
||||
|
|
Loading…
Add table
Reference in a new issue