diff --git a/src/cpptrace.cpp b/src/cpptrace.cpp index ce3f214..6065132 100644 --- a/src/cpptrace.cpp +++ b/src/cpptrace.cpp @@ -9,10 +9,10 @@ #if !(defined(CPPTRACE_FULL_TRACE_WITH_LIBBACKTRACE) || defined(CPPTRACE_FULL_TRACE_WITH_STACKTRACE)) -#include "symbols/cpptrace_symbols.hpp" -#include "unwind/cpptrace_unwind.hpp" -#include "demangle/cpptrace_demangle.hpp" -#include "platform/cpptrace_common.hpp" +#include "symbols/symbols.hpp" +#include "unwind/unwind.hpp" +#include "demangle/demangle.hpp" +#include "platform/common.hpp" namespace cpptrace { CPPTRACE_FORCE_NO_INLINE @@ -31,8 +31,8 @@ namespace cpptrace { // full trace -#include "full/cpptrace_full_trace.hpp" -#include "demangle/cpptrace_demangle.hpp" +#include "full/full_trace.hpp" +#include "demangle/demangle.hpp" namespace cpptrace { CPPTRACE_FORCE_NO_INLINE diff --git a/src/demangle/cpptrace_demangle.hpp b/src/demangle/demangle.hpp similarity index 68% rename from src/demangle/cpptrace_demangle.hpp rename to src/demangle/demangle.hpp index 4f55efd..6445466 100644 --- a/src/demangle/cpptrace_demangle.hpp +++ b/src/demangle/demangle.hpp @@ -1,5 +1,5 @@ -#ifndef CPPTRACE_DEMANGLE_HPP -#define CPPTRACE_DEMANGLE_HPP +#ifndef DEMANGLE_HPP +#define DEMANGLE_HPP #include diff --git a/src/demangle/demangle_with_cxxabi.cpp b/src/demangle/demangle_with_cxxabi.cpp index fb193a5..1296e63 100644 --- a/src/demangle/demangle_with_cxxabi.cpp +++ b/src/demangle/demangle_with_cxxabi.cpp @@ -1,6 +1,6 @@ #ifdef CPPTRACE_DEMANGLE_WITH_CXXABI -#include "cpptrace_demangle.hpp" +#include "demangle.hpp" #include diff --git a/src/demangle/demangle_with_nothing.cpp b/src/demangle/demangle_with_nothing.cpp index a102fc9..a524584 100644 --- a/src/demangle/demangle_with_nothing.cpp +++ b/src/demangle/demangle_with_nothing.cpp @@ -1,6 +1,6 @@ #ifdef CPPTRACE_DEMANGLE_WITH_NOTHING -#include "cpptrace_demangle.hpp" +#include "demangle.hpp" #include diff --git a/src/full/cpptrace_full_trace.hpp b/src/full/full_trace.hpp similarity index 68% rename from src/full/cpptrace_full_trace.hpp rename to src/full/full_trace.hpp index 85d14a9..8d27cbe 100644 --- a/src/full/cpptrace_full_trace.hpp +++ b/src/full/full_trace.hpp @@ -1,8 +1,8 @@ -#ifndef CPPTRACE_FULL_TRACE_HPP -#define CPPTRACE_FULL_TRACE_HPP +#ifndef FULL_TRACE_HPP +#define FULL_TRACE_HPP #include -#include "../platform/cpptrace_common.hpp" +#include "../platform/common.hpp" #include #include diff --git a/src/full/full_trace_with_libbacktrace.cpp b/src/full/full_trace_with_libbacktrace.cpp index 2713a42..5db8629 100644 --- a/src/full/full_trace_with_libbacktrace.cpp +++ b/src/full/full_trace_with_libbacktrace.cpp @@ -1,8 +1,8 @@ #ifdef CPPTRACE_FULL_TRACE_WITH_LIBBACKTRACE #include -#include "../platform/cpptrace_program_name.hpp" -#include "../platform/cpptrace_common.hpp" +#include "../platform/program_name.hpp" +#include "../platform/common.hpp" #include #include diff --git a/src/full/full_trace_with_stacktrace.cpp b/src/full/full_trace_with_stacktrace.cpp index 49f952e..14fec0b 100644 --- a/src/full/full_trace_with_stacktrace.cpp +++ b/src/full/full_trace_with_stacktrace.cpp @@ -1,8 +1,8 @@ #ifdef CPPTRACE_FULL_TRACE_WITH_STACKTRACE #include -#include "cpptrace_full_trace.hpp" -#include "../platform/cpptrace_common.hpp" +#include "full_trace.hpp" +#include "../platform/common.hpp" #include #include diff --git a/src/platform/cpptrace_common.hpp b/src/platform/common.hpp similarity index 99% rename from src/platform/cpptrace_common.hpp rename to src/platform/common.hpp index a744db3..d88971a 100644 --- a/src/platform/cpptrace_common.hpp +++ b/src/platform/common.hpp @@ -1,5 +1,5 @@ -#ifndef CPPTRACE_COMMON_HPP -#define CPPTRACE_COMMON_HPP +#ifndef COMMON_HPP +#define COMMON_HPP #ifdef _MSC_VER #define CPPTRACE_FORCE_NO_INLINE __declspec(noinline) diff --git a/src/platform/cpptrace_macho.hpp b/src/platform/mach-o.hpp similarity index 99% rename from src/platform/cpptrace_macho.hpp rename to src/platform/mach-o.hpp index 86bfd0c..38307b1 100644 --- a/src/platform/cpptrace_macho.hpp +++ b/src/platform/mach-o.hpp @@ -1,5 +1,5 @@ -#ifndef CPPTRACE_MACHO_HPP -#define CPPTRACE_MACHO_HPP +#ifndef MACHO_HPP +#define MACHO_HPP #if IS_APPLE #include diff --git a/src/platform/cpptrace_program_name.hpp b/src/platform/program_name.hpp similarity index 93% rename from src/platform/cpptrace_program_name.hpp rename to src/platform/program_name.hpp index 4b9dc11..9fda208 100644 --- a/src/platform/cpptrace_program_name.hpp +++ b/src/platform/program_name.hpp @@ -1,5 +1,5 @@ -#ifndef CPPTRACE_PROGRAM_NAME_HPP -#define CPPTRACE_PROGRAM_NAME_HPP +#ifndef PROGRAM_NAME_HPP +#define PROGRAM_NAME_HPP #include @@ -9,6 +9,7 @@ namespace cpptrace { namespace detail { inline std::string program_name() { + // TODO: Cache this better char buffer[MAX_PATH + 1]; int res = GetModuleFileNameA(nullptr, buffer, MAX_PATH); if(res) { @@ -29,6 +30,7 @@ namespace cpptrace { namespace cpptrace { namespace detail { inline const char* program_name() { + // TODO: Cache this better static std::string name; if (!name.empty()) { std::uint32_t bufferSize = PATH_MAX + 1; diff --git a/src/symbols/cpptrace_symbols.hpp b/src/symbols/symbols.hpp similarity index 88% rename from src/symbols/cpptrace_symbols.hpp rename to src/symbols/symbols.hpp index 39c125a..0a4fdbe 100644 --- a/src/symbols/cpptrace_symbols.hpp +++ b/src/symbols/symbols.hpp @@ -1,5 +1,5 @@ -#ifndef CPPTRACE_SYMBOLS_HPP -#define CPPTRACE_SYMBOLS_HPP +#ifndef SYMBOLS_HPP +#define SYMBOLS_HPP #include diff --git a/src/symbols/symbols_with_addr2line.cpp b/src/symbols/symbols_with_addr2line.cpp index 1d01f4b..f536866 100644 --- a/src/symbols/symbols_with_addr2line.cpp +++ b/src/symbols/symbols_with_addr2line.cpp @@ -1,8 +1,8 @@ #ifdef CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE #include -#include "cpptrace_symbols.hpp" -#include "../platform/cpptrace_common.hpp" +#include "symbols.hpp" +#include "../platform/common.hpp" #include #include @@ -19,7 +19,7 @@ #include #include #if IS_APPLE - #include "../platform/cpptrace_macho.hpp" + #include "../platform/mach-o.hpp" #endif #elif IS_WINDOWS #include diff --git a/src/symbols/symbols_with_dbghelp.cpp b/src/symbols/symbols_with_dbghelp.cpp index 87f9eb8..e62983a 100644 --- a/src/symbols/symbols_with_dbghelp.cpp +++ b/src/symbols/symbols_with_dbghelp.cpp @@ -1,8 +1,8 @@ #ifdef CPPTRACE_GET_SYMBOLS_WITH_DBGHELP #include -#include "cpptrace_symbols.hpp" -#include "../platform/cpptrace_program_name.hpp" +#include "symbols.hpp" +#include "../platform/program_name.hpp" #include #include diff --git a/src/symbols/symbols_with_dl.cpp b/src/symbols/symbols_with_dl.cpp index 7d0cf3d..089d4fe 100644 --- a/src/symbols/symbols_with_dl.cpp +++ b/src/symbols/symbols_with_dl.cpp @@ -1,7 +1,7 @@ #ifdef CPPTRACE_GET_SYMBOLS_WITH_LIBDL #include -#include "cpptrace_symbols.hpp" +#include "symbols.hpp" #include #include diff --git a/src/symbols/symbols_with_libbacktrace.cpp b/src/symbols/symbols_with_libbacktrace.cpp index 5d5e5cc..17ee7df 100644 --- a/src/symbols/symbols_with_libbacktrace.cpp +++ b/src/symbols/symbols_with_libbacktrace.cpp @@ -1,8 +1,8 @@ #ifdef CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE #include -#include "cpptrace_symbols.hpp" -#include "../platform/cpptrace_program_name.hpp" +#include "symbols.hpp" +#include "../platform/program_name.hpp" #include #include diff --git a/src/symbols/symbols_with_nothing.cpp b/src/symbols/symbols_with_nothing.cpp index 78e42d7..b7ea6ce 100644 --- a/src/symbols/symbols_with_nothing.cpp +++ b/src/symbols/symbols_with_nothing.cpp @@ -1,7 +1,7 @@ #ifdef CPPTRACE_GET_SYMBOLS_WITH_NOTHING #include -#include "cpptrace_symbols.hpp" +#include "symbols.hpp" #include diff --git a/src/unwind/cpptrace_unwind.hpp b/src/unwind/unwind.hpp similarity index 79% rename from src/unwind/cpptrace_unwind.hpp rename to src/unwind/unwind.hpp index a890917..38ca151 100644 --- a/src/unwind/cpptrace_unwind.hpp +++ b/src/unwind/unwind.hpp @@ -1,7 +1,7 @@ -#ifndef CPPTRACE_UNWIND_HPP -#define CPPTRACE_UNWIND_HPP +#ifndef UNWIND_HPP +#define UNWIND_HPP -#include "../platform/cpptrace_common.hpp" +#include "../platform/common.hpp" #include #include diff --git a/src/unwind/unwind_with_execinfo.cpp b/src/unwind/unwind_with_execinfo.cpp index 8c72ee5..dd8dbec 100644 --- a/src/unwind/unwind_with_execinfo.cpp +++ b/src/unwind/unwind_with_execinfo.cpp @@ -1,7 +1,7 @@ #ifdef CPPTRACE_UNWIND_WITH_EXECINFO -#include "cpptrace_unwind.hpp" -#include "../platform/cpptrace_common.hpp" +#include "unwind.hpp" +#include "../platform/common.hpp" #include #include diff --git a/src/unwind/unwind_with_nothing.cpp b/src/unwind/unwind_with_nothing.cpp index b862f18..78a016f 100644 --- a/src/unwind/unwind_with_nothing.cpp +++ b/src/unwind/unwind_with_nothing.cpp @@ -1,6 +1,6 @@ #ifdef CPPTRACE_UNWIND_WITH_NOTHING -#include "cpptrace_unwind.hpp" +#include "unwind.hpp" #include #include diff --git a/src/unwind/unwind_with_unwind.cpp b/src/unwind/unwind_with_unwind.cpp index 6bc5e70..c4a2f5b 100644 --- a/src/unwind/unwind_with_unwind.cpp +++ b/src/unwind/unwind_with_unwind.cpp @@ -1,7 +1,7 @@ #ifdef CPPTRACE_UNWIND_WITH_UNWIND -#include "cpptrace_unwind.hpp" -#include "../platform/cpptrace_common.hpp" +#include "unwind.hpp" +#include "../platform/common.hpp" #include #include diff --git a/src/unwind/unwind_with_winapi.cpp b/src/unwind/unwind_with_winapi.cpp index 15f0fc4..548c622 100644 --- a/src/unwind/unwind_with_winapi.cpp +++ b/src/unwind/unwind_with_winapi.cpp @@ -1,8 +1,8 @@ #ifdef CPPTRACE_UNWIND_WITH_WINAPI #include -#include "cpptrace_unwind.hpp" -#include "../platform/cpptrace_common.hpp" +#include "unwind.hpp" +#include "../platform/common.hpp" #include