How to DebugRubyMotion AppsThe Life and Times of an Object
My App Crashed!Now what???
Weapon of Choicegdb• rake debug=1• Watch it crash• Play!
What is an Object?• Just a struct!• First value is the isa pointer to the Class• In gdb, try “x”• Refer to the Obj-C Runti...
Demo
Advanced WeaponryMallocStackLoggingNoCompact• man malloc• Set environment variables to log the stackduring allocations• Ru...
Demo
4 Rs of Bug Reporting• Reproduce• Report• Reduce• Regress
Reproduce It!• Can you make the bug occur every time?most of the time? some of the time?• Check all config files, Rakefile• ...
Report It!• motion support• All steps to reproduce• bonus points for small sample apps• RubyMotionVersion (Have you update...
Reduce It!• Eliminate libraries• Simple scripts are best• Shrink code as much as possible!
Regress It!• Did it used to work?• motion update [--force-version=X]
Demo
Questions?@manhattanmetricJoshua Ballancohttps://github.com/jballanchttp://www.burnsidedigital.com
Upcoming SlideShare
Loading in …5
×

Debugging RubyMotion

938 views
775 views

Published on

Slides from the presentation on "Debugging RubyMotion" given at the RubyMotion #inspect 2013 conference.

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
938
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Debugging RubyMotion

  1. 1. How to DebugRubyMotion AppsThe Life and Times of an Object
  2. 2. My App Crashed!Now what???
  3. 3. Weapon of Choicegdb• rake debug=1• Watch it crash• Play!
  4. 4. What is an Object?• Just a struct!• First value is the isa pointer to the Class• In gdb, try “x”• Refer to the Obj-C Runtime Reference
  5. 5. Demo
  6. 6. Advanced WeaponryMallocStackLoggingNoCompact• man malloc• Set environment variables to log the stackduring allocations• Run in GDB, use malloc_history to viewstacks
  7. 7. Demo
  8. 8. 4 Rs of Bug Reporting• Reproduce• Report• Reduce• Regress
  9. 9. Reproduce It!• Can you make the bug occur every time?most of the time? some of the time?• Check all config files, Rakefile• Environment and EnvironmentVariables• Ask a friend
  10. 10. Report It!• motion support• All steps to reproduce• bonus points for small sample apps• RubyMotionVersion (Have you updatedrecently?)• Crash log (hint: look in Console.app)
  11. 11. Reduce It!• Eliminate libraries• Simple scripts are best• Shrink code as much as possible!
  12. 12. Regress It!• Did it used to work?• motion update [--force-version=X]
  13. 13. Demo
  14. 14. Questions?@manhattanmetricJoshua Ballancohttps://github.com/jballanchttp://www.burnsidedigital.com

×