C++ify fork_info, use std::list
authorPedro Alves <palves@redhat.com>
Wed, 6 Mar 2019 18:29:18 +0000 (18:29 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 6 Mar 2019 18:29:18 +0000 (18:29 +0000)
commit06974e6c05556edb7122f45239c95045e882dc76
tree52c396875ed81d87674e0b081f532d5cceec6534
parent72f31aea9e6c158f442239abedaf351465ebcb41
C++ify fork_info, use std::list

- Convert new_fork and free_fork to fork_info ctor/dtor.
- Use std::list.

gdb/ChangeLog:
2019-03-06  Pedro Alves  <palves@redhat.com>

* linux-fork.c: Include <list>.
(fork_list): Now a std::list instance.
(fork_info): Add ctor, dtor, and in-class initialize all fields.
(forks_exist_p, find_last_fork): Adjust.
(new_fork): Delete.
(one_fork_p): New.
(add_fork): Adjust.
(free_fork): Delete, folded into fork_info::~fork_info().
(delete_fork, find_fork_ptid, find_fork_id, find_fork_pid):
Adjust.
(init_fork_list): Delete.
(linux_fork_killall, linux_fork_mourn_inferior)
(linux_fork_detach, info_checkpoints_command): Adjust.
(_initialize_linux_fork): No longer call init_fork_list.
gdb/ChangeLog
gdb/linux-fork.c