gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp
[binutils-gdb.git] / gdb / gdbarch-components.py
1 # Dynamic architecture support for GDB, the GNU debugger.
2
3 # Copyright (C) 1998-2022 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 # How to add to gdbarch:
21 #
22 # There are four kinds of fields in gdbarch:
23 #
24 # * Info - you should never need this; it is only for things that are
25 # copied directly from the gdbarch_info.
26 #
27 # * Value - a variable.
28 #
29 # * Function - a function pointer.
30 #
31 # * Method - a function pointer, but the function takes a gdbarch as
32 # its first parameter.
33 #
34 # You construct a new one with a call to one of those functions. So,
35 # for instance, you can use the function named "Value" to make a new
36 # Value.
37 #
38 # All parameters are keyword-only. This is done to help catch typos.
39 #
40 # Some parameters are shared among all types (including Info):
41 #
42 # * "name" - required, the name of the field.
43 #
44 # * "type" - required, the type of the field. For functions and
45 # methods, this is the return type.
46 #
47 # * "printer" - an expression to turn this field into a 'const char
48 # *'. This is used for dumping. The string must live long enough to
49 # be passed to printf.
50 #
51 # Value, Function, and Method share some more parameters. Some of
52 # these work in conjunction in a somewhat complicated way, so they are
53 # described in a separate sub-section below.
54 #
55 # * "comment" - a comment that's written to the .h file. Please
56 # always use this. (It isn't currently a required option for
57 # historical reasons.)
58 #
59 # * "predicate" - a boolean, if True then a _p predicate function will
60 # be generated. The predicate will use the generic validation
61 # function for the field. See below.
62 #
63 # * "predefault", "postdefault", and "invalid" - These are used for
64 # the initialization and verification steps:
65 #
66 # A gdbarch is zero-initialized. Then, if a field has a pre-default,
67 # the field is set to that value. After initialization is complete
68 # (that is, after the tdep code has a change to change the settings),
69 # the post-initialization step is done.
70 #
71 # There is a generic algorithm to generate a "validation function" for
72 # all fields. If the field has an "invalid" attribute with a string
73 # value, then this string is the expression (note that a string-valued
74 # "invalid" and "predicate" are mutually exclusive; and the case where
75 # invalid is True means to ignore this field and instead use the
76 # default checking that is about to be described). Otherwise, if
77 # there is a "predefault", then the field is valid if it differs from
78 # the predefault. Otherwise, the check is done against 0 (really NULL
79 # for function pointers, but same idea).
80 #
81 # In post-initialization / validation, there are several cases.
82 #
83 # * If "invalid" is False, or if the field specifies "predicate",
84 # validation is skipped. Otherwise, a validation step is emitted.
85 #
86 # * Otherwise, the validity is checked using the usual validation
87 # function (see above). If the field is considered valid, nothing is
88 # done.
89 #
90 # * Otherwise, the field's value is invalid. If there is a
91 # "postdefault", then the field is assigned that value.
92 #
93 # * Otherwise, the gdbarch will fail validation and gdb will crash.
94 #
95 # Function and Method share:
96 #
97 # * "params" - required, a tuple of tuples. Each inner tuple is a
98 # pair of the form (TYPE, NAME), where TYPE is the type of this
99 # argument, and NAME is the name. Note that while the names could be
100 # auto-generated, this approach lets the "comment" field refer to
101 # arguments in a nicer way. It is also just nicer for users.
102
103 Info(
104 type="const struct bfd_arch_info *",
105 name="bfd_arch_info",
106 printer="gdbarch_bfd_arch_info (gdbarch)->printable_name",
107 )
108
109 Info(
110 type="enum bfd_endian",
111 name="byte_order",
112 )
113
114 Info(
115 type="enum bfd_endian",
116 name="byte_order_for_code",
117 )
118
119 Info(
120 type="enum gdb_osabi",
121 name="osabi",
122 )
123
124 Info(
125 type="const struct target_desc *",
126 name="target_desc",
127 printer="host_address_to_string (gdbarch->target_desc)",
128 )
129
130 Value(
131 comment="""
132 Number of bits in a short or unsigned short for the target machine.
133 """,
134 type="int",
135 name="short_bit",
136 predefault="2*TARGET_CHAR_BIT",
137 invalid=False,
138 )
139
140 Value(
141 comment="""
142 Number of bits in an int or unsigned int for the target machine.
143 """,
144 type="int",
145 name="int_bit",
146 predefault="4*TARGET_CHAR_BIT",
147 invalid=False,
148 )
149
150 Value(
151 comment="""
152 Number of bits in a long or unsigned long for the target machine.
153 """,
154 type="int",
155 name="long_bit",
156 predefault="4*TARGET_CHAR_BIT",
157 invalid=False,
158 )
159
160 Value(
161 comment="""
162 Number of bits in a long long or unsigned long long for the target
163 machine.
164 """,
165 type="int",
166 name="long_long_bit",
167 predefault="2*gdbarch->long_bit",
168 invalid=False,
169 )
170
171 Value(
172 comment="""
173 The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
174 "long double". These bit/format pairs should eventually be combined
175 into a single object. For the moment, just initialize them as a pair.
176 Each format describes both the big and little endian layouts (if
177 useful).
178 """,
179 type="int",
180 name="bfloat16_bit",
181 predefault="2*TARGET_CHAR_BIT",
182 invalid=False,
183 )
184
185 Value(
186 type="const struct floatformat **",
187 name="bfloat16_format",
188 postdefault="floatformats_bfloat16",
189 invalid=True,
190 printer="pformat (gdbarch->bfloat16_format)",
191 )
192
193 Value(
194 type="int",
195 name="half_bit",
196 predefault="2*TARGET_CHAR_BIT",
197 invalid=False,
198 )
199
200 Value(
201 type="const struct floatformat **",
202 name="half_format",
203 postdefault="floatformats_ieee_half",
204 invalid=True,
205 printer="pformat (gdbarch->half_format)",
206 )
207
208 Value(
209 type="int",
210 name="float_bit",
211 predefault="4*TARGET_CHAR_BIT",
212 invalid=False,
213 )
214
215 Value(
216 type="const struct floatformat **",
217 name="float_format",
218 postdefault="floatformats_ieee_single",
219 invalid=True,
220 printer="pformat (gdbarch->float_format)",
221 )
222
223 Value(
224 type="int",
225 name="double_bit",
226 predefault="8*TARGET_CHAR_BIT",
227 invalid=False,
228 )
229
230 Value(
231 type="const struct floatformat **",
232 name="double_format",
233 postdefault="floatformats_ieee_double",
234 invalid=True,
235 printer="pformat (gdbarch->double_format)",
236 )
237
238 Value(
239 type="int",
240 name="long_double_bit",
241 predefault="8*TARGET_CHAR_BIT",
242 invalid=False,
243 )
244
245 Value(
246 type="const struct floatformat **",
247 name="long_double_format",
248 postdefault="floatformats_ieee_double",
249 invalid=True,
250 printer="pformat (gdbarch->long_double_format)",
251 )
252
253 Value(
254 comment="""
255 The ABI default bit-size for "wchar_t". wchar_t is a built-in type
256 starting with C++11.
257 """,
258 type="int",
259 name="wchar_bit",
260 predefault="4*TARGET_CHAR_BIT",
261 invalid=False,
262 )
263
264 Value(
265 comment="""
266 One if `wchar_t' is signed, zero if unsigned.
267 """,
268 type="int",
269 name="wchar_signed",
270 predefault="-1",
271 postdefault="1",
272 invalid=True,
273 )
274
275 Method(
276 comment="""
277 Returns the floating-point format to be used for values of length LENGTH.
278 NAME, if non-NULL, is the type name, which may be used to distinguish
279 different target formats of the same length.
280 """,
281 type="const struct floatformat **",
282 name="floatformat_for_type",
283 params=[("const char *", "name"), ("int", "length")],
284 predefault="default_floatformat_for_type",
285 invalid=False,
286 )
287
288 Value(
289 comment="""
290 For most targets, a pointer on the target and its representation as an
291 address in GDB have the same size and "look the same". For such a
292 target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
293 / addr_bit will be set from it.
294
295 If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
296 also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
297 gdbarch_address_to_pointer as well.
298
299 ptr_bit is the size of a pointer on the target
300 """,
301 type="int",
302 name="ptr_bit",
303 predefault="gdbarch->int_bit",
304 invalid=False,
305 )
306
307 Value(
308 comment="""
309 addr_bit is the size of a target address as represented in gdb
310 """,
311 type="int",
312 name="addr_bit",
313 predefault="0",
314 postdefault="gdbarch_ptr_bit (gdbarch)",
315 invalid=True,
316 )
317
318 Value(
319 comment="""
320 dwarf2_addr_size is the target address size as used in the Dwarf debug
321 info. For .debug_frame FDEs, this is supposed to be the target address
322 size from the associated CU header, and which is equivalent to the
323 DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
324 Unfortunately there is no good way to determine this value. Therefore
325 dwarf2_addr_size simply defaults to the target pointer size.
326
327 dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
328 defined using the target's pointer size so far.
329
330 Note that dwarf2_addr_size only needs to be redefined by a target if the
331 GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
332 and if Dwarf versions < 4 need to be supported.
333 """,
334 type="int",
335 name="dwarf2_addr_size",
336 predefault="0",
337 postdefault="gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT",
338 invalid=True,
339 )
340
341 Value(
342 comment="""
343 One if `char' acts like `signed char', zero if `unsigned char'.
344 """,
345 type="int",
346 name="char_signed",
347 predefault="-1",
348 postdefault="1",
349 invalid=True,
350 )
351
352 Function(
353 type="CORE_ADDR",
354 name="read_pc",
355 params=[("readable_regcache *", "regcache")],
356 predicate=True,
357 invalid=True,
358 )
359
360 Function(
361 type="void",
362 name="write_pc",
363 params=[("struct regcache *", "regcache"), ("CORE_ADDR", "val")],
364 predicate=True,
365 invalid=True,
366 )
367
368 Method(
369 comment="""
370 Function for getting target's idea of a frame pointer. FIXME: GDB's
371 whole scheme for dealing with "frames" and "frame pointers" needs a
372 serious shakedown.
373 """,
374 type="void",
375 name="virtual_frame_pointer",
376 params=[
377 ("CORE_ADDR", "pc"),
378 ("int *", "frame_regnum"),
379 ("LONGEST *", "frame_offset"),
380 ],
381 predefault="legacy_virtual_frame_pointer",
382 invalid=False,
383 )
384
385 Method(
386 type="enum register_status",
387 name="pseudo_register_read",
388 params=[
389 ("readable_regcache *", "regcache"),
390 ("int", "cookednum"),
391 ("gdb_byte *", "buf"),
392 ],
393 predicate=True,
394 invalid=True,
395 )
396
397 Method(
398 comment="""
399 Read a register into a new struct value. If the register is wholly
400 or partly unavailable, this should call mark_value_bytes_unavailable
401 as appropriate. If this is defined, then pseudo_register_read will
402 never be called.
403 """,
404 type="struct value *",
405 name="pseudo_register_read_value",
406 params=[("readable_regcache *", "regcache"), ("int", "cookednum")],
407 predicate=True,
408 invalid=True,
409 )
410
411 Method(
412 type="void",
413 name="pseudo_register_write",
414 params=[
415 ("struct regcache *", "regcache"),
416 ("int", "cookednum"),
417 ("const gdb_byte *", "buf"),
418 ],
419 predicate=True,
420 invalid=True,
421 )
422
423 Value(
424 type="int",
425 name="num_regs",
426 predefault="-1",
427 invalid=True,
428 )
429
430 Value(
431 comment="""
432 This macro gives the number of pseudo-registers that live in the
433 register namespace but do not get fetched or stored on the target.
434 These pseudo-registers may be aliases for other registers,
435 combinations of other registers, or they may be computed by GDB.
436 """,
437 type="int",
438 name="num_pseudo_regs",
439 predefault="0",
440 invalid=False,
441 )
442
443 Method(
444 comment="""
445 Assemble agent expression bytecode to collect pseudo-register REG.
446 Return -1 if something goes wrong, 0 otherwise.
447 """,
448 type="int",
449 name="ax_pseudo_register_collect",
450 params=[("struct agent_expr *", "ax"), ("int", "reg")],
451 predicate=True,
452 invalid=True,
453 )
454
455 Method(
456 comment="""
457 Assemble agent expression bytecode to push the value of pseudo-register
458 REG on the interpreter stack.
459 Return -1 if something goes wrong, 0 otherwise.
460 """,
461 type="int",
462 name="ax_pseudo_register_push_stack",
463 params=[("struct agent_expr *", "ax"), ("int", "reg")],
464 predicate=True,
465 invalid=True,
466 )
467
468 Method(
469 comment="""
470 Some architectures can display additional information for specific
471 signals.
472 UIOUT is the output stream where the handler will place information.
473 """,
474 type="void",
475 name="report_signal_info",
476 params=[("struct ui_out *", "uiout"), ("enum gdb_signal", "siggnal")],
477 predicate=True,
478 invalid=True,
479 )
480
481 Value(
482 comment="""
483 GDB's standard (or well known) register numbers. These can map onto
484 a real register or a pseudo (computed) register or not be defined at
485 all (-1).
486 gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP.
487 """,
488 type="int",
489 name="sp_regnum",
490 predefault="-1",
491 invalid=False,
492 )
493
494 Value(
495 type="int",
496 name="pc_regnum",
497 predefault="-1",
498 invalid=False,
499 )
500
501 Value(
502 type="int",
503 name="ps_regnum",
504 predefault="-1",
505 invalid=False,
506 )
507
508 Value(
509 type="int",
510 name="fp0_regnum",
511 predefault="-1",
512 invalid=False,
513 )
514
515 Method(
516 comment="""
517 Convert stab register number (from `r' declaration) to a gdb REGNUM.
518 """,
519 type="int",
520 name="stab_reg_to_regnum",
521 params=[("int", "stab_regnr")],
522 predefault="no_op_reg_to_regnum",
523 invalid=False,
524 )
525
526 Method(
527 comment="""
528 Provide a default mapping from a ecoff register number to a gdb REGNUM.
529 """,
530 type="int",
531 name="ecoff_reg_to_regnum",
532 params=[("int", "ecoff_regnr")],
533 predefault="no_op_reg_to_regnum",
534 invalid=False,
535 )
536
537 Method(
538 comment="""
539 Convert from an sdb register number to an internal gdb register number.
540 """,
541 type="int",
542 name="sdb_reg_to_regnum",
543 params=[("int", "sdb_regnr")],
544 predefault="no_op_reg_to_regnum",
545 invalid=False,
546 )
547
548 Method(
549 comment="""
550 Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
551 Return -1 for bad REGNUM. Note: Several targets get this wrong.
552 """,
553 type="int",
554 name="dwarf2_reg_to_regnum",
555 params=[("int", "dwarf2_regnr")],
556 predefault="no_op_reg_to_regnum",
557 invalid=False,
558 )
559
560 Method(
561 type="const char *",
562 name="register_name",
563 params=[("int", "regnr")],
564 predefault="0",
565 invalid=True,
566 )
567
568 Method(
569 comment="""
570 Return the type of a register specified by the architecture. Only
571 the register cache should call this function directly; others should
572 use "register_type".
573 """,
574 type="struct type *",
575 name="register_type",
576 params=[("int", "reg_nr")],
577 predicate=True,
578 invalid=True,
579 )
580
581 Method(
582 comment="""
583 Generate a dummy frame_id for THIS_FRAME assuming that the frame is
584 a dummy frame. A dummy frame is created before an inferior call,
585 the frame_id returned here must match the frame_id that was built
586 for the inferior call. Usually this means the returned frame_id's
587 stack address should match the address returned by
588 gdbarch_push_dummy_call, and the returned frame_id's code address
589 should match the address at which the breakpoint was set in the dummy
590 frame.
591 """,
592 type="struct frame_id",
593 name="dummy_id",
594 params=[("struct frame_info *", "this_frame")],
595 predefault="default_dummy_id",
596 invalid=False,
597 )
598
599 Value(
600 comment="""
601 Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
602 deprecated_fp_regnum.
603 """,
604 type="int",
605 name="deprecated_fp_regnum",
606 predefault="-1",
607 invalid=False,
608 )
609
610 Method(
611 type="CORE_ADDR",
612 name="push_dummy_call",
613 params=[
614 ("struct value *", "function"),
615 ("struct regcache *", "regcache"),
616 ("CORE_ADDR", "bp_addr"),
617 ("int", "nargs"),
618 ("struct value **", "args"),
619 ("CORE_ADDR", "sp"),
620 ("function_call_return_method", "return_method"),
621 ("CORE_ADDR", "struct_addr"),
622 ],
623 predicate=True,
624 invalid=True,
625 )
626
627 Value(
628 type="int",
629 name="call_dummy_location",
630 predefault="AT_ENTRY_POINT",
631 invalid=False,
632 )
633
634 Method(
635 type="CORE_ADDR",
636 name="push_dummy_code",
637 params=[
638 ("CORE_ADDR", "sp"),
639 ("CORE_ADDR", "funaddr"),
640 ("struct value **", "args"),
641 ("int", "nargs"),
642 ("struct type *", "value_type"),
643 ("CORE_ADDR *", "real_pc"),
644 ("CORE_ADDR *", "bp_addr"),
645 ("struct regcache *", "regcache"),
646 ],
647 predicate=True,
648 invalid=True,
649 )
650
651 Method(
652 comment="""
653 Return true if the code of FRAME is writable.
654 """,
655 type="int",
656 name="code_of_frame_writable",
657 params=[("struct frame_info *", "frame")],
658 predefault="default_code_of_frame_writable",
659 invalid=False,
660 )
661
662 Method(
663 type="void",
664 name="print_registers_info",
665 params=[
666 ("struct ui_file *", "file"),
667 ("struct frame_info *", "frame"),
668 ("int", "regnum"),
669 ("int", "all"),
670 ],
671 predefault="default_print_registers_info",
672 invalid=False,
673 )
674
675 Method(
676 type="void",
677 name="print_float_info",
678 params=[
679 ("struct ui_file *", "file"),
680 ("struct frame_info *", "frame"),
681 ("const char *", "args"),
682 ],
683 predefault="default_print_float_info",
684 invalid=False,
685 )
686
687 Method(
688 type="void",
689 name="print_vector_info",
690 params=[
691 ("struct ui_file *", "file"),
692 ("struct frame_info *", "frame"),
693 ("const char *", "args"),
694 ],
695 predicate=True,
696 invalid=True,
697 )
698
699 Method(
700 comment="""
701 MAP a GDB RAW register number onto a simulator register number. See
702 also include/...-sim.h.
703 """,
704 type="int",
705 name="register_sim_regno",
706 params=[("int", "reg_nr")],
707 predefault="legacy_register_sim_regno",
708 invalid=False,
709 )
710
711 Method(
712 type="int",
713 name="cannot_fetch_register",
714 params=[("int", "regnum")],
715 predefault="cannot_register_not",
716 invalid=False,
717 )
718
719 Method(
720 type="int",
721 name="cannot_store_register",
722 params=[("int", "regnum")],
723 predefault="cannot_register_not",
724 invalid=False,
725 )
726
727 Function(
728 comment="""
729 Determine the address where a longjmp will land and save this address
730 in PC. Return nonzero on success.
731
732 FRAME corresponds to the longjmp frame.
733 """,
734 type="int",
735 name="get_longjmp_target",
736 params=[("struct frame_info *", "frame"), ("CORE_ADDR *", "pc")],
737 predicate=True,
738 invalid=True,
739 )
740
741 Value(
742 type="int",
743 name="believe_pcc_promotion",
744 invalid=True,
745 )
746
747 Method(
748 type="int",
749 name="convert_register_p",
750 params=[("int", "regnum"), ("struct type *", "type")],
751 predefault="generic_convert_register_p",
752 invalid=False,
753 )
754
755 Function(
756 type="int",
757 name="register_to_value",
758 params=[
759 ("struct frame_info *", "frame"),
760 ("int", "regnum"),
761 ("struct type *", "type"),
762 ("gdb_byte *", "buf"),
763 ("int *", "optimizedp"),
764 ("int *", "unavailablep"),
765 ],
766 invalid=True,
767 )
768
769 Function(
770 type="void",
771 name="value_to_register",
772 params=[
773 ("struct frame_info *", "frame"),
774 ("int", "regnum"),
775 ("struct type *", "type"),
776 ("const gdb_byte *", "buf"),
777 ],
778 invalid=True,
779 )
780
781 Method(
782 comment="""
783 Construct a value representing the contents of register REGNUM in
784 frame FRAME_ID, interpreted as type TYPE. The routine needs to
785 allocate and return a struct value with all value attributes
786 (but not the value contents) filled in.
787 """,
788 type="struct value *",
789 name="value_from_register",
790 params=[
791 ("struct type *", "type"),
792 ("int", "regnum"),
793 ("struct frame_id", "frame_id"),
794 ],
795 predefault="default_value_from_register",
796 invalid=False,
797 )
798
799 Method(
800 type="CORE_ADDR",
801 name="pointer_to_address",
802 params=[("struct type *", "type"), ("const gdb_byte *", "buf")],
803 predefault="unsigned_pointer_to_address",
804 invalid=False,
805 )
806
807 Method(
808 type="void",
809 name="address_to_pointer",
810 params=[("struct type *", "type"), ("gdb_byte *", "buf"), ("CORE_ADDR", "addr")],
811 predefault="unsigned_address_to_pointer",
812 invalid=False,
813 )
814
815 Method(
816 type="CORE_ADDR",
817 name="integer_to_address",
818 params=[("struct type *", "type"), ("const gdb_byte *", "buf")],
819 predicate=True,
820 invalid=True,
821 )
822
823 Method(
824 comment="""
825 Return the return-value convention that will be used by FUNCTION
826 to return a value of type VALTYPE. FUNCTION may be NULL in which
827 case the return convention is computed based only on VALTYPE.
828
829 If READBUF is not NULL, extract the return value and save it in this buffer.
830
831 If WRITEBUF is not NULL, it contains a return value which will be
832 stored into the appropriate register. This can be used when we want
833 to force the value returned by a function (see the "return" command
834 for instance).
835 """,
836 type="enum return_value_convention",
837 name="return_value",
838 params=[
839 ("struct value *", "function"),
840 ("struct type *", "valtype"),
841 ("struct regcache *", "regcache"),
842 ("gdb_byte *", "readbuf"),
843 ("const gdb_byte *", "writebuf"),
844 ],
845 predicate=True,
846 invalid=True,
847 )
848
849 Method(
850 comment="""
851 Return true if the return value of function is stored in the first hidden
852 parameter. In theory, this feature should be language-dependent, specified
853 by language and its ABI, such as C++. Unfortunately, compiler may
854 implement it to a target-dependent feature. So that we need such hook here
855 to be aware of this in GDB.
856 """,
857 type="int",
858 name="return_in_first_hidden_param_p",
859 params=[("struct type *", "type")],
860 predefault="default_return_in_first_hidden_param_p",
861 invalid=False,
862 )
863
864 Method(
865 type="CORE_ADDR",
866 name="skip_prologue",
867 params=[("CORE_ADDR", "ip")],
868 predefault="0",
869 invalid=True,
870 )
871
872 Method(
873 type="CORE_ADDR",
874 name="skip_main_prologue",
875 params=[("CORE_ADDR", "ip")],
876 predicate=True,
877 invalid=True,
878 )
879
880 Method(
881 comment="""
882 On some platforms, a single function may provide multiple entry points,
883 e.g. one that is used for function-pointer calls and a different one
884 that is used for direct function calls.
885 In order to ensure that breakpoints set on the function will trigger
886 no matter via which entry point the function is entered, a platform
887 may provide the skip_entrypoint callback. It is called with IP set
888 to the main entry point of a function (as determined by the symbol table),
889 and should return the address of the innermost entry point, where the
890 actual breakpoint needs to be set. Note that skip_entrypoint is used
891 by GDB common code even when debugging optimized code, where skip_prologue
892 is not used.
893 """,
894 type="CORE_ADDR",
895 name="skip_entrypoint",
896 params=[("CORE_ADDR", "ip")],
897 predicate=True,
898 invalid=True,
899 )
900
901 Function(
902 type="int",
903 name="inner_than",
904 params=[("CORE_ADDR", "lhs"), ("CORE_ADDR", "rhs")],
905 predefault="0",
906 invalid=True,
907 )
908
909 Method(
910 type="const gdb_byte *",
911 name="breakpoint_from_pc",
912 params=[("CORE_ADDR *", "pcptr"), ("int *", "lenptr")],
913 predefault="default_breakpoint_from_pc",
914 invalid=False,
915 )
916
917 Method(
918 comment="""
919 Return the breakpoint kind for this target based on *PCPTR.
920 """,
921 type="int",
922 name="breakpoint_kind_from_pc",
923 params=[("CORE_ADDR *", "pcptr")],
924 predefault="0",
925 invalid=True,
926 )
927
928 Method(
929 comment="""
930 Return the software breakpoint from KIND. KIND can have target
931 specific meaning like the Z0 kind parameter.
932 SIZE is set to the software breakpoint's length in memory.
933 """,
934 type="const gdb_byte *",
935 name="sw_breakpoint_from_kind",
936 params=[("int", "kind"), ("int *", "size")],
937 predefault="NULL",
938 invalid=False,
939 )
940
941 Method(
942 comment="""
943 Return the breakpoint kind for this target based on the current
944 processor state (e.g. the current instruction mode on ARM) and the
945 *PCPTR. In default, it is gdbarch->breakpoint_kind_from_pc.
946 """,
947 type="int",
948 name="breakpoint_kind_from_current_state",
949 params=[("struct regcache *", "regcache"), ("CORE_ADDR *", "pcptr")],
950 predefault="default_breakpoint_kind_from_current_state",
951 invalid=False,
952 )
953
954 Method(
955 type="CORE_ADDR",
956 name="adjust_breakpoint_address",
957 params=[("CORE_ADDR", "bpaddr")],
958 predicate=True,
959 invalid=True,
960 )
961
962 Method(
963 type="int",
964 name="memory_insert_breakpoint",
965 params=[("struct bp_target_info *", "bp_tgt")],
966 predefault="default_memory_insert_breakpoint",
967 invalid=False,
968 )
969
970 Method(
971 type="int",
972 name="memory_remove_breakpoint",
973 params=[("struct bp_target_info *", "bp_tgt")],
974 predefault="default_memory_remove_breakpoint",
975 invalid=False,
976 )
977
978 Value(
979 type="CORE_ADDR",
980 name="decr_pc_after_break",
981 invalid=False,
982 )
983
984 Value(
985 comment="""
986 A function can be addressed by either it's "pointer" (possibly a
987 descriptor address) or "entry point" (first executable instruction).
988 The method "convert_from_func_ptr_addr" converting the former to the
989 latter. gdbarch_deprecated_function_start_offset is being used to implement
990 a simplified subset of that functionality - the function's address
991 corresponds to the "function pointer" and the function's start
992 corresponds to the "function entry point" - and hence is redundant.
993 """,
994 type="CORE_ADDR",
995 name="deprecated_function_start_offset",
996 invalid=False,
997 )
998
999 Method(
1000 comment="""
1001 Return the remote protocol register number associated with this
1002 register. Normally the identity mapping.
1003 """,
1004 type="int",
1005 name="remote_register_number",
1006 params=[("int", "regno")],
1007 predefault="default_remote_register_number",
1008 invalid=False,
1009 )
1010
1011 Function(
1012 comment="""
1013 Fetch the target specific address used to represent a load module.
1014 """,
1015 type="CORE_ADDR",
1016 name="fetch_tls_load_module_address",
1017 params=[("struct objfile *", "objfile")],
1018 predicate=True,
1019 invalid=True,
1020 )
1021
1022 Method(
1023 comment="""
1024 Return the thread-local address at OFFSET in the thread-local
1025 storage for the thread PTID and the shared library or executable
1026 file given by LM_ADDR. If that block of thread-local storage hasn't
1027 been allocated yet, this function may throw an error. LM_ADDR may
1028 be zero for statically linked multithreaded inferiors.
1029 """,
1030 type="CORE_ADDR",
1031 name="get_thread_local_address",
1032 params=[("ptid_t", "ptid"), ("CORE_ADDR", "lm_addr"), ("CORE_ADDR", "offset")],
1033 predicate=True,
1034 invalid=True,
1035 )
1036
1037 Value(
1038 type="CORE_ADDR",
1039 name="frame_args_skip",
1040 invalid=False,
1041 )
1042
1043 Method(
1044 type="CORE_ADDR",
1045 name="unwind_pc",
1046 params=[("struct frame_info *", "next_frame")],
1047 predefault="default_unwind_pc",
1048 invalid=False,
1049 )
1050
1051 Method(
1052 type="CORE_ADDR",
1053 name="unwind_sp",
1054 params=[("struct frame_info *", "next_frame")],
1055 predefault="default_unwind_sp",
1056 invalid=False,
1057 )
1058
1059 Function(
1060 comment="""
1061 DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
1062 frame-base. Enable frame-base before frame-unwind.
1063 """,
1064 type="int",
1065 name="frame_num_args",
1066 params=[("struct frame_info *", "frame")],
1067 predicate=True,
1068 invalid=True,
1069 )
1070
1071 Method(
1072 type="CORE_ADDR",
1073 name="frame_align",
1074 params=[("CORE_ADDR", "address")],
1075 predicate=True,
1076 invalid=True,
1077 )
1078
1079 Method(
1080 type="int",
1081 name="stabs_argument_has_addr",
1082 params=[("struct type *", "type")],
1083 predefault="default_stabs_argument_has_addr",
1084 invalid=False,
1085 )
1086
1087 Value(
1088 type="int",
1089 name="frame_red_zone_size",
1090 invalid=True,
1091 )
1092
1093 Method(
1094 type="CORE_ADDR",
1095 name="convert_from_func_ptr_addr",
1096 params=[("CORE_ADDR", "addr"), ("struct target_ops *", "targ")],
1097 predefault="convert_from_func_ptr_addr_identity",
1098 invalid=False,
1099 )
1100
1101 Method(
1102 comment="""
1103 On some machines there are bits in addresses which are not really
1104 part of the address, but are used by the kernel, the hardware, etc.
1105 for special purposes. gdbarch_addr_bits_remove takes out any such bits so
1106 we get a "real" address such as one would find in a symbol table.
1107 This is used only for addresses of instructions, and even then I'm
1108 not sure it's used in all contexts. It exists to deal with there
1109 being a few stray bits in the PC which would mislead us, not as some
1110 sort of generic thing to handle alignment or segmentation (it's
1111 possible it should be in TARGET_READ_PC instead).
1112 """,
1113 type="CORE_ADDR",
1114 name="addr_bits_remove",
1115 params=[("CORE_ADDR", "addr")],
1116 predefault="core_addr_identity",
1117 invalid=False,
1118 )
1119
1120 Value(
1121 comment="""
1122 On some machines, not all bits of an address word are significant.
1123 For example, on AArch64, the top bits of an address known as the "tag"
1124 are ignored by the kernel, the hardware, etc. and can be regarded as
1125 additional data associated with the address.
1126 """,
1127 type="int",
1128 name="significant_addr_bit",
1129 invalid=False,
1130 )
1131
1132 Method(
1133 comment="""
1134 Return a string representation of the memory tag TAG.
1135 """,
1136 type="std::string",
1137 name="memtag_to_string",
1138 params=[("struct value *", "tag")],
1139 predefault="default_memtag_to_string",
1140 invalid=False,
1141 )
1142
1143 Method(
1144 comment="""
1145 Return true if ADDRESS contains a tag and false otherwise. ADDRESS
1146 must be either a pointer or a reference type.
1147 """,
1148 type="bool",
1149 name="tagged_address_p",
1150 params=[("struct value *", "address")],
1151 predefault="default_tagged_address_p",
1152 invalid=False,
1153 )
1154
1155 Method(
1156 comment="""
1157 Return true if the tag from ADDRESS matches the memory tag for that
1158 particular address. Return false otherwise.
1159 """,
1160 type="bool",
1161 name="memtag_matches_p",
1162 params=[("struct value *", "address")],
1163 predefault="default_memtag_matches_p",
1164 invalid=False,
1165 )
1166
1167 Method(
1168 comment="""
1169 Set the tags of type TAG_TYPE, for the memory address range
1170 [ADDRESS, ADDRESS + LENGTH) to TAGS.
1171 Return true if successful and false otherwise.
1172 """,
1173 type="bool",
1174 name="set_memtags",
1175 params=[
1176 ("struct value *", "address"),
1177 ("size_t", "length"),
1178 ("const gdb::byte_vector &", "tags"),
1179 ("memtag_type", "tag_type"),
1180 ],
1181 predefault="default_set_memtags",
1182 invalid=False,
1183 )
1184
1185 Method(
1186 comment="""
1187 Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
1188 assuming ADDRESS is tagged.
1189 """,
1190 type="struct value *",
1191 name="get_memtag",
1192 params=[("struct value *", "address"), ("memtag_type", "tag_type")],
1193 predefault="default_get_memtag",
1194 invalid=False,
1195 )
1196
1197 Value(
1198 comment="""
1199 memtag_granule_size is the size of the allocation tag granule, for
1200 architectures that support memory tagging.
1201 This is 0 for architectures that do not support memory tagging.
1202 For a non-zero value, this represents the number of bytes of memory per tag.
1203 """,
1204 type="CORE_ADDR",
1205 name="memtag_granule_size",
1206 invalid=False,
1207 )
1208
1209 Function(
1210 comment="""
1211 FIXME/cagney/2001-01-18: This should be split in two. A target method that
1212 indicates if the target needs software single step. An ISA method to
1213 implement it.
1214
1215 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
1216 target can single step. If not, then implement single step using breakpoints.
1217
1218 Return a vector of addresses on which the software single step
1219 breakpoints should be inserted. NULL means software single step is
1220 not used.
1221 Multiple breakpoints may be inserted for some instructions such as
1222 conditional branch. However, each implementation must always evaluate
1223 the condition and only put the breakpoint at the branch destination if
1224 the condition is true, so that we ensure forward progress when stepping
1225 past a conditional branch to self.
1226 """,
1227 type="std::vector<CORE_ADDR>",
1228 name="software_single_step",
1229 params=[("struct regcache *", "regcache")],
1230 predicate=True,
1231 invalid=True,
1232 )
1233
1234 Method(
1235 comment="""
1236 Return non-zero if the processor is executing a delay slot and a
1237 further single-step is needed before the instruction finishes.
1238 """,
1239 type="int",
1240 name="single_step_through_delay",
1241 params=[("struct frame_info *", "frame")],
1242 predicate=True,
1243 invalid=True,
1244 )
1245
1246 Function(
1247 comment="""
1248 FIXME: cagney/2003-08-28: Need to find a better way of selecting the
1249 disassembler. Perhaps objdump can handle it?
1250 """,
1251 type="int",
1252 name="print_insn",
1253 params=[("bfd_vma", "vma"), ("struct disassemble_info *", "info")],
1254 predefault="default_print_insn",
1255 invalid=False,
1256 )
1257
1258 Function(
1259 type="CORE_ADDR",
1260 name="skip_trampoline_code",
1261 params=[("struct frame_info *", "frame"), ("CORE_ADDR", "pc")],
1262 predefault="generic_skip_trampoline_code",
1263 invalid=False,
1264 )
1265
1266 Method(
1267 comment="""
1268 If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
1269 evaluates non-zero, this is the address where the debugger will place
1270 a step-resume breakpoint to get us past the dynamic linker.
1271 """,
1272 type="CORE_ADDR",
1273 name="skip_solib_resolver",
1274 params=[("CORE_ADDR", "pc")],
1275 predefault="generic_skip_solib_resolver",
1276 invalid=False,
1277 )
1278
1279 Method(
1280 comment="""
1281 Some systems also have trampoline code for returning from shared libs.
1282 """,
1283 type="int",
1284 name="in_solib_return_trampoline",
1285 params=[("CORE_ADDR", "pc"), ("const char *", "name")],
1286 predefault="generic_in_solib_return_trampoline",
1287 invalid=False,
1288 )
1289
1290 Method(
1291 comment="""
1292 Return true if PC lies inside an indirect branch thunk.
1293 """,
1294 type="bool",
1295 name="in_indirect_branch_thunk",
1296 params=[("CORE_ADDR", "pc")],
1297 predefault="default_in_indirect_branch_thunk",
1298 invalid=False,
1299 )
1300
1301 Method(
1302 comment="""
1303 A target might have problems with watchpoints as soon as the stack
1304 frame of the current function has been destroyed. This mostly happens
1305 as the first action in a function's epilogue. stack_frame_destroyed_p()
1306 is defined to return a non-zero value if either the given addr is one
1307 instruction after the stack destroying instruction up to the trailing
1308 return instruction or if we can figure out that the stack frame has
1309 already been invalidated regardless of the value of addr. Targets
1310 which don't suffer from that problem could just let this functionality
1311 untouched.
1312 """,
1313 type="int",
1314 name="stack_frame_destroyed_p",
1315 params=[("CORE_ADDR", "addr")],
1316 predefault="generic_stack_frame_destroyed_p",
1317 invalid=False,
1318 )
1319
1320 Function(
1321 comment="""
1322 Process an ELF symbol in the minimal symbol table in a backend-specific
1323 way. Normally this hook is supposed to do nothing, however if required,
1324 then this hook can be used to apply tranformations to symbols that are
1325 considered special in some way. For example the MIPS backend uses it
1326 to interpret `st_other' information to mark compressed code symbols so
1327 that they can be treated in the appropriate manner in the processing of
1328 the main symbol table and DWARF-2 records.
1329 """,
1330 type="void",
1331 name="elf_make_msymbol_special",
1332 params=[("asymbol *", "sym"), ("struct minimal_symbol *", "msym")],
1333 predicate=True,
1334 invalid=True,
1335 )
1336
1337 Function(
1338 type="void",
1339 name="coff_make_msymbol_special",
1340 params=[("int", "val"), ("struct minimal_symbol *", "msym")],
1341 predefault="default_coff_make_msymbol_special",
1342 invalid=False,
1343 )
1344
1345 Function(
1346 comment="""
1347 Process a symbol in the main symbol table in a backend-specific way.
1348 Normally this hook is supposed to do nothing, however if required,
1349 then this hook can be used to apply tranformations to symbols that
1350 are considered special in some way. This is currently used by the
1351 MIPS backend to make sure compressed code symbols have the ISA bit
1352 set. This in turn is needed for symbol values seen in GDB to match
1353 the values used at the runtime by the program itself, for function
1354 and label references.
1355 """,
1356 type="void",
1357 name="make_symbol_special",
1358 params=[("struct symbol *", "sym"), ("struct objfile *", "objfile")],
1359 predefault="default_make_symbol_special",
1360 invalid=False,
1361 )
1362
1363 Function(
1364 comment="""
1365 Adjust the address retrieved from a DWARF-2 record other than a line
1366 entry in a backend-specific way. Normally this hook is supposed to
1367 return the address passed unchanged, however if that is incorrect for
1368 any reason, then this hook can be used to fix the address up in the
1369 required manner. This is currently used by the MIPS backend to make
1370 sure addresses in FDE, range records, etc. referring to compressed
1371 code have the ISA bit set, matching line information and the symbol
1372 table.
1373 """,
1374 type="CORE_ADDR",
1375 name="adjust_dwarf2_addr",
1376 params=[("CORE_ADDR", "pc")],
1377 predefault="default_adjust_dwarf2_addr",
1378 invalid=False,
1379 )
1380
1381 Function(
1382 comment="""
1383 Adjust the address updated by a line entry in a backend-specific way.
1384 Normally this hook is supposed to return the address passed unchanged,
1385 however in the case of inconsistencies in these records, this hook can
1386 be used to fix them up in the required manner. This is currently used
1387 by the MIPS backend to make sure all line addresses in compressed code
1388 are presented with the ISA bit set, which is not always the case. This
1389 in turn ensures breakpoint addresses are correctly matched against the
1390 stop PC.
1391 """,
1392 type="CORE_ADDR",
1393 name="adjust_dwarf2_line",
1394 params=[("CORE_ADDR", "addr"), ("int", "rel")],
1395 predefault="default_adjust_dwarf2_line",
1396 invalid=False,
1397 )
1398
1399 Value(
1400 type="int",
1401 name="cannot_step_breakpoint",
1402 predefault="0",
1403 invalid=False,
1404 )
1405
1406 Value(
1407 comment="""
1408 See comment in target.h about continuable, steppable and
1409 non-steppable watchpoints.
1410 """,
1411 type="int",
1412 name="have_nonsteppable_watchpoint",
1413 predefault="0",
1414 invalid=False,
1415 )
1416
1417 Function(
1418 type="type_instance_flags",
1419 name="address_class_type_flags",
1420 params=[("int", "byte_size"), ("int", "dwarf2_addr_class")],
1421 predicate=True,
1422 invalid=True,
1423 )
1424
1425 Method(
1426 type="const char *",
1427 name="address_class_type_flags_to_name",
1428 params=[("type_instance_flags", "type_flags")],
1429 predicate=True,
1430 invalid=True,
1431 )
1432
1433 Method(
1434 comment="""
1435 Execute vendor-specific DWARF Call Frame Instruction. OP is the instruction.
1436 FS are passed from the generic execute_cfa_program function.
1437 """,
1438 type="bool",
1439 name="execute_dwarf_cfa_vendor_op",
1440 params=[("gdb_byte", "op"), ("struct dwarf2_frame_state *", "fs")],
1441 predefault="default_execute_dwarf_cfa_vendor_op",
1442 invalid=False,
1443 )
1444
1445 Method(
1446 comment="""
1447 Return the appropriate type_flags for the supplied address class.
1448 This function should return true if the address class was recognized and
1449 type_flags was set, false otherwise.
1450 """,
1451 type="bool",
1452 name="address_class_name_to_type_flags",
1453 params=[("const char *", "name"), ("type_instance_flags *", "type_flags_ptr")],
1454 predicate=True,
1455 invalid=True,
1456 )
1457
1458 Method(
1459 comment="""
1460 Is a register in a group
1461 """,
1462 type="int",
1463 name="register_reggroup_p",
1464 params=[("int", "regnum"), ("struct reggroup *", "reggroup")],
1465 predefault="default_register_reggroup_p",
1466 invalid=False,
1467 )
1468
1469 Function(
1470 comment="""
1471 Fetch the pointer to the ith function argument.
1472 """,
1473 type="CORE_ADDR",
1474 name="fetch_pointer_argument",
1475 params=[
1476 ("struct frame_info *", "frame"),
1477 ("int", "argi"),
1478 ("struct type *", "type"),
1479 ],
1480 predicate=True,
1481 invalid=True,
1482 )
1483
1484 Method(
1485 comment="""
1486 Iterate over all supported register notes in a core file. For each
1487 supported register note section, the iterator must call CB and pass
1488 CB_DATA unchanged. If REGCACHE is not NULL, the iterator can limit
1489 the supported register note sections based on the current register
1490 values. Otherwise it should enumerate all supported register note
1491 sections.
1492 """,
1493 type="void",
1494 name="iterate_over_regset_sections",
1495 params=[
1496 ("iterate_over_regset_sections_cb *", "cb"),
1497 ("void *", "cb_data"),
1498 ("const struct regcache *", "regcache"),
1499 ],
1500 predicate=True,
1501 invalid=True,
1502 )
1503
1504 Method(
1505 comment="""
1506 Create core file notes
1507 """,
1508 type="gdb::unique_xmalloc_ptr<char>",
1509 name="make_corefile_notes",
1510 params=[("bfd *", "obfd"), ("int *", "note_size")],
1511 predicate=True,
1512 invalid=True,
1513 )
1514
1515 Method(
1516 comment="""
1517 Find core file memory regions
1518 """,
1519 type="int",
1520 name="find_memory_regions",
1521 params=[("find_memory_region_ftype", "func"), ("void *", "data")],
1522 predicate=True,
1523 invalid=True,
1524 )
1525
1526 Method(
1527 comment="""
1528 Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
1529 core file into buffer READBUF with length LEN. Return the number of bytes read
1530 (zero indicates failure).
1531 failed, otherwise, return the red length of READBUF.
1532 """,
1533 type="ULONGEST",
1534 name="core_xfer_shared_libraries",
1535 params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1536 predicate=True,
1537 invalid=True,
1538 )
1539
1540 Method(
1541 comment="""
1542 Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
1543 libraries list from core file into buffer READBUF with length LEN.
1544 Return the number of bytes read (zero indicates failure).
1545 """,
1546 type="ULONGEST",
1547 name="core_xfer_shared_libraries_aix",
1548 params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1549 predicate=True,
1550 invalid=True,
1551 )
1552
1553 Method(
1554 comment="""
1555 How the core target converts a PTID from a core file to a string.
1556 """,
1557 type="std::string",
1558 name="core_pid_to_str",
1559 params=[("ptid_t", "ptid")],
1560 predicate=True,
1561 invalid=True,
1562 )
1563
1564 Method(
1565 comment="""
1566 How the core target extracts the name of a thread from a core file.
1567 """,
1568 type="const char *",
1569 name="core_thread_name",
1570 params=[("struct thread_info *", "thr")],
1571 predicate=True,
1572 invalid=True,
1573 )
1574
1575 Method(
1576 comment="""
1577 Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
1578 from core file into buffer READBUF with length LEN. Return the number
1579 of bytes read (zero indicates EOF, a negative value indicates failure).
1580 """,
1581 type="LONGEST",
1582 name="core_xfer_siginfo",
1583 params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1584 predicate=True,
1585 invalid=True,
1586 )
1587
1588 Value(
1589 comment="""
1590 BFD target to use when generating a core file.
1591 """,
1592 type="const char *",
1593 name="gcore_bfd_target",
1594 predicate=True,
1595 predefault="0",
1596 invalid=True,
1597 printer="pstring (gdbarch->gcore_bfd_target)",
1598 )
1599
1600 Value(
1601 comment="""
1602 If the elements of C++ vtables are in-place function descriptors rather
1603 than normal function pointers (which may point to code or a descriptor),
1604 set this to one.
1605 """,
1606 type="int",
1607 name="vtable_function_descriptors",
1608 predefault="0",
1609 invalid=False,
1610 )
1611
1612 Value(
1613 comment="""
1614 Set if the least significant bit of the delta is used instead of the least
1615 significant bit of the pfn for pointers to virtual member functions.
1616 """,
1617 type="int",
1618 name="vbit_in_delta",
1619 predefault="0",
1620 invalid=False,
1621 )
1622
1623 Function(
1624 comment="""
1625 Advance PC to next instruction in order to skip a permanent breakpoint.
1626 """,
1627 type="void",
1628 name="skip_permanent_breakpoint",
1629 params=[("struct regcache *", "regcache")],
1630 predefault="default_skip_permanent_breakpoint",
1631 invalid=False,
1632 )
1633
1634 Value(
1635 comment="""
1636 The maximum length of an instruction on this architecture in bytes.
1637 """,
1638 type="ULONGEST",
1639 name="max_insn_length",
1640 predicate=True,
1641 predefault="0",
1642 invalid=True,
1643 )
1644
1645 Method(
1646 comment="""
1647 Copy the instruction at FROM to TO, and make any adjustments
1648 necessary to single-step it at that address.
1649
1650 REGS holds the state the thread's registers will have before
1651 executing the copied instruction; the PC in REGS will refer to FROM,
1652 not the copy at TO. The caller should update it to point at TO later.
1653
1654 Return a pointer to data of the architecture's choice to be passed
1655 to gdbarch_displaced_step_fixup.
1656
1657 For a general explanation of displaced stepping and how GDB uses it,
1658 see the comments in infrun.c.
1659
1660 The TO area is only guaranteed to have space for
1661 gdbarch_max_insn_length (arch) bytes, so this function must not
1662 write more bytes than that to that area.
1663
1664 If you do not provide this function, GDB assumes that the
1665 architecture does not support displaced stepping.
1666
1667 If the instruction cannot execute out of line, return NULL. The
1668 core falls back to stepping past the instruction in-line instead in
1669 that case.
1670 """,
1671 type="displaced_step_copy_insn_closure_up",
1672 name="displaced_step_copy_insn",
1673 params=[("CORE_ADDR", "from"), ("CORE_ADDR", "to"), ("struct regcache *", "regs")],
1674 predicate=True,
1675 invalid=True,
1676 )
1677
1678 Method(
1679 comment="""
1680 Return true if GDB should use hardware single-stepping to execute a displaced
1681 step instruction. If false, GDB will simply restart execution at the
1682 displaced instruction location, and it is up to the target to ensure GDB will
1683 receive control again (e.g. by placing a software breakpoint instruction into
1684 the displaced instruction buffer).
1685
1686 The default implementation returns false on all targets that provide a
1687 gdbarch_software_single_step routine, and true otherwise.
1688 """,
1689 type="bool",
1690 name="displaced_step_hw_singlestep",
1691 params=[],
1692 predefault="default_displaced_step_hw_singlestep",
1693 invalid=False,
1694 )
1695
1696 Method(
1697 comment="""
1698 Fix up the state resulting from successfully single-stepping a
1699 displaced instruction, to give the result we would have gotten from
1700 stepping the instruction in its original location.
1701
1702 REGS is the register state resulting from single-stepping the
1703 displaced instruction.
1704
1705 CLOSURE is the result from the matching call to
1706 gdbarch_displaced_step_copy_insn.
1707
1708 If you provide gdbarch_displaced_step_copy_insn.but not this
1709 function, then GDB assumes that no fixup is needed after
1710 single-stepping the instruction.
1711
1712 For a general explanation of displaced stepping and how GDB uses it,
1713 see the comments in infrun.c.
1714 """,
1715 type="void",
1716 name="displaced_step_fixup",
1717 params=[
1718 ("struct displaced_step_copy_insn_closure *", "closure"),
1719 ("CORE_ADDR", "from"),
1720 ("CORE_ADDR", "to"),
1721 ("struct regcache *", "regs"),
1722 ],
1723 predicate=True,
1724 predefault="NULL",
1725 invalid=True,
1726 )
1727
1728 Method(
1729 comment="""
1730 Prepare THREAD for it to displaced step the instruction at its current PC.
1731
1732 Throw an exception if any unexpected error happens.
1733 """,
1734 type="displaced_step_prepare_status",
1735 name="displaced_step_prepare",
1736 params=[("thread_info *", "thread"), ("CORE_ADDR &", "displaced_pc")],
1737 predicate=True,
1738 invalid=True,
1739 )
1740
1741 Method(
1742 comment="""
1743 Clean up after a displaced step of THREAD.
1744 """,
1745 type="displaced_step_finish_status",
1746 name="displaced_step_finish",
1747 params=[("thread_info *", "thread"), ("gdb_signal", "sig")],
1748 predefault="NULL",
1749 invalid="(! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare)",
1750 )
1751
1752 Function(
1753 comment="""
1754 Return the closure associated to the displaced step buffer that is at ADDR.
1755 """,
1756 type="const displaced_step_copy_insn_closure *",
1757 name="displaced_step_copy_insn_closure_by_addr",
1758 params=[("inferior *", "inf"), ("CORE_ADDR", "addr")],
1759 predicate=True,
1760 invalid=True,
1761 )
1762
1763 Function(
1764 comment="""
1765 PARENT_INF has forked and CHILD_PTID is the ptid of the child. Restore the
1766 contents of all displaced step buffers in the child's address space.
1767 """,
1768 type="void",
1769 name="displaced_step_restore_all_in_ptid",
1770 params=[("inferior *", "parent_inf"), ("ptid_t", "child_ptid")],
1771 invalid=True,
1772 )
1773
1774 Method(
1775 comment="""
1776 Relocate an instruction to execute at a different address. OLDLOC
1777 is the address in the inferior memory where the instruction to
1778 relocate is currently at. On input, TO points to the destination
1779 where we want the instruction to be copied (and possibly adjusted)
1780 to. On output, it points to one past the end of the resulting
1781 instruction(s). The effect of executing the instruction at TO shall
1782 be the same as if executing it at FROM. For example, call
1783 instructions that implicitly push the return address on the stack
1784 should be adjusted to return to the instruction after OLDLOC;
1785 relative branches, and other PC-relative instructions need the
1786 offset adjusted; etc.
1787 """,
1788 type="void",
1789 name="relocate_instruction",
1790 params=[("CORE_ADDR *", "to"), ("CORE_ADDR", "from")],
1791 predicate=True,
1792 predefault="NULL",
1793 invalid=True,
1794 )
1795
1796 Function(
1797 comment="""
1798 Refresh overlay mapped state for section OSECT.
1799 """,
1800 type="void",
1801 name="overlay_update",
1802 params=[("struct obj_section *", "osect")],
1803 predicate=True,
1804 invalid=True,
1805 )
1806
1807 Method(
1808 type="const struct target_desc *",
1809 name="core_read_description",
1810 params=[("struct target_ops *", "target"), ("bfd *", "abfd")],
1811 predicate=True,
1812 invalid=True,
1813 )
1814
1815 Value(
1816 comment="""
1817 Set if the address in N_SO or N_FUN stabs may be zero.
1818 """,
1819 type="int",
1820 name="sofun_address_maybe_missing",
1821 predefault="0",
1822 invalid=False,
1823 )
1824
1825 Method(
1826 comment="""
1827 Parse the instruction at ADDR storing in the record execution log
1828 the registers REGCACHE and memory ranges that will be affected when
1829 the instruction executes, along with their current values.
1830 Return -1 if something goes wrong, 0 otherwise.
1831 """,
1832 type="int",
1833 name="process_record",
1834 params=[("struct regcache *", "regcache"), ("CORE_ADDR", "addr")],
1835 predicate=True,
1836 invalid=True,
1837 )
1838
1839 Method(
1840 comment="""
1841 Save process state after a signal.
1842 Return -1 if something goes wrong, 0 otherwise.
1843 """,
1844 type="int",
1845 name="process_record_signal",
1846 params=[("struct regcache *", "regcache"), ("enum gdb_signal", "signal")],
1847 predicate=True,
1848 invalid=True,
1849 )
1850
1851 Method(
1852 comment="""
1853 Signal translation: translate inferior's signal (target's) number
1854 into GDB's representation. The implementation of this method must
1855 be host independent. IOW, don't rely on symbols of the NAT_FILE
1856 header (the nm-*.h files), the host <signal.h> header, or similar
1857 headers. This is mainly used when cross-debugging core files ---
1858 "Live" targets hide the translation behind the target interface
1859 (target_wait, target_resume, etc.).
1860 """,
1861 type="enum gdb_signal",
1862 name="gdb_signal_from_target",
1863 params=[("int", "signo")],
1864 predicate=True,
1865 invalid=True,
1866 )
1867
1868 Method(
1869 comment="""
1870 Signal translation: translate the GDB's internal signal number into
1871 the inferior's signal (target's) representation. The implementation
1872 of this method must be host independent. IOW, don't rely on symbols
1873 of the NAT_FILE header (the nm-*.h files), the host <signal.h>
1874 header, or similar headers.
1875 Return the target signal number if found, or -1 if the GDB internal
1876 signal number is invalid.
1877 """,
1878 type="int",
1879 name="gdb_signal_to_target",
1880 params=[("enum gdb_signal", "signal")],
1881 predicate=True,
1882 invalid=True,
1883 )
1884
1885 Method(
1886 comment="""
1887 Extra signal info inspection.
1888
1889 Return a type suitable to inspect extra signal information.
1890 """,
1891 type="struct type *",
1892 name="get_siginfo_type",
1893 params=[],
1894 predicate=True,
1895 invalid=True,
1896 )
1897
1898 Method(
1899 comment="""
1900 Record architecture-specific information from the symbol table.
1901 """,
1902 type="void",
1903 name="record_special_symbol",
1904 params=[("struct objfile *", "objfile"), ("asymbol *", "sym")],
1905 predicate=True,
1906 invalid=True,
1907 )
1908
1909 Method(
1910 comment="""
1911 Function for the 'catch syscall' feature.
1912 Get architecture-specific system calls information from registers.
1913 """,
1914 type="LONGEST",
1915 name="get_syscall_number",
1916 params=[("thread_info *", "thread")],
1917 predicate=True,
1918 invalid=True,
1919 )
1920
1921 Value(
1922 comment="""
1923 The filename of the XML syscall for this architecture.
1924 """,
1925 type="const char *",
1926 name="xml_syscall_file",
1927 predefault="0",
1928 invalid=False,
1929 printer="pstring (gdbarch->xml_syscall_file)",
1930 )
1931
1932 Value(
1933 comment="""
1934 Information about system calls from this architecture
1935 """,
1936 type="struct syscalls_info *",
1937 name="syscalls_info",
1938 predefault="0",
1939 invalid=False,
1940 printer="host_address_to_string (gdbarch->syscalls_info)",
1941 )
1942
1943 Value(
1944 comment="""
1945 SystemTap related fields and functions.
1946 A NULL-terminated array of prefixes used to mark an integer constant
1947 on the architecture's assembly.
1948 For example, on x86 integer constants are written as:
1949
1950 $10 ;; integer constant 10
1951
1952 in this case, this prefix would be the character `$'.
1953 """,
1954 type="const char *const *",
1955 name="stap_integer_prefixes",
1956 predefault="0",
1957 invalid=False,
1958 printer="pstring_list (gdbarch->stap_integer_prefixes)",
1959 )
1960
1961 Value(
1962 comment="""
1963 A NULL-terminated array of suffixes used to mark an integer constant
1964 on the architecture's assembly.
1965 """,
1966 type="const char *const *",
1967 name="stap_integer_suffixes",
1968 predefault="0",
1969 invalid=False,
1970 printer="pstring_list (gdbarch->stap_integer_suffixes)",
1971 )
1972
1973 Value(
1974 comment="""
1975 A NULL-terminated array of prefixes used to mark a register name on
1976 the architecture's assembly.
1977 For example, on x86 the register name is written as:
1978
1979 %eax ;; register eax
1980
1981 in this case, this prefix would be the character `%'.
1982 """,
1983 type="const char *const *",
1984 name="stap_register_prefixes",
1985 predefault="0",
1986 invalid=False,
1987 printer="pstring_list (gdbarch->stap_register_prefixes)",
1988 )
1989
1990 Value(
1991 comment="""
1992 A NULL-terminated array of suffixes used to mark a register name on
1993 the architecture's assembly.
1994 """,
1995 type="const char *const *",
1996 name="stap_register_suffixes",
1997 predefault="0",
1998 invalid=False,
1999 printer="pstring_list (gdbarch->stap_register_suffixes)",
2000 )
2001
2002 Value(
2003 comment="""
2004 A NULL-terminated array of prefixes used to mark a register
2005 indirection on the architecture's assembly.
2006 For example, on x86 the register indirection is written as:
2007
2008 (%eax) ;; indirecting eax
2009
2010 in this case, this prefix would be the charater `('.
2011
2012 Please note that we use the indirection prefix also for register
2013 displacement, e.g., `4(%eax)' on x86.
2014 """,
2015 type="const char *const *",
2016 name="stap_register_indirection_prefixes",
2017 predefault="0",
2018 invalid=False,
2019 printer="pstring_list (gdbarch->stap_register_indirection_prefixes)",
2020 )
2021
2022 Value(
2023 comment="""
2024 A NULL-terminated array of suffixes used to mark a register
2025 indirection on the architecture's assembly.
2026 For example, on x86 the register indirection is written as:
2027
2028 (%eax) ;; indirecting eax
2029
2030 in this case, this prefix would be the charater `)'.
2031
2032 Please note that we use the indirection suffix also for register
2033 displacement, e.g., `4(%eax)' on x86.
2034 """,
2035 type="const char *const *",
2036 name="stap_register_indirection_suffixes",
2037 predefault="0",
2038 invalid=False,
2039 printer="pstring_list (gdbarch->stap_register_indirection_suffixes)",
2040 )
2041
2042 Value(
2043 comment="""
2044 Prefix(es) used to name a register using GDB's nomenclature.
2045
2046 For example, on PPC a register is represented by a number in the assembly
2047 language (e.g., `10' is the 10th general-purpose register). However,
2048 inside GDB this same register has an `r' appended to its name, so the 10th
2049 register would be represented as `r10' internally.
2050 """,
2051 type="const char *",
2052 name="stap_gdb_register_prefix",
2053 predefault="0",
2054 invalid=False,
2055 printer="pstring (gdbarch->stap_gdb_register_prefix)",
2056 )
2057
2058 Value(
2059 comment="""
2060 Suffix used to name a register using GDB's nomenclature.
2061 """,
2062 type="const char *",
2063 name="stap_gdb_register_suffix",
2064 predefault="0",
2065 invalid=False,
2066 printer="pstring (gdbarch->stap_gdb_register_suffix)",
2067 )
2068
2069 Method(
2070 comment="""
2071 Check if S is a single operand.
2072
2073 Single operands can be:
2074 - Literal integers, e.g. `$10' on x86
2075 - Register access, e.g. `%eax' on x86
2076 - Register indirection, e.g. `(%eax)' on x86
2077 - Register displacement, e.g. `4(%eax)' on x86
2078
2079 This function should check for these patterns on the string
2080 and return 1 if some were found, or zero otherwise. Please try to match
2081 as much info as you can from the string, i.e., if you have to match
2082 something like `(%', do not match just the `('.
2083 """,
2084 type="int",
2085 name="stap_is_single_operand",
2086 params=[("const char *", "s")],
2087 predicate=True,
2088 invalid=True,
2089 )
2090
2091 Method(
2092 comment="""
2093 Function used to handle a "special case" in the parser.
2094
2095 A "special case" is considered to be an unknown token, i.e., a token
2096 that the parser does not know how to parse. A good example of special
2097 case would be ARM's register displacement syntax:
2098
2099 [R0, #4] ;; displacing R0 by 4
2100
2101 Since the parser assumes that a register displacement is of the form:
2102
2103 <number> <indirection_prefix> <register_name> <indirection_suffix>
2104
2105 it means that it will not be able to recognize and parse this odd syntax.
2106 Therefore, we should add a special case function that will handle this token.
2107
2108 This function should generate the proper expression form of the expression
2109 using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
2110 and so on). It should also return 1 if the parsing was successful, or zero
2111 if the token was not recognized as a special token (in this case, returning
2112 zero means that the special parser is deferring the parsing to the generic
2113 parser), and should advance the buffer pointer (p->arg).
2114 """,
2115 type="expr::operation_up",
2116 name="stap_parse_special_token",
2117 params=[("struct stap_parse_info *", "p")],
2118 predicate=True,
2119 invalid=True,
2120 )
2121
2122 Method(
2123 comment="""
2124 Perform arch-dependent adjustments to a register name.
2125
2126 In very specific situations, it may be necessary for the register
2127 name present in a SystemTap probe's argument to be handled in a
2128 special way. For example, on i386, GCC may over-optimize the
2129 register allocation and use smaller registers than necessary. In
2130 such cases, the client that is reading and evaluating the SystemTap
2131 probe (ourselves) will need to actually fetch values from the wider
2132 version of the register in question.
2133
2134 To illustrate the example, consider the following probe argument
2135 (i386):
2136
2137 4@%ax
2138
2139 This argument says that its value can be found at the %ax register,
2140 which is a 16-bit register. However, the argument's prefix says
2141 that its type is "uint32_t", which is 32-bit in size. Therefore, in
2142 this case, GDB should actually fetch the probe's value from register
2143 %eax, not %ax. In this scenario, this function would actually
2144 replace the register name from %ax to %eax.
2145
2146 The rationale for this can be found at PR breakpoints/24541.
2147 """,
2148 type="std::string",
2149 name="stap_adjust_register",
2150 params=[
2151 ("struct stap_parse_info *", "p"),
2152 ("const std::string &", "regname"),
2153 ("int", "regnum"),
2154 ],
2155 predicate=True,
2156 invalid=True,
2157 )
2158
2159 Method(
2160 comment="""
2161 DTrace related functions.
2162 The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
2163 NARG must be >= 0.
2164 """,
2165 type="expr::operation_up",
2166 name="dtrace_parse_probe_argument",
2167 params=[("int", "narg")],
2168 predicate=True,
2169 invalid=True,
2170 )
2171
2172 Method(
2173 comment="""
2174 True if the given ADDR does not contain the instruction sequence
2175 corresponding to a disabled DTrace is-enabled probe.
2176 """,
2177 type="int",
2178 name="dtrace_probe_is_enabled",
2179 params=[("CORE_ADDR", "addr")],
2180 predicate=True,
2181 invalid=True,
2182 )
2183
2184 Method(
2185 comment="""
2186 Enable a DTrace is-enabled probe at ADDR.
2187 """,
2188 type="void",
2189 name="dtrace_enable_probe",
2190 params=[("CORE_ADDR", "addr")],
2191 predicate=True,
2192 invalid=True,
2193 )
2194
2195 Method(
2196 comment="""
2197 Disable a DTrace is-enabled probe at ADDR.
2198 """,
2199 type="void",
2200 name="dtrace_disable_probe",
2201 params=[("CORE_ADDR", "addr")],
2202 predicate=True,
2203 invalid=True,
2204 )
2205
2206 Value(
2207 comment="""
2208 True if the list of shared libraries is one and only for all
2209 processes, as opposed to a list of shared libraries per inferior.
2210 This usually means that all processes, although may or may not share
2211 an address space, will see the same set of symbols at the same
2212 addresses.
2213 """,
2214 type="int",
2215 name="has_global_solist",
2216 predefault="0",
2217 invalid=False,
2218 )
2219
2220 Value(
2221 comment="""
2222 On some targets, even though each inferior has its own private
2223 address space, the debug interface takes care of making breakpoints
2224 visible to all address spaces automatically. For such cases,
2225 this property should be set to true.
2226 """,
2227 type="int",
2228 name="has_global_breakpoints",
2229 predefault="0",
2230 invalid=False,
2231 )
2232
2233 Method(
2234 comment="""
2235 True if inferiors share an address space (e.g., uClinux).
2236 """,
2237 type="int",
2238 name="has_shared_address_space",
2239 params=[],
2240 predefault="default_has_shared_address_space",
2241 invalid=False,
2242 )
2243
2244 Method(
2245 comment="""
2246 True if a fast tracepoint can be set at an address.
2247 """,
2248 type="int",
2249 name="fast_tracepoint_valid_at",
2250 params=[("CORE_ADDR", "addr"), ("std::string *", "msg")],
2251 predefault="default_fast_tracepoint_valid_at",
2252 invalid=False,
2253 )
2254
2255 Method(
2256 comment="""
2257 Guess register state based on tracepoint location. Used for tracepoints
2258 where no registers have been collected, but there's only one location,
2259 allowing us to guess the PC value, and perhaps some other registers.
2260 On entry, regcache has all registers marked as unavailable.
2261 """,
2262 type="void",
2263 name="guess_tracepoint_registers",
2264 params=[("struct regcache *", "regcache"), ("CORE_ADDR", "addr")],
2265 predefault="default_guess_tracepoint_registers",
2266 invalid=False,
2267 )
2268
2269 Function(
2270 comment="""
2271 Return the "auto" target charset.
2272 """,
2273 type="const char *",
2274 name="auto_charset",
2275 params=[],
2276 predefault="default_auto_charset",
2277 invalid=False,
2278 )
2279
2280 Function(
2281 comment="""
2282 Return the "auto" target wide charset.
2283 """,
2284 type="const char *",
2285 name="auto_wide_charset",
2286 params=[],
2287 predefault="default_auto_wide_charset",
2288 invalid=False,
2289 )
2290
2291 Value(
2292 comment="""
2293 If non-empty, this is a file extension that will be opened in place
2294 of the file extension reported by the shared library list.
2295
2296 This is most useful for toolchains that use a post-linker tool,
2297 where the names of the files run on the target differ in extension
2298 compared to the names of the files GDB should load for debug info.
2299 """,
2300 type="const char *",
2301 name="solib_symbols_extension",
2302 invalid=True,
2303 printer="pstring (gdbarch->solib_symbols_extension)",
2304 )
2305
2306 Value(
2307 comment="""
2308 If true, the target OS has DOS-based file system semantics. That
2309 is, absolute paths include a drive name, and the backslash is
2310 considered a directory separator.
2311 """,
2312 type="int",
2313 name="has_dos_based_file_system",
2314 predefault="0",
2315 invalid=False,
2316 )
2317
2318 Method(
2319 comment="""
2320 Generate bytecodes to collect the return address in a frame.
2321 Since the bytecodes run on the target, possibly with GDB not even
2322 connected, the full unwinding machinery is not available, and
2323 typically this function will issue bytecodes for one or more likely
2324 places that the return address may be found.
2325 """,
2326 type="void",
2327 name="gen_return_address",
2328 params=[
2329 ("struct agent_expr *", "ax"),
2330 ("struct axs_value *", "value"),
2331 ("CORE_ADDR", "scope"),
2332 ],
2333 predefault="default_gen_return_address",
2334 invalid=False,
2335 )
2336
2337 Method(
2338 comment="""
2339 Implement the "info proc" command.
2340 """,
2341 type="void",
2342 name="info_proc",
2343 params=[("const char *", "args"), ("enum info_proc_what", "what")],
2344 predicate=True,
2345 invalid=True,
2346 )
2347
2348 Method(
2349 comment="""
2350 Implement the "info proc" command for core files. Noe that there
2351 are two "info_proc"-like methods on gdbarch -- one for core files,
2352 one for live targets.
2353 """,
2354 type="void",
2355 name="core_info_proc",
2356 params=[("const char *", "args"), ("enum info_proc_what", "what")],
2357 predicate=True,
2358 invalid=True,
2359 )
2360
2361 Method(
2362 comment="""
2363 Iterate over all objfiles in the order that makes the most sense
2364 for the architecture to make global symbol searches.
2365
2366 CB is a callback function where OBJFILE is the objfile to be searched,
2367 and CB_DATA a pointer to user-defined data (the same data that is passed
2368 when calling this gdbarch method). The iteration stops if this function
2369 returns nonzero.
2370
2371 CB_DATA is a pointer to some user-defined data to be passed to
2372 the callback.
2373
2374 If not NULL, CURRENT_OBJFILE corresponds to the objfile being
2375 inspected when the symbol search was requested.
2376 """,
2377 type="void",
2378 name="iterate_over_objfiles_in_search_order",
2379 params=[
2380 ("iterate_over_objfiles_in_search_order_cb_ftype *", "cb"),
2381 ("void *", "cb_data"),
2382 ("struct objfile *", "current_objfile"),
2383 ],
2384 predefault="default_iterate_over_objfiles_in_search_order",
2385 invalid=False,
2386 )
2387
2388 Value(
2389 comment="""
2390 Ravenscar arch-dependent ops.
2391 """,
2392 type="struct ravenscar_arch_ops *",
2393 name="ravenscar_ops",
2394 predefault="NULL",
2395 invalid=False,
2396 printer="host_address_to_string (gdbarch->ravenscar_ops)",
2397 )
2398
2399 Method(
2400 comment="""
2401 Return non-zero if the instruction at ADDR is a call; zero otherwise.
2402 """,
2403 type="int",
2404 name="insn_is_call",
2405 params=[("CORE_ADDR", "addr")],
2406 predefault="default_insn_is_call",
2407 invalid=False,
2408 )
2409
2410 Method(
2411 comment="""
2412 Return non-zero if the instruction at ADDR is a return; zero otherwise.
2413 """,
2414 type="int",
2415 name="insn_is_ret",
2416 params=[("CORE_ADDR", "addr")],
2417 predefault="default_insn_is_ret",
2418 invalid=False,
2419 )
2420
2421 Method(
2422 comment="""
2423 Return non-zero if the instruction at ADDR is a jump; zero otherwise.
2424 """,
2425 type="int",
2426 name="insn_is_jump",
2427 params=[("CORE_ADDR", "addr")],
2428 predefault="default_insn_is_jump",
2429 invalid=False,
2430 )
2431
2432 Method(
2433 comment="""
2434 Return true if there's a program/permanent breakpoint planted in
2435 memory at ADDRESS, return false otherwise.
2436 """,
2437 type="bool",
2438 name="program_breakpoint_here_p",
2439 params=[("CORE_ADDR", "address")],
2440 predefault="default_program_breakpoint_here_p",
2441 invalid=False,
2442 )
2443
2444 Method(
2445 comment="""
2446 Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
2447 Return 0 if *READPTR is already at the end of the buffer.
2448 Return -1 if there is insufficient buffer for a whole entry.
2449 Return 1 if an entry was read into *TYPEP and *VALP.
2450 """,
2451 type="int",
2452 name="auxv_parse",
2453 params=[
2454 ("gdb_byte **", "readptr"),
2455 ("gdb_byte *", "endptr"),
2456 ("CORE_ADDR *", "typep"),
2457 ("CORE_ADDR *", "valp"),
2458 ],
2459 predicate=True,
2460 invalid=True,
2461 )
2462
2463 Method(
2464 comment="""
2465 Print the description of a single auxv entry described by TYPE and VAL
2466 to FILE.
2467 """,
2468 type="void",
2469 name="print_auxv_entry",
2470 params=[("struct ui_file *", "file"), ("CORE_ADDR", "type"), ("CORE_ADDR", "val")],
2471 predefault="default_print_auxv_entry",
2472 invalid=False,
2473 )
2474
2475 Method(
2476 comment="""
2477 Find the address range of the current inferior's vsyscall/vDSO, and
2478 write it to *RANGE. If the vsyscall's length can't be determined, a
2479 range with zero length is returned. Returns true if the vsyscall is
2480 found, false otherwise.
2481 """,
2482 type="int",
2483 name="vsyscall_range",
2484 params=[("struct mem_range *", "range")],
2485 predefault="default_vsyscall_range",
2486 invalid=False,
2487 )
2488
2489 Function(
2490 comment="""
2491 Allocate SIZE bytes of PROT protected page aligned memory in inferior.
2492 PROT has GDB_MMAP_PROT_* bitmask format.
2493 Throw an error if it is not possible. Returned address is always valid.
2494 """,
2495 type="CORE_ADDR",
2496 name="infcall_mmap",
2497 params=[("CORE_ADDR", "size"), ("unsigned", "prot")],
2498 predefault="default_infcall_mmap",
2499 invalid=False,
2500 )
2501
2502 Function(
2503 comment="""
2504 Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
2505 Print a warning if it is not possible.
2506 """,
2507 type="void",
2508 name="infcall_munmap",
2509 params=[("CORE_ADDR", "addr"), ("CORE_ADDR", "size")],
2510 predefault="default_infcall_munmap",
2511 invalid=False,
2512 )
2513
2514 Method(
2515 comment="""
2516 Return string (caller has to use xfree for it) with options for GCC
2517 to produce code for this target, typically "-m64", "-m32" or "-m31".
2518 These options are put before CU's DW_AT_producer compilation options so that
2519 they can override it.
2520 """,
2521 type="std::string",
2522 name="gcc_target_options",
2523 params=[],
2524 predefault="default_gcc_target_options",
2525 invalid=False,
2526 )
2527
2528 Method(
2529 comment="""
2530 Return a regular expression that matches names used by this
2531 architecture in GNU configury triplets. The result is statically
2532 allocated and must not be freed. The default implementation simply
2533 returns the BFD architecture name, which is correct in nearly every
2534 case.
2535 """,
2536 type="const char *",
2537 name="gnu_triplet_regexp",
2538 params=[],
2539 predefault="default_gnu_triplet_regexp",
2540 invalid=False,
2541 )
2542
2543 Method(
2544 comment="""
2545 Return the size in 8-bit bytes of an addressable memory unit on this
2546 architecture. This corresponds to the number of 8-bit bytes associated to
2547 each address in memory.
2548 """,
2549 type="int",
2550 name="addressable_memory_unit_size",
2551 params=[],
2552 predefault="default_addressable_memory_unit_size",
2553 invalid=False,
2554 )
2555
2556 Value(
2557 comment="""
2558 Functions for allowing a target to modify its disassembler options.
2559 """,
2560 type="const char *",
2561 name="disassembler_options_implicit",
2562 predefault="0",
2563 invalid=False,
2564 printer="pstring (gdbarch->disassembler_options_implicit)",
2565 )
2566
2567 Value(
2568 type="char **",
2569 name="disassembler_options",
2570 predefault="0",
2571 invalid=False,
2572 printer="pstring_ptr (gdbarch->disassembler_options)",
2573 )
2574
2575 Value(
2576 type="const disasm_options_and_args_t *",
2577 name="valid_disassembler_options",
2578 predefault="0",
2579 invalid=False,
2580 printer="host_address_to_string (gdbarch->valid_disassembler_options)",
2581 )
2582
2583 Method(
2584 comment="""
2585 Type alignment override method. Return the architecture specific
2586 alignment required for TYPE. If there is no special handling
2587 required for TYPE then return the value 0, GDB will then apply the
2588 default rules as laid out in gdbtypes.c:type_align.
2589 """,
2590 type="ULONGEST",
2591 name="type_align",
2592 params=[("struct type *", "type")],
2593 predefault="default_type_align",
2594 invalid=False,
2595 )
2596
2597 Function(
2598 comment="""
2599 Return a string containing any flags for the given PC in the given FRAME.
2600 """,
2601 type="std::string",
2602 name="get_pc_address_flags",
2603 params=[("frame_info *", "frame"), ("CORE_ADDR", "pc")],
2604 predefault="default_get_pc_address_flags",
2605 invalid=False,
2606 )
2607
2608 Method(
2609 comment="""
2610 Read core file mappings
2611 """,
2612 type="void",
2613 name="read_core_file_mappings",
2614 params=[
2615 ("struct bfd *", "cbfd"),
2616 ("read_core_file_mappings_pre_loop_ftype", "pre_loop_cb"),
2617 ("read_core_file_mappings_loop_ftype", "loop_cb"),
2618 ],
2619 predefault="default_read_core_file_mappings",
2620 invalid=False,
2621 )