-
Notifications
You must be signed in to change notification settings - Fork 0
/
lldbinit
30 lines (24 loc) · 1.71 KB
/
lldbinit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Print view hierarchy
# Kudos to @charlietuna https://twitter.com/charlietuna/status/277187685473464320
command alias pwin expression -o -- (NSString *)[[UIWindow keyWindow] recursiveDescription]
# http://blog.ittybittyapps.com/blog/2013/11/07/integrating-reveal-without-modifying-your-xcode-project/
command alias reveal_load_sim expr (void*)dlopen("/Users/mkalmes/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib", 0x2);
command alias reveal_load_dev expr (void*)dlopen([(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2);
command alias reveal_start expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStart" object:nil];
command alias reveal_stop expr (void)[(NSNotificationCenter*)[NSNotificationCenter defaultCenter] postNotificationName:@"IBARevealRequestStop" object:nil];
# For substitution, use command regex
# http://stackoverflow.com/a/16139539/1712728
# command regex test 's/(.*)/po %1/'
# Hexdump a string
# The magic number is NSUTF8StringEncoding
command regex hexstring 's/(.*)/po (NSString *)NSLog(@"Return: %@", [%1 dataUsingEncoding:4]);/'
# iOS 8: Where is your apps document folder?
# 1. magic number is NSDocumentDirectory
# 2. magic number is NSUserDomainMask
command alias pdd expr (void*)NSLog(@"Documents Directory: %@", [(NSArray *)[[NSFileManager defaultManager] URLsForDirectory:9 inDomains:1] lastObject]);
# Import modules to forget typecasts
command alias uikit expr @import UIKit
command alias foundation expr @import Foundation
# Evaluate Obj-C code in Swift frames
# https://developer.apple.com/wwdc18/412
command alias poc expression -l objc -O --