-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathLLDB_Chisel_Commands.rb
More file actions
583 lines (508 loc) · 11.1 KB
/
Copy pathLLDB_Chisel_Commands.rb
File metadata and controls
583 lines (508 loc) · 11.1 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
cheatsheet do
title 'LLDB Chisel Commands'
docset_file_name 'LLDB_Chisel_Commands'
keyword 'lldb'
source_url 'http://cheat.kapeli.com'
# FBAccessibilityCommands.py
category do
id 'Accessibility Commands'
entry do
name 'Print accessibility labels of all views in hierarchy of `aView`'
notes '
```
(lldb) pa11y <aView>
```
'
end
entry do
name 'Print accessibility identifiers of all views in hierarchy of `aView`'
notes '
```
(lldb) pa11yi <aView>
```
'
end
entry do
name 'Find the views whose accessibility labels match labelRegex and puts the address of the first result on the clipboard'
notes '
```
(lldb) fa11y <aView>
```
'
end
end
# FBAutoLayoutCommands.py
category do
id 'AutoLayout Commands'
entry do
name 'Print the Auto Layout trace for the given view. Defaults to the key window'
notes '
```
(lldb) paltrace [aView]
```
'
end
entry do
name 'Put a border around views with an ambiguous layout'
notes '
```
(lldb) alamborder
```
'
end
entry do
name 'Removes the border around views with an ambiguous layout'
notes '
```
(lldb) alamunborder
```
'
end
end
# FBClassDump.py
category do
id 'Class Dump'
entry do
name 'Print the class and instance methods of a class'
notes '
```
(lldb) pmethods <instance/class>
-a / --address Print the implementation address of the method
-i / --instance Print the instance methods
-c / --class Print the class methods
-n / --name Take the argument as class name
```
'
end
entry do
name 'Print the properties of an instance or class'
notes '
```
(lldb) pproperties -n <className>
```
'
end
entry do
name 'Print the block\'s implementation address and signature'
notes '
```
(lldb) pblock <block>
```
'
end
end
# FBComponentCommands.py
category do
id 'Component Commands'
entry do
name 'Set debugging options for components'
notes '
```
(lldb) dcomponents --set
(lldb) dcomponents --unset
```
'
end
entry do
name 'Print a recursive description of components found starting from `aView`'
notes '
```
(lldb) pcomponents <aView>
```
'
end
end
# FBDisplayCommands.py
category do
id 'Display Commands'
entry do
name 'Show/hide a view or layer'
notes '
```
(lldb) show <viewOrLayer>
(lldb) hide <viewOrLayer>
```
'
end
entry do
name 'Draws a border around `viewOrLayer`. Color and width can be optionally provided. Additionally depth can be provided in order to recursively border subviews'
notes '
```
(lldb) border <viewOrLayer>
(lldb) unborder <viewOrLayer>
-c <colorname>
-w <width>
-d <depth>
```
'
end
entry do
name 'Add a transparent rectangle to the window to reveal a possibly obscured or hidden view or layer\'s bounds'
notes '
```
(lldb) mask <viewOrLayer>
(lldb) unmask <viewOrLayer>
```
'
end
entry do
name 'Force Core Animation to flush. This will \'repaint\' the UI but also may mess with ongoing animations'
notes '
```
(lldb) caflush
```
'
end
entry do
name 'Present a view controller'
notes '
```
(lldb) present <aViewController>
```
'
end
entry do
name 'Dismiss a presented view controller'
notes '
```
(lldb) dismiss <aViewController>
```
'
end
entry do
name 'Slows down animations. Works on the iOS Simulator and a device'
notes '
```
(lldb) slowanim
```
'
end
entry do
name 'Turn off slow animations'
notes '
```
(lldb) unslowanim
```
'
end
end
# FBFlickerCommands.py
category do
id 'Flicker Commands'
entry do
name 'Quickly show and hide a view to quickly help visualize where it is'
notes '
```
(lldb) flicker <viewOrLayer>
```
'
end
entry do
name 'Interactively search for a view by walking the hierarchy'
notes '
```
(lldb) vs <view>
```
'
end
end
# FBFindCommands.py
category do
id 'Find Commands'
entry do
name 'Find the view controllers whose class names match `classNameRegex` and puts the address of first on the clipboard'
notes '
```
(lldb) fvc <classNameRegex>
```
'
end
entry do
name 'Find the views whose class names match `classNameRegex` and puts the address of first result on the clipboard'
notes '
```
(lldb) fv <classNameRegex>
```
'
end
end
# FBVisualizationCommands.py
category do
id 'Visualization Commands'
entry do
name 'Open a UIImage in Preview.app on your Mac'
notes '
```
(lldb) showimage <anImage>
```
'
end
entry do
name 'Open a CGImageRef in Preview.app on your Mac'
notes '
```
(lldb) showimageref <anImageRef>
```
'
end
entry do
name 'Render the given UIView into an image and open it in Preview.app on your Mac'
notes '
```
(lldb) showview <aView>
```
'
end
entry do
name 'Render the given CALayer into an image and open it in Preview.app on your Mac'
notes '
```
(lldb) showlayer <aLayer>
```
'
end
end
# FBInvocationCommands.py
category do
id 'Invocation Commands'
entry do
name 'Print the stack frame, receiver, and arguments of the current invocation. It will fail to print all arguments if any arguments are variadic (varargs)'
notes '
```
(lldb) pinvocation [--all]
```
Note: sadly this is currently only implemented on x86.
'
end
end
# FBDebugCommands.py
category do
id 'Debug Commands'
entry do
name 'Set a watchpoint for an object\'s instance variable'
notes '
```
(lldb) wivar <object> <ivarName>
```
'
end
entry do
name 'Set a breakpoint for a selector on a class, even if the class itself doesn\'t override that selector. It walks the hierarchy until it finds a class that does implement the selector and sets a conditional breakpoint there'
notes '
```
(lldb) bmessage <expression>
(lldb) bmessage -[MyView setFrame:]
```
'
end
entry do
name 'Set a breakpoint for a relative address within the framework/library that\'s currently running. This does the work of finding the offset for the framework/library and sliding your address accordingly'
notes '
```
(lldb) binside <address>
```
'
end
entry do
name 'Simulate a memory warning'
notes '
```
(lldb) mwarning
```
'
end
end
# FBPrintCommands.py
category do
id 'Print Commands'
entry do
name 'Print the recursion description of `aView`'
notes '
```
(lldb) pviews <aView>
```
'
end
entry do
name 'Print layer tree from the perspective of the render server'
notes '
```
(lldb) pca
```
'
end
entry do
name 'Print the recursion description of `aViewController`'
notes '
```
(lldb) pvc <aViewController>
```
'
end
entry do
name 'Prints if the code is currently execution with a UIView animation block'
notes '
```
(lldb) panim
```
'
end
entry do
name 'Print the inheritance starting from an instance of any class'
notes '
```
(lldb) pclass <anObject>
```
'
end
entry do
name 'Print the responder chain starting from a specific responder'
notes '
```
(lldb) presponder <startResponder>
```
'
end
entry do
name 'Print the highest table view in the hierarchy'
notes '
```
(lldb) ptv
```
'
end
entry do
name 'Print the visible cells of the highest table view in the hierarchy'
notes '
```
(lldb) pcells
```
'
end
entry do
name 'Show the internals of an object by dereferencing it as a pointer'
notes '
```
(lldb) pinternals <anObject>
```
'
end
entry do
name 'Print the value of an object\'s named instance variable'
notes '
```
(lldb) pivar <anObject> <ivarName>
```
'
end
entry do
name 'Print out the value of the key path expression using -valueForKeyPath:'
notes '
```
(lldb) pkp <keyPath>
```
'
end
entry do
name 'Print application\'s `Documents` directory path'
notes '
```
(lldb) pdocspath
```
'
end
entry do
name 'Print application\'s bundle directory path'
notes '
```
(lldb) pbundlepath
```
'
end
entry do
name 'Print the contents of NSData object as string'
notes '
```
(lldb) pdata <data>
Supported encodings:
-ascii,
-utf8,
-utf16, unicode,
-utf16l (Little endian),
-utf16b (Big endian),
-utf32,
-utf32l (Little endian),
-utf32b (Big endian),
-latin1, iso88591 (88591),
-latin2, iso88592 (88592),
-cp1251 (1251),
-cp1252 (1252),
-cp1253 (1253),
-cp1254 (1254),
-cp1250 (1250
```
'
end
entry do
name 'Print the actions and targets of a control'
notes '
```
(lldb) pactions <control>
```
'
end
entry do
name 'Print JSON representation of NSDictionary or NSArray object'
notes '
```
(lldb) pjson <aDictOrArray>
```
'
end
entry do
name 'Print the NSURLRequest (HTTP) as curl command'
notes '
```
(lldb) pcurl <aRequest>
```
'
end
entry do
name 'Print object and copy output to clipboard'
notes '
```
(lldb) pbcopy <object>
```
'
end
entry do
name 'Print the expression result, with the expression run in an ObjC++ context. (Shortcut for "expression -O -l ObjC++ -- '
notes '
```
(lldb) poobjc <expression>
```
'
end
end
# FBTextInputCommands.py
category do
id 'Test Input Commands'
entry do
name 'Set text on text on a view by accessibility id'
notes '
```
(lldb) settext <accessibilityId> <replacementText>
```
'
end
entry do
name 'Input text into text field or text view that is first responder'
notes '
```
(lldb) setinput <inputText>
```
'
end
end
notes '* Based on the help documentation of Chisel https://github.com/facebook/chisel'
end