From: Andrew Cagney Date: Tue, 26 Apr 2005 14:57:22 +0000 (+0000) Subject: 2005-04-26 Andrew Cagney X-Git-Tag: msnyder-tracepoint-checkpoint-branchpoint~457 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=109c3e397e8c8c131128f2bcf6cea8b6ce6f2d51;p=platform%2Fupstream%2Fbinutils.git 2005-04-26 Andrew Cagney * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fa36e4c..af11653 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 2005-04-26 Andrew Cagney + * 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 + Rename 'struct exception' to 'struct gdb_exception'. * wrapper.c: Update. * varobj.c: Update. diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 3d69601..a4da9c5 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1286,7 +1286,8 @@ script_from_file (FILE *stream, char *file) 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")); diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 00b2196..47c8101 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -204,12 +204,8 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset) 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); } diff --git a/gdb/linespec.c b/gdb/linespec.c index 8cf7a65..cf6e6f6 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1529,7 +1529,7 @@ symtab_from_filename (char **argptr, char *p, int is_quote_enclosed, 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. */ @@ -1741,7 +1741,7 @@ decode_variable (char *copy, int funfirstline, char ***canonical, 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); } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 30f9c94..fca0b04 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1246,12 +1246,8 @@ thread_db_get_thread_local_address (ptid_t ptid, /* 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); @@ -1267,26 +1263,17 @@ thread_db_get_thread_local_address (ptid_t ptid, #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; @@ -1295,13 +1282,8 @@ thread_db_get_thread_local_address (ptid_t ptid, 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 diff --git a/gdb/remote.c b/gdb/remote.c index 7ad9ec2..450ef5b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2179,7 +2179,6 @@ 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" @@ -2282,14 +2281,17 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, 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; @@ -5357,28 +5359,15 @@ remote_get_thread_local_address (ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset) 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; }