This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/17223] cannot do background execution in scripts


https://sourceware.org/bugzilla/show_bug.cgi?id=17223

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

--- Comment #4 from Pedro Alves <palves at redhat dot com> ---
Yeah, this is a use case that ideally we'd support.

My original attempt to make async work in scripts relied on continuations and
the top level event loop.  That was turning out to be a rat hole, so we ended
up with the interpreter flipping async off.  See:

 https://sourceware.org/ml/gdb/2011-08/msg00069.html

> This happens because script execution is done in its own loop that doesn't 
> check for events (ref: top.c:command_loop).

With -x and -ex, it's indeed annoying that those are processed before the top
level event loop starts.  However, events do get processed, in
maybe_wait_sync_command_done, when the command is foreground, or if the command
is foreground, they'll be processed at the next command that blocks, or after
the script is all run, whichever comes first.

Here:

 run &
 shell sleep 3
 info threads

We can also say that the problem is with the "shell" command.  It's
synchronous, and does it's own blocking "waitpid" instead of going through the
event loop.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]