Testing and debugging

The Momentics IDE for BlackBerry provides a source-level debugger that's integrated with the other workbench tools.

The IDE debugger uses the GNU Debugger (GDB) as the underlying debug tool. The IDE debugger translates each action in the UI into a sequence of GDB commands, and then processes the output from GDB to show the current state of the app being debugged. You can see and control the GDB commands by using the GDB consoles that are available in the Debug perspective in the IDE. You can also perform other debugging tasks, such as:

Debugging is supported for both C++ and QML/JavaScript. You can find more information about debugging basics, such as how to:

Keep reading to learn about the following topics:

If you are writing apps for the work space (that is, developing enterprise apps for an organization), see Testing and debugging apps in the work space.

The Debug view

In the Debug perspective, the Debug view shows the debugging session, tool, and thread instance, as well as the stack frames and controls for each device that you debug on. It displays the debugging information in a tree hierarchy. It shows stack frames as child elements and includes the reason for a suspension beside the thread. For example, a thread is suspended when it reaches the end of the stepping range, a breakpoint, or a received signal. When an app exits, the Momentics IDE also shows the exit code.

Screen showing the Debug view with debug sessions, running processes, threads, and call stacks.

The thread label includes the thread's state. For example, the label might indicate that the thread is suspended because the app hit a breakpoint. You can't suspend only one thread in a process; suspension affects all threads. The number beside the thread label is a reference counter for the Momentics IDE, not a thread ID (TID) number.

Editing your source code after compiling causes the line numbering to be out of step because the debug information is tied directly to the source code. Debugging an optimized binary can also cause unexpected jumps in the execution trace, especially when the debug symbols for that library aren't available and loaded.

Last modified: 2014-11-17



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus