0
votes

1) I start GDB on remote machine by gdb myAppName

2) Then i give run -p portNumber

3) Then i run java application which connect with it on above mentioned port.

Now when i am trying to remote debug via gdbserver then the scenario is

1) I run gdb server on remote machine gdbserver host:port path to application

Now when i try to connect my java client application to the gdbserver port .It will not be able to connect.

So i am searching of alternative of run -p command of gdb in gdb server

What i was trying was remote debugging of C code via eclipse CDT

Any help would be highly appreciated.

1

1 Answers

0
votes

gdbserver can be started attached to a pid on some systems according to the docs using the following syntax which is different than the normal invocation

gdbserver hostname : port --attach pid

or gdb can be started with a program that is subsequently started by the remote machine

gdbserver hostname : port program

and then you can attach to it from another remote gdb using

(gdb) target remote hostname: port

Eclipse would probably do the same thing so long at the remote gdbserver is invoked as above

and then start the remote program using a different port

(gdb) run -p someotherport

This 2nd invocation, from your comments above, I assume you have created some flag to your program that allows it to bind to someotherport