LLDB mainline
MainLoopWindows.h
Go to the documentation of this file.
1//===-- MainLoopWindows.h ---------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H
10#define LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H
11
12#include "lldb/Host/Config.h"
14#include <csignal>
15#include <list>
16#include <vector>
17
18namespace lldb_private {
19
20// Windows-specific implementation of the MainLoopBase class. It can monitor
21// socket descriptors for readability using WSAEventSelect. Non-socket file
22// descriptors are not supported.
24public:
26 ~MainLoopWindows() override;
27
29 const Callback &callback,
30 Status &error) override;
31
32 Status Run() override;
33
34protected:
36
37 void Interrupt() override;
38
39private:
41 llvm::Expected<size_t> Poll();
42
43 struct FdInfo {
44 void *event;
46 };
47 llvm::DenseMap<IOObject::WaitableHandle, FdInfo> m_read_fds;
49};
50
51} // namespace lldb_private
52
53#endif // LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H
static llvm::raw_ostream & error(Stream &strm)
std::unique_ptr< ReadHandle > ReadHandleUP
Definition: MainLoopBase.h:49
std::function< void(MainLoopBase &)> Callback
Definition: MainLoopBase.h:51
llvm::Expected< size_t > Poll()
llvm::DenseMap< IOObject::WaitableHandle, FdInfo > m_read_fds
ReadHandleUP RegisterReadObject(const lldb::IOObjectSP &object_sp, const Callback &callback, Status &error) override
void UnregisterReadObject(IOObject::WaitableHandle handle) override
void ProcessReadObject(IOObject::WaitableHandle handle)
An error handling class.
Definition: Status.h:115
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::IOObject > IOObjectSP
Definition: lldb-forward.h:362