| 216 | |
| 217 | '''Using gdb''' |
| 218 | |
| 219 | It is possible to deploy an application and launch it in debugging mode on the BB10 device. |
| 220 | |
| 221 | First source your shell envrionment from the BB10 NDK environment script: |
| 222 | {{{ |
| 223 | source bbndk-env.sh |
| 224 | }}} |
| 225 | Then deploy the application with debugging enabled: |
| 226 | {{{ |
| 227 | blackberry-deploy -installApp -launchApp -debugNative <device ip> -password <device password> -package HelloWorld.bar |
| 228 | }}} |
| 229 | In the ourput of this command you should get something like this at the end: |
| 230 | {{{ |
| 231 | result::32395406 |
| 232 | }}} |
| 233 | The number is the application PID you will use for debugging it with gdb. |
| 234 | |
| 235 | Next, start the BB10 NDK gdb: |
| 236 | {{{ |
| 237 | ntoarm-gdb |
| 238 | }}} |
| 239 | From inside the gdb shell: |
| 240 | {{{ |
| 241 | echo target qnx <device ip>:8000 |
| 242 | attach <PID> |
| 243 | }}} |
| 244 | |
| 245 | The result: |
| 246 | |
| 247 | {{{ |
| 248 | (gdb) attach 32395406 |
| 249 | Attaching to pid 32395406 |
| 250 | "/usr/bin/python3.2": not in executable format: File format not recognized |
| 251 | (gdb) run |
| 252 | ../../gdb/thread.c:72: internal-error: inferior_thread: Assertion `tp' failed. |
| 253 | A problem internal to GDB has been detected, |
| 254 | further debugging may prove unreliable. |
| 255 | Quit this debugging session? (y or n) n |
| 256 | ../../gdb/thread.c:72: internal-error: inferior_thread: Assertion `tp' failed. |
| 257 | A problem internal to GDB has been detected, |
| 258 | further debugging may prove unreliable. |
| 259 | Create a core file of GDB? (y or n) y |
| 260 | }}} |
| 261 | |
| 262 | So its not really that usable for debugging Python applications but probably could be somehow fixed to provide some meaningful output. |
| 263 | |