From: Doug Evans Date: Wed, 21 May 2014 18:52:51 +0000 (-0700) Subject: Make exception throwers have void result. Delete unused gdbscm_scm_to_target_string_... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a2722c51f6acc5d4c410b9060d44afe96c294bc;p=binutils-gdb.git Make exception throwers have void result. Delete unused gdbscm_scm_to_target_string_unsafe. * scm-exception.c (gdbscm_invalid_object_error): Make result is void. (gdbscm_out_of_range_error): Ditto. (gdbscm_memory_error): Ditto. * scm-string.c (gdbscm_scm_to_target_string_unsafe): Delete. * guile-internal.h (gdbscm_invalid_object_error): Update. (gdbscm_out_of_range_error): Update. (gdbscm_memory_error): Update. (gdbscm_scm_to_target_string_unsafe): Delete. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ba052db0c90..6658da6842a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2014-05-21 Doug Evans + + * scm-exception.c (gdbscm_invalid_object_error): Make result is void. + (gdbscm_out_of_range_error): Ditto. + (gdbscm_memory_error): Ditto. + * scm-string.c (gdbscm_scm_to_target_string_unsafe): Delete. + * guile-internal.h (gdbscm_invalid_object_error): Update. + (gdbscm_out_of_range_error): Update. + (gdbscm_memory_error): Update. + (gdbscm_scm_to_target_string_unsafe): Delete. + 2014-05-21 Pedro Alves * inf-child.c (inf_child_ops, inf_child_explicitly_opened): New diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index f95f0920283..b6d01f453bc 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -274,15 +274,15 @@ extern SCM gdbscm_make_type_error (const char *subr, int arg_pos, extern SCM gdbscm_make_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern SCM gdbscm_invalid_object_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) +extern void gdbscm_invalid_object_error (const char *subr, int arg_pos, + SCM bad_value, const char *error) ATTRIBUTE_NORETURN; extern SCM gdbscm_make_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern SCM gdbscm_out_of_range_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) +extern void gdbscm_out_of_range_error (const char *subr, int arg_pos, + SCM bad_value, const char *error) ATTRIBUTE_NORETURN; extern SCM gdbscm_make_misc_error (const char *subr, int arg_pos, @@ -307,7 +307,8 @@ extern excp_matcher_func gdbscm_memory_error_p; extern SCM gdbscm_make_memory_error (const char *subr, const char *msg, SCM args); -extern SCM gdbscm_memory_error (const char *subr, const char *msg, SCM args); +extern void gdbscm_memory_error (const char *subr, const char *msg, SCM args) + ATTRIBUTE_NORETURN; /* scm-safe-call.c */ @@ -441,9 +442,6 @@ extern char *gdbscm_scm_to_string (SCM string, size_t *lenp, extern SCM gdbscm_scm_from_string (const char *string, size_t len, const char *charset, int strict); -extern char *gdbscm_scm_to_target_string_unsafe (SCM string, size_t *lenp, - struct gdbarch *gdbarch); - /* scm-symbol.c */ extern int syscm_is_symbol (SCM scm); diff --git a/gdb/guile/scm-exception.c b/gdb/guile/scm-exception.c index a96a350f13c..ffe83ede184 100644 --- a/gdb/guile/scm-exception.c +++ b/gdb/guile/scm-exception.c @@ -332,7 +332,7 @@ gdbscm_make_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, /* Throw an invalid-object error. OBJECT is the name of the kind of object that is invalid. */ -SCM +void gdbscm_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *object) { @@ -356,7 +356,7 @@ gdbscm_make_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, /* Throw an out-of-range error. This is the standard Guile out-of-range exception. */ -SCM +void gdbscm_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error) { @@ -387,7 +387,7 @@ gdbscm_make_memory_error (const char *subr, const char *msg, SCM args) /* Throw a gdb:memory-error exception. */ -SCM +void gdbscm_memory_error (const char *subr, const char *msg, SCM args) { SCM exception = gdbscm_make_memory_error (subr, msg, args); diff --git a/gdb/guile/scm-string.c b/gdb/guile/scm-string.c index 87ecabf5a72..c8d81c4a8bd 100644 --- a/gdb/guile/scm-string.c +++ b/gdb/guile/scm-string.c @@ -183,19 +183,6 @@ gdbscm_scm_from_string (const char *string, size_t len, return scm_result; } -/* Convert an SCM string to a target string. - This function will thrown a conversion error if there's a problem. - Space for the result is allocated with malloc, caller must free. - It is an error to call this if STRING is not a string. */ - -char * -gdbscm_scm_to_target_string_unsafe (SCM string, size_t *lenp, - struct gdbarch *gdbarch) -{ - return scm_to_stringn (string, lenp, target_charset (gdbarch), - SCM_FAILED_CONVERSION_ERROR); -} - /* (string->argv string) -> list Return list of strings split up according to GDB's argv parsing rules. This is useful when writing GDB commands in Scheme. */