2346 Commits

Author SHA1 Message Date
Mark Mentovai
4f74716f6d Add MachOImageReader and its test, which also tests
MachOImageSegmentReader.

TEST=util_test MachOImageReader.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/535343004
2014-09-04 11:45:40 -04:00
Mark Mentovai
52064fdd1b Add the MultiprocessExec test and its test.
TEST=util_test MultiprocessExec.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/531203002
2014-09-03 18:24:29 -04:00
Mark Mentovai
d492df404c Add CloseMultipleNowOrOnExec().
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/534703003
2014-09-02 16:21:46 -04:00
Mark Mentovai
1460c47d6a Add MachOImageSegmentReader.
This is part of a family of classes whose chief entry point is
MachOImageReader. MachOImageReader depends on this class to read
segments, so this one is landing first. The bulk of this class will be
tested as part of MachOImageReader.

TEST=util_test MachOImageSegmentReader.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/516983003
2014-09-02 15:50:11 -04:00
Mark Mentovai
af0cfd5a57 Add strnlen() wrapper and its test.
TEST=util_test strnlen.strnlen
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/514253002
2014-08-28 14:38:27 -04:00
Mark Mentovai
04842e0ca4 Add CheckedMachAddressRange and its test.
TEST=util_test CheckedMachAddressRange.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/513453002
2014-08-28 13:47:28 -04:00
Mark Mentovai
ff26ea6db9 Refactor MachMultiprocess into a Multiprocess base class without any
knowledge of Mach. MachMultiprocess builds on this new base class.

TEST=util_test MachMultiprocess.*:Multiprocess.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/506143002
2014-08-26 17:10:19 -04:00
Mark Mentovai
30589d87a9 Add ProcessTypes, its test, and many proctype definition files.
TEST=util_test ProcessTypes.DyldImagesSelf
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/501203002
2014-08-26 17:08:18 -04:00
Mark Mentovai
0cc86a24f9 Add ScopedForbidReturn and its test.
Use ScopedForbidReturn in ProcessReader::InitializeThreads().

TEST=util_test ScopedForbidReturn*.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/493203005
2014-08-26 16:50:08 -04:00
Mark Mentovai
8256f9fc23 Add most of ProcessReader and its test.
TEST=util_test ProcessReader.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/491963002
2014-08-25 17:51:09 -04:00
Mark Mentovai
d0fcfa42e4 Convert SimpleStringDictionary interface documentation to Doxygen.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/499643002
2014-08-22 17:09:03 -04:00
Mark Mentovai
4004e77ee9 Improvements for MachMultiprocess.
This adds a pipe going in the other direction (parent to child).
Initially, I didn’t think this was necessary, but it turned out to be
needed for ProcessReader. Having the child wait on a pipe read is the
easiest way to keep it alive until the parent is done with it.

This also tests MachMultiprocess::ChildPID() in
mach_multiprocess_test.cc.

Both of these fell out of https://codereview.chromium.org/491963002/.

TEST=util_test MachMultiprocess.MachMultiprocess
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/491363002
2014-08-22 14:00:10 -04:00
Mark Mentovai
b980a5984b Add SimpleStringDictionary and its test.
TEST=client_test SimpleStringDictionary*.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/489993002
2014-08-22 13:52:28 -04:00
Mark Mentovai
9168ba47ac Fix minidump_module_writer_test 32-bit x86 build.
time_t is a typedef for long on Mac OS X. In 32-bit x86 (ILP32), long is
a signed 32-bit quantity, and its range does not contain the range of
uint32_t, used to store times in time_t fashion in minidump files. A
cast is necessary to make these EXPECT_* macros do the right thing. This
is not a problem in x86_64 (LP64) where long is a signed 64-bit
quantity, which does contain the range of uint32_t.

clang’s error was “error: comparison of integers of different signs:
'const long' and 'const unsigned int' [-Werror,-Wsign-compare]”

BUG=
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/491023005
2014-08-20 18:32:06 -04:00
Mark Mentovai
be5d0ab39c Add CaptureContext and its test.
TEST=client_test CaptureContextMac.CaptureContext
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/493563002
2014-08-20 18:30:19 -04:00
Mark Mentovai
0b7f86a650 Add on_demand_service_tool.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/477353002
2014-08-20 15:18:55 -04:00
Mark Mentovai
bbe4d85935 Add MachMultiprocess and its test.
TEST=util_test MachMultiprocess.MachMultiprocess
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/482483002
2014-08-20 13:58:42 -04:00
Mark Mentovai
280c4345c5 Add BootstrapCheckIn and its test.
TEST=util_test Bootstrap.BootstrapCheckIn
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/478713003
2014-08-18 20:41:00 -07:00
Mark Mentovai
8fe32b7b9c Add mac_util, including MacOSXMinorVersion(), MacOSXVersion(), and
MacModelAndBoard(), along with their tests.

TEST=util_test MacUtil.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/473023002
2014-08-15 22:33:14 -07:00
Mark Mentovai
a70edb3b7f Add ServiceManagement*() and their tests.
TEST=util_test ServiceManagement
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/467923003
2014-08-15 22:30:24 -07:00
Mark Mentovai
d05166c26c Add CheckedRange<> and its test.
TEST=util_test CheckedRange
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/467113002
2014-08-15 10:22:37 -07:00
Mark Mentovai
6997418cd4 Add InRangeCast<> and its test.
InRangeCast<> is similar to base::saturated_cast<>, but it allows the
caller to specify the value to be returned in the event that the source
value can’t be converted to the destination data type without data loss.

TEST=util_test InRangeCast
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/467103002
2014-08-14 16:00:44 -07:00
Mark Mentovai
01f9e396b8 Include <limits.h> in util/file/file_writer.cc because it uses IOV_MAX.
This also updates mini_chromium to abd6e3792f4f.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/469093002
2014-08-14 09:58:31 -07:00
Mark Mentovai
5f554ff10e Add ProcessArgumentsForPID() (process_util) and its test.
TEST=util_test ProcessUtil.ProcessArgumentsForPID
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/461253002
2014-08-14 09:57:19 -07:00
Mark Mentovai
21af173940 Add InitializationStateDcheck, its base class, and their tests.
TEST=util_test InitializationState*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/465103002
2014-08-14 09:51:26 -07:00
Mark Mentovai
7090b209ad Use the gtest_main target for test executables.
There’s no need to build a separate copy of gtest_main.cc for each test
executable.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/465363004
2014-08-13 15:28:59 -07:00
Mark Mentovai
2a6927614c Hide COMPILE_ASSERT from Doxygen, which doesn’t otherwise understand it.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/467383002
2014-08-13 15:28:23 -07:00
Mark Mentovai
e0a79bec5e MinidumpMemoryWriter test: Don’t suffix uint64_t constants.
It’s not necessary.

TEST=minidump_test MinidumpMemoryWriter
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/467323003
2014-08-13 15:27:33 -07:00
Mark Mentovai
0ba9d2b065 Add MinidumpModuleWriter, MinidumpModuleListWriter, related classes, and
their test.

TEST=minidump_test MinidumpModuleTest
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/460933004
2014-08-13 15:26:21 -07:00
Mark Mentovai
3b2c6d32f4 Add MinidumpMemoryWriter, MinidumpMemoryListWriter, and their test.
TEST=minidump_test MinidumpMemoryWriter
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/459973002
2014-08-12 10:26:40 -07:00
Mark Mentovai
c73a97d4e3 Add MinidumpMiscInfoWriter and its test.
TEST=minidump_test MinidumpMiscInfoWriter
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/454073002
2014-08-11 11:42:12 -07:00
Mark Mentovai
aa3adf2c5b Add MinidumpSystemInfoWriter and its test.
TEST=minidump_test MinidumpSystemInfoWriter
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/435243002
2014-08-07 14:58:26 -04:00
Mark Mentovai
293964f69b Add CFPropertyToLaunchData() and its test.
TEST=util_test Launchd
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/438673003
2014-08-03 18:53:10 -04:00
Mark Mentovai
4ae57690fa Put back the standard-layout checks lost in 5bbb7e8abbe0.
TEST=util_test UUID.UUID
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/440603002
2014-08-03 18:50:09 -04:00
Mark Mentovai
9f6d86742d Add TaskMemory, which can read another Mach task’s memory, and its test.
This also adds MachErrorMessage(), a test-only function that’s a
dependency of TaskMemory’s test, and related test-only error message
functions.

TEST=util_test TaskMemory.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/438993002
2014-08-03 18:48:40 -04:00
Mark Mentovai
859560f70d Add MinidumpFileWriter and its test.
MinidumpFileWriter writes the top-level object to a minidump file. This
consists of a MINIDUMP_HEADER and a list of MINIDUMP_DIRECTORY entries
that point to streams, which are second-level objects in minidump files.
This change also adds the base class for stream writers,
MinidumpStreamWriter.

TEST=minidump_test MinidumpFileWriter*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/432863006
2014-08-03 18:47:34 -04:00
Mark Mentovai
3cad76870c Update mini_chromium to bd605a3773f5.
bd605a3773f5 Fix RandBytesAsString().

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/416323004
2014-08-03 17:57:41 -04:00
Mark Mentovai
5bbb7e8abb Fix the UUID structure to have distinct fields, as expected by
Breakpad’s minidump reader.

TEST=util_test UUID.UUID
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/436933002
2014-08-01 16:10:58 -04:00
Mark Mentovai
d2675ce50b Introduce MinidumpStringWriter and its test.
MinidumpStringWriter is responsible for writing variable-length UTF-16
(MINIDUMP_STRING) and UTF-8 (MinidumpUTF8String) strings to minidump
files.

This change depends on https://codereview.chromium.org/430003003/ and
https://codereview.chromium.org/435013002/.

TEST=minidump_test MinidumpStringWriter.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/431363002
2014-08-01 14:44:57 -04:00
Mark Mentovai
4d6b867a1f Add UUID, c16lcpy (strlcpy for char16*), and their tests to util.
These are dependencies of the upcoming MinidumpStringWriter.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/430003003
2014-08-01 14:39:55 -04:00
Mark Mentovai
5ba343ccf1 Add minidump_extensions.h, which defines Crashpad/Breakpad extensions to
the standard minidump format defined in dbghelp.h.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/435013002
2014-08-01 14:37:20 -04:00
Mark Mentovai
6e720f1421 Fix StringFileWriter::Seek().
The final range check needs to check that the value fits in a size_t,
because that’s what StringFileWriter uses for its offset_.

TEST=util_test StringFileWriter.SeekInvalid
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/434103003
2014-08-01 13:30:27 -04:00
Mark Mentovai
995012534e Introduce MinidumpWritable, its dependencies, and their tests.
MinidumpWritable is the base class for all minidump-writing operations.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/432003005
2014-08-01 12:48:28 -04:00
Mark Mentovai
dfe81014f7 Add compat to Crashpad.
compat includes headers providing definitions normally provided by the
system, in cases where the system SDK does not always provide the
correct or up-to-date definitions, and cases where code on different
platforms needs to access definitions normally only available on one
platform.

To provide definitions on a single platform, where the system SDK may
not provide the definitions correctly, use subdirectories named for the
platform, such as “mac”.

To provide definitions normally available on only one platform to
others, use subdirectories that identify that they are to be used on
platforms other than the one that originated their definitions, such as
“non_win”.

In all cases, headers should be named as they are natively in their
respective SDKs, so that it’s possible to #include them according to
their usual names.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/432843002
2014-07-31 13:45:51 -04:00
Mark Mentovai
fbcd680b50 Initial commit of Crashpad.
This commit contains the basic structure of the project:
 - LICENSE and related files.
 - DEPS to check dependencies out into third_party.
 - README.crashpad files and .gyp files to accompany third_party
   dependencies.
 - Infrastructure to run GYP as a gclient hook.
 - codereview.settings to enable Rietveld code review.
 - Assorted other administrative and dot-files.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/426403002
2014-07-30 23:24:58 -04:00
Chase Phillips
b39398134c Initial empty repository 2014-07-30 21:15:14 +00:00