mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Fix stack_trace_test for ARM64
When symbolize.cc is built with unwind tables function from the lib calling into symbolize.cc might be duplicated in stack trace (libunwind fallback to LR) PiperOrigin-RevId: 514324815 Change-Id: I76ee4ccf5aaf388924714284d9896fa367f5f752
This commit is contained in:
parent
550b26587f
commit
64b52ff3b5
|
@ -96,6 +96,7 @@ void SymbolizationWorksCommon(TestCase param) {
|
||||||
EXPECT_THAT(result.stack_trace(),
|
EXPECT_THAT(result.stack_trace(),
|
||||||
Contains(StartsWith("RecurseB")).Times(5));
|
Contains(StartsWith("RecurseB")).Times(5));
|
||||||
} else if (param.testmode == 3) {
|
} else if (param.testmode == 3) {
|
||||||
|
EXPECT_THAT(result.stack_trace(), Contains(StartsWith("LibCallCallback")));
|
||||||
EXPECT_THAT(result.stack_trace(), Contains(StartsWith("LibRecurse")));
|
EXPECT_THAT(result.stack_trace(), Contains(StartsWith("LibRecurse")));
|
||||||
EXPECT_THAT(result.stack_trace(),
|
EXPECT_THAT(result.stack_trace(),
|
||||||
Contains(StartsWith("LibRecurseA")).Times(5));
|
Contains(StartsWith("LibRecurseA")).Times(5));
|
||||||
|
|
|
@ -6,20 +6,24 @@ ABSL_ATTRIBUTE_NOINLINE
|
||||||
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
||||||
void LibRecurseA(void (*cb)(int), int data, int n);
|
void LibRecurseA(void (*cb)(int), int data, int n);
|
||||||
|
|
||||||
|
ABSL_ATTRIBUTE_NOINLINE
|
||||||
|
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
||||||
|
void LibCallCallback(void (*cb)(int), int data) { cb(data); }
|
||||||
|
|
||||||
ABSL_ATTRIBUTE_NOINLINE
|
ABSL_ATTRIBUTE_NOINLINE
|
||||||
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
ABSL_ATTRIBUTE_NO_TAIL_CALL
|
||||||
void LibRecurseB(void (*cb)(int), int data, int n) {
|
void LibRecurseB(void (*cb)(int), int data, int n) {
|
||||||
if (n > 1) {
|
if (n > 1) {
|
||||||
return LibRecurseA(cb, data, n - 1);
|
return LibRecurseA(cb, data, n - 1);
|
||||||
}
|
}
|
||||||
return cb(data);
|
return LibCallCallback(cb, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibRecurseA(void (*cb)(int), int data, int n) {
|
void LibRecurseA(void (*cb)(int), int data, int n) {
|
||||||
if (n > 1) {
|
if (n > 1) {
|
||||||
return LibRecurseB(cb, data, n - 1);
|
return LibRecurseB(cb, data, n - 1);
|
||||||
}
|
}
|
||||||
return cb(data);
|
return LibCallCallback(cb, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibRecurse(void (*cb)(int), int data, int n) { LibRecurseA(cb, data, n); }
|
void LibRecurse(void (*cb)(int), int data, int n) { LibRecurseA(cb, data, n); }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user