define parg p *($arg0*)($ebp+8+(4*$arg1)) end document parg Prints current function arguments parg Prints the th argument of the current function as type is 0-based end define poarg po *(id*)($ebp+8+(4*$arg0)) end document poarg Prints current function arguments poarg Prints the th argument of the current function as an NSObject is 0-based end define xarg if "$arg0"[0] == '/' x $arg0 *(long*)($ebp+8+(4*$arg1)) else x *(long*)($ebp+8+(4*$arg0)) end end document xarg Examines current function arguments xarg [] Examines the th argument of the current function using format is 0-based See "x" command for help on formats end define getarg if ($argc == 2) set $$arg0 = *(long*)($ebp+8+(4*$arg1)) else set $$arg0 = *($arg1*)($ebp+8+(4*$arg2)) end end document getarg Fetches current function arguments getarg [] Sets the variable $ to the th argument of the current function Uses type if present, otherwise long is 0-based end define pret if ((int)strcmp("$arg0", "float") == 0 || (int)strcmp("$arg0", "double") == 0) p ($arg0)$st0 else if (sizeof($arg0) > 8) p *($arg0*)($ebp+8) else if (sizeof($arg0) > 4) p ($arg0){$eax, $ebx} else p ($arg0)$eax end end end end document pret Prints function return value pret Prints the return value of the last function as type must be a single word If is a floating-point type it must match "float" or "double" This should only be called immediately after a function returns or it may be incorrect end define poret po (id)$eax end document poret Prints function return value Prints the return value of the last function as an NSObject end define getret if ($argc == 1) set $$arg0 = (long)$eax else if ((int)strcmp("$arg1", "float") == 0 || (int)strcmp("$arg1", "double") == 0) set $$arg0 = ($arg1)$st0 else if (sizeof($arg1) > 8) set $$arg0 = *($arg1*)($ebp+8) else if (sizeof($arg1) > 4) set $$arg0 = ($arg1){$eax, $ebx} else set $$arg0 = ($arg1)$eax end end end end end document getret Fetches return value getret [] Sets the variable $ to the return value of the last function Uses type if present, otherwise long end define pfunarg p *($arg0*)($esp+(4*$arg1)) end document pfunarg Prints function arguments pfunarg Prints the th argument of the function we're ready to call as type is 0-based end define pofunarg po *(id*)($esp+(4*$arg0)) end document pofunarg Prints function arguments pofunarg Prints the th argument of the function we're ready to call as an NSObject is 0-based end define xfunarg if "$arg0"[0] == '/' x $arg0 *(long*)($esp+(4*$arg1)) else x *(long*)($esp+(4*$arg0)) end end document xfunarg Examines function arguments xarg [] Examines the th argument of the function we're about to call using format is 0-based See "x" command for help on formats end define getfunarg if ($argc == 2) set $$arg0 = *(long*)($esp+(4*$arg1)) else set $$arg0 = *($arg1*)($esp+(4*$arg2)) end end document getfunarg Fetches function arguments getfunarg [] Sets the variable $ to the th argument of the function we're about to call Uses type if present, otherwise long is 0-based end define selfinfo getarg _selfinfo0 id 0 getarg _selfinfo1 SEL 1 printf "%s\n%s\n", (char*)[(NSString *)NSStringFromSelector($_selfinfo1) UTF8String], (char *)[[$_selfinfo0 description] UTF8String] end document selfinfo Prints self and _cmd for the current Obj-C method end define methodinfo getfunarg _methodinfo0 id 0 getfunarg _methodinfo1 SEL 1 printf "%s\n%s\n", (char*)[(NSString *)NSStringFromSelector($_methodinfo1) UTF8String], (char *)[[$_methodinfo0 description] UTF8String] end document methodinfo Prints self and _cmd for an Obj-C method Intended for use right before calling objc_msgSend end define pc x/i $pc end document pc Prints the current program counter end define current x/30i $pc end document current Displays the next 30 instructions to execute The current instruction is at the top end