Remote debugging with GDB...

Has anybody ever set up remote debugging using XEmacs (on Win32) and GDB (on QNX)? I’m particularly interested in QNX on non-x86 targets.

You want to use XEmacs on Win32 and have the Momentics SE/PE tools installed on Win32 and you want to target a remote QNX machine?

Yep, that’s it exactly. I have XEmacs and Momentics SE installed on my Win32 machine; I would like to use gud-mode to interact with a remote QNX machine. (I’ll be targeting both x86 and sh4 platforms, if that makes any difference.)

We have our own extension protocol to gdb for talking to pdebug (our debug agent). So if you simply tell Xemacs to use nto-gdb and then use the “target qnx hostname:port” command to get gdb to connect. On the remote target have both qconn and pdebug in your boot image and simply have qconn running. Then use the hostname/ip of your target on port 8000.

OK, I’ve told Xemacs to use ntox86-gdb, and it starts up ok.

But when I try to set the target, I get:

(gdb) target qnx 192.168.1.66:8000
Remote debugging using 192.168.1.66:8000
MsgNak received - resending

This doesn’t look good. When I try to load the executable, I get
(gdb) load
Loading section .interp, size 0x14 lma 0x80480f4
Memory access error while loading section .interp.

Well, that doesn’t look good. What am I doing wrong?

Are you running qconn/pdebug on the remote target?

QConn is running, although psin doesn’t seem to find pdebug.

You only need to check for pdebug once you have connected with gdb. Just to eliminate Xemacs, if you do this from the command line in a bash session, does it work any better?

Just tried this from the command line, and I get the same results:
(gdb) target qnx 192.168.1.66:8000
Remote debugging using 192.168.1.66:8000
MsgNak received - resending
(gdb) load
Loading section .interp, size 0x14 lma 0x80480f4
Memory access error while loading section .interp.
(gdb)

One question - where in the file system does the program get copied to? Or am I supposed to copy the program over manually before running gdb?

If I copy the program manually, how does gdb know what the remote file name is?

qnx.com/developer/docs/momen … html#DEBUG

Read that. :slight_smile:

Hi,

I’m trying to debug a programm at a remote qnx-machine.

I go through the following steps:

  • devc-pty -n 32 & (remote target)

  • pdebug 8000 & (remote target)

    (host qnx-system)

  • gdb -quiet

  • (gdb) target qnx 192.168.50.12:8000
    Remote debugging using 192.168.50.12:8000

  • upload program /tmp/program

  • (gdb) sym program
    Reading symbols from program…done.

  • (gdb) run /tmp/program
    Starting program: /tmp/program

  • (gdb) break main
    Breakpoint 1 at 0x804c11e: file program.cpp, line 5.

  • (gdb) c
    Continuing.

After the last step the debug session stops…nothing happens.
How can I resolve this problem?

do

  • (gdb) break main
    earlier than
  • (gdb) run /tmp/program

all is going well.

When you run, very fast main will be executed. typing break cannot catch it. right.
I am doing based on qconn on target, and gdb, actually ntoppc-gdb, run on host. trying to integrate it with code::blocks IDE… :smiley: :smiley: