Merge pull request #188 from shinh/remove-configure
authorFumitoshi Ukai <fumitoshi.ukai@gmail.com>
Fri, 12 May 2017 05:57:09 +0000 (14:57 +0900)
committerGitHub <noreply@github.com>
Fri, 12 May 2017 05:57:09 +0000 (14:57 +0900)
Remove files generated by autotools

closes #165

CMakeLists.txt
src/logging_unittest.cc
src/stacktrace_x86-inl.h
src/symbolize_unittest.cc
src/utilities.cc
src/utilities.h

index 7ede6e7..7415eab 100644 (file)
@@ -14,7 +14,7 @@ enable_testing ()
 
 set (GLOG_MAJOR_VERSION 0)
 set (GLOG_MINOR_VERSION 3)
-set (GLOG_PATCH_VERSION 4)
+set (GLOG_PATCH_VERSION 5)
 
 set (GLOG_VERSION
   ${GLOG_MAJOR_VERSION}.${GLOG_MINOR_VERSION}.${GLOG_PATCH_VERSION})
index b886222..97cbeaa 100644 (file)
@@ -282,7 +282,7 @@ void TestLogging(bool check_counts) {
 }
 
 static void NoAllocNewHook() {
-  CHECK(false) << "unexpected new";
+  LOG(FATAL) << "unexpected new";
 }
 
 struct NewHook {
index cfd31f7..3b8d5a8 100644 (file)
@@ -93,16 +93,23 @@ static void **NextStackFrame(void **old_sp) {
 // If you change this function, also change GetStackFrames below.
 int GetStackTrace(void** result, int max_depth, int skip_count) {
   void **sp;
-#ifdef __i386__
+
+#ifdef __GNUC__
+#if __GNUC__ * 100 + __GNUC_MINOR__ >= 402
+#define USE_BUILTIN_FRAME_ADDRESS
+#endif
+#endif
+
+#ifdef USE_BUILTIN_FRAME_ADDRESS
+  sp = reinterpret_cast<void**>(__builtin_frame_address(0));
+#elif defined(__i386__)
   // Stack frame format:
   //    sp[0]   pointer to previous frame
   //    sp[1]   caller address
   //    sp[2]   first argument
   //    ...
   sp = (void **)&result - 2;
-#endif
-
-#ifdef __x86_64__
+#elif defined(__x86_64__)
   // __builtin_frame_address(0) can return the wrong address on gcc-4.1.0-k8
   unsigned long rbp;
   // Move the value of the register %rbp into the local variable rbp.
index 05cb8a1..bdd2f03 100644 (file)
@@ -99,7 +99,13 @@ TEST(Symbolize, Symbolize) {
 
   // Compilers should give us pointers to them.
   EXPECT_STREQ("nonstatic_func", TrySymbolize((void *)(&nonstatic_func)));
-  EXPECT_STREQ("static_func", TrySymbolize((void *)(&static_func)));
+
+  // The name of an internal linkage symbol is not specified; allow either a
+  // mangled or an unmangled name here.
+  const char *static_func_symbol = TrySymbolize((void *)(&static_func));
+  CHECK(NULL != static_func_symbol);
+  EXPECT_TRUE(strcmp("static_func", static_func_symbol) == 0 ||
+              strcmp("static_func()", static_func_symbol) == 0);
 
   EXPECT_TRUE(NULL == TrySymbolize(NULL));
 }
@@ -254,8 +260,13 @@ static const char *SymbolizeStackConsumption(void *pc, int *stack_consumed) {
   return g_symbolize_result;
 }
 
+#ifdef __ppc64__
+// Symbolize stack consumption should be within 4kB.
+const int kStackConsumptionUpperLimit = 4096;
+#else
 // Symbolize stack consumption should be within 2kB.
 const int kStackConsumptionUpperLimit = 2048;
+#endif
 
 TEST(Symbolize, SymbolizeStackConsumption) {
   int stack_consumed;
@@ -267,9 +278,13 @@ TEST(Symbolize, SymbolizeStackConsumption) {
   EXPECT_GT(stack_consumed, 0);
   EXPECT_LT(stack_consumed, kStackConsumptionUpperLimit);
 
+  // The name of an internal linkage symbol is not specified; allow either a
+  // mangled or an unmangled name here.
   symbol = SymbolizeStackConsumption((void *)(&static_func),
                                      &stack_consumed);
-  EXPECT_STREQ("static_func", symbol);
+  CHECK(NULL != symbol);
+  EXPECT_TRUE(strcmp("static_func", symbol) == 0 ||
+              strcmp("static_func()", symbol) == 0);
   EXPECT_GT(stack_consumed, 0);
   EXPECT_LT(stack_consumed, kStackConsumptionUpperLimit);
 }
index 5c88e58..0d686eb 100644 (file)
@@ -349,4 +349,12 @@ _END_GOOGLE_NAMESPACE_
 // Make an implementation of stacktrace compiled.
 #ifdef STACKTRACE_H
 # include STACKTRACE_H
+# if 0
+// For include scanners which can't handle macro expansions.
+#  include "stacktrace_libunwind-inl.h"
+#  include "stacktrace_x86-inl.h"
+#  include "stacktrace_x86_64-inl.h"
+#  include "stacktrace_powerpc-inl.h"
+#  include "stacktrace_generic-inl.h"
+# endif
 #endif
index 5f79968..101ca64 100644 (file)
@@ -39,7 +39,9 @@
 #elif defined(__CYGWIN__) || defined(__CYGWIN32__)
 # define OS_CYGWIN
 #elif defined(linux) || defined(__linux) || defined(__linux__)
-# define OS_LINUX
+# ifndef OS_LINUX
+#  define OS_LINUX
+# endif
 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
 # define OS_MACOSX
 #elif defined(__FreeBSD__)