Bug 63883 - breakpoint do not work if there are 2 files with the same name
Summary: breakpoint do not work if there are 2 files with the same name
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 3.0.0a5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-08 08:21 UTC by shift
Modified: 2005-07-19 15:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shift 2003-09-08 08:21:44 UTC
Version:           3.0.0a5 (using KDE 3.1.3)
Installed from:    SuSE
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.21-64-default

in my projects there 2 files with absolutely the same name  residing in different subprojects (say, lib1/data.cpp and lib2/data.cpp ). And regardless of in which of them i set a breakpoint within the Kdevelop IDE, gdb then always thinks as i set the breakpoint in the first one.  

(build of 30/08)
Comment 1 John Birch 2003-09-08 08:33:51 UTC
Very odd. The breakpoints are set with the full path name (or they used to be). 
What does the GDB window say when it tries to set a breakpoint? 
 
Comment 2 shift 2003-09-09 06:56:34 UTC
Subject: Re:  breakpoint do not work if there are 2 files with the same name

project is Automake-based C++, imported from pre-existing automake/autoconf 
files. 

i set a break point in my  lib2/data.cpp, 
and when i start debugging, the GDB prints the following:

(gdb) break data.cpp:541
No line 541 in file "data.cpp" 

remark: 
the file lib1/data.cpp has only 155 lines

actually -- i could not find a way to reffer to lib1/data.cpp in gdb command 
line -- my temprorary workaround is to set breakpoints on the method calls
(it is easy to do in ddd, since it has command-line-auto-completion :-), but 
its source browser does not display subdirs -- i have only one data.cpp there 
:-) ) 

note: my project does not have src directory, like new automake-based project 
creates, and all the necesary automake stuff was created using simply 
'automake -a -c' and 'libtoolize -c'  -- i.e. not what new automake-based 
project offers. 

the project directory tree looks like the following 

./  -- only auto* stuff, kdevelop project file and makefiles 
./lib1 -- contains sources of lib1.a 
./lib2 -- contains sources of lib2.a
./lib2/sublib1  -- contains sources of libsublib1.a
./progname -- contatins sources of progname binary, 
                        plus it links with  .a libs listed above.  
 

and,  my gdb is version 5.3, my linux is SuSE 8.2 


On Monday 08 September 2003 01:33, you wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=63883
>
>
>
>
> ------- Additional Comments From jbb@kdevelop.org  2003-09-08 08:33 -------
> Very odd. The breakpoints are set with the full path name (or they used to
> be). What does the GDB window say when it tries to set a breakpoint?
> __________
> IP - 
Comment 3 Jens Dagerbo 2005-01-13 01:07:33 UTC
Has anyone been able to reproduce this bug?
Comment 4 Robert Light 2005-02-07 15:40:16 UTC
This may not be relevant - but kdevelop or gdb doesn't deal properly with mixedcase filenames.  If you set a breakpoint on line 13 of HelloWorld.cpp - the breakpoint will be missed and you will get:

(gdb) break HelloWorld.cpp:13 
No source file named HelloWorld.cpp.

if you change the breakpoint in the "breakpoints" window from HelloWorld.cpp to helloworld.cpp the breakpoint will get hit but you won't see the source code line highlight (because that is in HelloWorld.cpp).

kdevelop:3.1.1
gdb: 6.1post-1.20040607.43rh
Comment 5 Amilcar do Carmo Lucas 2005-02-08 00:45:02 UTC
I do not see anything about this on the change log. So it's probably still valid in HEAD

Comment 6 Jens Dagerbo 2005-02-08 01:51:18 UTC
Amilcar,
That's assuming it was ever valid.. can anyone reproduce it?
Comment 7 shift 2005-02-08 14:52:57 UTC
I still can reproduce it on kDevelop 3.1.2 in SuSE 9.1 

make a project with 2 subdirs something like this: 


/dir1 
         test.cpp 
/dir2 
         test.cpp
/src
         main.cpp 

all files linked into a single executable. 

make a content something like this: 


dir1/test.cpp :
       #include <stdio.h>
        int Test1(){
            return printf("TEST1 called\n");
       }
dir2/test.cpp :
       #include <stdio.h>
        int Test2(){
            return printf("TEST2 called\n");
       }


make sure that  linenumber of return satement is the same in both files !!! 


src/main.cpp :
        #include <stdio.h>
        int Test1();
        int Test2();
        int main() {
                 printf("calling test1:...");
                 Test1();
                 printf("calling test2:...");
                 Test2();
                 return 0;
        }
       

now compile and run it.
then set the breakpoint upon the return statement in dir1/test.cpp 
run and see the results. 
now set the breakpoint upon the return statement in dir2/test.cpp 
run and compare. 

in my case the result was the same: in both cases it stopped in the 
dir1/test.cpp. In DDD it works just as it should. 

sorry guys, i dont have possibility to test it in HEAD right now. 

Comment 8 shift 2005-02-16 11:50:52 UTC
I cheked it in KDevelop 3.2 beta 2
which comes with SuSE 9.1 packages of KDE 3.2beta2 
and the bug is still there


On Tuesday 08 February 2005 16:52, shift@newmail.ru wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=63883
>
>
>
>
> ------- Additional Comments From shift newmail ru  2005-02-08 14:52
> ------- I still can reproduce it on kDevelop 3.1.2 in SuSE 9.1
>
> make a project with 2 subdirs something like this:
>
>
> /dir1
>          test.cpp
> /dir2
>          test.cpp
> /src
>          main.cpp
>
> all files linked into a single executable.
>
> make a content something like this:
>
>
> dir1/test.cpp :
>        #include <stdio.h>
>         int Test1(){
>             return printf("TEST1 called\n");
>        }
> dir2/test.cpp :
>        #include <stdio.h>
>         int Test2(){
>             return printf("TEST2 called\n");
>        }
>
>
> make sure that  linenumber of return satement is the same in both files
> !!!
>
>
> src/main.cpp :
>         #include <stdio.h>
>         int Test1();
>         int Test2();
>         int main() {
>                  printf("calling test1:...");
>                  Test1();
>                  printf("calling test2:...");
>                  Test2();
>                  return 0;
>         }
>
>
> now compile and run it.
> then set the breakpoint upon the return statement in dir1/test.cpp
> run and see the results.
> now set the breakpoint upon the return statement in dir2/test.cpp
> run and compare.
>
> in my case the result was the same: in both cases it stopped in the
> dir1/test.cpp. In DDD it works just as it should.
>
> sorry guys, i dont have possibility to test it in HEAD right now.

Comment 9 Vladimir Prus 2005-07-19 15:27:52 UTC
Fixed by this commit:

  r431114 | amantia | 2005-07-03 14:07:29 +0400 (Sun, 03 Jul 2005) | 2 lines