binutils-gdb/gdbsupport
Patrick Monnerat bac814af17 gdbsupport/event-loop: add a timeout parameter to gdb_do_one_event
Since commit b2d8657, having a per-interpreter event/command loop is not
possible anymore.

As Insight uses a GUI that has its own event loop, gdb and GUI event
loops have then to be "merged" (i.e.: work together). But this is
problematic as gdb_do_one_event is not aware of this alternate event
loop and thus may wait forever.

A solution is to delegate GUI events handling to the gdb events handler.
Insight uses Tck/Tk as GUI and the latter offers a "notifier" feature to
implement such a delegation. The Tcl notifier spec requires the event wait
function to support a timeout parameter. Unfortunately gdb_do_one_event
does not feature such a parameter.
This timeout cannot be implemented externally with a gdb timer, because
it would become an event by itself and thus can cause a legitimate event to
be missed if the timeout is 0.
Tcl implements "idle events" that are (internally) triggered only when no
other event is pending. For this reason, it can call the event wait function
with a 0 timeout quite often.

This patch implements a wait timeout to gdb_do_one_event. The initial
pending events monitoring is performed as before without the possibility
to enter a wait state. If no pending event has been found during this
phase, a timer is then created for the given timeout in order to re-use
the implemented timeout logic and the event wait is then performed.
This "internal" timer only limits the wait time and should never be triggered.
It is deleted upon gdb_do_one_event exit.

The new parameter defaults to "no timeout" (-1): as it is used by Insight
only, there is no need to update calls from the gdb source tree.
2022-08-18 11:56:38 +02:00
..
.dir-locals.el Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
.gitattributes
acinclude.m4 gdb: don't use -Wmissing-prototypes with g++ 2022-01-13 10:25:45 +00:00
aclocal.m4
agent.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
agent.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
alt-stack.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
array-view.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
ax.def Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
block-signals.h [gdb] Block SIGTERM in worker threads 2022-06-30 13:31:06 +02:00
break-common.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
btrace-common.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
btrace-common.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
buffer.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
buffer.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
buildargv.h Move gdb_argv to gdbsupport 2022-01-18 10:14:42 -07:00
byte-vector.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
ChangeLog-2020-2021 gdb: move remaining ChangeLogs to legacy files 2021-07-26 12:20:33 +01:00
check-defines.el Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cleanups.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cleanups.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-debug.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-debug.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-defs.h [gdb] Add debug_{exp,val} 2022-08-05 08:09:57 +02:00
common-exceptions.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-exceptions.h Specialize std::hash for gdb_exception 2022-04-12 09:31:16 -06:00
common-gdbthread.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-inferior.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-inferior.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-regcache.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-regcache.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-types.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-utils.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common-utils.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
common.m4 Let std::thread check pass even without pthreads 2022-04-14 09:28:56 -06:00
compiler-type.m4 gdb: don't use -Wmissing-prototypes with g++ 2022-01-13 10:25:45 +00:00
config.in Make GDBserver abort on internal error in development mode 2022-06-27 13:55:36 +01:00
configure Make GDBserver abort on internal error in development mode 2022-06-27 13:55:36 +01:00
configure.ac Make GDBserver abort on internal error in development mode 2022-06-27 13:55:36 +01:00
create-version.sh Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
def-vector.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
default-init-alloc.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
eintr.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
enum-flags.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
environ.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
environ.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
errors.cc Use strwinerror in gdb/windows-nat.c 2022-08-16 08:04:37 -06:00
errors.h Use strwinerror in gdb/windows-nat.c 2022-08-16 08:04:37 -06:00
event-loop.cc gdbsupport/event-loop: add a timeout parameter to gdb_do_one_event 2022-08-18 11:56:38 +02:00
event-loop.h gdbsupport/event-loop: add a timeout parameter to gdb_do_one_event 2022-08-18 11:56:38 +02:00
event-pipe.cc Fix typo in last change. 2022-03-03 13:06:50 -08:00
event-pipe.h Avoid conflict with gnulib open/close macros. 2022-03-03 11:21:36 -08:00
fileio.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
fileio.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
filestuff.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
filestuff.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
filtered-iterator.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
format.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
format.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
forward-scope-exit.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
function-view.h Introduce gdb::make_function_view 2022-08-05 16:12:56 +02:00
gdb_assert.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_binary_search.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_file.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_locale.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_obstack.cc Move gdb obstack code to gdbsupport 2022-01-18 10:14:42 -07:00
gdb_obstack.h Move gdb obstack code to gdbsupport 2022-01-18 10:14:42 -07:00
gdb_optional.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_proc_service.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_ref_ptr.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_regex.cc gdbsupport/gdb_regex.cc: replace defs.h include with common-defs.h 2022-01-20 22:58:21 -05:00
gdb_regex.h Move gdb_regex to gdbsupport 2022-01-18 10:14:43 -07:00
gdb_select.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_setjmp.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_signals.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_splay_tree.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_string_view.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_string_view.tcc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_sys_time.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_tilde_expand.cc gdb: use gdb_tilde_expand instead of gdb_tilde_expand_up in source_script_with_search 2022-04-18 15:48:03 -04:00
gdb_tilde_expand.h gdb: use gdb_tilde_expand instead of gdb_tilde_expand_up in source_script_with_search 2022-04-18 15:48:03 -04:00
gdb_unique_ptr.h gdb: add operator+= and operator+ overload for std::string 2022-02-25 17:50:22 +00:00
gdb_unlinker.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_vecs.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_vecs.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_wait.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb_wait.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb-checked-static-cast.h gdbsupport: add checked_static_cast 2022-07-21 15:19:43 +01:00
gdb-dlfcn.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb-dlfcn.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb-hashtab.cc Introduce gdb-hashtab module in gdbsupport 2022-01-18 10:14:43 -07:00
gdb-hashtab.h Introduce gdb-hashtab module in gdbsupport 2022-01-18 10:14:43 -07:00
gdb-safe-ctype.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb-sigmask.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gdb-xfree.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
hash_enum.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
host-defs.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
intrusive_list.h Make intrusive_list_node's next/prev private 2022-04-13 10:24:38 +01:00
iterator-range.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
job-control.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
job-control.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
Makefile.am gdbsupport: Add an event-pipe class. 2022-02-22 11:22:14 -08:00
Makefile.in gdbsupport: Add an event-pipe class. 2022-02-22 11:22:14 -08:00
netstuff.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
netstuff.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
new-op.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
next-iterator.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
observable.h Move non-dependent gdb::observers::observable::visit_state outside template 2022-05-10 13:40:57 +01:00
offset-type.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
packed.h struct packed: Add fallback byte array implementation 2022-07-25 16:04:05 +01:00
parallel-for.h [gdbsupport] Add task size parameter in parallel_for_each 2022-08-05 16:12:56 +02:00
pathstuff.cc gdbsupport: fix path_join crash with -std=c++17 and -D_GLIBCXX_DEBUG 2022-05-19 08:04:13 -04:00
pathstuff.h gdbsupport/pathstuff.h: #include <array> explicitly for std::array<> 2022-04-25 17:06:09 -07:00
poison.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
preprocessor.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
print-utils.cc [gdbsupport] Fix UB in print-utils.cc:int_string 2022-05-23 14:50:02 +02:00
print-utils.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
ptid.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
ptid.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
ptrace.m4 Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
range-chain.h Finalize each cooked index separately 2022-05-26 07:35:30 -06:00
README
refcounted-object.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
reference-to-pointer-iterator.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
rsp-low.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
rsp-low.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
run-time-clock.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
run-time-clock.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
safe-iterator.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
safe-strerror.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
scope-exit.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
scoped_fd.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
scoped_ignore_signal.h gdb: don't pass nullptr to sigwait 2022-01-04 10:28:19 +00:00
scoped_ignore_sigttou.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
scoped_mmap.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
scoped_mmap.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
scoped_restore.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
search.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
search.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
selftest.cc gdbsupport/selftest: Allow lazy registration 2022-04-19 09:12:42 +01:00
selftest.h gdbsupport/selftest: Allow lazy registration 2022-04-19 09:12:42 +01:00
selftest.m4 Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
signals-state-save-restore.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
signals-state-save-restore.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
signals.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
symbol.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
tdesc.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
tdesc.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
thread-pool.cc Fix --disable-threading build 2022-05-10 08:15:40 -06:00
thread-pool.h Fix --disable-threading build 2022-05-10 08:15:40 -06:00
traits.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
underlying.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
valid-expr.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
version.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
warning.m4 gdb: don't use -Wmissing-prototypes with g++ 2022-01-13 10:25:45 +00:00
x86-xstate.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
xml-utils.cc Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
xml-utils.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.