@@ -82,16 +82,16 @@ void ObjDumper::printAsStringList(StringRef StringContent,
82
82
continue ;
83
83
}
84
84
W.startLine () << format (" [%6tx] " , CurrentWord - StrContent);
85
- printAsPrintable (W.startLine (), CurrentWord, WordSize);
86
- W.startLine () << ' \n ' ;
85
+ printAsPrintable (W.getOStream (), CurrentWord, WordSize);
86
+ W.getOStream () << ' \n ' ;
87
87
CurrentWord += WordSize + 1 ;
88
88
}
89
89
}
90
90
91
91
void ObjDumper::printFileSummary (StringRef FileStr, object::ObjectFile &Obj,
92
92
ArrayRef<std::string> InputFilenames,
93
93
const object::Archive *A) {
94
- W.startLine () << " \n " ;
94
+ W.getOStream () << " \n " ;
95
95
W.printString (" File" , FileStr);
96
96
W.printString (" Format" , Obj.getFileFormatName ());
97
97
W.printString (" Arch" , Triple::getArchTypeName (Obj.getArch ()));
@@ -163,7 +163,8 @@ void ObjDumper::printSectionsAsString(const object::ObjectFile &Obj,
163
163
for (object::SectionRef Section :
164
164
getSectionRefsByNameOrIndex (Obj, Sections)) {
165
165
StringRef SectionName = unwrapOrError (Obj.getFileName (), Section.getName ());
166
- W.startLine () << " \n String dump of section '" << SectionName << " ':\n " ;
166
+ W.getOStream () << ' \n ' ;
167
+ W.startLine () << " String dump of section '" << SectionName << " ':\n " ;
167
168
168
169
StringRef SectionContent =
169
170
unwrapOrError (Obj.getFileName (), Section.getContents ());
@@ -180,7 +181,8 @@ void ObjDumper::printSectionsAsHex(const object::ObjectFile &Obj,
180
181
for (object::SectionRef Section :
181
182
getSectionRefsByNameOrIndex (Obj, Sections)) {
182
183
StringRef SectionName = unwrapOrError (Obj.getFileName (), Section.getName ());
183
- W.startLine () << " \n Hex dump of section '" << SectionName << " ':\n " ;
184
+ W.getOStream () << ' \n ' ;
185
+ W.startLine () << " Hex dump of section '" << SectionName << " ':\n " ;
184
186
185
187
StringRef SectionContent =
186
188
unwrapOrError (Obj.getFileName (), Section.getContents ());
@@ -196,13 +198,13 @@ void ObjDumper::printSectionsAsHex(const object::ObjectFile &Obj,
196
198
197
199
W.startLine () << format_hex (Section.getAddress () + (SecPtr - SecContent),
198
200
10 );
199
- W.startLine () << ' ' ;
201
+ W.getOStream () << ' ' ;
200
202
for (i = 0 ; TmpSecPtr < SecEnd && i < 4 ; ++i) {
201
203
for (k = 0 ; TmpSecPtr < SecEnd && k < 4 ; k++, TmpSecPtr++) {
202
204
uint8_t Val = *(reinterpret_cast <const uint8_t *>(TmpSecPtr));
203
- W.startLine () << format_hex_no_prefix (Val, 2 );
205
+ W.getOStream () << format_hex_no_prefix (Val, 2 );
204
206
}
205
- W.startLine () << ' ' ;
207
+ W.getOStream () << ' ' ;
206
208
}
207
209
208
210
// We need to print the correct amount of spaces to match the format.
@@ -211,17 +213,17 @@ void ObjDumper::printSectionsAsHex(const object::ObjectFile &Obj,
211
213
// Least, if we cut in a middle of a row, we add the remaining characters,
212
214
// which is (8 - (k * 2)).
213
215
if (i < 4 )
214
- W.startLine () << format (" %*c" , (4 - i) * 8 + (4 - i), ' ' );
216
+ W.getOStream () << format (" %*c" , (4 - i) * 8 + (4 - i), ' ' );
215
217
if (k < 4 )
216
- W.startLine () << format (" %*c" , 8 - k * 2 , ' ' );
218
+ W.getOStream () << format (" %*c" , 8 - k * 2 , ' ' );
217
219
218
220
TmpSecPtr = SecPtr;
219
221
for (i = 0 ; TmpSecPtr + i < SecEnd && i < 16 ; ++i)
220
- W.startLine () << (isPrint (TmpSecPtr[i])
221
- ? static_cast <char >(TmpSecPtr[i])
222
- : ' .' );
222
+ W.getOStream () << (isPrint (TmpSecPtr[i])
223
+ ? static_cast <char >(TmpSecPtr[i])
224
+ : ' .' );
223
225
224
- W.startLine () << ' \n ' ;
226
+ W.getOStream () << ' \n ' ;
225
227
}
226
228
}
227
229
}
0 commit comments