This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFC] Move Curses interface implementation to own file
ClosedPublic

Authored by teemperor on Dec 3 2019, 12:58 AM.

Details

Summary

The IOHandler class source file is currently around 4600 LOC. However only 200
of these lines are concerned with the actual IOHandler class and the rest are the
implementations for Editline, IOHandlerConfirm and the Curses interface. All these
large features also cause that the IOHandler (which is in Core) has a large set of dependencies
on other parts of LLDB.

This patch splits out the code for the curses interface into its own file. This way
the simple IOHandler code is no longer buried in-between much larger functionalities.

Next up is splitting out the other IOHandlers into their own files and then move them
to more appropriate parts of LLDB.

Diff Detail

Event Timeline

teemperor created this revision.Dec 3 2019, 12:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2019, 12:59 AM
labath accepted this revision.Dec 3 2019, 2:03 AM

Yes, this was long overdue.

lldb/include/lldb/Core/CursesInterface.h
38–51 ↗(On Diff #231838)

Is this class actually used anywhere? Can we delete it and rename this file to a plain IOHandlerCursesGUI.h ?

lldb/source/Commands/CommandObjectGUI.cpp
15

What's up with these random blank lines? It seems everyone is adding them based on some different key... llvm does not use blank lines at all and just relies on clang-format to produce a "reasonable" include block.

This revision is now accepted and ready to land.Dec 3 2019, 2:03 AM
teemperor marked 2 inline comments as done.Dec 3 2019, 2:36 AM
teemperor added inline comments.
lldb/include/lldb/Core/CursesInterface.h
38–51 ↗(On Diff #231838)

Interesting, this is indeed not referenced anywhere. Will remove it and then rename the file. Thanks!

lldb/source/Commands/CommandObjectGUI.cpp
15

I'm getting paid by LOC

teemperor updated this revision to Diff 231873.Dec 3 2019, 4:29 AM
  • Renamed file to IOHandlerCursesGUI.*
  • Got rid of scary empty line between the includes.
This revision was automatically updated to reflect the committed changes.
lldb/source/Core/CMakeLists.txt