[Lldb-commits] [PATCH] D68622: IOHandler: fall back on File::Read if a FILE* isn't available.
Lawrence D'Anna via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 7 18:28:55 PDT 2019
lawrence_danna created this revision.
lawrence_danna added reviewers: JDevlieghere, jasonmolenda, labath, lanza.
Herald added a project: LLDB.
IOHandler needs to read lines of input from a lldb::File.
The way it currently does this using, FILE*, which is something
we want to avoid now. I'd prefer to just replace the FILE* code
with calls to File::Read, but it contains an awkward and
delicate workaround specific to ctrl-C handling on windows, and
it's not clear if or how that workaround would translate to
lldb::File.
So in this patch, we use use the FILE* if it's available, and only
fall back on File::Read if that's the only option.
I think this is a reasonable approach here for two reasons. First
is that interactive terminal support is the one area where FILE*
can't be avoided. We need them for libedit and curses anyway,
and using them here as well is consistent with that pattern.
The second reason is that the comments express a hope that the
underlying windows bug that's being worked around will be fixed one
day, so hopefully when that happens, that whole path can be deleted.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D68622
Files:
lldb/include/lldb/Core/IOHandler.h
lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
lldb/source/Core/IOHandler.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68622.223718.patch
Type: text/x-patch
Size: 4309 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191008/7df2a3e0/attachment.bin>
More information about the lldb-commits
mailing list