njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- Assertions and panics. m_libcassert.c ---*/ |
| 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
| 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
| 9 | |
sewardj | 9eecbbb | 2010-05-03 21:37:12 +0000 | [diff] [blame] | 10 | Copyright (C) 2000-2010 Julian Seward |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 11 | jseward@acm.org |
| 12 | |
| 13 | This program is free software; you can redistribute it and/or |
| 14 | modify it under the terms of the GNU General Public License as |
| 15 | published by the Free Software Foundation; either version 2 of the |
| 16 | License, or (at your option) any later version. |
| 17 | |
| 18 | This program is distributed in the hope that it will be useful, but |
| 19 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | General Public License for more details. |
| 22 | |
| 23 | You should have received a copy of the GNU General Public License |
| 24 | along with this program; if not, write to the Free Software |
| 25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 26 | 02111-1307, USA. |
| 27 | |
| 28 | The GNU General Public License is contained in the file COPYING. |
| 29 | */ |
| 30 | |
njn | c7561b9 | 2005-06-19 01:24:32 +0000 | [diff] [blame] | 31 | #include "pub_core_basics.h" |
sewardj | 4cfea4f | 2006-10-14 19:26:10 +0000 | [diff] [blame] | 32 | #include "pub_core_vki.h" |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 33 | #include "pub_core_vkiscnums.h" |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 34 | #include "pub_core_threadstate.h" |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 35 | #include "pub_core_libcbase.h" |
| 36 | #include "pub_core_libcassert.h" |
| 37 | #include "pub_core_libcprint.h" |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 38 | #include "pub_core_libcproc.h" // For VG_(gettid)() |
| 39 | #include "pub_core_stacktrace.h" |
njn | 9abd608 | 2005-06-17 21:31:45 +0000 | [diff] [blame] | 40 | #include "pub_core_syscall.h" |
njn | e070c20 | 2005-06-20 23:58:15 +0000 | [diff] [blame] | 41 | #include "pub_core_tooliface.h" // For VG_(details).{name,bug_reports_to} |
sewardj | f349d55 | 2005-11-14 17:01:01 +0000 | [diff] [blame] | 42 | #include "pub_core_options.h" // For VG_(clo_xml) |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 43 | |
| 44 | /* --------------------------------------------------------------------- |
| 45 | Assertery. |
| 46 | ------------------------------------------------------------------ */ |
| 47 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 48 | #if defined(VGP_x86_linux) || defined(VGP_x86_darwin) |
| 49 | # define GET_STARTREGS(srP) \ |
| 50 | { UInt eip, esp, ebp; \ |
| 51 | __asm__ __volatile__( \ |
| 52 | "call 0f;" \ |
| 53 | "0: popl %0;" \ |
| 54 | "movl %%esp, %1;" \ |
| 55 | "movl %%ebp, %2;" \ |
| 56 | : "=r" (eip), "=r" (esp), "=r" (ebp) \ |
| 57 | : /* reads none */ \ |
| 58 | : "memory" \ |
| 59 | ); \ |
| 60 | (srP)->r_pc = (ULong)eip; \ |
| 61 | (srP)->r_sp = (ULong)esp; \ |
| 62 | (srP)->misc.X86.r_ebp = ebp; \ |
| 63 | } |
| 64 | #elif defined(VGP_amd64_linux) || defined(VGP_amd64_darwin) |
| 65 | # define GET_STARTREGS(srP) \ |
| 66 | { ULong rip, rsp, rbp; \ |
| 67 | __asm__ __volatile__( \ |
| 68 | "leaq 0(%%rip), %0;" \ |
| 69 | "movq %%rsp, %1;" \ |
| 70 | "movq %%rbp, %2;" \ |
| 71 | : "=r" (rip), "=r" (rsp), "=r" (rbp) \ |
| 72 | : /* reads none */ \ |
| 73 | : "memory" \ |
| 74 | ); \ |
| 75 | (srP)->r_pc = rip; \ |
| 76 | (srP)->r_sp = rsp; \ |
| 77 | (srP)->misc.AMD64.r_rbp = rbp; \ |
| 78 | } |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 79 | #elif defined(VGP_ppc32_linux) || defined(VGP_ppc32_aix5) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 80 | # define GET_STARTREGS(srP) \ |
| 81 | { UInt cia, r1, lr; \ |
| 82 | __asm__ __volatile__( \ |
| 83 | "mflr 0;" /* r0 = lr */ \ |
| 84 | "bl m_libcassert_get_ip;" /* lr = pc */ \ |
| 85 | "m_libcassert_get_ip:\n" \ |
| 86 | "mflr %0;" /* %0 = pc */ \ |
| 87 | "mtlr 0;" /* restore lr */ \ |
| 88 | "mr %1,1;" /* %1 = r1 */ \ |
| 89 | "mr %2,0;" /* %2 = lr */ \ |
| 90 | : "=r" (cia), "=r" (r1), "=r" (lr) \ |
| 91 | : /* reads none */ \ |
| 92 | : "r0" /* trashed */ \ |
| 93 | ); \ |
sewardj | f5f1e12 | 2010-01-02 13:24:58 +0000 | [diff] [blame] | 94 | (srP)->r_pc = (ULong)cia; \ |
| 95 | (srP)->r_sp = (ULong)r1; \ |
| 96 | (srP)->misc.PPC32.r_lr = lr; \ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 97 | } |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 98 | #elif defined(VGP_ppc64_linux) || defined(VGP_ppc64_aix5) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 99 | # define GET_STARTREGS(srP) \ |
| 100 | { ULong cia, r1, lr; \ |
| 101 | __asm__ __volatile__( \ |
| 102 | "mflr 0;" /* r0 = lr */ \ |
| 103 | "bl .m_libcassert_get_ip;" /* lr = pc */ \ |
| 104 | ".m_libcassert_get_ip:\n" \ |
| 105 | "mflr %0;" /* %0 = pc */ \ |
| 106 | "mtlr 0;" /* restore lr */ \ |
| 107 | "mr %1,1;" /* %1 = r1 */ \ |
| 108 | "mr %2,0;" /* %2 = lr */ \ |
| 109 | : "=r" (cia), "=r" (r1), "=r" (lr) \ |
| 110 | : /* reads none */ \ |
| 111 | : "r0" /* trashed */ \ |
| 112 | ); \ |
sewardj | f5f1e12 | 2010-01-02 13:24:58 +0000 | [diff] [blame] | 113 | (srP)->r_pc = cia; \ |
| 114 | (srP)->r_sp = r1; \ |
| 115 | (srP)->misc.PPC64.r_lr = lr; \ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 116 | } |
| 117 | #elif defined(VGP_arm_linux) |
| 118 | # define GET_STARTREGS(srP) \ |
sewardj | fa5ce56 | 2010-09-23 22:05:59 +0000 | [diff] [blame] | 119 | { UInt block[6]; \ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 120 | __asm__ __volatile__( \ |
| 121 | "str r15, [%0, #+0];" \ |
| 122 | "str r14, [%0, #+4];" \ |
| 123 | "str r13, [%0, #+8];" \ |
| 124 | "str r12, [%0, #+12];" \ |
| 125 | "str r11, [%0, #+16];" \ |
sewardj | fa5ce56 | 2010-09-23 22:05:59 +0000 | [diff] [blame] | 126 | "str r7, [%0, #+20];" \ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 127 | : /* out */ \ |
| 128 | : /* in */ "r"(&block[0]) \ |
| 129 | : /* trash */ "memory" \ |
| 130 | ); \ |
| 131 | (srP)->r_pc = block[0] - 8; \ |
| 132 | (srP)->r_sp = block[1]; \ |
| 133 | (srP)->misc.ARM.r14 = block[2]; \ |
| 134 | (srP)->misc.ARM.r12 = block[3]; \ |
| 135 | (srP)->misc.ARM.r11 = block[4]; \ |
sewardj | fa5ce56 | 2010-09-23 22:05:59 +0000 | [diff] [blame] | 136 | (srP)->misc.ARM.r7 = block[5]; \ |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 137 | } |
sewardj | b5b8740 | 2011-03-07 16:05:35 +0000 | [diff] [blame^] | 138 | #elif defined(VGP_s390x_linux) |
| 139 | # define GET_STARTREGS(srP) \ |
| 140 | { ULong ia, sp, fp, lr; \ |
| 141 | __asm__ __volatile__( \ |
| 142 | "bras %0,0f;" \ |
| 143 | "0: lgr %1,15;" \ |
| 144 | "lgr %2,11;" \ |
| 145 | "lgr %3,14;" \ |
| 146 | : "=r" (ia), "=r" (sp),"=r" (fp),"=r" (lr) \ |
| 147 | /* no read & clobber */ \ |
| 148 | ); \ |
| 149 | (srP)->r_pc = ia; \ |
| 150 | (srP)->r_sp = sp; \ |
| 151 | (srP)->misc.S390X.r_fp = fp; \ |
| 152 | (srP)->misc.S390X.r_lr = lr; \ |
| 153 | } |
njn | 9450d24 | 2005-06-26 20:50:05 +0000 | [diff] [blame] | 154 | #else |
| 155 | # error Unknown platform |
| 156 | #endif |
| 157 | |
| 158 | #define BACKTRACE_DEPTH 100 // nice and deep! |
njn | 3161e80 | 2005-06-20 03:38:27 +0000 | [diff] [blame] | 159 | |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 160 | /* Pull down the entire world */ |
| 161 | void VG_(exit)( Int status ) |
| 162 | { |
njn | 5b6b8fa | 2009-05-19 05:28:43 +0000 | [diff] [blame] | 163 | #if defined(VGO_linux) |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 164 | (void)VG_(do_syscall1)(__NR_exit_group, status ); |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 165 | #elif defined(VGO_aix5) || defined(VGO_darwin) |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 166 | (void)VG_(do_syscall1)(__NR_exit, status ); |
njn | 5b6b8fa | 2009-05-19 05:28:43 +0000 | [diff] [blame] | 167 | #else |
| 168 | # error Unknown OS |
| 169 | #endif |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 170 | /*NOTREACHED*/ |
njn | 4eeb0e5 | 2009-06-09 22:46:32 +0000 | [diff] [blame] | 171 | // We really shouldn't reach here. Just in case we do, use some very crude |
| 172 | // methods to force abort |
| 173 | __builtin_trap(); |
| 174 | *(volatile Int*)0 = 'x'; |
njn | f39e9a3 | 2005-06-12 02:43:17 +0000 | [diff] [blame] | 175 | } |
| 176 | |
njn | c7561b9 | 2005-06-19 01:24:32 +0000 | [diff] [blame] | 177 | // Print the scheduler status. |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 178 | void VG_(show_sched_status) ( void ) |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 179 | { |
| 180 | Int i; |
| 181 | VG_(printf)("\nsched status:\n"); |
| 182 | VG_(printf)(" running_tid=%d\n", VG_(get_running_tid)()); |
| 183 | for (i = 1; i < VG_N_THREADS; i++) { |
| 184 | if (VG_(threads)[i].status == VgTs_Empty) continue; |
| 185 | VG_(printf)( "\nThread %d: status = %s\n", i, |
| 186 | VG_(name_of_ThreadStatus)(VG_(threads)[i].status) ); |
| 187 | VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH ); |
| 188 | } |
| 189 | VG_(printf)("\n"); |
| 190 | } |
njn | c7561b9 | 2005-06-19 01:24:32 +0000 | [diff] [blame] | 191 | |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 192 | __attribute__ ((noreturn)) |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 193 | static void report_and_quit ( const Char* report, |
| 194 | UnwindStartRegs* startRegsIN ) |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 195 | { |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 196 | Addr stacktop; |
| 197 | Addr ips[BACKTRACE_DEPTH]; |
njn | 5f5ef2a | 2009-05-11 08:01:09 +0000 | [diff] [blame] | 198 | Int n_ips; |
sewardj | 4278172 | 2006-12-17 19:36:06 +0000 | [diff] [blame] | 199 | ThreadState *tst |
| 200 | = VG_(get_ThreadState)( VG_(lwpid_to_vgtid)( VG_(gettid)() ) ); |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 201 | |
| 202 | // If necessary, fake up an ExeContext which is of our actual real CPU |
| 203 | // state. Could cause problems if we got the panic/exception within the |
| 204 | // execontext/stack dump/symtab code. But it's better than nothing. |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 205 | UnwindStartRegs startRegs; |
| 206 | VG_(memset)(&startRegs, 0, sizeof(startRegs)); |
| 207 | |
| 208 | if (startRegsIN == NULL) { |
| 209 | GET_STARTREGS(&startRegs); |
| 210 | } else { |
| 211 | startRegs = *startRegsIN; |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 212 | } |
| 213 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 214 | stacktop = tst->os_state.valgrind_stack_init_SP; |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 215 | |
| 216 | n_ips = |
njn | 5f5ef2a | 2009-05-11 08:01:09 +0000 | [diff] [blame] | 217 | VG_(get_StackTrace_wrk)( |
| 218 | 0/*tid is unknown*/, |
| 219 | ips, BACKTRACE_DEPTH, |
| 220 | NULL/*array to dump SP values in*/, |
| 221 | NULL/*array to dump FP values in*/, |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 222 | &startRegs, stacktop |
njn | 5f5ef2a | 2009-05-11 08:01:09 +0000 | [diff] [blame] | 223 | ); |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 224 | VG_(clo_xml) = False; |
njn | 5f5ef2a | 2009-05-11 08:01:09 +0000 | [diff] [blame] | 225 | VG_(pp_StackTrace) (ips, n_ips); |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 226 | |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 227 | VG_(show_sched_status)(); |
njn | b8329f0 | 2009-04-16 00:33:20 +0000 | [diff] [blame] | 228 | VG_(printf)( |
| 229 | "\n" |
| 230 | "Note: see also the FAQ in the source distribution.\n" |
| 231 | "It contains workarounds to several common problems.\n" |
| 232 | "In particular, if Valgrind aborted or crashed after\n" |
| 233 | "identifying problems in your program, there's a good chance\n" |
| 234 | "that fixing those problems will prevent Valgrind aborting or\n" |
| 235 | "crashing, especially if it happened in m_mallocfree.c.\n" |
| 236 | "\n" |
| 237 | "If that doesn't help, please report this bug to: %s\n\n" |
| 238 | "In the bug report, send all the above text, the valgrind\n" |
| 239 | "version, and what OS and version you are using. Thanks.\n\n", |
| 240 | report); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 241 | VG_(exit)(1); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file, |
| 245 | Int line, const Char* fn, const HChar* format, ... ) |
| 246 | { |
| 247 | va_list vargs; |
| 248 | Char buf[256]; |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 249 | Char* component; |
| 250 | Char* bugs_to; |
| 251 | |
| 252 | static Bool entered = False; |
| 253 | if (entered) |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 254 | VG_(exit)(2); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 255 | entered = True; |
| 256 | |
| 257 | va_start(vargs, format); |
njn | aba25b4 | 2005-06-21 04:26:24 +0000 | [diff] [blame] | 258 | VG_(vsprintf) ( buf, format, vargs ); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 259 | va_end(vargs); |
| 260 | |
| 261 | if (isCore) { |
| 262 | component = "valgrind"; |
| 263 | bugs_to = VG_BUGS_TO; |
| 264 | } else { |
| 265 | component = VG_(details).name; |
| 266 | bugs_to = VG_(details).bug_reports_to; |
| 267 | } |
| 268 | |
sewardj | f349d55 | 2005-11-14 17:01:01 +0000 | [diff] [blame] | 269 | if (VG_(clo_xml)) |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 270 | VG_(printf_xml)("</valgrindoutput>\n"); |
sewardj | f349d55 | 2005-11-14 17:01:01 +0000 | [diff] [blame] | 271 | |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 272 | // Treat vg_assert2(0, "foo") specially, as a panicky abort |
| 273 | if (VG_STREQ(expr, "0")) { |
| 274 | VG_(printf)("\n%s: %s:%d (%s): the 'impossible' happened.\n", |
njn | 8a7b41b | 2007-09-23 00:51:24 +0000 | [diff] [blame] | 275 | component, file, line, fn ); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 276 | } else { |
| 277 | VG_(printf)("\n%s: %s:%d (%s): Assertion '%s' failed.\n", |
| 278 | component, file, line, fn, expr ); |
| 279 | } |
| 280 | if (!VG_STREQ(buf, "")) |
| 281 | VG_(printf)("%s: %s\n", component, buf ); |
| 282 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 283 | report_and_quit(bugs_to, NULL); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | __attribute__ ((noreturn)) |
| 287 | static void panic ( Char* name, Char* report, Char* str, |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 288 | UnwindStartRegs* startRegs ) |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 289 | { |
sewardj | f349d55 | 2005-11-14 17:01:01 +0000 | [diff] [blame] | 290 | if (VG_(clo_xml)) |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 291 | VG_(printf_xml)("</valgrindoutput>\n"); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 292 | VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str); |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 293 | report_and_quit(report, startRegs); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 294 | } |
| 295 | |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 296 | void VG_(core_panic_at) ( Char* str, UnwindStartRegs* startRegs ) |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 297 | { |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 298 | panic("valgrind", VG_BUGS_TO, str, startRegs); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | void VG_(core_panic) ( Char* str ) |
| 302 | { |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 303 | VG_(core_panic_at)(str, NULL); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 304 | } |
| 305 | |
| 306 | void VG_(tool_panic) ( Char* str ) |
| 307 | { |
sewardj | 59570ff | 2010-01-01 11:59:33 +0000 | [diff] [blame] | 308 | panic(VG_(details).name, VG_(details).bug_reports_to, str, NULL); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 309 | } |
| 310 | |
njn | 49b45ba | 2005-07-20 02:41:31 +0000 | [diff] [blame] | 311 | /* Print some helpful-ish text about unimplemented things, and give up. */ |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 312 | void VG_(unimplemented) ( Char* msg ) |
| 313 | { |
sewardj | f349d55 | 2005-11-14 17:01:01 +0000 | [diff] [blame] | 314 | if (VG_(clo_xml)) |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 315 | VG_(printf_xml)("</valgrindoutput>\n"); |
| 316 | VG_(umsg)("\n"); |
| 317 | VG_(umsg)("Valgrind detected that your program requires\n"); |
| 318 | VG_(umsg)("the following unimplemented functionality:\n"); |
| 319 | VG_(umsg)(" %s\n", msg); |
| 320 | VG_(umsg)("This may be because the functionality is hard to implement,\n"); |
| 321 | VG_(umsg)("or because no reasonable program would behave this way,\n"); |
| 322 | VG_(umsg)("or because nobody has yet needed it. " |
| 323 | "In any case, let us know at\n"); |
| 324 | VG_(umsg)("%s and/or try to work around the problem, if you can.\n", |
| 325 | VG_BUGS_TO); |
| 326 | VG_(umsg)("\n"); |
| 327 | VG_(umsg)("Valgrind has to exit now. Sorry. Bye!\n"); |
| 328 | VG_(umsg)("\n"); |
sewardj | 745fc45 | 2006-10-17 02:03:11 +0000 | [diff] [blame] | 329 | VG_(show_sched_status)(); |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 330 | VG_(exit)(1); |
| 331 | } |
| 332 | |
njn | 132bfcc | 2005-06-04 19:16:06 +0000 | [diff] [blame] | 333 | /*--------------------------------------------------------------------*/ |
| 334 | /*--- end ---*/ |
| 335 | /*--------------------------------------------------------------------*/ |
| 336 | |