Bug 270970 - Breakpoint in the .gdbinit script is multiplied
Summary: Breakpoint in the .gdbinit script is multiplied
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Unclassified
Component: CPP Debugger (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 327085 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-14 18:12 UTC by leon pollak
Modified: 2014-01-10 15:47 UTC (History)
2 users (show)

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 leon pollak 2011-04-14 18:12:14 UTC
Version:           git master (using KDE 4.5.5) 
OS:                Linux

A break point inserted into the .gdbinit file as 
br main.c:10
is inserted again and again on each start of the debugger.
This finally leads to a tens of BP which slows down the debugger very much.

Reproducible: Always

Steps to Reproduce:
Insert BP into the gdbinit file and rerun the debugger

Actual Results:  
Breakpoint pane shows many BP of the same content

Expected Results:  
Only one BP
Comment 1 Niko Sams 2011-06-11 23:33:51 UTC
Git commit 205a838c121baed2ebe8508095e25ad1eaa72a82 by Niko Sams.
Committed on 11/06/2011 at 23:31.
Pushed by nsams into branch 'master'.

When starting gdb read breakpoints and merge them with existing ones

That way we don't get duplicates when the user adds new ones using .gdbinit
for every session, and we save them additionally.

BUG: 270970

M  +50   -0    debuggers/gdb/breakpointcontroller.cpp     
M  +1    -0    debuggers/gdb/breakpointcontroller.h     
M  +27   -0    debuggers/gdb/unittests/gdbtest.cpp     
M  +1    -0    debuggers/gdb/unittests/gdbtest.h     

http://commits.kde.org/kdevelop/205a838c121baed2ebe8508095e25ad1eaa72a82
Comment 2 Niko Sams 2011-06-11 23:34:37 UTC
Please test if this fixes the problem for you - if not reopen.
Comment 3 leon pollak 2011-06-29 11:34:08 UTC
It does not.
Comment 4 Niko Sams 2011-07-02 10:44:38 UTC
Did you try using master?
I can't reproduce the problem anymore, even with remote debugging.
Comment 5 leon pollak 2013-11-04 08:01:48 UTC
This problem returned. See bug 327085.
Comment 6 leon pollak 2013-11-04 08:13:44 UTC
*** Bug 327085 has been marked as a duplicate of this bug. ***
Comment 7 Milian Wolff 2013-11-04 09:29:04 UTC
Reopening as to Leon's report.
Comment 8 Vlas Puhov 2013-11-05 18:06:13 UTC
Git commit 47b00e535731a18323a706489efd150d3fc1bad4 by Vlas Puhov.
Committed on 05/11/2013 at 19:56.
Pushed by vpuhov into branch '4.6'.

Don't set the same breakpoint multiple times when starting.

It was implemented only for file:line cases, now function cases
supported too(e.g. main.cpp:10 and main). Also added unit test for it.

M  +9    -0    debuggers/gdb/breakpointcontroller.cpp
M  +8    -2    debuggers/gdb/unittests/gdbtest.cpp

http://commits.kde.org/kdevelop/47b00e535731a18323a706489efd150d3fc1bad4
Comment 9 leon pollak 2013-12-16 10:07:37 UTC
Sorry, but the git master again multiplies these BP as it was previously.
Comment 10 Vlas Puhov 2014-01-01 13:25:51 UTC
    It works perfectly for me...
Could you try to run it from a clean user. E.g. by adding a new user, and creating in home folder .gdbinit file which contains only br command and nothing else?
  If it still multiplies your breakpoints, could you then put a breakpoint at BreakpointController::handleBreakpointListInitial (in breakpointcontroller.cpp) and figure out why it does so?
   If not, at least attach the console's output...
   Also what information gives "info b" command given from within kdevelop, and does breakpoint's multiplication happens if you use gdb directly?
Comment 11 leon pollak 2014-01-09 18:38:49 UTC
Здравствуйте, Влас.

Я буду рад помочь, если вы поможете мне...:-)

info b дает:

(gdb) info b
info b
Num Type Disp Enb Address What
1 breakpoint keep y 0x0008d108 in main(int, char**) at 
/Projects/CSU/src/main.cpp:56
breakpoint already hit 1 time
2 breakpoint keep y 0x000770e0 in BreakP() at 
/Projects/CSU/src/helpers/utils.cpp:13
3 breakpoint keep y 0x000770e0 in BreakP() at 
/Projects/CSU/src/helpers/utils.cpp:13
4 breakpoint keep y 0x0008d108 in main(int, char**) at 
/Projects/CSU/src/main.cpp:56
5 breakpoint keep y 0x000770e0 in BreakP() at 
/Projects/CSU/src/helpers/utils.cpp:13
6 breakpoint keep y 0x0008d108 in main(int, char**) at 
/Projects/CSU/src/main.cpp:56

при этом мой .gdbinit содержит:
    shell cp /Projects/CSU/BuildARM/debug/csu /opt/FS_DVRM/home/csu
    set remote exec-file /home/csu
    file /Projects/CSU/BuildARM/debug/csu
    target extended-remote 192.168.50.204:44000
    br main
    br BreakP
    r

(.gdbinit.ram содержит макро определения, не используются сейчас)

Оба файла находятся в директории /Projects/CSU/BuildPC/ а не в home.

Когда вы говорите о clean user, вы имеете ввиду создать нового?

Пожалуйста, примите во внимание, что я делаю remote debugging через 
Ethernet в девайс в котором стоит ARM9 processor.

Я буду рад следовать вашим указаниям.

On Wednesday 01 January 2014 13:25:51 you wrote:
> https://bugs.kde.org/show_bug.cgi?id=270970
> 
> Vlas Puhov <vlas.puhov@mail.ru> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------
> ------ Status|REOPENED                    |NEEDSINFO
>                  CC|                            |vlas.puhov@mail.ru
>          Resolution|---                         |WAITINGFORINFO
> 
> --- Comment #10 from Vlas Puhov <vlas.puhov@mail.ru> ---
>     It works perfectly for me...
> Could you try to run it from a clean user. E.g. by adding a new user,
> and creating in home folder .gdbinit file which contains only br
> command and nothing else?
>   If it still multiplies your breakpoints, could you then put a
> breakpoint at BreakpointController::handleBreakpointListInitial (in
> breakpointcontroller.cpp) and figure out why it does so?
>    If not, at least attach the console's output...
>    Also what information gives "info b" command given from within
> kdevelop, and does breakpoint's multiplication happens if you use gdb
> directly?
Comment 12 Vlas Puhov 2014-01-10 12:38:00 UTC
Git commit d9f8904814fa7a795dbfd508e484ce2fd9e5f578 by Vlas Puhov.
Committed on 10/01/2014 at 12:15.
Pushed by vpuhov into branch 'master'.

Don't insert the same breakpoint multiple times while starting. Part 2.

First compare "fullname" and "line" entries and only if it fails fall
back to "original-location", as the latter can contaion literally
anything. Note that even a better solution'd be to store a full path
in the first place (if available).

M  +17   -2    debuggers/gdb/breakpointcontroller.cpp
M  +1    -0    debuggers/gdb/unittests/gdbtest.cpp

http://commits.kde.org/kdevelop/d9f8904814fa7a795dbfd508e484ce2fd9e5f578
Comment 13 leon pollak 2014-01-10 15:47:53 UTC
Thanks!
I confirm - work now!!