Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Effective Debugging Strategies
Search
Vladimir Pouzanov
February 15, 2011
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Effective Debugging Strategies
Vladimir Pouzanov
February 15, 2011
More Decks by Vladimir Pouzanov
See All by Vladimir Pouzanov
Zinc at Rust London '14
farcaller
1
150
Pixels Everywhere!
farcaller
0
180
Prepare to Dock
farcaller
1
290
REPL Done Right
farcaller
1
340
iOS in Motion
farcaller
1
160
Reversing WTF
farcaller
2
140
iOS TDD
farcaller
1
190
Clang 3.0 Memory Management
farcaller
1
130
Effective Multithreading in iOS
farcaller
1
150
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
699
190k
Scaling GitHub
holman
464
140k
Agile that works and the tools we love
rasmusluckow
331
22k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
510
The Mindset for Success: Future Career Progression
greggifford
PRO
0
530
Transcript
15.02.2011 Эффективные стратегии отладки !"#$%&%' “Farcaller” ()*#+,- <
[email protected]
> Monday, September
24, 12
Темы на сегодня ✤ .#/%0+,1 2,$%',-#+%1 % '#++11 ,3+#')41+%1 ,5%3,2
✤ .+#6 7-,6 ,0"#$8%2! ✤ .+#6 7-,1 ,2')41+%1! Monday, September 24, 12
Защитное кодирование ✤ (,-'14$1+%1/)+%80,41+%1 9,":*,-#01":72%; $#++<; ✤ .#-%7#+%1 ✤ =%;%6
>16" ✤ ?0,3'#41+%1 ,5%32% 9,":*,-#01"@ ✤ ?3;,$ ,5%32% A)851 Monday, September 24, 12
Проверяйте значения в assert ✤ (',-1'B601 %&)& #'C)&1+0,- ✤ !,,3/1,
9',-1'B601 -7D, 80, $-%4107B – -71 "C)0 ✤ NSAssert* – $"B &10,$,-, NSCAssert* – $"B >)+2E%6 ✤ F>>120%-+<6 Release-2,$ 9'% 73,'21 7 NS_BLOCK_ASSERTIONS Monday, September 24, 12
Конструкторы/деструкторы ✤ !71C$# 9'%7-#%-#601 ,0-10 ,0 [super init] - self
✤ G -71C$# 9',-1'B601, 80, 0#& +1 nil ✤ ! -dealloc ,7-,3,4$#0: 91'1&1++<1 &,4+, 9',70, 81'1* [ivar_ release], 0#2 2#2 +alloc C#'#+0%')10, Monday, September 24, 12
Сеттеры ✤ H-+, 9',-1'B601 7%0)#E%@ 7 newValue == nil, 17"%
-< -<9,"+B101 $,9,"+%01":+<1 $1670-%B ✤ I#70, 71001' %79,":*)107B $"B ,7-,3,4$1+%B 91'1&1++,6 81'1* obj.value = nil Monday, September 24, 12
Исключения ✤ J7"% 2,$ 9,01+E%#":+, &,410 -<*-#0: ,5%32) 9'%&1+1+%B –
-<3'#7<-#601 %72"@81+%1 ✤ K#9'%&1' - -init 2"#77#, 2,0,'<6 +1 9,$$1'4%-#10 %+%E%#"%*#E%@ 31* #'C)&1+0,- Monday, September 24, 12
NSError ✤ NSError -71C$# -,*-'#/#10 9,"1*+)@ %+>,'&#E%@ ✤ K1 ,70#-"B601
,3'#3,02) “+# 9,0,&” – L0,0 &,&1+0 +%2,C$# +1 +#70#10, # 2,$ +1 '#3,0#10 ✤ ?7,31++, 0/#01":+, 9',-1'B601 -+15+%1 $#++<1 ✤ K1 *#3)$:01 9',-1'%0: 2,$ -,*-'#0# ! "#$!%& '(#$#)* (Apple ,70#-"B10 *# 7,3,6 9'#-, +#2%$#0: &)7,'# - *error) Monday, September 24, 12
“Слабые” ссылки ✤ (1'1$ )$#"1+%1& “41702,6” 77<"2%, -71C$# 9'1$-#'%01":+, )$#"B601
“7"#3)@” ,3'#0+)@ 77<"2) ✤ UITableView, MKMapView, etc. Monday, September 24, 12
Отладка проблем ✤ gdb +#&+,C, >)+2E%,+#":+11, 81& 2#4107B ✤ NSDebug.h
9,",+ &#"1+:2%; +B512 ✤ NSLog 7,,3/#10 , -,*&,4+<; 9',3"1&#; Monday, September 24, 12
Вывод отладочной информации ✤ G79,":*)601 NSLog $"B -<-,$# 7,70,B+%B ,3M120,-
% 9',E177,- ✤ __PRETTY_FUNCTION__ – %+>,'�%-+,1 ,0,3'#41+%1 0,C,, C$1 &< 7168#7 +#;,$%&7B ✤ G+,C$# 9,"1*+, 9'B0#0: NSLog - ',7<: ✤ #define NetLog NSLog ✤ #define DBLog NSLog ✤ $"B "1C2,6 -,*&,4+,70% ,02"@8#0: ",CC%+C E1"%2,& %"% 8#70%8+, Monday, September 24, 12
Магия Gdb ✤ (,&%&, break’,- %+,C$# ,81+: 9,"1*+, -<-#"%-#0:7B -
gdb 9'% 2#2,&-0, )7",-%% ✤ N"B L0,C, &,4+, %79,":*,-#0: '1$#20,' breakpoint’,- % )7",-%B ✤ __asm__("int $3\n" : : ); 3'B2#107B - $13#CC1', %"% -<*<-#10 O0)";), 17"% gdb +1 *#9)/1+ Monday, September 24, 12
Еще про Gdb ✤ po a la print-object ✤ set
$var ... ✤ call Monday, September 24, 12
Полезные переменные окружения ✤ NSDebugEnabled ✤ NSZombieEnabled ✤ MallocStackLogging Monday,
September 24, 12