本文整理汇总了C++中Symbol::Rename方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::Rename方法的具体用法?C++ Symbol::Rename怎么用?C++ Symbol::Rename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbol
的用法示例。
在下文中一共展示了Symbol::Rename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddKnownSymbol
void PPCSymbolDB::AddKnownSymbol(u32 startAddr, u32 size, const std::string& name,
Symbol::Type type)
{
XFuncMap::iterator iter = functions.find(startAddr);
if (iter != functions.end())
{
// already got it, let's just update name, checksum & size to be sure.
Symbol* tempfunc = &iter->second;
tempfunc->Rename(name);
tempfunc->hash = HashSignatureDB::ComputeCodeChecksum(startAddr, startAddr + size - 4);
tempfunc->type = type;
tempfunc->size = size;
}
else
{
// new symbol. run analyze.
Symbol tf;
tf.Rename(name);
tf.type = type;
tf.address = startAddr;
if (tf.type == Symbol::Type::Function)
{
PPCAnalyst::AnalyzeFunction(startAddr, tf, size);
checksumToFunction[tf.hash].insert(&functions[startAddr]);
}
tf.size = size;
functions[startAddr] = tf;
}
}
示例2: Apply
void RSOView::Apply(PPCSymbolDB* symbol_db) const
{
for (const RSOExport& rso_export : GetExports())
{
u32 address = GetExportAddress(rso_export);
if (address != 0)
{
Symbol* symbol = symbol_db->AddFunction(address);
if (!symbol)
symbol = symbol_db->GetSymbolFromAddr(address);
const std::string export_name = GetExportName(rso_export);
if (symbol)
{
// Function symbol
symbol->Rename(export_name);
}
else
{
// Data symbol
symbol_db->AddKnownSymbol(address, 0, export_name, Symbol::Type::Data);
}
}
}
DEBUG_LOG(SYMBOLS, "RSO(%s): %zu symbols applied", GetName().c_str(), GetExportsCount());
}
示例3: OnRenameSymbol
void CodeViewWidget::OnRenameSymbol()
{
const u32 addr = GetContextAddress();
Symbol* symbol = g_symbolDB.GetSymbolFromAddr(addr);
if (!symbol)
return;
bool good;
QString name =
QInputDialog::getText(this, tr("Rename symbol"), tr("Symbol name:"), QLineEdit::Normal,
QString::fromStdString(symbol->name), &good);
if (good && !name.isEmpty())
{
symbol->Rename(name.toStdString());
emit SymbolsChanged();
Update();
}
}