Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Debugging Existing Opensource Project(Using CDT to open and run an existing project for stepthru debugging.)
Debugging Existing Opensource Project [message #962787] Mon, 29 October 2012 10:26 Go to next message
David Coventry is currently offline David Coventry
Messages: 3
Registered: October 2012
Junior Member
I'm trying to deconstruct an open source project (libreplanet.org/wiki/LibreDWG]LibreDWG) and am hoping to use a stepping degugger so that I can work out how to read dwg CAD files.

I have downloaded the source and compiled it without error using ./configure CFLAG=-g and make.

I have tried to set it up using the New->Makefile Project with existing code

This appears to Build and Compile correctly but I when try to run the resulting executable I get "Launch Failed. Binary not found".

"CDT Build Console"


**** Build of configuration Default for project srcneck ****

make all
make all-am
make[1]: Entering directory `/home/dave/Documents/Projects/Programming/workspace/libredwg/src'
make[1]: Leaving directory `/home/dave/Documents/Projects/Programming/workspace/libredwg/src'

**** Build Finished ****


The Makefile is attached:

The other option I have tried is to generate a new project and then import the libredwg files, but I get numerous syntax errors when I try this.

I am using Eclipse Indigo Version: 3.7.2, on X-Ubuntu, Linux.
  • Attachment: Makefile
    (Size: 19.61KB, Downloaded 62 times)
Re: Debugging Existing Opensource Project [message #964216 is a reply to message #962787] Tue, 30 October 2012 10:47 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
Quote:
This appears to Build and Compile correctly but I when try to run the resulting executable I get "Launch Failed. Binary not found".

When you edit the Launch Configuration you can define the name and path of the binary.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging Existing Opensource Project [message #969828 is a reply to message #962787] Sat, 03 November 2012 15:45 Go to previous messageGo to next message
David Coventry is currently offline David Coventry
Messages: 3
Registered: October 2012
Junior Member
Ok, well, thanks very much for the reply.

The project I'm trying to examine has source files in a subdirectory called 'src'.

None of these has a 'main()' function.

There is another subdirectory called 'example' which has a file called 'test.c' which contains a 'int main()' function which then calls a function in 'dwg.c' which is in the 'src' directory. The header file for 'dwg.c' is invoked by the directive '#include <dwg.h>'.

I have compiled the Project files by running './configure CFLAGS=-g', 'make' and 'sudo make install' which has generated the executables including 'test'. The test execuatble takes as a required argument the path of a CAD file (in AutoCAD DWG file format) and does run when called from the command line, although it does a core dump with a segmentation fault.

Try as I might, I cannot figure how to get the Project to run the executable although it now appears to build without error. Quite what I am building is also a matter of mystery as there is no indication which of the executables in the 'example' subdirectory is being built. I am rather hoping, probably a little too optimistically, that it is all of them.

The source code I am trying to follow by stepping through the lines of code (alwats assuming this is possible with Eclipse) is a file called 'decode.c'.

Does Eclipse have this capability?

If so could someone perhaps point me in the right direction so that I can a) build the test executable with the correct debugging, b) run the executable giving it the correct path to the input file and c) set up breakpoints in the 'decode.c' source code.

Many thanks,

~ Dave Coventry

[Updated on: Sat, 03 November 2012 15:54]

Report message to a moderator

Re: Debugging Existing Opensource Project [message #971981 is a reply to message #969828] Mon, 05 November 2012 09:08 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
In the Project Explorer is a virtual folder called Binaries. There are all binaries in your project that Eclipse has found. Select the one you want to debug and open the context menu to start the debug session.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Debugging Existing Opensource Project [message #986050 is a reply to message #962787] Sat, 17 November 2012 21:13 Go to previous messageGo to next message
David Coventry is currently offline David Coventry
Messages: 3
Registered: October 2012
Junior Member
Maybe I'm missing something, but I don't see anything that might refer to Binaries.

index.php/fa/12422/0/

The directory 'examples' has a number of executables:

index.php/fa/12426/0/

As can be shown by 'ls -l test*'

index.php/fa/12427/0/
  • Attachment: Binaries.png
    (Size: 28.24KB, Downloaded 298 times)
  • Attachment: example.png
    (Size: 40.69KB, Downloaded 299 times)
  • Attachment: lstest.png
    (Size: 36.25KB, Downloaded 297 times)

[Updated on: Sat, 17 November 2012 21:18]

Report message to a moderator

Re: Debugging Existing Opensource Project [message #986463 is a reply to message #986050] Tue, 20 November 2012 14:26 Go to previous message
Axel Mueller is currently offline Axel Mueller
Messages: 1949
Registered: July 2009
Senior Member
In Project Explorer click the small white triangle in the upper left corner to get the context menu. Then select "Customize View..". In the tab "Contents" enable "CDT Elements".
Usually this is enable by default.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Multiple Configurations in Eclipse
Next Topic:makefile-working with envirnoment variables
Goto Forum:
  


Current Time: Wed Sep 17 23:46:14 GMT 2014

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

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