C++ify program_space
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 3 Mar 2018 04:22:08 +0000 (23:22 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sat, 3 Mar 2018 04:22:08 +0000 (23:22 -0500)
commit564b1e3f2906bbbf53d003d6fdbcfc83661385e2
treef39a545af2f86a076051c4b32e9bd93b4e3214a9
parente80aaf6183c6692ecc167bf26cbdc53f8f1a55f0
C++ify program_space

This patch makes program_space a C++ object by adding a
constructor/destructor, giving default values to fields, and using
new/delete.

gdb/ChangeLog:

* progspace.h (struct program_space): Add constructor and
destructor, initialize fields.
(add_program_space): Remove.
* progspace.c (add_program_space): Rename to...
(program_space::program_space): ... this.
(release_program_space): Rename to...
(program_space::~program_space): ... this.
(delete_program_space): Use delete to delete program_space.
(initialize_progspace): Use new to allocate program_space.
* inferior.c (add_inferior_with_spaces): Likewise.
(clone_inferior_command): Likewise.
* infrun.c (follow_fork_inferior): Likewise.
(handle_vfork_child_exec_or_exit): Likewise.
gdb/ChangeLog
gdb/inferior.c
gdb/infrun.c
gdb/progspace.c
gdb/progspace.h