gdb/continuations: use lambdas instead of function pointers
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 22 Apr 2021 15:22:39 +0000 (17:22 +0200)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 22 Apr 2021 15:22:39 +0000 (17:22 +0200)
commitc4c493de2bbfc7414d0ec51f40f17cd7b1ff74f2
treea92975d7b21a379e8add3781e6b5b4a18c17b3cf
parent1194676e0be8d28a2ed631fe2b8d560409240ff0
gdb/continuations: use lambdas instead of function pointers

Use lambdas and std::list to track inferior continuations.  This is a
refactoring.

gdb/ChangeLog:
2021-04-22  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

* inferior.h (class inferior) <continuations>: Change the type
to be an std::list of std::function's.
Update the references and uses below.
* continuations.c (struct continuation): Delete.
(make_continuation): Delete.
(do_my_continuations_1): Delete.
(do_my_continuations): Delete.
(discard_my_continuations_1): Delete.
(discard_my_continuations): Delete.
(add_inferior_continuation): Update.
(do_all_inferior_continuations): Update.
(discard_all_inferior_continuations): Update.
* continuations.h (add_inferior_continuation): Update to take
an std::function as the parameter.
* infcmd.c (struct attach_command_continuation_args): Delete.
(attach_command_continuation): Delete.
(attach_command_continuation_free_args): Delete.
(attach_command): Update.
(notice_new_inferior): Update.
gdb/ChangeLog
gdb/continuations.c
gdb/continuations.h
gdb/infcmd.c
gdb/inferior.h