[PATCH] D49379: lldbsuite: ignore decoding errors in _encoded_write

Stella Stamenova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 14:40:50 PDT 2018


stella.stamenova requested changes to this revision.
stella.stamenova added a comment.
This revision now requires changes to proceed.

So I went through the code that leads here and I think long-term we need a better solution.  We don't really want to be losing data from the session logs (which is what this is writing) and we have similar code for handling Unicode decode/encode in the lit code (so we should merge the two).

Having said that, I think there is a short-term solution that is viable:

1. You should use 'replace' rather than 'ignore', so that we can at least see in the log that some characters were lost
2. You should add a comment before the decode along the lines of: `When decoding the string, replace invalid characters with (U+FFFD, ‘REPLACEMENT CHARACTER’). This may result in data loss`


Repository:
  rL LLVM

https://reviews.llvm.org/D49379





More information about the llvm-commits mailing list