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

Konstantin Baladurin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 08:12:33 PDT 2018


kbaladurin added a comment.

In https://reviews.llvm.org/D49379#1164975, @labath wrote:

> In https://reviews.llvm.org/D49379#1164949, @kbaladurin wrote:
>
> > Thank you for comments, I've updated patch. I agree that it is not complete solution, maybe better to make all tests unicode safe.
>
>
> I've been debating this with myself yesterday. In the case you encountered, the issue is that the c string we read from the inferior is not valid utf8. This is kind of a problem because it means that it can corrupt subsequent lldb output (most likely the closing `"` character).
>
> One possibility here would be to do the replacement character substitution directly when printing out strings read from inferior memory. However, I couldn't decide for myself whether I want my debugger to mess with these strings or not...


Also I think we can report about decoding errors like gdb does:

  Thread 3 "a.out" hit Breakpoint 1, do_bad_thing_with_location (char_ptr=0x619c20 "\001$\255", <incomplete sequence \373>, new_val=1 '\001') at main.cpp:40
  40	}
  (gdb) x/10xb char_ptr
  0x619c20:	0x01	0x24	0xad	0xfb	0x00	0x00	0x00	0x00
  0x619c28:	0x00	0x00


https://reviews.llvm.org/D49379





More information about the llvm-commits mailing list