GDB (xrefs)
Loading...
Searching...
No Matches
scm-block.c
Go to the documentation of this file.
1/* Scheme interface to blocks.
2
3 Copyright (C) 2008-2023 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#include "defs.h"
24#include "block.h"
25#include "dictionary.h"
26#include "objfiles.h"
27#include "source.h"
28#include "symtab.h"
29#include "guile-internal.h"
30
31/* A smob describing a gdb block. */
32
34{
35 /* This always appears first.
36 We want blocks to be eq?-able. And we need to be able to invalidate
37 blocks when the associated objfile is deleted. */
39
40 /* The GDB block structure that represents a frame's code block. */
41 const struct block *block;
42
43 /* The backing object file. There is no direct relationship in GDB
44 between a block and an object file. When a block is created also
45 store a pointer to the object file for later use. */
47};
48
49/* To iterate over block symbols from Scheme we need to store
50 struct block_iterator somewhere. This is stored in the "progress" field
51 of <gdb:iterator>. We store the block object in iterator_smob.object,
52 so we don't store it here.
53
54 Remember: While iterating over block symbols, you must continually check
55 whether the block is still valid. */
56
58{
59 /* This always appears first. */
61
62 /* The iterator for that block. */
64
65 /* Has the iterator been initialized flag. */
67};
68
69static const char block_smob_name[] = "gdb:block";
70static const char block_syms_progress_smob_name[] = "gdb:block-symbols-iterator";
71
72/* The tag Guile knows the block smobs by. */
73static scm_t_bits block_smob_tag;
75
76/* The "next!" block syms iterator method. */
78
79/* This is called when an objfile is about to be freed.
80 Invalidate the block as further actions on the block would result
81 in bad data. All access to b_smob->block should be gated by
82 checks to ensure the block is (still) valid. */
84{
85 /* Helper function for bkscm_del_objfile_blocks to mark the block
86 as invalid. */
87
88 static int
89 bkscm_mark_block_invalid (void **slot, void *info)
90 {
91 block_smob *b_smob = (block_smob *) *slot;
92
93 b_smob->block = NULL;
94 b_smob->objfile = NULL;
95 return 1;
96 }
97
98 void operator() (htab_t htab)
99 {
100 gdb_assert (htab != nullptr);
101 htab_traverse_noresize (htab, bkscm_mark_block_invalid, NULL);
102 htab_delete (htab);
103 }
104};
105
106static const registry<objfile>::key<htab, bkscm_deleter>
108
109/* Administrivia for block smobs. */
110
111/* Helper function to hash a block_smob. */
112
113static hashval_t
115{
116 const block_smob *b_smob = (const block_smob *) p;
117
118 return htab_hash_pointer (b_smob->block);
119}
120
121/* Helper function to compute equality of block_smobs. */
122
123static int
124bkscm_eq_block_smob (const void *ap, const void *bp)
125{
126 const block_smob *a = (const block_smob *) ap;
127 const block_smob *b = (const block_smob *) bp;
128
129 return (a->block == b->block
130 && a->block != NULL);
131}
132
133/* Return the struct block pointer -> SCM mapping table.
134 It is created if necessary. */
135
136static htab_t
138{
139 htab_t htab = bkscm_objfile_data_key.get (objfile);
140
141 if (htab == NULL)
142 {
146 }
147
148 return htab;
149}
150
151/* The smob "free" function for <gdb:block>. */
152
153static size_t
155{
156 block_smob *b_smob = (block_smob *) SCM_SMOB_DATA (self);
157
158 if (b_smob->block != NULL)
159 {
160 htab_t htab = bkscm_objfile_block_map (b_smob->objfile);
161
163 }
164
165 /* Not necessary, done to catch bugs. */
166 b_smob->block = NULL;
167 b_smob->objfile = NULL;
168
169 return 0;
170}
171
172/* The smob "print" function for <gdb:block>. */
173
174static int
175bkscm_print_block_smob (SCM self, SCM port, scm_print_state *pstate)
176{
177 block_smob *b_smob = (block_smob *) SCM_SMOB_DATA (self);
178 const struct block *b = b_smob->block;
179
180 gdbscm_printf (port, "#<%s", block_smob_name);
181
182 if (b->superblock () == NULL)
183 gdbscm_printf (port, " global");
184 else if (b->superblock ()->superblock () == NULL)
185 gdbscm_printf (port, " static");
186
187 if (b->function () != NULL)
188 gdbscm_printf (port, " %s", b->function ()->print_name ());
189
190 gdbscm_printf (port, " %s-%s",
191 hex_string (b->start ()), hex_string (b->end ()));
192
193 scm_puts (">", port);
194
195 scm_remember_upto_here_1 (self);
196
197 /* Non-zero means success. */
198 return 1;
199}
200
201/* Low level routine to create a <gdb:block> object. */
202
203static SCM
205{
206 block_smob *b_smob = (block_smob *)
207 scm_gc_malloc (sizeof (block_smob), block_smob_name);
208 SCM b_scm;
209
210 b_smob->block = NULL;
211 b_smob->objfile = NULL;
212 b_scm = scm_new_smob (block_smob_tag, (scm_t_bits) b_smob);
213 gdbscm_init_eqable_gsmob (&b_smob->base, b_scm);
214
215 return b_scm;
216}
217
218/* Returns non-zero if SCM is a <gdb:block> object. */
219
220static int
222{
223 return SCM_SMOB_PREDICATE (block_smob_tag, scm);
224}
225
226/* (block? scm) -> boolean */
227
228static SCM
230{
231 return scm_from_bool (bkscm_is_block (scm));
232}
233
234/* Return the existing object that encapsulates BLOCK, or create a new
235 <gdb:block> object. */
236
237SCM
239{
240 htab_t htab;
241 eqable_gdb_smob **slot;
242 block_smob *b_smob, b_smob_for_lookup;
243 SCM b_scm;
244
245 /* If we've already created a gsmob for this block, return it.
246 This makes blocks eq?-able. */
248 b_smob_for_lookup.block = block;
249 slot = gdbscm_find_eqable_gsmob_ptr_slot (htab, &b_smob_for_lookup.base);
250 if (*slot != NULL)
251 return (*slot)->containing_scm;
252
253 b_scm = bkscm_make_block_smob ();
254 b_smob = (block_smob *) SCM_SMOB_DATA (b_scm);
255 b_smob->block = block;
256 b_smob->objfile = objfile;
258
259 return b_scm;
260}
261
262/* Returns the <gdb:block> object in SELF.
263 Throws an exception if SELF is not a <gdb:block> object. */
264
265static SCM
266bkscm_get_block_arg_unsafe (SCM self, int arg_pos, const char *func_name)
267{
268 SCM_ASSERT_TYPE (bkscm_is_block (self), self, arg_pos, func_name,
270
271 return self;
272}
273
274/* Returns a pointer to the block smob of SELF.
275 Throws an exception if SELF is not a <gdb:block> object. */
276
277static block_smob *
278bkscm_get_block_smob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
279{
280 SCM b_scm = bkscm_get_block_arg_unsafe (self, arg_pos, func_name);
281 block_smob *b_smob = (block_smob *) SCM_SMOB_DATA (b_scm);
282
283 return b_smob;
284}
285
286/* Returns non-zero if block B_SMOB is valid. */
287
288static int
290{
291 return b_smob->block != NULL;
292}
293
294/* Returns the block smob in SELF, verifying it's valid.
295 Throws an exception if SELF is not a <gdb:block> object or is invalid. */
296
297static block_smob *
299 const char *func_name)
300{
301 block_smob *b_smob
302 = bkscm_get_block_smob_arg_unsafe (self, arg_pos, func_name);
303
304 if (!bkscm_is_valid (b_smob))
305 {
306 gdbscm_invalid_object_error (func_name, arg_pos, self,
307 _("<gdb:block>"));
308 }
309
310 return b_smob;
311}
312
313/* Returns the block smob contained in SCM or NULL if SCM is not a
314 <gdb:block> object.
315 If there is an error a <gdb:exception> object is stored in *EXCP. */
316
317static block_smob *
318bkscm_get_valid_block (SCM scm, int arg_pos, const char *func_name, SCM *excp)
319{
320 block_smob *b_smob;
321
322 if (!bkscm_is_block (scm))
323 {
324 *excp = gdbscm_make_type_error (func_name, arg_pos, scm,
326 return NULL;
327 }
328
329 b_smob = (block_smob *) SCM_SMOB_DATA (scm);
330 if (!bkscm_is_valid (b_smob))
331 {
332 *excp = gdbscm_make_invalid_object_error (func_name, arg_pos, scm,
333 _("<gdb:block>"));
334 return NULL;
335 }
336
337 return b_smob;
338}
339
340/* Returns the struct block that is wrapped by BLOCK_SCM.
341 If BLOCK_SCM is not a block, or is an invalid block, then NULL is returned
342 and a <gdb:exception> object is stored in *EXCP. */
343
344const struct block *
345bkscm_scm_to_block (SCM block_scm, int arg_pos, const char *func_name,
346 SCM *excp)
347{
348 block_smob *b_smob;
349
350 b_smob = bkscm_get_valid_block (block_scm, arg_pos, func_name, excp);
351
352 if (b_smob != NULL)
353 return b_smob->block;
354 return NULL;
355}
356
357
358/* Block methods. */
359
360/* (block-valid? <gdb:block>) -> boolean
361 Returns #t if SELF still exists in GDB. */
362
363static SCM
365{
366 block_smob *b_smob
367 = bkscm_get_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
368
369 return scm_from_bool (bkscm_is_valid (b_smob));
370}
371
372/* (block-start <gdb:block>) -> address */
373
374static SCM
376{
377 block_smob *b_smob
379 const struct block *block = b_smob->block;
380
382}
383
384/* (block-end <gdb:block>) -> address */
385
386static SCM
388{
389 block_smob *b_smob
391 const struct block *block = b_smob->block;
392
394}
395
396/* (block-function <gdb:block>) -> <gdb:symbol> */
397
398static SCM
400{
401 block_smob *b_smob
403 const struct block *block = b_smob->block;
404 struct symbol *sym;
405
406 sym = block->function ();
407
408 if (sym != NULL)
409 return syscm_scm_from_symbol (sym);
410 return SCM_BOOL_F;
411}
412
413/* (block-superblock <gdb:block>) -> <gdb:block> */
414
415static SCM
417{
418 block_smob *b_smob
420 const struct block *block = b_smob->block;
421 const struct block *super_block;
422
423 super_block = block->superblock ();
424
425 if (super_block)
426 return bkscm_scm_from_block (super_block, b_smob->objfile);
427 return SCM_BOOL_F;
428}
429
430/* (block-global-block <gdb:block>) -> <gdb:block>
431 Returns the global block associated to this block. */
432
433static SCM
435{
436 block_smob *b_smob
438 const struct block *block = b_smob->block;
439 const struct block *global_block;
440
442
443 return bkscm_scm_from_block (global_block, b_smob->objfile);
444}
445
446/* (block-static-block <gdb:block>) -> <gdb:block>
447 Returns the static block associated to this block.
448 Returns #f if we cannot get the static block (this is the global block). */
449
450static SCM
452{
453 block_smob *b_smob
455 const struct block *block = b_smob->block;
456 const struct block *static_block;
457
458 if (block->superblock () == NULL)
459 return SCM_BOOL_F;
460
462
463 return bkscm_scm_from_block (static_block, b_smob->objfile);
464}
465
466/* (block-global? <gdb:block>) -> boolean
467 Returns #t if this block object is a global block. */
468
469static SCM
471{
472 block_smob *b_smob
474 const struct block *block = b_smob->block;
475
476 return scm_from_bool (block->superblock () == NULL);
477}
478
479/* (block-static? <gdb:block>) -> boolean
480 Returns #t if this block object is a static block. */
481
482static SCM
484{
485 block_smob *b_smob
487 const struct block *block = b_smob->block;
488
489 if (block->superblock () != NULL
490 && block->superblock ()->superblock () == NULL)
491 return SCM_BOOL_T;
492 return SCM_BOOL_F;
493}
494
495/* (block-symbols <gdb:block>) -> list of <gdb:symbol objects
496 Returns a list of symbols of the block. */
497
498static SCM
500{
501 block_smob *b_smob
503 const struct block *block = b_smob->block;
504 SCM result;
505
506 result = SCM_EOL;
507
508 for (struct symbol *sym : block_iterator_range (block))
509 {
510 SCM s_scm = syscm_scm_from_symbol (sym);
511
512 result = scm_cons (s_scm, result);
513 }
514
515 return scm_reverse_x (result, SCM_EOL);
516}
517
518/* The <gdb:block-symbols-iterator> object,
519 for iterating over all symbols in a block. */
520
521/* The smob "print" function for <gdb:block-symbols-iterator>. */
522
523static int
525 scm_print_state *pstate)
526{
528 = (block_syms_progress_smob *) SCM_SMOB_DATA (self);
529
531
532 if (i_smob->initialized_p)
533 {
534 switch (i_smob->iter.which)
535 {
536 case GLOBAL_BLOCK:
537 case STATIC_BLOCK:
538 {
539 struct compunit_symtab *cust;
540
541 gdbscm_printf (port, " %s",
542 i_smob->iter.which == GLOBAL_BLOCK
543 ? "global" : "static");
544 if (i_smob->iter.idx != -1)
545 gdbscm_printf (port, " @%d", i_smob->iter.idx);
546 cust = (i_smob->iter.idx == -1
547 ? i_smob->iter.d.compunit_symtab
548 : i_smob->iter.d.compunit_symtab->includes[i_smob->iter.idx]);
549 gdbscm_printf (port, " %s",
551 (cust->primary_filetab ()));
552 break;
553 }
555 gdbscm_printf (port, " single block");
556 break;
557 }
558 }
559 else
560 gdbscm_printf (port, " !initialized");
561
562 scm_puts (">", port);
563
564 scm_remember_upto_here_1 (self);
565
566 /* Non-zero means success. */
567 return 1;
568}
569
570/* Low level routine to create a <gdb:block-symbols-progress> object. */
571
572static SCM
574{
576 scm_gc_malloc (sizeof (block_syms_progress_smob),
578 SCM smob;
579
580 memset (&i_smob->iter, 0, sizeof (i_smob->iter));
581 i_smob->initialized_p = 0;
582 smob = scm_new_smob (block_syms_progress_smob_tag, (scm_t_bits) i_smob);
583 gdbscm_init_gsmob (&i_smob->base);
584
585 return smob;
586}
587
588/* Returns non-zero if SCM is a <gdb:block-symbols-progress> object. */
589
590static int
592{
593 return SCM_SMOB_PREDICATE (block_syms_progress_smob_tag, scm);
594}
595
596/* (block-symbols-progress? scm) -> boolean */
597
598static SCM
600{
601 return scm_from_bool (bkscm_is_block_syms_progress (scm));
602}
603
604/* (make-block-symbols-iterator <gdb:block>) -> <gdb:iterator>
605 Return a <gdb:iterator> object for iterating over the symbols of SELF. */
606
607static SCM
609{
610 /* Call for side effects. */
612 SCM progress, iter;
613
615
616 iter = gdbscm_make_iterator (self, progress, bkscm_next_symbol_x_proc);
617
618 return iter;
619}
620
621/* Returns the next symbol in the iteration through the block's dictionary,
622 or (end-of-iteration).
623 This is the iterator_smob.next_x method. */
624
625static SCM
627{
628 SCM progress, iter_scm, block_scm;
629 iterator_smob *iter_smob;
630 block_smob *b_smob;
631 const struct block *block;
633 struct symbol *sym;
634
635 iter_scm = itscm_get_iterator_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
636 iter_smob = (iterator_smob *) SCM_SMOB_DATA (iter_scm);
637
638 block_scm = itscm_iterator_smob_object (iter_smob);
639 b_smob = bkscm_get_valid_block_smob_arg_unsafe (block_scm,
640 SCM_ARG1, FUNC_NAME);
641 block = b_smob->block;
642
643 progress = itscm_iterator_smob_progress (iter_smob);
644
645 SCM_ASSERT_TYPE (bkscm_is_block_syms_progress (progress),
646 progress, SCM_ARG1, FUNC_NAME,
648 p_smob = (block_syms_progress_smob *) SCM_SMOB_DATA (progress);
649
650 if (!p_smob->initialized_p)
651 {
652 sym = block_iterator_first (block, &p_smob->iter);
653 p_smob->initialized_p = 1;
654 }
655 else
656 sym = block_iterator_next (&p_smob->iter);
657
658 if (sym == NULL)
659 return gdbscm_end_of_iteration ();
660
661 return syscm_scm_from_symbol (sym);
662}
663
664/* (lookup-block address) -> <gdb:block>
665 Returns the innermost lexical block containing the specified pc value,
666 or #f if there is none. */
667
668static SCM
670{
671 CORE_ADDR pc;
672 const struct block *block = NULL;
673 struct compunit_symtab *cust = NULL;
674
675 gdbscm_parse_function_args (FUNC_NAME, SCM_ARG1, NULL, "U", pc_scm, &pc);
676
678 try
679 {
680 cust = find_pc_compunit_symtab (pc);
681
682 if (cust != NULL && cust->objfile () != NULL)
683 block = block_for_pc (pc);
684 }
685 catch (const gdb_exception &except)
686 {
687 exc = unpack (except);
688 }
689
691 if (cust == NULL || cust->objfile () == NULL)
692 {
693 gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, pc_scm,
694 _("cannot locate object file for block"));
695 }
696
697 if (block != NULL)
698 return bkscm_scm_from_block (block, cust->objfile ());
699 return SCM_BOOL_F;
700}
701
702/* Initialize the Scheme block support. */
703
705{
706 { "block?", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_p),
707 "\
708Return #t if the object is a <gdb:block> object." },
709
710 { "block-valid?", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_valid_p),
711 "\
712Return #t if the block is valid.\n\
713A block becomes invalid when its objfile is freed." },
714
715 { "block-start", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_start),
716 "\
717Return the start address of the block." },
718
719 { "block-end", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_end),
720 "\
721Return the end address of the block." },
722
723 { "block-function", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_function),
724 "\
725Return the gdb:symbol object of the function containing the block\n\
726or #f if the block does not live in any function." },
727
728 { "block-superblock", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_superblock),
729 "\
730Return the superblock (parent block) of the block." },
731
732 { "block-global-block", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_global_block),
733 "\
734Return the global block of the block." },
735
736 { "block-static-block", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_static_block),
737 "\
738Return the static block of the block." },
739
740 { "block-global?", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_global_p),
741 "\
742Return #t if block is a global block." },
743
744 { "block-static?", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_static_p),
745 "\
746Return #t if block is a static block." },
747
748 { "block-symbols", 1, 0, 0, as_a_scm_t_subr (gdbscm_block_symbols),
749 "\
750Return a list of all symbols (as <gdb:symbol> objects) in the block." },
751
752 { "make-block-symbols-iterator", 1, 0, 0,
754 "\
755Return a <gdb:iterator> object for iterating over all symbols in the block." },
756
757 { "block-symbols-progress?", 1, 0, 0,
759 "\
760Return #t if the object is a <gdb:block-symbols-progress> object." },
761
762 { "lookup-block", 1, 0, 0, as_a_scm_t_subr (gdbscm_lookup_block),
763 "\
764Return the innermost GDB block containing the address or #f if none found.\n\
765\n\
766 Arguments:\n\
767 address: the address to lookup" },
768
770};
771
772void
774{
777 scm_set_smob_free (block_smob_tag, bkscm_free_block_smob);
778 scm_set_smob_print (block_smob_tag, bkscm_print_block_smob);
779
782 sizeof (block_syms_progress_smob));
783 scm_set_smob_print (block_syms_progress_smob_tag,
785
787
788 /* This function is "private". */
790 = scm_c_define_gsubr ("%block-next-symbol!", 1, 0, 0,
792 scm_set_procedure_property_x (bkscm_next_symbol_x_proc,
795Internal function to assist the block symbols iterator."));
796}
static struct parser_state * pstate
Definition ada-exp.c:101
struct symbol * block_iterator_first(const struct block *block, struct block_iterator *iterator, const lookup_name_info *name)
Definition block.c:589
const struct block * block_for_pc(CORE_ADDR pc)
Definition block.c:276
struct symbol * block_iterator_next(struct block_iterator *iterator)
Definition block.c:614
iterator_range< block_iterator_wrapper > block_iterator_range
Definition block.h:553
void set(unsigned key, void *datum)
Definition registry.h:204
void * get(unsigned key)
Definition registry.h:211
@ STATIC_BLOCK
Definition defs.h:586
@ GLOBAL_BLOCK
Definition defs.h:585
@ FIRST_LOCAL_BLOCK
Definition defs.h:587
SCM gdbscm_make_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
Definition scm-gsmob.c:162
SCM gdbscm_make_type_error(const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
SCM itscm_iterator_smob_object(iterator_smob *i_smob)
SCM itscm_iterator_smob_progress(iterator_smob *i_smob)
#define END_FUNCTIONS
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
Definition scm-utils.c:528
SCM gdbscm_documentation_symbol
gdbscm_gdb_exception unpack(const gdb_exception &exc)
htab_t gdbscm_create_eqable_gsmob_ptr_map(htab_hash hash_fn, htab_eq eq_fn)
Definition scm-gsmob.c:213
void gdbscm_init_gsmob(gdb_smob *base)
Definition scm-gsmob.c:140
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
SCM gdbscm_make_iterator(SCM object, SCM progress, SCM next)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void gdbscm_clear_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
Definition scm-gsmob.c:251
SCM gdbscm_scm_from_ulongest(ULONGEST l)
Definition scm-utils.c:565
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
void gdbscm_define_functions(const scheme_function *, int is_public)
Definition scm-utils.c:44
eqable_gdb_smob ** gdbscm_find_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
Definition scm-gsmob.c:226
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
void gdbscm_fill_eqable_gsmob_ptr_slot(eqable_gdb_smob **slot, eqable_gdb_smob *base)
Definition scm-gsmob.c:237
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
Definition scm-gsmob.c:103
SCM itscm_get_iterator_arg_unsafe(SCM self, int arg_pos, const char *func_name)
SCM syscm_scm_from_symbol(struct symbol *symbol)
Definition scm-symbol.c:230
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_end_of_iteration(void)
#define FUNC_NAME
SCM gdbscm_scm_from_c_string(const char *string)
Definition scm-string.c:45
static SCM bkscm_make_block_syms_progress_smob(void)
Definition scm-block.c:573
static block_smob * bkscm_get_block_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
Definition scm-block.c:278
static int bkscm_is_block(SCM scm)
Definition scm-block.c:221
static SCM gdbscm_block_end(SCM self)
Definition scm-block.c:387
static SCM gdbscm_block_next_symbol_x(SCM self)
Definition scm-block.c:626
static SCM gdbscm_block_static_p(SCM self)
Definition scm-block.c:483
static SCM gdbscm_block_valid_p(SCM self)
Definition scm-block.c:364
static SCM gdbscm_block_function(SCM self)
Definition scm-block.c:399
static SCM gdbscm_block_superblock(SCM self)
Definition scm-block.c:416
static SCM gdbscm_make_block_syms_iter(SCM self)
Definition scm-block.c:608
static int bkscm_eq_block_smob(const void *ap, const void *bp)
Definition scm-block.c:124
static int bkscm_print_block_smob(SCM self, SCM port, scm_print_state *pstate)
Definition scm-block.c:175
static scm_t_bits block_smob_tag
Definition scm-block.c:73
static SCM gdbscm_block_global_p(SCM self)
Definition scm-block.c:470
static const registry< objfile >::key< htab, bkscm_deleter > bkscm_objfile_data_key
Definition scm-block.c:107
static const char block_smob_name[]
Definition scm-block.c:69
static const scheme_function block_functions[]
Definition scm-block.c:704
static scm_t_bits block_syms_progress_smob_tag
Definition scm-block.c:74
SCM bkscm_scm_from_block(const struct block *block, struct objfile *objfile)
Definition scm-block.c:238
static htab_t bkscm_objfile_block_map(struct objfile *objfile)
Definition scm-block.c:137
static SCM gdbscm_lookup_block(SCM pc_scm)
Definition scm-block.c:669
static SCM bkscm_make_block_smob(void)
Definition scm-block.c:204
static int bkscm_is_valid(block_smob *b_smob)
Definition scm-block.c:289
static block_smob * bkscm_get_valid_block_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
Definition scm-block.c:298
void gdbscm_initialize_blocks(void)
Definition scm-block.c:773
const struct block * bkscm_scm_to_block(SCM block_scm, int arg_pos, const char *func_name, SCM *excp)
Definition scm-block.c:345
static SCM gdbscm_block_static_block(SCM self)
Definition scm-block.c:451
static SCM gdbscm_block_global_block(SCM self)
Definition scm-block.c:434
static SCM bkscm_next_symbol_x_proc
Definition scm-block.c:77
static SCM bkscm_get_block_arg_unsafe(SCM self, int arg_pos, const char *func_name)
Definition scm-block.c:266
static SCM gdbscm_block_p(SCM scm)
Definition scm-block.c:229
static int bkscm_is_block_syms_progress(SCM scm)
Definition scm-block.c:591
static SCM gdbscm_block_start(SCM self)
Definition scm-block.c:375
static const char block_syms_progress_smob_name[]
Definition scm-block.c:70
static hashval_t bkscm_hash_block_smob(const void *p)
Definition scm-block.c:114
static block_smob * bkscm_get_valid_block(SCM scm, int arg_pos, const char *func_name, SCM *excp)
Definition scm-block.c:318
static SCM gdbscm_block_symbols(SCM self)
Definition scm-block.c:499
static SCM bkscm_block_syms_progress_p(SCM scm)
Definition scm-block.c:599
static int bkscm_print_block_syms_progress_smob(SCM self, SCM port, scm_print_state *pstate)
Definition scm-block.c:524
static size_t bkscm_free_block_smob(SCM self)
Definition scm-block.c:154
const char * symtab_to_filename_for_display(struct symtab *symtab)
Definition source.c:1269
static int bkscm_mark_block_invalid(void **slot, void *info)
Definition scm-block.c:89
void operator()(htab_t htab)
Definition scm-block.c:98
struct compunit_symtab * compunit_symtab
Definition block.h:464
enum block_enum which
Definition block.h:482
union block_iterator::@21 d
const struct block * block
Definition scm-block.c:41
eqable_gdb_smob base
Definition scm-block.c:38
struct objfile * objfile
Definition scm-block.c:46
struct block_iterator iter
Definition scm-block.c:63
Definition block.h:109
const block * superblock() const
Definition block.h:135
const struct block * global_block() const
Definition block.c:369
CORE_ADDR start() const
Definition block.h:111
const struct block * static_block() const
Definition block.c:354
CORE_ADDR end() const
Definition block.h:119
symbol * function() const
Definition block.h:127
struct objfile * objfile() const
Definition block.c:43
symtab * primary_filetab() const
Definition symtab.c:415
struct compunit_symtab ** includes
Definition symtab.h:1975
struct objfile * objfile() const
Definition symtab.h:1788
const char * print_name() const
Definition symtab.h:475
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)
Definition symtab.c:2946