Last active
December 19, 2015 06:19
-
-
Save robvinson/5910816 to your computer and use it in GitHub Desktop.
tracer.gdb
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
set logging file /tmp/Good-log.txt | |
set logging on | |
attach --waitfor Good | |
### Generic objective-c tracing | |
b objc_msgSend | |
commands | |
silent | |
# print class name and method name | |
printf "-[%s %s]\n", (char *)class_getName(*(long *)$r0,$r1),$r1 | |
# attempt to ask the first parameter to print itself | |
# po $r2 | |
c | |
end | |
### General c functions of interest | |
# stat() | |
b stat | |
commands | |
silent | |
printf "c stat() path:[%s]\n", $r0 | |
c | |
end | |
# fork | |
b fork | |
commands | |
silent | |
printf "c fork() called\n" | |
c | |
end | |
# open() | |
b open | |
commands | |
silent | |
printf "c open() path:[%s]\n", $r0 | |
c | |
end | |
# fopen() | |
b fopen | |
commands | |
silent | |
printf "c fopen() path:[%s]\n", $r0 | |
c | |
end | |
c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment