Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Andrew Burgess" <aburgess@broadcom.com>
To: "Jan Kratochvil" <jan.kratochvil@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] improve python finish breakpoint for exceptions/longjmp case.
Date: Thu, 25 Oct 2012 19:23:00 -0000	[thread overview]
Message-ID: <508991A7.5030607@broadcom.com> (raw)
In-Reply-To: <20121017162748.GA6546@host2.jankratochvil.net>

On 17/10/2012 5:27 PM, Jan Kratochvil wrote:

> On Mon, 15 Oct 2012 22:39:52 +0200, Andrew Burgess wrote:
>> @@ -295,11 +304,18 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
>>                           AUTO_BOOLEAN_TRUE,
>>                           &bkpt_breakpoint_ops,
>>                           0, 1, internal_bp, 0);
>> +      set_longjmp_breakpoint (inferior_thread (), null_frame_id);
> 
> I find too intrusive to call set_longjmp_breakpoint here.
> 
> A countercase - I did not try to reproduce it in real:
> 
>  * You have breakpoint installed at TRACEDFUNC and you automatically use
>    Python finish breakpoint to trace return values of TRACEDFUNC.
>  * User at CALLERFUNC will type in GDB CLI "finish".
>  * CALLERFUNC does a lot of processing and it also calls TRACEDFUNC.
>  * Now you overwide tp->INITIATING_FRAME of the user "finish" command by
>    null_frame_id which breaks the behavior in some way.

I don't think this is a problem, the first finish will be cancelled when
we stop for the second time in TRACEDFUNC. So, I think the chain of
events will be:

 - Stop in TRACEDFUNC, create a finish breakpoint setting
tp->INITIATING_FRAME to null_frame_id.
 - From the cli use "finish" command, change tp->INITIATING_FRAME.
 - User continues.
 - Recursively enter TRACEDFUNC, stopping.  The finish breakpoint is now
cancelled.  At this point the first finish breakpoint is also cancelled,
but this is a known bug at this point that I plan to work on later; and
is no worse than current behaviour.
 - User creates new finish breakpoint, setting tp->INITIATING_FRAME, but
that's fine as we have no "finish" in play at this point.

Let me know if I've got this wrong and you can see a problem, especially
if you think I've broken /other/ commands, that would be worse than just
leaving the finish breakpoint stuff with a few broken edge cases.

> You want to install the "longjmp breakpoint" there by
> set_longjmp_breakpoint_for_call_dummy.  You want to hook there
> check_longjmp_breakpoint_for_call_dummy to call bpfinishpy_detect_out_scope_cb
> in some way.  Currently you do it on stop but that is too late, breakpoint may
> may have been for example placed at stack trampoline function (code at the
> stack) and the breakpoint instruction now corrupts live stack data there.

Hmmm, I see the problem, I'll work on that one.


Thanks for your time,
Andrew




  parent reply	other threads:[~2012-10-25 19:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 14:58 Andrew Burgess
2012-09-24 10:22 ` Kevin Pouget
2012-10-01 16:33   ` Andrew Burgess
2012-10-01 16:30 ` Andrew Burgess
2012-10-10 21:08   ` Andrew Burgess
2012-10-11  6:46     ` Phil Muldoon
2012-10-11 16:32 ` Jan Kratochvil
2012-10-15 20:40   ` Andrew Burgess
2012-10-17 16:28     ` Jan Kratochvil
2012-10-24 20:48       ` Andrew Burgess
2012-10-25  6:13         ` Jan Kratochvil
2012-10-25 19:23       ` Andrew Burgess [this message]
2012-10-30 17:41         ` Jan Kratochvil
2012-11-06 14:24           ` Andrew Burgess
2012-11-22 18:15             ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508991A7.5030607@broadcom.com \
    --to=aburgess@broadcom.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox