Re: [PATCH 2/6] Don't reset errno/bfd_error on 'throw_perror_with_name'

Tom Tromey
2020-02-28T15:29:45Z

>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:

Sergio> Since this hunk may be a bit controversial, I decided to split it into
Sergio> a separate patch. This is going to be needed by the ptrace-error
Sergio> feature; GDB will need to be able to access the value of errno even
Sergio> after a call to our 'perror'-like functions.

I'm in favor of this. The existing code seems pretty ugly.

I'd imagine it's unlikely that any caller would rely on this.
If it tested cleanly then that is good enough for me.

Sergio> Another small hunk is the one that saves/restores errno on gdbserver's
Sergio> 'perror_with_name', but this one is pretty trivial, I think.

I didn't understand why this one was needed.
Does safe_strerror reset errno? Maybe a comment would be in order.

Tom