Reputation: 1337
This is a question from an absolute beginner.
I have a Ubuntu 14.04 host, gdb 7.7.1 installed on it and a project cross-compiled for qnx. I also have a qnx target, that I want to debug my app on.
The instructions on the internet tell me to use either gdb
on PC + gdbserver
, but I don't have gdbserver installed and I don't think I can compile gdb for qnx. I have something called pdebug
. Instructions for qnx tell me that gdb has to have the target qnx
command, that it clearly does not posess.
Here's what I've done:
# Assuming that 255.255.255.255 is the target ip and 1234 is the port
# On target
pdebug 1234
On host
gdb
gdb> target remote 255.255.255.255:1234
Then I got a couple of warnings and the gdb>
again, as it was normal.
I managed to install a connection between my host and target, but when I hit run
in gdb, it tries to run my local copy of the app, instead of running it on target.
Upvotes: 6
Views: 8089
Reputation: 1337
There is no way one can debug qnx apps with Ubuntu's gdb.
You have to use qnx's gdb
built for the exact this purpose, that is able to run target qnx
and many other commands you will need. You have to use qnx's gdb
on your host and pdebug
on your target and run the same commands you ran:
# on target
pdebug 1234
# on host
ntoarm-gdb
(gdb) file MyQnxApp
(gdb) target qnx 255.255.255.255:1234
(gdb) upload MyQnxApp /mnt/myWorkingDir/MyQnxApp
(gdb) b main
(gdb) r
Then you will see the info about your connection:
Remote debugging using 255.255.255.255:1234
Remote target is <your_endianness>
See this detailed instructions.
Upvotes: 11