[Lldb-commits] [PATCH] D134516: [lldb] Improve display of absolute symbol lookup

Alvin Wong via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 22 23:52:41 PDT 2022


alvinhochun created this revision.
alvinhochun added reviewers: labath, clayborg.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

When running `target module lookup` command, show the name of absolute
symbols. Also fix indentation issue after printing an absolute symbol.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134516

Files:
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/test/Shell/SymbolFile/absolute-symbol.test


Index: lldb/test/Shell/SymbolFile/absolute-symbol.test
===================================================================
--- lldb/test/Shell/SymbolFile/absolute-symbol.test
+++ lldb/test/Shell/SymbolFile/absolute-symbol.test
@@ -1,6 +1,7 @@
 # RUN: yaml2obj %s -o %t.o
 # RUN: %lldb -b -o 'target modules lookup -s absolute_symbol' %t.o | FileCheck %s
 # CHECK: 1 symbols match 'absolute_symbol'
+# CHECK:   Name: absolute_symbol
 # CHECK:   Value: 0x0000000012345678
 # Created from:
 #   .globl absolute_symbol
Index: lldb/source/Commands/CommandObjectTarget.cpp
===================================================================
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -1549,12 +1549,16 @@
           strm.EOL();
         } else {
           strm.IndentMore();
+          strm.Indent("    Name: ");
+          strm.PutCString(symbol->GetDisplayName().GetStringRef());
+          strm.EOL();
           strm.Indent("    Value: ");
           strm.Printf("0x%16.16" PRIx64 "\n", symbol->GetRawValue());
           if (symbol->GetByteSizeIsValid()) {
             strm.Indent("    Size: ");
             strm.Printf("0x%16.16" PRIx64 "\n", symbol->GetByteSize());
           }
+          strm.IndentLess();
         }
       }
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134516.462396.patch
Type: text/x-patch
Size: 1298 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220923/2db78e37/attachment.bin>


More information about the lldb-commits mailing list