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

LibSymbolication+SystemMonitor: Show ELF object in stack

This small patch allows SystemMonitor's Stack tab to show the name of
the ELF object to which the displayed address refers to. This gives a
bit more of contextual information to the viewer.

A better to show this is probably a table, but I'm not that familiar yet
with the GUI framework in general, so I'm keeping things simple.
This commit is contained in:
Rodrigo Tobar 2021-09-28 23:59:50 +08:00 committed by Andreas Kling
parent ee8380edea
commit 840822b8f1
3 changed files with 3 additions and 1 deletions

View file

@ -79,7 +79,7 @@ void ThreadStackWidget::custom_event(Core::CustomEvent& event)
StringBuilder builder; StringBuilder builder;
for (auto& symbol : completion_event.symbols()) { for (auto& symbol : completion_event.symbols()) {
builder.appendff("{:p}", symbol.address); builder.appendff("{:p} {:30s}", symbol.address, symbol.object);
if (!symbol.name.is_empty()) if (!symbol.name.is_empty())
builder.appendff(" {}", symbol.name); builder.appendff(" {}", symbol.name);
builder.append('\n'); builder.append('\n');

View file

@ -121,6 +121,7 @@ Optional<Symbol> symbolicate(String const& path, FlatPtr address)
return Symbol { return Symbol {
.address = address, .address = address,
.name = move(symbol), .name = move(symbol),
.object = LexicalPath::basename(path),
.offset = offset, .offset = offset,
.source_positions = move(positions), .source_positions = move(positions),
}; };

View file

@ -14,6 +14,7 @@ namespace Symbolication {
struct Symbol { struct Symbol {
FlatPtr address { 0 }; FlatPtr address { 0 };
String name {}; String name {};
String object {};
u32 offset { 0 }; u32 offset { 0 };
Vector<Debug::DebugInfo::SourcePosition> source_positions; Vector<Debug::DebugInfo::SourcePosition> source_positions;
}; };