diff options
author | <shinichiro.hamaji@gmail.com> | 2008-10-14 00:32:16 +0000 |
---|---|---|
committer | <shinichiro.hamaji@gmail.com> | 2008-10-14 00:32:16 +0000 |
commit | e1fb8f60e9922765d5693a3e219c8d416b6c514f (patch) | |
tree | 45a792b82c244b6f5922cb75ccd86bb137b2e7bb /src | |
parent | bf6108bb8cf3c43da1db6d9089b60b36437ca28b (diff) | |
download | glog-e1fb8f60e9922765d5693a3e219c8d416b6c514f.tar.gz glog-e1fb8f60e9922765d5693a3e219c8d416b6c514f.tar.bz2 glog-e1fb8f60e9922765d5693a3e219c8d416b6c514f.zip |
Add __attribute__((noinline)) for StackGrowsDown. This is necessary for recent GCC (4.3).
git-svn-id: https://google-glog.googlecode.com/svn/trunk@6 eb4d4688-79bd-11dd-afb4-1d65580434c0
Diffstat (limited to 'src')
-rw-r--r-- | src/symbolize_unittest.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/symbolize_unittest.cc b/src/symbolize_unittest.cc index 2405362..e172af9 100644 --- a/src/symbolize_unittest.cc +++ b/src/symbolize_unittest.cc @@ -126,7 +126,7 @@ const char kAlternateStackFillValue = 0x55; // These helper functions look at the alternate stack buffer, and figure // out what portion of this buffer has been touched - this is the stack // consumption of the signal handler running on this alternate stack. -static bool StackGrowsDown(int *x) { +static ATTRIBUTE_NOINLINE bool StackGrowsDown(int *x) { int y; return &y < x; } @@ -277,7 +277,7 @@ void ATTRIBUTE_NOINLINE TestWithPCInsideNonInlineFunction() { void *pc = non_inline_func(); const char *symbol = TrySymbolize(pc); CHECK(symbol != NULL); - CHECK_EQ(0, strcmp(symbol, "non_inline_func")); + CHECK_STREQ(symbol, "non_inline_func"); cout << "Test case TestWithPCInsideNonInlineFunction passed." << endl; #endif } @@ -287,7 +287,7 @@ void ATTRIBUTE_NOINLINE TestWithPCInsideInlineFunction() { void *pc = inline_func(); // Must be inlined. const char *symbol = TrySymbolize(pc); CHECK(symbol != NULL); - CHECK_EQ(0, strcmp(symbol, __FUNCTION__)); + CHECK_STREQ(symbol, __FUNCTION__); cout << "Test case TestWithPCInsideInlineFunction passed." << endl; #endif } @@ -299,7 +299,7 @@ void ATTRIBUTE_NOINLINE TestWithReturnAddress() { void *return_address = __builtin_return_address(0); const char *symbol = TrySymbolize(return_address); CHECK(symbol != NULL); - CHECK_EQ(0, strcmp(symbol, "main")); + CHECK_STREQ(symbol, "main"); cout << "Test case TestWithReturnAddress passed." << endl; #endif } @@ -307,6 +307,9 @@ void ATTRIBUTE_NOINLINE TestWithReturnAddress() { int main(int argc, char **argv) { FLAGS_logtostderr = true; InitGoogleLogging(argv[0]); + // We don't want to get affected by the callback interface, that may be + // used to install some callback function at InitGoogle() time. + InstallSymbolizeCallback(NULL); // Symbolize() now only supports ELF binaries. // The test makes sense only if __ELF__ is defined. |