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
20using handle_t = void *;
21
22// Windows-specific implementation of the MainLoopBase class. It can monitor
23// socket descriptors for readability using WSAEventSelect. Non-socket file
24// descriptors are not supported.
26public:
28 ~MainLoopWindows() override;
29
31 const Callback &callback,
32 Status &error) override;
33
34 Status Run() override;
35
36 class IOEvent {
37 public:
38 IOEvent(handle_t event) : m_event(event) {}
39 virtual ~IOEvent() {}
40 virtual void WillPoll() {}
41 virtual void DidPoll() {}
42 virtual void Disarm() {}
44
45 protected:
47 };
48 using IOEventUP = std::unique_ptr<IOEvent>;
49
50protected:
52
53 void Interrupt() override;
54
55private:
56 llvm::Expected<size_t> Poll();
57
62 llvm::DenseMap<IOObject::WaitableHandle, FdInfo> m_read_fds;
64};
65
66} // namespace lldb_private
67
68#endif // LLDB_HOST_WINDOWS_MAINLOOPWINDOWS_H
static llvm::raw_ostream & error(Stream &strm)
lldb::file_t WaitableHandle
Definition IOObject.h:29
std::unique_ptr< ReadHandle > ReadHandleUP
std::function< void(MainLoopBase &)> Callback
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
std::unique_ptr< IOEvent > IOEventUP
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::IOObject > IOObjectSP