1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

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
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 {};