Profiler: Show the symbol address in object file

This commit is contained in:
Ali Mohammad Pur 2021-08-08 03:01:10 +04:30 committed by Ali Mohammad Pur
parent 64ccf2196c
commit 4bef63fa6a
Notes: sideshowbarker 2024-07-18 07:10:27 +09:00
2 changed files with 11 additions and 0 deletions

View file

@ -86,6 +86,8 @@ String ProfileModel::column_name(int column) const
return "Object";
case Column::StackFrame:
return "Stack Frame";
case Column::SymbolAddress:
return "Symbol Address";
default:
VERIFY_NOT_REACHED();
return {};
@ -130,6 +132,14 @@ GUI::Variant ProfileModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
}
return node->symbol();
}
if (index.column() == Column::SymbolAddress) {
if (node->is_root())
return "";
auto library = node->process().library_metadata.library_containing(node->address());
if (!library)
return "";
return String::formatted("{:p} (offset {:p})", node->address(), node->address() - library->base);
}
return {};
}
return {};

View file

@ -24,6 +24,7 @@ public:
SelfCount,
ObjectName,
StackFrame,
SymbolAddress,
__Count
};