LLDB  mainline
LLDBAssert.cpp
Go to the documentation of this file.
1 //===--------------------- LLDBAssert.cpp ------------------------*- C++-*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 #include "llvm/Support/Format.h"
12 #include "llvm/Support/Signals.h"
13 #include "llvm/Support/raw_ostream.h"
14 
15 using namespace llvm;
16 using namespace lldb_private;
17 
18 void lldb_private::lldb_assert(bool expression, const char *expr_text,
19  const char *func, const char *file,
20  unsigned int line) {
21  if (LLVM_LIKELY(expression))
22  return;
23 
24  errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
25  expr_text, func, file, line);
26  errs() << "backtrace leading to the failure:\n";
27  llvm::sys::PrintStackTrace(errs());
28  errs() << "please file a bug report against lldb reporting this failure "
29  "log, and as many details as possible\n";
30 }
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
Definition: Debugger.h:71
void lldb_assert(bool expression, const char *expr_text, const char *func, const char *file, unsigned int line)
Definition: LLDBAssert.cpp:18