26#include "gdbsupport/pathstuff.h"
32 const char *(*func) (
void *);
66 return SCM_UNSPECIFIED;
75 SCM stack = scm_make_stack (SCM_BOOL_T, scm_list_1 (scm_from_int (2)));
79 return SCM_UNSPECIFIED;
87 return SCM_UNSPECIFIED;
104 if (matcher != NULL && matcher (key))
105 return SCM_UNSPECIFIED;
112 data->stack = scm_make_stack (SCM_BOOL_T, scm_list_1 (scm_from_int (2)));
120 return SCM_UNSPECIFIED;
154 = scm_c_catch (SCM_BOOL_T,
159#if HAVE_GUILE_MANUAL_FINALIZATION
160 scm_run_finalizers ();
180 c_data.
result = _(
"Error while executing Scheme code.");
187 catch_data.
stack = SCM_BOOL_F;
211 catch_data.
stack = SCM_BOOL_F;
234 SCM *args = (SCM *) argsp;
236 return scm_call_0 (args[0]);
242 SCM args[] = {
proc };
252 SCM *args = (SCM *) argsp;
254 return scm_call_1 (args[0], args[1]);
260 SCM args[] = {
proc, arg0 };
270 SCM *args = (SCM *) argsp;
272 return scm_call_2 (args[0], args[1], args[2]);
278 SCM args[] = {
proc, arg0, arg1 };
288 SCM *args = (SCM *) argsp;
290 return scm_call_3 (args[0], args[1], args[2], args[3]);
297 SCM args[] = {
proc, arg1, arg2, arg3 };
307 SCM *args = (SCM *) argsp;
309 return scm_call_4 (args[0], args[1], args[2], args[3], args[4]);
316 SCM args[] = {
proc, arg1, arg2, arg3, arg4 };
326 SCM *args = (SCM *) argsp;
328 return scm_apply_1 (args[0], args[1], args[2]);
334 SCM args[] = {
proc, arg0, rest };
359 return scm_call_1 (
proc, arg0);
378 SCM result = scm_c_eval_string (data->string);
380 if (data->display_result && !scm_is_eq (result, SCM_UNSPECIFIED))
382 SCM port = scm_current_output_port ();
384 scm_write (result, port);
398gdb::unique_xmalloc_ptr<char>
407 return make_unique_xstrdup (result);
418 const char *filename = (
const char *) data;
422 scm_c_primitive_load_path (filename);
434gdb::unique_xmalloc_ptr<char>
442 gdb::unique_xmalloc_ptr<char> abs_filename;
445 if (!IS_ABSOLUTE_PATH (filename))
447 abs_filename = gdb_realpath (filename);
448 filename = abs_filename.get ();
455 return make_unique_xstrdup (result);
467 scm_from_latin1_symbol (
"scheme"), NULL);
#define gdbscm_is_true(scm)
void gdbscm_print_exception_with_stack(SCM port, SCM stack, SCM key, SCM args)
int excp_matcher_func(SCM key)
SCM gdbscm_make_exception_with_stack(SCM key, SCM args, SCM stack)
SCM gdbscm_make_exception(SCM tag, SCM args)
void(* func)(remote_target *remote, char *)
static SCM scscm_call_1_body(void *argsp)
static SCM scscm_call_0_body(void *argsp)
static SCM scscm_call_3_body(void *argsp)
SCM gdbscm_safe_call_4(SCM proc, SCM arg1, SCM arg2, SCM arg3, SCM arg4, excp_matcher_func *ok_excps)
static void * gdbscm_with_catch(void *data)
static SCM scscm_apply_1_body(void *argsp)
static SCM scscm_recording_pre_unwind_handler(void *datap, SCM key, SCM args)
SCM gdbscm_safe_call_3(SCM proc, SCM arg1, SCM arg2, SCM arg3, excp_matcher_func *ok_excps)
static SCM scscm_printing_pre_unwind_handler(void *data, SCM key, SCM args)
static SCM scscm_call_4_body(void *argsp)
SCM gdbscm_safe_call_2(SCM proc, SCM arg0, SCM arg1, excp_matcher_func *ok_excps)
SCM gdbscm_safe_call_1(SCM proc, SCM arg0, excp_matcher_func *ok_excps)
SCM gdbscm_call_guile(SCM(*func)(void *), void *data, excp_matcher_func *ok_excps)
static const char * scscm_source_scheme_script(void *data)
static SCM scscm_call_2_body(void *argsp)
static SCM scscm_safe_call_body(void *d)
const char * gdbscm_with_guile(const char *(*func)(void *), void *data)
SCM gdbscm_safe_call_0(SCM proc, excp_matcher_func *ok_excps)
static const char * scscm_eval_scheme_string(void *datap)
gdb::unique_xmalloc_ptr< char > gdbscm_safe_source_script(const char *filename)
static SCM scscm_recording_unwind_handler(void *datap, SCM key, SCM args)
SCM gdbscm_unsafe_call_1(SCM proc, SCM arg0)
SCM gdbscm_safe_apply_1(SCM proc, SCM arg0, SCM rest, excp_matcher_func *ok_excps)
gdb::unique_xmalloc_ptr< char > gdbscm_safe_eval_string(const char *string, int display_result)
static SCM scscm_nop_unwind_handler(void *data, SCM key, SCM args)
void gdbscm_enter_repl(void)
const char *(* func)(void *)
scm_t_catch_handler unwind_handler
scm_t_catch_handler pre_unwind_handler
excp_matcher_func * excp_matcher