diff options
| author | Alexander Smirnov <[email protected]> | 2025-02-02 00:51:37 +0000 |
|---|---|---|
| committer | Alexander Smirnov <[email protected]> | 2025-02-02 00:51:37 +0000 |
| commit | 7d23e66aa304ad321392002afcb1a32e5f7e5611 (patch) | |
| tree | b5315b621d678ec8b966546aacb352f073b6fced /library/cpp | |
| parent | 5d71ae4a765907bd3a5ae43316348c14acc00deb (diff) | |
| parent | bbd3eacdd0520f608b6290efdd0050d7e55ad40d (diff) | |
Merge branch 'rightlib' into merge-libs-250202-0050
Diffstat (limited to 'library/cpp')
4 files changed, 11 insertions, 26 deletions
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt index 5bc20052bab..7d2d409d371 100644 --- a/library/cpp/tld/tlds-alpha-by-domain.txt +++ b/library/cpp/tld/tlds-alpha-by-domain.txt @@ -1,4 +1,4 @@ -# Version 2025012800, Last Updated Tue Jan 28 07:07:01 2025 UTC +# Version 2025020100, Last Updated Sat Feb 1 07:07:01 2025 UTC AAA AARP ABB diff --git a/library/cpp/yt/backtrace/symbolizers/dummy/dummy_symbolizer.cpp b/library/cpp/yt/backtrace/symbolizers/dummy/dummy_symbolizer.cpp index 19cb41e7951..3b1d37aa028 100644 --- a/library/cpp/yt/backtrace/symbolizers/dummy/dummy_symbolizer.cpp +++ b/library/cpp/yt/backtrace/symbolizers/dummy/dummy_symbolizer.cpp @@ -13,8 +13,8 @@ void SymbolizeBacktrace( for (int index = 0; index < std::ssize(backtrace); ++index) { TRawFormatter<1024> formatter; formatter.AppendNumber(index + 1, 10, 2); - formatter.AppendString(". "); - formatter.AppendNumberAsHexWithPadding(reinterpret_cast<uintptr_t>(backtrace[index]), 12); + formatter.AppendString(". 0x"); + formatter.AppendNumber(reinterpret_cast<uintptr_t>(backtrace[index]), /*radix*/ 16, /*width*/ 12); formatter.AppendString("\n"); frameCallback(formatter.GetBuffer()); } diff --git a/library/cpp/yt/backtrace/symbolizers/dynload/dynload_symbolizer.cpp b/library/cpp/yt/backtrace/symbolizers/dynload/dynload_symbolizer.cpp index 37ebda8e488..ca4b157045b 100644 --- a/library/cpp/yt/backtrace/symbolizers/dynload/dynload_symbolizer.cpp +++ b/library/cpp/yt/backtrace/symbolizers/dynload/dynload_symbolizer.cpp @@ -75,10 +75,10 @@ int GetSymbolInfo(const void* pc, char* buffer, int length) void DumpStackFrameInfo(TBaseFormatter* formatter, const void* pc) { - formatter->AppendString("@ "); + formatter->AppendString("@ 0x"); const int width = (sizeof(void*) == 8 ? 12 : 8) + 2; // +2 for "0x"; 12 for x86_64 because higher bits are always zeroed. - formatter->AppendNumberAsHexWithPadding(reinterpret_cast<uintptr_t>(pc), width); + formatter->AppendNumber(reinterpret_cast<uintptr_t>(pc), 16, width); formatter->AppendString(" "); // Get the symbol from the previous address of PC, // because PC may be in the next function. diff --git a/library/cpp/yt/string/raw_formatter.h b/library/cpp/yt/string/raw_formatter.h index 6956330883b..23ea7f9af08 100644 --- a/library/cpp/yt/string/raw_formatter.h +++ b/library/cpp/yt/string/raw_formatter.h @@ -84,11 +84,12 @@ public: } } - //! Appends a single character and updates the internal cursor. - void AppendChar(char ch) + //! Appends a single character given number of times and updates the internal cursor. + void AppendChar(char ch, int count = 1) { - if (Cursor_ < End_) { + while (Cursor_ < End_ && count > 0) { *Cursor_++ = ch; + count--; } } @@ -97,6 +98,8 @@ public: { int digits = 0; + width = std::min(width, GetBytesRemaining()); + if (radix == 16) { // Optimize output of hex numbers. @@ -140,22 +143,6 @@ public: } } - //! Formats |number| as hexadecimal number and updates the internal cursor. - //! Padding will be added in front if needed. - void AppendNumberAsHexWithPadding(uintptr_t number, int width) - { - char* begin = Cursor_; - AppendString("0x"); - AppendNumber(number, 16); - // Move to right and add padding in front if needed. - if (Cursor_ < begin + width) { - auto delta = begin + width - Cursor_; - std::copy(begin, Cursor_, begin + delta); - std::fill(begin, begin + delta, ' '); - Cursor_ = begin + width; - } - } - //! Formats |guid| and updates the internal cursor. void AppendGuid(TGuid guid) { @@ -185,7 +172,6 @@ private: char* const Begin_; char* Cursor_; char* const End_; - }; template <size_t N> @@ -203,7 +189,6 @@ public: private: char Buffer_[N]; - }; //////////////////////////////////////////////////////////////////////////////// |
