Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/source/Host/common/Terminal.cpp | ||
---|---|---|
75 | My gut feeling is telling me that this can be simplified somehow… or we could assume tcsetattr() is cheap and just do the change unconditionally. |
lldb/include/lldb/Host/Terminal.h | ||
---|---|---|
23 | If I do that, I can't use it from TerminalState. |
lldb/include/lldb/Host/Terminal.h | ||
---|---|---|
23 | I see. I was expecting that TerminalState was a friend or something. Given the new setup I think it would make sense to make it a friend so that it can use Get/SetData instead of raw tc[gs]etattr calls (and hopefully avoid some ifdefs). |
This causes lots of warnings on Windows, where TERMIOS is false: http://45.33.8.238/win/47744/step_4.txt (look for "Terminal.cpp"). Could you take a look? It looks like return statements are genuinely missing there.
When LLDB_ENABLE_TERMIOS is false, GetData() always returns an error, so the code below should not be reachable. I suppose I could add llvm_unreachable() for that. I'll try that and make a diff if it works.
Maybe it'd be easier to read if you move
return llvm::createStringError(llvm::inconvertibleErrorCode(), "termios support missing in LLDB");
into some function and then do
llvm::Error Terminal::SetCanonical(bool enabled) { #if LLDB_ENABLE_TERMIOS ...actual body... #else return ThatErrorFunction(); #endif `` (etc) in all the functions instead of hiding it in GetData()? Then it's obvious in every function what's going on.
Move this into the protected section