Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to debug into source files of another project
How to debug into source files of another project [message #15882] Thu, 07 February 2002 02:51 Go to next message
Eclipse UserFriend
Originally posted by: rerngler.sg.ibm.com

First, I will like to congratulate on the CDT. I only spent a few minutes
on the interface and was able to compile and debug C++ projects.
When I delve into the debug feature, I met a slight problem though. I am
debugging a project that uses some shared library maintained by another
project. When I tried to step into the source files of another project
from the current project, the debugger complains that it could not find
the source file. I think the debugger is trying to look for the source
file in the current project and could not find it.
I could not find any menu option that allows me to load the source file
belonging to another project into the debugger editor for debugging. Can
anyone help me ?

Thanks in advance...
Re: How to debug into source files of another project [message #15902 is a reply to message #15882] Thu, 07 February 2002 11:31 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your positive comments.

There are two ways for the debug feature to find a particular source file.
The first, is through the "source locator", a service that attempts to find
the file using project resource information. If the source locator fails to
find the source, then the task is delegated to the debug engine. I don't
know enough about the debug engine mechanism to comment on it, but I can
address the source locator.

The problem with the source locator is, as you suspect, that it only looks
for files in the project that contains the executable that is being
debugged. We have had some discussions about allowing a user to configure
the source locator to retrieve source files from places other than the
current project. One way to configure it would be to allow users to specify
debug source paths in a properties dialog. Maybe this could also be
configured when the source locator fails to find a source file. The notion
of specifying a path like this is similar to how a user specifies the include
path for the C/C++ parser. I think we might want to specify a single
interface for defining paths that can be used by the parser, debug source
locator and other tools, such as autoconf, for source paths, include paths
and lib paths. If you've got any ideas about this, please feel free to share
them.

Dave

Sitthichai Rernglertpricha wrote:

> First, I will like to congratulate on the CDT. I only spent a few minutes
> on the interface and was able to compile and debug C++ projects.
> When I delve into the debug feature, I met a slight problem though. I am
> debugging a project that uses some shared library maintained by another
> project. When I tried to step into the source files of another project
> from the current project, the debugger complains that it could not find
> the source file. I think the debugger is trying to look for the source
> file in the current project and could not find it.
> I could not find any menu option that allows me to load the source file
> belonging to another project into the debugger editor for debugging. Can
> anyone help me ?
>
> Thanks in advance...
Re: How to debug into source files of another project [message #15919 is a reply to message #15882] Thu, 07 February 2002 12:22 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your message.

The engine locates a file through the following mechanism. As you step
into the function, the engine retrieves call stack information from gdb.
Then the engine will check if it already has information about the files
on the call stack. If it does not already have the information, it will
query gdb for the files' information. During this query, the engine will
be able to get the build path information from gdb (assuming that your dll
is built with debug information). However, as I was looking into your
problem, I found that the build path information is lost during the
process. As a result, the engine is not able to locate the source of a
file from the dll.

I have already submitted a bug for this problem. For more information
about this bug and the testcase I used, please follow this link:
Bug 9253 - http://bugs.eclipse.org/bugs/show_bug.cgi?id=9253

In the future, if you would like to submit a problem into our bug
database, please feel free to do so at the following address:
bugs.eclipse.org

If you don't already have an account, create an account and follow the
link "Report a new bug" and open the bug against the CDT product.

Thanks

Regards,
Samantha Chan
Re: How to debug into source files of another project [message #15936 is a reply to message #15902] Fri, 08 February 2002 03:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rerngler.sg.ibm.com

Thanks for your reply.
Your suggestion on allowing users to specify debug source paths in
properties dialog is good. Another possibility is to popup a dialog (with
a browse... button) that ask the user for the full-path name of the
source. Once the user specifies the location of the source file, it will
be loaded into the debugger for view/debug. Meanwhile, the path
information can be updated into the properties. In this way, I do not
have to configure all possible source files location beforehand.
(The IDEBUG from IBM pops up a dialog for file location when it is not
found)

Thanks.

>David McKnight wrote:

> Thank you for your positive comments.

> There are two ways for the debug feature to find a particular source file.
> The first, is through the "source locator", a service that attempts to find
> the file using project resource information. If the source locator fails to
> find the source, then the task is delegated to the debug engine. I don't
> know enough about the debug engine mechanism to comment on it, but I can
> address the source locator.

> The problem with the source locator is, as you suspect, that it only looks
> for files in the project that contains the executable that is being
> debugged. We have had some discussions about allowing a user to configure
> the source locator to retrieve source files from places other than the
> current project. One way to configure it would be to allow users to specify
> debug source paths in a properties dialog. Maybe this could also be
> configured when the source locator fails to find a source file. The notion
> of specifying a path like this is similar to how a user specifies the include
> path for the C/C++ parser. I think we might want to specify a single
> interface for defining paths that can be used by the parser, debug source
> locator and other tools, such as autoconf, for source paths, include paths
> and lib paths. If you've got any ideas about this, please feel free to share
> them.

> Dave

> Sitthichai Rernglertpricha wrote:

> > First, I will like to congratulate on the CDT. I only spent a few minutes
> > on the interface and was able to compile and debug C++ projects.
> > When I delve into the debug feature, I met a slight problem though. I am
> > debugging a project that uses some shared library maintained by another
> > project. When I tried to step into the source files of another project
> > from the current project, the debugger complains that it could not find
> > the source file. I think the debugger is trying to look for the source
> > file in the current project and could not find it.
> > I could not find any menu option that allows me to load the source file
> > belonging to another project into the debugger editor for debugging. Can
> > anyone help me ?
> >
> > Thanks in advance...
Re: How to debug into source files of another project [message #16007 is a reply to message #15936] Sun, 10 February 2002 11:03 Go to previous message
Eclipse UserFriend
Thanks for your good suggestions. I especially like your idea to add
locations on demand. This is probably a good feature to post on the
mailing list.

Dave

Sitthichai Rernglertpricha wrote:

> Thanks for your reply.
> Your suggestion on allowing users to specify debug source paths in
> properties dialog is good. Another possibility is to popup a dialog (with
> a browse... button) that ask the user for the full-path name of the
> source. Once the user specifies the location of the source file, it will
> be loaded into the debugger for view/debug. Meanwhile, the path
> information can be updated into the properties. In this way, I do not
> have to configure all possible source files location beforehand.
> (The IDEBUG from IBM pops up a dialog for file location when it is not
> found)

> Thanks.

> >David McKnight wrote:

> > Thank you for your positive comments.

> > There are two ways for the debug feature to find a particular source file.
> > The first, is through the "source locator", a service that attempts to find
> > the file using project resource information. If the source locator fails
to
> > find the source, then the task is delegated to the debug engine. I don't
> > know enough about the debug engine mechanism to comment on it, but I can
> > address the source locator.

> > The problem with the source locator is, as you suspect, that it only looks
> > for files in the project that contains the executable that is being
> > debugged. We have had some discussions about allowing a user to configure
> > the source locator to retrieve source files from places other than the
> > current project. One way to configure it would be to allow users to
specify
> > debug source paths in a properties dialog. Maybe this could also be
> > configured when the source locator fails to find a source file. The notion
> > of specifying a path like this is similar to how a user specifies the
include
> > path for the C/C++ parser. I think we might want to specify a single
> > interface for defining paths that can be used by the parser, debug source
> > locator and other tools, such as autoconf, for source paths, include paths
> > and lib paths. If you've got any ideas about this, please feel free to
share
> > them.

> > Dave

> > Sitthichai Rernglertpricha wrote:

> > > First, I will like to congratulate on the CDT. I only spent a few minutes
> > > on the interface and was able to compile and debug C++ projects.
> > > When I delve into the debug feature, I met a slight problem though. I am
> > > debugging a project that uses some shared library maintained by another
> > > project. When I tried to step into the source files of another project
> > > from the current project, the debugger complains that it could not find
> > > the source file. I think the debugger is trying to look for the source
> > > file in the current project and could not find it.
> > > I could not find any menu option that allows me to load the source file
> > > belonging to another project into the debugger editor for debugging. Can
> > > anyone help me ?
> > >
> > > Thanks in advance...
Previous Topic:Text editor issues
Next Topic:Extensions mechanism
Goto Forum:
  


Current Time: Sun Jul 13 15:43:40 EDT 2025

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

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

Back to the top