Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
Posts: 76
Registered: ‎06-14-2013
My Device: Z10
My Carrier: PosteMobile

Debugging an app crash: How to get the crash line

Hi everybody.

 

I can run my app in debug mode and set breakpoints to run in step by step mode. However when the app crash I can't figure out how to get the precise line crash. The only way I found is to put a breakpoint in the beginning of the function and go on step by step until the app crash.

 

Is there a way to make the IDE highlighting the crash line automatically ?

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Debugging an app crash: How to get the crash line

In native code you should get a stacktrace when a crash occurs, this allows you to find the exact line.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Debugging an app crash: How to get the crash line

where do you find the stacktrace after it occurs?

 

Also slightly off topic, if console.log outputs an error like "failed to connected to target node with id ###" is there any way to trace down the node it wasn't able to target and get it's name instead of a seemingly unknown number?

Regular Contributor
Posts: 76
Registered: ‎06-14-2013
My Device: Z10
My Carrier: PosteMobile

Re: Debugging an app crash: How to get the crash line

[ Edited ]

This is how I solved the problem:

___________________________________________________________________________________________

 

When your app crashes a core dump will be written into the application sandbox (in the log directory).

Use the Target File System Navigator view in Momentics to copy the appname.core file out of the device/simulator onto your desktop.

Then create yourself a new Debug Configuration (Run -> Debug Configurations). Make sure you create it under the "BlackBerry Porstmortem Debugging" category.

For this new debug config, make sure the build configuration matches the build that you are testing (ie simulator-debug vs device-debug)

Leave the 'Core file' field blank and hit 'Debug'. Momentics will prompt you for the core file that you copied onto your desktop. Let momentics switch to the debug perspective, and there you'll have the complete callstack, variables, registers at the moment your program crashed

___________________________________________________________________________________________