Confirmed users
400
edits
| Line 17: | Line 17: | ||
For the JavaScript parts of the code base, [https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Firefox_for_Android remote debugging] with a desktop version of Firefox is the most effective way to see what is going on, add breakpoints, etc. | For the JavaScript parts of the code base, [https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Firefox_for_Android remote debugging] with a desktop version of Firefox is the most effective way to see what is going on, add breakpoints, etc. | ||
For Android Java code, if you have IntelliJ set up, the debugger works well and allows you to set breakpoints, inspect variables and objects, etc. Debugging without an IDE is much more primitive, and you can try using Android Log statements and inspecting logcat. | For Android Java code, if you have IntelliJ set up, the debugger works well and allows you to set breakpoints, inspect variables and objects, etc. | ||
See http://developer.android.com/tools/debugging/ddms.html | |||
Debugging without an IDE is much more primitive, and you can try using Android Log statements and inspecting logcat. | |||
[http://developer.android.com/guide/developing/tools/logcat.html logcat] is a tool that is going to show you some logs prompted by the device. It might be a good help if you don't want to or can't run gdb. You can use it by running this command: | |||
adb logcat -v time | |||
You can make things appear in logcat using printf_stderr. With debug builds, NS_WARNING, NS_ERROR and NS_ASSERTIONS will show up in logcat. If you're trying to debug something, you may wish to pipe the logcat output through grep to filter out irrelevant things (most Fennec-related output will be viewable by | |||
adb logcat -v time | grep Gecko | |||
but remember that when attaching log output to a bug you should include unfiltered output as there may be relevant log entries under other tags. | |||
If you want more debugging tools, [https://wiki.mozilla.org/Mobile/Fennec/Android/AdvancedTopics#Advanced_Debugging Advanced Debugging] is a good place to look. | |||
=== Coding Style === | === Coding Style === | ||