This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Create a displaced_step_closure class hierarchy


On 2017-10-13 10:34 AM, Simon Marchi wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
> 
> displaced_step_closure is a type defined in multiple -tdep.c files.
> Trying to xfree it from the common code (infrun.c) is a problem when we
> try to poison xfree for non-POD types.  Because there can be multiple of
> these types in the same build, this patch makes a hierarchy of classes
> with a virtual destructor.  When the common code deletes the object
> through a displaced_step_closure pointer, it will invoke the right
> destructor.
> 
> The amd64 used a last-member array with a variable size.  That doesn't
> work with new, so I changed it for an std::vector.  Other architectures
> which used a simple byte buffer as a closure now use a shared
> buf_displaced_step_closure, a closure type that only contains a
> gdb::byte_vector.
> 
> Reg-tested on the buildbot.

I pushed this in.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]