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

Reply
Regular Contributor
bemipefe
Posts: 75
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 ?

Please use plain text.
Developer
simon_hain
Posts: 16,113
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
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Telus

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?

Please use plain text.
Regular Contributor
bemipefe
Posts: 75
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

___________________________________________________________________________________________

 

 

 

Please use plain text.