Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Debugging & Profiling

Debugging & Profiling

My talk on debugging & profiling techniques for mobile testing days 2014 (german)

896e816a54b484b5233ed5f9ea5278a5?s=128

Florian

June 04, 2014
Tweet

Transcript

  1. @florianbuerger

  2. None
  3. Debugging Tools Profiling

  4. Debugging

  5. Exception Type: SIGSEGV Exception Codes: SEGV_ACCERR at 0x24 Crashed Thread:

    14 (...) Thread 14 Crashed: 0 AGXGLDriver 0x2f24e37e agxuReloadCtxVertexConstants(GLDContextRec*, void*) + 2 1 GLEngine 0x326a4a37 gleDoDrawDispatchCoreES2 + 592 2 GLEngine 0x3268440b glDrawElements_IMM_ES2Exec + 184 3 QuartzCore 0x32916595 CA::OGL::GLContext::draw_elements(CA::OGL:: 4 QuartzCore 0x32916437 CA::OGL::Context::array_flush() + 88 5 QuartzCore 0x329162ab CA::OGL::Context::ClippedArray::next_rect(CA::Bounds&) + 220 6 QuartzCore 0x329449c7 CA::OGL::emit_quad_indices(CA::OGL::Context&, CA::OGL::RectState const&, 7 QuartzCore 0x32944845 CA::OGL::emit_mesh_with_center(CA::OGL::Context&, CA::OGL::RectState const&, 8 QuartzCore 0x3294d6ed CA::OGL::emit_n_part_rect(CA::OGL::Context&, CA::OGL::RectState const&, int, 9 QuartzCore 0x3294aff1 CA::OGL::emit_shadow_path(CA::OGL::Context&, double, CA::Vec2<float> const&, 10 QuartzCore 0x32928ae1 CA::CG::DrawPathShadow::draw_shadow(CA::CG::Renderer&, bool) const + 278 11 QuartzCore 0x32913b05 CA::CG::DrawOp::render(CA::CG::Renderer&) const + 738 12 QuartzCore 0x32912791 CA::CG::Queue::render_callback(void*) + 250 13 libdispatch.dylib 0x3b07ee7b _dispatch_queue_drain + 372 14 libdispatch.dylib 0x3b07bf93 _dispatch_queue_invoke + 40 15 libdispatch.dylib 0x3b07f745 _dispatch_root_queue_drain + 74 16 libdispatch.dylib 0x3b07f9c5 _dispatch_worker_thread2 + 54 17 libsystem_pthread.dylib 0x3b1a9dff _pthread_wqthread + 298 18 libsystem_pthread.dylib 0x3b1a9cc4 start_wqthread + 8
  6. Panik&Ruhig&atmen

  7. Mentales(Modell(=>(

  8. Debugging(is(twice(as(hard(as( wri1ng(the(code(in(the(first(place.( Therefore,(if(you(write(the(code(as( cleverly(as(possible,(you(are,(by( defini1on,(not(smart(enough(to( debug(it.( —"Brian"Kernighan

  9. 100%$Verständnis

  10. Tools

  11. Xcode&Debugger

  12. Alle$Breakpoints$ de0/ak2vieren Standort simulieren Programm0 ausführung$ kontrollieren

  13. Demo

  14. Watch&on&Vimeo h"ps:/ /vimeo.com/97512083

  15. Target'Schemes

  16. Launch'Arguments

  17. -NSShowNonLocalizedStrings YES -NSDoubleLocalizedStrings YES -AppleLanguages (German)

  18. None
  19. LLDB$Debugger

  20. (…) po expr (…)

  21. po (NSString *)[self title]!→""Foo"

  22. expr [self setTitle:@"Bar"]!→""Bar"

  23. Aliase command alias spark \ p (void*)dlopen("(...)/SparkInspector.dylib")

  24. chisel

  25. Danke&Facebook 1. Sammlung*von*LLDB*Kommandos 2. presponder*=>*Ausgabe*der*Responder*Chain 3. (...) 4. brew install

    chisel
  26. Demo

  27. Watch&on&Vimeo h"ps:/ /vimeo.com/97512085

  28. Wissen&weitergeben ~/.lldbinit !!dynamic!Library!für!iOS!! http://defagos.roon.io/sharing-lldb-debugging- helpers-between-projects-using-a-dynamic-library

  29. Logging

  30. Logging&!=&NSLog

  31. Logging&via&Breakpoints

  32. Logging&via&Breakpoints kein%Neu(Kompilieren De#/Ak'vierung.mit.einem.Klick Logs%in%Release%builds

  33. CocoaLumberjack

  34. Schnell Mäch%g Flexibel

  35. NSLogger(❤(CocoaLumberjack

  36. Demo

  37. View%Inspec+on

  38. Spark&Inspector Reveal

  39. Spark&Inspector&der&laufenden&App&hinzufügen command alias spark p \ (void*)dlopen(" \ (…)Spark Inspector.app/(…)SparkInspector.dylib")

  40. Live%Änderungen

  41. Demo

  42. Zusammenfassung Wissen&über&Code&ist&falsch NSLog()!=>!CocoaLumberjack Reveal!oder!Spark*Inspector

  43. Profiling

  44. Vermuten(Messen!

  45. None
  46. Performance

  47. None
  48. 60#FPS!

  49. None
  50. Core%Data

  51. Caching Disk%I/O

  52. Demo

  53. Q&A

  54. Links&(1/2) • Florian)Bürger)→)h0p:/ /florianbuerger.com • keslcod)GmbH)→)h0p:/ /keslcod.com • LLDB)Kommandos)→)h0ps:/ /developer.apple.com/(…)

    • Facebook)chisel)→)h0ps:/ /github.com/facebook/chisel • Dynamic)Library)für)iOS)→)h0p:/ /defagos.roon.io/(…) • Cocoa)Lumberjack)→)h0ps:/ /github.com/CocoaLumberjack/ CocoaLumberjack
  55. Links&(2/2) • NSLogger)→)h,ps:/ /github.com/fpillet/NSLogger • NSLogger)zu)CoocaLumberjack)Connector)→)h,ps:/ /github.com/ steipete/NSLogger@CocoaLumberjack@connector • Spark)Inspector)→)h,p:/

    /sparkinspector.com • Reveval)→)h,p:/ /revealapp.com