Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: Doug Evans <dje@google.com>,  gdb-patches@sourceware.org
Subject: Re: [RFA] dummy frame handling cleanup, plus inferior fun call signal   handling improvement
Date: Thu, 04 Dec 2008 15:54:00 -0000	[thread overview]
Message-ID: <200812041553.37386.pedro@codesourcery.com> (raw)
In-Reply-To: <200812041531.mB4FVEKt030233@d12av02.megacenter.de.ibm.com>

On Thursday 04 December 2008 15:31:14, Ulrich Weigand wrote:
> Hmmm, that's not quite what what the code actually does.  The state is also
> restored if some error is thrown during the proceed call, for example.
> I'm not sure whether this is really the right thing to do ...

And it *can happen* (although it should be rare) that when the exception is
thrown, inferior_ptid is set to a different ptid the infcall started
with (say, while you're handling a thread specific breakpoint hitting the wrong thread),
so, the cleanup can still write the context back, the wrong thread.  Threading
and infcalls failing is a clear mess.

Thinking out loud, I wonder if we shouldn't be storing the
thread state prior to the infcall in struct thread_info itself, and
leave out in a separate object only the session state (what doesn't make
sense to have in thread_info).  So, a thread_info would hold two objects
of the same type, something like, thread_info->infrun_state,
thread_info->stored_infrun_state.

If a thread exits, (or the whole inferior) while doing the infcall, the
state is automatically deleted/discarded when you delete the thread.

If an exception is thrown, you'd go through all threads and set the
infrun_state from the stored_infrun_state, if there's any.

-- 
Pedro Alves


  reply	other threads:[~2008-12-04 15:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18 21:01 Doug Evans
2008-11-19 14:07 ` Doug Evans
2008-11-20 15:02 ` Doug Evans
2008-11-20 15:06   ` Doug Evans
2008-12-01 20:52     ` Doug Evans
2008-12-01 21:22       ` Pedro Alves
2008-12-02  1:20         ` Doug Evans
2008-12-03  6:04           ` Doug Evans
2008-12-04 15:32             ` Ulrich Weigand
2008-12-04 15:54               ` Pedro Alves [this message]
2008-12-04 22:32               ` Doug Evans
2008-12-04 22:42                 ` Pedro Alves
2008-12-05  0:18                   ` Ulrich Weigand
2008-12-05  0:37                     ` Pedro Alves
2008-12-05  1:16                       ` Get rid of stop_pc (was: [RFA] dummy frame handling cleanup, plus inferior fun call signal handling improvement) Pedro Alves
2008-12-05  1:50                         ` Doug Evans
2008-12-05  2:14                           ` Pedro Alves
2008-12-05  2:46                         ` Pedro Alves
2008-12-05 18:43                         ` Ulrich Weigand
2008-12-05 19:07                           ` Pedro Alves
2008-12-05  0:30                 ` [RFA] dummy frame handling cleanup, plus inferior fun call signal handling improvement Ulrich Weigand
2008-11-26 19:17 ` Doug Evans
2009-01-07  6:52 Doug Evans
2009-01-07 16:36 ` Doug Evans
2009-01-14 15:07   ` Ulrich Weigand
2009-01-07 17:02 ` Pedro Alves
2009-01-14 15:07 ` Ulrich Weigand
2009-01-19  7:24   ` Doug Evans
2009-01-19 14:40     ` Ulrich Weigand

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=200812041553.37386.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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