chromium/third_party/crashpad/crashpad/util/linux/ptrace_broker.cc

// Copyright 2017 The Crashpad Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "util/linux/ptrace_broker.h"

#include <fcntl.h>
#include <limits.h>
#include <string.h>
#include <sys/mman.h>
#include <syscall.h>
#include <unistd.h>

#include <algorithm>

#include "base/check_op.h"
#include "base/memory/page_size.h"
#include "base/posix/eintr_wrapper.h"
#include "third_party/lss/lss.h"
#include "util/linux/scoped_ptrace_attach.h"
#include "util/misc/memory_sanitizer.h"
#include "util/posix/scoped_mmap.h"

namespace crashpad {

namespace {

size_t FormatPID(char* buffer, pid_t pid) {}

}  // namespace

class PtraceBroker::AttachmentsArray {};

PtraceBroker::PtraceBroker(int sock, pid_t pid, bool is_64_bit)
    :{}

PtraceBroker::~PtraceBroker() = default;

void PtraceBroker::SetFileRoot(const char* new_root) {}

int PtraceBroker::Run() {}

int PtraceBroker::RunImpl(AttachmentsArray* attachments) {}

int PtraceBroker::SendError(ExceptionHandlerProtocol::Errno err) {}

int PtraceBroker::SendReadError(ReadError error) {}

int PtraceBroker::SendOpenResult(OpenResult result) {}

int PtraceBroker::SendFileContents(FileHandle handle) {}

void PtraceBroker::TryOpeningMemFile() {}

int PtraceBroker::SendMemory(pid_t pid, VMAddress address, VMSize size) {}

#if defined(MEMORY_SANITIZER)
// MSan doesn't intercept syscall() and doesn't see that buffer is initialized.
__attribute__((no_sanitize("memory")))
#endif  // defined(MEMORY_SANITIZER)
int PtraceBroker::SendDirectory(FileHandle handle) {}

int PtraceBroker::ReceiveAndOpenFilePath(VMSize path_length,
                                         bool is_directory,
                                         ScopedFileHandle* handle) {}

}  // namespace crashpad