LLDB mainline
Mangled.cpp
Go to the documentation of this file.
1//===-- Mangled.cpp -------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/Core/Mangled.h"
10
18#include "lldb/Utility/Log.h"
20#include "lldb/Utility/Stream.h"
22
23#include "llvm/ADT/StringExtras.h"
24#include "llvm/ADT/StringRef.h"
25#include "llvm/Demangle/Demangle.h"
26#include "llvm/Support/Compiler.h"
27
28#include <mutex>
29#include <optional>
30#include <string>
31#include <string_view>
32#include <utility>
33
34#include <cstdlib>
35#include <cstring>
36using namespace lldb_private;
37
38#pragma mark Mangled
39
40bool Mangled::IsMangledName(llvm::StringRef name) {
42}
43
45 if (name.empty())
47
48 if (name.starts_with("?"))
50
51 if (name.starts_with("_R"))
53
54 if (name.starts_with("_D")) {
55 // A dlang mangled name begins with `_D`, followed by a numeric length. One
56 // known exception is the symbol `_Dmain`.
57 // See `SymbolName` and `LName` in
58 // https://dlang.org/spec/abi.html#name_mangling
59 llvm::StringRef buf = name.drop_front(2);
60 if (!buf.empty() && (llvm::isDigit(buf.front()) || name == "_Dmain"))
62 }
63
64 if (name.starts_with("_Z"))
66
67 // ___Z is a clang extension of block invocations
68 if (name.starts_with("___Z"))
70
71 // Swift's older style of mangling used "_T" as a mangling prefix. This can
72 // lead to false positives with other symbols that just so happen to start
73 // with "_T". To minimize the chance of that happening, we only return true
74 // for select old-style swift mangled names. The known cases are ObjC classes
75 // and protocols. Classes are either prefixed with "_TtC" or "_TtGC".
76 // Protocols are prefixed with "_TtP".
77 if (name.starts_with("_TtC") || name.starts_with("_TtGC") ||
78 name.starts_with("_TtP"))
80
81 // Swift 4.2 used "$S" and "_$S".
82 // Swift 5 and onward uses "$s" and "_$s".
83 // Swift also uses "@__swiftmacro_" as a prefix for mangling filenames.
84 // Embedded Swift introduced "$e" and "_$e" as Swift mangling prefixes.
85 if (name.starts_with("$S") || name.starts_with("_$S") ||
86 name.starts_with("$s") || name.starts_with("_$s") ||
87 name.starts_with("$e") || name.starts_with("_$e") ||
88 name.starts_with("@__swiftmacro_"))
90
92}
93
98
99Mangled::Mangled(llvm::StringRef name) {
100 if (!name.empty())
101 SetValue(ConstString(name));
102}
103
104// Convert to bool operator. This allows code to check any Mangled objects
105// to see if they contain anything valid using code such as:
106//
107// Mangled mangled(...);
108// if (mangled)
109// { ...
110Mangled::operator bool() const { return m_mangled || m_demangled; }
111
112// Clear the mangled and demangled values.
114 m_mangled.Clear();
115 m_demangled.Clear();
116}
117
118// Compare the string values.
123
125 if (name) {
126 if (IsMangledName(name.GetStringRef())) {
127 m_demangled.Clear();
128 m_mangled = name;
129 } else {
130 m_demangled = name;
131 m_mangled.Clear();
132 }
133 } else {
134 m_demangled.Clear();
135 m_mangled.Clear();
136 }
137}
138
139// Local helpers for different demangling implementations.
140static char *GetMSVCDemangledStr(llvm::StringRef M) {
141 char *demangled_cstr = llvm::microsoftDemangle(
142 M, nullptr, nullptr,
143 llvm::MSDemangleFlags(
144 llvm::MSDF_NoAccessSpecifier | llvm::MSDF_NoCallingConvention |
145 llvm::MSDF_NoMemberType | llvm::MSDF_NoVariableType));
146
147 if (Log *log = GetLog(LLDBLog::Demangle)) {
148 if (demangled_cstr && demangled_cstr[0])
149 LLDB_LOGF(log, "demangled msvc: %s -> \"%s\"", M.data(), demangled_cstr);
150 else
151 LLDB_LOGF(log, "demangled msvc: %s -> error", M.data());
152 }
153
154 return demangled_cstr;
155}
156
157static std::pair<char *, DemangledNameInfo>
159 char *demangled_cstr = nullptr;
160
162 llvm::ItaniumPartialDemangler ipd;
163 bool err = ipd.partialDemangle(M);
164 if (!err) {
165 // Default buffer and size (OutputBuffer will realloc in case it's too
166 // small).
167 size_t demangled_size = 80;
168 demangled_cstr = static_cast<char *>(std::malloc(80));
169
170 TrackingOutputBuffer OB(demangled_cstr, demangled_size);
171 demangled_cstr = ipd.finishDemangle(&OB);
172 info = std::move(OB.NameInfo);
173
174 assert(demangled_cstr &&
175 "finishDemangle must always succeed if partialDemangle did");
176 assert(demangled_cstr[OB.getCurrentPosition() - 1] == '\0' &&
177 "Expected demangled_size to return length including trailing null");
178 }
179
180 if (Log *log = GetLog(LLDBLog::Demangle)) {
181 if (demangled_cstr)
182 LLDB_LOGF(log, "demangled itanium: %s -> \"%s\"", M, demangled_cstr);
183 else
184 LLDB_LOGF(log, "demangled itanium: %s -> error: failed to demangle", M);
185
186 if (!info.hasBasename())
187 LLDB_LOGF(log,
188 "demangled itanium: %s -> error: failed to retrieve name info",
189 M);
190 }
191
192 return {demangled_cstr, std::move(info)};
193}
194
195static char *GetRustV0DemangledStr(llvm::StringRef M) {
196 char *demangled_cstr = llvm::rustDemangle(M);
197
198 if (Log *log = GetLog(LLDBLog::Demangle)) {
199 if (demangled_cstr && demangled_cstr[0])
200 LLDB_LOG(log, "demangled rustv0: {0} -> \"{1}\"", M, demangled_cstr);
201 else
202 LLDB_LOG(log, "demangled rustv0: {0} -> error: failed to demangle",
203 static_cast<std::string_view>(M));
204 }
205
206 return demangled_cstr;
207}
208
209static char *GetDLangDemangledStr(llvm::StringRef M) {
210 char *demangled_cstr = llvm::dlangDemangle(M);
211
212 if (Log *log = GetLog(LLDBLog::Demangle)) {
213 if (demangled_cstr && demangled_cstr[0])
214 LLDB_LOG(log, "demangled dlang: {0} -> \"{1}\"", M, demangled_cstr);
215 else
216 LLDB_LOG(log, "demangled dlang: {0} -> error: failed to demangle",
217 static_cast<std::string_view>(M));
218 }
219
220 return demangled_cstr;
221}
222
223// Explicit demangling for scheduled requests during batch processing. This
224// makes use of ItaniumPartialDemangler's rich demangle info
226 SkipMangledNameFn *skip_mangled_name) {
227 // Others are not meant to arrive here. ObjC names or C's main() for example
228 // have their names stored in m_demangled, while m_mangled is empty.
229 assert(m_mangled);
230
231 // Check whether or not we are interested in this name at all.
232 ManglingScheme scheme = GetManglingScheme(m_mangled.GetStringRef());
233 if (skip_mangled_name && skip_mangled_name(m_mangled.GetStringRef(), scheme))
234 return false;
235
236 switch (scheme) {
238 // The current mangled_name_filter would allow llvm_unreachable here.
239 return false;
240
242 // We want the rich mangling info here, so we don't care whether or not
243 // there is a demangled string in the pool already.
244 return context.FromItaniumName(m_mangled);
245
246 case eManglingSchemeMSVC: {
247 // We have no rich mangling for MSVC-mangled names yet, so first try to
248 // demangle it if necessary.
249 if (!m_demangled && !m_mangled.GetMangledCounterpart(m_demangled)) {
250 if (char *d = GetMSVCDemangledStr(m_mangled)) {
251 // Without the rich mangling info we have to demangle the full name.
252 // Copy it to string pool and connect the counterparts to accelerate
253 // later access in GetDemangledName().
254 m_demangled.SetStringWithMangledCounterpart(llvm::StringRef(d),
255 m_mangled);
256 ::free(d);
257 } else {
258 m_demangled.SetCString("");
259 }
260 }
261
262 if (m_demangled.IsEmpty()) {
263 // Cannot demangle it, so don't try parsing.
264 return false;
265 } else {
266 // Demangled successfully, we can try and parse it with
267 // CPlusPlusLanguage::CxxMethodName.
268 return context.FromCxxMethodName(m_demangled);
269 }
270 }
271
273 case eManglingSchemeD:
275 // Rich demangling scheme is not supported
276 return false;
277 }
278 llvm_unreachable("Fully covered switch above!");
279}
280
281// Generate the demangled name on demand using this accessor. Code in this
282// class will need to use this accessor if it wishes to decode the demangled
283// name. The result is cached and will be kept until a new string value is
284// supplied to this object, or until the end of the object's lifetime.
286 if (!m_mangled)
287 return m_demangled;
288
289 // Re-use previously demangled names.
290 if (!m_demangled.IsNull())
291 return m_demangled;
292
293 if (m_mangled.GetMangledCounterpart(m_demangled) && !m_demangled.IsNull())
294 return m_demangled;
295
296 // We didn't already mangle this name, demangle it and if all goes well
297 // add it to our map.
298 char *demangled_name = nullptr;
299 switch (GetManglingScheme(m_mangled.GetStringRef())) {
301 demangled_name = GetMSVCDemangledStr(m_mangled);
302 break;
304 demangled_name = GetItaniumDemangledStr(m_mangled.GetCString()).first;
305 break;
307 demangled_name = GetRustV0DemangledStr(m_mangled);
308 break;
309 case eManglingSchemeD:
310 demangled_name = GetDLangDemangledStr(m_mangled);
311 break;
313 // Demangling a swift name requires the swift compiler. This is
314 // explicitly unsupported on llvm.org.
315 break;
317 // Don't bother demangling anything that isn't mangled.
318 break;
319 }
320
321 if (demangled_name) {
322 m_demangled.SetStringWithMangledCounterpart(demangled_name, m_mangled);
323 free(demangled_name);
324 }
325
326 if (m_demangled.IsNull()) {
327 // Set the demangled string to the empty string to indicate we tried to
328 // parse it once and failed.
329 m_demangled.SetCString("");
330 }
331
332 return m_demangled;
333}
334
335std::optional<DemangledNameInfo> Mangled::ComputeDemangledInfo() const {
336 // Only supported for itanium.
337 if (!m_mangled ||
339 return std::nullopt;
340
341 std::pair<char *, DemangledNameInfo> demangled =
342 GetItaniumDemangledStr(m_mangled.GetCString());
343 free(demangled.first);
344 return std::move(demangled.second);
345}
346
349 return lang->GetDisplayDemangledName(*this);
350 return GetDemangledName();
351}
352
353bool Mangled::NameMatches(const RegularExpression &regex) const {
354 if (m_mangled && regex.Execute(m_mangled.GetStringRef()))
355 return true;
356
357 ConstString demangled = GetDemangledName();
358 return demangled && regex.Execute(demangled.GetStringRef());
359}
360
361// Get the demangled name if there is one, else return the mangled name.
363 if (preference == ePreferMangled && m_mangled)
364 return m_mangled;
365
366 // Call the accessor to make sure we get a demangled name in case it hasn't
367 // been demangled yet...
368 ConstString demangled = GetDemangledName();
369
370 if (preference == ePreferDemangledWithoutArguments) {
372 return lang->GetDemangledFunctionNameWithoutArguments(*this);
373 }
374 }
375 if (preference == ePreferDemangled) {
376 if (demangled)
377 return demangled;
378 return m_mangled;
379 }
380 return demangled;
381}
382
383// Dump a Mangled object to stream "s". We don't force our demangled name to be
384// computed currently (we don't use the accessor).
385void Mangled::Dump(Stream *s) const {
386 if (m_mangled) {
387 *s << ", mangled = " << m_mangled;
388 }
389 if (m_demangled)
390 s->Format(", demangled = {0}", m_demangled.GetStringRef());
391}
392
393// Dumps a debug version of this string with extra object and state information
394// to stream "s".
396 s->Printf("%*p: Mangled mangled = ", static_cast<int>(sizeof(void *) * 2),
397 static_cast<const void *>(this));
398 m_mangled.DumpDebug(s);
399 s->PutCString(", demangled = ");
400 m_demangled.DumpDebug(s);
401}
402
403// We "guess" the language because we can't determine a symbol's language from
404// it's name. For example, a Pascal symbol can be mangled using the C++
405// Itanium scheme, and defined in a compilation unit within the same module as
406// other C++ units. In addition, different targets could have different ways
407// of mangling names from a given language, likewise the compilation units
408// within those targets.
411 // Ask each language plugin to check if the mangled name belongs to it.
412 Language::ForEach([this, &result](Language *l) {
413 if (l->SymbolNameFitsToLanguage(*this)) {
414 result = l->GetLanguageType();
416 }
418 });
419 return result;
420}
421
422// Dump OBJ to the supplied stream S.
423Stream &operator<<(Stream &s, const Mangled &obj) {
424 if (obj.GetMangledName())
425 s << "mangled = '" << obj.GetMangledName() << "'";
426
427 ConstString demangled = obj.GetDemangledName();
428 if (demangled)
429 s << ", demangled = '" << demangled << '\'';
430 else
431 s << ", demangled = <error>";
432 return s;
433}
434
435// When encoding Mangled objects we can get away with encoding as little
436// information as is required. The enumeration below helps us to efficiently
437// encode Mangled objects.
439 /// If the Mangled object has neither a mangled name or demangled name we can
440 /// encode the object with one zero byte using the Empty enumeration.
441 Empty = 0u,
442 /// If the Mangled object has only a demangled name and no mangled named, we
443 /// can encode only the demangled name.
445 /// If the mangle name can calculate the demangled name (it is the
446 /// mangled/demangled counterpart), then we only need to encode the mangled
447 /// name as the demangled name can be recomputed.
449 /// If we have a Mangled object with two different names that are not related
450 /// then we need to save both strings. This can happen if we have a name that
451 /// isn't a true mangled name, but we want to be able to lookup a symbol by
452 /// name and type in the symbol table. We do this for Objective C symbols like
453 /// "OBJC_CLASS_$_NSValue" where the mangled named will be set to
454 /// "OBJC_CLASS_$_NSValue" and the demangled name will be manually set to
455 /// "NSValue". If we tried to demangled the name "OBJC_CLASS_$_NSValue" it
456 /// would fail, but in these cases we want these unrelated names to be
457 /// preserved.
459};
460
461bool Mangled::Decode(const DataExtractor &data, lldb::offset_t *offset_ptr,
462 const StringTableReader &strtab) {
463 m_mangled.Clear();
464 m_demangled.Clear();
465 MangledEncoding encoding = (MangledEncoding)data.GetU8(offset_ptr);
466 switch (encoding) {
467 case Empty:
468 return true;
469
470 case DemangledOnly:
471 m_demangled.SetString(strtab.Get(data.GetU32(offset_ptr)));
472 return true;
473
474 case MangledOnly:
475 m_mangled.SetString(strtab.Get(data.GetU32(offset_ptr)));
476 return true;
477
479 m_mangled.SetString(strtab.Get(data.GetU32(offset_ptr)));
480 m_demangled.SetString(strtab.Get(data.GetU32(offset_ptr)));
481 return true;
482 }
483 return false;
484}
485/// The encoding format for the Mangled object is as follows:
486///
487/// uint8_t encoding;
488/// char str1[]; (only if DemangledOnly, MangledOnly)
489/// char str2[]; (only if MangledAndDemangled)
490///
491/// The strings are stored as null-terminated UTF8 strings and str1 and str2
492/// are only saved if we need them based on the encoding.
493///
494/// Some mangled names have a mangled name that can be demangled by the built
495/// in demanglers. These kinds of mangled objects know when the mangled and
496/// demangled names are the counterparts for each other. This is done because
497/// demangling is very expensive and avoiding demangling the same name twice
498/// saves us a lot of compute time. For these kinds of names we only need to
499/// save the mangled name and have the encoding set to "MangledOnly".
500///
501/// If a mangled object has only a demangled name, then we save only that string
502/// and have the encoding set to "DemangledOnly".
503///
504/// Some mangled objects have both mangled and demangled names, but the
505/// demangled name can not be computed from the mangled name. This is often used
506/// for runtime named, like Objective C runtime V2 and V3 names. Both these
507/// names must be saved and the encoding is set to "MangledAndDemangled".
508///
509/// For a Mangled object with no names, we only need to set the encoding to
510/// "Empty" and not store any string values.
511void Mangled::Encode(DataEncoder &file, ConstStringTable &strtab) const {
512 MangledEncoding encoding = Empty;
513 if (m_mangled) {
514 encoding = MangledOnly;
515 if (m_demangled) {
516 // We have both mangled and demangled names. If the demangled name is the
517 // counterpart of the mangled name, then we only need to save the mangled
518 // name. If they are different, we need to save both.
519 ConstString s;
520 if (!(m_mangled.GetMangledCounterpart(s) && s == m_demangled))
521 encoding = MangledAndDemangled;
522 }
523 } else if (m_demangled) {
524 encoding = DemangledOnly;
525 }
526 file.AppendU8(encoding);
527 switch (encoding) {
528 case Empty:
529 break;
530 case DemangledOnly:
531 file.AppendU32(strtab.Add(m_demangled));
532 break;
533 case MangledOnly:
534 file.AppendU32(strtab.Add(m_mangled));
535 break;
537 file.AppendU32(strtab.Add(m_mangled));
538 file.AppendU32(strtab.Add(m_demangled));
539 break;
540 }
541}
542
544 std::optional<DemangledNameInfo> demangled_info = ComputeDemangledInfo();
545 if (!demangled_info)
546 return {};
547
548 ConstString demangled_name = GetDemangledName();
549 if (!demangled_name)
550 return {};
551
552 const auto &range = demangled_info->BasenameRange;
553 return ConstString(
554 demangled_name.GetStringRef().slice(range.first, range.second));
555}
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition Log.h:375
#define LLDB_LOGF(log,...)
Definition Log.h:389
static char * GetDLangDemangledStr(llvm::StringRef M)
Definition Mangled.cpp:209
static char * GetRustV0DemangledStr(llvm::StringRef M)
Definition Mangled.cpp:195
static std::pair< char *, DemangledNameInfo > GetItaniumDemangledStr(const char *M)
Definition Mangled.cpp:158
MangledEncoding
Definition Mangled.cpp:438
@ MangledAndDemangled
If we have a Mangled object with two different names that are not related then we need to save both s...
Definition Mangled.cpp:458
@ DemangledOnly
If the Mangled object has only a demangled name and no mangled named, we can encode only the demangle...
Definition Mangled.cpp:444
@ Empty
If the Mangled object has neither a mangled name or demangled name we can encode the object with one ...
Definition Mangled.cpp:441
@ MangledOnly
If the mangle name can calculate the demangled name (it is the mangled/demangled counterpart),...
Definition Mangled.cpp:448
static char * GetMSVCDemangledStr(llvm::StringRef M)
Definition Mangled.cpp:140
Many cache files require string tables to store data efficiently.
uint32_t Add(ConstString s)
Add a string into the string table.
A uniqued constant string class.
Definition ConstString.h:40
static int Compare(ConstString lhs, ConstString rhs, const bool case_sensitive=true)
Compare two string objects.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
An binary data encoding class.
Definition DataEncoder.h:42
void AppendU32(uint32_t value)
void AppendU8(uint8_t value)
Append a unsigned integer to the end of the owned data.
An data extractor class.
uint32_t GetU32(lldb::offset_t *offset_ptr) const
Extract a uint32_t value from *offset_ptr.
uint8_t GetU8(lldb::offset_t *offset_ptr) const
Extract a uint8_t value from *offset_ptr.
static void ForEach(llvm::function_ref< IterationAction(Language *)> callback)
Definition Language.cpp:127
static Language * FindPlugin(lldb::LanguageType language)
Definition Language.cpp:84
A class that handles mangled names.
Definition Mangled.h:34
void Encode(DataEncoder &encoder, ConstStringTable &strtab) const
Encode this object into a data encoder object.
Definition Mangled.cpp:511
bool NameMatches(ConstString name) const
Check if "name" matches either the mangled or demangled name.
Definition Mangled.h:166
static int Compare(const Mangled &lhs, const Mangled &rhs)
Compare the mangled string values.
Definition Mangled.cpp:119
static bool IsMangledName(llvm::StringRef name)
Definition Mangled.cpp:40
@ ePreferDemangledWithoutArguments
Definition Mangled.h:39
Mangled()=default
Default constructor.
void DumpDebug(Stream *s) const
Dump a debug description of this object to a Stream s.
Definition Mangled.cpp:395
std::optional< DemangledNameInfo > ComputeDemangledInfo() const
Compute the DemangledNameInfo of the demangled name.
Definition Mangled.cpp:335
ConstString GetMangledName() const
Mangled name get accessor.
Definition Mangled.h:146
bool GetRichManglingInfo(RichManglingContext &context, SkipMangledNameFn *skip_mangled_name)
Get rich mangling information.
Definition Mangled.cpp:225
ConstString GetDemangledName() const
Demangled name get accessor.
Definition Mangled.cpp:285
ConstString GetBaseName() const
Compute the base name (without namespace/class qualifiers) from the demangled name.
Definition Mangled.cpp:543
lldb::LanguageType GuessLanguage() const
Try to guess the language from the mangling.
Definition Mangled.cpp:409
bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr, const StringTableReader &strtab)
Decode a serialized version of this object from data.
Definition Mangled.cpp:461
bool(llvm::StringRef, ManglingScheme) SkipMangledNameFn
Function signature for filtering mangled names.
Definition Mangled.h:199
void SetValue(ConstString name)
Set the string value in this object.
Definition Mangled.cpp:124
ConstString GetName(NamePreference preference=ePreferDemangled) const
Best name get accessor.
Definition Mangled.cpp:362
static Mangled::ManglingScheme GetManglingScheme(llvm::StringRef name)
Try to identify the mangling scheme used.
Definition Mangled.cpp:44
ConstString m_mangled
The mangled version of the name.
Definition Mangled.h:288
ConstString m_demangled
Mutable so we can get it on demand with a const version of this object.
Definition Mangled.h:292
ConstString GetDisplayDemangledName() const
Display demangled name get accessor.
Definition Mangled.cpp:347
void Dump(Stream *s) const
Dump a description of this object to a Stream s.
Definition Mangled.cpp:385
void Clear()
Clear the mangled and demangled values.
Definition Mangled.cpp:113
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
Uniform wrapper for access to rich mangling information from different providers.
bool FromItaniumName(ConstString mangled)
Use the ItaniumPartialDemangler to obtain rich mangling information from the given mangled name.
bool FromCxxMethodName(ConstString demangled)
Use the legacy language parser implementation to obtain rich mangling information from the given dema...
A stream class that can stream formatted output to a file.
Definition Stream.h:28
void Format(const char *format, Args &&... args)
Forwards the arguments to llvm::formatv and writes to the stream.
Definition Stream.h:370
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition Stream.cpp:63
Many cache files require string tables to store data efficiently.
llvm::StringRef Get(uint32_t offset) const
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:338
Stream & operator<<(Stream &s, const Mangled &obj)
uint64_t offset_t
Definition lldb-types.h:86
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
Stores information about where certain portions of a demangled function name begin and end.
bool hasBasename() const
Returns true if this object holds a valid basename range.
An OutputBuffer which keeps a record of where certain parts of a demangled name begin/end (e....
DemangledNameInfo NameInfo
Holds information about the demangled name that is being printed into this buffer.