107 Commits

Author SHA1 Message Date
Mark Mentovai
5f7eda87a6 mac: Don’t leak send rights from ExceptionPorts::GetExceptionPorts()
ExceptionPorts::GetExceptionPorts() returned a
std::vector<ExceptionPorts::ExceptionHandler>, which contained send
rights to Mach ports. The interface required callers to assume ownership
of each send right contained within the vector. This was cumbersome and
error-prone, and despite the care taken in Crashpad, port right leaks
did occur:

 - SimulateCrash() didn’t make any attempt to release these resources at
   all.
 - Neither did crashpad_util_test ExceptionPorts.HostExceptionPorts,
   which also reused a vector.

This replaces the vector with the interface-compatible (as far as
necessary) ExceptionPorts::ExceptionHandlerVector, which deallocates
collected port rights on destruction or clear().

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1381023007 .
2015-10-06 16:14:29 -04:00
Mark Mentovai
bb13efbda7 Add and use scoped-right-returning wrappers for Mach bootstrap routines
This wraps bootstrap_check_in() in BootstrapCheckIn(), and
bootstrap_look_up() in BootstrapLookUp(). The wrappers make it more
difficult to accidentally leak a returned right. They’re easier to use,
encapsulating common error checking and logging, simplifying all call
sites.

TEST=crashpad_util_test MachExtensions.BootstrapCheckInAndLookUp
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1383283003 .
2015-10-05 17:07:15 -04:00
Scott Graham
3a886267aa win: Fix OpenProcess(PROCESS_ALL_ACCESS, ...) on XP
PROCESS_ALL_ACCESS was changed in later SDKs and the newer value fails
when run on XP with ERROR_ACCESS_DENIED. Use the old value to maintain
compatibility with XP.

R=mark@chromium.org
BUG=crashpad:50

Review URL: https://codereview.chromium.org/1337133002 .
2015-09-11 13:16:06 -07:00
Scott Graham
d7f90b45b6 win: Fix incorrect thread suspend count due to ScopedProcessSuspend
After https://codereview.chromium.org/1303173011/, the thread suspend
count would be one too large because the count is adjusted when the
process is suspended. Counteract this by passing in whether the
process is suspended or not so that the thread's suspension count
can be adjusted.

Add a test to sanity-check thread suspend count.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/1326443007 .
2015-09-09 12:29:29 -07:00
Scott Graham
5111a1823f win: Implement and use ScopedProcessSuspend
R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1303173011 .
2015-09-08 10:09:26 -07:00
Mark Mentovai
9086d25ce8 Don’t trigger EXC_CORPSE_NOTIFY on OS X 10.11
CrashReportExceptionHandler::CatchMachException() must always set a
valid new_state. Failing to do so appears to trigger corpse generation
on OS X 10.11. This is addressed by calling ExcServerCopyState().
Previously, this was not done for exceptions forwarded to the user
ReportCrash, under the apparent mistaken assumption that ReportCrash
would do it. However, ReportCrash is given copies of out-parameters like
new_state to explicitly prevent it from influencing Crashpad’s returned
state.

ExcServerSuccessfulReturnValue() must not return MACH_RCV_PORT_DIED for
an EXC_CRASH handler on OS X 10.11. This appears to trigger corpse
generation. This is addressed by always returning KERN_SUCCESS from
EXC_CRASH handlers on OS X 10.11.

This also adds generic EXC_CORPSE_NOTIFY support throughout Crashpad.
The crashpad_handler does not listen for this exception type, but it is
now possible to work with this exception type using tools like
exception_port_tool and catch_exception_tool.

BUG=crashpad:48
TEST=Crashes handled by crashpad_handler do not result in the generation
     of reports in the root /Library/Logs/DiagnosticReports.

R=kerrnel@chromium.org, rsesek@chromium.org

Review URL: https://codereview.chromium.org/1305893010 .
2015-09-04 14:29:12 -04:00
Mark Mentovai
124ace19bd crashpad_database_util: Accept --new-report=- to read a new report from
standard input.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1023943003 .
2015-08-07 13:57:05 -04:00
Mark Mentovai
29eeec3d56 Remove unused #include following 03663076154a.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1273073002 .
2015-08-06 11:07:23 -04:00
Mark Mentovai
0366307615 win: Provide strcasecmp() in <strings.h> in compat.
base::strcasecmp() has been deprecated since upstream 8a800901b78a2.

BUG=chromium:472900
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1275633002 .
2015-08-05 16:34:50 -04:00
Scott Graham
5a21de6a1b win: Retrieve thread context for x64
Retrieve context and save to thread context. NtQueryInformationThread
is no longer required (right now?) because to retrieve the CONTEXT, the
thread needs to be Suspend/ResumeThread'd anyway, and the return value
of SuspendThread is the previous SuspendCount.

I haven't handle the x86 case yet -- that would ideally be via
Wow64GetThreadContext (I think) but unfortunately that's Vista+, so I'll
likely need to to a bit of fiddling to get that sorted out. (It's actually
likely going to be NtQueryInformationThread again, but one thing at a
time for now.)

R=cpu@chromium.org, rsesek@chromium.org
TBR=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1133203002
2015-05-14 17:37:02 -07:00
Scott Graham
b2e78eb3c5 Revert "Intentional compile error to test bot changes"
This reverts commit f8c763e6c081a524c8b0c5b43ff53e02c956a53a.

TBR=dpranke@chromium.org
BUG=crashpad:37

Review URL: https://codereview.chromium.org/1136633002
2015-05-07 15:20:49 -07:00
Scott Graham
f8c763e6c0 Intentional compile error to test bot changes
TBR=dpranke@chromium.org
BUG=crashpad:37

Review URL: https://codereview.chromium.org/1135663002
2015-05-07 15:19:00 -07:00
Mark Mentovai
919715bda8 ToolSupport::Version(): fix PRFilePath format string.
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1136583002
2015-05-07 14:41:16 -04:00
Scott Graham
ff52791faf Get generate_dump compiling on Windows
Sort of works in that the process is opened, modules retrieved, etc.
but eventually CHECKs due to missing functionality in snapshot.

Follows https://codereview.chromium.org/1119783005/.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1120383003
2015-05-06 11:09:31 -07:00
Scott Graham
17b770ece4 win: get tools/crashpad_database_util mostly working
- Add public domain getopt implementation to third_party.
- Add timegm to compat/win.
- Add stub of strptime to compat/win.

Requires https://codereview.chromium.org/1119173003/ and
https://codereview.chromium.org/1117013006/.

Rather than working in wchar_t everywhere on Windows, convert
UTF16 command line arguments in wmain to UTF8, work primarily
in UTF8, and convert back when necessary to UTF16 for base::FilePath.
This avoids the need to genericize over all the standard C string
functions, getopt, etc. while still handling non-ASCII properly.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/1119783005
2015-05-06 10:28:07 -07:00
Mark Mentovai
1baff4ff92 Accept non-fatal resource exceptions without generating crash reports.
This adds IsExceptionNonfatalResource() and its test, and uses it in
crashpad_handler. When non-fatal resource exceptions are encountered, no
crash report is generated. crashpad_handler swallows these exceptions.
Alternatively, it could allow them to be sent to the system’s host-level
resource exception handler, normally com.apple.ReportCrash.root, which
would allow them to be processed in the same way as when Crashpad is not
in use. I’m not sure which option is better. I chose to swallow them
because there doesn’t appear to be much value in letting
com.apple.ReportCrash.root and spindump look at them.

This also moves ExcCrashRecoverOriginalException() to the new file as a
sibling of IsExceptionNonfatalResource(). This provides better
organization.

BUG=crashpad:35, chromium:474163, chromium:474326
TEST=crashpad_util_test ExceptionTypes.IsExceptionNonfatalResource
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1066243002
2015-04-08 17:46:09 -04:00
Mark Mentovai
ab23906193 crashpad_database_util: add --new-report.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1018853006
2015-04-03 18:57:01 -04:00
Mark Mentovai
40b1d7cb1d Add ConstThreadState to mach_extensions.h and use it everywhere.
TEST=everything
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1058523002
2015-04-02 15:28:28 -04:00
Mark Mentovai
332e8219ed Migrate content from wiki.
The wiki existed at https://code.google.com/p/crashpad/wiki, but given
Google Code Project Hosting’s impending shutdown[1], it’s prudent to
move wiki documents into the source code repository.

This change moves the existing contents of doc into doc/support, to make
way for documentation in doc. The two existing wiki pages, ProjectStatus
and DevelopingCrashpad, are converted to AsciiDoc format (a fairly
straightforward conversion) and checked in to doc. generate_asciidoc.sh
is updated to produce HTML output from these files. The generated HTML
will show up at http://docs.crashpad.googlecode.com/git/doc/. Note that
generated HTML is still hosted on Google Code Project Hosting, but it’ll
be easy to find a new home for them.

[1]
http://google-opensource.blogspot.com/2015/03/farewell-to-google-code.html

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1055523002
2015-04-01 12:39:53 -04:00
Mark Mentovai
352160906b Add ExcServerCopyState().
ExcServerCopyState() properly sets the new_state and new_state_count
out-parameters for exception handler routines that may deal with
state-carrying exceptions.

This used to exist inline in catch_exception_tool, but that
implementation had a bug caught by the new test.

TEST=crashpad_util_test ExcServerVariants.ExcServerCopyState and others
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1049023003
2015-04-01 12:16:22 -04:00
Mark Mentovai
d5ddd14ee1 Improve map insertion operations.
Add MapInsertOrReplace<>() to insert a key-value pair into a map if the
key is not already present, or replace the existing value for key if the
key is present. The original value can optionally be returned to the
caller in this case.

Map insertions now use either MapInsertOrReplace<>() or
std::map<>::insert() directly.

Use MapInsertOrReplace<>() when the map should be updated to contain a
mapping from a key to a value regardless of whether the key is already
present.

Use std::map<>::insert() to insert a mapping from a key to a value
without replacing any existing mapping from a key, if present. If it is
important to know whether an existing mapping from a key was present,
use the returned std::pair<>.second. If it is important to know the
existing value, use the returned std::pair<>.first->second.

This change has a slight positive impact on performance.

TEST=crashpad_util_test MapInsert.MapInsertOrReplace and others
BUG=
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1044273002
2015-03-31 14:29:32 -04:00
Mark Mentovai
6f4e6aacc8 Add crashpad_database_util and its man page.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1022663002
2015-03-19 18:41:01 -04:00
Mark Mentovai
af9e78940e Allow man pages to link to each other
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1018023002
2015-03-18 17:13:22 -04:00
Mark Mentovai
c2502f45c9 doc: Add documentation-generating scripts to the Crashpad tree.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1009223003
2015-03-18 17:10:12 -04:00
Mark Mentovai
82bebb11de Update man pages.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1013783002
2015-03-16 13:47:51 -04:00
Mark Mentovai
29cdc74579 CrashpadClient::StartHandler(): accept database, url, and annotations arguments.
This makes it easier for clients to start the Crashpad handler, instead
of requiring them to know how to construct arguments for the handler
themselves. Note in the TEST that -a is no longer required.

TEST=run_with_crashpad --handler crashpad_handler \
         --database=/tmp/crashpad_db \
         --url=https://clients2.google.com/cr/staging_report \
         --annotation=prod=crashpad \
         --annotation=ver=0.7.0 \
         crashy_program

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1001993002
2015-03-12 14:28:19 -04:00
Mark Mentovai
a829f67f81 Don’t const_cast<char*> the service name parameter to
bootstrap_look_up().

This hasn’t been required since the 10.5 SDK, which is no longer
supported.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/999533002
2015-03-10 17:01:12 -04:00
Mark Mentovai
b665a0db07 Allow Crashpad to build in the Chromium tree.
When building in the Chromium tree, this swaps out Crashpad’s copies of
mini_chromium, gtest, and gmock for the equivalents provided by
Chromium. A GYP variable, crashpad_in_chromium, is used to determine the
behavior.

gclient doesn’t sync sub-DEPS, so when doing an in-Chromium build,
Crashpad’s copies of mini_chromium, gtest, and gmock are not available.

BUG=crashpad:12
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/986033002
2015-03-09 15:25:42 -04:00
Mark Mentovai
b256df0534 Set target_name on many targets to use a crashpad_ prefix.
In Chromium, many targets are built, sharing a single output directory.
Collisions are likely. When integrating Crashpad into Chromium, the
ui/snapshot library and Crashpad’s snapshot library were found to
conflict.

This change gives most Crashpad targets a “crashpad_” prefix to avoid
conflicts. All library and test targets are given a target_name with
this prefix. Existing tools are not likely to conflict with anything
else and are not given a prefix.

BUG=crashpad:12
R=rsesek@chromium.org, scottmg@chromium.org

Review URL: https://codereview.chromium.org/990553003
2015-03-08 16:25:34 -04:00
Mark Mentovai
b770a51f2b Set the chromium_code GYP variable.
When building in the Chromium tree, chromium_code is necessary to apply
Chromium’s build/filename_rules.gypi. Crashpad’s build depends on these
rules. chromium_code also enables a high warning level, which is
desirable for Crashpad.

BUG=crashpad:12
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/986873002
2015-03-08 15:17:22 -04:00
Mark Mentovai
3ee6566051 generate_dump, exception_port_tool: set SecTaskAccess allowed.
This adds an Info.plist to these two tools that use task_for_pid().
Since they’re flat unbundled executables, the Info.plist must be placed
as a __TEXT,__info_plist section.

By setting SecTaskAccess to allowed and signing these tools with a
certificate trusted by the system, they will be allowed to use
task_for_pid() without requiring the invoking user to be root. This
provides an alternative to installing these tools as setuid root.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/822533002
2014-12-30 14:27:58 -05:00
Mark Mentovai
f4ec7ba590 Add the run_with_crashpad tool.
run_with_crashpad runs a program with a Crashpad exception handler. It
allows a Crashpad exception-handling server to be started and to direct
crashes to it from programs that are not themselves clients of the
Crashpad client library.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/810423004
2014-12-30 14:25:58 -05:00
Mark Mentovai
b0e8f3e3e4 tools: Restore Resources, Copyright, and License to man pages.
This updates moved man pages to reference man_footer.ad by a proper
relative path following 39f69c862af6.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/820803003
2014-12-19 18:44:35 -05:00
Scott Graham
6865865773 Change 'bool world_readable' to an enum
More clear at callsites, and relatively important not to accidentally choose the wrong one.

R=mark@chromium.org

Review URL: https://codereview.chromium.org/821483002
2014-12-19 15:35:30 -08:00
Scott Graham
5f5e342584 Switch [String]FileWriter to use new file_io.h functions/types
Also add ScopedFileHandle as cross-platform version of ScopedFD/ScopedFileHANDLE.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/815053004
2014-12-19 13:33:01 -08:00
Mark Mentovai
39f69c862a tools: Move Mac-specific tools to tools/mac.
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/804913003
2014-12-17 15:26:23 -05:00
Mark Mentovai
c874958fd0 MachMessageServer: eliminate argument redundancy.
MachMessageServer::Run()’s distinct |nonblocking| parameter is removed.
The information it formerly conveyed is now implied by the |timeout_ms|
parameter, which can accept two special values,
kMachMessageTimeoutNonblocking and kMachMessageTimeoutWaitIndefinitely.

TEST=client_test, snapshot_test, util_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/777993002
2014-12-10 11:11:21 -05:00
Mark Mentovai
22b2f0cad7 tools: Use hyphens instead of underscores for multi-word option names.
Option names like --mach-service are easier to type than --mach_service.
Command-line tools don’t necessarily have the most ergonomic interfaces
anyway, but this is an improvement.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/774763006
2014-12-04 16:46:12 -05:00
Mark Mentovai
821ed8fe0f UniversalMachExcServer: eliminate multiple implementation inheritance.
UniversalMachExcServer provided both an interface and an implementation,
contrary to the other classes in the exc_server_variants family. This
was mostly done for reasons of economy in an already-large class family.
Unfortunately, this decision meant that it was impossible for other code
to use UniversalMachExcServer, which required that CatchMachException()
be implemented, and also extend another class without violating the
style guide’s prohibition of multiple implementation inheritance. This
became a problem in a lot of test code, which extended MachMultiprocess
and UniversalMachExcServer.

UniversalMachExcServer is now given its own nested Interface class,
which is a pure interface. All users of UniversalMachExcServer are
changed from “is-a” UniversalMachExcServer to “has-a”
UniversalMachExcServer and “is-a” UniversalMachExcServer::Interface.

TEST=client_test, snapshot_test, util_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/775943005
2014-12-04 10:18:24 -05:00
Mark Mentovai
0437bc53b6 Pass Mach message trailers to server handler functions.
TEST=util_test ChildPortServer.*:ExcServerVariants.*:MachMessageUtil.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/755313004
2014-12-01 16:06:56 -05:00
Mark Mentovai
79b4434c81 Add a ReceiveLarge parameter to MachMessageServer::Run().
Previously, MachMessageServer::Run() only provided two strategies for
dealing with large messages, indicated by mach_msg() returning
MACH_RCV_TOO_LARGE: the receive buffer could be reallocated and the
message received, or the entire function could return MACH_RCV_TOO_LARGE
to the caller. There are situations where an intermediate behavior might
be desirable. This intermediate behavior would allow the function to
continue waiting for another message without returning an error to the
caller or attempting to receive the large message. This is desirable
when dealing with fixed-sized messages and a receiver that might be sent
messages by unknown, possibly-malicious callers. This can happen when
the corresponding send right is published with the bootstrap server, for
example.

Existing users continue to request their existing behavior, typically
receiving an error when encountering a large message.
catch_exception_tool will use the new “ignore” behavior when running in
persistent mode.

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

Review URL: https://codereview.chromium.org/756803002
2014-11-25 14:48:44 -05:00
Mark Mentovai
09d3a6c695 Add the generate_dump tool.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/727983002
2014-11-14 19:21:43 -05:00
Mark Mentovai
49d7fdba9a Add DropPrivileges().
DropPrivileges() is used in exception_port_tool, so that when it is
installed as a setuid executable, it only uses elevated privileges to
obtain a task port for its -p option, and then relinquishes those
privileges.

It is difficult to provide a test for this function, because it must be
running setuid or setgid in order to do anything interesting. However,
the function contains its own CHECKs to verify that it behaves properly.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/727053002
2014-11-14 18:44:19 -05:00
Mark Mentovai
de3c46c6b3 Add TaskForPID().
This also transitions exception_port_tool to use TaskForPID(), so that
it can be safely used as a setuid executable without giving permission
to operate on any process on the system.

It is difficult to provide a test for this function, because it must be
running setuid root in order to do anything interesting.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/728973002
2014-11-14 17:56:17 -05:00
Mark Mentovai
f59e3e6b78 Add tool man pages in asciidoc format.
nroff mandoc-format man pages can be generated by running:

a2x --format manpage \
    --attribute 'mansource=Crashpad' \
    --attribute 'manversion=0.6.0' \
    --attribute 'manmanual=Crashpad Manual' \
    --attribute 'revdate=October 2014' \
    manpage.ad

For HTML output, use --format xhtml.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/664553004
2014-10-17 11:01:48 -04:00
Mark Mentovai
5d74f120fc Convert NULL to nullptr.
This change was generated mechanically by running:

  find . \( -name \*.cc -or -name \*.mm -or -name \*.h \) \
      -and -not -path ./third_party/\* -and -not -path ./out/\* \
      -exec sed -i '' -E -e 's/(^|[^_])NULL/\1nullptr/g' {} +

Further manual fix-ups were applied to remove casts of nullptr to other
pointer types where possible, to preserve the intentional use of NULL
(as a short form of MACH_PORT_NULL) in exception_port_tool, and to fix
80-column violations.

https://groups.google.com/a/chromium.org/d/topic/chromium-dev/4mijeJHzxLg/discussion

TEST=*_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/656703002
2014-10-14 11:10:45 -04:00
Mark Mentovai
8c7872e9e0 Use the correct null constants for Mach threads, tasks, and hosts.
This uses THREAD_NULL, TASK_NULL, and HOST_NULL in preference to
MACH_PORT_NULL and kMachPortNull. These constants are correctly-typed
(thread_t, task_t, and host_t) and result in more readable source code,
especially where thread and task parameters appear together as they do
in exc_*_variants.

TEST=util_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/649713002
2014-10-13 12:59:21 -04:00
Mark Mentovai
40602fab1f Don’t use using directives (“using namespace”) in tools.
The contents of tools are moved into the namespace
crashpad::(anonymous namespace).

https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Namespaces

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/627273004
2014-10-07 17:30:09 -04:00
Scott Graham
7dda7b3228 Superficial gyp changes to not immediately error out on Windows
Just guarding the usage of $SDKROOT so that ninja doesn't error out
on invalid $ escape on parsing.

R=mark@chromium.org
BUG=crashpad:1

Review URL: https://codereview.chromium.org/620553004
2014-09-30 13:11:04 -07:00
Mark Mentovai
0d8f67c1f5 Specify system framework dependencies properly in .gyp files.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/588073004
2014-09-22 14:06:06 -04:00
Mark Mentovai
12b67422f9 catch_exception_tool: Show the thread ID, state flavor, and state count.
For identity-carrying exceptions, the system-wide thread ID is shown.

For state-carrying exceptions, the flavor and old_state_count are shown.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/581153002
2014-09-18 13:55:03 -04:00
Mark Mentovai
4d35ffa80e Use more-specific typedefs for send rights to task, thread, and
exception handler ports.

task_t, thread_t, and exception_handler_t are typedefs for mach_port_t.
They are more descriptive than mach_port_t, and are already in use in
exc_server_variants.

TEST=util_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/577293002
2014-09-18 13:53:43 -04:00
Mark Mentovai
1b61c90e7c Add exception_port_tool.
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/575033004
2014-09-18 12:09:00 -04:00
Mark Mentovai
021c93c2e0 Use a more specific type, mach_exception_code_t, when possible.
mach_exception_data_type_t is more generic and is used for any element
of a codes[] array. For individual elements, the typedefs
mach_exception_code_t and mach_exception_subcode_t are available. Using
mach_exception_code_t when possible gives slightly more descriptive
code.

No functional change.

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

Review URL: https://codereview.chromium.org/585473003
2014-09-18 11:56:03 -04:00
Mark Mentovai
b4fe6dfae0 Refactor EXC_CRASH code[0] processing into a new function,
ExcCrashRecoverOriginalException(), and use it where sensible.

TEST=util_test ExcVariantsTest.ExcCrashRecoverOriginalException …
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/566693003
2014-09-17 17:59:35 -04:00
Mark Mentovai
f764db270f Add catch_exception_tool.
catch_exception_tool catches Mach exceptions. Currenlty, it simply
prints a message with some information about each exception it handles.
In the future, it will be tied to the minidump generator as well.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/579443005
2014-09-17 15:40:09 -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