Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327458

Summary: It is not possible to debug autotools project
Product: z_Archived Reporter: BB <bjoern.kiefer>
Component: AutotoolsAssignee: Jeff Johnston <jjohnstn>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description BB CLA 2010-10-11 11:27:27 EDT
I detected the same problem described in forum:
http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg17057.html

"I have libtool generated executable and some libraries. I can debug the executable and libraries by creating a run/debug configuration for which I must set all the paths manually. But I would like to be able to debug it by using libtool itself: libool --mode=execute gdb my_executable"
Comment 1 Doug Schaefer CLA 2010-10-11 16:51:33 EDT
Sending this to the autotools guys. I'm not sure what this is all about.
Comment 2 Jeff Johnston CLA 2010-10-12 18:28:37 EDT
(In reply to comment #0)
> I detected the same problem described in forum:
> http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg17057.html
> 
> "I have libtool generated executable and some libraries. I can debug the
> executable and libraries by creating a run/debug configuration for which I must
> set all the paths manually. But I would like to be able to debug it by using
> libtool itself: libool --mode=execute gdb my_executable"

This should have been an RFE stating your request to use libtool to debug as opposed to "It is not possible to debug an Autotools project".

If you look at the Debug launcher under Debug Configurations, you will see a tab labelled "gdb".  There you can specify the command for gdb.  Try putting libtools --mode=execute gdb and see if that helps.  I tried it on a normal application and it worked ok, but I didn't try it with something with uninstalled shared library references.
Comment 3 BB CLA 2010-10-13 10:47:26 EDT
(In reply to comment #2)
> (In reply to comment #0)
> > I detected the same problem described in forum:
> > http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg17057.html
> > 
> > "I have libtool generated executable and some libraries. I can debug the
> > executable and libraries by creating a run/debug configuration for which I must
> > set all the paths manually. But I would like to be able to debug it by using
> > libtool itself: libool --mode=execute gdb my_executable"
> 
> This should have been an RFE stating your request to use libtool to debug as
> opposed to "It is not possible to debug an Autotools project".
> 
> If you look at the Debug launcher under Debug Configurations, you will see a
> tab labelled "gdb".  There you can specify the command for gdb.  Try putting
> libtools --mode=execute gdb and see if that helps.  I tried it on a normal
> application and it worked ok, but I didn't try it with something with
> uninstalled shared library references.

If you want to debug a libtool generated executable, you have to enter the following command:
"libtools --mode=execute gdb executable_script"
Libtool creates an executable script and the real executable is located in hidden subdirectory ".libs". I think the problem is that the eclipse debug launcher expects a binary file and does not allow to select a script to debug.
Comment 4 Jeff Johnston CLA 2010-10-14 16:58:16 EDT
> If you want to debug a libtool generated executable, you have to enter the
> following command:
> "libtools --mode=execute gdb executable_script"
> Libtool creates an executable script and the real executable is located in
> hidden subdirectory ".libs". I think the problem is that the eclipse debug
> launcher expects a binary file and does not allow to select a script to debug.

I see.  Have you tried a workaround of specifying the executable script as well in the gdb command replacement?

There are two options to fix this:

1. Open an RFE to allow specification of an executable script in the launcher
   (in which case you can specify the libtool command for the gdb command)

2. Open an RFE to add a new debug launcher for debugging via libtool
Comment 5 BB CLA 2010-10-15 12:21:31 EDT
(In reply to comment #4)
> > If you want to debug a libtool generated executable, you have to enter the
> > following command:
> > "libtools --mode=execute gdb executable_script"
> > Libtool creates an executable script and the real executable is located in
> > hidden subdirectory ".libs". I think the problem is that the eclipse debug
> > launcher expects a binary file and does not allow to select a script to debug.
> 
> I see.  Have you tried a workaround of specifying the executable script as well
> in the gdb command replacement?
> 
> There are two options to fix this:
> 
> 1. Open an RFE to allow specification of an executable script in the launcher
>    (in which case you can specify the libtool command for the gdb command)
> 
> 2. Open an RFE to add a new debug launcher for debugging via libtool

I have already tried this workaround but it did not work. I think the best way is to allow specification of an executable script. I will open an enhancement bug for CDT Debugger and I will close this bug. Thanks.
Comment 6 BB CLA 2010-10-17 17:25:02 EDT
I have opened a new enhancement bug 328001. So I close this bug.

*** This bug has been marked as a duplicate of bug 328001 ***