Detection of C strings does not work well for pointers. If the value object holding a (char*) pointer does not have an address (e.g., if it is a temp), the value is not considered a C string and its formatting is left to DumpDataExtractor rather than the special handling in ValueObject::DumpPrintableRepresentation. This leads to inconsistent outputs, e.g., in escaping non-ASCII characters. See the test for an example; the second test expectation is not met (without this patch). With this patch, the C string detection only insists that the pointer value is valid. The patch makes the code consistent with how the pointer is obtained in ValueObject::ReadPointedString.
LGTM, thanks for tracking this down! I only have a minor comment about the test character.
expect_expr is the modern way to check this:
self.expect_expr("s", result_summary='"🔥"') self.expect_expr("(const char*)s", result_summary='"🔥"')
Could you make this a string like u8"🔥"? "é" is also a valid character in a lot of extended-ASCII character sets (e.g., Latin-1) and we probably should take some unicode-exclusive character and make sure it's utf-8.