This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: remote.c (remote_send): Do not assume what to do on error
- To: Fernando Nasser <fnasser at cygnus dot com>
- Subject: Re: RFA: remote.c (remote_send): Do not assume what to do on error
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 04 Dec 2000 15:31:47 +1100
- Cc: gdb-patches at sources dot redhat dot com
- References: <3A072F27.5E5F9EDC@cygnus.com>
Fernando Nasser wrote:
>
> remote_send() makes assumptions about what the caller wants to do about
> errors reported by the stub. And it assumes it should longjump!
>
> I believe it should just return the error code (in the buffer) and let
> the caller decide. The patch below makes this change and adds a test for
> the error in the only place it makes sense to do it.
>
> * remote.c (remote_send): Do not call error(). Do not assume what
> the caller wants to do on an error condition. Just return the
> buffer with the error code.
> (store_register_using_P): Test for write register result.
Should all calls to remote_send() be changed so that they check the
return value?
Andrew