forked from nodejs/llnode
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
704 additions
and
1 deletion.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| "src/llnode.cc", | ||
| "src/llv8.cc", | ||
| "src/llv8-constants.cc", | ||
| "src/llscan.cc", | ||
| ], | ||
|
|
||
| "conditions": [ | ||
|
|
||
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,43 @@ | ||
| #!/usr/bin/env python | ||
| ''' | ||
| Created on 7 Apr 2016 | ||
| @author: hhellyer | ||
| ''' | ||
| import sys,os,subprocess | ||
|
|
||
| OTOOL_COMMAND = "otool -l {0}" | ||
|
|
||
| # Grab the details of the memory ranges in the process from otool. | ||
| def main(): | ||
| if( len(sys.argv) < 2 ): | ||
| print("Usage " + sys.argv[0] + " <core_file>") | ||
| sys.exit(1) | ||
| core_file = sys.argv[1] | ||
|
|
||
| otool_proc = subprocess.Popen( | ||
| OTOOL_COMMAND.format(core_file), shell=True, bufsize=1, | ||
| stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) | ||
| (otool_stdin, otool_stdout) = (otool_proc.stdin, otool_proc.stdout) | ||
|
|
||
| reading_segment = False | ||
| vaddress = "" | ||
|
|
||
| for line in otool_stdout: | ||
| line = line.strip() | ||
| if not line.startswith("vmaddr") and not reading_segment: | ||
| continue | ||
| elif line.startswith("vmaddr"): | ||
| # Might need to filer out segments that have a file offset of 0 | ||
| # (ie segments that aren't in the core!) | ||
| reading_segment = True | ||
| (name, vaddress) = line.split() | ||
| elif line.startswith("vmsize") and reading_segment: | ||
| reading_segment = False | ||
| memsize = line.split()[1] | ||
| # Simple format "address size", both in hex | ||
| print("{0} {1}".format(vaddress, memsize)) | ||
| vaddress = "" | ||
|
|
||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/usr/bin/env python | ||
| ''' | ||
| Created on 7 Apr 2016 | ||
| @author: hhellyer | ||
| ''' | ||
| import sys,os,subprocess | ||
|
|
||
| READELF_COMMAND = "readelf --segments {0}" | ||
|
|
||
| # Grab the details of the memory ranges in the process from readelf. | ||
| def main(): | ||
| if( len(sys.argv) < 2 ): | ||
| print("Usage " + sys.argv[0] + " <core_file>") | ||
| sys.exit(1) | ||
| core_file = sys.argv[1] | ||
|
|
||
| readelf_proc = subprocess.Popen( | ||
| READELF_COMMAND.format(core_file), shell=True, bufsize=1, | ||
| stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) | ||
| (readelf_stdin, readelf_stdout) = (readelf_proc.stdin, readelf_proc.stdout) | ||
|
|
||
| reading_segment = False | ||
| vaddress = "" | ||
|
|
||
| for line in readelf_stdout: | ||
| line = line.strip() | ||
| if not line.startswith("LOAD") and not reading_segment: | ||
| continue | ||
| elif line.startswith("LOAD"): | ||
| # Might need to filer out segments that have a file offset of 0 | ||
| # (ie segments that aren't in the core!) | ||
| reading_segment = True | ||
| (type, offset, vaddress, paddr) = line.split() | ||
| elif reading_segment: | ||
| reading_segment = False | ||
| memsize = line.split()[1] | ||
| # Simple format "address size", both in hex | ||
| print("{0} {1}".format(vaddress, memsize)) | ||
| vaddress = "" | ||
|
|
||
| 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
Oops, something went wrong.