Compare commits
2 Commits
24ca2d3531
...
dd15bb2205
Author | SHA1 | Date | |
---|---|---|---|
dd15bb2205 | |||
4b53b5544f |
@ -122,6 +122,7 @@ endif()
|
||||
-DPROJECT_COPYRIGHT=${PROJECT_COPYRIGHT}
|
||||
-DPROJECT_DESC=${PROJECT_DESC}
|
||||
-DPROJECT_DIST_DIR=${PROJECT_DIST_DIR}
|
||||
-DPROJECT_ENABLE_BACKWARD_CPP=${PROJECT_ENABLE_BACKWARD_CPP}
|
||||
-DPROJECT_ENABLE_BOOST=${PROJECT_ENABLE_BOOST}
|
||||
-DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB}
|
||||
-DPROJECT_ENABLE_CURL=${PROJECT_ENABLE_CURL}
|
||||
|
@ -6,6 +6,7 @@ include(cmake/libraries/openssl.cmake)
|
||||
|
||||
include(cmake/libraries/boost.cmake)
|
||||
|
||||
include(cmake/libraries/backward_cpp.cmake)
|
||||
include(cmake/libraries/cpp_httplib.cmake)
|
||||
include(cmake/libraries/curl.cmake)
|
||||
include(cmake/libraries/fuse.cmake)
|
||||
|
7
cmake/libraries/backward_cpp.cmake
Normal file
7
cmake/libraries/backward_cpp.cmake
Normal file
@ -0,0 +1,7 @@
|
||||
if(PROJECT_ENABLE_BACKWARD_CPP AND PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_BACKWARD_CPP)
|
||||
|
||||
if(PROJECT_IS_MINGW)
|
||||
link_libraries(msvcr90)
|
||||
endif()
|
||||
endif()
|
@ -1,3 +1,4 @@
|
||||
option(PROJECT_ENABLE_BACKWARD_CPP "Enable backward-cpp" ON)
|
||||
option(PROJECT_ENABLE_BOOST "Enable boost libraries" ON)
|
||||
option(PROJECT_ENABLE_CPP_HTTPLIB "Enable cpp-httplib" ON)
|
||||
option(PROJECT_ENABLE_CURL "Enable curl library" ON)
|
||||
|
@ -19,6 +19,7 @@ PROJECT_APP_LIST=(${PROJECT_NAME})
|
||||
PROJECT_PRIVATE_KEY=${DEVELOPER_PRIVATE_KEY}
|
||||
PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY}
|
||||
|
||||
PROJECT_ENABLE_BACKWARD_CPP=ON
|
||||
PROJECT_ENABLE_BOOST=ON
|
||||
PROJECT_ENABLE_CPP_HTTPLIB=ON
|
||||
PROJECT_ENABLE_CURL=ON
|
||||
@ -33,6 +34,7 @@ PROJECT_ENABLE_STDUUID=ON
|
||||
PROJECT_ENABLE_TESTING=ON
|
||||
PROJECT_ENABLE_WINFSP=ON
|
||||
|
||||
PROJECT_KEEP_BACKWARD_CPP=1
|
||||
PROJECT_STATIC_LINK=ON
|
||||
|
||||
PROJECT_MINGW64_COPY_DEPENDENCIES+=()
|
||||
|
@ -19,7 +19,7 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#if !defined(PROJECT_STATIC_LINK)
|
||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
#include "backward.hpp"
|
||||
#endif
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
using namespace repertory;
|
||||
|
||||
auto main(int argc, char **argv) -> int {
|
||||
#if !defined(PROJECT_STATIC_LINK)
|
||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
static backward::SignalHandling sh;
|
||||
#endif
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#if !defined(PROJECT_STATIC_LINK)
|
||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
#include "backward.hpp"
|
||||
#endif
|
||||
|
||||
@ -36,7 +36,7 @@ std::size_t PROVIDER_INDEX{0U};
|
||||
#endif // _WIN32
|
||||
|
||||
auto main(int argc, char **argv) -> int {
|
||||
#if !defined(PROJECT_STATIC_LINK)
|
||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
static backward::SignalHandling sh;
|
||||
#endif
|
||||
|
||||
|
@ -202,6 +202,7 @@ fi
|
||||
|
||||
if [ "${PROJECT_STATIC_LINK}" == "ON" ]; then
|
||||
PROJECT_BUILD_SHARED_LIBS=OFF
|
||||
PROJECT_ENABLE_BACKWARD_CPP=OFF
|
||||
else
|
||||
PROJECT_BUILD_SHARED_LIBS=ON
|
||||
fi
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
PROJECT_LIBRARIES=(
|
||||
BACKWARD_CPP
|
||||
BOOST
|
||||
CPP_HTTPLIB
|
||||
CURL
|
||||
@ -17,6 +18,7 @@ PROJECT_LIBRARIES=(
|
||||
)
|
||||
|
||||
declare -A PROJECT_CLEANUP
|
||||
PROJECT_CLEANUP[BACKWARD_CPP]="include/backward.hpp:src/backward.cpp"
|
||||
PROJECT_CLEANUP[BOOST]="boost_*"
|
||||
PROJECT_CLEANUP[CPP_HTTPLIB]="cpp-httplib-*"
|
||||
PROJECT_CLEANUP[CURL]="curl-*"
|
||||
|
@ -1,3 +1,4 @@
|
||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
/*
|
||||
* backward.hpp
|
||||
* Copyright 2013 Google Inc. All Rights Reserved.
|
||||
@ -81,17 +82,17 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <new>
|
||||
#include <sstream>
|
||||
#include <streambuf>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <exception>
|
||||
#include <iterator>
|
||||
|
||||
#if defined(BACKWARD_SYSTEM_LINUX)
|
||||
|
||||
@ -507,11 +508,17 @@ typedef pdb_symbol current;
|
||||
|
||||
namespace details {
|
||||
|
||||
template <typename T> struct rm_ptr { typedef T type; };
|
||||
template <typename T> struct rm_ptr {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <typename T> struct rm_ptr<T *> { typedef T type; };
|
||||
template <typename T> struct rm_ptr<T *> {
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <typename T> struct rm_ptr<const T *> { typedef const T type; };
|
||||
template <typename T> struct rm_ptr<const T *> {
|
||||
typedef const T type;
|
||||
};
|
||||
|
||||
template <typename R, typename T, R (*F)(T)> struct deleter {
|
||||
template <typename U> void operator()(U &ptr) const { (*F)(ptr); }
|
||||
@ -1252,7 +1259,8 @@ template <typename TAG> class TraceResolverImpl;
|
||||
|
||||
#ifdef BACKWARD_SYSTEM_UNKNOWN
|
||||
|
||||
template <> class TraceResolverImpl<system_tag::unknown_tag>
|
||||
template <>
|
||||
class TraceResolverImpl<system_tag::unknown_tag>
|
||||
: public TraceResolverImplBase {};
|
||||
|
||||
#endif
|
||||
@ -3349,7 +3357,8 @@ private:
|
||||
char **srcfiles = 0;
|
||||
Dwarf_Signed file_count = 0;
|
||||
if (dwarf_srcfiles(cu_die, &srcfiles, &file_count, &error) == DW_DLV_OK) {
|
||||
if (file_count > 0 && file_index <= static_cast<Dwarf_Unsigned>(file_count)) {
|
||||
if (file_count > 0 &&
|
||||
file_index <= static_cast<Dwarf_Unsigned>(file_count)) {
|
||||
file = std::string(srcfiles[file_index - 1]);
|
||||
}
|
||||
|
||||
@ -3605,7 +3614,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <> class TraceResolverImpl<system_tag::windows_tag>
|
||||
template <>
|
||||
class TraceResolverImpl<system_tag::windows_tag>
|
||||
: public TraceResolverImplBase {
|
||||
public:
|
||||
TraceResolverImpl() {
|
||||
@ -3619,13 +3629,13 @@ public:
|
||||
DWORD symOptions = SymGetOptions();
|
||||
symOptions |= SYMOPT_LOAD_LINES | SYMOPT_UNDNAME;
|
||||
SymSetOptions(symOptions);
|
||||
EnumProcessModules(process, &module_handles[0],
|
||||
static_cast<DWORD>(module_handles.size() * sizeof(HMODULE)),
|
||||
&cbNeeded);
|
||||
EnumProcessModules(
|
||||
process, &module_handles[0],
|
||||
static_cast<DWORD>(module_handles.size() * sizeof(HMODULE)), &cbNeeded);
|
||||
module_handles.resize(cbNeeded / sizeof(HMODULE));
|
||||
EnumProcessModules(process, &module_handles[0],
|
||||
static_cast<DWORD>(module_handles.size() * sizeof(HMODULE)),
|
||||
&cbNeeded);
|
||||
EnumProcessModules(
|
||||
process, &module_handles[0],
|
||||
static_cast<DWORD>(module_handles.size() * sizeof(HMODULE)), &cbNeeded);
|
||||
std::transform(module_handles.begin(), module_handles.end(),
|
||||
std::back_inserter(modules), get_mod_info(process));
|
||||
void *base = modules[0].base_address;
|
||||
@ -3809,9 +3819,10 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
// Allow adding to paths gotten from BACKWARD_CXX_SOURCE_PREFIXES after loading the
|
||||
// library; this can be useful when the library is loaded when the locations are unknown
|
||||
// Warning: Because this edits the static paths variable, it is *not* intrinsiclly thread safe
|
||||
// Allow adding to paths gotten from BACKWARD_CXX_SOURCE_PREFIXES after
|
||||
// loading the library; this can be useful when the library is loaded when the
|
||||
// locations are unknown Warning: Because this edits the static paths
|
||||
// variable, it is *not* intrinsiclly thread safe
|
||||
static void add_paths_to_env_variable_impl(const std::string &to_add) {
|
||||
get_mutable_paths_from_env_variable().push_back(to_add);
|
||||
}
|
||||
@ -3830,7 +3841,8 @@ private:
|
||||
}
|
||||
|
||||
static std::vector<std::string> &get_mutable_paths_from_env_variable() {
|
||||
static volatile std::vector<std::string> paths = get_paths_from_env_variable_impl();
|
||||
static volatile std::vector<std::string> paths =
|
||||
get_paths_from_env_variable_impl();
|
||||
return const_cast<std::vector<std::string> &>(paths);
|
||||
}
|
||||
|
||||
@ -4494,3 +4506,4 @@ public:
|
||||
} // namespace backward
|
||||
|
||||
#endif /* H_GUARD */
|
||||
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
@ -1,3 +1,4 @@
|
||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||
// Pick your poison.
|
||||
//
|
||||
// On GNU/Linux, you have few choices to get the most out of your stack trace.
|
||||
@ -40,3 +41,4 @@ namespace backward {
|
||||
backward::SignalHandling sh;
|
||||
|
||||
} // namespace backward
|
||||
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
Reference in New Issue
Block a user