Remote debugging

I don’t understand how remote debugging should work.

I have a project tree on my host which looks like:
…/src
|_Communication
|_Modbus
|_ser_Modbus-1.0
|_nto
|_x86
|_o

with different source files in almost all of these directories.

According to the doc, the executable must be in the target names space.
So, on target, I cd
/net/host/…/src/Communication/Modbus/ser_Modbus-1.0
I run pdebug 8000&

On the host, I cd in the same directory, and I run pdb.
In pdb:

target qnx 172.20.22.89:8000
Remote debugging using 172.20.22.89:8000

0x0 in ?? ()

upload ./nto/x86/o/ser_Modbus-1.0
sym ./nto/x86/o/ser_Modbus-1.0
“./nto/x86/o/ser_Modbus-1.0”: can’t read symbols: File truncated.

I don’t undestand this message. If I copy my directory tree on the
target, It’s ok. But you understand that it’s not what I want otherwise
I woul try to do a remote debugging!

What is the problem?

Thanks
Alain

Alain Bonnefoy <alain.bonnefoy@icbt.com> wrote:

I don’t understand how remote debugging should work.

I have a project tree on my host which looks like:
./src
|_Communication
|_Modbus
|_ser_Modbus-1.0
|_nto
|_x86
|_o

with different source files in almost all of these directories.

According to the doc, the executable must be in the target names space.
So, on target, I cd
/net/host/…/src/Communication/Modbus/ser_Modbus-1.0
I run pdebug 8000&

On the host, I cd in the same directory, and I run pdb.
In pdb:
target qnx 172.20.22.89:8000
Remote debugging using 172.20.22.89:8000
0x0 in ?? ()
upload ./nto/x86/o/ser_Modbus-1.0

This is your problem. If your target can already see the binary,
then you have no need to upload it. Since you are uploading the
binary to itself, pdebug opens it for write (which truncates it to
0 bytes in length), and thus the download stops and you have a 0
byte file!

sym ./nto/x86/o/ser_Modbus-1.0
“./nto/x86/o/ser_Modbus-1.0”: can’t read symbols: File truncated.

I don’t undestand this message. If I copy my directory tree on the
target, It’s ok. But you understand that it’s not what I want otherwise
I woul try to do a remote debugging!

What is the problem?

Thanks
Alain


cburgess@qnx.com

you’ll find it much quicker to copy the file over manually rather than
using upload which takes ages…

Its a shame as you could stick all the remote debug commands into .gdbinit
(you can stick the others in there anyway to save to retyping in every debug
session. I’m gonna give that a go…