Re: [PATCH v4] Improve ptrace-error detection on Linux targets

Sergio Durigan Junior
2019-09-26T04:22:22Z

On Wednesday, September 25 2019, Tom Tromey wrote:

>>> Unrestricted sprintf gives me pause. Do we know own_buf is large
>>> enough? Or can/should we truncate the text instead?
>
> Sergio> I was also worried about this. I found other cases using sprintf, but
> Sergio> their strings are not as big. I know own_buf comes from struct
> Sergio> client_state, and its size of PBUFSIZ + 1. One option would be to use
> Sergio> snprintf with this value. WDYT?
>
> I think that would be fine.
>
>>> I was wondering if each case should just return, or if checking each one
>>> is the correct thing to do here.
>
> Sergio> I don't have a strong opinion here, but I think it's more useful for the
> Sergio> user if we print everything wrong in the first pass. I'm thinking of
> Sergio> cases when starting GDB may take a while, for example: if we tell the
> Sergio> user a list of problems that need to be solved, then she won't need to
> Sergio> keep retrying.
>
> Makes sense to me, thanks.

Thanks; I've just sent v5 now.

Cheers,

--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible