[binutils-gdb] Make inferior a class with cdtors, and use new/delete

sergiodj+buildbot@sergiodj.net sergiodj+buildbot@sergiodj.net
Thu Apr 13 19:45:00 GMT 2017


*** TEST RESULTS FOR COMMIT 0550c9559522c84341edcb334af30bc9bf2df9fb ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 0550c9559522c84341edcb334af30bc9bf2df9fb

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.



More information about the Gdb-testers mailing list