This is an archive of the discontinued LLVM Phabricator instance.

SBDebugger::SetInputFile, SetOutputFile, etc.
ClosedPublic

Authored by lawrence_danna on Sep 28 2019, 12:13 AM.

Details

Summary

Add new methods to SBDebugger to set IO files as SBFiles instead of
as FILE* streams.

In future commits, the FILE* methods will be deprecated and these
will become the primary way to set the debugger I/O streams.

Diff Detail

Repository
rL LLVM

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2019, 12:13 AM

clang-format fix

Looks mostly fine to me. Just a couple of questions inline...

lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
243–244 ↗(On Diff #222285)

self.assertTrue(status.Success())

lldb/source/API/SBDebugger.cpp
296–313 ↗(On Diff #222285)

Any chance we could make this method simply delegate to the SBFile version ?

lldb/source/Core/Debugger.cpp
828–833 ↗(On Diff #222285)

Could we make it so that the validity of the file_sp argument is checked at the SB level? That way you wouldn't need the Status result here. Same goes for stdout and stderr methods.

propagated updates from parent

pushed validity checks out to the SB layer

lawrence_danna marked an inline comment as done.Sep 30 2019, 7:18 PM

assertions instead of exceptions

lawrence_danna marked an inline comment as done.Sep 30 2019, 7:24 PM
lawrence_danna marked an inline comment as done.
labath accepted this revision.Oct 1 2019, 3:07 AM

LGTM. thanks.

lldb/include/lldb/API/SBFile.h
31–36 ↗(On Diff #222538)

All (including private) SB methods should be defined out of line. Otherwise, their implementation becomes a part of the ABI.

This revision is now accepted and ready to land.Oct 1 2019, 3:07 AM
lawrence_danna marked an inline comment as done.

no inlines in the API

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 9:05 PM