mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
Profiler: Show the symbol address in object file
This commit is contained in:
parent
64ccf2196c
commit
4bef63fa6a
Notes:
sideshowbarker
2024-07-18 07:10:27 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/4bef63fa6ad Pull-request: https://github.com/SerenityOS/serenity/pull/9319
|
@ -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 {};
|
||||
|
|
|
@ -24,6 +24,7 @@ public:
|
|||
SelfCount,
|
||||
ObjectName,
|
||||
StackFrame,
|
||||
SymbolAddress,
|
||||
__Count
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue