|
LLDB mainline
|
#include <File.h>
Classes | |
| struct | Options |
Public Member Functions | |
| bool | IsValid () const override |
| IsValid. | |
| Status | Close () override |
| Flush any buffers and release any resources owned by the file. | |
| bool | isA (const void *classID) const override |
| Public Member Functions inherited from lldb_private::NativeFilePosix | |
| NativeFilePosix ()=default | |
| NativeFilePosix (FILE *fh, OpenOptions options, bool transfer_ownership) | |
| NativeFilePosix (int fd, OpenOptions options, bool transfer_ownership) | |
| Status | GetFileSpec (FileSpec &file_spec) const override |
| Get the file specification for this file, if possible. | |
| WaitableHandle | GetWaitableHandle () override |
| Get a handle that can be used for OS polling interfaces, such as WaitForMultipleObjects, select, or epoll. | |
| Status | Sync () override |
| Sync to disk. | |
| Status | Read (void *dst, size_t &num_bytes, off_t &offset) override |
| Read bytes from a file from the specified file offset. | |
| Status | Write (const void *src, size_t &num_bytes, off_t &offset) override |
| Write bytes to a file at the specified file offset. | |
| Status | Read (void *buf, size_t &num_bytes) override |
| Read bytes from a file from the current file position into buf. | |
| Status | Write (const void *buf, size_t &num_bytes) override |
| Write bytes from buf to a file at the current file position. | |
| Public Member Functions inherited from lldb_private::NativeFileBase | |
| int | GetDescriptor () const override |
| Get underlying OS file descriptor for this file, or kInvalidDescriptor. | |
| FILE * | GetStream () override |
| Get the underlying libc stream for this file, or NULL. | |
| off_t | SeekFromStart (off_t offset, Status *error_ptr=nullptr) override |
| Seek to an offset relative to the beginning of the file. | |
| off_t | SeekFromCurrent (off_t offset, Status *error_ptr=nullptr) override |
| Seek to an offset relative to the current file position. | |
| off_t | SeekFromEnd (off_t offset, Status *error_ptr=nullptr) override |
| Seek to an offset relative to the end of the file. | |
| Status | Flush () override |
| Flush the current stream. | |
| size_t | PrintfVarArg (const char *format, va_list args) override |
| Output printf formatted output to the stream. | |
| llvm::Expected< OpenOptions > | GetOptions () const override |
| Return the OpenOptions for this file. | |
| Public Member Functions inherited from lldb_private::File | |
| File () | |
| size_t | Printf (const char *format,...) __attribute__((format(printf |
| Output printf formatted output to the stream. | |
| llvm::Expected< const char * > | GetOpenMode () const |
| uint32_t | GetPermissions (Status &error) const |
| Get the permissions for a this file. | |
| bool | GetIsInteractive () |
| Return true if this file is interactive. | |
| bool | GetIsRealTerminal () |
| Return true if this file from a real terminal. | |
| bool | GetIsTerminalWithColors () |
| Return true if this file is a terminal which supports colors. | |
| operator bool () const | |
| bool | operator! () const |
| Public Member Functions inherited from lldb_private::IOObject | |
| IOObject (FDType type) | |
| virtual | ~IOObject () |
| FDType | GetFdType () const |
Static Public Member Functions | |
| static llvm::Expected< Options > | OptionsFromURL (llvm::StringRef urlqs) |
| static llvm::Expected< std::unique_ptr< SerialPort > > | Create (int fd, OpenOptions options, Options serial_options, bool transfer_ownership) |
| static bool | classof (const File *file) |
| Static Public Member Functions inherited from lldb_private::NativeFilePosix | |
| static bool | classof (const File *file) |
| Static Public Member Functions inherited from lldb_private::NativeFileBase | |
| static bool | classof (const File *file) |
| Static Public Member Functions inherited from lldb_private::File | |
| static mode_t | ConvertOpenOptionsForPOSIXOpen (OpenOptions open_options) |
| static llvm::Expected< OpenOptions > | GetOptionsFromMode (llvm::StringRef mode) |
| static bool | DescriptorIsValid (int descriptor) |
| static llvm::Expected< const char * > | GetStreamOpenModeFromOptions (OpenOptions options) |
| static bool | classof (const File *file) |
Static Public Attributes | |
| static char | ID = 0 |
| Static Public Attributes inherited from lldb_private::NativeFilePosix | |
| static char | ID = 0 |
| Static Public Attributes inherited from lldb_private::NativeFileBase | |
| static char | ID = 0 |
| Static Public Attributes inherited from lldb_private::File | |
| static int | kInvalidDescriptor = -1 |
| static FILE * | kInvalidStream = nullptr |
| static constexpr OpenOptions | OpenOptionsModeMask |
| static char | ID = 0 |
| Static Public Attributes inherited from lldb_private::IOObject | |
| static const WaitableHandle | kInvalidHandleValue = -1 |
Private Member Functions | |
| SerialPort (int fd, OpenOptions options, Options serial_options, bool transfer_ownership) | |
| SerialPort (const SerialPort &)=delete | |
| const SerialPort & | operator= (const SerialPort &)=delete |
Private Attributes | |
| TerminalState | m_state |
Additional Inherited Members | |
| Public Types inherited from lldb_private::NativeFileBase | |
| enum | TransferOwnership : bool { Owned = true , Unowned = false } |
| Public Types inherited from lldb_private::File | |
| enum | OpenOptions : uint32_t { eOpenOptionReadOnly = 0x0 , eOpenOptionWriteOnly = 0x1 , eOpenOptionReadWrite = 0x2 , eOpenOptionAppend , eOpenOptionCanCreate = 0x200 , eOpenOptionTruncate = 0x400 , eOpenOptionCanCreateNewOnly , eOpenOptionNonBlocking = (1u << 28) , eOpenOptionDontFollowSymlinks = (1u << 29) , eOpenOptionCloseOnExec , eOpenOptionInvalid = (1u << 31) } |
| Public Types inherited from lldb_private::IOObject | |
| enum | FDType { eFDTypeFile , eFDTypeSocket } |
| using | WaitableHandle = lldb::file_t |
| Protected Member Functions inherited from lldb_private::NativeFilePosix | |
| void | CalculateInteractiveAndTerminal () override |
| Refresh the cached interactive / terminal / color flags by inspecting the underlying descriptor. | |
| Protected Member Functions inherited from lldb_private::NativeFileBase | |
| NativeFileBase () | |
| NativeFileBase (FILE *fh, OpenOptions options, bool transfer_ownership) | |
| NativeFileBase (int fd, OpenOptions options, bool transfer_ownership) | |
| ~NativeFileBase () override | |
| bool | DescriptorIsValidUnlocked () const |
| bool | StreamIsValidUnlocked () const |
| ValueGuard | DescriptorIsValid () const |
| ValueGuard | StreamIsValid () const |
| virtual int | Fileno (FILE *fh) const |
| Map a stream to its underlying file descriptor. | |
| virtual int | Dup (int fd) const |
| Duplicate a file descriptor. | |
| virtual bool | TryWriteStreamUnlocked (const void *buf, size_t &num_bytes, Status &error) |
| Hook for stream writes that bypass the default fwrite path. | |
| Protected Attributes inherited from lldb_private::NativeFileBase | |
| int | m_descriptor = kInvalidDescriptor |
| bool | m_own_descriptor = false |
| std::mutex | m_descriptor_mutex |
| FILE * | m_stream = kInvalidStream |
| std::mutex | m_stream_mutex |
| OpenOptions | m_options {} |
| bool | m_own_stream = false |
| std::mutex | offset_access_mutex |
| Protected Attributes inherited from lldb_private::File | |
| LazyBool | m_is_interactive = eLazyBoolCalculate |
| LazyBool | m_is_real_terminal = eLazyBoolCalculate |
| LazyBool | m_supports_colors = eLazyBoolCalculate |
| Protected Attributes inherited from lldb_private::IOObject | |
| FDType | m_fd_type |
|
private |
Definition at line 720 of file File.cpp.
References m_state.
Referenced by Create(), operator=(), and SerialPort().
|
privatedelete |
References SerialPort().
Definition at line 59 of file File.h.
References ID, and lldb_private::File::isA().
|
overridevirtual |
Flush any buffers and release any resources owned by the file.
After Close() the file will be invalid.
Reimplemented from lldb_private::NativeFileBase.
Definition at line 725 of file File.cpp.
References lldb_private::File::Close(), and m_state.
|
static |
Definition at line 688 of file File.cpp.
References lldb_private::SerialPort::Options::BaudRate, error(), lldb_private::SerialPort::Options::Parity, lldb_private::SerialPort::Options::ParityCheck, SerialPort(), lldb_private::Terminal::SetBaudRate(), lldb_private::Terminal::SetParity(), lldb_private::Terminal::SetParityCheck(), lldb_private::Terminal::SetRaw(), lldb_private::Terminal::SetStopBits(), and lldb_private::SerialPort::Options::StopBits.
Referenced by lldb_private::ConnectionFileDescriptor::ConnectSerialPort().
|
inlineoverridevirtual |
Reimplemented from lldb_private::NativeFilePosix.
Definition at line 56 of file File.h.
References ID, and lldb_private::NativeFilePosix::isA().
|
inlineoverridevirtual |
IsValid.
Reimplemented from lldb_private::NativeFileBase.
Definition at line 49 of file File.h.
References lldb_private::eLazyBoolYes, lldb_private::File::IsValid(), and lldb_private::File::m_is_interactive.
|
privatedelete |
References SerialPort().
|
static |
Definition at line 633 of file File.cpp.
References lldb_private::SerialPort::Options::BaudRate, lldb_private::Terminal::Even, lldb_private::Terminal::Ignore, lldb_private::Terminal::Mark, lldb_private::Terminal::No, lldb_private::Terminal::Odd, lldb_private::SerialPort::Options::Parity, lldb_private::SerialPort::Options::ParityCheck, lldb_private::Terminal::ReplaceWithNUL, lldb_private::Terminal::Space, and lldb_private::SerialPort::Options::StopBits.
Referenced by lldb_private::ConnectionFileDescriptor::ConnectSerialPort().
|
static |
|
private |
Definition at line 68 of file File.h.
Referenced by Close(), and SerialPort().