[Lldb-commits] [PATCH] D70241: [lldb] remove unsigned Stream::operator<< overloads

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 14 06:44:56 PST 2019


labath created this revision.
labath added reviewers: teemperor, JDevlieghere.
Herald added a reviewer: jdoerfert.
Herald added a project: LLDB.

I recently re-discovered that the unsinged stream operators of the
lldb_private::Stream class have a surprising behavior in that they print
the number in hex. This is all the more confusing because the "signed"
versions of those operators behave normally.

Now that, thanks to Raphael, each Stream class has a llvm::raw_ostream
wrapper, I think we should delete most of our formatting capabilities
and just delegate to that. This patch tests the water by just deleting
the operators with the most surprising behavior.

Most of the code using these operators was printing user_id_t values. It
wasn't fully consistent about prefixing them with "0x", but I've tried
to consistenly print it without that prefix, to make it more obviously
different from pointer values.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70241

Files:
  lldb/include/lldb/Utility/Stream.h
  lldb/source/Expression/DWARFExpression.cpp
  lldb/source/Symbol/SymbolContext.cpp
  lldb/source/Symbol/Type.cpp
  lldb/source/Symbol/Variable.cpp
  lldb/source/Utility/Stream.cpp
  lldb/test/Shell/SymbolFile/DWARF/array-sizes.s
  lldb/unittests/Utility/StreamTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70241.229302.patch
Type: text/x-patch
Size: 7189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191114/d8ddf1ed/attachment.bin>


More information about the lldb-commits mailing list