Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb@sources.redhat.com
Subject: Async function calls
Date: Thu, 20 Mar 2008 12:10:00 -0000	[thread overview]
Message-ID: <200803201044.47454.vladimir@codesourcery.com> (raw)


Right now, most commands that start inferior have provisions for async 
execution -- if a command has to do something after the inferior is 
stopped, it adds a 'continuation' which is executed.

The notable exception is the code for calling inferior functions. We
cannot use the continuation trick directly, because function call is
done in the middle of expression evaluation, in general, so we should
return the called function's return value. We cannot return to
event loop, then handle inferior stop event, and then continue 
evaluating the expression.

Then, the only way to make function calls async would be run
inner event loop inside call_function_by_hand. This is honestly
scary. Worst case, user can go as far as to start a different program,
possibly invalidating lots of data that callers of call_function_by_hand
will try to use. And in general, if we wait long enough, all of program
state can change. Of course, we can "audit" all the code involved in
evaluating an expression, figure which commands or events can adversely
affect that code, and then disallow those commands while inferior call
is in progress, but that sounds like a huge amount of work.

Maybe, somebody have bright ideas?

Thanks,
Volodya


             reply	other threads:[~2008-03-20  7:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-20 12:10 Vladimir Prus [this message]
2008-03-20 12:22 ` Daniel Jacobowitz
2008-03-20 16:23   ` Vladimir Prus
2008-03-20 17:01     ` Daniel Jacobowitz
2008-03-20 17:24       ` Daniel Jacobowitz
2008-03-20 17:35   ` Michael Snyder

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=200803201044.47454.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb@sources.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