-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(symcache): Add a test for mostly overlapping functions (#545)
Because we don't track file name functions, there are situations where the only distinguishing difference between two otherwise identical functions is their entry_pc. It's important to ensure that this doesn't change, so a test demonstrating one of those situations has been added to ensure that this behaviour isn't broken.
- Loading branch information
1 parent
4d98429
commit b4597b2
Showing
9 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
symbolic-symcache/tests/snapshots/test_writer__overlapping_funcs.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: symbolic-symcache/tests/test_writer.rs | ||
expression: FunctionsDebug(&symcache) | ||
|
||
--- | ||
0 _mh_execute_header | ||
3f50 main | ||
3f80 shell | ||
3f90 unique_i_swear | ||
3fa0 spin | ||
3fb0 unique_i_swear | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+9.45 KB
...estutils/fixtures/macos/overlapping_funcs.dSYM/Contents/Resources/DWARF/overlapping_funcs
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
# Replace clang with gcc if needed. Produces overlapping_funcs.dSYM which should be placed in | ||
# symbolic-testutils/fixtures/macos for test_write_functions_overlapping_funcs. Also produces an | ||
# executable which can be ignored. Or run it for a surprise! (It doesn't do anything.) | ||
clang -Weverything main.c -v -g -o overlapping_funcs testachio.c testaroni.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "testachio.h" | ||
#include "testaroni.h" | ||
|
||
int main() | ||
{ | ||
spin(); | ||
shell(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "testachio.h" | ||
|
||
void shell(void) | ||
{ | ||
unique_i_swear(); | ||
} | ||
|
||
static void unique_i_swear(void) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
void shell(void); | ||
static void unique_i_swear(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "testaroni.h" | ||
|
||
void spin(void) | ||
{ | ||
unique_i_swear(); | ||
} | ||
|
||
static void unique_i_swear(void) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
void spin(void); | ||
static void unique_i_swear(void); |