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 v3 12/12] btrace: Store function segments as objects.


On 2017-05-10 07:46, Wiederhake, Tim wrote:
> +  struct btrace_function bfun {mfun, fun, 0, 0, 0, NULL, 0, 0, 0, 0,
> 0};

I think it would be much better to add a simple constructor to
btrace_function. For the fields that should simply be zero'ed, you can initialize fields directly, like we do in many other places (e.g. class
inferior).

Having a proper constructor would definitely be beneficial here.
Nevertheless, I would do such a change in a separate patch set.

Ok, but in this case I'd still prefer if you initialized the fields directly in the class right away. In the (unlikely) event that we add a field in btrace_function, we'll have to think to update this.

Thanks,

Simon


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