diff options
author | Zachary Turner <zturner@google.com> | 2015-03-06 20:45:43 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-03-06 20:45:43 +0000 |
commit | a893d3014b763c20071cd9525428489357850f00 (patch) | |
tree | c951e9dfd9d7904f02e76d2e24809b5b5bb92396 /lldb/source/Host/freebsd/Host.cpp | |
parent | 829c7347d1f51eadf536687b04b0c2e35581d864 (diff) | |
download | bcm5719-llvm-a893d3014b763c20071cd9525428489357850f00.tar.gz bcm5719-llvm-a893d3014b763c20071cd9525428489357850f00.zip |
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
Diffstat (limited to 'lldb/source/Host/freebsd/Host.cpp')
-rw-r--r-- | lldb/source/Host/freebsd/Host.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lldb/source/Host/freebsd/Host.cpp b/lldb/source/Host/freebsd/Host.cpp index e2bc1dc6232..62cf29365b0 100644 --- a/lldb/source/Host/freebsd/Host.cpp +++ b/lldb/source/Host/freebsd/Host.cpp @@ -50,35 +50,6 @@ extern "C" { using namespace lldb; using namespace lldb_private; -void -Host::Backtrace (Stream &strm, uint32_t max_frames) -{ - char backtrace_path[] = "/tmp/lldb-backtrace-tmp-XXXXXX"; - int backtrace_fd = ::mkstemp (backtrace_path); - if (backtrace_fd != -1) - { - std::vector<void *> frame_buffer (max_frames, NULL); - int count = ::backtrace (&frame_buffer[0], frame_buffer.size()); - ::backtrace_symbols_fd (&frame_buffer[0], count, backtrace_fd); - - const off_t buffer_size = ::lseek(backtrace_fd, 0, SEEK_CUR); - - if (::lseek(backtrace_fd, 0, SEEK_SET) == 0) - { - char *buffer = (char *)::malloc (buffer_size); - if (buffer) - { - ssize_t bytes_read = ::read (backtrace_fd, buffer, buffer_size); - if (bytes_read > 0) - strm.Write(buffer, bytes_read); - ::free (buffer); - } - } - ::close (backtrace_fd); - ::unlink (backtrace_path); - } -} - size_t Host::GetEnvironment (StringList &env) { |