Jump to content
  • Advertisement
Sign in to follow this  

Debugging Makefile project With Eclipse?

This topic is 2535 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Guys,

I've been around a few eclipse forums but no ones come back to me so i thought id ask this rather eclipse specific question on trusty GameDev to see if anyone could help me out!

At work we currently use the terminal to compile a make file project that we then "push" (copy over) onto a target machine and then use GDB while on the target machine to debug (usually through a remote ssh connection). I'm hoping to bring all this under one roof, specifically eclipse because I think it would help the productivity of the project enormously.

So ideally I want to be able to compile, run and debug this Linux graphics driver all from eclipse. I have made some headway into getting it to compile with make file errors (it throws up the makefile warnings as errors), I have even managed to get the whole process to (apparently) run but its the debugging that I'm having the most trouble with, and is probably the one I'm most excited about getting to work.

Ok bellow is all the steps i have taken so far, they seem very complicated (i would love to simplify it) I really appreciate any tips or advice anyone can give me!
Here is a quick run down of what I've done so far to get it compiling and running:

-At the moment I have made two run configurations that i run as a launch group.

Running Scripts
-The first run configuration is a "External Tools Configuration" that builds the code, and then runs a script (this is why i chose external program).

-This script basically sets up the connection with the target machine and then copies the code and the driver module over. The launch group waits for this to end.

-This first bit actually works but I'm open to a way of simplifying it, another problem is the script itself, it has to be run as root, so I'm currently running eclipse as root, which scares me a little.

Remote Application

-I think the second bit of set up results in my main problem.

-I chose a C/C++ Remote Application configuration.

-As Remote Absolute File Path for C/C++ I have simply typed "startx"

-The commands to execute before application consist of:
pkill -9 X; rmmod driver; depmod; modprobe driver.

-And as my C/C++ application I've picked one of the .so's that make up the driver

-I have also set up my connection as "ssh only" to the i.p. address of the target machine.

Running Launch Group

-Now if i run the Launch group it builds the code, pushes the driver over, it then successfully modprobes the driver but then it builds the code again (i cant seem to tell it not to) and then it starts X successfully and as far as i can tell with our driver, so just "run" is pretty much working.

Main Problem Area
-However debugging is a different story, the whole thing works the same way apart from it doesn't seem to start X on the target machine, i seem to go into a break point but i cant step over or in,
-Through some settings it seems to reach code that it says is "un-accessible code " and it lets me click "step into/over" (as in now they are enabled) but it comes up with an error box complaining about being unable to go out of the bounds of that function

-When i click resume, it just seems to exit and log out. As if the program has ran all its code and it doesn't have anything more to do, even if i set break points in the code.

GDB Hardware Debug
-I also tried "GDB Hardware Debug" but i had even less success with that, mainly cause i wasn't sure how to tell it to startx. (however from its name i assume that this is what i should be doing)

-I tried an number of different settings:

changing the GDB command to gdb startx and added the
pkill -9 X; rmmod driver; depmod; modprobe driver
to the run commands, i also tried just having startx in the run commands...

some of these ways result in it hanging untill it says

"Launching HardwareDebug has encountered a problem

Error in final launch sequence
Failed to execute MI command:
target remote <#ip#>

Error message from debugger back end:
Remote communication error. Target disconnected.: Connection reset by peer.
Remote communication error. Target disconnected.: Connection reset by peer.

  • My main issue is with the debug
  • It also compiles twice through this set up!
  • i don't like the fact I'm running eclipse as root!
  • It seems to clean the project before each compile, how do i stop this? (event though through terminal make debug, it doesn't do this)
  • It would be great if i could set it up so i could debug the kernel and user side part of the driver through eclipse but at the moment I'm just aiming at user sideAll the stuff I've done so far is totally guess work (which probably shows icon_smile.gif ), i haven't come across any use full resources so far. Can anyone give me a push in the right direction please!

    Any help would be really appreciated!

    p.s. I'm sorry about the cobbled way I've expressed my set up above, its been a rather cobbled attempt so far, i do apologise for its scruffiness, I've tried to clean it up as best as i can!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!