Add translations for various sub-directories
[binutils-gdb.git] / gdb / gdbarch_components.py
blobe0fd74e80d145852b43c261548a58a2a1c15e188
1 # Dynamic architecture support for GDB, the GNU debugger.
3 # Copyright (C) 1998-2024 Free Software Foundation, Inc.
5 # This file is part of GDB.
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.
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.
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/>.
20 # How to add to gdbarch:
22 # There are four kinds of fields in gdbarch:
24 # * Info - you should never need this; it is only for things that are
25 # copied directly from the gdbarch_info.
27 # * Value - a variable.
29 # * Function - a function pointer.
31 # * Method - a function pointer, but the function takes a gdbarch as
32 # its first parameter.
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.
38 # All parameters are keyword-only. This is done to help catch typos.
40 # Some parameters are shared among all types (including Info):
42 # * "name" - required, the name of the field.
44 # * "type" - required, the type of the field. For functions and
45 # methods, this is the return type.
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.
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.
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.)
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.
63 # * "predefault", "postdefault", and "invalid" - These are used for
64 # the initialization and verification steps:
66 # A gdbarch is zero-initialized. Then, if a field has a "predefault",
67 # the field is set to that value. This becomes the field's initial
68 # value.
70 # After initialization is complete (that is, after the tdep code has a
71 # chance to change the settings), the post-initialization step is
72 # done.
74 # If the field still has its initial value (see above), and the field
75 # has a "postdefault", then the field is set to this value.
77 # After the possible "postdefault" assignment, validation is
78 # performed for fields that don't have a "predicate".
80 # If the field has an "invalid" attribute with a string value, then
81 # this string is the expression that should evaluate to true when the
82 # field is invalid.
84 # Otherwise, if "invalid" is True (the default), then the generic
85 # validation function is used: the field is considered invalid it
86 # still contains its default value. This validation is what is used
87 # within the _p predicate function if the field has "predicate" set to
88 # True.
90 # Function and Method share:
92 # * "params" - required, a tuple of tuples. Each inner tuple is a
93 # pair of the form (TYPE, NAME), where TYPE is the type of this
94 # argument, and NAME is the name. Note that while the names could be
95 # auto-generated, this approach lets the "comment" field refer to
96 # arguments in a nicer way. It is also just nicer for users.
98 # * "param_checks" - optional, a list of strings. Each string is an
99 # expression that is placed within a gdb_assert before the call is
100 # made to the Function/Method implementation. Each expression is
101 # something that should be true, and it is expected that the
102 # expression will make use of the parameters named in 'params' (though
103 # this is not required).
105 # * "result_checks" - optional, a list of strings. Each string is an
106 # expression that is placed within a gdb_assert after the call to the
107 # Function/Method implementation. Within each expression the variable
108 # 'result' can be used to reference the result of the function/method
109 # implementation. The 'result_checks' can only be used if the 'type'
110 # of this Function/Method is not 'void'.
112 # * "implement" - optional, a boolean. If True (the default), a
113 # wrapper function for this function will be emitted.
115 from gdbarch_types import Function, Info, Method, Value
117 Info(
118 type="const struct bfd_arch_info *",
119 name="bfd_arch_info",
120 printer="gdbarch_bfd_arch_info (gdbarch)->printable_name",
123 Info(
124 type="enum bfd_endian",
125 name="byte_order",
128 Info(
129 type="enum bfd_endian",
130 name="byte_order_for_code",
133 Info(
134 type="enum gdb_osabi",
135 name="osabi",
138 Info(
139 type="const struct target_desc *",
140 name="target_desc",
141 printer="host_address_to_string (gdbarch->target_desc)",
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,
154 int_bit = 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,
164 long_bit_predefault = "4*TARGET_CHAR_BIT"
165 long_bit = Value(
166 comment="""
167 Number of bits in a long or unsigned long for the target machine.
168 """,
169 type="int",
170 name="long_bit",
171 predefault=long_bit_predefault,
172 invalid=False,
175 Value(
176 comment="""
177 Number of bits in a long long or unsigned long long for the target
178 machine.
179 """,
180 type="int",
181 name="long_long_bit",
182 predefault="2*" + long_bit_predefault,
183 invalid=False,
186 Value(
187 comment="""
188 The ABI default bit-size and format for "bfloat16", "half", "float", "double", and
189 "long double". These bit/format pairs should eventually be combined
190 into a single object. For the moment, just initialize them as a pair.
191 Each format describes both the big and little endian layouts (if
192 useful).
193 """,
194 type="int",
195 name="bfloat16_bit",
196 predefault="2*TARGET_CHAR_BIT",
197 invalid=False,
200 Value(
201 type="const struct floatformat **",
202 name="bfloat16_format",
203 predefault="floatformats_bfloat16",
204 printer="pformat (gdbarch, gdbarch->bfloat16_format)",
205 invalid=False,
208 Value(
209 type="int",
210 name="half_bit",
211 predefault="2*TARGET_CHAR_BIT",
212 invalid=False,
215 Value(
216 type="const struct floatformat **",
217 name="half_format",
218 predefault="floatformats_ieee_half",
219 printer="pformat (gdbarch, gdbarch->half_format)",
220 invalid=False,
223 Value(
224 type="int",
225 name="float_bit",
226 predefault="4*TARGET_CHAR_BIT",
227 invalid=False,
230 Value(
231 type="const struct floatformat **",
232 name="float_format",
233 predefault="floatformats_ieee_single",
234 printer="pformat (gdbarch, gdbarch->float_format)",
235 invalid=False,
238 Value(
239 type="int",
240 name="double_bit",
241 predefault="8*TARGET_CHAR_BIT",
242 invalid=False,
245 Value(
246 type="const struct floatformat **",
247 name="double_format",
248 predefault="floatformats_ieee_double",
249 printer="pformat (gdbarch, gdbarch->double_format)",
250 invalid=False,
253 Value(
254 type="int",
255 name="long_double_bit",
256 predefault="8*TARGET_CHAR_BIT",
257 invalid=False,
260 Value(
261 type="const struct floatformat **",
262 name="long_double_format",
263 predefault="floatformats_ieee_double",
264 printer="pformat (gdbarch, gdbarch->long_double_format)",
265 invalid=False,
268 Value(
269 comment="""
270 The ABI default bit-size for "wchar_t". wchar_t is a built-in type
271 starting with C++11.
272 """,
273 type="int",
274 name="wchar_bit",
275 predefault="4*TARGET_CHAR_BIT",
276 invalid=False,
279 Value(
280 comment="""
281 One if `wchar_t' is signed, zero if unsigned.
282 """,
283 type="int",
284 name="wchar_signed",
285 predefault="-1",
286 postdefault="1",
287 invalid=False,
290 Method(
291 comment="""
292 Returns the floating-point format to be used for values of length LENGTH.
293 NAME, if non-NULL, is the type name, which may be used to distinguish
294 different target formats of the same length.
295 """,
296 type="const struct floatformat **",
297 name="floatformat_for_type",
298 params=[("const char *", "name"), ("int", "length")],
299 predefault="default_floatformat_for_type",
300 invalid=False,
303 Value(
304 comment="""
305 For most targets, a pointer on the target and its representation as an
306 address in GDB have the same size and "look the same". For such a
307 target, you need only set gdbarch_ptr_bit and gdbarch_addr_bit
308 / addr_bit will be set from it.
310 If gdbarch_ptr_bit and gdbarch_addr_bit are different, you'll probably
311 also need to set gdbarch_dwarf2_addr_size, gdbarch_pointer_to_address and
312 gdbarch_address_to_pointer as well.
314 ptr_bit is the size of a pointer on the target
315 """,
316 type="int",
317 name="ptr_bit",
318 predefault=int_bit.predefault,
319 invalid=False,
322 Value(
323 comment="""
324 addr_bit is the size of a target address as represented in gdb
325 """,
326 type="int",
327 name="addr_bit",
328 predefault="0",
329 postdefault="gdbarch_ptr_bit (gdbarch)",
330 invalid=False,
333 Value(
334 comment="""
335 dwarf2_addr_size is the target address size as used in the Dwarf debug
336 info. For .debug_frame FDEs, this is supposed to be the target address
337 size from the associated CU header, and which is equivalent to the
338 DWARF2_ADDR_SIZE as defined by the target specific GCC back-end.
339 Unfortunately there is no good way to determine this value. Therefore
340 dwarf2_addr_size simply defaults to the target pointer size.
342 dwarf2_addr_size is not used for .eh_frame FDEs, which are generally
343 defined using the target's pointer size so far.
345 Note that dwarf2_addr_size only needs to be redefined by a target if the
346 GCC back-end defines a DWARF2_ADDR_SIZE other than the target pointer size,
347 and if Dwarf versions < 4 need to be supported.
348 """,
349 type="int",
350 name="dwarf2_addr_size",
351 postdefault="gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT",
352 invalid=False,
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=False,
366 Function(
367 type="CORE_ADDR",
368 name="read_pc",
369 params=[("readable_regcache *", "regcache")],
370 predicate=True,
373 Function(
374 type="void",
375 name="write_pc",
376 params=[("struct regcache *", "regcache"), ("CORE_ADDR", "val")],
377 predicate=True,
380 Method(
381 comment="""
382 Function for getting target's idea of a frame pointer. FIXME: GDB's
383 whole scheme for dealing with "frames" and "frame pointers" needs a
384 serious shakedown.
385 """,
386 type="void",
387 name="virtual_frame_pointer",
388 params=[
389 ("CORE_ADDR", "pc"),
390 ("int *", "frame_regnum"),
391 ("LONGEST *", "frame_offset"),
393 predefault="legacy_virtual_frame_pointer",
394 invalid=False,
397 Method(
398 type="enum register_status",
399 name="pseudo_register_read",
400 params=[
401 ("readable_regcache *", "regcache"),
402 ("int", "cookednum"),
403 ("gdb_byte *", "buf"),
405 predicate=True,
408 Method(
409 comment="""
410 Read a register into a new struct value. If the register is wholly
411 or partly unavailable, this should call mark_value_bytes_unavailable
412 as appropriate. If this is defined, then pseudo_register_read will
413 never be called.
414 """,
415 type="struct value *",
416 name="pseudo_register_read_value",
417 params=[("const frame_info_ptr &", "next_frame"), ("int", "cookednum")],
418 predicate=True,
421 Method(
422 comment="""
423 Write bytes in BUF to pseudo register with number PSEUDO_REG_NUM.
425 Raw registers backing the pseudo register should be written to using
426 NEXT_FRAME.
427 """,
428 type="void",
429 name="pseudo_register_write",
430 params=[
431 ("const frame_info_ptr &", "next_frame"),
432 ("int", "pseudo_reg_num"),
433 ("gdb::array_view<const gdb_byte>", "buf"),
435 predicate=True,
438 Method(
439 comment="""
440 Write bytes to a pseudo register.
442 This is marked as deprecated because it gets passed a regcache for
443 implementations to write raw registers in. This doesn't work for unwound
444 frames, where the raw registers backing the pseudo registers may have been
445 saved elsewhere.
447 Implementations should be migrated to implement pseudo_register_write instead.
448 """,
449 type="void",
450 name="deprecated_pseudo_register_write",
451 params=[
452 ("struct regcache *", "regcache"),
453 ("int", "cookednum"),
454 ("const gdb_byte *", "buf"),
456 predicate=True,
459 Value(
460 type="int",
461 name="num_regs",
462 predefault="-1",
465 Value(
466 comment="""
467 This macro gives the number of pseudo-registers that live in the
468 register namespace but do not get fetched or stored on the target.
469 These pseudo-registers may be aliases for other registers,
470 combinations of other registers, or they may be computed by GDB.
471 """,
472 type="int",
473 name="num_pseudo_regs",
474 predefault="0",
475 invalid=False,
478 Method(
479 comment="""
480 Assemble agent expression bytecode to collect pseudo-register REG.
481 Return -1 if something goes wrong, 0 otherwise.
482 """,
483 type="int",
484 name="ax_pseudo_register_collect",
485 params=[("struct agent_expr *", "ax"), ("int", "reg")],
486 predicate=True,
489 Method(
490 comment="""
491 Assemble agent expression bytecode to push the value of pseudo-register
492 REG on the interpreter stack.
493 Return -1 if something goes wrong, 0 otherwise.
494 """,
495 type="int",
496 name="ax_pseudo_register_push_stack",
497 params=[("struct agent_expr *", "ax"), ("int", "reg")],
498 predicate=True,
501 Method(
502 comment="""
503 Some architectures can display additional information for specific
504 signals.
505 UIOUT is the output stream where the handler will place information.
506 """,
507 type="void",
508 name="report_signal_info",
509 params=[("struct ui_out *", "uiout"), ("enum gdb_signal", "siggnal")],
510 predicate=True,
513 Value(
514 comment="""
515 GDB's standard (or well known) register numbers. These can map onto
516 a real register or a pseudo (computed) register or not be defined at
517 all (-1).
518 gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP.
519 """,
520 type="int",
521 name="sp_regnum",
522 predefault="-1",
523 invalid=False,
526 Value(
527 type="int",
528 name="pc_regnum",
529 predefault="-1",
530 invalid=False,
533 Value(
534 type="int",
535 name="ps_regnum",
536 predefault="-1",
537 invalid=False,
540 Value(
541 type="int",
542 name="fp0_regnum",
543 predefault="-1",
544 invalid=False,
547 Method(
548 comment="""
549 Convert stab register number (from `r' declaration) to a gdb REGNUM.
550 """,
551 type="int",
552 name="stab_reg_to_regnum",
553 params=[("int", "stab_regnr")],
554 predefault="no_op_reg_to_regnum",
555 invalid=False,
558 Method(
559 comment="""
560 Provide a default mapping from a ecoff register number to a gdb REGNUM.
561 """,
562 type="int",
563 name="ecoff_reg_to_regnum",
564 params=[("int", "ecoff_regnr")],
565 predefault="no_op_reg_to_regnum",
566 invalid=False,
569 Method(
570 comment="""
571 Convert from an sdb register number to an internal gdb register number.
572 """,
573 type="int",
574 name="sdb_reg_to_regnum",
575 params=[("int", "sdb_regnr")],
576 predefault="no_op_reg_to_regnum",
577 invalid=False,
580 Method(
581 comment="""
582 Provide a default mapping from a DWARF2 register number to a gdb REGNUM.
583 Return -1 for bad REGNUM. Note: Several targets get this wrong.
584 """,
585 type="int",
586 name="dwarf2_reg_to_regnum",
587 params=[("int", "dwarf2_regnr")],
588 predefault="no_op_reg_to_regnum",
589 invalid=False,
592 Method(
593 comment="""
594 Return the name of register REGNR for the specified architecture.
595 REGNR can be any value greater than, or equal to zero, and less than
596 'gdbarch_num_cooked_regs (GDBARCH)'. If REGNR is not supported for
597 GDBARCH, then this function will return an empty string, this function
598 should never return nullptr.
599 """,
600 type="const char *",
601 name="register_name",
602 params=[("int", "regnr")],
603 param_checks=["regnr >= 0", "regnr < gdbarch_num_cooked_regs (gdbarch)"],
604 result_checks=["result != nullptr"],
607 Method(
608 comment="""
609 Return the type of a register specified by the architecture. Only
610 the register cache should call this function directly; others should
611 use "register_type".
612 """,
613 type="struct type *",
614 name="register_type",
615 params=[("int", "reg_nr")],
618 Method(
619 comment="""
620 Generate a dummy frame_id for THIS_FRAME assuming that the frame is
621 a dummy frame. A dummy frame is created before an inferior call,
622 the frame_id returned here must match the frame_id that was built
623 for the inferior call. Usually this means the returned frame_id's
624 stack address should match the address returned by
625 gdbarch_push_dummy_call, and the returned frame_id's code address
626 should match the address at which the breakpoint was set in the dummy
627 frame.
628 """,
629 type="struct frame_id",
630 name="dummy_id",
631 params=[("const frame_info_ptr &", "this_frame")],
632 predefault="default_dummy_id",
633 invalid=False,
636 Value(
637 comment="""
638 Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
639 deprecated_fp_regnum.
640 """,
641 type="int",
642 name="deprecated_fp_regnum",
643 predefault="-1",
644 invalid=False,
647 Method(
648 type="CORE_ADDR",
649 name="push_dummy_call",
650 params=[
651 ("struct value *", "function"),
652 ("struct regcache *", "regcache"),
653 ("CORE_ADDR", "bp_addr"),
654 ("int", "nargs"),
655 ("struct value **", "args"),
656 ("CORE_ADDR", "sp"),
657 ("function_call_return_method", "return_method"),
658 ("CORE_ADDR", "struct_addr"),
660 predicate=True,
663 Value(
664 type="enum call_dummy_location_type",
665 name="call_dummy_location",
666 predefault="AT_ENTRY_POINT",
667 invalid=False,
670 Method(
671 type="CORE_ADDR",
672 name="push_dummy_code",
673 params=[
674 ("CORE_ADDR", "sp"),
675 ("CORE_ADDR", "funaddr"),
676 ("struct value **", "args"),
677 ("int", "nargs"),
678 ("struct type *", "value_type"),
679 ("CORE_ADDR *", "real_pc"),
680 ("CORE_ADDR *", "bp_addr"),
681 ("struct regcache *", "regcache"),
683 predicate=True,
686 Method(
687 comment="""
688 Return true if the code of FRAME is writable.
689 """,
690 type="int",
691 name="code_of_frame_writable",
692 params=[("const frame_info_ptr &", "frame")],
693 predefault="default_code_of_frame_writable",
694 invalid=False,
697 Method(
698 type="void",
699 name="print_registers_info",
700 params=[
701 ("struct ui_file *", "file"),
702 ("const frame_info_ptr &", "frame"),
703 ("int", "regnum"),
704 ("int", "all"),
706 predefault="default_print_registers_info",
707 invalid=False,
710 Method(
711 type="void",
712 name="print_float_info",
713 params=[
714 ("struct ui_file *", "file"),
715 ("const frame_info_ptr &", "frame"),
716 ("const char *", "args"),
718 predefault="default_print_float_info",
719 invalid=False,
722 Method(
723 type="void",
724 name="print_vector_info",
725 params=[
726 ("struct ui_file *", "file"),
727 ("const frame_info_ptr &", "frame"),
728 ("const char *", "args"),
730 predicate=True,
733 Method(
734 comment="""
735 MAP a GDB RAW register number onto a simulator register number. See
736 also include/...-sim.h.
737 """,
738 type="int",
739 name="register_sim_regno",
740 params=[("int", "reg_nr")],
741 predefault="legacy_register_sim_regno",
742 invalid=False,
745 Method(
746 type="int",
747 name="cannot_fetch_register",
748 params=[("int", "regnum")],
749 predefault="cannot_register_not",
750 invalid=False,
753 Method(
754 type="int",
755 name="cannot_store_register",
756 params=[("int", "regnum")],
757 predefault="cannot_register_not",
758 invalid=False,
761 Function(
762 comment="""
763 Determine the address where a longjmp will land and save this address
764 in PC. Return nonzero on success.
766 FRAME corresponds to the longjmp frame.
767 """,
768 type="int",
769 name="get_longjmp_target",
770 params=[("const frame_info_ptr &", "frame"), ("CORE_ADDR *", "pc")],
771 predicate=True,
774 Value(
775 type="int",
776 name="believe_pcc_promotion",
777 invalid=False,
780 Method(
781 type="int",
782 name="convert_register_p",
783 params=[("int", "regnum"), ("struct type *", "type")],
784 predefault="generic_convert_register_p",
785 invalid=False,
788 Function(
789 type="int",
790 name="register_to_value",
791 params=[
792 ("const frame_info_ptr &", "frame"),
793 ("int", "regnum"),
794 ("struct type *", "type"),
795 ("gdb_byte *", "buf"),
796 ("int *", "optimizedp"),
797 ("int *", "unavailablep"),
799 invalid=False,
802 Function(
803 type="void",
804 name="value_to_register",
805 params=[
806 ("const frame_info_ptr &", "frame"),
807 ("int", "regnum"),
808 ("struct type *", "type"),
809 ("const gdb_byte *", "buf"),
811 invalid=False,
814 Method(
815 comment="""
816 Construct a value representing the contents of register REGNUM in
817 frame THIS_FRAME, interpreted as type TYPE. The routine needs to
818 allocate and return a struct value with all value attributes
819 (but not the value contents) filled in.
820 """,
821 type="struct value *",
822 name="value_from_register",
823 params=[
824 ("struct type *", "type"),
825 ("int", "regnum"),
826 ("const frame_info_ptr &", "this_frame"),
828 predefault="default_value_from_register",
829 invalid=False,
832 Method(
833 comment="""
834 For a DW_OP_piece located in a register, but not occupying the
835 entire register, return the placement of the piece within that
836 register as defined by the ABI.
837 """,
838 type="ULONGEST",
839 name="dwarf2_reg_piece_offset",
840 params=[("int", "regnum"), ("ULONGEST", "size")],
841 predefault="default_dwarf2_reg_piece_offset",
842 invalid=False,
845 Method(
846 type="CORE_ADDR",
847 name="pointer_to_address",
848 params=[("struct type *", "type"), ("const gdb_byte *", "buf")],
849 predefault="unsigned_pointer_to_address",
850 invalid=False,
853 Method(
854 type="void",
855 name="address_to_pointer",
856 params=[("struct type *", "type"), ("gdb_byte *", "buf"), ("CORE_ADDR", "addr")],
857 predefault="unsigned_address_to_pointer",
858 invalid=False,
861 Method(
862 type="CORE_ADDR",
863 name="integer_to_address",
864 params=[("struct type *", "type"), ("const gdb_byte *", "buf")],
865 predicate=True,
868 Method(
869 comment="""
870 Return the return-value convention that will be used by FUNCTION
871 to return a value of type VALTYPE. FUNCTION may be NULL in which
872 case the return convention is computed based only on VALTYPE.
874 If READBUF is not NULL, extract the return value and save it in this buffer.
876 If WRITEBUF is not NULL, it contains a return value which will be
877 stored into the appropriate register. This can be used when we want
878 to force the value returned by a function (see the "return" command
879 for instance).
881 NOTE: it is better to implement return_value_as_value instead, as that
882 method can properly handle variably-sized types.
883 """,
884 type="enum return_value_convention",
885 name="return_value",
886 params=[
887 ("struct value *", "function"),
888 ("struct type *", "valtype"),
889 ("struct regcache *", "regcache"),
890 ("gdb_byte *", "readbuf"),
891 ("const gdb_byte *", "writebuf"),
893 invalid=False,
894 # We don't want to accidentally introduce calls to this, as gdb
895 # should only ever call return_value_new (see below).
896 implement=False,
899 Method(
900 comment="""
901 Return the return-value convention that will be used by FUNCTION
902 to return a value of type VALTYPE. FUNCTION may be NULL in which
903 case the return convention is computed based only on VALTYPE.
905 If READ_VALUE is not NULL, extract the return value and save it in
906 this pointer.
908 If WRITEBUF is not NULL, it contains a return value which will be
909 stored into the appropriate register. This can be used when we want
910 to force the value returned by a function (see the "return" command
911 for instance).
912 """,
913 type="enum return_value_convention",
914 name="return_value_as_value",
915 params=[
916 ("struct value *", "function"),
917 ("struct type *", "valtype"),
918 ("struct regcache *", "regcache"),
919 ("struct value **", "read_value"),
920 ("const gdb_byte *", "writebuf"),
922 predefault="default_gdbarch_return_value",
923 # If we're using the default, then the other method must be set;
924 # but if we aren't using the default here then the other method
925 # must not be set.
926 invalid="(gdbarch->return_value_as_value == default_gdbarch_return_value) == (gdbarch->return_value == nullptr)",
929 Function(
930 comment="""
931 Return the address at which the value being returned from
932 the current function will be stored. This routine is only
933 called if the current function uses the the "struct return
934 convention".
936 May return 0 when unable to determine that address.""",
937 type="CORE_ADDR",
938 name="get_return_buf_addr",
939 params=[("struct type *", "val_type"), ("const frame_info_ptr &", "cur_frame")],
940 predefault="default_get_return_buf_addr",
941 invalid=False,
945 # The DWARF info currently does not distinguish between IEEE 128-bit floating
946 # point values and the IBM 128-bit floating point format. GCC has an internal
947 # hack to identify the IEEE 128-bit floating point value. The long double is a
948 # defined base type in C. The GCC hack uses a typedef for long double to
949 # reference_Float128 base to identify the long double as and IEEE 128-bit
950 # value. The following method is used to "fix" the long double type to be a
951 # base type with the IEEE float format info from the _Float128 basetype and
952 # the long double name. With the fix, the proper name is printed for the
953 # GDB typedef command.
954 Function(
955 comment="""
956 Return true if the typedef record needs to be replaced.".
958 Return 0 by default""",
959 type="bool",
960 name="dwarf2_omit_typedef_p",
961 params=[
962 ("struct type *", "target_type"),
963 ("const char *", "producer"),
964 ("const char *", "name"),
966 predefault="default_dwarf2_omit_typedef_p",
967 invalid=False,
970 Method(
971 comment="""
972 Update PC when trying to find a call site. This is useful on
973 architectures where the call site PC, as reported in the DWARF, can be
974 incorrect for some reason.
976 The passed-in PC will be an address in the inferior. GDB will have
977 already failed to find a call site at this PC. This function may
978 simply return its parameter if it thinks that should be the correct
979 address.""",
980 type="CORE_ADDR",
981 name="update_call_site_pc",
982 params=[("CORE_ADDR", "pc")],
983 predefault="default_update_call_site_pc",
984 invalid=False,
987 Method(
988 comment="""
989 Return true if the return value of function is stored in the first hidden
990 parameter. In theory, this feature should be language-dependent, specified
991 by language and its ABI, such as C++. Unfortunately, compiler may
992 implement it to a target-dependent feature. So that we need such hook here
993 to be aware of this in GDB.
994 """,
995 type="int",
996 name="return_in_first_hidden_param_p",
997 params=[("struct type *", "type")],
998 predefault="default_return_in_first_hidden_param_p",
999 invalid=False,
1002 Method(
1003 type="CORE_ADDR",
1004 name="skip_prologue",
1005 params=[("CORE_ADDR", "ip")],
1008 Method(
1009 type="CORE_ADDR",
1010 name="skip_main_prologue",
1011 params=[("CORE_ADDR", "ip")],
1012 predicate=True,
1015 Method(
1016 comment="""
1017 On some platforms, a single function may provide multiple entry points,
1018 e.g. one that is used for function-pointer calls and a different one
1019 that is used for direct function calls.
1020 In order to ensure that breakpoints set on the function will trigger
1021 no matter via which entry point the function is entered, a platform
1022 may provide the skip_entrypoint callback. It is called with IP set
1023 to the main entry point of a function (as determined by the symbol table),
1024 and should return the address of the innermost entry point, where the
1025 actual breakpoint needs to be set. Note that skip_entrypoint is used
1026 by GDB common code even when debugging optimized code, where skip_prologue
1027 is not used.
1028 """,
1029 type="CORE_ADDR",
1030 name="skip_entrypoint",
1031 params=[("CORE_ADDR", "ip")],
1032 predicate=True,
1035 Function(
1036 type="bool",
1037 name="inner_than",
1038 params=[("CORE_ADDR", "lhs"), ("CORE_ADDR", "rhs")],
1041 Method(
1042 type="const gdb_byte *",
1043 name="breakpoint_from_pc",
1044 params=[("CORE_ADDR *", "pcptr"), ("int *", "lenptr")],
1045 predefault="default_breakpoint_from_pc",
1046 invalid=False,
1049 Method(
1050 comment="""
1051 Return the breakpoint kind for this target based on *PCPTR.
1052 """,
1053 type="int",
1054 name="breakpoint_kind_from_pc",
1055 params=[("CORE_ADDR *", "pcptr")],
1058 Method(
1059 comment="""
1060 Return the software breakpoint from KIND. KIND can have target
1061 specific meaning like the Z0 kind parameter.
1062 SIZE is set to the software breakpoint's length in memory.
1063 """,
1064 type="const gdb_byte *",
1065 name="sw_breakpoint_from_kind",
1066 params=[("int", "kind"), ("int *", "size")],
1067 predefault="NULL",
1068 invalid=False,
1071 Method(
1072 comment="""
1073 Return the breakpoint kind for this target based on the current
1074 processor state (e.g. the current instruction mode on ARM) and the
1075 *PCPTR. In default, it is gdbarch->breakpoint_kind_from_pc.
1076 """,
1077 type="int",
1078 name="breakpoint_kind_from_current_state",
1079 params=[("struct regcache *", "regcache"), ("CORE_ADDR *", "pcptr")],
1080 predefault="default_breakpoint_kind_from_current_state",
1081 invalid=False,
1084 Method(
1085 type="CORE_ADDR",
1086 name="adjust_breakpoint_address",
1087 params=[("CORE_ADDR", "bpaddr")],
1088 predicate=True,
1091 Method(
1092 type="int",
1093 name="memory_insert_breakpoint",
1094 params=[("struct bp_target_info *", "bp_tgt")],
1095 predefault="default_memory_insert_breakpoint",
1096 invalid=False,
1099 Method(
1100 type="int",
1101 name="memory_remove_breakpoint",
1102 params=[("struct bp_target_info *", "bp_tgt")],
1103 predefault="default_memory_remove_breakpoint",
1104 invalid=False,
1107 Value(
1108 type="CORE_ADDR",
1109 name="decr_pc_after_break",
1110 invalid=False,
1113 Value(
1114 comment="""
1115 A function can be addressed by either its "pointer" (possibly a
1116 descriptor address) or "entry point" (first executable instruction).
1117 The method "convert_from_func_ptr_addr" converting the former to the
1118 latter. gdbarch_deprecated_function_start_offset is being used to implement
1119 a simplified subset of that functionality - the function's address
1120 corresponds to the "function pointer" and the function's start
1121 corresponds to the "function entry point" - and hence is redundant.
1122 """,
1123 type="CORE_ADDR",
1124 name="deprecated_function_start_offset",
1125 invalid=False,
1128 Method(
1129 comment="""
1130 Return the remote protocol register number associated with this
1131 register. Normally the identity mapping.
1132 """,
1133 type="int",
1134 name="remote_register_number",
1135 params=[("int", "regno")],
1136 predefault="default_remote_register_number",
1137 invalid=False,
1140 Function(
1141 comment="""
1142 Fetch the target specific address used to represent a load module.
1143 """,
1144 type="CORE_ADDR",
1145 name="fetch_tls_load_module_address",
1146 params=[("struct objfile *", "objfile")],
1147 predicate=True,
1150 Method(
1151 comment="""
1152 Return the thread-local address at OFFSET in the thread-local
1153 storage for the thread PTID and the shared library or executable
1154 file given by LM_ADDR. If that block of thread-local storage hasn't
1155 been allocated yet, this function may throw an error. LM_ADDR may
1156 be zero for statically linked multithreaded inferiors.
1157 """,
1158 type="CORE_ADDR",
1159 name="get_thread_local_address",
1160 params=[("ptid_t", "ptid"), ("CORE_ADDR", "lm_addr"), ("CORE_ADDR", "offset")],
1161 predicate=True,
1164 Value(
1165 type="CORE_ADDR",
1166 name="frame_args_skip",
1167 invalid=False,
1170 Method(
1171 type="CORE_ADDR",
1172 name="unwind_pc",
1173 params=[("const frame_info_ptr &", "next_frame")],
1174 predefault="default_unwind_pc",
1175 invalid=False,
1178 Method(
1179 type="CORE_ADDR",
1180 name="unwind_sp",
1181 params=[("const frame_info_ptr &", "next_frame")],
1182 predefault="default_unwind_sp",
1183 invalid=False,
1186 Function(
1187 comment="""
1188 DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
1189 frame-base. Enable frame-base before frame-unwind.
1190 """,
1191 type="int",
1192 name="frame_num_args",
1193 params=[("const frame_info_ptr &", "frame")],
1194 predicate=True,
1197 Method(
1198 type="CORE_ADDR",
1199 name="frame_align",
1200 params=[("CORE_ADDR", "address")],
1201 predicate=True,
1204 Method(
1205 type="int",
1206 name="stabs_argument_has_addr",
1207 params=[("struct type *", "type")],
1208 predefault="default_stabs_argument_has_addr",
1209 invalid=False,
1212 Value(
1213 type="int",
1214 name="frame_red_zone_size",
1215 invalid=False,
1218 Method(
1219 type="CORE_ADDR",
1220 name="convert_from_func_ptr_addr",
1221 params=[("CORE_ADDR", "addr"), ("struct target_ops *", "targ")],
1222 predefault="convert_from_func_ptr_addr_identity",
1223 invalid=False,
1226 Method(
1227 comment="""
1228 On some machines there are bits in addresses which are not really
1229 part of the address, but are used by the kernel, the hardware, etc.
1230 for special purposes. gdbarch_addr_bits_remove takes out any such bits so
1231 we get a "real" address such as one would find in a symbol table.
1232 This is used only for addresses of instructions, and even then I'm
1233 not sure it's used in all contexts. It exists to deal with there
1234 being a few stray bits in the PC which would mislead us, not as some
1235 sort of generic thing to handle alignment or segmentation (it's
1236 possible it should be in TARGET_READ_PC instead).
1237 """,
1238 type="CORE_ADDR",
1239 name="addr_bits_remove",
1240 params=[("CORE_ADDR", "addr")],
1241 predefault="core_addr_identity",
1242 invalid=False,
1245 Method(
1246 comment="""
1247 On some architectures, not all bits of a pointer are significant.
1248 On AArch64 and amd64, for example, the top bits of a pointer may carry a
1249 "tag", which can be ignored by the kernel and the hardware. The "tag" can be
1250 regarded as additional data associated with the pointer, but it is not part
1251 of the address.
1253 Given a pointer for the architecture, this hook removes all the
1254 non-significant bits and sign-extends things as needed. It gets used to
1255 remove non-address bits from pointers used for watchpoints.
1256 """,
1257 type="CORE_ADDR",
1258 name="remove_non_address_bits_watchpoint",
1259 params=[("CORE_ADDR", "pointer")],
1260 predefault="default_remove_non_address_bits",
1261 invalid=False,
1264 Method(
1265 comment="""
1266 On some architectures, not all bits of a pointer are significant.
1267 On AArch64 and amd64, for example, the top bits of a pointer may carry a
1268 "tag", which can be ignored by the kernel and the hardware. The "tag" can be
1269 regarded as additional data associated with the pointer, but it is not part
1270 of the address.
1272 Given a pointer for the architecture, this hook removes all the
1273 non-significant bits and sign-extends things as needed. It gets used to
1274 remove non-address bits from pointers used for breakpoints.
1275 """,
1276 type="CORE_ADDR",
1277 name="remove_non_address_bits_breakpoint",
1278 params=[("CORE_ADDR", "pointer")],
1279 predefault="default_remove_non_address_bits",
1280 invalid=False,
1283 Method(
1284 comment="""
1285 On some architectures, not all bits of a pointer are significant.
1286 On AArch64 and amd64, for example, the top bits of a pointer may carry a
1287 "tag", which can be ignored by the kernel and the hardware. The "tag" can be
1288 regarded as additional data associated with the pointer, but it is not part
1289 of the address.
1291 Given a pointer for the architecture, this hook removes all the
1292 non-significant bits and sign-extends things as needed. It gets used to
1293 remove non-address bits from any pointer used to access memory.
1294 """,
1295 type="CORE_ADDR",
1296 name="remove_non_address_bits_memory",
1297 params=[("CORE_ADDR", "pointer")],
1298 predefault="default_remove_non_address_bits",
1299 invalid=False,
1302 Method(
1303 comment="""
1304 Return a string representation of the memory tag TAG.
1305 """,
1306 type="std::string",
1307 name="memtag_to_string",
1308 params=[("struct value *", "tag")],
1309 predefault="default_memtag_to_string",
1310 invalid=False,
1313 Method(
1314 comment="""
1315 Return true if ADDRESS contains a tag and false otherwise. ADDRESS
1316 must be either a pointer or a reference type.
1317 """,
1318 type="bool",
1319 name="tagged_address_p",
1320 params=[("CORE_ADDR", "address")],
1321 predefault="default_tagged_address_p",
1322 invalid=False,
1325 Method(
1326 comment="""
1327 Return true if the tag from ADDRESS matches the memory tag for that
1328 particular address. Return false otherwise.
1329 """,
1330 type="bool",
1331 name="memtag_matches_p",
1332 params=[("struct value *", "address")],
1333 predefault="default_memtag_matches_p",
1334 invalid=False,
1337 Method(
1338 comment="""
1339 Set the tags of type TAG_TYPE, for the memory address range
1340 [ADDRESS, ADDRESS + LENGTH) to TAGS.
1341 Return true if successful and false otherwise.
1342 """,
1343 type="bool",
1344 name="set_memtags",
1345 params=[
1346 ("struct value *", "address"),
1347 ("size_t", "length"),
1348 ("const gdb::byte_vector &", "tags"),
1349 ("memtag_type", "tag_type"),
1351 predefault="default_set_memtags",
1352 invalid=False,
1355 Method(
1356 comment="""
1357 Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
1358 assuming ADDRESS is tagged.
1359 """,
1360 type="struct value *",
1361 name="get_memtag",
1362 params=[("struct value *", "address"), ("memtag_type", "tag_type")],
1363 predefault="default_get_memtag",
1364 invalid=False,
1367 Value(
1368 comment="""
1369 memtag_granule_size is the size of the allocation tag granule, for
1370 architectures that support memory tagging.
1371 This is 0 for architectures that do not support memory tagging.
1372 For a non-zero value, this represents the number of bytes of memory per tag.
1373 """,
1374 type="CORE_ADDR",
1375 name="memtag_granule_size",
1376 invalid=False,
1379 Function(
1380 comment="""
1381 FIXME/cagney/2001-01-18: This should be split in two. A target method that
1382 indicates if the target needs software single step. An ISA method to
1383 implement it.
1385 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
1386 target can single step. If not, then implement single step using breakpoints.
1388 Return a vector of addresses on which the software single step
1389 breakpoints should be inserted. NULL means software single step is
1390 not used.
1391 Multiple breakpoints may be inserted for some instructions such as
1392 conditional branch. However, each implementation must always evaluate
1393 the condition and only put the breakpoint at the branch destination if
1394 the condition is true, so that we ensure forward progress when stepping
1395 past a conditional branch to self.
1396 """,
1397 type="std::vector<CORE_ADDR>",
1398 name="software_single_step",
1399 params=[("struct regcache *", "regcache")],
1400 predicate=True,
1403 Method(
1404 comment="""
1405 Return non-zero if the processor is executing a delay slot and a
1406 further single-step is needed before the instruction finishes.
1407 """,
1408 type="int",
1409 name="single_step_through_delay",
1410 params=[("const frame_info_ptr &", "frame")],
1411 predicate=True,
1414 Function(
1415 comment="""
1416 FIXME: cagney/2003-08-28: Need to find a better way of selecting the
1417 disassembler. Perhaps objdump can handle it?
1418 """,
1419 type="int",
1420 name="print_insn",
1421 params=[("bfd_vma", "vma"), ("struct disassemble_info *", "info")],
1422 predefault="default_print_insn",
1423 invalid=False,
1426 Function(
1427 type="CORE_ADDR",
1428 name="skip_trampoline_code",
1429 params=[("const frame_info_ptr &", "frame"), ("CORE_ADDR", "pc")],
1430 predefault="generic_skip_trampoline_code",
1431 invalid=False,
1434 Value(
1435 comment="Vtable of solib operations functions.",
1436 type="const solib_ops *",
1437 name="so_ops",
1438 predefault="&solib_target_so_ops",
1439 printer="host_address_to_string (gdbarch->so_ops)",
1440 invalid=False,
1443 Method(
1444 comment="""
1445 If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
1446 evaluates non-zero, this is the address where the debugger will place
1447 a step-resume breakpoint to get us past the dynamic linker.
1448 """,
1449 type="CORE_ADDR",
1450 name="skip_solib_resolver",
1451 params=[("CORE_ADDR", "pc")],
1452 predefault="generic_skip_solib_resolver",
1453 invalid=False,
1456 Method(
1457 comment="""
1458 Some systems also have trampoline code for returning from shared libs.
1459 """,
1460 type="int",
1461 name="in_solib_return_trampoline",
1462 params=[("CORE_ADDR", "pc"), ("const char *", "name")],
1463 predefault="generic_in_solib_return_trampoline",
1464 invalid=False,
1467 Method(
1468 comment="""
1469 Return true if PC lies inside an indirect branch thunk.
1470 """,
1471 type="bool",
1472 name="in_indirect_branch_thunk",
1473 params=[("CORE_ADDR", "pc")],
1474 predefault="default_in_indirect_branch_thunk",
1475 invalid=False,
1478 Method(
1479 comment="""
1480 A target might have problems with watchpoints as soon as the stack
1481 frame of the current function has been destroyed. This mostly happens
1482 as the first action in a function's epilogue. stack_frame_destroyed_p()
1483 is defined to return a non-zero value if either the given addr is one
1484 instruction after the stack destroying instruction up to the trailing
1485 return instruction or if we can figure out that the stack frame has
1486 already been invalidated regardless of the value of addr. Targets
1487 which don't suffer from that problem could just let this functionality
1488 untouched.
1489 """,
1490 type="int",
1491 name="stack_frame_destroyed_p",
1492 params=[("CORE_ADDR", "addr")],
1493 predefault="generic_stack_frame_destroyed_p",
1494 invalid=False,
1497 Function(
1498 comment="""
1499 Process an ELF symbol in the minimal symbol table in a backend-specific
1500 way. Normally this hook is supposed to do nothing, however if required,
1501 then this hook can be used to apply tranformations to symbols that are
1502 considered special in some way. For example the MIPS backend uses it
1503 to interpret `st_other' information to mark compressed code symbols so
1504 that they can be treated in the appropriate manner in the processing of
1505 the main symbol table and DWARF-2 records.
1506 """,
1507 type="void",
1508 name="elf_make_msymbol_special",
1509 params=[("asymbol *", "sym"), ("struct minimal_symbol *", "msym")],
1510 predicate=True,
1513 Function(
1514 type="void",
1515 name="coff_make_msymbol_special",
1516 params=[("int", "val"), ("struct minimal_symbol *", "msym")],
1517 predefault="default_coff_make_msymbol_special",
1518 invalid=False,
1521 Function(
1522 comment="""
1523 Process a symbol in the main symbol table in a backend-specific way.
1524 Normally this hook is supposed to do nothing, however if required,
1525 then this hook can be used to apply tranformations to symbols that
1526 are considered special in some way. This is currently used by the
1527 MIPS backend to make sure compressed code symbols have the ISA bit
1528 set. This in turn is needed for symbol values seen in GDB to match
1529 the values used at the runtime by the program itself, for function
1530 and label references.
1531 """,
1532 type="void",
1533 name="make_symbol_special",
1534 params=[("struct symbol *", "sym"), ("struct objfile *", "objfile")],
1535 predefault="default_make_symbol_special",
1536 invalid=False,
1539 Function(
1540 comment="""
1541 Adjust the address retrieved from a DWARF-2 record other than a line
1542 entry in a backend-specific way. Normally this hook is supposed to
1543 return the address passed unchanged, however if that is incorrect for
1544 any reason, then this hook can be used to fix the address up in the
1545 required manner. This is currently used by the MIPS backend to make
1546 sure addresses in FDE, range records, etc. referring to compressed
1547 code have the ISA bit set, matching line information and the symbol
1548 table.
1549 """,
1550 type="CORE_ADDR",
1551 name="adjust_dwarf2_addr",
1552 params=[("CORE_ADDR", "pc")],
1553 predefault="default_adjust_dwarf2_addr",
1554 invalid=False,
1557 Function(
1558 comment="""
1559 Adjust the address updated by a line entry in a backend-specific way.
1560 Normally this hook is supposed to return the address passed unchanged,
1561 however in the case of inconsistencies in these records, this hook can
1562 be used to fix them up in the required manner. This is currently used
1563 by the MIPS backend to make sure all line addresses in compressed code
1564 are presented with the ISA bit set, which is not always the case. This
1565 in turn ensures breakpoint addresses are correctly matched against the
1566 stop PC.
1567 """,
1568 type="CORE_ADDR",
1569 name="adjust_dwarf2_line",
1570 params=[("CORE_ADDR", "addr"), ("int", "rel")],
1571 predefault="default_adjust_dwarf2_line",
1572 invalid=False,
1575 Value(
1576 type="int",
1577 name="cannot_step_breakpoint",
1578 predefault="0",
1579 invalid=False,
1582 Value(
1583 comment="""
1584 See comment in target.h about continuable, steppable and
1585 non-steppable watchpoints.
1586 """,
1587 type="int",
1588 name="have_nonsteppable_watchpoint",
1589 predefault="0",
1590 invalid=False,
1593 Function(
1594 type="type_instance_flags",
1595 name="address_class_type_flags",
1596 params=[("int", "byte_size"), ("int", "dwarf2_addr_class")],
1597 predicate=True,
1600 Method(
1601 type="const char *",
1602 name="address_class_type_flags_to_name",
1603 params=[("type_instance_flags", "type_flags")],
1604 predicate=True,
1607 Method(
1608 comment="""
1609 Execute vendor-specific DWARF Call Frame Instruction. OP is the instruction.
1610 FS are passed from the generic execute_cfa_program function.
1611 """,
1612 type="bool",
1613 name="execute_dwarf_cfa_vendor_op",
1614 params=[("gdb_byte", "op"), ("struct dwarf2_frame_state *", "fs")],
1615 predefault="default_execute_dwarf_cfa_vendor_op",
1616 invalid=False,
1619 Method(
1620 comment="""
1621 Return the appropriate type_flags for the supplied address class.
1622 This function should return true if the address class was recognized and
1623 type_flags was set, false otherwise.
1624 """,
1625 type="bool",
1626 name="address_class_name_to_type_flags",
1627 params=[("const char *", "name"), ("type_instance_flags *", "type_flags_ptr")],
1628 predicate=True,
1631 Method(
1632 comment="""
1633 Is a register in a group
1634 """,
1635 type="int",
1636 name="register_reggroup_p",
1637 params=[("int", "regnum"), ("const struct reggroup *", "reggroup")],
1638 predefault="default_register_reggroup_p",
1639 invalid=False,
1642 Function(
1643 comment="""
1644 Fetch the pointer to the ith function argument.
1645 """,
1646 type="CORE_ADDR",
1647 name="fetch_pointer_argument",
1648 params=[
1649 ("const frame_info_ptr &", "frame"),
1650 ("int", "argi"),
1651 ("struct type *", "type"),
1653 predicate=True,
1656 Method(
1657 comment="""
1658 Iterate over all supported register notes in a core file. For each
1659 supported register note section, the iterator must call CB and pass
1660 CB_DATA unchanged. If REGCACHE is not NULL, the iterator can limit
1661 the supported register note sections based on the current register
1662 values. Otherwise it should enumerate all supported register note
1663 sections.
1664 """,
1665 type="void",
1666 name="iterate_over_regset_sections",
1667 params=[
1668 ("iterate_over_regset_sections_cb *", "cb"),
1669 ("void *", "cb_data"),
1670 ("const struct regcache *", "regcache"),
1672 predicate=True,
1675 Method(
1676 comment="""
1677 Create core file notes
1678 """,
1679 type="gdb::unique_xmalloc_ptr<char>",
1680 name="make_corefile_notes",
1681 params=[("bfd *", "obfd"), ("int *", "note_size")],
1682 predicate=True,
1685 Method(
1686 comment="""
1687 Find core file memory regions
1688 """,
1689 type="int",
1690 name="find_memory_regions",
1691 params=[("find_memory_region_ftype", "func"), ("void *", "data")],
1692 predicate=True,
1695 Method(
1696 comment="""
1697 Given a bfd OBFD, segment ADDRESS and SIZE, create a memory tag section to be dumped to a core file
1698 """,
1699 type="asection *",
1700 name="create_memtag_section",
1701 params=[("bfd *", "obfd"), ("CORE_ADDR", "address"), ("size_t", "size")],
1702 predicate=True,
1705 Method(
1706 comment="""
1707 Given a memory tag section OSEC, fill OSEC's contents with the appropriate tag data
1708 """,
1709 type="bool",
1710 name="fill_memtag_section",
1711 params=[("asection *", "osec")],
1712 predicate=True,
1715 Method(
1716 comment="""
1717 Decode a memory tag SECTION and return the tags of type TYPE contained in
1718 the memory range [ADDRESS, ADDRESS + LENGTH).
1719 If no tags were found, return an empty vector.
1720 """,
1721 type="gdb::byte_vector",
1722 name="decode_memtag_section",
1723 params=[
1724 ("bfd_section *", "section"),
1725 ("int", "type"),
1726 ("CORE_ADDR", "address"),
1727 ("size_t", "length"),
1729 predicate=True,
1732 Method(
1733 comment="""
1734 Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
1735 core file into buffer READBUF with length LEN. Return the number of bytes read
1736 (zero indicates failure).
1737 failed, otherwise, return the red length of READBUF.
1738 """,
1739 type="ULONGEST",
1740 name="core_xfer_shared_libraries",
1741 params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1742 predicate=True,
1745 Method(
1746 comment="""
1747 Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
1748 libraries list from core file into buffer READBUF with length LEN.
1749 Return the number of bytes read (zero indicates failure).
1750 """,
1751 type="ULONGEST",
1752 name="core_xfer_shared_libraries_aix",
1753 params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1754 predicate=True,
1757 Method(
1758 comment="""
1759 How the core target converts a PTID from a core file to a string.
1760 """,
1761 type="std::string",
1762 name="core_pid_to_str",
1763 params=[("ptid_t", "ptid")],
1764 predicate=True,
1767 Method(
1768 comment="""
1769 How the core target extracts the name of a thread from a core file.
1770 """,
1771 type="const char *",
1772 name="core_thread_name",
1773 params=[("struct thread_info *", "thr")],
1774 predicate=True,
1777 Method(
1778 comment="""
1779 Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
1780 from core file into buffer READBUF with length LEN. Return the number
1781 of bytes read (zero indicates EOF, a negative value indicates failure).
1782 """,
1783 type="LONGEST",
1784 name="core_xfer_siginfo",
1785 params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1786 predicate=True,
1789 Method(
1790 comment="""
1791 Read x86 XSAVE layout information from core file into XSAVE_LAYOUT.
1792 Returns true if the layout was read successfully.
1793 """,
1794 type="bool",
1795 name="core_read_x86_xsave_layout",
1796 params=[("x86_xsave_layout &", "xsave_layout")],
1797 predicate=True,
1800 Value(
1801 comment="""
1802 BFD target to use when generating a core file.
1803 """,
1804 type="const char *",
1805 name="gcore_bfd_target",
1806 predicate=True,
1807 printer="pstring (gdbarch->gcore_bfd_target)",
1810 Value(
1811 comment="""
1812 If the elements of C++ vtables are in-place function descriptors rather
1813 than normal function pointers (which may point to code or a descriptor),
1814 set this to one.
1815 """,
1816 type="int",
1817 name="vtable_function_descriptors",
1818 predefault="0",
1819 invalid=False,
1822 Value(
1823 comment="""
1824 Set if the least significant bit of the delta is used instead of the least
1825 significant bit of the pfn for pointers to virtual member functions.
1826 """,
1827 type="int",
1828 name="vbit_in_delta",
1829 invalid=False,
1832 Function(
1833 comment="""
1834 Advance PC to next instruction in order to skip a permanent breakpoint.
1835 """,
1836 type="void",
1837 name="skip_permanent_breakpoint",
1838 params=[("struct regcache *", "regcache")],
1839 predefault="default_skip_permanent_breakpoint",
1840 invalid=False,
1843 Value(
1844 comment="""
1845 The maximum length of an instruction on this architecture in bytes.
1846 """,
1847 type="ULONGEST",
1848 name="max_insn_length",
1849 predefault="0",
1850 predicate=True,
1853 Method(
1854 comment="""
1855 Copy the instruction at FROM to TO, and make any adjustments
1856 necessary to single-step it at that address.
1858 REGS holds the state the thread's registers will have before
1859 executing the copied instruction; the PC in REGS will refer to FROM,
1860 not the copy at TO. The caller should update it to point at TO later.
1862 Return a pointer to data of the architecture's choice to be passed
1863 to gdbarch_displaced_step_fixup.
1865 For a general explanation of displaced stepping and how GDB uses it,
1866 see the comments in infrun.c.
1868 The TO area is only guaranteed to have space for
1869 gdbarch_displaced_step_buffer_length (arch) octets, so this
1870 function must not write more octets than that to this area.
1872 If you do not provide this function, GDB assumes that the
1873 architecture does not support displaced stepping.
1875 If the instruction cannot execute out of line, return NULL. The
1876 core falls back to stepping past the instruction in-line instead in
1877 that case.
1878 """,
1879 type="displaced_step_copy_insn_closure_up",
1880 name="displaced_step_copy_insn",
1881 params=[("CORE_ADDR", "from"), ("CORE_ADDR", "to"), ("struct regcache *", "regs")],
1882 predicate=True,
1885 Method(
1886 comment="""
1887 Return true if GDB should use hardware single-stepping to execute a displaced
1888 step instruction. If false, GDB will simply restart execution at the
1889 displaced instruction location, and it is up to the target to ensure GDB will
1890 receive control again (e.g. by placing a software breakpoint instruction into
1891 the displaced instruction buffer).
1893 The default implementation returns false on all targets that provide a
1894 gdbarch_software_single_step routine, and true otherwise.
1895 """,
1896 type="bool",
1897 name="displaced_step_hw_singlestep",
1898 params=[],
1899 predefault="default_displaced_step_hw_singlestep",
1900 invalid=False,
1903 Method(
1904 comment="""
1905 Fix up the state after attempting to single-step a displaced
1906 instruction, to give the result we would have gotten from stepping the
1907 instruction in its original location.
1909 REGS is the register state resulting from single-stepping the
1910 displaced instruction.
1912 CLOSURE is the result from the matching call to
1913 gdbarch_displaced_step_copy_insn.
1915 FROM is the address where the instruction was original located, TO is
1916 the address of the displaced buffer where the instruction was copied
1917 to for stepping.
1919 COMPLETED_P is true if GDB stopped as a result of the requested step
1920 having completed (e.g. the inferior stopped with SIGTRAP), otherwise
1921 COMPLETED_P is false and GDB stopped for some other reason. In the
1922 case where a single instruction is expanded to multiple replacement
1923 instructions for stepping then it may be necessary to read the current
1924 program counter from REGS in order to decide how far through the
1925 series of replacement instructions the inferior got before stopping,
1926 this may impact what will need fixing up in this function.
1928 For a general explanation of displaced stepping and how GDB uses it,
1929 see the comments in infrun.c.
1930 """,
1931 type="void",
1932 name="displaced_step_fixup",
1933 params=[
1934 ("struct displaced_step_copy_insn_closure *", "closure"),
1935 ("CORE_ADDR", "from"),
1936 ("CORE_ADDR", "to"),
1937 ("struct regcache *", "regs"),
1938 ("bool", "completed_p"),
1940 predicate=False,
1941 predefault="NULL",
1942 invalid="(gdbarch->displaced_step_copy_insn == nullptr) != (gdbarch->displaced_step_fixup == nullptr)",
1945 Method(
1946 comment="""
1947 Prepare THREAD for it to displaced step the instruction at its current PC.
1949 Throw an exception if any unexpected error happens.
1950 """,
1951 type="displaced_step_prepare_status",
1952 name="displaced_step_prepare",
1953 params=[("thread_info *", "thread"), ("CORE_ADDR &", "displaced_pc")],
1954 predicate=True,
1957 Method(
1958 comment="""
1959 Clean up after a displaced step of THREAD.
1961 It is possible for the displaced-stepped instruction to have caused
1962 the thread to exit. The implementation can detect this case by
1963 checking if WS.kind is TARGET_WAITKIND_THREAD_EXITED.
1964 """,
1965 type="displaced_step_finish_status",
1966 name="displaced_step_finish",
1967 params=[("thread_info *", "thread"), ("const target_waitstatus &", "ws")],
1968 predefault="NULL",
1969 invalid="(! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare)",
1972 Function(
1973 comment="""
1974 Return the closure associated to the displaced step buffer that is at ADDR.
1975 """,
1976 type="const displaced_step_copy_insn_closure *",
1977 name="displaced_step_copy_insn_closure_by_addr",
1978 params=[("inferior *", "inf"), ("CORE_ADDR", "addr")],
1979 predicate=True,
1982 Function(
1983 comment="""
1984 PARENT_INF has forked and CHILD_PTID is the ptid of the child. Restore the
1985 contents of all displaced step buffers in the child's address space.
1986 """,
1987 type="void",
1988 name="displaced_step_restore_all_in_ptid",
1989 params=[("inferior *", "parent_inf"), ("ptid_t", "child_ptid")],
1990 invalid=False,
1993 Value(
1994 comment="""
1995 The maximum length in octets required for a displaced-step instruction
1996 buffer. By default this will be the same as gdbarch::max_insn_length,
1997 but should be overridden for architectures that might expand a
1998 displaced-step instruction to multiple replacement instructions.
1999 """,
2000 type="ULONGEST",
2001 name="displaced_step_buffer_length",
2002 predefault="0",
2003 postdefault="gdbarch->max_insn_length",
2004 invalid="gdbarch->displaced_step_buffer_length < gdbarch->max_insn_length",
2007 Method(
2008 comment="""
2009 Relocate an instruction to execute at a different address. OLDLOC
2010 is the address in the inferior memory where the instruction to
2011 relocate is currently at. On input, TO points to the destination
2012 where we want the instruction to be copied (and possibly adjusted)
2013 to. On output, it points to one past the end of the resulting
2014 instruction(s). The effect of executing the instruction at TO shall
2015 be the same as if executing it at FROM. For example, call
2016 instructions that implicitly push the return address on the stack
2017 should be adjusted to return to the instruction after OLDLOC;
2018 relative branches, and other PC-relative instructions need the
2019 offset adjusted; etc.
2020 """,
2021 type="void",
2022 name="relocate_instruction",
2023 params=[("CORE_ADDR *", "to"), ("CORE_ADDR", "from")],
2024 predicate=True,
2025 predefault="NULL",
2028 Function(
2029 comment="""
2030 Refresh overlay mapped state for section OSECT.
2031 """,
2032 type="void",
2033 name="overlay_update",
2034 params=[("struct obj_section *", "osect")],
2035 predicate=True,
2038 Method(
2039 type="const struct target_desc *",
2040 name="core_read_description",
2041 params=[("struct target_ops *", "target"), ("bfd *", "abfd")],
2042 predicate=True,
2045 Value(
2046 comment="""
2047 Set if the address in N_SO or N_FUN stabs may be zero.
2048 """,
2049 type="int",
2050 name="sofun_address_maybe_missing",
2051 predefault="0",
2052 invalid=False,
2055 Method(
2056 comment="""
2057 Parse the instruction at ADDR storing in the record execution log
2058 the registers REGCACHE and memory ranges that will be affected when
2059 the instruction executes, along with their current values.
2060 Return -1 if something goes wrong, 0 otherwise.
2061 """,
2062 type="int",
2063 name="process_record",
2064 params=[("struct regcache *", "regcache"), ("CORE_ADDR", "addr")],
2065 predicate=True,
2068 Method(
2069 comment="""
2070 Save process state after a signal.
2071 Return -1 if something goes wrong, 0 otherwise.
2072 """,
2073 type="int",
2074 name="process_record_signal",
2075 params=[("struct regcache *", "regcache"), ("enum gdb_signal", "signal")],
2076 predicate=True,
2079 Method(
2080 comment="""
2081 Signal translation: translate inferior's signal (target's) number
2082 into GDB's representation. The implementation of this method must
2083 be host independent. IOW, don't rely on symbols of the NAT_FILE
2084 header (the nm-*.h files), the host <signal.h> header, or similar
2085 headers. This is mainly used when cross-debugging core files ---
2086 "Live" targets hide the translation behind the target interface
2087 (target_wait, target_resume, etc.).
2088 """,
2089 type="enum gdb_signal",
2090 name="gdb_signal_from_target",
2091 params=[("int", "signo")],
2092 predicate=True,
2095 Method(
2096 comment="""
2097 Signal translation: translate the GDB's internal signal number into
2098 the inferior's signal (target's) representation. The implementation
2099 of this method must be host independent. IOW, don't rely on symbols
2100 of the NAT_FILE header (the nm-*.h files), the host <signal.h>
2101 header, or similar headers.
2102 Return the target signal number if found, or -1 if the GDB internal
2103 signal number is invalid.
2104 """,
2105 type="int",
2106 name="gdb_signal_to_target",
2107 params=[("enum gdb_signal", "signal")],
2108 predicate=True,
2111 Method(
2112 comment="""
2113 Extra signal info inspection.
2115 Return a type suitable to inspect extra signal information.
2116 """,
2117 type="struct type *",
2118 name="get_siginfo_type",
2119 params=[],
2120 predicate=True,
2123 Method(
2124 comment="""
2125 Record architecture-specific information from the symbol table.
2126 """,
2127 type="void",
2128 name="record_special_symbol",
2129 params=[("struct objfile *", "objfile"), ("asymbol *", "sym")],
2130 predicate=True,
2133 Method(
2134 comment="""
2135 Function for the 'catch syscall' feature.
2136 Get architecture-specific system calls information from registers.
2137 """,
2138 type="LONGEST",
2139 name="get_syscall_number",
2140 params=[("thread_info *", "thread")],
2141 predicate=True,
2144 Value(
2145 comment="""
2146 The filename of the XML syscall for this architecture.
2147 """,
2148 type="const char *",
2149 name="xml_syscall_file",
2150 invalid=False,
2151 printer="pstring (gdbarch->xml_syscall_file)",
2154 Value(
2155 comment="""
2156 Information about system calls from this architecture
2157 """,
2158 type="struct syscalls_info *",
2159 name="syscalls_info",
2160 invalid=False,
2161 printer="host_address_to_string (gdbarch->syscalls_info)",
2164 Value(
2165 comment="""
2166 SystemTap related fields and functions.
2167 A NULL-terminated array of prefixes used to mark an integer constant
2168 on the architecture's assembly.
2169 For example, on x86 integer constants are written as:
2171 $10 ;; integer constant 10
2173 in this case, this prefix would be the character `$'.
2174 """,
2175 type="const char *const *",
2176 name="stap_integer_prefixes",
2177 invalid=False,
2178 printer="pstring_list (gdbarch->stap_integer_prefixes)",
2181 Value(
2182 comment="""
2183 A NULL-terminated array of suffixes used to mark an integer constant
2184 on the architecture's assembly.
2185 """,
2186 type="const char *const *",
2187 name="stap_integer_suffixes",
2188 invalid=False,
2189 printer="pstring_list (gdbarch->stap_integer_suffixes)",
2192 Value(
2193 comment="""
2194 A NULL-terminated array of prefixes used to mark a register name on
2195 the architecture's assembly.
2196 For example, on x86 the register name is written as:
2198 %eax ;; register eax
2200 in this case, this prefix would be the character `%'.
2201 """,
2202 type="const char *const *",
2203 name="stap_register_prefixes",
2204 invalid=False,
2205 printer="pstring_list (gdbarch->stap_register_prefixes)",
2208 Value(
2209 comment="""
2210 A NULL-terminated array of suffixes used to mark a register name on
2211 the architecture's assembly.
2212 """,
2213 type="const char *const *",
2214 name="stap_register_suffixes",
2215 invalid=False,
2216 printer="pstring_list (gdbarch->stap_register_suffixes)",
2219 Value(
2220 comment="""
2221 A NULL-terminated array of prefixes used to mark a register
2222 indirection on the architecture's assembly.
2223 For example, on x86 the register indirection is written as:
2225 (%eax) ;; indirecting eax
2227 in this case, this prefix would be the charater `('.
2229 Please note that we use the indirection prefix also for register
2230 displacement, e.g., `4(%eax)' on x86.
2231 """,
2232 type="const char *const *",
2233 name="stap_register_indirection_prefixes",
2234 invalid=False,
2235 printer="pstring_list (gdbarch->stap_register_indirection_prefixes)",
2238 Value(
2239 comment="""
2240 A NULL-terminated array of suffixes used to mark a register
2241 indirection on the architecture's assembly.
2242 For example, on x86 the register indirection is written as:
2244 (%eax) ;; indirecting eax
2246 in this case, this prefix would be the charater `)'.
2248 Please note that we use the indirection suffix also for register
2249 displacement, e.g., `4(%eax)' on x86.
2250 """,
2251 type="const char *const *",
2252 name="stap_register_indirection_suffixes",
2253 invalid=False,
2254 printer="pstring_list (gdbarch->stap_register_indirection_suffixes)",
2257 Value(
2258 comment="""
2259 Prefix(es) used to name a register using GDB's nomenclature.
2261 For example, on PPC a register is represented by a number in the assembly
2262 language (e.g., `10' is the 10th general-purpose register). However,
2263 inside GDB this same register has an `r' appended to its name, so the 10th
2264 register would be represented as `r10' internally.
2265 """,
2266 type="const char *",
2267 name="stap_gdb_register_prefix",
2268 invalid=False,
2269 printer="pstring (gdbarch->stap_gdb_register_prefix)",
2272 Value(
2273 comment="""
2274 Suffix used to name a register using GDB's nomenclature.
2275 """,
2276 type="const char *",
2277 name="stap_gdb_register_suffix",
2278 invalid=False,
2279 printer="pstring (gdbarch->stap_gdb_register_suffix)",
2282 Method(
2283 comment="""
2284 Check if S is a single operand.
2286 Single operands can be:
2287 - Literal integers, e.g. `$10' on x86
2288 - Register access, e.g. `%eax' on x86
2289 - Register indirection, e.g. `(%eax)' on x86
2290 - Register displacement, e.g. `4(%eax)' on x86
2292 This function should check for these patterns on the string
2293 and return 1 if some were found, or zero otherwise. Please try to match
2294 as much info as you can from the string, i.e., if you have to match
2295 something like `(%', do not match just the `('.
2296 """,
2297 type="int",
2298 name="stap_is_single_operand",
2299 params=[("const char *", "s")],
2300 predicate=True,
2303 Method(
2304 comment="""
2305 Function used to handle a "special case" in the parser.
2307 A "special case" is considered to be an unknown token, i.e., a token
2308 that the parser does not know how to parse. A good example of special
2309 case would be ARM's register displacement syntax:
2311 [R0, #4] ;; displacing R0 by 4
2313 Since the parser assumes that a register displacement is of the form:
2315 <number> <indirection_prefix> <register_name> <indirection_suffix>
2317 it means that it will not be able to recognize and parse this odd syntax.
2318 Therefore, we should add a special case function that will handle this token.
2320 This function should generate the proper expression form of the expression
2321 using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
2322 and so on). It should also return 1 if the parsing was successful, or zero
2323 if the token was not recognized as a special token (in this case, returning
2324 zero means that the special parser is deferring the parsing to the generic
2325 parser), and should advance the buffer pointer (p->arg).
2326 """,
2327 type="expr::operation_up",
2328 name="stap_parse_special_token",
2329 params=[("struct stap_parse_info *", "p")],
2330 predicate=True,
2333 Method(
2334 comment="""
2335 Perform arch-dependent adjustments to a register name.
2337 In very specific situations, it may be necessary for the register
2338 name present in a SystemTap probe's argument to be handled in a
2339 special way. For example, on i386, GCC may over-optimize the
2340 register allocation and use smaller registers than necessary. In
2341 such cases, the client that is reading and evaluating the SystemTap
2342 probe (ourselves) will need to actually fetch values from the wider
2343 version of the register in question.
2345 To illustrate the example, consider the following probe argument
2346 (i386):
2348 4@%ax
2350 This argument says that its value can be found at the %ax register,
2351 which is a 16-bit register. However, the argument's prefix says
2352 that its type is "uint32_t", which is 32-bit in size. Therefore, in
2353 this case, GDB should actually fetch the probe's value from register
2354 %eax, not %ax. In this scenario, this function would actually
2355 replace the register name from %ax to %eax.
2357 The rationale for this can be found at PR breakpoints/24541.
2358 """,
2359 type="std::string",
2360 name="stap_adjust_register",
2361 params=[
2362 ("struct stap_parse_info *", "p"),
2363 ("const std::string &", "regname"),
2364 ("int", "regnum"),
2366 predicate=True,
2369 Method(
2370 comment="""
2371 DTrace related functions.
2372 The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
2373 NARG must be >= 0.
2374 """,
2375 type="expr::operation_up",
2376 name="dtrace_parse_probe_argument",
2377 params=[("int", "narg")],
2378 predicate=True,
2381 Method(
2382 comment="""
2383 True if the given ADDR does not contain the instruction sequence
2384 corresponding to a disabled DTrace is-enabled probe.
2385 """,
2386 type="int",
2387 name="dtrace_probe_is_enabled",
2388 params=[("CORE_ADDR", "addr")],
2389 predicate=True,
2392 Method(
2393 comment="""
2394 Enable a DTrace is-enabled probe at ADDR.
2395 """,
2396 type="void",
2397 name="dtrace_enable_probe",
2398 params=[("CORE_ADDR", "addr")],
2399 predicate=True,
2402 Method(
2403 comment="""
2404 Disable a DTrace is-enabled probe at ADDR.
2405 """,
2406 type="void",
2407 name="dtrace_disable_probe",
2408 params=[("CORE_ADDR", "addr")],
2409 predicate=True,
2412 Value(
2413 comment="""
2414 True if the list of shared libraries is one and only for all
2415 processes, as opposed to a list of shared libraries per inferior.
2416 This usually means that all processes, although may or may not share
2417 an address space, will see the same set of symbols at the same
2418 addresses.
2419 """,
2420 type="int",
2421 name="has_global_solist",
2422 predefault="0",
2423 invalid=False,
2426 Value(
2427 comment="""
2428 On some targets, even though each inferior has its own private
2429 address space, the debug interface takes care of making breakpoints
2430 visible to all address spaces automatically. For such cases,
2431 this property should be set to true.
2432 """,
2433 type="int",
2434 name="has_global_breakpoints",
2435 predefault="0",
2436 invalid=False,
2439 Method(
2440 comment="""
2441 True if inferiors share an address space (e.g., uClinux).
2442 """,
2443 type="int",
2444 name="has_shared_address_space",
2445 params=[],
2446 predefault="default_has_shared_address_space",
2447 invalid=False,
2450 Method(
2451 comment="""
2452 True if a fast tracepoint can be set at an address.
2453 """,
2454 type="int",
2455 name="fast_tracepoint_valid_at",
2456 params=[("CORE_ADDR", "addr"), ("std::string *", "msg")],
2457 predefault="default_fast_tracepoint_valid_at",
2458 invalid=False,
2461 Method(
2462 comment="""
2463 Guess register state based on tracepoint location. Used for tracepoints
2464 where no registers have been collected, but there's only one location,
2465 allowing us to guess the PC value, and perhaps some other registers.
2466 On entry, regcache has all registers marked as unavailable.
2467 """,
2468 type="void",
2469 name="guess_tracepoint_registers",
2470 params=[("struct regcache *", "regcache"), ("CORE_ADDR", "addr")],
2471 predefault="default_guess_tracepoint_registers",
2472 invalid=False,
2475 Function(
2476 comment="""
2477 Return the "auto" target charset.
2478 """,
2479 type="const char *",
2480 name="auto_charset",
2481 params=[],
2482 predefault="default_auto_charset",
2483 invalid=False,
2486 Function(
2487 comment="""
2488 Return the "auto" target wide charset.
2489 """,
2490 type="const char *",
2491 name="auto_wide_charset",
2492 params=[],
2493 predefault="default_auto_wide_charset",
2494 invalid=False,
2497 Value(
2498 comment="""
2499 If non-empty, this is a file extension that will be opened in place
2500 of the file extension reported by the shared library list.
2502 This is most useful for toolchains that use a post-linker tool,
2503 where the names of the files run on the target differ in extension
2504 compared to the names of the files GDB should load for debug info.
2505 """,
2506 type="const char *",
2507 name="solib_symbols_extension",
2508 invalid=False,
2509 printer="pstring (gdbarch->solib_symbols_extension)",
2512 Value(
2513 comment="""
2514 If true, the target OS has DOS-based file system semantics. That
2515 is, absolute paths include a drive name, and the backslash is
2516 considered a directory separator.
2517 """,
2518 type="int",
2519 name="has_dos_based_file_system",
2520 predefault="0",
2521 invalid=False,
2524 Method(
2525 comment="""
2526 Generate bytecodes to collect the return address in a frame.
2527 Since the bytecodes run on the target, possibly with GDB not even
2528 connected, the full unwinding machinery is not available, and
2529 typically this function will issue bytecodes for one or more likely
2530 places that the return address may be found.
2531 """,
2532 type="void",
2533 name="gen_return_address",
2534 params=[
2535 ("struct agent_expr *", "ax"),
2536 ("struct axs_value *", "value"),
2537 ("CORE_ADDR", "scope"),
2539 predefault="default_gen_return_address",
2540 invalid=False,
2543 Method(
2544 comment="""
2545 Implement the "info proc" command.
2546 """,
2547 type="void",
2548 name="info_proc",
2549 params=[("const char *", "args"), ("enum info_proc_what", "what")],
2550 predicate=True,
2553 Method(
2554 comment="""
2555 Implement the "info proc" command for core files. Noe that there
2556 are two "info_proc"-like methods on gdbarch -- one for core files,
2557 one for live targets.
2558 """,
2559 type="void",
2560 name="core_info_proc",
2561 params=[("const char *", "args"), ("enum info_proc_what", "what")],
2562 predicate=True,
2565 Method(
2566 comment="""
2567 Iterate over all objfiles in the order that makes the most sense
2568 for the architecture to make global symbol searches.
2570 CB is a callback function passed an objfile to be searched. The iteration stops
2571 if this function returns nonzero.
2573 If not NULL, CURRENT_OBJFILE corresponds to the objfile being
2574 inspected when the symbol search was requested.
2575 """,
2576 type="void",
2577 name="iterate_over_objfiles_in_search_order",
2578 params=[
2579 ("iterate_over_objfiles_in_search_order_cb_ftype", "cb"),
2580 ("struct objfile *", "current_objfile"),
2582 predefault="default_iterate_over_objfiles_in_search_order",
2583 invalid=False,
2586 Value(
2587 comment="""
2588 Ravenscar arch-dependent ops.
2589 """,
2590 type="struct ravenscar_arch_ops *",
2591 name="ravenscar_ops",
2592 predefault="NULL",
2593 invalid=False,
2594 printer="host_address_to_string (gdbarch->ravenscar_ops)",
2597 Method(
2598 comment="""
2599 Return non-zero if the instruction at ADDR is a call; zero otherwise.
2600 """,
2601 type="int",
2602 name="insn_is_call",
2603 params=[("CORE_ADDR", "addr")],
2604 predefault="default_insn_is_call",
2605 invalid=False,
2608 Method(
2609 comment="""
2610 Return non-zero if the instruction at ADDR is a return; zero otherwise.
2611 """,
2612 type="int",
2613 name="insn_is_ret",
2614 params=[("CORE_ADDR", "addr")],
2615 predefault="default_insn_is_ret",
2616 invalid=False,
2619 Method(
2620 comment="""
2621 Return non-zero if the instruction at ADDR is a jump; zero otherwise.
2622 """,
2623 type="int",
2624 name="insn_is_jump",
2625 params=[("CORE_ADDR", "addr")],
2626 predefault="default_insn_is_jump",
2627 invalid=False,
2630 Method(
2631 comment="""
2632 Return true if there's a program/permanent breakpoint planted in
2633 memory at ADDRESS, return false otherwise.
2634 """,
2635 type="bool",
2636 name="program_breakpoint_here_p",
2637 params=[("CORE_ADDR", "address")],
2638 predefault="default_program_breakpoint_here_p",
2639 invalid=False,
2642 Method(
2643 comment="""
2644 Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
2645 Return 0 if *READPTR is already at the end of the buffer.
2646 Return -1 if there is insufficient buffer for a whole entry.
2647 Return 1 if an entry was read into *TYPEP and *VALP.
2648 """,
2649 type="int",
2650 name="auxv_parse",
2651 params=[
2652 ("const gdb_byte **", "readptr"),
2653 ("const gdb_byte *", "endptr"),
2654 ("CORE_ADDR *", "typep"),
2655 ("CORE_ADDR *", "valp"),
2657 predicate=True,
2660 Method(
2661 comment="""
2662 Print the description of a single auxv entry described by TYPE and VAL
2663 to FILE.
2664 """,
2665 type="void",
2666 name="print_auxv_entry",
2667 params=[("struct ui_file *", "file"), ("CORE_ADDR", "type"), ("CORE_ADDR", "val")],
2668 predefault="default_print_auxv_entry",
2669 invalid=False,
2672 Method(
2673 comment="""
2674 Find the address range of the current inferior's vsyscall/vDSO, and
2675 write it to *RANGE. If the vsyscall's length can't be determined, a
2676 range with zero length is returned. Returns true if the vsyscall is
2677 found, false otherwise.
2678 """,
2679 type="int",
2680 name="vsyscall_range",
2681 params=[("struct mem_range *", "range")],
2682 predefault="default_vsyscall_range",
2683 invalid=False,
2686 Function(
2687 comment="""
2688 Allocate SIZE bytes of PROT protected page aligned memory in inferior.
2689 PROT has GDB_MMAP_PROT_* bitmask format.
2690 Throw an error if it is not possible. Returned address is always valid.
2691 """,
2692 type="CORE_ADDR",
2693 name="infcall_mmap",
2694 params=[("CORE_ADDR", "size"), ("unsigned", "prot")],
2695 predefault="default_infcall_mmap",
2696 invalid=False,
2699 Function(
2700 comment="""
2701 Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
2702 Print a warning if it is not possible.
2703 """,
2704 type="void",
2705 name="infcall_munmap",
2706 params=[("CORE_ADDR", "addr"), ("CORE_ADDR", "size")],
2707 predefault="default_infcall_munmap",
2708 invalid=False,
2711 Method(
2712 comment="""
2713 Return string (caller has to use xfree for it) with options for GCC
2714 to produce code for this target, typically "-m64", "-m32" or "-m31".
2715 These options are put before CU's DW_AT_producer compilation options so that
2716 they can override it.
2717 """,
2718 type="std::string",
2719 name="gcc_target_options",
2720 params=[],
2721 predefault="default_gcc_target_options",
2722 invalid=False,
2725 Method(
2726 comment="""
2727 Return a regular expression that matches names used by this
2728 architecture in GNU configury triplets. The result is statically
2729 allocated and must not be freed. The default implementation simply
2730 returns the BFD architecture name, which is correct in nearly every
2731 case.
2732 """,
2733 type="const char *",
2734 name="gnu_triplet_regexp",
2735 params=[],
2736 predefault="default_gnu_triplet_regexp",
2737 invalid=False,
2740 Method(
2741 comment="""
2742 Return the size in 8-bit bytes of an addressable memory unit on this
2743 architecture. This corresponds to the number of 8-bit bytes associated to
2744 each address in memory.
2745 """,
2746 type="int",
2747 name="addressable_memory_unit_size",
2748 params=[],
2749 predefault="default_addressable_memory_unit_size",
2750 invalid=False,
2753 Value(
2754 comment="""
2755 Functions for allowing a target to modify its disassembler options.
2756 """,
2757 type="const char *",
2758 name="disassembler_options_implicit",
2759 invalid=False,
2760 printer="pstring (gdbarch->disassembler_options_implicit)",
2763 Value(
2764 type="std::string *",
2765 name="disassembler_options",
2766 invalid=False,
2767 printer="pstring_ptr (gdbarch->disassembler_options)",
2770 Value(
2771 type="const disasm_options_and_args_t *",
2772 name="valid_disassembler_options",
2773 invalid=False,
2774 printer="host_address_to_string (gdbarch->valid_disassembler_options)",
2777 Method(
2778 comment="""
2779 Type alignment override method. Return the architecture specific
2780 alignment required for TYPE. If there is no special handling
2781 required for TYPE then return the value 0, GDB will then apply the
2782 default rules as laid out in gdbtypes.c:type_align.
2783 """,
2784 type="ULONGEST",
2785 name="type_align",
2786 params=[("struct type *", "type")],
2787 predefault="default_type_align",
2788 invalid=False,
2791 Function(
2792 comment="""
2793 Return a string containing any flags for the given PC in the given FRAME.
2794 """,
2795 type="std::string",
2796 name="get_pc_address_flags",
2797 params=[("const frame_info_ptr &", "frame"), ("CORE_ADDR", "pc")],
2798 predefault="default_get_pc_address_flags",
2799 invalid=False,
2802 Method(
2803 comment="""
2804 Read core file mappings
2805 """,
2806 type="void",
2807 name="read_core_file_mappings",
2808 params=[
2809 ("struct bfd *", "cbfd"),
2810 ("read_core_file_mappings_pre_loop_ftype", "pre_loop_cb"),
2811 ("read_core_file_mappings_loop_ftype", "loop_cb"),
2813 predefault="default_read_core_file_mappings",
2814 invalid=False,
2817 Method(
2818 comment="""
2819 Return true if the target description for all threads should be read from the
2820 target description core file note(s). Return false if the target description
2821 for all threads should be inferred from the core file contents/sections.
2823 The corefile's bfd is passed through COREFILE_BFD.
2824 """,
2825 type="bool",
2826 name="use_target_description_from_corefile_notes",
2827 params=[("struct bfd *", "corefile_bfd")],
2828 predefault="default_use_target_description_from_corefile_notes",
2829 invalid=False,
2832 Method(
2833 comment="""
2834 Examine the core file bfd object CBFD and try to extract the name of
2835 the current executable and the argument list, which are return in a
2836 core_file_exec_context object.
2838 If for any reason the details can't be extracted from CBFD then an
2839 empty context is returned.
2841 It is required that the current inferior be the one associated with
2842 CBFD, strings are read from the current inferior using target methods
2843 which all assume current_inferior() is the one to read from.
2844 """,
2845 type="core_file_exec_context",
2846 name="core_parse_exec_context",
2847 params=[("bfd *", "cbfd")],
2848 predefault="default_core_parse_exec_context",
2849 invalid=False,