[Lldb-commits] [PATCH] D111355: [lldb] Add serial:// protocol for connecting to serial port

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 20 04:06:19 PDT 2021


labath added inline comments.


================
Comment at: lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp:772-774
+  llvm::Error error = llvm::Error::success();
+  m_io_sp = std::make_shared<SerialPort>(fd, File::eOpenOptionReadWrite,
+                                         serial_options.get(), true, error);
----------------
It would be better to hide this by making the constructor private and have a static factory function returning `Expected<unique_ptr<SerialPort>>`. Bonus points if you can move all the fallible operations into the factory function so that the (now private) constructor does not need the Error argument at all


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111355/new/

https://reviews.llvm.org/D111355



More information about the lldb-commits mailing list