This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Prevent dwim-print from showing kNoResult error
ClosedPublic

Authored by kastiglione on May 24 2023, 10:36 AM.

Details

Summary

Expression evaluation for void valued expressions sets an error using the kNoResult
code. Like the expression command, dwim-print should also not print such errors.

Before:

(lldb) dwim-print (void)printf("hi\n")
hi
Error: 'unknown error'

After:

(lldb) dwim-print (void)printf("hi\n")
hi

rdar://109746544

Diff Detail

Event Timeline

kastiglione created this revision.May 24 2023, 10:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 10:36 AM
kastiglione requested review of this revision.May 24 2023, 10:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2023, 10:36 AM
aprantl accepted this revision.May 30 2023, 2:19 PM
aprantl added inline comments.
lldb/source/Commands/CommandObjectDWIMPrint.cpp
1

nit: C++ marker is only needed in a .h file ;-)

This revision is now accepted and ready to land.May 30 2023, 2:19 PM