forked from OSchip/llvm-project
Fix a problem where the StringPrinter could be mistaking an empty string for a read error, and reporting spurious 'unable to read data' messages. rdar://19007243
llvm-svn: 222190
This commit is contained in:
parent
6cd8e0c9b0
commit
099263b487
|
@ -566,7 +566,7 @@ ReadUTFBufferAndDumpToStream (const ReadStringAndDumpToStreamOptions& options,
|
|||
else
|
||||
data_read = process_sp->ReadMemoryFromInferior(options.GetLocation(), (char*)buffer_sp->GetBytes(), bufferSPSize, error);
|
||||
|
||||
if (error.Fail() || data_read == 0)
|
||||
if (error.Fail())
|
||||
{
|
||||
options.GetStream()->Printf("unable to read data");
|
||||
return true;
|
||||
|
|
|
@ -73,6 +73,8 @@ class CxxWCharTTestCase(TestBase):
|
|||
self.expect("frame variable mazeltov",
|
||||
substrs = ['(const wchar_t *) mazeltov = ','L"מזל טוב"'])
|
||||
|
||||
self.expect("frame variable ws_NULL",substrs = ['(wchar_t *) ws_NULL = 0x0'])
|
||||
self.expect("frame variable ws_empty",substrs = [' L""'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
import atexit
|
||||
|
|
|
@ -24,5 +24,7 @@ int main (int argc, char const *argv[])
|
|||
Foo<int> foo_x('a');
|
||||
Foo<wchar_t> foo_y(L'a');
|
||||
const wchar_t *mazeltov = L"מזל טוב";
|
||||
wchar_t *ws_NULL = nullptr;
|
||||
wchar_t *ws_empty = L"";
|
||||
return 0; // Set break point at this line.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue