GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
scm-exception.c File Reference
#include "defs.h"
#include <signal.h>
#include "guile-internal.h"

Go to the source code of this file.

Classes

struct  exception_smob
 

Functions

static int exscm_print_exception_smob (SCM self, SCM port, scm_print_state *pstate)
 
SCM gdbscm_make_exception (SCM key, SCM args)
 
int gdbscm_is_exception (SCM scm)
 
static SCM gdbscm_exception_p (SCM scm)
 
SCM gdbscm_exception_key (SCM self)
 
SCM gdbscm_exception_args (SCM self)
 
SCM gdbscm_make_exception_with_stack (SCM key, SCM args, SCM stack)
 
SCM gdbscm_make_error_scm (SCM key, SCM subr, SCM message, SCM args, SCM data)
 
SCM gdbscm_make_error (SCM key, const char *subr, const char *message, SCM args, SCM data)
 
SCM gdbscm_make_type_error (const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
 
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_make_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *object)
 
void gdbscm_invalid_object_error (const char *subr, int arg_pos, SCM bad_value, const char *object)
 
SCM gdbscm_make_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error)
 
void gdbscm_out_of_range_error (const char *subr, int arg_pos, SCM bad_value, const char *error)
 
SCM gdbscm_make_misc_error (const char *subr, int arg_pos, SCM bad_value, const char *error)
 
void gdbscm_misc_error (const char *subr, int arg_pos, SCM bad_value, const char *error)
 
SCM gdbscm_make_memory_error (const char *subr, const char *msg, SCM args)
 
void gdbscm_memory_error (const char *subr, const char *msg, SCM args)
 
int gdbscm_memory_error_p (SCM key)
 
int gdbscm_user_error_p (SCM key)
 
void gdbscm_throw (SCM exception)
 
SCM gdbscm_scm_from_gdb_exception (const gdbscm_gdb_exception &exception)
 
void gdbscm_throw_gdb_exception (gdbscm_gdb_exception exception)
 
static void gdbscm_print_exception_message (SCM port, SCM frame, SCM key, SCM args)
 
void gdbscm_print_exception_with_stack (SCM port, SCM stack, SCM key, SCM args)
 
void gdbscm_print_gdb_exception (SCM port, SCM exception)
 
gdb::unique_xmalloc_ptr< char > gdbscm_exception_message_to_string (SCM exception)
 
static SCM gdbscm_percent_exception_print_style (void)
 
static SCM gdbscm_percent_exception_count (void)
 
void gdbscm_initialize_exceptions (void)
 

Variables

static const char exception_smob_name [] = "gdb:exception"
 
static scm_t_bits exception_smob_tag
 
static SCM error_symbol
 
static SCM memory_error_symbol
 
static SCM signal_symbol
 
static SCM user_error_symbol
 
static SCM with_stack_error_symbol
 
SCM gdbscm_invalid_object_error_symbol
 
static SCM none_symbol
 
static SCM message_symbol
 
static SCM full_symbol
 
static const char percent_print_exception_message_name []
 
static SCM percent_print_exception_message_var = SCM_BOOL_F
 
static const char percent_print_exception_with_stack_name []
 
static SCM percent_print_exception_with_stack_var = SCM_BOOL_F
 
static unsigned long gdbscm_exception_count = 0
 
static const scheme_function exception_functions []
 
static const scheme_function private_exception_functions []
 

Function Documentation

◆ exscm_print_exception_smob()

static int exscm_print_exception_smob ( SCM self,
SCM port,
scm_print_state * pstate )
static

◆ gdbscm_exception_args()

SCM gdbscm_exception_args ( SCM self)

◆ gdbscm_exception_key()

SCM gdbscm_exception_key ( SCM self)

◆ gdbscm_exception_message_to_string()

gdb::unique_xmalloc_ptr< char > gdbscm_exception_message_to_string ( SCM exception)

◆ gdbscm_exception_p()

static SCM gdbscm_exception_p ( SCM scm)
static

Definition at line 155 of file scm-exception.c.

References gdbscm_is_exception().

◆ gdbscm_initialize_exceptions()

void gdbscm_initialize_exceptions ( void )

◆ gdbscm_invalid_object_error()

void gdbscm_invalid_object_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * object )

◆ gdbscm_is_exception()

int gdbscm_is_exception ( SCM scm)

◆ gdbscm_make_arg_error()

static SCM gdbscm_make_arg_error ( SCM key,
const char * subr,
int arg_pos,
SCM bad_value,
const char * error_prefix,
const char * error )
static

◆ gdbscm_make_error()

SCM gdbscm_make_error ( SCM key,
const char * subr,
const char * message,
SCM args,
SCM data )

◆ gdbscm_make_error_scm()

SCM gdbscm_make_error_scm ( SCM key,
SCM subr,
SCM message,
SCM args,
SCM data )

Definition at line 210 of file scm-exception.c.

References gdbscm_make_exception().

Referenced by gdbscm_make_error().

◆ gdbscm_make_exception()

SCM gdbscm_make_exception ( SCM key,
SCM args )

◆ gdbscm_make_exception_with_stack()

SCM gdbscm_make_exception_with_stack ( SCM key,
SCM args,
SCM stack )

Definition at line 192 of file scm-exception.c.

References gdbscm_make_exception(), and with_stack_error_symbol.

Referenced by scscm_recording_unwind_handler().

◆ gdbscm_make_invalid_object_error()

SCM gdbscm_make_invalid_object_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * object )

◆ gdbscm_make_memory_error()

SCM gdbscm_make_memory_error ( const char * subr,
const char * msg,
SCM args )

Definition at line 380 of file scm-exception.c.

References gdbscm_make_error(), and memory_error_symbol.

Referenced by gdbscm_memory_error().

◆ gdbscm_make_misc_error()

SCM gdbscm_make_misc_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * error )

Definition at line 359 of file scm-exception.c.

References gdbscm_make_arg_error().

Referenced by gdbscm_misc_error(), and vlscm_convert_typed_value_from_scheme().

◆ gdbscm_make_out_of_range_error()

SCM gdbscm_make_out_of_range_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * error )

◆ gdbscm_make_type_error()

SCM gdbscm_make_type_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * expected_type )

◆ gdbscm_memory_error()

void gdbscm_memory_error ( const char * subr,
const char * msg,
SCM args )

◆ gdbscm_memory_error_p()

int gdbscm_memory_error_p ( SCM key)

Definition at line 400 of file scm-exception.c.

References memory_error_symbol.

◆ gdbscm_misc_error()

void gdbscm_misc_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * error )

◆ gdbscm_out_of_range_error()

void gdbscm_out_of_range_error ( const char * subr,
int arg_pos,
SCM bad_value,
const char * error )

◆ gdbscm_percent_exception_count()

static SCM gdbscm_percent_exception_count ( void )
static

Definition at line 626 of file scm-exception.c.

References gdbscm_exception_count.

◆ gdbscm_percent_exception_print_style()

static SCM gdbscm_percent_exception_print_style ( void )
static

◆ gdbscm_print_exception_message()

static void gdbscm_print_exception_message ( SCM port,
SCM frame,
SCM key,
SCM args )
static

◆ gdbscm_print_exception_with_stack()

void gdbscm_print_exception_with_stack ( SCM port,
SCM stack,
SCM key,
SCM args )

◆ gdbscm_print_gdb_exception()

void gdbscm_print_gdb_exception ( SCM port,
SCM exception )

◆ gdbscm_scm_from_gdb_exception()

SCM gdbscm_scm_from_gdb_exception ( const gdbscm_gdb_exception & exception)

◆ gdbscm_throw()

void gdbscm_throw ( SCM exception)

◆ gdbscm_throw_gdb_exception()

void gdbscm_throw_gdb_exception ( gdbscm_gdb_exception exception)

◆ gdbscm_user_error_p()

int gdbscm_user_error_p ( SCM key)

Definition at line 409 of file scm-exception.c.

References user_error_symbol.

Variable Documentation

◆ error_symbol

SCM error_symbol
static

Definition at line 57 of file scm-exception.c.

Referenced by gdbscm_initialize_exceptions(), and gdbscm_scm_from_gdb_exception().

◆ exception_functions

const scheme_function exception_functions[]
static
Initial value:
=
{
{ "make-exception", 2, 0, 0, as_a_scm_t_subr (gdbscm_make_exception),
"\
Create a <gdb:exception> object.\n\
\n\
Arguments: key args\n\
These are the standard key,args arguments of \"throw\"." },
{ "exception?", 1, 0, 0, as_a_scm_t_subr (gdbscm_exception_p),
"\
Return #t if the object is a <gdb:exception> object." },
{ "exception-key", 1, 0, 0, as_a_scm_t_subr (gdbscm_exception_key),
"\
Return the exception's key." },
{ "exception-args", 1, 0, 0, as_a_scm_t_subr (gdbscm_exception_args),
"\
Return the exception's arg list." },
}
#define END_FUNCTIONS
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_exception_args(SCM self)
SCM gdbscm_exception_key(SCM self)
static SCM gdbscm_exception_p(SCM scm)
SCM gdbscm_make_exception(SCM key, SCM args)

Definition at line 633 of file scm-exception.c.

Referenced by gdbscm_initialize_exceptions().

◆ exception_smob_name

const char exception_smob_name[] = "gdb:exception"
static

◆ exception_smob_tag

scm_t_bits exception_smob_tag
static

◆ full_symbol

SCM full_symbol
static

◆ gdbscm_exception_count

unsigned long gdbscm_exception_count = 0
static

Definition at line 102 of file scm-exception.c.

Referenced by gdbscm_make_exception(), and gdbscm_percent_exception_count().

◆ gdbscm_invalid_object_error_symbol

SCM gdbscm_invalid_object_error_symbol

◆ memory_error_symbol

SCM memory_error_symbol
static

◆ message_symbol

SCM message_symbol
static

◆ none_symbol

SCM none_symbol
static

◆ percent_print_exception_message_name

const char percent_print_exception_message_name[]
static
Initial value:
=
"%print-exception-message"

Definition at line 84 of file scm-exception.c.

Referenced by gdbscm_print_exception_message().

◆ percent_print_exception_message_var

SCM percent_print_exception_message_var = SCM_BOOL_F
static

Definition at line 90 of file scm-exception.c.

Referenced by gdbscm_print_exception_message().

◆ percent_print_exception_with_stack_name

const char percent_print_exception_with_stack_name[]
static
Initial value:
=
"%print-exception-with-stack"

Definition at line 92 of file scm-exception.c.

Referenced by gdbscm_print_exception_with_stack().

◆ percent_print_exception_with_stack_var

SCM percent_print_exception_with_stack_var = SCM_BOOL_F
static

Definition at line 98 of file scm-exception.c.

Referenced by gdbscm_print_exception_with_stack().

◆ private_exception_functions

const scheme_function private_exception_functions[]
static
Initial value:
=
{
{ "%exception-print-style", 0, 0, 0,
"\
Return the value of the \"guile print-stack\" option." },
{ "%exception-count", 0, 0, 0,
"\
Return a count of the number of <gdb:exception> objects created.\n\
This is for debugging purposes." },
}
static SCM gdbscm_percent_exception_print_style(void)
static SCM gdbscm_percent_exception_count(void)

Definition at line 657 of file scm-exception.c.

Referenced by gdbscm_initialize_exceptions().

◆ signal_symbol

SCM signal_symbol
static

Definition at line 64 of file scm-exception.c.

Referenced by gdbscm_initialize_exceptions(), and gdbscm_scm_from_gdb_exception().

◆ user_error_symbol

SCM user_error_symbol
static

Definition at line 67 of file scm-exception.c.

Referenced by gdbscm_initialize_exceptions(), and gdbscm_user_error_p().

◆ with_stack_error_symbol

SCM with_stack_error_symbol
static