Page MenuHomePhabricator

[lldb] Add -w flag for expressions to print compiler warnings even if expression succeeds.
Needs ReviewPublic

Authored by teemperor on Aug 26 2019, 6:35 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Currently if you evaluate for example "expression int" the user just sees nothing and has no way of knowing what
exactly could have gone wrong. This patch adds a -w flag to the expression command that causes compiler warnings
to be emitted even if the command succeeds. This was the agreed workaround to solve rdar://12788008.

The checkerror flag that was added to lldbtest was necessary as we usually don't check the error output of commands
when they succeed (but we have to do now).

Diff Detail

Event Timeline

teemperor created this revision.Aug 26 2019, 6:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2019, 6:35 AM
teemperor edited the summary of this revision. (Show Details)Aug 26 2019, 6:36 AM
labath added a subscriber: labath.Aug 26 2019, 6:41 AM

You could avoid the business with adding a flag to self.expect (which has enough flags already) by just making this a lit test. :)

JDevlieghere added inline comments.
lldb/include/lldb/Target/Target.h
1106

Is there anyway we could store this and things like the fixed expression in the ExpressionResults and then specify in the EvaluateExpressionOptions whether we want this to be set or not?

shafik added a subscriber: shafik.Aug 26 2019, 2:10 PM
shafik added inline comments.
lldb/source/Expression/UserExpression.cpp
276

Is this just white space?