Make inferior a class with cdtors, and use new/delete
authorPedro Alves <palves@redhat.com>
Thu, 13 Apr 2017 15:15:35 +0000 (16:15 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 13 Apr 2017 15:18:16 +0000 (16:18 +0100)
commit0550c9559522c84341edcb334af30bc9bf2df9fb
treef8b901ca49c06e2f92bd1d0c1e1c362c11f96312
parente3d60dfc000a29959c78bd69b85100aab33f7ab5
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.
gdb/ChangeLog
gdb/inferior.c
gdb/inferior.h
This page took 0.02652 seconds and 4 git commands to generate.