llvm.org GIT mirror llvm / 2d07720
Revert "[llvm-readobj] Fix printing format" There is a problem with the formatting on windows build. I need to investigate on this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336061 91177308-0d34-0410-b5e6-96231b3b80d8 Paul Semel 2 years ago
2 changed file(s) with 4 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
+0
-8
test/tools/llvm-readobj/print-section.test less more
None RUN: llvm-readobj -p .text %p/Inputs/elf-groups.x86_64 \
1 RUN: | FileCheck %s
2
3 CHECK: [000000] UH..H....E.
4 CHECK: [00000f] .E.x.E..
5 CHECK: [00001a] ..}..
6 CHECK: [000023] .}..
7 CHECK: [00002b] 1.H...].
32743274 }
32753275 }
32763276
3277 void printAsPrintable(raw_ostream &W, StringRef S) {
3278 for (char C : S)
3279 W << (isprint(C) ? C : '.');
3280 }
3281
32823277 template
32833278 void GNUStyle::printSectionAsString(const ELFO *Obj,
32843279 StringRef SectionName) {
33023297 CurrentWord++;
33033298 continue;
33043299 }
3305 OS << format("[%6tx] ", CurrentWord - SecContent);
3306 printAsPrintable(OS, StringRef(CurrentWord, WordSize));
3307 OS << '\n';
3300 OS << format("[%6tx]", CurrentWord - SecContent);
3301 OS << format(" %.*s\n", WordSize, CurrentWord);
33083302 CurrentWord += WordSize + 1;
33093303 }
33103304 OS.flush();
43664360 W.startLine() << "["
43674361 << to_string(
43684362 format_hex_no_prefix((CurrentWord - SecContent), 6))
4369 << "] ";
4370 printAsPrintable(W.startLine(), StringRef(CurrentWord, WordSize));
4371 W.startLine() << '\n';
4363 << "]";
4364 W.startLine() << format(" %.*s\n", WordSize, CurrentWord);
43724365 CurrentWord += WordSize + 1;
43734366 }
43744367 }