From 92d45631deca2c5bf0d0014b6a286d6d17cdf3bb Mon Sep 17 00:00:00 2001 From: "HP_Owner@Hp" Date: Sun, 11 Dec 2011 02:33:22 -0600 Subject: [PATCH] removed warnings, a performance compilation error (erroneous comment) --- g2log/src/crashhandler_unix.cpp | 17 ++--------------- g2log/test_performance/main_threaded_worst.cpp | 2 +- g2log/test_performance/performance.h | 2 -- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/g2log/src/crashhandler_unix.cpp b/g2log/src/crashhandler_unix.cpp index 27a3b40..7cfbc98 100644 --- a/g2log/src/crashhandler_unix.cpp +++ b/g2log/src/crashhandler_unix.cpp @@ -31,26 +31,13 @@ void crashHandler(int signal_number, siginfo_t *info, void *unused_context) const size_t max_dump_size = 50; void* dump[max_dump_size]; size_t size = backtrace(dump, max_dump_size); - // overwrite sigaction with caller's address - char** messages = backtrace_symbols(dump, size); + char** messages = backtrace_symbols(dump, size); // overwrite sigaction with caller's address std::ostringstream oss; oss << "Received fatal signal: " << g2::internal::signalName(signal_number); oss << "(" << signal_number << ")" << std::endl; oss << "\tPID: " << getpid() << std::endl; - // Below is gcc specific demangling done. Just dumping the stack could be done with - //for(size_t idx = 1; idx < size && messages != nullptr; ++idx) // skip first frame, since that is here - //{ - // oss << "\tstack dump [" << idx << "] " << messages[idx] << std::endl; - //} - // HOWEVER - thiw would give mangled symbols in the dump: - //./g2log-example(_ZN5__jss5__X469__invokerIvMN8kjellkod6ActiveEFvvEIPS3_EEclEv+0x24) [0x80630e0] - // - // Using the GCC abi demangle the mangled symbols will be 'demangled': - // ./g2log-example : g2::internal::LogMessage::messageSave(char const*, ...)+0x3a [0x805f3dc] - // - // // dump stack: skip first frame, since that is here for(size_t idx = 1; idx < size && messages != nullptr; ++idx) { @@ -97,9 +84,9 @@ void crashHandler(int signal_number, siginfo_t *info, void *unused_context) } free(real_name); // mallocated by abi::__cxa_demangle(...) } - // no demangling done -- just dump the whole line else { + // no demangling done -- just dump the whole line oss << "\tstack dump [" << idx << "] " << messages[idx] << std::endl; } } // END: for(size_t idx = 1; idx < size && messages != nullptr; ++idx) diff --git a/g2log/test_performance/main_threaded_worst.cpp b/g2log/test_performance/main_threaded_worst.cpp index 8cf6b56..d445bcd 100644 --- a/g2log/test_performance/main_threaded_worst.cpp +++ b/g2log/test_performance/main_threaded_worst.cpp @@ -137,7 +137,7 @@ int main(int argc, char** argv) delete [] threads_result; // finally get rid of them std::sort (all_measurements.begin(), all_measurements.end()); - std::map value_amounts; + std::map value_amounts; // for(long long& idx : all_measurements) --- didn't work?! for(auto iter = all_measurements.begin(); iter != all_measurements.end(); ++iter) { diff --git a/g2log/test_performance/performance.h b/g2log/test_performance/performance.h index 04cc518..e8fa7fd 100644 --- a/g2log/test_performance/performance.h +++ b/g2log/test_performance/performance.h @@ -3,8 +3,6 @@ * with no warranties. This code is yours to share, use and modify with no * strings attached and no restrictions or obligations. * ============================================================================*/ - * ********************************************* */ - #ifndef PERFORMANCE_G2_TEST_H_ #define PERFORMANCE_G2_TEST_H_