85 "%print-exception-message";
93 "%print-exception-with-stack";
114 scm_write (e_smob->
key, port);
115 scm_puts (
" ", port);
116 scm_write (e_smob->
args, port);
117 scm_puts (
">", port);
119 scm_remember_upto_here_1 (
self);
195 scm_cons (key, scm_cons (stack, args)));
225 subr == NULL ? SCM_BOOL_F : scm_from_latin1_string (subr),
226 message == NULL ? SCM_BOOL_F : scm_from_latin1_string (message),
235 const char *expected_type)
242 if (expected_type != NULL)
244 msg =
xstrprintf (
_(
"Wrong type argument in position %d"
245 " (expecting %s): ~S"),
246 arg_pos, expected_type);
250 msg =
xstrprintf (
_(
"Wrong type argument in position %d: ~S"),
256 if (expected_type != NULL)
258 msg =
xstrprintf (
_(
"Wrong type argument (expecting %s): ~S"),
266 scm_list_1 (bad_value), scm_list_1 (bad_value));
280 const char *error_prefix,
const char *
error)
285 if (error_prefix != NULL)
290 error_prefix, error, arg_pos);
293 msg =
xstrprintf (
_(
"%s %s: ~S"), error_prefix, error);
298 msg =
xstrprintf (
_(
"%s in position %d: ~S"), error, arg_pos);
304 scm_list_1 (bad_value), scm_list_1 (bad_value));
317 subr, arg_pos, bad_value,
318 _(
"Invalid object:"),
object);
341 subr, arg_pos, bad_value,
342 _(
"Out of range:"), error);
365 subr, arg_pos, bad_value, NULL, error);
439 SCM_EOL, scm_list_1 (scm_from_int (SIGINT)));
475 port = scm_current_error_port ();
493 " can't find %s.\n"),
507 scm_display (status, port);
531 port = scm_current_error_port ();
544 " can't find %s.\n"),
558 scm_display (status, port);
585 SCM port = scm_open_output_string ();
596 && scm_is_pair (args)
597 && scm_is_pair (scm_cdr (args)))
599 key = scm_car (args);
600 args = scm_cddr (args);
605 scm_close_port (port);
640 Create a <gdb:exception> object.\n\
642 Arguments: key args\n\
643 These are the standard key,args arguments of \"throw\"." },
647 Return #t if the object is a <gdb:exception> object." },
651 Return the exception's key." },
655 Return the exception's arg list." },
664 Return the value of the \"guile print-stack\" option." },
668 Return a count of the number of <gdb:exception> objects created.\n\
669 This is for debugging purposes." },
691 = scm_from_latin1_symbol (
"gdb:invalid-object-error");
SCM gdbscm_make_memory_error(const char *subr, const char *msg, SCM args)
SCM gdbscm_invalid_object_error_symbol
SCM gdbscm_make_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *object)
const char * gdbscm_print_excp
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
static SCM memory_error_symbol
const char gdbscm_print_excp_none[]
void gdbscm_define_functions(const scheme_function *, int is_public)
static SCM percent_print_exception_with_stack_var
char * gdbscm_scm_to_c_string(SCM string)
char * gdbscm_exception_message_to_string(SCM exception)
SCM gdbscm_exception_args(SCM self)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
SCM gdbscm_make_error(SCM key, const char *subr, const char *message, SCM args, SCM data)
void gdbscm_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
static SCM percent_print_exception_message_var
static SCM gdbscm_percent_exception_print_style(void)
SCM gdbscm_make_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
void gdbscm_print_exception_with_stack(SCM port, SCM stack, SCM key, SCM args)
int gdbscm_memory_error_p(SCM key)
static SCM gdbscm_percent_exception_count(void)
static SCM with_stack_error_symbol
void gdbscm_init_gsmob(gdb_smob *base)
SCM gdbscm_make_exception_with_stack(SCM key, SCM args, SCM stack)
static const char exception_smob_name[]
static struct parser_state * pstate
static SCM gdbscm_make_arg_error(SCM key, const char *subr, int arg_pos, SCM bad_value, const char *error_prefix, const char *error)
SCM gdbscm_scm_from_c_string(const char *string)
void gdbscm_initialize_exceptions(void)
#define gdbscm_is_false(scm)
void gdbscm_memory_error(const char *subr, const char *msg, SCM args)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
#define gdb_assert_not_reached(message)
void gdbscm_throw_gdb_exception(struct gdb_exception exception)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
static SCM user_error_symbol
static const char percent_print_exception_with_stack_name[]
int gdbscm_is_exception(SCM scm)
char * xstrprintf(const char *format,...)
SCM gdbscm_make_type_error(const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
SCM gdbscm_make_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
static const char percent_print_exception_message_name[]
SCM gdbscm_scm_from_gdb_exception(struct gdb_exception exception)
SCM gdbscm_safe_call_4(SCM proc, SCM arg0, SCM arg1, SCM arg2, SCM arg3, excp_matcher_func *ok_excps)
const char gdbscm_print_excp_message[]
static int exscm_print_exception_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM gdbscm_exception_p(SCM scm)
static SCM message_symbol
static scm_t_bits exception_smob_tag
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *object)
SCM gdbscm_make_exception(SCM key, SCM args)
static unsigned long gdbscm_exception_count
const char gdbscm_init_module_name[]
const char gdbscm_print_excp_full[]
void gdbscm_throw(SCM exception)
void gdbscm_print_gdb_exception(SCM port, SCM exception)
void error(const char *fmt,...)
int gdbscm_user_error_p(SCM key)
SCM gdbscm_make_error_scm(SCM key, SCM subr, SCM message, SCM args, SCM data)
enum return_reason reason
SCM gdbscm_exception_key(SCM self)
static void gdbscm_print_exception_message(SCM port, SCM frame, SCM key, SCM args)