diff options
Diffstat (limited to 'gdb/guile/guile-internal.h')
-rw-r--r-- | gdb/guile/guile-internal.h | 175 |
1 files changed, 92 insertions, 83 deletions
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h index 42ecb3c..5200ce9 100644 --- a/gdb/guile/guile-internal.h +++ b/gdb/guile/guile-internal.h @@ -23,7 +23,6 @@ /* See README file in this directory for implementation notes, coding conventions, et.al. */ - #include "hashtab.h" #include "extension-priv.h" #include "symtab.h" @@ -50,7 +49,10 @@ struct scheme_variable /* End of scheme_variable table mark. */ -#define END_VARIABLES { NULL, SCM_BOOL_F, NULL } +#define END_VARIABLES \ + { \ + NULL, SCM_BOOL_F, NULL \ + } /* Although scm_t_subr is meant to hold a function pointer, at least in some versions of guile, it is actually a typedef to "void *". @@ -102,7 +104,10 @@ struct scheme_function /* End of scheme_function table mark. */ -#define END_FUNCTIONS { NULL, 0, 0, 0, NULL, NULL } +#define END_FUNCTIONS \ + { \ + NULL, 0, 0, 0, NULL, NULL \ + } /* Useful for defining a set of constants. */ @@ -112,7 +117,10 @@ struct scheme_integer_constant int value; }; -#define END_INTEGER_CONSTANTS { NULL, 0 } +#define END_INTEGER_CONSTANTS \ + { \ + NULL, 0 \ + } /* Pass this instead of 0 to routines like SCM_ASSERT to indicate the value is not a function argument. */ @@ -174,7 +182,7 @@ extern SCM gdbscm_invalid_object_error_symbol; extern SCM gdbscm_map_string; extern SCM gdbscm_array_string; extern SCM gdbscm_string_string; - + /* scm-utils.c */ extern void gdbscm_define_variables (const scheme_variable *, int is_public); @@ -210,10 +218,10 @@ extern int gdbscm_is_procedure (SCM proc); extern char *gdbscm_gc_xstrdup (const char *); -extern const char * const *gdbscm_gc_dup_argv (char **argv); +extern const char *const *gdbscm_gc_dup_argv (char **argv); extern int gdbscm_guile_version_is_at_least (int major, int minor, int micro); - + /* GDB smobs, from scm-gsmob.c */ /* All gdb smobs must contain one of the following as the first member: @@ -237,8 +245,7 @@ extern int gdbscm_guile_version_is_at_least (int major, int minor, int micro); gdb_smob as if it is a subclass. To that end we use macro GDB_SMOB_HEAD to ensure this. */ -#define GDB_SMOB_HEAD \ - int empty_base_class; +#define GDB_SMOB_HEAD int empty_base_class; struct gdb_smob { @@ -290,15 +297,15 @@ extern void gdbscm_init_eqable_gsmob (eqable_gdb_smob *base, extern htab_t gdbscm_create_eqable_gsmob_ptr_map (htab_hash hash_fn, htab_eq eq_fn); -extern eqable_gdb_smob **gdbscm_find_eqable_gsmob_ptr_slot - (htab_t htab, eqable_gdb_smob *base); +extern eqable_gdb_smob ** +gdbscm_find_eqable_gsmob_ptr_slot (htab_t htab, eqable_gdb_smob *base); extern void gdbscm_fill_eqable_gsmob_ptr_slot (eqable_gdb_smob **slot, eqable_gdb_smob *base); extern void gdbscm_clear_eqable_gsmob_ptr_slot (htab_t htab, eqable_gdb_smob *base); - + /* Exceptions and calling out to Guile. */ /* scm-exception.c */ @@ -313,8 +320,8 @@ extern SCM gdbscm_exception_args (SCM excp); extern SCM gdbscm_make_exception_with_stack (SCM key, SCM args, SCM stack); -extern SCM gdbscm_make_error_scm (SCM key, SCM subr, SCM message, - SCM args, SCM data); +extern SCM gdbscm_make_error_scm (SCM key, SCM subr, SCM message, SCM args, + SCM data); extern SCM gdbscm_make_error (SCM key, const char *subr, const char *message, SCM args, SCM data); @@ -326,39 +333,38 @@ extern SCM gdbscm_make_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; + 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 void gdbscm_out_of_range_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) - ATTRIBUTE_NORETURN; + SCM bad_value, + const char *error) ATTRIBUTE_NORETURN; extern SCM gdbscm_make_misc_error (const char *subr, int arg_pos, SCM bad_value, const char *error); -extern void gdbscm_misc_error (const char *subr, int arg_pos, - SCM bad_value, const char *error) - ATTRIBUTE_NORETURN; +extern void gdbscm_misc_error (const char *subr, int arg_pos, SCM bad_value, + const char *error) ATTRIBUTE_NORETURN; extern void gdbscm_throw (SCM exception) ATTRIBUTE_NORETURN; struct gdbscm_gdb_exception; -extern SCM gdbscm_scm_from_gdb_exception - (const gdbscm_gdb_exception &exception); +extern SCM +gdbscm_scm_from_gdb_exception (const gdbscm_gdb_exception &exception); -extern void gdbscm_throw_gdb_exception (gdbscm_gdb_exception exception) - ATTRIBUTE_NORETURN; +extern void +gdbscm_throw_gdb_exception (gdbscm_gdb_exception exception) ATTRIBUTE_NORETURN; -extern void gdbscm_print_exception_with_stack (SCM port, SCM stack, - SCM key, SCM args); +extern void gdbscm_print_exception_with_stack (SCM port, SCM stack, SCM key, + SCM args); extern void gdbscm_print_gdb_exception (SCM port, SCM exception); -extern gdb::unique_xmalloc_ptr<char> gdbscm_exception_message_to_string - (SCM exception); +extern gdb::unique_xmalloc_ptr<char> +gdbscm_exception_message_to_string (SCM exception); extern excp_matcher_func gdbscm_memory_error_p; @@ -367,12 +373,13 @@ extern excp_matcher_func gdbscm_user_error_p; extern SCM gdbscm_make_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; +extern void gdbscm_memory_error (const char *subr, const char *msg, + SCM args) ATTRIBUTE_NORETURN; /* scm-safe-call.c */ -extern const char *gdbscm_with_guile (const char *(*func) (void *), void *data); +extern const char *gdbscm_with_guile (const char *(*func) (void *), + void *data); extern SCM gdbscm_call_guile (SCM (*func) (void *), void *data, excp_matcher_func *ok_excps); @@ -389,22 +396,21 @@ extern SCM gdbscm_safe_call_3 (SCM proc, SCM arg0, SCM arg1, SCM arg2, excp_matcher_func *ok_excps); extern SCM gdbscm_safe_call_4 (SCM proc, SCM arg0, SCM arg1, SCM arg2, - SCM arg3, - excp_matcher_func *ok_excps); + SCM arg3, excp_matcher_func *ok_excps); extern SCM gdbscm_safe_apply_1 (SCM proc, SCM arg0, SCM args, excp_matcher_func *ok_excps); extern SCM gdbscm_unsafe_call_1 (SCM proc, SCM arg0); -extern gdb::unique_xmalloc_ptr<char> gdbscm_safe_eval_string - (const char *string, int display_result); +extern gdb::unique_xmalloc_ptr<char> +gdbscm_safe_eval_string (const char *string, int display_result); -extern gdb::unique_xmalloc_ptr<char> gdbscm_safe_source_script - (const char *filename); +extern gdb::unique_xmalloc_ptr<char> +gdbscm_safe_source_script (const char *filename); extern void gdbscm_enter_repl (void); - + /* Interface to various GDB objects, in alphabetical order. */ /* scm-arch.c */ @@ -423,8 +429,9 @@ extern SCM arscm_scm_from_arch (struct gdbarch *gdbarch); extern SCM bkscm_scm_from_block (const struct block *block, struct objfile *objfile); -extern const struct block *bkscm_scm_to_block - (SCM block_scm, int arg_pos, const char *func_name, SCM *excp); +extern const struct block *bkscm_scm_to_block (SCM block_scm, int arg_pos, + const char *func_name, + SCM *excp); /* scm-cmd.c */ @@ -482,14 +489,13 @@ extern int lsscm_is_lazy_string (SCM scm); extern SCM lsscm_make_lazy_string (CORE_ADDR address, int length, const char *encoding, struct type *type); -extern struct value *lsscm_safe_lazy_string_to_value (SCM string, - int arg_pos, +extern struct value *lsscm_safe_lazy_string_to_value (SCM string, int arg_pos, const char *func_name, SCM *except_scmp); -extern void lsscm_val_print_lazy_string - (SCM string, struct ui_file *stream, - const struct value_print_options *options); +extern void +lsscm_val_print_lazy_string (SCM string, struct ui_file *stream, + const struct value_print_options *options); /* scm-objfile.c */ @@ -520,16 +526,17 @@ extern gdb::unique_xmalloc_ptr<char> gdbscm_scm_to_c_string (SCM string); extern SCM gdbscm_scm_from_c_string (const char *string); extern SCM gdbscm_scm_from_printf (const char *format, ...) - ATTRIBUTE_PRINTF (1, 2); + ATTRIBUTE_PRINTF (1, 2); -extern gdb::unique_xmalloc_ptr<char> gdbscm_scm_to_string - (SCM string, size_t *lenp, const char *charset, int strict, SCM *except_scmp); +extern gdb::unique_xmalloc_ptr<char> +gdbscm_scm_to_string (SCM string, size_t *lenp, const char *charset, + int strict, SCM *except_scmp); extern SCM gdbscm_scm_from_string (const char *string, size_t len, const char *charset, int strict); -extern gdb::unique_xmalloc_ptr<char> gdbscm_scm_to_host_string - (SCM string, size_t *lenp, SCM *except); +extern gdb::unique_xmalloc_ptr<char> +gdbscm_scm_to_host_string (SCM string, size_t *lenp, SCM *except); extern SCM gdbscm_scm_from_host_string (const char *string, size_t len); @@ -539,8 +546,9 @@ extern int syscm_is_symbol (SCM scm); extern SCM syscm_scm_from_symbol (struct symbol *symbol); -extern struct symbol *syscm_get_valid_symbol_arg_unsafe - (SCM self, int arg_pos, const char *func_name); +extern struct symbol * +syscm_get_valid_symbol_arg_unsafe (SCM self, int arg_pos, + const char *func_name); /* scm-symtab.c */ @@ -574,15 +582,15 @@ extern int vlscm_is_value (SCM scm); extern SCM vlscm_scm_from_value (struct value *value); extern SCM vlscm_scm_from_value_no_release (struct value *value); -extern struct value *vlscm_convert_typed_value_from_scheme - (const char *func_name, int obj_arg_pos, SCM obj, - int type_arg_pos, SCM type_scm, struct type *type, SCM *except_scmp, - struct gdbarch *gdbarch, const struct language_defn *language); +extern struct value *vlscm_convert_typed_value_from_scheme ( + const char *func_name, int obj_arg_pos, SCM obj, int type_arg_pos, + SCM type_scm, struct type *type, SCM *except_scmp, struct gdbarch *gdbarch, + const struct language_defn *language); + +extern struct value *vlscm_convert_value_from_scheme ( + const char *func_name, int obj_arg_pos, SCM obj, SCM *except_scmp, + struct gdbarch *gdbarch, const struct language_defn *language); -extern struct value *vlscm_convert_value_from_scheme - (const char *func_name, int obj_arg_pos, SCM obj, SCM *except_scmp, - struct gdbarch *gdbarch, const struct language_defn *language); - /* stript_lang methods */ extern objfile_script_sourcer_func gdbscm_source_objfile_script; @@ -593,23 +601,23 @@ extern objfile_script_executor_func gdbscm_execute_objfile_script; extern bool gdbscm_auto_load_enabled (const struct extension_language_defn *); -extern void gdbscm_preserve_values - (const struct extension_language_defn *, - struct objfile *, htab_t copied_types); +extern void gdbscm_preserve_values (const struct extension_language_defn *, + struct objfile *, htab_t copied_types); -extern enum ext_lang_rc gdbscm_apply_val_pretty_printer - (const struct extension_language_defn *, - struct value *val, - struct ui_file *stream, int recurse, - const struct value_print_options *options, - const struct language_defn *language); +extern enum ext_lang_rc +gdbscm_apply_val_pretty_printer (const struct extension_language_defn *, + struct value *val, struct ui_file *stream, + int recurse, + const struct value_print_options *options, + const struct language_defn *language); extern int gdbscm_breakpoint_has_cond (const struct extension_language_defn *, struct breakpoint *b); -extern enum ext_lang_bp_stop gdbscm_breakpoint_cond_says_stop - (const struct extension_language_defn *, struct breakpoint *b); - +extern enum ext_lang_bp_stop +gdbscm_breakpoint_cond_says_stop (const struct extension_language_defn *, + struct breakpoint *b); + /* Initializers for each piece of Scheme support, in alphabetical order. */ extern void gdbscm_initialize_arches (void); @@ -634,7 +642,6 @@ extern void gdbscm_initialize_symbols (void); extern void gdbscm_initialize_symtabs (void); extern void gdbscm_initialize_types (void); extern void gdbscm_initialize_values (void); - /* A complication with the Guile code is that we have two types of exceptions to consider. GDB/C++ exceptions, and Guile/SJLJ @@ -675,14 +682,16 @@ unpack (const gdb_exception &exc) /* Use this after a TRY/CATCH to throw the appropriate Scheme exception if a GDB error occurred. */ -#define GDBSCM_HANDLE_GDB_EXCEPTION(exception) \ - do { \ - if (exception.reason < 0) \ - { \ - gdbscm_throw_gdb_exception (exception); \ - /*NOTREACHED */ \ - } \ - } while (0) +#define GDBSCM_HANDLE_GDB_EXCEPTION(exception) \ + do \ + { \ + if (exception.reason < 0) \ + { \ + gdbscm_throw_gdb_exception (exception); \ + /*NOTREACHED */ \ + } \ + } \ + while (0) /* Use this to wrap a callable to throw the appropriate Scheme exception if the callable throws a GDB error. ARGS are forwarded @@ -695,7 +704,7 @@ unpack (const gdb_exception &exc) template<typename Function, typename... Args> SCM -gdbscm_wrap (Function &&func, Args &&... args) +gdbscm_wrap (Function &&func, Args &&...args) { SCM result = SCM_BOOL_F; gdbscm_gdb_exception exc {}; |