OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 :doctype: manpage |
| 16 |
| 17 = catch_exception_tool(1) |
| 18 |
| 19 == Name |
| 20 |
| 21 catch_exception_tool - Catch Mach exceptions and display information about them |
| 22 |
| 23 == Synopsis |
| 24 |
| 25 [verse] |
| 26 *catch_exception_tool* *-m* 'SERVICE' ['OPTION…'] |
| 27 |
| 28 == Description |
| 29 |
| 30 Runs a Mach exception server registered with the bootstrap server under the name |
| 31 'SERVICE'. The exception server is capable of receiving exceptions for |
| 32 “behavior” values of +EXCEPTION_DEFAULT+, +EXCEPTION_STATE+, and |
| 33 +EXCEPTION_STATE_IDENTITY+, with or without +MACH_EXCEPTION_CODES+ set. |
| 34 |
| 35 == Options |
| 36 |
| 37 *-f*, *--file*='FILE':: |
| 38 Information about the exception will be appended to 'FILE' instead of the |
| 39 standard output stream. |
| 40 |
| 41 *-m*, *--mach_service*='SERVICE':: |
| 42 Check in with the bootstrap server under the name 'SERVICE'. This service name |
| 43 may already be reserved with the bootstrap server in cases where this tool is |
| 44 started by launchd(8) as a result of a message being sent to a service declared |
| 45 in a job’s +MachServices+ dictionary (see launchd.plist(5)). The service name |
| 46 may also be completely unknown to the system. |
| 47 |
| 48 *-n*, *--nonblocking*:: |
| 49 Don’t wait for an exception to occur if one is not received immediately. In |
| 50 nonblocking mode, this tool exits immediately if no exception is received. The |
| 51 default mode is blocking. |
| 52 |
| 53 *-p*, *--persistent*:: |
| 54 Continue processing exceptions after the first one. The default mode is |
| 55 one-shot, where this tool exits after processing the first exception. |
| 56 |
| 57 *-t*, *--timeout*='TIMEOUT':: |
| 58 Run for a maximum of 'TIMEOUT' seconds. This option only has an effect in |
| 59 blocking mode (when *--nonblocking* is not specified). In *--persistent* mode, |
| 60 'TIMEOUT' applies to the overall duration that this tool will run, not to the |
| 61 processing of individual exceptions. |
| 62 |
| 63 *--help*:: |
| 64 Display help and exit. |
| 65 |
| 66 *--version*:: |
| 67 Output version information and exit. |
| 68 |
| 69 == Examples |
| 70 |
| 71 Run a one-shot blocking exception server registered with the bootstrap server |
| 72 under the name +svc+: |
| 73 [subs="quotes"] |
| 74 ---- |
| 75 $ *catch_exception_tool --mach_service=svc --file=out &* |
| 76 [1] 1233 |
| 77 $ *exception_port_tool --set_handler=handler=bootstrap:svc crasher* |
| 78 Illegal instruction: 4 |
| 79 [1]+ Done catch_exception_tool --mach_service=svc --file=out |
| 80 $ *cat out* |
| 81 catch_exception_tool: |
| 82 behavior EXCEPTION_DEFAULT|MACH_EXCEPTION_CODES, |
| 83 pid 1234, thread 56789, exception EXC_CRASH, codes[2] 0x4200001, 0, |
| 84 original exception EXC_BAD_INSTRUCTION, original code[0] 1, |
| 85 signal SIGILL |
| 86 ---- |
| 87 |
| 88 Run an on-demand exception server started by launchd(5) available via the |
| 89 bootstrap server under the name +svc+: |
| 90 [subs="quotes"] |
| 91 ---- |
| 92 $ *on_demand_service_tool --load --label=catch_exception \ |
| 93 --mach_service=svc \ |
| 94 $(which catch_exception_tool) --mach_service=svc \ |
| 95 --file=/tmp/out --nonblocking --persistent* |
| 96 $ *exception_port_tool --set_handler=handler=bootstrap:svc crasher* |
| 97 Illegal instruction: 4 |
| 98 $ *on_demand_service_tool --unload --label=catch_exception* |
| 99 $ *cat /tmp/out* |
| 100 catch_exception_tool: |
| 101 behavior EXCEPTION_DEFAULT|MACH_EXCEPTION_CODES, |
| 102 pid 2468, thread 13579, exception EXC_CRASH, codes[2] 0x4200001, 0, |
| 103 original exception EXC_BAD_INSTRUCTION, original code[0] 1, |
| 104 signal SIGILL |
| 105 ---- |
| 106 |
| 107 == Exit Status |
| 108 |
| 109 *0*:: |
| 110 Success. In *--persistent* mode with a *--timeout* set, it is considered |
| 111 successful if at least one exception was caught when the timer expires. |
| 112 |
| 113 *1*:: |
| 114 Failure, with a message printed to the standard error stream. |
| 115 |
| 116 == See Also |
| 117 |
| 118 exception_port_tool(1), |
| 119 on_demand_service_tool(1) |
| 120 |
| 121 include::man_footer.ad[] |
OLD | NEW |