public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Fix gdb.python/py-finish-breakpoint2.exp with -m32
Date: Thu, 21 Jan 2021 09:22:54 -0500	[thread overview]
Message-ID: <9dc1b1bc-0c3e-04a4-cf86-aa1eab8f2f84@polymtl.ca> (raw)
In-Reply-To: <13409e22-657c-28f3-2b90-bbbd90d68c41@suse.de>

On 2021-01-21 3:45 a.m., Tom de Vries wrote:
> On 1/21/21 9:29 AM, Tom de Vries wrote:
>> The different outcomes for -m32 and -m64 are both valid given the
>> semantics of FinishBreakpoint, which is "set at the return address of a
>> frame".  It all depends where that return address is.  There is no
>> guarantee that the return address is an insn that uniquely represent the
>> function return control path.
> 
> And, reading the documentation:
> ...
> Function: FinishBreakpoint.out_of_scope (self)
> 
>     In some circumstances (e.g. longjmp, C++ exceptions, GDB return
>     command, …), a function may not properly terminate, and thus never
>     hit the finish breakpoint. When GDB notices such a situation, the
>     out_of_scope callback will be triggered.
> ...
> this may be somewhat misleading or unclear, given that it's possible (as
> the -m64 case demonstrates) that both:
> - the function does properly terminate, and
> - the finish breakpoint still hits (meaning the stop method is called).
> 
> Thanks,
> - Tom
> 

I think don't see how FinishBreakpoint can be useful with that kind of
inconsistency.  Given that an exception is thrown in both cases, and the
throw_exception_1 call frame never properly terminates, it seems obvious
to me that out_of_scope should be called both times, and stop should not
be called, both times.

Simon

  reply	other threads:[~2021-01-21 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 10:31 Tom de Vries
2021-01-21  7:04 ` Simon Marchi
2021-01-21  8:29   ` Tom de Vries
2021-01-21  8:45     ` Tom de Vries
2021-01-21 14:22       ` Simon Marchi [this message]
2021-09-28 14:33         ` [RFC][gdb/python] FinishBreakPoint update Tom de Vries

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=9dc1b1bc-0c3e-04a4-cf86-aa1eab8f2f84@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).