Re: [PATCH 3/3] [PowerPC] Fix debug register issues in ppc-linux-nat

Pedro Franco de Carvalho
2019-08-21T17:45:37Z

"Ulrich Weigand" <uweigand@de.ibm.com> writes:

> The one question I still have is, given that we'll be deleting the
> installed breakpoints after a clone/fork anyway, wouldn't it be
> easier to just *delete* all breakpoints directly at the clone/fork
> callback and start out the GDB "installed" structures as empty?
> But that's just a minor detail ... whatever is easier to implement
> is fine with me.

I think it's easier to do it in prepare_to_resume, since we have to do
it there anyway to handle hardware breakpoints that were removed by the
user. I'm also not sure that linux-nat is prepared to take exceptions
from these callbacks, in case a ptrace call there fails.

> Since this really seems to be required on PowerPC due to the peculiar
> ptrace interface, I'm fine with adding the common code clone hook.

Ok. Is it acceptable if linux-low in gdbserver doesn't have the
equivalent hook? Adding one there would require changing struct
linux_target_ops and every arch that uses it. This will become
necessary in the future to enable hardware breakpoints in the ppc server
stub.

Thanks!

--
Pedro Franco de Carvalho

>
> Thanks,
> Ulrich
>
> --
> Dr. Ulrich Weigand
> GNU/Linux compilers and toolchain
> Ulrich.Weigand@de.ibm.com