This patch fixes random test fails due to UnicodeDecodeError:
... File "lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2070, in runCmd print(self.res.GetError(), file=sbuf) File "lldb/packages/Python/lldbsuite/test/lldbtest.py", line 293, in __exit__ print(self.getvalue(), file=self.session) File "lldb/packages/Python/lldbsuite/support/encoded_file.py", line 34, in impl s = s.decode(encoding) File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xfb in position 257: invalid start byte
This error occurs when we try to decode string that contains garbage, for example:
runCmd: process continue output: Process 579 resuming Process 579 stopped * thread #2, name = 'test_hello_watc', stop reason = watchpoint 1 frame #0: 0x000000000040150f func(char_ptr="\x01$\xad�, new_val='\x01') at main.cpp:40 37 unsigned what = new_val; 38 printf("new value written to location(%p) = %u\n", char_ptr, what); 39 *char_ptr = new_val; -> 40 } 41 42 uint32_t 43 access_pool (bool flag = false)
In such cases we should ignore decoding errors.