public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/16481] New: Python finish breakpoint does not work with a mix of inlined and tailcalled functions
@ 2014-01-21 22:51 simon.marchi at polymtl dot ca
  2014-01-21 22:58 ` [Bug python/16481] " simon.marchi at polymtl dot ca
  2023-12-15 19:59 ` ssbssa at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: simon.marchi at polymtl dot ca @ 2014-01-21 22:51 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 16481
           Summary: Python finish breakpoint does not work with a mix of
                    inlined and tailcalled functions
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at polymtl dot ca

This may seem a little far fetched, but I hit this while trying to track memory
allocations with a python script. I put a Python breakpoint on __libc_malloc,
which in turn sets a finish breakpoint so that I can get the pointer to the
allocated region. I noticed that some times, the finish breakpoint is never
hit.

I put up a very simple test case here:
  https://gist.github.com/simark/8548964

Compile with
  $ gcc -g test.c -O3

Run with
  $ gdb -x finish.py a.out

As the name describe, hopefully_inlined is inlined, hopefully_tailcalled is
tailcalled (did I just invent a verb?).

The python script sets a breakpoint on the hopefully_notinlined function, which
instanciantes a finish breakpoint. On exit of the function, we should see "I am
here", but we don't.

I diagnosed the problem, and something wrong seems to happen here:
 
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/breakpoint.c;h=c8e7e8842e2ed418d78b23c466018c88bb5e2aae;hb=HEAD#l5172

>From what I understand, for kinds of breakpoints where it makes sens, GDB
checks that the current stack frame is the same as when the breakpoint was set.
For the breakpoint to cause a stop, they have to match. The comparison in this
case returns false. One of the frames has its artifical_depth to zero while the
other has it to one. I am not sure which one is right, but I think that they
should be equal...

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


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

* [Bug python/16481] Python finish breakpoint does not work with a mix of inlined and tailcalled functions
  2014-01-21 22:51 [Bug gdb/16481] New: Python finish breakpoint does not work with a mix of inlined and tailcalled functions simon.marchi at polymtl dot ca
@ 2014-01-21 22:58 ` simon.marchi at polymtl dot ca
  2023-12-15 19:59 ` ssbssa at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: simon.marchi at polymtl dot ca @ 2014-01-21 22:58 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|gdb                         |python

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


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

* [Bug python/16481] Python finish breakpoint does not work with a mix of inlined and tailcalled functions
  2014-01-21 22:51 [Bug gdb/16481] New: Python finish breakpoint does not work with a mix of inlined and tailcalled functions simon.marchi at polymtl dot ca
  2014-01-21 22:58 ` [Bug python/16481] " simon.marchi at polymtl dot ca
@ 2023-12-15 19:59 ` ssbssa at sourceware dot org
  1 sibling, 0 replies; 3+ messages in thread
From: ssbssa at sourceware dot org @ 2023-12-15 19:59 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.1
                 CC|                            |ssbssa at sourceware dot org
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Hannes Domani <ssbssa at sourceware dot org> ---
I didn't know about this bug report, but I fixed this a few days ago with this
commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=80ffe7226459e3edf840d0c23462d93cb560d2de

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

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

end of thread, other threads:[~2023-12-15 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-21 22:51 [Bug gdb/16481] New: Python finish breakpoint does not work with a mix of inlined and tailcalled functions simon.marchi at polymtl dot ca
2014-01-21 22:58 ` [Bug python/16481] " simon.marchi at polymtl dot ca
2023-12-15 19:59 ` ssbssa at sourceware dot org

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).