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