GDB (xrefs)
guile-internal.h
Go to the documentation of this file.
1 /* Internal header for GDB/Scheme code.
2 
3  Copyright (C) 2014-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* See README file in this directory for implementation notes, coding
21  conventions, et.al. */
22 
23 #ifndef GDB_GUILE_INTERNAL_H
24 #define GDB_GUILE_INTERNAL_H
25 
26 #include "hashtab.h"
27 #include "extension-priv.h"
28 #include "symtab.h"
29 #include "libguile.h"
30 
31 struct block;
32 struct frame_info;
33 struct objfile;
34 struct symbol;
35 
36 /* A function to pass to the safe-call routines to ignore things like
37  memory errors. */
38 typedef int excp_matcher_func (SCM key);
39 
40 /* Scheme variables to define during initialization. */
41 
42 typedef struct
43 {
44  const char *name;
45  SCM value;
46  const char *doc_string;
48 
49 /* End of scheme_variable table mark. */
50 
51 #define END_VARIABLES { NULL, SCM_BOOL_F, NULL }
52 
53 /* Scheme functions to define during initialization. */
54 
55 typedef struct
56 {
57  const char *name;
58  int required;
59  int optional;
60  int rest;
61  scm_t_subr func;
62  const char *doc_string;
64 
65 /* End of scheme_function table mark. */
66 
67 #define END_FUNCTIONS { NULL, 0, 0, 0, NULL, NULL }
68 
69 /* Useful for defining a set of constants. */
70 
71 typedef struct
72 {
73  const char *name;
74  int value;
76 
77 #define END_INTEGER_CONSTANTS { NULL, 0 }
78 
79 /* Pass this instead of 0 to routines like SCM_ASSERT to indicate the value
80  is not a function argument. */
81 #define GDBSCM_ARG_NONE 0
82 
83 /* Ensure new code doesn't accidentally try to use this. */
84 #undef scm_make_smob_type
85 #define scm_make_smob_type USE_gdbscm_make_smob_type_INSTEAD
86 
87 /* They brought over () == #f from lisp.
88  Let's avoid that for now. */
89 #undef scm_is_bool
90 #undef scm_is_false
91 #undef scm_is_true
92 #define scm_is_bool USE_gdbscm_is_bool_INSTEAD
93 #define scm_is_false USE_gdbscm_is_false_INSTEAD
94 #define scm_is_true USE_gdbscm_is_true_INSTEAD
95 #define gdbscm_is_bool(scm) \
96  (scm_is_eq ((scm), SCM_BOOL_F) || scm_is_eq ((scm), SCM_BOOL_T))
97 #define gdbscm_is_false(scm) scm_is_eq ((scm), SCM_BOOL_F)
98 #define gdbscm_is_true(scm) (!gdbscm_is_false (scm))
99 
100 #ifndef HAVE_SCM_NEW_SMOB
101 
102 /* Guile <= 2.0.5 did not provide this function, so provide it here. */
103 
104 static inline SCM
105 scm_new_smob (scm_t_bits tc, scm_t_bits data)
106 {
107  SCM_RETURN_NEWSMOB (tc, data);
108 }
109 
110 #endif
111 
112 /* Function name that is passed around in case an error needs to be reported.
113  __func is in C99, but we provide a wrapper "just in case",
114  and because FUNC_NAME is the canonical value used in guile sources.
115  IWBN to use the Scheme version of the name (e.g. foo-bar vs foo_bar),
116  but let's KISS for now. */
117 #define FUNC_NAME __func__
118 
119 extern const char gdbscm_module_name[];
120 extern const char gdbscm_init_module_name[];
121 
122 extern int gdb_scheme_initialized;
123 
124 extern int gdbscm_guile_major_version;
125 extern int gdbscm_guile_minor_version;
126 extern int gdbscm_guile_micro_version;
127 
128 extern const char gdbscm_print_excp_none[];
129 extern const char gdbscm_print_excp_full[];
130 extern const char gdbscm_print_excp_message[];
131 extern const char *gdbscm_print_excp;
132 
133 extern SCM gdbscm_documentation_symbol;
135 
136 extern SCM gdbscm_map_string;
137 extern SCM gdbscm_array_string;
138 extern SCM gdbscm_string_string;
139 
140 /* scm-utils.c */
141 
142 extern void gdbscm_define_variables (const scheme_variable *, int is_public);
143 
144 extern void gdbscm_define_functions (const scheme_function *, int is_public);
145 
147  int is_public);
148 
149 extern void gdbscm_printf (SCM port, const char *format, ...)
150  ATTRIBUTE_PRINTF (2, 3);
151 
152 extern void gdbscm_debug_display (SCM obj);
153 
154 extern void gdbscm_debug_write (SCM obj);
155 
156 extern void gdbscm_parse_function_args (const char *function_name,
157  int beginning_arg_pos,
158  const SCM *keywords,
159  const char *format, ...);
160 
161 extern SCM gdbscm_scm_from_longest (LONGEST l);
162 
163 extern LONGEST gdbscm_scm_to_longest (SCM l);
164 
165 extern SCM gdbscm_scm_from_ulongest (ULONGEST l);
166 
167 extern ULONGEST gdbscm_scm_to_ulongest (SCM u);
168 
169 extern void gdbscm_dynwind_xfree (void *ptr);
170 
171 extern int gdbscm_is_procedure (SCM proc);
172 
173 extern char *gdbscm_gc_xstrdup (const char *);
174 
175 extern const char * const *gdbscm_gc_dup_argv (char **argv);
176 
177 extern int gdbscm_guile_version_is_at_least (int major, int minor, int micro);
178 
179 /* GDB smobs, from scm-gsmob.c */
180 
181 /* All gdb smobs must contain one of the following as the first member:
182  gdb_smob, chained_gdb_smob, or eqable_gdb_smob.
183 
184  Chained GDB smobs should have chained_gdb_smob as their first member. The
185  next,prev members of chained_gdb_smob allow for chaining gsmobs together so
186  that, for example, when an objfile is deleted we can clean up all smobs that
187  reference it.
188 
189  Eq-able GDB smobs should have eqable_gdb_smob as their first member. The
190  containing_scm member of eqable_gdb_smob allows for returning the same gsmob
191  instead of creating a new one, allowing them to be eq?-able.
192 
193  All other smobs should have gdb_smob as their first member.
194  FIXME: dje/2014-05-26: gdb_smob was useful during early development as a
195  "baseclass" for all gdb smobs. If it's still unused by gdb 8.0 delete it.
196 
197  IMPORTANT: chained_gdb_smob and eqable_gdb-smob are "subclasses" of
198  gdb_smob. The layout of chained_gdb_smob,eqable_gdb_smob must match
199  gdb_smob as if it is a subclass. To that end we use macro GDB_SMOB_HEAD
200  to ensure this. */
201 
202 #define GDB_SMOB_HEAD \
203  int empty_base_class;
204 
205 typedef struct
206 {
208 } gdb_smob;
209 
210 typedef struct _chained_gdb_smob
211 {
213 
217 
218 typedef struct _eqable_gdb_smob
219 {
221 
222  /* The object we are contained in.
223  This can be used for several purposes.
224  This is used by the eq? machinery: We need to be able to see if we have
225  already created an object for a symbol, and if so use that SCM.
226  This may also be used to protect the smob from GC if there is
227  a reference to this smob from outside of GC space (i.e., from gdb).
228  This can also be used in place of chained_gdb_smob where we need to
229  keep track of objfile referencing objects. When the objfile is deleted
230  we need to invalidate the objects: we can do that using the same hashtab
231  used to record the smob for eq-ability. */
234 
235 #undef GDB_SMOB_HEAD
236 
237 struct objfile;
238 struct objfile_data;
239 
240 /* A predicate that returns non-zero if an object is a particular kind
241  of gsmob. */
242 typedef int (gsmob_pred_func) (SCM);
243 
244 extern scm_t_bits gdbscm_make_smob_type (const char *name, size_t size);
245 
246 extern void gdbscm_init_gsmob (gdb_smob *base);
247 
248 extern void gdbscm_init_chained_gsmob (chained_gdb_smob *base);
249 
250 extern void gdbscm_init_eqable_gsmob (eqable_gdb_smob *base,
251  SCM containing_scm);
252 
253 extern void gdbscm_add_objfile_ref (struct objfile *objfile,
254  const struct objfile_data *data_key,
255  chained_gdb_smob *g_smob);
256 
257 extern void gdbscm_remove_objfile_ref (struct objfile *objfile,
258  const struct objfile_data *data_key,
259  chained_gdb_smob *g_smob);
260 
261 extern htab_t gdbscm_create_eqable_gsmob_ptr_map (htab_hash hash_fn,
262  htab_eq eq_fn);
263 
265  (htab_t htab, eqable_gdb_smob *base);
266 
268  eqable_gdb_smob *base);
269 
270 extern void gdbscm_clear_eqable_gsmob_ptr_slot (htab_t htab,
271  eqable_gdb_smob *base);
272 
273 /* Exceptions and calling out to Guile. */
274 
275 /* scm-exception.c */
276 
277 extern SCM gdbscm_make_exception (SCM tag, SCM args);
278 
279 extern int gdbscm_is_exception (SCM scm);
280 
281 extern SCM gdbscm_exception_key (SCM excp);
282 
283 extern SCM gdbscm_exception_args (SCM excp);
284 
285 extern SCM gdbscm_make_exception_with_stack (SCM key, SCM args, SCM stack);
286 
287 extern SCM gdbscm_make_error_scm (SCM key, SCM subr, SCM message,
288  SCM args, SCM data);
289 
290 extern SCM gdbscm_make_error (SCM key, const char *subr, const char *message,
291  SCM args, SCM data);
292 
293 extern SCM gdbscm_make_type_error (const char *subr, int arg_pos,
294  SCM bad_value, const char *expected_type);
295 
296 extern SCM gdbscm_make_invalid_object_error (const char *subr, int arg_pos,
297  SCM bad_value, const char *error);
298 
299 extern void gdbscm_invalid_object_error (const char *subr, int arg_pos,
300  SCM bad_value, const char *error)
301  ATTRIBUTE_NORETURN;
302 
303 extern SCM gdbscm_make_out_of_range_error (const char *subr, int arg_pos,
304  SCM bad_value, const char *error);
305 
306 extern void gdbscm_out_of_range_error (const char *subr, int arg_pos,
307  SCM bad_value, const char *error)
308  ATTRIBUTE_NORETURN;
309 
310 extern SCM gdbscm_make_misc_error (const char *subr, int arg_pos,
311  SCM bad_value, const char *error);
312 
313 extern void gdbscm_misc_error (const char *subr, int arg_pos,
314  SCM bad_value, const char *error)
315  ATTRIBUTE_NORETURN;
316 
317 extern void gdbscm_throw (SCM exception) ATTRIBUTE_NORETURN;
318 
319 extern SCM gdbscm_scm_from_gdb_exception (struct gdb_exception exception);
320 
321 extern void gdbscm_throw_gdb_exception (struct gdb_exception exception)
322  ATTRIBUTE_NORETURN;
323 
324 extern void gdbscm_print_exception_with_stack (SCM port, SCM stack,
325  SCM key, SCM args);
326 
327 extern void gdbscm_print_gdb_exception (SCM port, SCM exception);
328 
329 extern char *gdbscm_exception_message_to_string (SCM exception);
330 
332 
334 
335 extern SCM gdbscm_make_memory_error (const char *subr, const char *msg,
336  SCM args);
337 
338 extern void gdbscm_memory_error (const char *subr, const char *msg, SCM args)
339  ATTRIBUTE_NORETURN;
340 
341 /* scm-safe-call.c */
342 
343 extern void *gdbscm_with_guile (void *(*func) (void *), void *data);
344 
345 extern SCM gdbscm_call_guile (SCM (*func) (void *), void *data,
346  excp_matcher_func *ok_excps);
347 
348 extern SCM gdbscm_safe_call_0 (SCM proc, excp_matcher_func *ok_excps);
349 
350 extern SCM gdbscm_safe_call_1 (SCM proc, SCM arg0,
351  excp_matcher_func *ok_excps);
352 
353 extern SCM gdbscm_safe_call_2 (SCM proc, SCM arg0, SCM arg1,
354  excp_matcher_func *ok_excps);
355 
356 extern SCM gdbscm_safe_call_3 (SCM proc, SCM arg0, SCM arg1, SCM arg2,
357  excp_matcher_func *ok_excps);
358 
359 extern SCM gdbscm_safe_call_4 (SCM proc, SCM arg0, SCM arg1, SCM arg2,
360  SCM arg3,
361  excp_matcher_func *ok_excps);
362 
363 extern SCM gdbscm_safe_apply_1 (SCM proc, SCM arg0, SCM args,
364  excp_matcher_func *ok_excps);
365 
366 extern SCM gdbscm_unsafe_call_1 (SCM proc, SCM arg0);
367 
368 extern char *gdbscm_safe_eval_string (const char *string, int display_result);
369 
370 extern char *gdbscm_safe_source_script (const char *filename);
371 
372 extern void gdbscm_enter_repl (void);
373 
374 /* Interface to various GDB objects, in alphabetical order. */
375 
376 /* scm-arch.c */
377 
378 typedef struct _arch_smob arch_smob;
379 
380 extern struct gdbarch *arscm_get_gdbarch (arch_smob *a_smob);
381 
382 extern arch_smob *arscm_get_arch_smob_arg_unsafe (SCM arch_scm, int arg_pos,
383  const char *func_name);
384 
385 extern SCM arscm_scm_from_arch (struct gdbarch *gdbarch);
386 
387 /* scm-block.c */
388 
389 extern SCM bkscm_scm_from_block (const struct block *block,
390  struct objfile *objfile);
391 
392 extern const struct block *bkscm_scm_to_block
393  (SCM block_scm, int arg_pos, const char *func_name, SCM *excp);
394 
395 /* scm-cmd.c */
396 
397 extern char *gdbscm_parse_command_name (const char *name,
398  const char *func_name, int arg_pos,
399  struct cmd_list_element ***base_list,
400  struct cmd_list_element **start_list);
401 
403 
404 extern char *gdbscm_canonicalize_command_name (const char *name,
405  int want_trailing_space);
406 
407 /* scm-frame.c */
408 
409 typedef struct _frame_smob frame_smob;
410 
411 extern int frscm_is_frame (SCM scm);
412 
413 extern frame_smob *frscm_get_frame_smob_arg_unsafe (SCM frame_scm, int arg_pos,
414  const char *func_name);
415 
417 
418 /* scm-iterator.c */
419 
421 
422 extern SCM itscm_iterator_smob_object (iterator_smob *i_smob);
423 
424 extern SCM itscm_iterator_smob_progress (iterator_smob *i_smob);
425 
427  SCM progress);
428 
429 extern const char *itscm_iterator_smob_name (void);
430 
431 extern SCM gdbscm_make_iterator (SCM object, SCM progress, SCM next);
432 
433 extern int itscm_is_iterator (SCM scm);
434 
435 extern SCM gdbscm_end_of_iteration (void);
436 
437 extern int itscm_is_end_of_iteration (SCM obj);
438 
439 extern SCM itscm_safe_call_next_x (SCM iter, excp_matcher_func *ok_excps);
440 
441 extern SCM itscm_get_iterator_arg_unsafe (SCM self, int arg_pos,
442  const char *func_name);
443 
444 /* scm-lazy-string.c */
445 
446 extern int lsscm_is_lazy_string (SCM scm);
447 
448 extern SCM lsscm_make_lazy_string (CORE_ADDR address, int length,
449  const char *encoding, struct type *type);
450 
451 extern struct value *lsscm_safe_lazy_string_to_value (SCM string,
452  int arg_pos,
453  const char *func_name,
454  SCM *except_scmp);
455 
456 extern void lsscm_val_print_lazy_string
457  (SCM string, struct ui_file *stream,
458  const struct value_print_options *options);
459 
460 /* scm-objfile.c */
461 
463 
465 
466 extern objfile_smob *ofscm_objfile_smob_from_objfile (struct objfile *objfile);
467 
468 extern SCM ofscm_scm_from_objfile (struct objfile *objfile);
469 
470 /* scm-progspace.c */
471 
472 typedef struct _pspace_smob pspace_smob;
473 
475 
477 
478 extern SCM psscm_scm_from_pspace (struct program_space *);
479 
480 /* scm-string.c */
481 
482 extern int gdbscm_scm_string_to_int (SCM string);
483 
484 extern char *gdbscm_scm_to_c_string (SCM string);
485 
486 extern SCM gdbscm_scm_from_c_string (const char *string);
487 
488 extern SCM gdbscm_scm_from_printf (const char *format, ...)
489  ATTRIBUTE_PRINTF (1, 2);
490 
491 extern char *gdbscm_scm_to_string (SCM string, size_t *lenp,
492  const char *charset,
493  int strict, SCM *except_scmp);
494 
495 extern SCM gdbscm_scm_from_string (const char *string, size_t len,
496  const char *charset, int strict);
497 
498 extern char *gdbscm_scm_to_host_string (SCM string, size_t *lenp, SCM *except);
499 
500 extern SCM gdbscm_scm_from_host_string (const char *string, size_t len);
501 
502 /* scm-symbol.c */
503 
504 extern int syscm_is_symbol (SCM scm);
505 
506 extern SCM syscm_scm_from_symbol (struct symbol *symbol);
507 
508 extern struct symbol *syscm_get_valid_symbol_arg_unsafe
509  (SCM self, int arg_pos, const char *func_name);
510 
511 /* scm-symtab.c */
512 
513 extern SCM stscm_scm_from_symtab (struct symtab *symtab);
514 
515 extern SCM stscm_scm_from_sal (struct symtab_and_line sal);
516 
517 /* scm-type.c */
518 
519 typedef struct _type_smob type_smob;
520 
521 extern int tyscm_is_type (SCM scm);
522 
523 extern SCM tyscm_scm_from_type (struct type *type);
524 
525 extern type_smob *tyscm_get_type_smob_arg_unsafe (SCM type_scm, int arg_pos,
526  const char *func_name);
527 
528 extern struct type *tyscm_type_smob_type (type_smob *t_smob);
529 
530 extern SCM tyscm_scm_from_field (SCM type_scm, int field_num);
531 
532 /* scm-value.c */
533 
534 extern struct value *vlscm_scm_to_value (SCM scm);
535 
536 extern int vlscm_is_value (SCM scm);
537 
538 extern SCM vlscm_scm_from_value (struct value *value);
539 
540 extern SCM vlscm_scm_from_value_unsafe (struct value *value);
541 
542 extern struct value *vlscm_convert_typed_value_from_scheme
543  (const char *func_name, int obj_arg_pos, SCM obj,
544  int type_arg_pos, SCM type_scm, struct type *type, SCM *except_scmp,
545  struct gdbarch *gdbarch, const struct language_defn *language);
546 
547 extern struct value *vlscm_convert_value_from_scheme
548  (const char *func_name, int obj_arg_pos, SCM obj, SCM *except_scmp,
549  struct gdbarch *gdbarch, const struct language_defn *language);
550 
551 /* stript_lang methods */
552 
553 extern objfile_script_sourcer_func gdbscm_source_objfile_script;
554 extern objfile_script_executor_func gdbscm_execute_objfile_script;
555 
556 extern int gdbscm_auto_load_enabled (const struct extension_language_defn *);
557 
558 extern void gdbscm_preserve_values
559  (const struct extension_language_defn *,
560  struct objfile *, htab_t copied_types);
561 
563  (const struct extension_language_defn *,
564  struct type *type, const gdb_byte *valaddr,
565  int embedded_offset, CORE_ADDR address,
566  struct ui_file *stream, int recurse,
567  const struct value *val,
568  const struct value_print_options *options,
569  const struct language_defn *language);
570 
571 extern int gdbscm_breakpoint_has_cond (const struct extension_language_defn *,
572  struct breakpoint *b);
573 
575  (const struct extension_language_defn *, struct breakpoint *b);
576 
577 /* Initializers for each piece of Scheme support, in alphabetical order. */
578 
579 extern void gdbscm_initialize_arches (void);
580 extern void gdbscm_initialize_auto_load (void);
581 extern void gdbscm_initialize_blocks (void);
582 extern void gdbscm_initialize_breakpoints (void);
583 extern void gdbscm_initialize_commands (void);
584 extern void gdbscm_initialize_disasm (void);
585 extern void gdbscm_initialize_exceptions (void);
586 extern void gdbscm_initialize_frames (void);
587 extern void gdbscm_initialize_iterators (void);
588 extern void gdbscm_initialize_lazy_strings (void);
589 extern void gdbscm_initialize_math (void);
590 extern void gdbscm_initialize_objfiles (void);
591 extern void gdbscm_initialize_pretty_printers (void);
592 extern void gdbscm_initialize_parameters (void);
593 extern void gdbscm_initialize_ports (void);
594 extern void gdbscm_initialize_pspaces (void);
595 extern void gdbscm_initialize_smobs (void);
596 extern void gdbscm_initialize_strings (void);
597 extern void gdbscm_initialize_symbols (void);
598 extern void gdbscm_initialize_symtabs (void);
599 extern void gdbscm_initialize_types (void);
600 extern void gdbscm_initialize_values (void);
601 
602 /* Use these after a TRY_CATCH to throw the appropriate Scheme exception
603  if a GDB error occurred. */
604 
605 #define GDBSCM_HANDLE_GDB_EXCEPTION(exception) \
606  do { \
607  if (exception.reason < 0) \
608  { \
609  gdbscm_throw_gdb_exception (exception); \
610  /*NOTREACHED */ \
611  } \
612  } while (0)
613 
614 /* If cleanups are establish outside the TRY_CATCH block, use this version. */
615 
616 #define GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS(exception, cleanups) \
617  do { \
618  if (exception.reason < 0) \
619  { \
620  do_cleanups (cleanups); \
621  gdbscm_throw_gdb_exception (exception); \
622  /*NOTREACHED */ \
623  } \
624  } while (0)
625 
626 #endif /* GDB_GUILE_INTERNAL_H */
arch_smob * arscm_get_arch_smob_arg_unsafe(SCM arch_scm, int arg_pos, const char *func_name)
Definition: scm-arch.c:151
void gdbscm_initialize_exceptions(void)
char * gdbscm_canonicalize_command_name(const char *name, int want_trailing_space)
Definition: scm-cmd.c:601
struct frame_info * frscm_frame_smob_to_frame(frame_smob *)
Definition: scm-frame.c:347
SCM stscm_scm_from_sal(struct symtab_and_line sal)
Definition: scm-symtab.c:448
const char * gdbscm_print_excp
Definition: guile.c:70
GDB_SMOB_HEAD SCM containing_scm
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
int gdbscm_guile_major_version
Definition: guile.c:45
SCM gdbscm_make_memory_error(const char *subr, const char *msg, SCM args)
SCM gdbscm_make_iterator(SCM object, SCM progress, SCM next)
Definition: scm-iterator.c:157
void gdbscm_memory_error(const char *subr, const char *msg, SCM args) ATTRIBUTE_NORETURN
const char *const * gdbscm_gc_dup_argv(char **argv)
Definition: scm-utils.c:599
const char gdbscm_print_excp_none[]
Definition: guile.c:53
void gdbscm_define_functions(const scheme_function *, int is_public)
Definition: scm-utils.c:44
bfd_vma CORE_ADDR
Definition: common-types.h:41
void gdbscm_initialize_frames(void)
Definition: scm-frame.c:1162
ext_lang_bp_stop
Definition: extension.h:129
SCM gdbscm_scm_from_ulongest(ULONGEST l)
Definition: scm-utils.c:552
SCM tyscm_scm_from_field(SCM type_scm, int field_num)
Definition: scm-type.c:466
ext_lang_rc
const char * name
SCM tyscm_scm_from_type(struct type *type)
Definition: scm-type.c:303
void(* func)(char *)
char * gdbscm_scm_to_host_string(SCM string, size_t *lenp, SCM *except)
Definition: scm-string.c:221
SCM gdbscm_safe_call_3(SCM proc, SCM arg0, SCM arg1, SCM arg2, excp_matcher_func *ok_excps)
SCM syscm_scm_from_symbol(struct symbol *symbol)
Definition: scm-symbol.c:206
struct type ** const(pascal_builtin_types[])
void gdbscm_initialize_values(void)
Definition: scm-value.c:1578
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)
Definition: scm-math.c:893
struct type * tyscm_type_smob_type(type_smob *t_smob)
Definition: scm-type.c:97
char * gdbscm_scm_to_c_string(SCM string)
Definition: scm-string.c:55
void objfile_script_executor_func(const struct extension_language_defn *, struct objfile *, const char *name, const char *script)
Definition: extension.h:54
const char * doc_string
SCM stscm_scm_from_symtab(struct symtab *symtab)
Definition: scm-symtab.c:200
int vlscm_is_value(SCM scm)
Definition: scm-value.c:240
SCM gdbscm_scm_from_longest(LONGEST l)
Definition: scm-utils.c:533
void gdbscm_init_chained_gsmob(chained_gdb_smob *base)
Definition: scm-gsmob.c:123
SCM gdbscm_make_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
Definition: scm-gsmob.c:102
struct gdbarch * arscm_get_gdbarch(arch_smob *a_smob)
Definition: scm-arch.c:88
struct value * lsscm_safe_lazy_string_to_value(SCM string, int arg_pos, const char *func_name, SCM *except_scmp)
SCM vlscm_scm_from_value(struct value *value)
Definition: scm-value.c:258
char * gdbscm_safe_source_script(const char *filename)
struct _chained_gdb_smob chained_gdb_smob
int gdbscm_is_exception(SCM scm)
SCM gdbscm_make_type_error(const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
SCM gdbscm_exception_args(SCM excp)
SCM gdbscm_string_string
#define GDB_SMOB_HEAD
char * gdbscm_parse_command_name(const char *name, const char *func_name, int arg_pos, struct cmd_list_element ***base_list, struct cmd_list_element **start_list)
Definition: scm-cmd.c:480
int gdbscm_guile_minor_version
Definition: guile.c:46
int excp_matcher_func(SCM key)
SCM lsscm_make_lazy_string(CORE_ADDR address, int length, const char *encoding, struct type *type)
void gdbscm_initialize_iterators(void)
Definition: scm-iterator.c:349
int gdbscm_guile_version_is_at_least(int major, int minor, int micro)
Definition: scm-utils.c:629
void gdbscm_dynwind_xfree(void *ptr)
Definition: scm-utils.c:571
void gdbscm_initialize_pspaces(void)
SCM gdbscm_scm_from_string(const char *string, size_t len, const char *charset, int strict)
Definition: scm-string.c:180
SCM gdbscm_invalid_object_error_symbol
Definition: scm-exception.c:77
const char *const name
Definition: aarch64-tdep.c:68
scm_t_subr func
int gdbscm_auto_load_enabled(const struct extension_language_defn *)
Definition: scm-auto-load.c:48
void gdbscm_init_gsmob(gdb_smob *base)
Definition: scm-gsmob.c:113
void gdbscm_initialize_smobs(void)
Definition: scm-gsmob.c:286
SCM itscm_get_iterator_arg_unsafe(SCM self, int arg_pos, const char *func_name)
Definition: scm-iterator.c:231
char * gdbscm_exception_message_to_string(SCM exception)
void gdbscm_initialize_objfiles(void)
Definition: scm-objfile.c:429
objfile_smob * ofscm_objfile_smob_from_objfile(struct objfile *objfile)
Definition: scm-objfile.c:147
SCM psscm_scm_from_pspace(struct program_space *)
void objfile_script_sourcer_func(const struct extension_language_defn *, struct objfile *, FILE *stream, const char *filename)
Definition: extension.h:48
SCM gdbscm_make_exception(SCM tag, SCM args)
SCM bkscm_scm_from_block(const struct block *block, struct objfile *objfile)
Definition: scm-block.c:210
SCM itscm_iterator_smob_object(iterator_smob *i_smob)
Definition: scm-iterator.c:94
SCM gdbscm_safe_apply_1(SCM proc, SCM arg0, SCM args, excp_matcher_func *ok_excps)
struct _chained_gdb_smob * next
SCM gdbscm_scm_from_c_string(const char *string)
Definition: scm-string.c:44
SCM gdbscm_exception_key(SCM excp)
excp_matcher_func gdbscm_memory_error_p
SCM gdbscm_scm_from_host_string(const char *string, size_t len)
Definition: scm-string.c:231
SCM gdbscm_scm_from_gdb_exception(struct gdb_exception exception)
void gdbscm_initialize_pretty_printers(void)
excp_matcher_func gdbscm_user_error_p
SCM gdbscm_make_error_scm(SCM key, SCM subr, SCM message, SCM args, SCM data)
void itscm_set_iterator_smob_progress_x(iterator_smob *i_smob, SCM progress)
Definition: scm-iterator.c:106
SCM vlscm_scm_from_value_unsafe(struct value *value)
SCM gdbscm_safe_call_2(SCM proc, SCM arg0, SCM arg1, excp_matcher_func *ok_excps)
int syscm_is_symbol(SCM scm)
Definition: scm-symbol.c:189
void gdbscm_initialize_auto_load(void)
Definition: scm-auto-load.c:62
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
GDB_SMOB_HEAD struct _chained_gdb_smob * prev
SCM ofscm_objfile_smob_pretty_printers(objfile_smob *o_smob)
Definition: scm-objfile.c:58
void gdbscm_initialize_breakpoints(void)
void gdbscm_initialize_commands(void)
Definition: scm-cmd.c:868
void lsscm_val_print_lazy_string(SCM string, struct ui_file *stream, const struct value_print_options *options)
int lsscm_is_lazy_string(SCM scm)
SCM gdbscm_array_string
void gdbscm_define_variables(const scheme_variable *, int is_public)
Definition: scm-utils.c:29
void gdbscm_clear_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
Definition: scm-gsmob.c:263
int gdbscm_scm_string_to_int(SCM string)
Definition: scm-string.c:31
ULONGEST gdbscm_scm_to_ulongest(SCM u)
Definition: scm-utils.c:563
static char encoding[]
Definition: remote-mips.c:2988
SCM gdbscm_call_guile(SCM(*func)(void *), void *data, excp_matcher_func *ok_excps)
struct _eqable_gdb_smob eqable_gdb_smob
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
void gdbscm_initialize_symtabs(void)
Definition: scm-symtab.c:681
enum ext_lang_bp_stop gdbscm_breakpoint_cond_says_stop(const struct extension_language_defn *, struct breakpoint *b)
Definition: block.h:60
enum ext_lang_rc gdbscm_apply_val_pretty_printer(const struct extension_language_defn *, struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, const struct language_defn *language)
void void gdbscm_debug_display(SCM obj)
Definition: scm-utils.c:94
htab_t gdbscm_create_eqable_gsmob_ptr_map(htab_hash hash_fn, htab_eq eq_fn)
Definition: scm-gsmob.c:225
void gdbscm_initialize_math(void)
Definition: scm-math.c:1008
int itscm_is_end_of_iteration(SCM obj)
Definition: scm-iterator.c:197
SCM gdbscm_end_of_iteration(void)
Definition: scm-iterator.c:189
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
Definition: scm-gsmob.c:135
char * gdbscm_safe_eval_string(const char *string, int display_result)
SCM gdbscm_safe_call_1(SCM proc, SCM arg0, excp_matcher_func *ok_excps)
const char const char int
Definition: command.h:229
bfd_byte gdb_byte
Definition: common-types.h:38
void gdbscm_define_integer_constants(const scheme_integer_constant *, int is_public)
Definition: scm-utils.c:63
void gdbscm_remove_objfile_ref(struct objfile *objfile, const struct objfile_data *data_key, chained_gdb_smob *g_smob)
Definition: scm-gsmob.c:209
const struct block * bkscm_scm_to_block(SCM block_scm, int arg_pos, const char *func_name, SCM *excp)
Definition: scm-block.c:317
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void gdbscm_initialize_arches(void)
Definition: scm-arch.c:647
SCM gdbscm_safe_call_4(SCM proc, SCM arg0, SCM arg1, SCM arg2, SCM arg3, excp_matcher_func *ok_excps)
void gdbscm_enter_repl(void)
void gdbscm_initialize_symbols(void)
Definition: scm-symbol.c:802
command_class
Definition: command.h:33
const char gdbscm_print_excp_message[]
Definition: guile.c:55
eqable_gdb_smob ** gdbscm_find_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
Definition: scm-gsmob.c:238
LONGEST gdbscm_scm_to_longest(SCM l)
Definition: scm-utils.c:544
void gdbscm_preserve_values(const struct extension_language_defn *, struct objfile *, htab_t copied_types)
Definition: scm-value.c:87
SCM gdbscm_unsafe_call_1(SCM proc, SCM arg0)
void gdbscm_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void gdbscm_print_gdb_exception(SCM port, SCM exception)
SCM gdbscm_make_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
SCM gdbscm_make_exception_with_stack(SCM key, SCM args, SCM stack)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
SCM gdbscm_safe_call_0(SCM proc, excp_matcher_func *ok_excps)
frame_smob * frscm_get_frame_smob_arg_unsafe(SCM frame_scm, int arg_pos, const char *func_name)
Definition: scm-frame.c:324
void gdbscm_throw_gdb_exception(struct gdb_exception exception) ATTRIBUTE_NORETURN
SCM psscm_pspace_smob_pretty_printers(const pspace_smob *)
Definition: scm-progspace.c:61
const char * name
SCM gdbscm_documentation_symbol
SCM itscm_iterator_smob_progress(iterator_smob *i_smob)
Definition: scm-iterator.c:100
type_smob * tyscm_get_type_smob_arg_unsafe(SCM type_scm, int arg_pos, const char *func_name)
Definition: scm-type.c:342
void gdbscm_print_exception_with_stack(SCM port, SCM stack, SCM key, SCM args)
void * gdbscm_with_guile(void *(*func)(void *), void *data)
void gdbscm_initialize_lazy_strings(void)
const char gdbscm_module_name[]
void gdbscm_add_objfile_ref(struct objfile *objfile, const struct objfile_data *data_key, chained_gdb_smob *g_smob)
Definition: scm-gsmob.c:189
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
Definition: scm-utils.c:377
struct symbol * syscm_get_valid_symbol_arg_unsafe(SCM self, int arg_pos, const char *func_name)
Definition: scm-symbol.c:284
void gdbscm_fill_eqable_gsmob_ptr_slot(eqable_gdb_smob **slot, eqable_gdb_smob *base)
Definition: scm-gsmob.c:249
SCM gdbscm_make_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
void gdbscm_initialize_blocks(void)
Definition: scm-block.c:777
int gdbscm_breakpoint_has_cond(const struct extension_language_defn *, struct breakpoint *b)
void gdbscm_debug_write(SCM obj)
Definition: scm-utils.c:106
const char * doc_string
unsigned long long ULONGEST
Definition: common-types.h:53
SCM gdbscm_make_error(SCM key, const char *subr, const char *message, SCM args, SCM data)
void gdbscm_initialize_parameters(void)
Definition: scm-param.c:1176
static void ATTRIBUTE_PRINTF(6, 0)
Definition: cli-out.c:229
const char * itscm_iterator_smob_name(void)
Definition: scm-iterator.c:88
SCM itscm_safe_call_next_x(SCM iter, excp_matcher_func *ok_excps)
Definition: scm-iterator.c:215
SCM gdbscm_scm_from_printf(const char *format,...) ATTRIBUTE_PRINTF(1
void gdbscm_initialize_strings(void)
Definition: scm-string.c:280
void gdbscm_initialize_types(void)
Definition: scm-type.c:1490
int gdb_scheme_initialized
SCM gdbscm_map_string
int itscm_is_iterator(SCM scm)
Definition: scm-iterator.c:172
struct value * vlscm_scm_to_value(SCM scm)
Definition: scm-value.c:300
SCM ofscm_scm_from_objfile(struct objfile *objfile)
Definition: scm-objfile.c:169
int tyscm_is_type(SCM scm)
Definition: scm-type.c:286
const char gdbscm_init_module_name[]
pspace_smob * psscm_pspace_smob_from_pspace(struct program_space *)
const char gdbscm_print_excp_full[]
Definition: guile.c:54
int frscm_is_frame(SCM scm)
Definition: scm-frame.c:201
int gdbscm_is_procedure(SCM proc)
Definition: scm-utils.c:579
int gdbscm_valid_command_class_p(int command_class)
Definition: scm-cmd.c:579
SCM char * gdbscm_scm_to_string(SCM string, size_t *lenp, const char *charset, int strict, SCM *except_scmp)
Definition: scm-string.c:120
void error(const char *fmt,...)
Definition: errors.c:38
size_t size
Definition: go32-nat.c:242
SCM arscm_scm_from_arch(struct gdbarch *gdbarch)
Definition: scm-arch.c:128
int gdbscm_guile_micro_version
Definition: guile.c:47
int( gsmob_pred_func)(SCM)
long long LONGEST
Definition: common-types.h:52
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)
Definition: scm-math.c:747
char * gdbscm_gc_xstrdup(const char *)
Definition: scm-utils.c:587
void gdbscm_initialize_ports(void)
Definition: scm-ports.c:1388
void gdbscm_initialize_disasm(void)
Definition: scm-disasm.c:346