+2002-05-19 Andrew Cagney <ac131313@redhat.com>
+
+ From Fernando Nasser:
+ * remote.c (remote_async_open_1): Re-throw the exception when the
+ connection fails.
+ (remote_cisco_open): Ditto.
+ (remote_open_1): Ditto.
+
2002-05-19 Andrew Cagney <ac131313@redhat.com>
* remote.c (remote_start_remote_dummy): Add uiout parameter.
#endif
/* Start the remote connection. If error() or QUIT, discard this
- target (we'd otherwise be in an inconsistent state).
+ target (we'd otherwise be in an inconsistent state) and then
+ propogate the error on up the exception chain. This ensures that
+ the caller doesn't stumble along blindly assuming that the
+ function succeeded. The CLI doesn't have this problem but other
+ UI's, such as MI do.
FIXME: cagney/2002-05-19: Instead of re-throwing the exception,
this function should return an error indication letting the
if (ex < 0)
{
pop_target ();
- return;
+ throw_exception (ex);
}
if (extended_p)
#endif
/* Start the remote connection; if error, discard this target. See
- the comments in remote_open_1() for further details. */
+ the comments in remote_open_1() for further details such as the
+ need to re-throw the exception. */
ex = catch_exceptions (uiout,
remote_start_remote, NULL,
"Couldn't establish connection to remote"
{
pop_target ();
wait_forever_enabled_p = 1;
- return;
+ throw_exception (ex);
}
wait_forever_enabled_p = 1;
inferior_ptid = pid_to_ptid (MAGIC_NULL_PID);
/* Start the remote connection; if error, discard this target. See
- the comments in remote_open_1() for further details. */
+ the comments in remote_open_1() for further details such as the
+ need to re-throw the exception. */
ex = catch_exceptions (uiout,
remote_start_remote_dummy, NULL,
"Couldn't establish connection to remote"
if (ex < 0)
{
pop_target ();
- return;
+ throw_exception (ex);
}
}