This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Host/Terminal] Fix warnings with termios disabled
ClosedPublic

Authored by mgorny on Oct 27 2021, 9:48 AM.

Details

Diff Detail

Event Timeline

mgorny requested review of this revision.Oct 27 2021, 9:48 AM
mgorny created this revision.
mgorny updated this revision to Diff 383112.Oct 28 2021, 12:07 PM
mgorny retitled this revision from [lldb] [Host/Terminal] Add llvm_unreachable() to appease Windows to [lldb] [Host/Terminal] Fix warnings with termios disabled.
mgorny edited the summary of this revision. (Show Details)

Create the error for !LLDB_ENABLE_TERMIOS via a helper function, as suggested by Nico Weber.

thakis accepted this revision.Oct 28 2021, 6:47 PM

Thanks!

lldb/source/Host/common/Terminal.cpp
39–40

nit: should GetData() even exist if !LLDB_ENABLE_TERMIOS? Looks like it's only called #if LLDB_ENABLE_TERMIOS now. Maybe the whole method definition should be inside an ifdef.

If it should keep existing, either move the !FileDescriptorIsValid() check into the #if inside it (imho preferred), or move all the callers of it outside that #if. The current mix is a bit self-inconsistent.

This revision is now accepted and ready to land.Oct 28 2021, 6:47 PM
mgorny marked an inline comment as done.Oct 29 2021, 12:29 AM
mgorny added inline comments.
lldb/source/Host/common/Terminal.cpp
39–40

I think the goal was to avoid checking LLDB_ENABLE_TERMIOS in the header file, though I'm not sure if it was an explicit goal or one I've implicitly assumed.

I've move the check inside for the time being. We can always change it later.

This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2021, 12:58 AM