Re: [PATCH v4 10/12] [PowerPC] Add support for EBB and PMU registers

Pedro Franco de Carvalho
2018-08-16T18:16:14Z

Pedro Alves <palves@redhat.com> writes:

>> Since gdbserver writes all registers in one go before resuming the
>> inferior, this error would not be detected at the time the user tries
>> to write to one of the registers on the client side, and gdbserver
>> would print out warnings every time it resumes the inferior when no
>> ebb performance event is opened, so there is currently no
>> straightforward way to handle this case. This means the ebb registers
>> in the client-side regcache can become dirty when the user tries to
>> write to them, until the inferior is resumed and stopped again.
>
> Should we make gdbserver flush the regcache after handling 'G' and 'P'
> packets?

Yes, I think this would work. It would have to flush the regcache and
if anything goes wrong reply with an error packet. This would probably
involve catching exceptions raised by target_ops::store_register in
server.c.

Thanks!

--
Pedro Franco de Carvalho