| OLD | NEW |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with 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 | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 'SERVICE'. The exception server is capable of receiving exceptions for | 31 'SERVICE'. The exception server is capable of receiving exceptions for |
| 32 “behavior” values of +EXCEPTION_DEFAULT+, +EXCEPTION_STATE+, and | 32 “behavior” values of +EXCEPTION_DEFAULT+, +EXCEPTION_STATE+, and |
| 33 +EXCEPTION_STATE_IDENTITY+, with or without +MACH_EXCEPTION_CODES+ set. | 33 +EXCEPTION_STATE_IDENTITY+, with or without +MACH_EXCEPTION_CODES+ set. |
| 34 | 34 |
| 35 == Options | 35 == Options |
| 36 | 36 |
| 37 *-f*, *--file*='FILE':: | 37 *-f*, *--file*='FILE':: |
| 38 Information about the exception will be appended to 'FILE' instead of the | 38 Information about the exception will be appended to 'FILE' instead of the |
| 39 standard output stream. | 39 standard output stream. |
| 40 | 40 |
| 41 *-m*, *--mach_service*='SERVICE':: | 41 *-m*, *--mach-service*='SERVICE':: |
| 42 Check in with the bootstrap server under the name 'SERVICE'. This service name | 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 | 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 | 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 | 45 in a job’s +MachServices+ dictionary (see launchd.plist(5)). The service name |
| 46 may also be completely unknown to the system. | 46 may also be completely unknown to the system. |
| 47 | 47 |
| 48 *-n*, *--nonblocking*:: | 48 *-n*, *--nonblocking*:: |
| 49 Don’t wait for an exception to occur if one is not received immediately. In | 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 | 50 nonblocking mode, this tool exits immediately if no exception is received. The |
| 51 default mode is blocking. | 51 default mode is blocking. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 *--version*:: | 66 *--version*:: |
| 67 Output version information and exit. | 67 Output version information and exit. |
| 68 | 68 |
| 69 == Examples | 69 == Examples |
| 70 | 70 |
| 71 Run a one-shot blocking exception server registered with the bootstrap server | 71 Run a one-shot blocking exception server registered with the bootstrap server |
| 72 under the name +svc+: | 72 under the name +svc+: |
| 73 [subs="quotes"] | 73 [subs="quotes"] |
| 74 ---- | 74 ---- |
| 75 $ *catch_exception_tool --mach_service=svc --file=out &* | 75 $ *catch_exception_tool --mach-service=svc --file=out &* |
| 76 [1] 1233 | 76 [1] 1233 |
| 77 $ *exception_port_tool --set_handler=handler=bootstrap:svc crasher* | 77 $ *exception_port_tool --set-handler=handler=bootstrap:svc crasher* |
| 78 Illegal instruction: 4 | 78 Illegal instruction: 4 |
| 79 [1]+ Done catch_exception_tool --mach_service=svc --file=out | 79 [1]+ Done catch_exception_tool --mach-service=svc --file=out |
| 80 $ *cat out* | 80 $ *cat out* |
| 81 catch_exception_tool: | 81 catch_exception_tool: |
| 82 behavior EXCEPTION_DEFAULT|MACH_EXCEPTION_CODES, | 82 behavior EXCEPTION_DEFAULT|MACH_EXCEPTION_CODES, |
| 83 pid 1234, thread 56789, exception EXC_CRASH, codes[2] 0x4200001, 0, | 83 pid 1234, thread 56789, exception EXC_CRASH, codes[2] 0x4200001, 0, |
| 84 original exception EXC_BAD_INSTRUCTION, original code[0] 1, | 84 original exception EXC_BAD_INSTRUCTION, original code[0] 1, |
| 85 signal SIGILL | 85 signal SIGILL |
| 86 ---- | 86 ---- |
| 87 | 87 |
| 88 Run an on-demand exception server started by launchd(5) available via the | 88 Run an on-demand exception server started by launchd(5) available via the |
| 89 bootstrap server under the name +svc+: | 89 bootstrap server under the name +svc+: |
| 90 [subs="quotes"] | 90 [subs="quotes"] |
| 91 ---- | 91 ---- |
| 92 $ *on_demand_service_tool --load --label=catch_exception \ | 92 $ *on_demand_service_tool --load --label=catch_exception \ |
| 93 --mach_service=svc \ | 93 --mach-service=svc \ |
| 94 $(which catch_exception_tool) --mach_service=svc \ | 94 $(which catch_exception_tool) --mach-service=svc \ |
| 95 --file=/tmp/out --nonblocking --persistent* | 95 --file=/tmp/out --nonblocking --persistent* |
| 96 $ *exception_port_tool --set_handler=handler=bootstrap:svc crasher* | 96 $ *exception_port_tool --set-handler=handler=bootstrap:svc crasher* |
| 97 Illegal instruction: 4 | 97 Illegal instruction: 4 |
| 98 $ *on_demand_service_tool --unload --label=catch_exception* | 98 $ *on_demand_service_tool --unload --label=catch_exception* |
| 99 $ *cat /tmp/out* | 99 $ *cat /tmp/out* |
| 100 catch_exception_tool: | 100 catch_exception_tool: |
| 101 behavior EXCEPTION_DEFAULT|MACH_EXCEPTION_CODES, | 101 behavior EXCEPTION_DEFAULT|MACH_EXCEPTION_CODES, |
| 102 pid 2468, thread 13579, exception EXC_CRASH, codes[2] 0x4200001, 0, | 102 pid 2468, thread 13579, exception EXC_CRASH, codes[2] 0x4200001, 0, |
| 103 original exception EXC_BAD_INSTRUCTION, original code[0] 1, | 103 original exception EXC_BAD_INSTRUCTION, original code[0] 1, |
| 104 signal SIGILL | 104 signal SIGILL |
| 105 ---- | 105 ---- |
| 106 | 106 |
| 107 == Exit Status | 107 == Exit Status |
| 108 | 108 |
| 109 *0*:: | 109 *0*:: |
| 110 Success. In *--persistent* mode with a *--timeout* set, it is considered | 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. | 111 successful if at least one exception was caught when the timer expires. |
| 112 | 112 |
| 113 *1*:: | 113 *1*:: |
| 114 Failure, with a message printed to the standard error stream. | 114 Failure, with a message printed to the standard error stream. |
| 115 | 115 |
| 116 == See Also | 116 == See Also |
| 117 | 117 |
| 118 exception_port_tool(1), | 118 exception_port_tool(1), |
| 119 on_demand_service_tool(1) | 119 on_demand_service_tool(1) |
| 120 | 120 |
| 121 include::man_footer.ad[] | 121 include::man_footer.ad[] |
| OLD | NEW |