result, internal_dict): frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() result = frame.EvaluateExpression(command) target = result.GetLocation() expr = "expr -l objc++ -- (NSData *)UIImagePNGRepresentation((id)" + target + ")" frame.EvaluateExpression(expr) imagePath = '/Users/dealforest/lldb.png' saveImageTemplate = 'expr -l objc++ -- (void) [(NSData *){} writeToFile:@"{}" atomically:YES];' saveImageExpr = createImageFormatStr.format(result.GetName(), imagePath) lldb.debugger.HandleCommand(saveImageExpr) def __lldb_init_module(debugger,internal_dict): debugger.HandleCommand("command script add -f save_image.save_image save_image") print"save_image command enabled." UIImage ͷ pointer Λऔಘ save_image.py