Skip to content

Commit 6a4e9cc

Browse files
committed
[LLDB] Add missing newline to "image lookup" output
When using --name, due to a missing newline, multiple symbol results were not correctly printed: ``` (lldb) image lookup -r -n "As<.*" 2 matches found in <...>/tbi_lisp: Address: tbi_lisp<...> Summary: tbi_lisp<...> at Symbol.cpp:75 Address: tbi_lisp<...> Summary: tbi_lisp<...> at Symbol.cpp:82 ``` It should be: ``` (lldb) image lookup -r -n "As<.*" 2 matches found in /home/david.spickett/tbi_lisp/tbi_lisp: Address: tbi_lisp<...> Summary: tbi_lisp<...> at Symbol.cpp:75 Address: tbi_lisp<...> Summary: tbi_lisp<...> at Symbol.cpp:82 ``` With Address/Summary on separate lines. Reviewed By: clayborg, labath Differential Revision: https://reviews.llvm.org/D143564
1 parent b1883aa commit 6a4e9cc

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,8 @@ static void DumpSymbolContextList(ExecutionContextScope *exe_scope,
15821582
sc.GetAddressRange(eSymbolContextEverything, 0, true, range);
15831583

15841584
DumpAddress(exe_scope, range.GetBaseAddress(), verbose, all_ranges, strm);
1585+
if (i != (num_matches - 1))
1586+
strm.EOL();
15851587
}
15861588
}
15871589
strm.IndentLess();

lldb/test/Shell/Commands/command-target-modules-lookup.test

+7
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@
1010
# CHECK-NEXT: Summary: [[MODULE]]`someOtherFunc()
1111
# CHECK-NEXT: Address: [[MODULE]][0x0000000000000038] ([[MODULE]]..text + 56)
1212
# CHECK-NEXT: Summary: [[MODULE]]`someOtherFunc(double)
13+
14+
# RUN: %lldb %t -b -o "target modules lookup -r -n \".*someFunc\"" | FileCheck %s -DMODULE=%basename_t.tmp --check-prefix CHECKFN
15+
# CHECKFN: 2 matches found in {{.*}}[[MODULE]]:
16+
# CHECKFN-NEXT: Address: [[MODULE]][0x0000000000000000] ([[MODULE]]..text + 0)
17+
# CHECKFN-NEXT: Summary: [[MODULE]]`someFunc(int, int, int)
18+
# CHECKFN-NEXT: Address: [[MODULE]][0x000000000000001c] ([[MODULE]]..text + 28)
19+
# CHECKFN-NEXT: Summary: [[MODULE]]`someFunc(char, int)

0 commit comments

Comments
 (0)