Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: pmuldoon@redhat.com
Cc: gdb@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [RFC] Python Finish Breakpoints
Date: Thu, 12 May 2011 11:29:00 -0000	[thread overview]
Message-ID: <BANLkTi=J+oDwKVBGK5wM+KVdvHxP5WEnRw@mail.gmail.com> (raw)
In-Reply-To: <m3y62cgpme.fsf@redhat.com>

thanks for these useful feedbacks,
I will try to better understand what can be wrong/unusual with the
situations you described and prepare some tests to catch it.

But globally, my thoughts when I prepared this interface were that it
shouldn't be much different from a classic breakpoint. I'm not really
familiar with C++ mechanisms, but I can't see (right now, but I'll
investigate it) how it differs from setting a BP on the frame above,
checking for recursion upon BP hit and checking for the scope every
once in a while.

for instance, to talk about what I know
> What happens if a longjmp occurs?

nothing! obj->out_of_scope() will be triggered by
`observer_notify_stop' and the script will have the ability to
obj->delete() the breakpoint if it thinks it won't be useful anymore

> An exec?
nothing/the same as above, out_of_scope() will be triggered at the
next stop, I don't know off the top of my head what GDB does with BPs
on exec(), but the same would happen with FinishBreakpoint



I'll prepare the tests for all these situations and I'll see if it is
'at easy' as I thought

thanks,

Kevin

--

> There are questions arising on how these breakpoints cope when the
> inferior jumps unexpectedly.  I can think of two examples of this
> behavior during inferior function calls.
>
> * What happens with your breakpoint when you perform an inferior function
>  call on a C++ function, and that function raises an exception that is
>  normally and legally processed by an out-of-frame exception handler?
>  This question arises as it triggers special behavior in GDB.  The
>  problem originates from the dummy-frame created by GDB.  It insulates the
>  out-of-frame exception handler from the exception raising code, and
>  the default C++ handler terminates the inferior.  GDB detects this at
>  present, and rewinds the stack back to the original location before the
>  function call.  What happens, as in your example, if the breakpoint is
>  in this inferior function call?  This unwinding behavior related to a
>  C++ inferior is 'on' by default in GDB.
>
> * The other related example is what happens when a signal is delivered
>  to the inferior during the inferior function call?  Presently GDB will
>  stop with an error message.  However the user can turn unwinding 'on'
>  in this scenario too.  This signal handling unwinding is 'off' by
>  default.
>
> There are other scenarios and state changes to consider.  What happens if
> a longjmp occurs? An exec?
>
> So the behavior is subtle when dealing with inferior changes.  So to
> prove this new breakpoint type is robust, you would need to provide
> test-cases of this kind of proven behavior in your patch.
>
> Apologies to Tom is I misquoted or mis-phrased our conversation. ;)
>
> Cheers,
>
> Phil
>


  reply	other threads:[~2011-05-12 11:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 14:11 Kevin Pouget
2011-05-09 14:31 ` Kevin Pouget
     [not found]   ` <BANLkTikVdqbMqjguTV8ct0TWiBDhHGYtLg@mail.gmail.com>
2011-05-11  7:44     ` Kevin Pouget
2011-05-11 10:31       ` Phil Muldoon
2011-05-11 11:29         ` Kevin Pouget
2011-05-12 10:50         ` Phil Muldoon
2011-05-12 11:29           ` Kevin Pouget [this message]
2011-05-12 19:00 ` Doug Evans
2011-05-13  7:51   ` Phil Muldoon
     [not found]   ` <BANLkTikt2hEUcXkGVH44NaUcwiF1SGdMaw@mail.gmail.com>
2011-05-13  9:04     ` Kevin Pouget
2011-05-16 11:24       ` Kevin Pouget
2011-05-18  8:58         ` Kevin Pouget
2011-05-18 10:16           ` Phil Muldoon

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='BANLkTi=J+oDwKVBGK5wM+KVdvHxP5WEnRw@mail.gmail.com' \
    --to=kevin.pouget@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=pmuldoon@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