Make inferior a class with cdtors, and use new/delete
struct inferior became a non-POD when enum_flags was made a non-POD,
so we should be allocating/destroying inferiors with new/delete, etc.
That's what this commit does.
Note: this commit makes all boolean fields of inferior be "bool",
except the "detaching" field. That'll require more work, so I split
it to a separate patch.
gdb/ChangeLog:
2017-04-13 Pedro Alves <palves@redhat.com>
* inferior.c (free_inferior): Convert to ...
(inferior::~inferior): ... this dtor.
(inferior::inferior): New ctor, factored out from ...
(add_inferior_silent): ... here. Allocate the inferior with a new
expression.
(delete_inferior): Call delete instead of free_inferior.
* inferior.h (gdb_environ, continuation): Forward declare.
(inferior): Now a class. Add in-class initialization to all
members. Make boolean fields bool, except 'detaching'.
(inferior::inferior): New explicit ctor.
(inferior::~inferior): New.