Skip to content

Commit f4991bf

Browse files
alvinhochunmstorsjo
authored andcommitted
[lldb] Improve display of absolute symbol lookup
When running `target module lookup` command, show the name of absolute symbols. Also fix indentation issue after printing an absolute symbol. Reviewed By: clayborg, DavidSpickett Differential Revision: https://reviews.llvm.org/D134516
1 parent a426753 commit f4991bf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,12 +1549,16 @@ static uint32_t LookupSymbolInModule(CommandInterpreter &interpreter,
15491549
strm.EOL();
15501550
} else {
15511551
strm.IndentMore();
1552+
strm.Indent(" Name: ");
1553+
strm.PutCString(symbol->GetDisplayName().GetStringRef());
1554+
strm.EOL();
15521555
strm.Indent(" Value: ");
15531556
strm.Printf("0x%16.16" PRIx64 "\n", symbol->GetRawValue());
15541557
if (symbol->GetByteSizeIsValid()) {
15551558
strm.Indent(" Size: ");
15561559
strm.Printf("0x%16.16" PRIx64 "\n", symbol->GetByteSize());
15571560
}
1561+
strm.IndentLess();
15581562
}
15591563
}
15601564
}

lldb/test/Shell/SymbolFile/absolute-symbol.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# RUN: yaml2obj %s -o %t.o
22
# RUN: %lldb -b -o 'target modules lookup -s absolute_symbol' %t.o | FileCheck %s
33
# CHECK: 1 symbols match 'absolute_symbol'
4+
# CHECK: Name: absolute_symbol
45
# CHECK: Value: 0x0000000012345678
56
# Created from:
67
# .globl absolute_symbol

0 commit comments

Comments
 (0)