Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Async function calls
@ 2008-03-20 12:10 Vladimir Prus
  2008-03-20 12:22 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Prus @ 2008-03-20 12:10 UTC (permalink / raw)
  To: gdb


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-20 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-20 12:10 Async function calls Vladimir Prus
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox