[Lldb-commits] [PATCH] D122025: [lldb] Remove lldbassert from CommandInterpreter::PrintCommandOutput

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 22 03:00:22 PDT 2022


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Agreed we generally don't want to have embedded nuls in the command output, but I don't think we have to go to such great lengths to enforce it.

> The latter doesn't trigger this bug because it writes directly to the output stream and therefore bypasses PrintCommandOutput but that's just an implementation detail.

I guess this would be triggered by `sb_command_return_object.PutOutput("\0")`



================
Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:2988-2994
     size_t chunk_size = 0;
     for (; chunk_size < size; ++chunk_size) {
-      lldbassert(data[chunk_size] != '\0');
       if (data[chunk_size] == '\n') {
         ++chunk_size;
         break;
       }
     }
----------------
I guess this could now be something like `std::tie(line, str) = str.split('\n');`


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122025/new/

https://reviews.llvm.org/D122025



More information about the lldb-commits mailing list