aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2018-03-02 23:22:08 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2018-03-02 23:22:08 -0500
commit564b1e3f2906bbbf53d003d6fdbcfc83661385e2 (patch)
treef39a545af2f86a076051c4b32e9bd93b4e3214a9 /gdb/infrun.c
parente80aaf6183c6692ecc167bf26cbdc53f8f1a55f0 (diff)
downloadgdb-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/infrun.c')
-rw-r--r--gdb/infrun.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index c663908..5aeafef 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -511,7 +511,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
else
{
child_inf->aspace = new_address_space ();
- child_inf->pspace = add_program_space (child_inf->aspace);
+ child_inf->pspace = new program_space (child_inf->aspace);
child_inf->removable = 1;
set_current_program_space (child_inf->pspace);
clone_program_space (child_inf->pspace, parent_inf->pspace);
@@ -630,7 +630,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
else
{
child_inf->aspace = new_address_space ();
- child_inf->pspace = add_program_space (child_inf->aspace);
+ child_inf->pspace = new program_space (child_inf->aspace);
child_inf->removable = 1;
child_inf->symfile_flags = SYMFILE_NO_READ;
set_current_program_space (child_inf->pspace);
@@ -986,7 +986,7 @@ handle_vfork_child_exec_or_exit (int exec)
{
/* We're staying attached to the parent, so, really give the
child a new address space. */
- inf->pspace = add_program_space (maybe_new_address_space ());
+ inf->pspace = new program_space (maybe_new_address_space ());
inf->aspace = inf->pspace->aspace;
inf->removable = 1;
set_current_program_space (inf->pspace);
@@ -1020,7 +1020,7 @@ handle_vfork_child_exec_or_exit (int exec)
program space resets breakpoints). */
inf->aspace = NULL;
inf->pspace = NULL;
- pspace = add_program_space (maybe_new_address_space ());
+ pspace = new program_space (maybe_new_address_space ());
set_current_program_space (pspace);
inf->removable = 1;
inf->symfile_flags = SYMFILE_NO_READ;