Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » gdb server for eclipse
gdb server for eclipse [message #1715585] Tue, 24 November 2015 13:35 Go to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
Hi,

I am trying to use the eclipse for remote debugging c++ on linux.

I am not able to install the gdbserver.

when i do the "yum install gdbserver" I get "No package gdbserver available."

Thanks
~p
Re: gdb server for eclipse [message #1715605 is a reply to message #1715585] Tue, 24 November 2015 16:03 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
just got it corrected to "gdb-gdbserver" and it worked ! ..Thanks
Re: gdb server for eclipse [message #1715687 is a reply to message #1715585] Wed, 25 November 2015 09:31 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
Now trying to attach the process on other machine (IPAddress B) to the eclipse running in machine with IPAddress A.

On m/C B, i start the executable and
gdbserver --multi :9999
Listening on port 9999
Remote debugging from host 192.168.A.A
readchar: Got EOF
Remote side has terminated connection. GDBserver will reopen the connection.
Listening on port 9999
Remote debugging from host 192.168.A.A
Attached; pid = 2851

But somehow the breakpoint is not hitting the eclipse running on other machine..

I have followed instructions at "Remote Attach Launch" section of the Eclipse CDT.

I have added the executable to the eclipse with the debug attach.
Re: gdb server for eclipse [message #1715693 is a reply to message #1715687] Wed, 25 November 2015 10:04 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
In the "Remote Attach Launch" section, it says:

Normally, when you press 'Connect' you should get a list of all running processes; you can select one or more process to connect to; you will be prompted for the path to the binary for each process, the very first time you attach to such binary.

Is the path , mentioned above is from the target machine ?

Could eclipse community help me with this please ?
Re: gdb server for eclipse [message #1715696 is a reply to message #1715693] Wed, 25 November 2015 10:15 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
When i connect a process, i click "New", where i was prompted to give path for binary in host and target.
I gave both paths..But getting following error now

[root@localhost exe]# gdbserver --multi :9999
Listening on port 9999
Remote debugging from host 192.168.A.A
gdbserver: Current inferior requested, but current_inferior is NULL
Re: gdb server for eclipse [message #1715701 is a reply to message #1715696] Wed, 25 November 2015 10:39 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
Can anybody in eclipse help me please, my debug is urgent Sad
Re: gdb server for eclipse [message #1715730 is a reply to message #1715701] Wed, 25 November 2015 14:09 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
Is there anybody moderating this forum ? (It is helpful if they give some hints)..I can add screensnapshot if required
Re: gdb server for eclipse [message #1715739 is a reply to message #1715730] Wed, 25 November 2015 15:35 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You need to setup a gdb inferior. You may find this helpful.
https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-and-Programs.html
There are a number of examples on Google.
Try searching: "gdbserver: Current inferior requested, but current inferior is NULL"

You should also make sure the listening port isn't blocked by a firewall.

Edit:
Here is an Eclipse remote debug setup parts of which may be useful:
http://janaxelson.com/eclipse5.htm

There is also a remote debugging plugin for Eclipse that directly debugs on the remote
https://marketplace.eclipse.org/content/direct-remote-c-debugging

Many more Eclipse examples can be found by searching "eclipse remote debugging c++".

[Updated on: Wed, 25 November 2015 16:08]

Report message to a moderator

Re: gdb server for eclipse [message #1715743 is a reply to message #1715739] Wed, 25 November 2015 15:55 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
I was trying to setup as per the instructions in your webpage.
Googling sometimes diverts the topic. (that too when you are in hurry , as of now i used plain gdb commandline on target to sort out the issue, but it is bit tedious).
It is helpful, to save time, if you can put the correct info in your help page

I have tried to check the inferior on the target machine, and I can see that process it there

(gdb) info inferiors
Num Description Executable
* 1 <null> /usr/pdk/pdk

Btw, i have a executable running in my target machine. So I just want to attach to that process from my host. (I am not trying to launch the executable from the host)

[Updated on: Wed, 25 November 2015 16:15]

Report message to a moderator

Re: gdb server for eclipse [message #1715746 is a reply to message #1715743] Wed, 25 November 2015 16:14 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I added some more links about using Eclipse and a remote debugger that crossed your last post. The issue only arises when running gdb of another gdb so I'm not sure how running gdb from the command line helps.
Re: gdb server for eclipse [message #1715753 is a reply to message #1715746] Wed, 25 November 2015 16:48 Go to previous messageGo to next message
Pdk kk is currently offline Pdk kkFriend
Messages: 16
Registered: July 2015
Junior Member
Now this works...I was selecting "New" when i was trying to add the process on the Host machine..But now tried without New, (and giving the path of the executable in the host machine)

Not sure why "New" option doesnot work..

Regarding "so I'm not sure how running gdb from the command line helps."..I have been just running the naked gdb on target machine, so I can debug...(without eclipse)..like gdb executabke..and break in suspicious function...

Btw I have not installed gdb inferior you were mentioning..I just had gdbserver running on target along with the executable...

[Updated on: Wed, 25 November 2015 17:22]

Report message to a moderator

Re: gdb server for eclipse [message #1715757 is a reply to message #1715753] Wed, 25 November 2015 18:02 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Glad you got it working.

Not sure why "New" option does not work..
Btw I have not installed gdb inferior you were mentioning..
gdbserver: Current inferior requested, but current_inferior is NULL


Think about it.

[Updated on: Wed, 25 November 2015 18:06]

Report message to a moderator

Previous Topic:Cannot get Eclipse for C/C++ to debug
Next Topic:Getting Started
Goto Forum:
  


Current Time: Thu Apr 18 16:46:08 GMT 2024

Powered by FUDForum. Page generated in 0.06522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top