Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Debug source lookup question

Hi Mikhail,

Not meaning to labour the point, but I think we have two separate issues here.

> I can't comment on the latest changes - haven't worked on or used
> seriously a CDT/GDB based debugger for more than a year. If there is a
> problem with AbsolutePathSourceContainer it should be fixed.

I don't think there is a problem with it.  If execution stops at some
external absolute file path -- for example the user steps into a
library function (where the library has debug symbols) they should see
the source.  It would be overkill to force the user to add all
external source locations to the launch config "Source" tab.  For this
AbsolutePathSourceContainer does what it says on the tin.

> But I still think the synchronization with the source lookup is
> required. If executable is compiled with "/foo/../main.c" setting a
> breakpoint at "/foo/main.c" wouldn't work. And the source lookup is the
> place where we can resolve this type of issues.

I see there is a problem here, but it's not one the source locator solves:
  - If both main.c's were in different projects, marker comparison
would spot this.
  - If they are in the same project, and not both built into the same
executable, your default Project Path Container would also fail --
there's a collision here and both exist in the source container.
  - If both main.c's are in the same project and built into the same
executable then you're scuppered if you don't select "Use full file
path to set breakpoints" as the breakpoints aren't disambiguated
before being set (cdt just uses main.c:xx as discussed previously).

A better solution might be to look in the binary and check whether
there are any source file collisions before attempting to set
breakpoints.

>From my point of view, if you make the source locators too specific
(so breakpoints are filtered) then when the target stops you risk not
finding the source.  If you make it too general -- allowing it to
resolve all source on a best effort basis -- then all breakpoints are
set on launch.

Even though both features are based on sets of source files: the set
of files with breakpoints that will be set on launch,  is contained
within the set of source file locations we can resolve in the IDE, and
not vice versa.  (Obviously the sets are equivalent if we know exactly
what files are built into an executable, but this isn't what the
source locator provides.)

Cheers,

James


Back to the top