This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/17497] New: gdb doesn't always consider normalized source file paths when inserting breakpoints


https://sourceware.org/bugzilla/show_bug.cgi?id=17497

            Bug ID: 17497
           Summary: gdb doesn't always consider normalized source file
                    paths when inserting breakpoints
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: malaperle at gmail dot com

I have an executable with debug symbols with a path that look likes
/build-server/program/build/../file.c
I try to insert a breakpoint by using the CLI "b /build-server/program/file.c"

If file.c doesn't exist, gdb fails to insert the breakpoint with "No source
file named".
However, if file.c exists, it works. So it seems that in that case it correctly
normalizes the source file path in the debug symbols and removes the
"build/../" part so that it can be matched.

Some background:

This is especially a problem when using Eclipse with path mapping. For example,
the program was compiled in /build-server/program/build on another machine and
I try to debug it on my local machine with the source files in
/home/user/program. If I create this mapping:

/home/user/program -> /build-server/program/build/../

The paths in the mapping get normalized (by Eclipse) to this:

/home/user/program -> /build-server/program/

So that when I set a breakpoint in /home/user/program/file.c, it issues the
command to insert in /build-server/program/file.c. But that doesn't work, as
explained above. One could argue that this could be changed on the Eclipse side
so that it doesn't normalize the paths but I think it's reasonable to expect
that the user should be able to enter "b /build-server/program/file.c" and
expect it to work on the command line.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]