Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Device Debugging » Linux, Graphics Driver Debug How To(Im working on a graphics driver and hoping to update my tools to eclipse)
Linux, Graphics Driver Debug How To [message #695785] Tue, 12 July 2011 14:42
chris pepper is currently offline chris pepperFriend
Messages: 1
Registered: July 2011
Junior Member
Hi Everyone,

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 side

All the stuff I've done so far is totally guess work (which probably shows Posted Image ), 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!

[Updated on: Wed, 13 July 2011 10:24]

Report message to a moderator

Previous Topic:Forum Closure
Next Topic:Is it possible to debug a GPU code with Eclipse ?
Goto Forum:

Current Time: Tue Nov 13 18:06:07 GMT 2018

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

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

Back to the top