1 //===--------------------- LLDBAssert.cpp --------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Utility/LLDBAssert.h" 11 #include "lldb/Core/StreamString.h" 12 #include "lldb/Host/Host.h" 13 14 using namespace lldb_private; 15 16 void 17 lldb_private::lldb_assert (int expression, 18 const char* expr_text, 19 const char* func, 20 const char* file, 21 unsigned int line) 22 { 23 if (expression) 24 ; 25 else 26 { 27 StreamString stream; 28 stream.Printf("Assertion failed: (%s), function %s, file %s, line %u\n", 29 expr_text, 30 func, 31 file, 32 line); 33 stream.Printf("backtrace leading to the failure:\n"); 34 Host::Backtrace(stream, 1000); 35 stream.Printf("please file a bug report against lldb reporting this failure log, and as many details as possible\n"); 36 printf("%s\n", stream.GetData()); 37 } 38 } 39