mirror of
https://github.com/QuasarApp/backward-cpp.git
synced 2025-05-05 06:19:37 +00:00
clang-format
This commit is contained in:
parent
738e3c6c5a
commit
29e4061494
16
backward.hpp
16
backward.hpp
@ -1001,14 +1001,13 @@ private:
|
|||||||
|
|
||||||
#ifdef BACKWARD_SYSTEM_LINUX
|
#ifdef BACKWARD_SYSTEM_LINUX
|
||||||
|
|
||||||
class TraceResolverLinuxBase
|
class TraceResolverLinuxBase : public TraceResolverImplBase {
|
||||||
: public TraceResolverImplBase {
|
|
||||||
public:
|
public:
|
||||||
TraceResolverLinuxBase()
|
TraceResolverLinuxBase()
|
||||||
: argv0_(get_argv0()), exec_path_(read_symlink("/proc/self/exe")) {
|
: argv0_(get_argv0()), exec_path_(read_symlink("/proc/self/exe")) {}
|
||||||
}
|
|
||||||
std::string resolve_exec_path(Dl_info &symbol_info) const {
|
std::string resolve_exec_path(Dl_info &symbol_info) const {
|
||||||
// mutates symbol_info.dli_fname to be filename to open and returns filename to display
|
// mutates symbol_info.dli_fname to be filename to open and returns filename
|
||||||
|
// to display
|
||||||
if (symbol_info.dli_fname == argv0_) {
|
if (symbol_info.dli_fname == argv0_) {
|
||||||
// dladdr returns argv[0] in dli_fname for symbols contained in
|
// dladdr returns argv[0] in dli_fname for symbols contained in
|
||||||
// the main executable, which is not a valid path if the
|
// the main executable, which is not a valid path if the
|
||||||
@ -1022,6 +1021,7 @@ public:
|
|||||||
return symbol_info.dli_fname;
|
return symbol_info.dli_fname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string argv0_;
|
std::string argv0_;
|
||||||
std::string exec_path_;
|
std::string exec_path_;
|
||||||
@ -3415,7 +3415,8 @@ public:
|
|||||||
// Double slashes (//) should not be a problem.
|
// Double slashes (//) should not be a problem.
|
||||||
std::string new_path = prefixes[i] + '/' + path;
|
std::string new_path = prefixes[i] + '/' + path;
|
||||||
_file.reset(new std::ifstream(new_path.c_str()));
|
_file.reset(new std::ifstream(new_path.c_str()));
|
||||||
if (is_open()) break;
|
if (is_open())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// 2. If no valid file found then fallback to opening the path as-is.
|
// 2. If no valid file found then fallback to opening the path as-is.
|
||||||
if (!_file || !is_open()) {
|
if (!_file || !is_open()) {
|
||||||
@ -3930,7 +3931,8 @@ public:
|
|||||||
#elif defined(__aarch64__)
|
#elif defined(__aarch64__)
|
||||||
error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.pc);
|
error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.pc);
|
||||||
#elif defined(__mips__)
|
#elif defined(__mips__)
|
||||||
error_addr = reinterpret_cast<void *>(reinterpret_cast<struct sigcontext*>(&uctx->uc_mcontext)->sc_pc);
|
error_addr = reinterpret_cast<void *>(
|
||||||
|
reinterpret_cast<struct sigcontext *>(&uctx->uc_mcontext)->sc_pc);
|
||||||
#elif defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || \
|
#elif defined(__ppc__) || defined(__powerpc) || defined(__powerpc__) || \
|
||||||
defined(__POWERPC__)
|
defined(__POWERPC__)
|
||||||
error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.regs->nip);
|
error_addr = reinterpret_cast<void *>(uctx->uc_mcontext.regs->nip);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user