breakpad/src/google_breakpad/processor/proc_maps_linux.h
Mark Mentovai 4febb34583 Update copyright boilerplate, 2022 edition (Breakpad)
sed -i '' -E -e 's/Copyright (\(c\) )?([0-9-]+),? (Google|The Chromium Authors).*(\r)?$/Copyright \2 Google LLC\4/' -e '/^((\/\/|#| \*) )?All rights reserved\.?\r?$/d' -e 's/name of Google Inc\. nor the/name of Google LLC nor the/' -e 's/POSSIBILITY OF SUCH DAMAGE$/POSSIBILITY OF SUCH DAMAGE./' $(git grep -El 'Copyright (\(c\) )?([0-9-]+),? (Google|The Chromium Authors).*$')

Plus manual fixes for src/processor/disassembler_x86.{cc,h}.

Plus some conversions from CRLF to LF line endings in .cc and .h files.

Bug: chromium:1098010
Change-Id: I8030e804eecd9f5a1ec9d66ae166efd8418c2a67
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3878302
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2022-09-07 16:59:53 +00:00

60 lines
1.6 KiB
C++

// Copyright 2013 Google LLC
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_DEBUG_PROC_MAPS_LINUX_H_
#define BASE_DEBUG_PROC_MAPS_LINUX_H_
#include <string>
#include <vector>
#include "common/using_std_string.h"
#include "google_breakpad/common/breakpad_types.h"
namespace google_breakpad {
// Describes a region of mapped memory and the path of the file mapped.
struct MappedMemoryRegion {
enum Permission {
READ = 1 << 0,
WRITE = 1 << 1,
EXECUTE = 1 << 2,
PRIVATE = 1 << 3, // If set, region is private, otherwise it is shared.
};
// The address range [start,end) of mapped memory.
uint64_t start;
uint64_t end;
// Byte offset into |path| of the range mapped into memory.
uint64_t offset;
// Bitmask of read/write/execute/private/shared permissions.
uint8_t permissions;
// Major and minor devices.
uint8_t major_device;
uint8_t minor_device;
// Value of the inode.
uint64_t inode;
// Name of the file mapped into memory.
//
// NOTE: path names aren't guaranteed to point at valid files. For example,
// "[heap]" and "[stack]" are used to represent the location of the process'
// heap and stack, respectively.
string path;
// The line from /proc/<pid>/maps that this struct represents.
string line;
};
// Parses /proc/<pid>/maps input data and stores in |regions|. Returns true
// and updates |regions| if and only if all of |input| was successfully parsed.
bool ParseProcMaps(const string& input,
std::vector<MappedMemoryRegion>* regions);
} // namespace google_breakpad
#endif // BASE_DEBUG_PROC_MAPS_LINUX_H_