Created
July 11, 2016 11:07
-
-
Save Wonicon/a5f4d879cbe0483a4394bb5165b154a4 to your computer and use it in GitHub Desktop.
Check function name from objdump -d output
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
#!/usr/bin/env ruby | |
result = [] | |
File.read(ARGV[0]).each_line do |line| | |
# Match pattern "XXXXXXXX <function-name>:" | |
# and extract the function name. | |
# Note that all the symbol including '<', '>' | |
# and ':' are literal, except 'function-name', | |
# which is the variable we want. | |
matchData = /(?<=\h{8} <)\w+(?=>:$)/ .match line | |
result << matchData.to_s if matchData | |
end | |
puts result.sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment