llvm.org GIT mirror llvm / 82b53cd
Actually disable crash reporting on Mac OS X, returning bugpoint to speedy crash miscompilations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49000 91177308-0d34-0410-b5e6-96231b3b80d8 Nate Begeman 11 years ago
1 changed file(s) with 6 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
122122 return getgid();
123123 }
124124
125 #ifdef HAVE_MACH_MACH_H
126 #include
127 #endif
128
129125 // Some LLVM programs such as bugpoint produce core files as a normal part of
130126 // their operation. To prevent the disk from filling up, this function
131127 // does what's necessary to prevent their generation.
137133 #endif
138134
139135 #ifdef HAVE_MACH_MACH_H
140 // Disable crash reporting on Mac OS/X.
141
142 // get information about the original set of exception ports for the task
143 mach_msg_type_number_t Count = 0;
144 exception_mask_t OriginalMasks[EXC_TYPES_COUNT];
145 exception_port_t OriginalPorts[EXC_TYPES_COUNT];
146 exception_behavior_t OriginalBehaviors[EXC_TYPES_COUNT];
147 thread_state_flavor_t OriginalFlavors[EXC_TYPES_COUNT];
148 kern_return_t err =
149 task_get_exception_ports(mach_task_self(), EXC_MASK_ALL, OriginalMasks,
150 &Count, OriginalPorts, OriginalBehaviors,
151 OriginalFlavors);
152 if (err == KERN_SUCCESS) {
153 // replace each with MACH_PORT_NULL.
154 for (unsigned i = 0; i != Count; ++i)
155 task_set_exception_ports(mach_task_self(), OriginalMasks[i],
156 MACH_PORT_NULL, OriginalBehaviors[i],
157 OriginalFlavors[i]);
158 }
136 // Disable crash reporting on Mac OS X.
137 signal(SIGABRT, _exit);
138 signal(SIGILL, _exit);
139 signal(SIGFPE, _exit);
140 signal(SIGSEGV, _exit);
141 signal(SIGBUS, _exit);
159142 #endif
160143 }
161144