diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-03-02 23:22:08 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2018-03-02 23:22:08 -0500 |
commit | 564b1e3f2906bbbf53d003d6fdbcfc83661385e2 (patch) | |
tree | f39a545af2f86a076051c4b32e9bd93b4e3214a9 /gdb/inferior.c | |
parent | e80aaf6183c6692ecc167bf26cbdc53f8f1a55f0 (diff) | |
download | gdb-564b1e3f2906bbbf53d003d6fdbcfc83661385e2.zip gdb-564b1e3f2906bbbf53d003d6fdbcfc83661385e2.tar.gz gdb-564b1e3f2906bbbf53d003d6fdbcfc83661385e2.tar.bz2 |
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.
Diffstat (limited to 'gdb/inferior.c')
-rw-r--r-- | gdb/inferior.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c index 880f25d..c88a23c 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -784,7 +784,7 @@ add_inferior_with_spaces (void) doesn't really return a new address space; otherwise, it really does. */ aspace = maybe_new_address_space (); - pspace = add_program_space (aspace); + pspace = new program_space (aspace); inf = add_inferior (0); inf->pspace = pspace; inf->aspace = pspace->aspace; @@ -928,7 +928,7 @@ clone_inferior_command (const char *args, int from_tty) doesn't really return a new address space; otherwise, it really does. */ aspace = maybe_new_address_space (); - pspace = add_program_space (aspace); + pspace = new program_space (aspace); inf = add_inferior (0); inf->pspace = pspace; inf->aspace = pspace->aspace; |