summaryrefslogtreecommitdiff
path: root/boost/stacktrace/detail
diff options
context:
space:
mode:
Diffstat (limited to 'boost/stacktrace/detail')
-rw-r--r--boost/stacktrace/detail/collect_msvc.ipp10
-rw-r--r--boost/stacktrace/detail/frame_msvc.ipp8
-rw-r--r--boost/stacktrace/detail/location_from_symbol.hpp18
-rw-r--r--boost/stacktrace/detail/safe_dump_win.ipp38
4 files changed, 39 insertions, 35 deletions
diff --git a/boost/stacktrace/detail/collect_msvc.ipp b/boost/stacktrace/detail/collect_msvc.ipp
index d75df558f3..37d3a298ac 100644
--- a/boost/stacktrace/detail/collect_msvc.ipp
+++ b/boost/stacktrace/detail/collect_msvc.ipp
@@ -14,15 +14,15 @@
#include <boost/stacktrace/safe_dump_to.hpp>
-#include <boost/detail/winapi/stack_backtrace.hpp>
+#include <boost/winapi/stack_backtrace.hpp>
namespace boost { namespace stacktrace { namespace detail {
std::size_t this_thread_frames::collect(native_frame_ptr_t* out_frames, std::size_t max_frames_count, std::size_t skip) BOOST_NOEXCEPT {
- return boost::detail::winapi::RtlCaptureStackBackTrace(
- static_cast<boost::detail::winapi::ULONG_>(skip),
- static_cast<boost::detail::winapi::ULONG_>(max_frames_count),
- const_cast<boost::detail::winapi::PVOID_*>(out_frames),
+ return boost::winapi::RtlCaptureStackBackTrace(
+ static_cast<boost::winapi::ULONG_>(skip),
+ static_cast<boost::winapi::ULONG_>(max_frames_count),
+ const_cast<boost::winapi::PVOID_*>(out_frames),
0
);
}
diff --git a/boost/stacktrace/detail/frame_msvc.ipp b/boost/stacktrace/detail/frame_msvc.ipp
index 6110524568..6e5eb490c6 100644
--- a/boost/stacktrace/detail/frame_msvc.ipp
+++ b/boost/stacktrace/detail/frame_msvc.ipp
@@ -21,8 +21,6 @@
#include <windows.h>
#include "dbgeng.h"
-#include <boost/detail/winapi/get_current_process.hpp>
-
#ifdef BOOST_MSVC
# pragma comment(lib, "ole32.lib")
# pragma comment(lib, "Dbgeng.lib")
@@ -59,7 +57,7 @@ public:
//
// If we call CoInitializeEx befire user - user may end up with different mode, which is a problem.
// So we need to call that initialization function as late as possible.
- const boost::detail::winapi::DWORD_ res = ::CoInitializeEx(0, COINIT_MULTITHREADED);
+ const DWORD res = ::CoInitializeEx(0, COINIT_MULTITHREADED);
ok_ = (res == S_OK || res == S_FALSE);
}
@@ -100,7 +98,7 @@ public:
};
-static std::string minwg_demangling_workaround(const std::string& s) {
+static std::string mingw_demangling_workaround(const std::string& s) {
#ifdef BOOST_GCC
if (s.empty()) {
return s;
@@ -239,7 +237,7 @@ public:
return result;
}
- result = minwg_demangling_workaround(
+ result = mingw_demangling_workaround(
result.substr(delimiter + 1)
);
diff --git a/boost/stacktrace/detail/location_from_symbol.hpp b/boost/stacktrace/detail/location_from_symbol.hpp
index ed82ef50b6..534ac91075 100644
--- a/boost/stacktrace/detail/location_from_symbol.hpp
+++ b/boost/stacktrace/detail/location_from_symbol.hpp
@@ -15,7 +15,7 @@
#if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__)
# include <dlfcn.h>
#else
-# include <boost/detail/winapi/dll.hpp>
+# include <boost/winapi/dll.hpp>
#endif
namespace boost { namespace stacktrace { namespace detail {
@@ -52,20 +52,20 @@ public:
#else
class location_from_symbol {
- BOOST_STATIC_CONSTEXPR boost::detail::winapi::DWORD_ DEFAULT_PATH_SIZE_ = 260;
+ BOOST_STATIC_CONSTEXPR boost::winapi::DWORD_ DEFAULT_PATH_SIZE_ = 260;
char file_name_[DEFAULT_PATH_SIZE_];
public:
explicit location_from_symbol(const void* addr) BOOST_NOEXCEPT {
file_name_[0] = '\0';
- boost::detail::winapi::MEMORY_BASIC_INFORMATION_ mbi;
- if (!boost::detail::winapi::VirtualQuery(addr, &mbi, sizeof(mbi))) {
+ boost::winapi::MEMORY_BASIC_INFORMATION_ mbi;
+ if (!boost::winapi::VirtualQuery(addr, &mbi, sizeof(mbi))) {
return;
}
- boost::detail::winapi::HMODULE_ handle = reinterpret_cast<boost::detail::winapi::HMODULE_>(mbi.AllocationBase);
- if (!boost::detail::winapi::GetModuleFileNameA(handle, file_name_, DEFAULT_PATH_SIZE_)) {
+ boost::winapi::HMODULE_ handle = reinterpret_cast<boost::winapi::HMODULE_>(mbi.AllocationBase);
+ if (!boost::winapi::GetModuleFileNameA(handle, file_name_, DEFAULT_PATH_SIZE_)) {
file_name_[0] = '\0';
return;
}
@@ -81,15 +81,15 @@ public:
};
class program_location {
- BOOST_STATIC_CONSTEXPR boost::detail::winapi::DWORD_ DEFAULT_PATH_SIZE_ = 260;
+ BOOST_STATIC_CONSTEXPR boost::winapi::DWORD_ DEFAULT_PATH_SIZE_ = 260;
char file_name_[DEFAULT_PATH_SIZE_];
public:
program_location() BOOST_NOEXCEPT {
file_name_[0] = '\0';
- const boost::detail::winapi::HMODULE_ handle = 0;
- if (!boost::detail::winapi::GetModuleFileNameA(handle, file_name_, DEFAULT_PATH_SIZE_)) {
+ const boost::winapi::HMODULE_ handle = 0;
+ if (!boost::winapi::GetModuleFileNameA(handle, file_name_, DEFAULT_PATH_SIZE_)) {
file_name_[0] = '\0';
}
}
diff --git a/boost/stacktrace/detail/safe_dump_win.ipp b/boost/stacktrace/detail/safe_dump_win.ipp
index 26f0516c01..23e81aab48 100644
--- a/boost/stacktrace/detail/safe_dump_win.ipp
+++ b/boost/stacktrace/detail/safe_dump_win.ipp
@@ -1,4 +1,4 @@
-// Copyright Antony Polukhin, 2016-2017.
+// Copyright Antony Polukhin, 2016-2018.
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -16,43 +16,49 @@
#include <boost/core/noncopyable.hpp>
-#include <boost/detail/winapi/get_current_process.hpp>
-#include <boost/detail/winapi/file_management.hpp>
-#include <boost/detail/winapi/handles.hpp>
-#include <boost/detail/winapi/access_rights.hpp>
+#include <boost/winapi/get_current_process.hpp>
+#include <boost/winapi/file_management.hpp>
+#include <boost/winapi/handles.hpp>
+#include <boost/winapi/access_rights.hpp>
namespace boost { namespace stacktrace { namespace detail {
-std::size_t dump(void* fd, const native_frame_ptr_t* frames, std::size_t frames_count) BOOST_NOEXCEPT {
- boost::detail::winapi::DWORD_ written;
- const boost::detail::winapi::DWORD_ bytes_to_write = static_cast<boost::detail::winapi::DWORD_>(
+std::size_t dump(void* /*fd*/, const native_frame_ptr_t* /*frames*/, std::size_t /*frames_count*/) BOOST_NOEXCEPT {
+#if 0 // This code potentially could cause deadlocks (according to the MSDN). Disabled
+ boost::winapi::DWORD_ written;
+ const boost::winapi::DWORD_ bytes_to_write = static_cast<boost::winapi::DWORD_>(
sizeof(native_frame_ptr_t) * frames_count
);
- if (!boost::detail::winapi::WriteFile(fd, frames, bytes_to_write, &written, 0)) {
+ if (!boost::winapi::WriteFile(fd, frames, bytes_to_write, &written, 0)) {
return 0;
}
return frames_count;
+#endif
+ return 0;
}
-std::size_t dump(const char* file, const native_frame_ptr_t* frames, std::size_t frames_count) BOOST_NOEXCEPT {
- void* const fd = boost::detail::winapi::CreateFileA(
+std::size_t dump(const char* /*file*/, const native_frame_ptr_t* /*frames*/, std::size_t /*frames_count*/) BOOST_NOEXCEPT {
+#if 0 // This code causing deadlocks on some platforms. Disabled
+ void* const fd = boost::winapi::CreateFileA(
file,
- boost::detail::winapi::GENERIC_WRITE_,
+ boost::winapi::GENERIC_WRITE_,
0,
0,
- boost::detail::winapi::CREATE_ALWAYS_,
- boost::detail::winapi::FILE_ATTRIBUTE_NORMAL_,
+ boost::winapi::CREATE_ALWAYS_,
+ boost::winapi::FILE_ATTRIBUTE_NORMAL_,
0
);
- if (fd == boost::detail::winapi::invalid_handle_value) {
+ if (fd == boost::winapi::invalid_handle_value) {
return 0;
}
const std::size_t size = boost::stacktrace::detail::dump(fd, frames, frames_count);
- boost::detail::winapi::CloseHandle(fd);
+ boost::winapi::CloseHandle(fd);
return size;
+#endif
+ return 0;
}
}}} // namespace boost::stacktrace::detail