-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from compspec/add/dwarf-example
adding simple callsite/inline example
- Loading branch information
Showing
11 changed files
with
135 additions
and
27 deletions.
There are no files selected for viewing
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
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
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
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
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
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,31 @@ | ||
__author__ = "Vanessa Sochat" | ||
__copyright__ = "Copyright 2022, Vanessa Sochat" | ||
__license__ = "MPL 2.0" | ||
|
||
from model import DwarfDifference | ||
|
||
import os | ||
import sys | ||
import json | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
sys.path.insert(0, here) | ||
|
||
|
||
def main(): | ||
# Hard coded examples, for now | ||
lib1 = os.path.join(here, "lib", "callsite", "v1", "libcallsite.v1.so") | ||
lib2 = os.path.join(here, "lib", "callsite", "v2", "libcallsite.v2.so") | ||
|
||
for lib in lib1, lib2: | ||
if not os.path.exists(lib): | ||
sys.exit(f"{lib} does not exist.") | ||
|
||
# Run the diff! | ||
runner = DwarfDifference(lib1, lib2) | ||
result = runner.run() | ||
print(json.dumps(result, indent=4)) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
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 @@ | ||
all: | ||
g++ -g -Wall -fPIC -shared -o libcallsite.v1.so callsite.cpp |
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,11 @@ | ||
#include <unistd.h> | ||
|
||
static int inline_this() | ||
{ | ||
return getpid(); | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
return inline_this(); | ||
} |
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 @@ | ||
all: | ||
g++ -g -Wall -fPIC -shared -o libcallsite.v2.so callsite.cpp |
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,11 @@ | ||
#include <unistd.h> | ||
|
||
static int inline_that() | ||
{ | ||
return getpid(); | ||
} | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
return inline_that(); | ||
} |