DebugServer2
Loading...
Searching...
No Matches
PlatformSessionImpl.h
1//
2// Copyright (c) 2014-present, Facebook, Inc.
3// All rights reserved.
4//
5// This source code is licensed under the University of Illinois/NCSA Open
6// Source License found in the LICENSE file in the root directory of this
7// source tree. An additional grant of patent rights can be found in the
8// PATENTS file in the same directory.
9//
10
11#pragma once
12
13#include "DebugServer2/GDBRemote/DummySessionDelegateImpl.h"
14#include "DebugServer2/GDBRemote/Mixins/FileOperationsMixin.h"
15#include "DebugServer2/GDBRemote/Mixins/ProcessLaunchMixin.h"
16#include "DebugServer2/Utils/MPL.h"
17
18namespace ds2 {
19namespace GDBRemote {
20
22protected:
23 // a struct to help iterate over the process list for onQueryProcessList
24 mutable IterationState<ProcessId> _processIterationState;
25
26public:
28
29protected:
30 ErrorCode onQueryProcessList(Session &session, ProcessInfoMatch const &match,
31 bool first, ProcessInfo &info) const override;
32 ErrorCode onQueryProcessInfoPID(Session &session, ProcessId pid,
33 ProcessInfo &info) const override;
34
35 ErrorCode onExecuteProgram(Session &session, std::string const &command,
36 uint32_t timeout,
37 std::string const &workingDirectory,
38 ProgramResult &result) override;
39
40protected:
41 ErrorCode onQueryUserName(Session &session, UserId const &uid,
42 std::string &name) const override;
43 ErrorCode onQueryGroupName(Session &session, GroupId const &gid,
44 std::string &name) const override;
45
46protected:
47 ErrorCode onLaunchDebugServer(Session &session, std::string const &host,
48 uint16_t &port, ProcessId &pid) override;
49
50private:
51 void updateProcesses(ProcessInfoMatch const &match) const;
52 static bool processMatch(ProcessInfoMatch const &match,
53 ds2::ProcessInfo const &info);
54 static bool nameMatch(ProcessInfoMatch const &match,
55 std::string const &name);
56};
57
61} // namespace GDBRemote
62} // namespace ds2
Definition DummySessionDelegateImpl.h:20
Definition FileOperationsMixin.h:24
Definition PlatformSessionImpl.h:21
Definition ProcessLaunchMixin.h:27
Definition Session.h:22
Definition MPL.h:18
Definition Types.h:220
Definition Types.h:179
Definition Types.h:185
Definition Types.h:204
Definition Types.h:263