+2005-04-26 Andrew Cagney <cagney@gnu.org>
+
+ * remote.c (remote_open_1): Move "ex"'s declaration to where it is
+ used.
+ (remote_get_thread_local_address): Use throw_error, include a
+ printed string.
+ * linux-thread-db.c (thread_db_get_thread_local_address): Ditto.
+ * dwarf2loc.c (dwarf_expr_tls_address): Ditto.
+ * cli/cli-script.c (script_from_file): Mark up throw_error message.
+ * linespec.c (symtab_from_filename, decode_variable): Ditto.
+
2005-04-26 Andrew Cagney <cagney@gnu.org>
Rename 'struct exception' to 'struct gdb_exception'.
case RETURN_ERROR:
/* Re-throw the error, but with the file name information
prepended. */
- throw_error (e.error, "%s:%d: Error in sourced command file:\n%s",
+ throw_error (e.error,
+ _("%s:%d: Error in sourced command file:\n%s"),
source_file_name, source_line_number, e.message);
default:
internal_error (__FILE__, __LINE__, _("bad reason"));
objfile);
/* If it's 0, throw the appropriate exception. */
if (lm_addr == 0)
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_LOAD_MODULE_NOT_FOUND_ERROR, 0 };
-
- throw_exception (e);
- }
+ throw_error (TLS_LOAD_MODULE_NOT_FOUND_ERROR,
+ _("TLS load module not found"));
addr = target_get_thread_local_address (ptid, lm_addr, offset);
}
error (_("No symbol table is loaded. Use the \"file\" command."));
if (not_found_ptr)
*not_found_ptr = 1;
- throw_error (NOT_FOUND_ERROR, "No source file named %s.", copy);
+ throw_error (NOT_FOUND_ERROR, _("No source file named %s."), copy);
}
/* Discard the file name from the arg. */
if (not_found_ptr)
*not_found_ptr = 1;
- throw_error (NOT_FOUND_ERROR, "Function \"%s\" not defined.", copy);
+ throw_error (NOT_FOUND_ERROR, _("Function \"%s\" not defined."), copy);
}
/* glibc doesn't provide the needed interface. */
if (!td_thr_tls_get_addr_p)
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_NO_LIBRARY_SUPPORT_ERROR, 0 };
-
- throw_exception (e);
- }
+ throw_error (TLS_NO_LIBRARY_SUPPORT_ERROR,
+ _("No TLS library support"));
/* Caller should have verified that lm != 0. */
gdb_assert (lm != 0);
#ifdef THREAD_DB_HAS_TD_NOTALLOC
/* The memory hasn't been allocated, yet. */
if (err == TD_NOTALLOC)
- {
/* Now, if libthread_db provided the initialization image's
address, we *could* try to build a non-lvalue value from
the initialization image. */
-
- struct gdb_exception e
- = { RETURN_ERROR, TLS_NOT_ALLOCATED_YET_ERROR, 0 };
-
- throw_exception (e);
- }
+ throw_error (TLS_NOT_ALLOCATED_YET_ERROR,
+ _("TLS not allocated yet"));
#endif
/* Something else went wrong. */
if (err != TD_OK)
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR, thread_db_err_str (err) };
-
- throw_exception (e);
- }
+ throw_error (TLS_GENERIC_ERROR,
+ (("%s")), thread_db_err_str (err));
/* Cast assuming host == target. Joy. */
return (CORE_ADDR) address;
if (target_beneath->to_get_thread_local_address)
return target_beneath->to_get_thread_local_address (ptid, lm, offset);
else
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR,
- "TLS not supported on this target" };
-
- throw_exception (e);
- }
+ throw_error (TLS_GENERIC_ERROR,
+ _("TLS not supported on this target"));
}
static void
remote_open_1 (char *name, int from_tty, struct target_ops *target,
int extended_p, int async_p)
{
- struct gdb_exception ex;
struct remote_state *rs = get_remote_state ();
if (name == 0)
error (_("To open a remote debug connection, you need to specify what\n"
been fixed - the function set_cmd_context() makes it possible for
all the ``target ....'' commands to share a common callback
function. See cli-dump.c. */
- ex = catch_exception (uiout, remote_start_remote, NULL, RETURN_MASK_ALL);
- if (ex.reason < 0)
- {
- pop_target ();
- if (async_p)
- wait_forever_enabled_p = 1;
- throw_exception (ex);
- }
+ {
+ struct gdb_exception ex
+ = catch_exception (uiout, remote_start_remote, NULL, RETURN_MASK_ALL);
+ if (ex.reason < 0)
+ {
+ pop_target ();
+ if (async_p)
+ wait_forever_enabled_p = 1;
+ throw_exception (ex);
+ }
+ }
if (async_p)
wait_forever_enabled_p = 1;
return result;
}
else if (result == PACKET_UNKNOWN)
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR,
- "Remote target doesn't support qGetTLSAddr packet" };
- throw_exception (e);
- }
+ throw_error (TLS_GENERIC_ERROR,
+ _("Remote target doesn't support qGetTLSAddr packet"));
else
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR,
- "Remote target failed to process qGetTLSAddr request" };
- throw_exception (e);
-
- }
+ throw_error (TLS_GENERIC_ERROR,
+ _("Remote target failed to process qGetTLSAddr request"));
}
else
- {
- struct gdb_exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR,
- "TLS not supported or disabled on this target" };
- throw_exception (e);
- }
+ throw_error (TLS_GENERIC_ERROR,
+ _("TLS not supported or disabled on this target"));
/* Not reached. */
return 0;
}