GDB (xrefs)
Loading...
Searching...
No Matches
scm-breakpoint.c
Go to the documentation of this file.
1/* Scheme interface to breakpoints.
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 "value.h"
25#include "breakpoint.h"
26#include "gdbcmd.h"
27#include "gdbthread.h"
28#include "observable.h"
29#include "cli/cli-script.h"
30#include "ada-lang.h"
31#include "arch-utils.h"
32#include "language.h"
33#include "guile-internal.h"
34#include "location.h"
35
36/* The <gdb:breakpoint> smob.
37 N.B.: The name of this struct is known to breakpoint.h.
38
39 Note: Breakpoints are added to gdb using a two step process:
40 1) Call make-breakpoint to create a <gdb:breakpoint> object.
41 2) Call register-breakpoint! to add the breakpoint to gdb.
42 It is done this way so that the constructor, make-breakpoint, doesn't have
43 any side-effects. This means that the smob needs to store everything
44 that was passed to make-breakpoint. */
45
47{
48 /* This always appears first. */
50
51 /* Non-zero if this breakpoint was created with make-breakpoint. */
53
54 /* For breakpoints created with make-breakpoint, these are the parameters
55 that were passed to make-breakpoint. These values are not used except
56 to register the breakpoint with GDB. */
57 struct
58 {
59 /* The string representation of the breakpoint.
60 Space for this lives in GC space. */
61 char *location;
62
63 /* The kind of breakpoint.
64 At the moment this can only be one of bp_breakpoint, bp_watchpoint. */
66
67 /* If a watchpoint, the kind of watchpoint. */
68 enum target_hw_bp_type access_type;
69
70 /* Non-zero if the breakpoint is an "internal" breakpoint. */
72
73 /* Non-zero if the breakpoint is temporary. */
76
77 /* The breakpoint number according to gdb.
78 For breakpoints created from Scheme, this has the value -1 until the
79 breakpoint is registered with gdb.
80 This is recorded here because BP will be NULL when deleted. */
81 int number;
82
83 /* The gdb breakpoint object, or NULL if the breakpoint has not been
84 registered yet, or has been deleted. */
85 struct breakpoint *bp;
86
87 /* Backlink to our containing <gdb:breakpoint> smob.
88 This is needed when we are deleted, we need to unprotect the object
89 from GC. */
91
92 /* A stop condition or #f. */
93 SCM stop;
95
96static const char breakpoint_smob_name[] = "gdb:breakpoint";
97
98/* The tag Guile knows the breakpoint smob by. */
99static scm_t_bits breakpoint_smob_tag;
100
101/* Variables used to pass information between the breakpoint_smob
102 constructor and the breakpoint-created hook function. */
103static SCM pending_breakpoint_scm = SCM_BOOL_F;
104
105/* Keywords used by create-breakpoint!. */
106static SCM type_keyword;
110
111/* Administrivia for breakpoint smobs. */
112
113/* The smob "free" function for <gdb:breakpoint>. */
114
115static size_t
117{
118 breakpoint_smob *bp_smob = (breakpoint_smob *) SCM_SMOB_DATA (self);
119
120 if (bp_smob->bp)
121 bp_smob->bp->scm_bp_object = NULL;
122
123 /* Not necessary, done to catch bugs. */
124 bp_smob->bp = NULL;
125 bp_smob->containing_scm = SCM_UNDEFINED;
126 bp_smob->stop = SCM_UNDEFINED;
127
128 return 0;
129}
130
131/* Return the name of TYPE.
132 This doesn't handle all types, just the ones we export. */
133
134static const char *
136{
137 switch (type)
138 {
139 case bp_none: return "BP_NONE";
140 case bp_breakpoint: return "BP_BREAKPOINT";
141 case bp_watchpoint: return "BP_WATCHPOINT";
142 case bp_hardware_watchpoint: return "BP_HARDWARE_WATCHPOINT";
143 case bp_read_watchpoint: return "BP_READ_WATCHPOINT";
144 case bp_access_watchpoint: return "BP_ACCESS_WATCHPOINT";
145 case bp_catchpoint: return "BP_CATCHPOINT";
146 default: return "internal/other";
147 }
148}
149
150/* Return the name of ENABLE_STATE. */
151
152static const char *
154{
155 switch (enable_state)
156 {
157 case bp_disabled: return "disabled";
158 case bp_enabled: return "enabled";
159 case bp_call_disabled: return "call_disabled";
160 default: return "unknown";
161 }
162}
163
164/* The smob "print" function for <gdb:breakpoint>. */
165
166static int
167bpscm_print_breakpoint_smob (SCM self, SCM port, scm_print_state *pstate)
168{
169 breakpoint_smob *bp_smob = (breakpoint_smob *) SCM_SMOB_DATA (self);
170 struct breakpoint *b = bp_smob->bp;
171
172 gdbscm_printf (port, "#<%s", breakpoint_smob_name);
173
174 /* Only print what we export to the user.
175 The rest are possibly internal implementation details. */
176
177 gdbscm_printf (port, " #%d", bp_smob->number);
178
179 /* Careful, the breakpoint may be invalid. */
180 if (b != NULL)
181 {
182 gdbscm_printf (port, " %s %s %s",
185 b->silent ? "silent" : "noisy");
186
187 gdbscm_printf (port, " hit:%d", b->hit_count);
188 gdbscm_printf (port, " ignore:%d", b->ignore_count);
189
190 if (b->locspec != nullptr)
191 {
192 const char *str = b->locspec->to_string ();
193 if (str != nullptr)
194 gdbscm_printf (port, " @%s", str);
195 }
196 }
197
198 scm_puts (">", port);
199
200 scm_remember_upto_here_1 (self);
201
202 /* Non-zero means success. */
203 return 1;
204}
205
206/* Low level routine to create a <gdb:breakpoint> object. */
207
208static SCM
210{
211 breakpoint_smob *bp_smob = (breakpoint_smob *)
212 scm_gc_malloc (sizeof (breakpoint_smob), breakpoint_smob_name);
213 SCM bp_scm;
214
215 memset (bp_smob, 0, sizeof (*bp_smob));
216 bp_smob->number = -1;
217 bp_smob->stop = SCM_BOOL_F;
218 bp_scm = scm_new_smob (breakpoint_smob_tag, (scm_t_bits) bp_smob);
219 bp_smob->containing_scm = bp_scm;
220 gdbscm_init_gsmob (&bp_smob->base);
221
222 return bp_scm;
223}
224
225/* Return non-zero if we want a Scheme wrapper for breakpoint B.
226 If FROM_SCHEME is non-zero,this is called for a breakpoint created
227 by the user from Scheme. Otherwise it is zero. */
228
229static int
230bpscm_want_scm_wrapper_p (struct breakpoint *bp, int from_scheme)
231{
232 /* Don't create <gdb:breakpoint> objects for internal GDB breakpoints. */
233 if (bp->number < 0 && !from_scheme)
234 return 0;
235
236 /* The others are not supported. */
237 if (bp->type != bp_breakpoint
238 && bp->type != bp_watchpoint
239 && bp->type != bp_hardware_watchpoint
240 && bp->type != bp_read_watchpoint
241 && bp->type != bp_access_watchpoint
242 && bp->type != bp_catchpoint)
243 return 0;
244
245 return 1;
246}
247
248/* Install the Scheme side of a breakpoint, CONTAINING_SCM, in
249 the gdb side BP. */
250
251static void
252bpscm_attach_scm_to_breakpoint (struct breakpoint *bp, SCM containing_scm)
253{
254 breakpoint_smob *bp_smob;
255
256 bp_smob = (breakpoint_smob *) SCM_SMOB_DATA (containing_scm);
257 bp_smob->number = bp->number;
258 bp_smob->bp = bp;
259 bp_smob->containing_scm = containing_scm;
260 bp_smob->bp->scm_bp_object = bp_smob;
261
262 /* The owner of this breakpoint is not in GC-controlled memory, so we need
263 to protect it from GC until the breakpoint is deleted. */
264 scm_gc_protect_object (containing_scm);
265}
266
267/* Return non-zero if SCM is a breakpoint smob. */
268
269static int
271{
272 return SCM_SMOB_PREDICATE (breakpoint_smob_tag, scm);
273}
274
275/* (breakpoint? scm) -> boolean */
276
277static SCM
279{
280 return scm_from_bool (bpscm_is_breakpoint (scm));
281}
282
283/* Returns the <gdb:breakpoint> object in SELF.
284 Throws an exception if SELF is not a <gdb:breakpoint> object. */
285
286static SCM
287bpscm_get_breakpoint_arg_unsafe (SCM self, int arg_pos, const char *func_name)
288{
289 SCM_ASSERT_TYPE (bpscm_is_breakpoint (self), self, arg_pos, func_name,
291
292 return self;
293}
294
295/* Returns a pointer to the breakpoint smob of SELF.
296 Throws an exception if SELF is not a <gdb:breakpoint> object. */
297
298static breakpoint_smob *
300 const char *func_name)
301{
302 SCM bp_scm = bpscm_get_breakpoint_arg_unsafe (self, arg_pos, func_name);
303 breakpoint_smob *bp_smob = (breakpoint_smob *) SCM_SMOB_DATA (bp_scm);
304
305 return bp_smob;
306}
307
308/* Return non-zero if breakpoint BP_SMOB is valid. */
309
310static int
312{
313 return bp_smob->bp != NULL;
314}
315
316/* Returns the breakpoint smob in SELF, verifying it's valid.
317 Throws an exception if SELF is not a <gdb:breakpoint> object,
318 or is invalid. */
319
320static breakpoint_smob *
322 const char *func_name)
323{
324 breakpoint_smob *bp_smob
325 = bpscm_get_breakpoint_smob_arg_unsafe (self, arg_pos, func_name);
326
327 if (!bpscm_is_valid (bp_smob))
328 {
329 gdbscm_invalid_object_error (func_name, arg_pos, self,
330 _("<gdb:breakpoint>"));
331 }
332
333 return bp_smob;
334}
335
336/* Breakpoint methods. */
337
338/* (make-breakpoint string [#:type integer] [#:wp-class integer]
339 [#:internal boolean] [#:temporary boolean]) -> <gdb:breakpoint>
340
341 The result is the <gdb:breakpoint> Scheme object.
342 The breakpoint is not available to be used yet, however.
343 It must still be added to gdb with register-breakpoint!. */
344
345static SCM
346gdbscm_make_breakpoint (SCM location_scm, SCM rest)
347{
348 const SCM keywords[] = {
350 temporary_keyword, SCM_BOOL_F
351 };
352 char *s;
353 char *location;
354 int type_arg_pos = -1, access_type_arg_pos = -1,
355 internal_arg_pos = -1, temporary_arg_pos = -1;
356 int type = bp_breakpoint;
357 int access_type = hw_write;
358 int internal = 0;
359 int temporary = 0;
360 SCM result;
361 breakpoint_smob *bp_smob;
362
363 gdbscm_parse_function_args (FUNC_NAME, SCM_ARG1, keywords, "s#iitt",
364 location_scm, &location, rest,
365 &type_arg_pos, &type,
366 &access_type_arg_pos, &access_type,
367 &internal_arg_pos, &internal,
368 &temporary_arg_pos, &temporary);
369
370 result = bpscm_make_breakpoint_smob ();
371 bp_smob = (breakpoint_smob *) SCM_SMOB_DATA (result);
372
373 s = location;
374 location = gdbscm_gc_xstrdup (s);
375 xfree (s);
376
377 switch (type)
378 {
379 case bp_breakpoint:
380 if (access_type_arg_pos > 0)
381 {
382 gdbscm_misc_error (FUNC_NAME, access_type_arg_pos,
383 scm_from_int (access_type),
384 _("access type with breakpoint is not allowed"));
385 }
386 break;
387 case bp_watchpoint:
388 switch (access_type)
389 {
390 case hw_write:
391 case hw_access:
392 case hw_read:
393 break;
394 default:
395 gdbscm_out_of_range_error (FUNC_NAME, access_type_arg_pos,
396 scm_from_int (access_type),
397 _("invalid watchpoint class"));
398 }
399 break;
400 case bp_none:
404 case bp_catchpoint:
405 {
406 const char *type_name = bpscm_type_to_string ((enum bptype) type);
407 gdbscm_misc_error (FUNC_NAME, type_arg_pos,
408 gdbscm_scm_from_c_string (type_name),
409 _("unsupported breakpoint type"));
410 }
411 break;
412 default:
414 scm_from_int (type),
415 _("invalid breakpoint type"));
416 }
417
418 bp_smob->is_scheme_bkpt = 1;
419 bp_smob->spec.location = location;
420 bp_smob->spec.type = (enum bptype) type;
421 bp_smob->spec.access_type = (enum target_hw_bp_type) access_type;
422 bp_smob->spec.is_internal = internal;
423 bp_smob->spec.is_temporary = temporary;
424
425 return result;
426}
427
428/* (register-breakpoint! <gdb:breakpoint>) -> unspecified
429
430 It is an error to register a breakpoint created outside of Guile,
431 or an already-registered breakpoint. */
432
433static SCM
435{
436 breakpoint_smob *bp_smob
438 gdbscm_gdb_exception except {};
439 const char *location, *copy;
440
441 /* We only support registering breakpoints created with make-breakpoint. */
442 if (!bp_smob->is_scheme_bkpt)
443 scm_misc_error (FUNC_NAME, _("not a Scheme breakpoint"), SCM_EOL);
444
445 if (bpscm_is_valid (bp_smob))
446 scm_misc_error (FUNC_NAME, _("breakpoint is already registered"), SCM_EOL);
447
449 location = bp_smob->spec.location;
450 copy = skip_spaces (location);
455
456 try
457 {
458 int internal = bp_smob->spec.is_internal;
459 int temporary = bp_smob->spec.is_temporary;
460
461 switch (bp_smob->spec.type)
462 {
463 case bp_breakpoint:
464 {
465 const breakpoint_ops *ops =
468 locspec.get (), NULL, -1, -1, NULL, false,
469 0,
470 temporary, bp_breakpoint,
471 0,
473 ops,
474 0, 1, internal, 0);
475 break;
476 }
477 case bp_watchpoint:
478 {
479 enum target_hw_bp_type access_type = bp_smob->spec.access_type;
480
481 if (access_type == hw_write)
482 watch_command_wrapper (location, 0, internal);
483 else if (access_type == hw_access)
484 awatch_command_wrapper (location, 0, internal);
485 else if (access_type == hw_read)
486 rwatch_command_wrapper (location, 0, internal);
487 else
488 gdb_assert_not_reached ("invalid access type");
489 break;
490 }
491 default:
492 gdb_assert_not_reached ("invalid breakpoint type");
493 }
494 }
495 catch (const gdb_exception &ex)
496 {
497 except = unpack (ex);
498 }
499
500 /* Ensure this gets reset, even if there's an error. */
501 pending_breakpoint_scm = SCM_BOOL_F;
503
504 return SCM_UNSPECIFIED;
505}
506
507/* (delete-breakpoint! <gdb:breakpoint>) -> unspecified
508 Scheme function which deletes (removes) the underlying GDB breakpoint
509 from GDB's list of breakpoints. This triggers the breakpoint_deleted
510 observer which will call gdbscm_breakpoint_deleted; that function cleans
511 up the Scheme bits. */
512
513static SCM
515{
516 breakpoint_smob *bp_smob
518
520 try
521 {
522 delete_breakpoint (bp_smob->bp);
523 }
524 catch (const gdb_exception &except)
525 {
526 exc = unpack (except);
527 }
528
530 return SCM_UNSPECIFIED;
531}
532
533/* iterate_over_breakpoints function for gdbscm_breakpoints. */
534
535static void
537{
538 breakpoint_smob *bp_smob = bp->scm_bp_object;
539
540 /* Lazily create wrappers for breakpoints created outside Scheme. */
541
542 if (bp_smob == NULL)
543 {
545 {
546 SCM bp_scm;
547
548 bp_scm = bpscm_make_breakpoint_smob ();
550 /* Refetch it. */
551 bp_smob = bp->scm_bp_object;
552 }
553 }
554
555 /* Not all breakpoints will have a companion Scheme object.
556 Only breakpoints that trigger the created_breakpoint observer call,
557 and satisfy certain conditions (see bpscm_want_scm_wrapper_p),
558 get a companion object (this includes Scheme-created breakpoints). */
559
560 if (bp_smob != NULL)
561 *list = scm_cons (bp_smob->containing_scm, *list);
562}
563
564/* (breakpoints) -> list
565 Return a list of all breakpoints. */
566
567static SCM
569{
570 SCM list = SCM_EOL;
571
572 for (breakpoint &bp : all_breakpoints ())
573 bpscm_build_bp_list (&bp, &list);
574
575 return scm_reverse_x (list, SCM_EOL);
576}
577
578/* (breakpoint-valid? <gdb:breakpoint>) -> boolean
579 Returns #t if SELF is still valid. */
580
581static SCM
583{
584 breakpoint_smob *bp_smob
586
587 return scm_from_bool (bpscm_is_valid (bp_smob));
588}
589
590/* (breakpoint-enabled? <gdb:breakpoint>) -> boolean */
591
592static SCM
594{
595 breakpoint_smob *bp_smob
597
598 return scm_from_bool (bp_smob->bp->enable_state == bp_enabled);
599}
600
601/* (set-breakpoint-enabled? <gdb:breakpoint> boolean) -> unspecified */
602
603static SCM
604gdbscm_set_breakpoint_enabled_x (SCM self, SCM newvalue)
605{
606 breakpoint_smob *bp_smob
608
609 SCM_ASSERT_TYPE (gdbscm_is_bool (newvalue), newvalue, SCM_ARG2, FUNC_NAME,
610 _("boolean"));
611
613 try
614 {
615 if (gdbscm_is_true (newvalue))
616 enable_breakpoint (bp_smob->bp);
617 else
618 disable_breakpoint (bp_smob->bp);
619 }
620 catch (const gdb_exception &except)
621 {
622 exc = unpack (except);
623 }
624
626 return SCM_UNSPECIFIED;
627}
628
629/* (breakpoint-silent? <gdb:breakpoint>) -> boolean */
630
631static SCM
633{
634 breakpoint_smob *bp_smob
636
637 return scm_from_bool (bp_smob->bp->silent);
638}
639
640/* (set-breakpoint-silent?! <gdb:breakpoint> boolean) -> unspecified */
641
642static SCM
643gdbscm_set_breakpoint_silent_x (SCM self, SCM newvalue)
644{
645 breakpoint_smob *bp_smob
647
648 SCM_ASSERT_TYPE (gdbscm_is_bool (newvalue), newvalue, SCM_ARG2, FUNC_NAME,
649 _("boolean"));
650
652 try
653 {
654 breakpoint_set_silent (bp_smob->bp, gdbscm_is_true (newvalue));
655 }
656 catch (const gdb_exception &except)
657 {
658 exc = unpack (except);
659 }
660
662 return SCM_UNSPECIFIED;
663}
664
665/* (breakpoint-ignore-count <gdb:breakpoint>) -> integer */
666
667static SCM
669{
670 breakpoint_smob *bp_smob
672
673 return scm_from_long (bp_smob->bp->ignore_count);
674}
675
676/* (set-breakpoint-ignore-count! <gdb:breakpoint> integer)
677 -> unspecified */
678
679static SCM
681{
682 breakpoint_smob *bp_smob
684 long value;
685
686 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN, LONG_MAX),
687 newvalue, SCM_ARG2, FUNC_NAME, _("integer"));
688
689 value = scm_to_long (newvalue);
690 if (value < 0)
691 value = 0;
692
694 try
695 {
696 set_ignore_count (bp_smob->number, (int) value, 0);
697 }
698 catch (const gdb_exception &except)
699 {
700 exc = unpack (except);
701 }
702
704 return SCM_UNSPECIFIED;
705}
706
707/* (breakpoint-hit-count <gdb:breakpoint>) -> integer */
708
709static SCM
711{
712 breakpoint_smob *bp_smob
714
715 return scm_from_long (bp_smob->bp->hit_count);
716}
717
718/* (set-breakpoint-hit-count! <gdb:breakpoint> integer) -> unspecified */
719
720static SCM
721gdbscm_set_breakpoint_hit_count_x (SCM self, SCM newvalue)
722{
723 breakpoint_smob *bp_smob
725 long value;
726
727 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN, LONG_MAX),
728 newvalue, SCM_ARG2, FUNC_NAME, _("integer"));
729
730 value = scm_to_long (newvalue);
731 if (value < 0)
732 value = 0;
733
734 if (value != 0)
735 {
736 gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG2, newvalue,
737 _("hit-count must be zero"));
738 }
739
740 bp_smob->bp->hit_count = 0;
741
742 return SCM_UNSPECIFIED;
743}
744
745/* (breakpoint-thread <gdb:breakpoint>) -> integer */
746
747static SCM
749{
750 breakpoint_smob *bp_smob
752
753 if (bp_smob->bp->thread == -1)
754 return SCM_BOOL_F;
755
756 return scm_from_long (bp_smob->bp->thread);
757}
758
759/* (set-breakpoint-thread! <gdb:breakpoint> integer) -> unspecified */
760
761static SCM
762gdbscm_set_breakpoint_thread_x (SCM self, SCM newvalue)
763{
764 breakpoint_smob *bp_smob
766 long id;
767
768 if (scm_is_signed_integer (newvalue, LONG_MIN, LONG_MAX))
769 {
770 id = scm_to_long (newvalue);
771 if (!valid_global_thread_id (id))
772 {
773 gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG2, newvalue,
774 _("invalid thread id"));
775 }
776
777 if (bp_smob->bp->task != -1)
778 scm_misc_error (FUNC_NAME,
779 _("cannot set both task and thread attributes"),
780 SCM_EOL);
781 }
782 else if (gdbscm_is_false (newvalue))
783 id = -1;
784 else
785 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2, FUNC_NAME, _("integer or #f"));
786
787 if (bp_smob->bp->inferior != -1 && id != -1)
788 scm_misc_error (FUNC_NAME,
789 _("Cannot have both 'thread' and 'inferior' "
790 "conditions on a breakpoint"), SCM_EOL);
791
792 breakpoint_set_thread (bp_smob->bp, id);
793
794 return SCM_UNSPECIFIED;
795}
796
797/* (breakpoint-task <gdb:breakpoint>) -> integer */
798
799static SCM
801{
802 breakpoint_smob *bp_smob
804
805 if (bp_smob->bp->task == -1)
806 return SCM_BOOL_F;
807
808 return scm_from_long (bp_smob->bp->task);
809}
810
811/* (set-breakpoint-task! <gdb:breakpoint> integer) -> unspecified */
812
813static SCM
814gdbscm_set_breakpoint_task_x (SCM self, SCM newvalue)
815{
816 breakpoint_smob *bp_smob
818 long id;
819 int valid_id = 0;
820
821 if (scm_is_signed_integer (newvalue, LONG_MIN, LONG_MAX))
822 {
823 id = scm_to_long (newvalue);
824
826 try
827 {
828 valid_id = valid_task_id (id);
829 }
830 catch (const gdb_exception &except)
831 {
832 exc = unpack (except);
833 }
834
836 if (! valid_id)
837 {
838 gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG2, newvalue,
839 _("invalid task id"));
840 }
841
842 if (bp_smob->bp->thread != -1)
843 scm_misc_error (FUNC_NAME,
844 _("cannot set both task and thread attributes"),
845 SCM_EOL);
846 }
847 else if (gdbscm_is_false (newvalue))
848 id = -1;
849 else
850 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2, FUNC_NAME, _("integer or #f"));
851
853 try
854 {
855 breakpoint_set_task (bp_smob->bp, id);
856 }
857 catch (const gdb_exception &except)
858 {
859 exc = unpack (except);
860 }
861
863 return SCM_UNSPECIFIED;
864}
865
866/* (breakpoint-location <gdb:breakpoint>) -> string */
867
868static SCM
870{
871 breakpoint_smob *bp_smob
873
874 if (bp_smob->bp->type != bp_breakpoint)
875 return SCM_BOOL_F;
876
877 const char *str = bp_smob->bp->locspec->to_string ();
878 if (str == nullptr)
879 str = "";
880
881 return gdbscm_scm_from_c_string (str);
882}
883
884/* (breakpoint-expression <gdb:breakpoint>) -> string
885 This is only valid for watchpoints.
886 Returns #f for non-watchpoints. */
887
888static SCM
890{
891 breakpoint_smob *bp_smob
893
894 if (!is_watchpoint (bp_smob->bp))
895 return SCM_BOOL_F;
896
897 watchpoint *wp = gdb::checked_static_cast<watchpoint *> (bp_smob->bp);
898
899 const char *str = wp->exp_string.get ();
900 if (! str)
901 str = "";
902
903 return gdbscm_scm_from_c_string (str);
904}
905
906/* (breakpoint-condition <gdb:breakpoint>) -> string */
907
908static SCM
910{
911 breakpoint_smob *bp_smob
913 char *str;
914
915 str = bp_smob->bp->cond_string.get ();
916 if (! str)
917 return SCM_BOOL_F;
918
919 return gdbscm_scm_from_c_string (str);
920}
921
922/* (set-breakpoint-condition! <gdb:breakpoint> string|#f)
923 -> unspecified */
924
925static SCM
926gdbscm_set_breakpoint_condition_x (SCM self, SCM newvalue)
927{
928 breakpoint_smob *bp_smob
930
931 SCM_ASSERT_TYPE (scm_is_string (newvalue) || gdbscm_is_false (newvalue),
932 newvalue, SCM_ARG2, FUNC_NAME,
933 _("string or #f"));
934
935 return gdbscm_wrap ([=]
936 {
937 gdb::unique_xmalloc_ptr<char> exp
938 = (gdbscm_is_false (newvalue)
939 ? nullptr
940 : gdbscm_scm_to_c_string (newvalue));
941
942 set_breakpoint_condition (bp_smob->bp, exp ? exp.get () : "", 0, false);
943
944 return SCM_UNSPECIFIED;
945 });
946}
947
948/* (breakpoint-stop <gdb:breakpoint>) -> procedure or #f */
949
950static SCM
952{
953 breakpoint_smob *bp_smob
955
956 return bp_smob->stop;
957}
958
959/* (set-breakpoint-stop! <gdb:breakpoint> procedure|#f)
960 -> unspecified */
961
962static SCM
963gdbscm_set_breakpoint_stop_x (SCM self, SCM newvalue)
964{
965 breakpoint_smob *bp_smob
967 const struct extension_language_defn *extlang = NULL;
968
969 SCM_ASSERT_TYPE (gdbscm_is_procedure (newvalue)
970 || gdbscm_is_false (newvalue),
971 newvalue, SCM_ARG2, FUNC_NAME,
972 _("procedure or #f"));
973
974 if (bp_smob->bp->cond_string != NULL)
976 if (extlang == NULL)
977 extlang = get_breakpoint_cond_ext_lang (bp_smob->bp, EXT_LANG_GUILE);
978 if (extlang != NULL)
979 {
980 char *error_text
981 = xstrprintf (_("Only one stop condition allowed. There is"
982 " currently a %s stop condition defined for"
983 " this breakpoint."),
984 ext_lang_capitalized_name (extlang)).release ();
985
986 scm_dynwind_begin ((scm_t_dynwind_flags) 0);
987 gdbscm_dynwind_xfree (error_text);
988 gdbscm_out_of_range_error (FUNC_NAME, SCM_ARG1, self, error_text);
989 /* The following line, while unnecessary, is present for completeness
990 sake. */
991 scm_dynwind_end ();
992 }
993
994 bp_smob->stop = newvalue;
995
996 return SCM_UNSPECIFIED;
997}
998
999/* (breakpoint-commands <gdb:breakpoint>) -> string */
1000
1001static SCM
1003{
1004 breakpoint_smob *bp_smob
1006 struct breakpoint *bp;
1007 SCM result;
1008
1009 bp = bp_smob->bp;
1010
1011 if (bp->commands == NULL)
1012 return SCM_BOOL_F;
1013
1014 string_file buf;
1015
1016 gdbscm_gdb_exception exc {};
1017 try
1018 {
1019 ui_out_redirect_pop redir (current_uiout, &buf);
1021 }
1022 catch (const gdb_exception &except)
1023 {
1024 exc = unpack (except);
1025 }
1026
1028 result = gdbscm_scm_from_c_string (buf.c_str ());
1029
1030 return result;
1031}
1032
1033/* (breakpoint-type <gdb:breakpoint>) -> integer */
1034
1035static SCM
1037{
1038 breakpoint_smob *bp_smob
1040
1041 return scm_from_long (bp_smob->bp->type);
1042}
1043
1044/* (breakpoint-visible? <gdb:breakpoint>) -> boolean */
1045
1046static SCM
1048{
1049 breakpoint_smob *bp_smob
1051
1052 return scm_from_bool (bp_smob->bp->number >= 0);
1053}
1054
1055/* (breakpoint-number <gdb:breakpoint>) -> integer */
1056
1057static SCM
1059{
1060 breakpoint_smob *bp_smob
1062
1063 return scm_from_long (bp_smob->number);
1064}
1065
1066/* (breakpoint-temporary? <gdb:breakpoint>) -> boolean */
1067
1068static SCM
1070{
1071 breakpoint_smob *bp_smob
1073
1074 return scm_from_bool (bp_smob->bp->disposition == disp_del
1075 || bp_smob->bp->disposition == disp_del_at_next_stop);
1076}
1077
1078/* Return TRUE if "stop" has been set for this breakpoint.
1079
1080 This is the extension_language_ops.breakpoint_has_cond "method". */
1081
1082int
1084 struct breakpoint *b)
1085{
1086 breakpoint_smob *bp_smob = b->scm_bp_object;
1087
1088 if (bp_smob == NULL)
1089 return 0;
1090
1091 return gdbscm_is_procedure (bp_smob->stop);
1092}
1093
1094/* Call the "stop" method in the breakpoint class.
1095 This must only be called if gdbscm_breakpoint_has_cond returns true.
1096 If the stop method returns #t, the inferior will be stopped at the
1097 breakpoint. Otherwise the inferior will be allowed to continue
1098 (assuming other conditions don't indicate "stop").
1099
1100 This is the extension_language_ops.breakpoint_cond_says_stop "method". */
1101
1104 (const struct extension_language_defn *extlang, struct breakpoint *b)
1105{
1106 breakpoint_smob *bp_smob = b->scm_bp_object;
1107 SCM predicate_result;
1108 int stop;
1109
1110 if (bp_smob == NULL)
1112 if (!gdbscm_is_procedure (bp_smob->stop))
1114
1115 stop = 1;
1116
1117 predicate_result
1118 = gdbscm_safe_call_1 (bp_smob->stop, bp_smob->containing_scm, NULL);
1119
1120 if (gdbscm_is_exception (predicate_result))
1121 ; /* Exception already printed. */
1122 /* If the "stop" function returns #f that means
1123 the Scheme breakpoint wants GDB to continue. */
1124 else if (gdbscm_is_false (predicate_result))
1125 stop = 0;
1126
1128}
1129
1130/* Event callback functions. */
1131
1132/* Callback that is used when a breakpoint is created.
1133 For breakpoints created by Scheme, i.e., gdbscm_create_breakpoint_x, finish
1134 object creation by connecting the Scheme wrapper to the gdb object.
1135 We ignore breakpoints created from gdb or python here, we create the
1136 Scheme wrapper for those when there's a need to, e.g.,
1137 gdbscm_breakpoints. */
1138
1139static void
1141{
1142 SCM bp_scm;
1143
1145 return;
1146
1147 /* Verify our caller error checked the user's request. */
1148 gdb_assert (bpscm_want_scm_wrapper_p (bp, 1));
1149
1150 bp_scm = pending_breakpoint_scm;
1151 pending_breakpoint_scm = SCM_BOOL_F;
1152
1154}
1155
1156/* Callback that is used when a breakpoint is deleted. This will
1157 invalidate the corresponding Scheme object. */
1158
1159static void
1161{
1162 int num = b->number;
1163 struct breakpoint *bp;
1164
1165 /* TODO: Why the lookup? We have B. */
1166
1167 bp = get_breakpoint (num);
1168 if (bp)
1169 {
1170 breakpoint_smob *bp_smob = bp->scm_bp_object;
1171
1172 if (bp_smob)
1173 {
1174 bp_smob->bp = NULL;
1175 bp_smob->number = -1;
1176 bp_smob->stop = SCM_BOOL_F;
1177 scm_gc_unprotect_object (bp_smob->containing_scm);
1178 }
1179 }
1180}
1181
1182/* Initialize the Scheme breakpoint code. */
1183
1185{
1186 { "BP_NONE", bp_none },
1187 { "BP_BREAKPOINT", bp_breakpoint },
1188 { "BP_WATCHPOINT", bp_watchpoint },
1189 { "BP_HARDWARE_WATCHPOINT", bp_hardware_watchpoint },
1190 { "BP_READ_WATCHPOINT", bp_read_watchpoint },
1191 { "BP_ACCESS_WATCHPOINT", bp_access_watchpoint },
1192 { "BP_CATCHPOINT", bp_catchpoint },
1193
1194 { "WP_READ", hw_read },
1195 { "WP_WRITE", hw_write },
1196 { "WP_ACCESS", hw_access },
1197
1199};
1200
1202{
1203 { "make-breakpoint", 1, 0, 1, as_a_scm_t_subr (gdbscm_make_breakpoint),
1204 "\
1205Create a GDB breakpoint object.\n\
1206\n\
1207 Arguments:\n\
1208 location [#:type <type>] [#:wp-class <wp-class>] [#:internal <bool>] [#:temporary <bool>]\n\
1209 Returns:\n\
1210 <gdb:breakpoint> object" },
1211
1212 { "register-breakpoint!", 1, 0, 0,
1214 "\
1215Register a <gdb:breakpoint> object with GDB." },
1216
1217 { "delete-breakpoint!", 1, 0, 0, as_a_scm_t_subr (gdbscm_delete_breakpoint_x),
1218 "\
1219Delete the breakpoint from GDB." },
1220
1221 { "breakpoints", 0, 0, 0, as_a_scm_t_subr (gdbscm_breakpoints),
1222 "\
1223Return a list of all GDB breakpoints.\n\
1224\n\
1225 Arguments: none" },
1226
1227 { "breakpoint?", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_p),
1228 "\
1229Return #t if the object is a <gdb:breakpoint> object." },
1230
1231 { "breakpoint-valid?", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_valid_p),
1232 "\
1233Return #t if the breakpoint has not been deleted from GDB." },
1234
1235 { "breakpoint-number", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_number),
1236 "\
1237Return the breakpoint's number." },
1238
1239 { "breakpoint-temporary?", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_temporary),
1240 "\
1241Return #t if the breakpoint is a temporary breakpoint." },
1242
1243 { "breakpoint-type", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_type),
1244 "\
1245Return the type of the breakpoint." },
1246
1247 { "breakpoint-visible?", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_visible),
1248 "\
1249Return #t if the breakpoint is visible to the user." },
1250
1251 { "breakpoint-location", 1, 0, 0,
1253 "\
1254Return the location of the breakpoint as specified by the user." },
1255
1256 { "breakpoint-expression", 1, 0, 0,
1258 "\
1259Return the expression of the breakpoint as specified by the user.\n\
1260Valid for watchpoints only, returns #f for non-watchpoints." },
1261
1262 { "breakpoint-enabled?", 1, 0, 0,
1264 "\
1265Return #t if the breakpoint is enabled." },
1266
1267 { "set-breakpoint-enabled!", 2, 0, 0,
1269 "\
1270Set the breakpoint's enabled state.\n\
1271\n\
1272 Arguments: <gdb:breakpoint> boolean" },
1273
1274 { "breakpoint-silent?", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_silent_p),
1275 "\
1276Return #t if the breakpoint is silent." },
1277
1278 { "set-breakpoint-silent!", 2, 0, 0,
1280 "\
1281Set the breakpoint's silent state.\n\
1282\n\
1283 Arguments: <gdb:breakpoint> boolean" },
1284
1285 { "breakpoint-ignore-count", 1, 0, 0,
1287 "\
1288Return the breakpoint's \"ignore\" count." },
1289
1290 { "set-breakpoint-ignore-count!", 2, 0, 0,
1292 "\
1293Set the breakpoint's \"ignore\" count.\n\
1294\n\
1295 Arguments: <gdb:breakpoint> count" },
1296
1297 { "breakpoint-hit-count", 1, 0, 0,
1299 "\
1300Return the breakpoint's \"hit\" count." },
1301
1302 { "set-breakpoint-hit-count!", 2, 0, 0,
1304 "\
1305Set the breakpoint's \"hit\" count. The value must be zero.\n\
1306\n\
1307 Arguments: <gdb:breakpoint> 0" },
1308
1309 { "breakpoint-thread", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_thread),
1310 "\
1311Return the breakpoint's global thread id or #f if there isn't one." },
1312
1313 { "set-breakpoint-thread!", 2, 0, 0,
1315 "\
1316Set the global thread id for this breakpoint.\n\
1317\n\
1318 Arguments: <gdb:breakpoint> global-thread-id" },
1319
1320 { "breakpoint-task", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_task),
1321 "\
1322Return the breakpoint's Ada task-id or #f if there isn't one." },
1323
1324 { "set-breakpoint-task!", 2, 0, 0,
1326 "\
1327Set the breakpoint's Ada task-id.\n\
1328\n\
1329 Arguments: <gdb:breakpoint> task-id" },
1330
1331 { "breakpoint-condition", 1, 0, 0,
1333 "\
1334Return the breakpoint's condition as specified by the user.\n\
1335Return #f if there isn't one." },
1336
1337 { "set-breakpoint-condition!", 2, 0, 0,
1339 "\
1340Set the breakpoint's condition.\n\
1341\n\
1342 Arguments: <gdb:breakpoint> condition\n\
1343 condition: a string" },
1344
1345 { "breakpoint-stop", 1, 0, 0, as_a_scm_t_subr (gdbscm_breakpoint_stop),
1346 "\
1347Return the breakpoint's stop predicate.\n\
1348Return #f if there isn't one." },
1349
1350 { "set-breakpoint-stop!", 2, 0, 0,
1352 "\
1353Set the breakpoint's stop predicate.\n\
1354\n\
1355 Arguments: <gdb:breakpoint> procedure\n\
1356 procedure: A procedure of one argument, the breakpoint.\n\
1357 Its result is true if program execution should stop." },
1358
1359 { "breakpoint-commands", 1, 0, 0,
1361 "\
1362Return the breakpoint's commands." },
1363
1365};
1366
1367void
1369{
1374
1376 "scm-breakpoint");
1378 "scm-breakpoint");
1379
1382
1383 type_keyword = scm_from_latin1_keyword ("type");
1384 wp_class_keyword = scm_from_latin1_keyword ("wp-class");
1385 internal_keyword = scm_from_latin1_keyword ("internal");
1386 temporary_keyword = scm_from_latin1_keyword ("temporary");
1387}
static struct parser_state * pstate
Definition ada-exp.c:101
void xfree(void *)
int valid_task_id(int)
Definition ada-tasks.c:370
struct gdbarch * get_current_arch(void)
Definition arch-utils.c:846
void enable_breakpoint(struct breakpoint *bpt)
void delete_breakpoint(struct breakpoint *bpt)
void breakpoint_set_thread(struct breakpoint *b, int thread)
struct breakpoint * get_breakpoint(int num)
Definition breakpoint.c:887
void watch_command_wrapper(const char *arg, int from_tty, bool internal)
void rwatch_command_wrapper(const char *arg, int from_tty, bool internal)
int create_breakpoint(struct gdbarch *gdbarch, location_spec *locspec, const char *cond_string, int thread, int inferior, const char *extra_string, bool force_condition, int parse_extra, int tempflag, enum bptype type_wanted, int ignore_count, enum auto_boolean pending_break_support, const struct breakpoint_ops *ops, int from_tty, int enabled, int internal, unsigned flags)
bool is_watchpoint(const struct breakpoint *bpt)
void awatch_command_wrapper(const char *arg, int from_tty, bool internal)
struct command_line * breakpoint_commands(struct breakpoint *b)
Definition breakpoint.c:494
void breakpoint_set_silent(struct breakpoint *b, int silent)
void disable_breakpoint(struct breakpoint *bpt)
void breakpoint_set_task(struct breakpoint *b, int task)
void set_ignore_count(int bptnum, int count, int from_tty)
void set_breakpoint_condition(struct breakpoint *b, const char *exp, int from_tty, bool force)
const struct breakpoint_ops * breakpoint_ops_for_location_spec(const location_spec *locspec, bool is_tracepoint)
breakpoint_range all_breakpoints()
Definition breakpoint.c:704
@ disp_del
Definition breakpoint.h:237
@ disp_del_at_next_stop
Definition breakpoint.h:238
bptype
Definition breakpoint.h:84
@ bp_breakpoint
Definition breakpoint.h:86
@ bp_watchpoint
Definition breakpoint.h:91
@ bp_read_watchpoint
Definition breakpoint.h:93
@ bp_catchpoint
Definition breakpoint.h:182
@ bp_access_watchpoint
Definition breakpoint.h:94
@ bp_none
Definition breakpoint.h:85
@ bp_hardware_watchpoint
Definition breakpoint.h:92
enable_state
Definition breakpoint.h:217
@ bp_disabled
Definition breakpoint.h:218
@ bp_enabled
Definition breakpoint.h:220
@ bp_call_disabled
Definition breakpoint.h:222
const char * c_str() const
Definition ui-file.h:222
void print_command_lines(struct ui_out *uiout, struct command_line *cmd, unsigned int depth)
Definition cli-script.c:202
@ AUTO_BOOLEAN_TRUE
Definition defs.h:248
const struct extension_language_defn * get_breakpoint_cond_ext_lang(struct breakpoint *b, enum extension_language skip_lang)
Definition extension.c:583
const struct extension_language_defn * get_ext_lang_defn(enum extension_language lang)
Definition extension.c:99
const char * ext_lang_capitalized_name(const struct extension_language_defn *extlang)
Definition extension.c:215
@ EXT_LANG_GUILE
Definition extension.h:65
@ EXT_LANG_GDB
Definition extension.h:63
ext_lang_bp_stop
Definition extension.h:138
@ EXT_LANG_BP_STOP_NO
Definition extension.h:143
@ EXT_LANG_BP_STOP_YES
Definition extension.h:146
@ EXT_LANG_BP_STOP_UNSET
Definition extension.h:140
int valid_global_thread_id(int global_id)
Definition thread.c:621
#define gdbscm_is_true(scm)
SCM gdbscm_wrap(Function &&func, Args &&... args)
#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
#define END_INTEGER_CONSTANTS
gdbscm_gdb_exception unpack(const gdb_exception &exc)
void gdbscm_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
int gdbscm_is_procedure(SCM proc)
Definition scm-utils.c:592
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
void gdbscm_dynwind_xfree(void *ptr)
Definition scm-utils.c:584
char * gdbscm_gc_xstrdup(const char *)
Definition scm-utils.c:600
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
SCM gdbscm_safe_call_1(SCM proc, SCM arg0, excp_matcher_func *ok_excps)
#define gdbscm_is_false(scm)
#define gdbscm_is_bool(scm)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
gdb::unique_xmalloc_ptr< char > gdbscm_scm_to_c_string(SCM string)
Definition scm-string.c:55
void gdbscm_define_integer_constants(const scheme_integer_constant *, int is_public)
Definition scm-utils.c:63
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
int gdbscm_is_exception(SCM scm)
void gdbscm_define_functions(const scheme_function *, int is_public)
Definition scm-utils.c:44
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
Definition scm-gsmob.c:103
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
#define FUNC_NAME
SCM gdbscm_scm_from_c_string(const char *string)
Definition scm-string.c:45
const struct language_defn * current_language
Definition language.c:82
location_spec_up string_to_location_spec_basic(const char **stringp, const struct language_defn *language, symbol_name_match_type match_type)
Definition location.c:785
std::unique_ptr< location_spec > location_spec_up
Definition location.h:71
observable< struct breakpoint * > breakpoint_created
observable< struct breakpoint * > breakpoint_deleted
int value
Definition py-param.c:79
static SCM bpscm_get_breakpoint_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM bpscm_make_breakpoint_smob(void)
static breakpoint_smob * bpscm_get_breakpoint_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_breakpoint_valid_p(SCM self)
static SCM gdbscm_set_breakpoint_thread_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_type(SCM self)
static SCM internal_keyword
static void bpscm_breakpoint_created(struct breakpoint *bp)
static const char * bpscm_enable_state_to_string(enum enable_state enable_state)
static SCM temporary_keyword
static void bpscm_build_bp_list(struct breakpoint *bp, SCM *list)
static SCM gdbscm_breakpoint_temporary(SCM self)
enum ext_lang_bp_stop gdbscm_breakpoint_cond_says_stop(const struct extension_language_defn *extlang, struct breakpoint *b)
int gdbscm_breakpoint_has_cond(const struct extension_language_defn *extlang, struct breakpoint *b)
static int bpscm_is_breakpoint(SCM scm)
static int bpscm_want_scm_wrapper_p(struct breakpoint *bp, int from_scheme)
static SCM gdbscm_breakpoint_expression(SCM self)
static SCM gdbscm_breakpoint_thread(SCM self)
static int bpscm_print_breakpoint_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM type_keyword
static SCM gdbscm_set_breakpoint_task_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_condition(SCM self)
static SCM gdbscm_set_breakpoint_ignore_count_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_ignore_count(SCM self)
static SCM gdbscm_make_breakpoint(SCM location_scm, SCM rest)
static SCM gdbscm_breakpoint_location(SCM self)
static void bpscm_attach_scm_to_breakpoint(struct breakpoint *bp, SCM containing_scm)
static size_t bpscm_free_breakpoint_smob(SCM self)
static SCM gdbscm_breakpoint_p(SCM scm)
static const char * bpscm_type_to_string(enum bptype type)
static const char breakpoint_smob_name[]
static breakpoint_smob * bpscm_get_valid_breakpoint_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_set_breakpoint_hit_count_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_commands(SCM self)
static const scheme_function breakpoint_functions[]
static SCM gdbscm_breakpoint_enabled_p(SCM self)
static SCM gdbscm_breakpoint_silent_p(SCM self)
static SCM gdbscm_set_breakpoint_silent_x(SCM self, SCM newvalue)
static SCM gdbscm_set_breakpoint_condition_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_hit_count(SCM self)
static scm_t_bits breakpoint_smob_tag
void gdbscm_initialize_breakpoints(void)
static SCM wp_class_keyword
static int bpscm_is_valid(breakpoint_smob *bp_smob)
static SCM pending_breakpoint_scm
static SCM gdbscm_register_breakpoint_x(SCM self)
static SCM gdbscm_delete_breakpoint_x(SCM self)
static SCM gdbscm_breakpoint_visible(SCM self)
static void bpscm_breakpoint_deleted(struct breakpoint *b)
static SCM gdbscm_breakpoint_task(SCM self)
static SCM gdbscm_breakpoints(void)
static SCM gdbscm_breakpoint_stop(SCM self)
struct gdbscm_breakpoint_object breakpoint_smob
static SCM gdbscm_breakpoint_number(SCM self)
static const scheme_integer_constant breakpoint_integer_constants[]
static SCM gdbscm_set_breakpoint_stop_x(SCM self, SCM newvalue)
static SCM gdbscm_set_breakpoint_enabled_x(SCM self, SCM newvalue)
int ignore_count
Definition breakpoint.h:813
bptype type
Definition breakpoint.h:798
location_spec_up locspec
Definition breakpoint.h:832
gdb::unique_xmalloc_ptr< char > cond_string
Definition breakpoint.h:850
gdbscm_breakpoint_object * scm_bp_object
Definition breakpoint.h:893
enum enable_state enable_state
Definition breakpoint.h:800
bpdisp disposition
Definition breakpoint.h:802
enum target_hw_bp_type access_type
struct gdbscm_breakpoint_object::@76 spec
struct breakpoint * bp
Definition value.h:130
gdb::unique_xmalloc_ptr< char > exp_string
#define current_uiout
Definition ui-out.h:40
#define nullptr
Definition x86-cpuid.h:28