|
LLDB mainline
|
A Windows-specific extension of FileAction that supports HANDLE-based file operations in addition to the standard file descriptor operations. More...
#include <WindowsFileAction.h>
Public Member Functions | |
| WindowsFileAction ()=default | |
| WindowsFileAction (const FileAction &fa) | |
| Allow implicit conversion from a base FileAction. | |
| void | Clear () |
| Reset this WindowsFileAction to its default state. | |
| bool | Duplicate (HANDLE fh, HANDLE dup_fh) |
| Configure this action to duplicate a Windows file handle. | |
| bool | Open (HANDLE fh, const FileSpec &file_spec, bool read, bool write) |
| Configure this action to associate a Windows file handle with a file. | |
| HANDLE | GetHandle () const |
| Get the Windows HANDLE for this action's file. | |
| HANDLE | GetActionArgumentHandle () const |
| Get the Windows HANDLE argument for eFileActionDuplicate actions. | |
| Public Member Functions inherited from lldb_private::FileAction | |
| FileAction () | |
| void | Clear () |
| Reset this FileAction to its default state. | |
| bool | Close (int fd) |
| Configure this action to close a file descriptor. | |
| bool | Duplicate (int fd, int dup_fd) |
| Configure this action to duplicate a file descriptor. | |
| bool | Open (int fd, const FileSpec &file_spec, bool read, bool write) |
| Configure this action to open a file. | |
| int | GetFD () const |
| Get the file descriptor this action applies to. | |
| Action | GetAction () const |
| Get the type of action. | |
| int | GetActionArgument () const |
| Get the action-specific argument. | |
| const FileSpec & | GetFileSpec () const |
| Get the file specification for open actions. | |
| void | Dump (Stream &stream) const |
Private Attributes | |
| HANDLE | m_handle = LLDB_INVALID_PIPE |
| HANDLE | m_arg_handle = LLDB_INVALID_PIPE |
Additional Inherited Members | |
| Public Types inherited from lldb_private::FileAction | |
| enum | Action { eFileActionNone , eFileActionClose , eFileActionDuplicate , eFileActionOpen } |
| Protected Attributes inherited from lldb_private::FileAction | |
| Action | m_action = eFileActionNone |
| The action for this file. | |
| int | m_fd = -1 |
| The file descriptor this action applies to. | |
| int | m_arg = -1 |
| oflag for eFileActionOpen, dup_fd for eFileActionDuplicate. | |
| FileSpec | m_file_spec |
| File spec to use for opening after fork or posix_spawn. | |
A Windows-specific extension of FileAction that supports HANDLE-based file operations in addition to the standard file descriptor operations.
Definition at line 21 of file WindowsFileAction.h.
|
default |
|
inline |
Allow implicit conversion from a base FileAction.
The Windows-specific handle fields default to INVALID_HANDLE_VALUE.
Definition at line 27 of file WindowsFileAction.h.
References lldb_private::FileAction::FileAction().
|
inline |
Reset this WindowsFileAction to its default state.
Definition at line 30 of file WindowsFileAction.h.
References lldb_private::FileAction::Clear(), LLDB_INVALID_PIPE, m_arg_handle, and m_handle.
Referenced by Duplicate(), and Open().
Configure this action to duplicate a Windows file handle.
| [in] | fh | The source file handle to duplicate. |
| [in] | dup_fh | The target file handle. |
Definition at line 17 of file WindowsFileAction.cpp.
References Clear(), lldb_private::FileAction::eFileActionDuplicate, lldb_private::FileAction::m_action, m_arg_handle, and m_handle.
| HANDLE WindowsFileAction::GetActionArgumentHandle | ( | ) | const |
Get the Windows HANDLE argument for eFileActionDuplicate actions.
Definition at line 62 of file WindowsFileAction.cpp.
References m_arg_handle.
Referenced by lldb_private::ProcessLauncherWindows::GetInheritedHandles().
| HANDLE WindowsFileAction::GetHandle | ( | ) | const |
Get the Windows HANDLE for this action's file.
If a HANDLE was stored directly, it is returned. Otherwise, the standard handles for STDIN/STDOUT/STDERR are returned based on the stored fd.
Definition at line 47 of file WindowsFileAction.cpp.
References lldb_private::FileAction::m_fd, and m_handle.
Referenced by lldb_private::ProcessLauncherWindows::GetInheritedHandles().
Configure this action to associate a Windows file handle with a file.
| [in] | fh | The file handle to use for the opened file. |
| [in] | file_spec | The file to open. |
| [in] | read | Open for reading. |
| [in] | write | Open for writing. |
Definition at line 28 of file WindowsFileAction.cpp.
References Clear(), lldb_private::FileAction::eFileActionOpen, lldb_private::FileAction::m_action, lldb_private::FileAction::m_arg, lldb_private::FileAction::m_file_spec, m_handle, and O_NOCTTY.
|
private |
Definition at line 67 of file WindowsFileAction.h.
Referenced by Clear(), Duplicate(), and GetActionArgumentHandle().
|
private |
Definition at line 66 of file WindowsFileAction.h.
Referenced by Clear(), Duplicate(), GetHandle(), and Open().