Files
clang-p2996/lldb/source/Utility/LLDBAssert.cpp
Zachary Turner a893d3014b Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()
This removes Host::Backtrace from the codebase, and changes all
call sites to use llvm::sys::PrintStackTrace().  This makes the
functionality available for all platforms, and even for platforms
which currently had a supported implementation of Host::Backtrace,
this patch should enable richer information in stack traces, such
as file and line number information, as well as giving it the
ability to unwind through inlined functions.

llvm-svn: 231511
2015-03-06 20:45:43 +00:00

37 lines
1.2 KiB
C++

//===--------------------- LLDBAssert.cpp --------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lldb/Utility/LLDBAssert.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Signals.h"
using namespace llvm;
using namespace lldb_private;
void
lldb_private::lldb_assert (int expression,
const char* expr_text,
const char* func,
const char* file,
unsigned int line)
{
if (expression)
;
else
{
errs() << format("Assertion failed: (%s), function %s, file %s, line %u\n",
expr_text, func, file, line);
errs() << "backtrace leading to the failure:\n";
llvm::sys::PrintStackTrace(errs());
errs() << "please file a bug report against lldb reporting this failure log, and as many details as possible\n";
}
}