Skip to main content



      Home
Home » Newcomers » Newcomers » Using Eclipse to debug program with Make
Using Eclipse to debug program with Make [message #253817] Sat, 12 April 2008 21:24 Go to next message
Eclipse UserFriend
Hi,

I recently try to debug a C++ program which executed through Make files.
This program has also XML file in the end to wrap up all the text files
using Make.

I wanted to debug the C++ code for a particular file; So, I try to choose
one of the main binary to debug but it seems that its not working. It gives
me error such as:- count not find *stuffs* in other files from other
directories.

Is there any way I could debug this type of program which is compiled
through Make in the Eclipse IDE?

Please get back to me asap. Having this hang for a couple of months.

Thanks.
Re: Using Eclipse to debug program with Make [message #253833 is a reply to message #253817] Mon, 14 April 2008 03:35 Go to previous messageGo to next message
Eclipse UserFriend
Frederick wrote:
> Hi,
>
> I recently try to debug a C++ program which executed through Make files.
> This program has also XML file in the end to wrap up all the text files
> using Make.
>
> I wanted to debug the C++ code for a particular file; So, I try to choose
> one of the main binary to debug but it seems that its not working. It gives
> me error such as:- count not find *stuffs* in other files from other
> directories.
> Is there any way I could debug this type of program which is compiled
> through Make in the Eclipse IDE?
>
> Please get back to me asap. Having this hang for a couple of months.
>
> Thanks.
>
>

Could you elaborate a bit more what you did and what the exact error
message was that you got?
Basically you can debug any native binary executable with Eclipse/CDT
provided you have GDB installed.
A common stumbling block is also that the correct binary parser for the
project needs to be configured. Look into the project properties.

--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Using Eclipse to debug program with Make [message #253872 is a reply to message #253833] Mon, 14 April 2008 11:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ahjiefreak.yahoo.com

Hi,

Thanks for the prompt reply.

I have this project which has make which is analysis.mk and analysis.mk.in.
And this project contains alot of C++ files and there is no single main
binary as I know of.

What usually I did so far is doing a Make on the src folder, pointing to
another makefile in another sub folder and hence it is executed.

However, i tried to point to almost all the important binary but I could
not resolve the problem I faced which keeps on saying "some inputs is
needed from file XXX" This file XXX is from another sub folder.

For the Eclipse settings, I tried to set to Select Import->C/C++ project
files,
Then, I tried both options..Through directory and Through binary.

For directory, I try to point to project/src and they list some binaries
automatically. However, it doesnt work as well. Same goes for in
binary/executables option.

I tried on GDB and its the same scenario. Certainly , GDB is installed
properly as well.

Please help. I am stuck at this stage. Thanks.


Rgrds,
Frederick
Re: Using Eclipse to debug program with Make [message #253922 is a reply to message #253872] Tue, 15 April 2008 03:56 Go to previous messageGo to next message
Eclipse UserFriend
Frederick wrote:
> Hi,
>
> Thanks for the prompt reply.
>
> I have this project which has make which is analysis.mk and analysis.mk.in.
> And this project contains alot of C++ files and there is no single main
> binary as I know of.
>
> What usually I did so far is doing a Make on the src folder, pointing to
> another makefile in another sub folder and hence it is executed.
>
> However, i tried to point to almost all the important binary but I could
> not resolve the problem I faced which keeps on saying "some inputs is
> needed from file XXX" This file XXX is from another sub folder.
>
> For the Eclipse settings, I tried to set to Select Import->C/C++ project
> files,
> Then, I tried both options..Through directory and Through binary.
>
> For directory, I try to point to project/src and they list some binaries
> automatically. However, it doesnt work as well. Same goes for in
> binary/executables option.
>
> I tried on GDB and its the same scenario. Certainly , GDB is installed
> properly as well.
>
> Please help. I am stuck at this stage. Thanks.
>
>
> Rgrds,
> Frederick
>

Hm, I am not sure I understand the issue. My current assumption is:

1) You have used the Import C/C++ Executable wizard to create
an Eclipse project for debugging.
2) Launching the debugger gives you error messages.

Are my assumptions correct?

Please copy/paste the exact error messages and describe where and when
they appear.
Do you get the same error when you use GDB on the command line?
Do you have defined LD_LIBRARY_PATH such that all the shared libraries
required by your program are found?

HTH
--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Using Eclipse to debug program with Make [message #253958 is a reply to message #253922] Tue, 15 April 2008 10:23 Go to previous messageGo to next message
Eclipse UserFriend
Anton Leherbauer wrote:

> Frederick wrote:
>> Hi,
>>
>> Thanks for the prompt reply.
>>
>> I have this project which has make which is analysis.mk and analysis.mk.in.
>> And this project contains alot of C++ files and there is no single main
>> binary as I know of.
>>
>> What usually I did so far is doing a Make on the src folder, pointing to
>> another makefile in another sub folder and hence it is executed.
>>
>> However, i tried to point to almost all the important binary but I could
>> not resolve the problem I faced which keeps on saying "some inputs is
>> needed from file XXX" This file XXX is from another sub folder.
>>
>> For the Eclipse settings, I tried to set to Select Import->C/C++ project
>> files,
>> Then, I tried both options..Through directory and Through binary.
>>
>> For directory, I try to point to project/src and they list some binaries
>> automatically. However, it doesnt work as well. Same goes for in
>> binary/executables option.
>>
>> I tried on GDB and its the same scenario. Certainly , GDB is installed
>> properly as well.
>>
>> Please help. I am stuck at this stage. Thanks.
>>
>>
>> Rgrds,
>> Frederick
>>

> Hm, I am not sure I understand the issue. My current assumption is:

> 1) You have used the Import C/C++ Executable wizard to create
> an Eclipse project for debugging.
> 2) Launching the debugger gives you error messages.

> Are my assumptions correct?

> Please copy/paste the exact error messages and describe where and when
> they appear.
> Do you get the same error when you use GDB on the command line?
> Do you have defined LD_LIBRARY_PATH such that all the shared libraries
> required by your program are found?

> HTH
Hi,

Your assumptions are almost correct. I am launching debugger and do some
step-in until a function which somehow call another files. And then,it
jumps out and gives error message below.

I used GDB and the same error occur.."could not find count from
../stamp-label"

And I suspect its the binary which I choose is not the main one.
Eclipse didnt show me any useful main binary which I can used for
debugging.

I tried to ask around in #eclipse in freenode.net but I could not find any
solution either.


Please let me know. Thanks.


Rgrds,
Frederick
Re: Using Eclipse to debug program with Make [message #254011 is a reply to message #253958] Wed, 16 April 2008 04:35 Go to previous messageGo to next message
Eclipse UserFriend
Frederick wrote:
> Anton Leherbauer wrote:
>
>> Frederick wrote:
>>> Hi,
>>>
>>> Thanks for the prompt reply.
>>>
>>> I have this project which has make which is analysis.mk and
>>> analysis.mk.in.
>>> And this project contains alot of C++ files and there is no single
>>> main binary as I know of.
>>>
>>> What usually I did so far is doing a Make on the src folder, pointing
>>> to another makefile in another sub folder and hence it is executed.
>>>
>>> However, i tried to point to almost all the important binary but I
>>> could not resolve the problem I faced which keeps on saying "some
>>> inputs is needed from file XXX" This file XXX is from another sub
>>> folder.
>>>
>>> For the Eclipse settings, I tried to set to Select Import->C/C++
>>> project files,
>>> Then, I tried both options..Through directory and Through binary.
>>>
>>> For directory, I try to point to project/src and they list some
>>> binaries automatically. However, it doesnt work as well. Same goes
>>> for in binary/executables option.
>>>
>>> I tried on GDB and its the same scenario. Certainly , GDB is
>>> installed properly as well.
>>>
>>> Please help. I am stuck at this stage. Thanks.
>>>
>>>
>>> Rgrds,
>>> Frederick
>>>
>
>> Hm, I am not sure I understand the issue. My current assumption is:
>
>> 1) You have used the Import C/C++ Executable wizard to create
>> an Eclipse project for debugging.
>> 2) Launching the debugger gives you error messages.
>
>> Are my assumptions correct?
>
>> Please copy/paste the exact error messages and describe where and when
>> they appear.
>> Do you get the same error when you use GDB on the command line?
>> Do you have defined LD_LIBRARY_PATH such that all the shared libraries
>> required by your program are found?
>
>> HTH
> Hi,
>
> Your assumptions are almost correct. I am launching debugger and do some
> step-in until a function which somehow call another files. And then,it
> jumps out and gives error message below.
>
> I used GDB and the same error occur.."could not find count from
> ./stamp-label"
>
> And I suspect its the binary which I choose is not the main one.
> Eclipse didnt show me any useful main binary which I can used for
> debugging.
>
> I tried to ask around in #eclipse in freenode.net but I could not find
> any solution either.
>
>
> Please let me know. Thanks.
>
>
> Rgrds,
> Frederick
>

I don't know what you mean by the "main" binary.
If your project creates multiple executable binaries, you have to choose
yourself, which one you would like to debug.

To debug the executable, it should be built with debug info (gcc -g) and
no optimization (-O0).
Could you try the following command in a shell:

file <your_executable_file>

You should get some information about the type of binary it is, whether
it contains debug info or not, etc.

Anyway, as you get the error from GDB, eclipse.newcomer is probably not
the best forum to get help for this problem.


--
Anton Leherbauer
Wind River CDT Team, Austria
Re: Using Eclipse to debug program with Make [message #254201 is a reply to message #254011] Thu, 17 April 2008 23:42 Go to previous message
Eclipse UserFriend
Hi Anton

Earlier on, I am using both Eclipse and GDB to compare the debugging
output. And they are the same.

Anyway I have checked in most of the binaries and they returned as:-

fileXXXx: ELF 32-bit LSB executable, Intel 80386, version 1(SYSV),
dynamically lined(uses shared libs), for GNU/Linux 2.6.9, not stripped.

I have no idea what debugger I could use to find these main binary.

Please advise.
Previous Topic:web service question
Next Topic:C# compiler Mac OS X 10.4
Goto Forum:
  


Current Time: Sun May 11 23:14:15 EDT 2025

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

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

Back to the top