public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted
@ 2015-07-10 15:43 simon.marchi at ericsson dot com
  2015-07-10 15:43 ` [Bug python/18655] " simon.marchi at ericsson dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: simon.marchi at ericsson dot com @ 2015-07-10 15:43 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 18655
           Summary: GDB Python FinishBreakpoints are not deleted
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com
  Target Milestone: ---

I am not completely certain that this is a bug, but here it is anyway. 
FinishBreakpoints are intended to be temporary, once the frame it's attached to
disappears, the breakpoint should vanish.  It is not the case currently.  I
believe this could be a problem when you start having a few thousand
breakpoints...

I will attach the example C and Python code. Here is a transcript showing that
FinishBreakpoints just keep piling up.  I used internal breakpoints to avoid
the verbose output, but it doesn't really matter.


$ gdb -nx -ex "set pagination off" a.out -x test.py
Reading symbols from a.out...done.
(gdb) r
Starting program: /home/emaisin/a.out 
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 0
Return value is 1
Return value is 2
Return value is 3
Return value is 4
Return value is 5
Return value is 6
Return value is 7
Return value is 8
Return value is 9
Return value is 0
Return value is 2
Return value is 4
Return value is 6
Return value is 8
Return value is 10
Return value is 12
Return value is 14
Return value is 16
Return value is 18
Return value is 0
Return value is 3
Return value is 6
Return value is 9
Return value is 12
Return value is 15
Return value is 18
Return value is 21
Return value is 24
Return value is 27
Return value is 0
Return value is 4
Return value is 8
Return value is 12
Return value is 16
Return value is 20
Return value is 24
Return value is 28
Return value is 32
Return value is 36
Return value is 0
Return value is 5
Return value is 10
Return value is 15
Return value is 20
Return value is 25
Return value is 30
Return value is 35
Return value is 40
Return value is 45

Temporary breakpoint -65, main () at test.c:13
13                      for (j = 0; j < 10; j++)
(gdb) maintenance info breakpoints 
Num     Type           Disp Enb Address            What
-1      breakpoint     keep y   0x00000000004004f7 in fonction at test.c:4 inf
1
-2      shlib events   keep y   0x00007ffff7dea970 <_dl_debug_state> inf 1
-3      longjmp master keep n   0x00007ffff7a4bb30 <siglongjmp> inf 1
-4      longjmp master keep n   0x00007ffff7a4bb30 <siglongjmp> inf 1
-5      longjmp master keep n   0x00007ffff7a4bb30 <siglongjmp> inf 1
-6      breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-7      breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-8      breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-9      breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-10     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-11     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-12     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-13     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-14     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-15     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-16     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-17     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-18     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-19     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-20     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-21     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-22     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-23     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-24     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-25     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-26     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-27     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-28     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-29     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-30     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-31     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-32     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-33     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-34     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-35     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-36     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-37     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-38     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-39     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-40     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-41     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-42     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-43     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-44     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-45     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-46     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-47     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-48     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-49     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-50     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-51     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-52     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-53     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-54     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-55     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-56     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-57     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-58     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-59     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-60     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-61     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-62     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-63     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
-64     breakpoint     del  n   0x0000000000400529 in main at test.c:13 inf 1
thread 1
        stop only in thread 1
(gdb)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] GDB Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
@ 2015-07-10 15:43 ` simon.marchi at ericsson dot com
  2015-07-10 15:44 ` simon.marchi at ericsson dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: simon.marchi at ericsson dot com @ 2015-07-10 15:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Simon Marchi <simon.marchi at ericsson dot com> ---
Created attachment 8426
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8426&action=edit
Test C code

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] GDB Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
  2015-07-10 15:43 ` [Bug python/18655] " simon.marchi at ericsson dot com
@ 2015-07-10 15:44 ` simon.marchi at ericsson dot com
  2015-07-10 18:17 ` [Bug python/18655] " simon.marchi at ericsson dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: simon.marchi at ericsson dot com @ 2015-07-10 15:44 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Simon Marchi <simon.marchi at ericsson dot com> ---
Created attachment 8427
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8427&action=edit
Test Python code

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
  2015-07-10 15:43 ` [Bug python/18655] " simon.marchi at ericsson dot com
  2015-07-10 15:44 ` simon.marchi at ericsson dot com
@ 2015-07-10 18:17 ` simon.marchi at ericsson dot com
  2015-07-10 18:52 ` andrew.burgess at embecosm dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: simon.marchi at ericsson dot com @ 2015-07-10 18:17 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|GDB Python                  |Python FinishBreakpoints
                   |FinishBreakpoints are not   |are not deleted
                   |deleted                     |

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
                   ` (2 preceding siblings ...)
  2015-07-10 18:17 ` [Bug python/18655] " simon.marchi at ericsson dot com
@ 2015-07-10 18:52 ` andrew.burgess at embecosm dot com
  2022-09-17  0:19 ` j3.soon777 at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: andrew.burgess at embecosm dot com @ 2015-07-10 18:52 UTC (permalink / raw)
  To: gdb-prs

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

Andrew Burgess <andrew.burgess at embecosm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.burgess at embecosm dot com

--- Comment #3 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
This old thread about the FinishBreakpoints might be of interest to anyone
taking on this bug: https://sourceware.org/ml/gdb-patches/2012-09/msg00436.html
I have not confirmed if those issues still all apply, apologies if they've been
fixed.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
                   ` (3 preceding siblings ...)
  2015-07-10 18:52 ` andrew.burgess at embecosm dot com
@ 2022-09-17  0:19 ` j3.soon777 at gmail dot com
  2022-09-17  0:24 ` j3.soon777 at gmail dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: j3.soon777 at gmail dot com @ 2022-09-17  0:19 UTC (permalink / raw)
  To: gdb-prs

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

Johnson Sun <j3.soon777 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |j3.soon777 at gmail dot com

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
                   ` (4 preceding siblings ...)
  2022-09-17  0:19 ` j3.soon777 at gmail dot com
@ 2022-09-17  0:24 ` j3.soon777 at gmail dot com
  2022-09-20 17:35 ` j3.soon777 at gmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: j3.soon777 at gmail dot com @ 2022-09-17  0:24 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Johnson Sun <j3.soon777 at gmail dot com> ---
Reproduced with GCC 7.5.0 + GDB 10.2, and GCC 11.2.0 + GDB 12.0.90.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
                   ` (5 preceding siblings ...)
  2022-09-17  0:24 ` j3.soon777 at gmail dot com
@ 2022-09-20 17:35 ` j3.soon777 at gmail dot com
  2022-11-18 15:56 ` cvs-commit at gcc dot gnu.org
  2022-11-18 16:01 ` simark at simark dot ca
  8 siblings, 0 replies; 10+ messages in thread
From: j3.soon777 at gmail dot com @ 2022-09-20 17:35 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Johnson Sun <j3.soon777 at gmail dot com> ---
Just send a patch to fix this issue. Please refer to:
https://sourceware.org/pipermail/gdb-patches/2022-September/191957.html

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
                   ` (6 preceding siblings ...)
  2022-09-20 17:35 ` j3.soon777 at gmail dot com
@ 2022-11-18 15:56 ` cvs-commit at gcc dot gnu.org
  2022-11-18 16:01 ` simark at simark dot ca
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-18 15:56 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <simark@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6533cbeeb831224e2d2dd2a7bea54b22b798fa39

commit 6533cbeeb831224e2d2dd2a7bea54b22b798fa39
Author: Johnson Sun <j3.soon777@gmail.com>
Date:   Fri Oct 21 01:49:18 2022 +0800

    Fix deletion of FinishBreakpoints

    Currently, FinishBreakpoints are set at the return address of a frame based
on
    the `finish' command, and are meant to be temporary breakpoints. However,
they
    are not being cleaned up after use, as reported in PR python/18655. This
was
    happening because the disposition of the breakpoint was not being set
    correctly.

    This commit fixes this issue by correctly setting the disposition in the
    post-stop hook of the breakpoint. It also adds a test to ensure this
feature
    isn't regressed in the future.

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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug python/18655] Python FinishBreakpoints are not deleted
  2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
                   ` (7 preceding siblings ...)
  2022-11-18 15:56 ` cvs-commit at gcc dot gnu.org
@ 2022-11-18 16:01 ` simark at simark dot ca
  8 siblings, 0 replies; 10+ messages in thread
From: simark at simark dot ca @ 2022-11-18 16:01 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Simon Marchi <simark at simark dot ca> ---
Fixed.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-11-18 16:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10 15:43 [Bug python/18655] New: GDB Python FinishBreakpoints are not deleted simon.marchi at ericsson dot com
2015-07-10 15:43 ` [Bug python/18655] " simon.marchi at ericsson dot com
2015-07-10 15:44 ` simon.marchi at ericsson dot com
2015-07-10 18:17 ` [Bug python/18655] " simon.marchi at ericsson dot com
2015-07-10 18:52 ` andrew.burgess at embecosm dot com
2022-09-17  0:19 ` j3.soon777 at gmail dot com
2022-09-17  0:24 ` j3.soon777 at gmail dot com
2022-09-20 17:35 ` j3.soon777 at gmail dot com
2022-11-18 15:56 ` cvs-commit at gcc dot gnu.org
2022-11-18 16:01 ` simark at simark dot ca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).