aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-05-19 20:11:17 +0000
committerAndrew Cagney <cagney@redhat.com>2002-05-19 20:11:17 +0000
commit165b8e33ee01fccd77a949a27056812c6e26ab65 (patch)
tree48b7409244e6a7eb3a30299a7fa33dc393e1ad3e
parent36918e70e5cbd19f845d09abf5f8630f102eeafe (diff)
downloadgdb-165b8e33ee01fccd77a949a27056812c6e26ab65.zip
gdb-165b8e33ee01fccd77a949a27056812c6e26ab65.tar.gz
gdb-165b8e33ee01fccd77a949a27056812c6e26ab65.tar.bz2
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.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/remote.c18
2 files changed, 20 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a2d38da..8504cc4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
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.
(remote_start_remote): Add uiout parameter. Pass through to
remote_start_remote_dummy.
diff --git a/gdb/remote.c b/gdb/remote.c
index 04045c6..a1b90b7 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2314,7 +2314,11 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
#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
@@ -2332,7 +2336,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
if (ex < 0)
{
pop_target ();
- return;
+ throw_exception (ex);
}
if (extended_p)
@@ -2437,7 +2441,8 @@ remote_async_open_1 (char *name, int from_tty, struct target_ops *target,
#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"
@@ -2447,7 +2452,7 @@ remote_async_open_1 (char *name, int from_tty, struct target_ops *target,
{
pop_target ();
wait_forever_enabled_p = 1;
- return;
+ throw_exception (ex);
}
wait_forever_enabled_p = 1;
@@ -5555,7 +5560,8 @@ remote_cisco_open (char *name, int from_tty)
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"
@@ -5564,7 +5570,7 @@ remote_cisco_open (char *name, int from_tty)
if (ex < 0)
{
pop_target ();
- return;
+ throw_exception (ex);
}
}