blob: b243f605c95a791ed0f17db81dc2e2c095b506e6 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_DEVELOPER_DEBUG_DEBUG_AGENT_PROCESS_HANDLE_OBSERVER_H_
#define SRC_DEVELOPER_DEBUG_DEBUG_AGENT_PROCESS_HANDLE_OBSERVER_H_
#include <memory>
namespace debug_agent {
class ExceptionHandle;
// Callback interface used by ProcessHandle to notify about events. This is like the native
// ZirconExceptionWatcher but adapted to use the abstract ExceptionHandle types.
class ProcessHandleObserver {
public:
virtual void OnProcessTerminated() = 0;
virtual void OnThreadStarting(std::unique_ptr<ExceptionHandle> exception) = 0;
virtual void OnThreadExiting(std::unique_ptr<ExceptionHandle> exception) = 0;
virtual void OnException(std::unique_ptr<ExceptionHandle> exception) = 0;
// Linux only (Fuchsia process launches are detected on jobs). This is called on the process
// executing the fork and is passed the newly forked process.
virtual void OnProcessStarting(std::unique_ptr<ProcessHandle> new_process_handle) = 0;
};
} // namespace debug_agent
#endif // SRC_DEVELOPER_DEBUG_DEBUG_AGENT_PROCESS_HANDLE_OBSERVER_H_