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
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
70 # After initialization is complete (that is, after the tdep code has a
71 # chance to change the settings), the post-initialization step is
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
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
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
118 type="const struct bfd_arch_info *",
119 name
="bfd_arch_info",
120 printer
="gdbarch_bfd_arch_info (gdbarch)->printable_name",
124 type="enum bfd_endian",
129 type="enum bfd_endian",
130 name
="byte_order_for_code",
134 type="enum gdb_osabi",
139 type="const struct target_desc *",
141 printer
="host_address_to_string (gdbarch->target_desc)",
146 Number of bits in a short or unsigned short for the target machine.
150 predefault
="2*TARGET_CHAR_BIT",
156 Number of bits in an int or unsigned int for the target machine.
160 predefault
="4*TARGET_CHAR_BIT",
164 long_bit_predefault
= "4*TARGET_CHAR_BIT"
167 Number of bits in a long or unsigned long for the target machine.
171 predefault
=long_bit_predefault
,
177 Number of bits in a long long or unsigned long long for the target
181 name
="long_long_bit",
182 predefault
="2*" + long_bit_predefault
,
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
196 predefault
="2*TARGET_CHAR_BIT",
201 type="const struct floatformat **",
202 name
="bfloat16_format",
203 predefault
="floatformats_bfloat16",
204 printer
="pformat (gdbarch, gdbarch->bfloat16_format)",
211 predefault
="2*TARGET_CHAR_BIT",
216 type="const struct floatformat **",
218 predefault
="floatformats_ieee_half",
219 printer
="pformat (gdbarch, gdbarch->half_format)",
226 predefault
="4*TARGET_CHAR_BIT",
231 type="const struct floatformat **",
233 predefault
="floatformats_ieee_single",
234 printer
="pformat (gdbarch, gdbarch->float_format)",
241 predefault
="8*TARGET_CHAR_BIT",
246 type="const struct floatformat **",
247 name
="double_format",
248 predefault
="floatformats_ieee_double",
249 printer
="pformat (gdbarch, gdbarch->double_format)",
255 name
="long_double_bit",
256 predefault
="8*TARGET_CHAR_BIT",
261 type="const struct floatformat **",
262 name
="long_double_format",
263 predefault
="floatformats_ieee_double",
264 printer
="pformat (gdbarch, gdbarch->long_double_format)",
270 The ABI default bit-size for "wchar_t". wchar_t is a built-in type
275 predefault
="4*TARGET_CHAR_BIT",
281 One if `wchar_t' is signed, zero if unsigned.
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.
296 type="const struct floatformat **",
297 name
="floatformat_for_type",
298 params
=[("const char *", "name"), ("int", "length")],
299 predefault
="default_floatformat_for_type",
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
318 predefault
=int_bit
.predefault
,
324 addr_bit is the size of a target address as represented in gdb
329 postdefault
="gdbarch_ptr_bit (gdbarch)",
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.
350 name
="dwarf2_addr_size",
351 postdefault
="gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT",
357 One if `char' acts like `signed char', zero if `unsigned char'.
369 params
=[("readable_regcache *", "regcache")],
376 params
=[("struct regcache *", "regcache"), ("CORE_ADDR", "val")],
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
387 name
="virtual_frame_pointer",
390 ("int *", "frame_regnum"),
391 ("LONGEST *", "frame_offset"),
393 predefault
="legacy_virtual_frame_pointer",
398 type="enum register_status",
399 name
="pseudo_register_read",
401 ("readable_regcache *", "regcache"),
402 ("int", "cookednum"),
403 ("gdb_byte *", "buf"),
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
415 type="struct value *",
416 name
="pseudo_register_read_value",
417 params
=[("const frame_info_ptr &", "next_frame"), ("int", "cookednum")],
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
429 name
="pseudo_register_write",
431 ("const frame_info_ptr &", "next_frame"),
432 ("int", "pseudo_reg_num"),
433 ("gdb::array_view<const gdb_byte>", "buf"),
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
447 Implementations should be migrated to implement pseudo_register_write instead.
450 name
="deprecated_pseudo_register_write",
452 ("struct regcache *", "regcache"),
453 ("int", "cookednum"),
454 ("const gdb_byte *", "buf"),
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.
473 name
="num_pseudo_regs",
480 Assemble agent expression bytecode to collect pseudo-register REG.
481 Return -1 if something goes wrong, 0 otherwise.
484 name
="ax_pseudo_register_collect",
485 params
=[("struct agent_expr *", "ax"), ("int", "reg")],
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.
496 name
="ax_pseudo_register_push_stack",
497 params
=[("struct agent_expr *", "ax"), ("int", "reg")],
503 Some architectures can display additional information for specific
505 UIOUT is the output stream where the handler will place information.
508 name
="report_signal_info",
509 params
=[("struct ui_out *", "uiout"), ("enum gdb_signal", "siggnal")],
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
518 gdbarch_sp_regnum will hopefully be replaced by UNWIND_SP.
549 Convert stab register number (from `r' declaration) to a gdb REGNUM.
552 name
="stab_reg_to_regnum",
553 params
=[("int", "stab_regnr")],
554 predefault
="no_op_reg_to_regnum",
560 Provide a default mapping from a ecoff register number to a gdb REGNUM.
563 name
="ecoff_reg_to_regnum",
564 params
=[("int", "ecoff_regnr")],
565 predefault
="no_op_reg_to_regnum",
571 Convert from an sdb register number to an internal gdb register number.
574 name
="sdb_reg_to_regnum",
575 params
=[("int", "sdb_regnr")],
576 predefault
="no_op_reg_to_regnum",
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.
586 name
="dwarf2_reg_to_regnum",
587 params
=[("int", "dwarf2_regnr")],
588 predefault
="no_op_reg_to_regnum",
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.
601 name
="register_name",
602 params
=[("int", "regnr")],
603 param_checks
=["regnr >= 0", "regnr < gdbarch_num_cooked_regs (gdbarch)"],
604 result_checks
=["result != nullptr"],
609 Return the type of a register specified by the architecture. Only
610 the register cache should call this function directly; others should
613 type="struct type *",
614 name
="register_type",
615 params
=[("int", "reg_nr")],
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
629 type="struct frame_id",
631 params
=[("const frame_info_ptr &", "this_frame")],
632 predefault
="default_dummy_id",
638 Implement DUMMY_ID and PUSH_DUMMY_CALL, then delete
639 deprecated_fp_regnum.
642 name
="deprecated_fp_regnum",
649 name
="push_dummy_call",
651 ("struct value *", "function"),
652 ("struct regcache *", "regcache"),
653 ("CORE_ADDR", "bp_addr"),
655 ("struct value **", "args"),
657 ("function_call_return_method", "return_method"),
658 ("CORE_ADDR", "struct_addr"),
664 type="enum call_dummy_location_type",
665 name
="call_dummy_location",
666 predefault
="AT_ENTRY_POINT",
672 name
="push_dummy_code",
675 ("CORE_ADDR", "funaddr"),
676 ("struct value **", "args"),
678 ("struct type *", "value_type"),
679 ("CORE_ADDR *", "real_pc"),
680 ("CORE_ADDR *", "bp_addr"),
681 ("struct regcache *", "regcache"),
688 Return true if the code of FRAME is writable.
691 name
="code_of_frame_writable",
692 params
=[("const frame_info_ptr &", "frame")],
693 predefault
="default_code_of_frame_writable",
699 name
="print_registers_info",
701 ("struct ui_file *", "file"),
702 ("const frame_info_ptr &", "frame"),
706 predefault
="default_print_registers_info",
712 name
="print_float_info",
714 ("struct ui_file *", "file"),
715 ("const frame_info_ptr &", "frame"),
716 ("const char *", "args"),
718 predefault
="default_print_float_info",
724 name
="print_vector_info",
726 ("struct ui_file *", "file"),
727 ("const frame_info_ptr &", "frame"),
728 ("const char *", "args"),
735 MAP a GDB RAW register number onto a simulator register number. See
736 also include/...-sim.h.
739 name
="register_sim_regno",
740 params
=[("int", "reg_nr")],
741 predefault
="legacy_register_sim_regno",
747 name
="cannot_fetch_register",
748 params
=[("int", "regnum")],
749 predefault
="cannot_register_not",
755 name
="cannot_store_register",
756 params
=[("int", "regnum")],
757 predefault
="cannot_register_not",
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.
769 name
="get_longjmp_target",
770 params
=[("const frame_info_ptr &", "frame"), ("CORE_ADDR *", "pc")],
776 name
="believe_pcc_promotion",
782 name
="convert_register_p",
783 params
=[("int", "regnum"), ("struct type *", "type")],
784 predefault
="generic_convert_register_p",
790 name
="register_to_value",
792 ("const frame_info_ptr &", "frame"),
794 ("struct type *", "type"),
795 ("gdb_byte *", "buf"),
796 ("int *", "optimizedp"),
797 ("int *", "unavailablep"),
804 name
="value_to_register",
806 ("const frame_info_ptr &", "frame"),
808 ("struct type *", "type"),
809 ("const gdb_byte *", "buf"),
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.
821 type="struct value *",
822 name
="value_from_register",
824 ("struct type *", "type"),
826 ("const frame_info_ptr &", "this_frame"),
828 predefault
="default_value_from_register",
834 name
="pointer_to_address",
835 params
=[("struct type *", "type"), ("const gdb_byte *", "buf")],
836 predefault
="unsigned_pointer_to_address",
842 name
="address_to_pointer",
843 params
=[("struct type *", "type"), ("gdb_byte *", "buf"), ("CORE_ADDR", "addr")],
844 predefault
="unsigned_address_to_pointer",
850 name
="integer_to_address",
851 params
=[("struct type *", "type"), ("const gdb_byte *", "buf")],
857 Return the return-value convention that will be used by FUNCTION
858 to return a value of type VALTYPE. FUNCTION may be NULL in which
859 case the return convention is computed based only on VALTYPE.
861 If READBUF is not NULL, extract the return value and save it in this buffer.
863 If WRITEBUF is not NULL, it contains a return value which will be
864 stored into the appropriate register. This can be used when we want
865 to force the value returned by a function (see the "return" command
868 NOTE: it is better to implement return_value_as_value instead, as that
869 method can properly handle variably-sized types.
871 type="enum return_value_convention",
874 ("struct value *", "function"),
875 ("struct type *", "valtype"),
876 ("struct regcache *", "regcache"),
877 ("gdb_byte *", "readbuf"),
878 ("const gdb_byte *", "writebuf"),
881 # We don't want to accidentally introduce calls to this, as gdb
882 # should only ever call return_value_new (see below).
888 Return the return-value convention that will be used by FUNCTION
889 to return a value of type VALTYPE. FUNCTION may be NULL in which
890 case the return convention is computed based only on VALTYPE.
892 If READ_VALUE is not NULL, extract the return value and save it in
895 If WRITEBUF is not NULL, it contains a return value which will be
896 stored into the appropriate register. This can be used when we want
897 to force the value returned by a function (see the "return" command
900 type="enum return_value_convention",
901 name
="return_value_as_value",
903 ("struct value *", "function"),
904 ("struct type *", "valtype"),
905 ("struct regcache *", "regcache"),
906 ("struct value **", "read_value"),
907 ("const gdb_byte *", "writebuf"),
909 predefault
="default_gdbarch_return_value",
910 # If we're using the default, then the other method must be set;
911 # but if we aren't using the default here then the other method
913 invalid
="(gdbarch->return_value_as_value == default_gdbarch_return_value) == (gdbarch->return_value == nullptr)",
918 Return the address at which the value being returned from
919 the current function will be stored. This routine is only
920 called if the current function uses the the "struct return
923 May return 0 when unable to determine that address.""",
925 name
="get_return_buf_addr",
926 params
=[("struct type *", "val_type"), ("const frame_info_ptr &", "cur_frame")],
927 predefault
="default_get_return_buf_addr",
932 # The DWARF info currently does not distinguish between IEEE 128-bit floating
933 # point values and the IBM 128-bit floating point format. GCC has an internal
934 # hack to identify the IEEE 128-bit floating point value. The long double is a
935 # defined base type in C. The GCC hack uses a typedef for long double to
936 # reference_Float128 base to identify the long double as and IEEE 128-bit
937 # value. The following method is used to "fix" the long double type to be a
938 # base type with the IEEE float format info from the _Float128 basetype and
939 # the long double name. With the fix, the proper name is printed for the
940 # GDB typedef command.
943 Return true if the typedef record needs to be replaced.".
945 Return 0 by default""",
947 name
="dwarf2_omit_typedef_p",
949 ("struct type *", "target_type"),
950 ("const char *", "producer"),
951 ("const char *", "name"),
953 predefault
="default_dwarf2_omit_typedef_p",
959 Update PC when trying to find a call site. This is useful on
960 architectures where the call site PC, as reported in the DWARF, can be
961 incorrect for some reason.
963 The passed-in PC will be an address in the inferior. GDB will have
964 already failed to find a call site at this PC. This function may
965 simply return its parameter if it thinks that should be the correct
968 name
="update_call_site_pc",
969 params
=[("CORE_ADDR", "pc")],
970 predefault
="default_update_call_site_pc",
976 Return true if the return value of function is stored in the first hidden
977 parameter. In theory, this feature should be language-dependent, specified
978 by language and its ABI, such as C++. Unfortunately, compiler may
979 implement it to a target-dependent feature. So that we need such hook here
980 to be aware of this in GDB.
983 name
="return_in_first_hidden_param_p",
984 params
=[("struct type *", "type")],
985 predefault
="default_return_in_first_hidden_param_p",
991 name
="skip_prologue",
992 params
=[("CORE_ADDR", "ip")],
997 name
="skip_main_prologue",
998 params
=[("CORE_ADDR", "ip")],
1004 On some platforms, a single function may provide multiple entry points,
1005 e.g. one that is used for function-pointer calls and a different one
1006 that is used for direct function calls.
1007 In order to ensure that breakpoints set on the function will trigger
1008 no matter via which entry point the function is entered, a platform
1009 may provide the skip_entrypoint callback. It is called with IP set
1010 to the main entry point of a function (as determined by the symbol table),
1011 and should return the address of the innermost entry point, where the
1012 actual breakpoint needs to be set. Note that skip_entrypoint is used
1013 by GDB common code even when debugging optimized code, where skip_prologue
1017 name
="skip_entrypoint",
1018 params
=[("CORE_ADDR", "ip")],
1025 params
=[("CORE_ADDR", "lhs"), ("CORE_ADDR", "rhs")],
1029 type="const gdb_byte *",
1030 name
="breakpoint_from_pc",
1031 params
=[("CORE_ADDR *", "pcptr"), ("int *", "lenptr")],
1032 predefault
="default_breakpoint_from_pc",
1038 Return the breakpoint kind for this target based on *PCPTR.
1041 name
="breakpoint_kind_from_pc",
1042 params
=[("CORE_ADDR *", "pcptr")],
1047 Return the software breakpoint from KIND. KIND can have target
1048 specific meaning like the Z0 kind parameter.
1049 SIZE is set to the software breakpoint's length in memory.
1051 type="const gdb_byte *",
1052 name
="sw_breakpoint_from_kind",
1053 params
=[("int", "kind"), ("int *", "size")],
1060 Return the breakpoint kind for this target based on the current
1061 processor state (e.g. the current instruction mode on ARM) and the
1062 *PCPTR. In default, it is gdbarch->breakpoint_kind_from_pc.
1065 name
="breakpoint_kind_from_current_state",
1066 params
=[("struct regcache *", "regcache"), ("CORE_ADDR *", "pcptr")],
1067 predefault
="default_breakpoint_kind_from_current_state",
1073 name
="adjust_breakpoint_address",
1074 params
=[("CORE_ADDR", "bpaddr")],
1080 name
="memory_insert_breakpoint",
1081 params
=[("struct bp_target_info *", "bp_tgt")],
1082 predefault
="default_memory_insert_breakpoint",
1088 name
="memory_remove_breakpoint",
1089 params
=[("struct bp_target_info *", "bp_tgt")],
1090 predefault
="default_memory_remove_breakpoint",
1096 name
="decr_pc_after_break",
1102 A function can be addressed by either its "pointer" (possibly a
1103 descriptor address) or "entry point" (first executable instruction).
1104 The method "convert_from_func_ptr_addr" converting the former to the
1105 latter. gdbarch_deprecated_function_start_offset is being used to implement
1106 a simplified subset of that functionality - the function's address
1107 corresponds to the "function pointer" and the function's start
1108 corresponds to the "function entry point" - and hence is redundant.
1111 name
="deprecated_function_start_offset",
1117 Return the remote protocol register number associated with this
1118 register. Normally the identity mapping.
1121 name
="remote_register_number",
1122 params
=[("int", "regno")],
1123 predefault
="default_remote_register_number",
1129 Fetch the target specific address used to represent a load module.
1132 name
="fetch_tls_load_module_address",
1133 params
=[("struct objfile *", "objfile")],
1139 Return the thread-local address at OFFSET in the thread-local
1140 storage for the thread PTID and the shared library or executable
1141 file given by LM_ADDR. If that block of thread-local storage hasn't
1142 been allocated yet, this function may throw an error. LM_ADDR may
1143 be zero for statically linked multithreaded inferiors.
1146 name
="get_thread_local_address",
1147 params
=[("ptid_t", "ptid"), ("CORE_ADDR", "lm_addr"), ("CORE_ADDR", "offset")],
1153 name
="frame_args_skip",
1160 params
=[("const frame_info_ptr &", "next_frame")],
1161 predefault
="default_unwind_pc",
1168 params
=[("const frame_info_ptr &", "next_frame")],
1169 predefault
="default_unwind_sp",
1175 DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
1176 frame-base. Enable frame-base before frame-unwind.
1179 name
="frame_num_args",
1180 params
=[("const frame_info_ptr &", "frame")],
1187 params
=[("CORE_ADDR", "address")],
1193 name
="stabs_argument_has_addr",
1194 params
=[("struct type *", "type")],
1195 predefault
="default_stabs_argument_has_addr",
1201 name
="frame_red_zone_size",
1207 name
="convert_from_func_ptr_addr",
1208 params
=[("CORE_ADDR", "addr"), ("struct target_ops *", "targ")],
1209 predefault
="convert_from_func_ptr_addr_identity",
1215 On some machines there are bits in addresses which are not really
1216 part of the address, but are used by the kernel, the hardware, etc.
1217 for special purposes. gdbarch_addr_bits_remove takes out any such bits so
1218 we get a "real" address such as one would find in a symbol table.
1219 This is used only for addresses of instructions, and even then I'm
1220 not sure it's used in all contexts. It exists to deal with there
1221 being a few stray bits in the PC which would mislead us, not as some
1222 sort of generic thing to handle alignment or segmentation (it's
1223 possible it should be in TARGET_READ_PC instead).
1226 name
="addr_bits_remove",
1227 params
=[("CORE_ADDR", "addr")],
1228 predefault
="core_addr_identity",
1234 On some architectures, not all bits of a pointer are significant.
1235 On AArch64, for example, the top bits of a pointer may carry a "tag", which
1236 can be ignored by the kernel and the hardware. The "tag" can be regarded as
1237 additional data associated with the pointer, but it is not part of the address.
1239 Given a pointer for the architecture, this hook removes all the
1240 non-significant bits and sign-extends things as needed. It gets used to remove
1241 non-address bits from data pointers (for example, removing the AArch64 MTE tag
1242 bits from a pointer) and from code pointers (removing the AArch64 PAC signature
1243 from a pointer containing the return address).
1246 name
="remove_non_address_bits",
1247 params
=[("CORE_ADDR", "pointer")],
1248 predefault
="default_remove_non_address_bits",
1254 Return a string representation of the memory tag TAG.
1257 name
="memtag_to_string",
1258 params
=[("struct value *", "tag")],
1259 predefault
="default_memtag_to_string",
1265 Return true if ADDRESS contains a tag and false otherwise. ADDRESS
1266 must be either a pointer or a reference type.
1269 name
="tagged_address_p",
1270 params
=[("CORE_ADDR", "address")],
1271 predefault
="default_tagged_address_p",
1277 Return true if the tag from ADDRESS matches the memory tag for that
1278 particular address. Return false otherwise.
1281 name
="memtag_matches_p",
1282 params
=[("struct value *", "address")],
1283 predefault
="default_memtag_matches_p",
1289 Set the tags of type TAG_TYPE, for the memory address range
1290 [ADDRESS, ADDRESS + LENGTH) to TAGS.
1291 Return true if successful and false otherwise.
1296 ("struct value *", "address"),
1297 ("size_t", "length"),
1298 ("const gdb::byte_vector &", "tags"),
1299 ("memtag_type", "tag_type"),
1301 predefault
="default_set_memtags",
1307 Return the tag of type TAG_TYPE associated with the memory address ADDRESS,
1308 assuming ADDRESS is tagged.
1310 type="struct value *",
1312 params
=[("struct value *", "address"), ("memtag_type", "tag_type")],
1313 predefault
="default_get_memtag",
1319 memtag_granule_size is the size of the allocation tag granule, for
1320 architectures that support memory tagging.
1321 This is 0 for architectures that do not support memory tagging.
1322 For a non-zero value, this represents the number of bytes of memory per tag.
1325 name
="memtag_granule_size",
1331 FIXME/cagney/2001-01-18: This should be split in two. A target method that
1332 indicates if the target needs software single step. An ISA method to
1335 FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the
1336 target can single step. If not, then implement single step using breakpoints.
1338 Return a vector of addresses on which the software single step
1339 breakpoints should be inserted. NULL means software single step is
1341 Multiple breakpoints may be inserted for some instructions such as
1342 conditional branch. However, each implementation must always evaluate
1343 the condition and only put the breakpoint at the branch destination if
1344 the condition is true, so that we ensure forward progress when stepping
1345 past a conditional branch to self.
1347 type="std::vector<CORE_ADDR>",
1348 name
="software_single_step",
1349 params
=[("struct regcache *", "regcache")],
1355 Return non-zero if the processor is executing a delay slot and a
1356 further single-step is needed before the instruction finishes.
1359 name
="single_step_through_delay",
1360 params
=[("const frame_info_ptr &", "frame")],
1366 FIXME: cagney/2003-08-28: Need to find a better way of selecting the
1367 disassembler. Perhaps objdump can handle it?
1371 params
=[("bfd_vma", "vma"), ("struct disassemble_info *", "info")],
1372 predefault
="default_print_insn",
1378 name
="skip_trampoline_code",
1379 params
=[("const frame_info_ptr &", "frame"), ("CORE_ADDR", "pc")],
1380 predefault
="generic_skip_trampoline_code",
1385 comment
="Vtable of solib operations functions.",
1386 type="const solib_ops *",
1388 predefault
="&solib_target_so_ops",
1389 printer
="host_address_to_string (gdbarch->so_ops)",
1395 If in_solib_dynsym_resolve_code() returns true, and SKIP_SOLIB_RESOLVER
1396 evaluates non-zero, this is the address where the debugger will place
1397 a step-resume breakpoint to get us past the dynamic linker.
1400 name
="skip_solib_resolver",
1401 params
=[("CORE_ADDR", "pc")],
1402 predefault
="generic_skip_solib_resolver",
1408 Some systems also have trampoline code for returning from shared libs.
1411 name
="in_solib_return_trampoline",
1412 params
=[("CORE_ADDR", "pc"), ("const char *", "name")],
1413 predefault
="generic_in_solib_return_trampoline",
1419 Return true if PC lies inside an indirect branch thunk.
1422 name
="in_indirect_branch_thunk",
1423 params
=[("CORE_ADDR", "pc")],
1424 predefault
="default_in_indirect_branch_thunk",
1430 A target might have problems with watchpoints as soon as the stack
1431 frame of the current function has been destroyed. This mostly happens
1432 as the first action in a function's epilogue. stack_frame_destroyed_p()
1433 is defined to return a non-zero value if either the given addr is one
1434 instruction after the stack destroying instruction up to the trailing
1435 return instruction or if we can figure out that the stack frame has
1436 already been invalidated regardless of the value of addr. Targets
1437 which don't suffer from that problem could just let this functionality
1441 name
="stack_frame_destroyed_p",
1442 params
=[("CORE_ADDR", "addr")],
1443 predefault
="generic_stack_frame_destroyed_p",
1449 Process an ELF symbol in the minimal symbol table in a backend-specific
1450 way. Normally this hook is supposed to do nothing, however if required,
1451 then this hook can be used to apply tranformations to symbols that are
1452 considered special in some way. For example the MIPS backend uses it
1453 to interpret `st_other' information to mark compressed code symbols so
1454 that they can be treated in the appropriate manner in the processing of
1455 the main symbol table and DWARF-2 records.
1458 name
="elf_make_msymbol_special",
1459 params
=[("asymbol *", "sym"), ("struct minimal_symbol *", "msym")],
1465 name
="coff_make_msymbol_special",
1466 params
=[("int", "val"), ("struct minimal_symbol *", "msym")],
1467 predefault
="default_coff_make_msymbol_special",
1473 Process a symbol in the main symbol table in a backend-specific way.
1474 Normally this hook is supposed to do nothing, however if required,
1475 then this hook can be used to apply tranformations to symbols that
1476 are considered special in some way. This is currently used by the
1477 MIPS backend to make sure compressed code symbols have the ISA bit
1478 set. This in turn is needed for symbol values seen in GDB to match
1479 the values used at the runtime by the program itself, for function
1480 and label references.
1483 name
="make_symbol_special",
1484 params
=[("struct symbol *", "sym"), ("struct objfile *", "objfile")],
1485 predefault
="default_make_symbol_special",
1491 Adjust the address retrieved from a DWARF-2 record other than a line
1492 entry in a backend-specific way. Normally this hook is supposed to
1493 return the address passed unchanged, however if that is incorrect for
1494 any reason, then this hook can be used to fix the address up in the
1495 required manner. This is currently used by the MIPS backend to make
1496 sure addresses in FDE, range records, etc. referring to compressed
1497 code have the ISA bit set, matching line information and the symbol
1501 name
="adjust_dwarf2_addr",
1502 params
=[("CORE_ADDR", "pc")],
1503 predefault
="default_adjust_dwarf2_addr",
1509 Adjust the address updated by a line entry in a backend-specific way.
1510 Normally this hook is supposed to return the address passed unchanged,
1511 however in the case of inconsistencies in these records, this hook can
1512 be used to fix them up in the required manner. This is currently used
1513 by the MIPS backend to make sure all line addresses in compressed code
1514 are presented with the ISA bit set, which is not always the case. This
1515 in turn ensures breakpoint addresses are correctly matched against the
1519 name
="adjust_dwarf2_line",
1520 params
=[("CORE_ADDR", "addr"), ("int", "rel")],
1521 predefault
="default_adjust_dwarf2_line",
1527 name
="cannot_step_breakpoint",
1534 See comment in target.h about continuable, steppable and
1535 non-steppable watchpoints.
1538 name
="have_nonsteppable_watchpoint",
1544 type="type_instance_flags",
1545 name
="address_class_type_flags",
1546 params
=[("int", "byte_size"), ("int", "dwarf2_addr_class")],
1551 type="const char *",
1552 name
="address_class_type_flags_to_name",
1553 params
=[("type_instance_flags", "type_flags")],
1559 Execute vendor-specific DWARF Call Frame Instruction. OP is the instruction.
1560 FS are passed from the generic execute_cfa_program function.
1563 name
="execute_dwarf_cfa_vendor_op",
1564 params
=[("gdb_byte", "op"), ("struct dwarf2_frame_state *", "fs")],
1565 predefault
="default_execute_dwarf_cfa_vendor_op",
1571 Return the appropriate type_flags for the supplied address class.
1572 This function should return true if the address class was recognized and
1573 type_flags was set, false otherwise.
1576 name
="address_class_name_to_type_flags",
1577 params
=[("const char *", "name"), ("type_instance_flags *", "type_flags_ptr")],
1583 Is a register in a group
1586 name
="register_reggroup_p",
1587 params
=[("int", "regnum"), ("const struct reggroup *", "reggroup")],
1588 predefault
="default_register_reggroup_p",
1594 Fetch the pointer to the ith function argument.
1597 name
="fetch_pointer_argument",
1599 ("const frame_info_ptr &", "frame"),
1601 ("struct type *", "type"),
1608 Iterate over all supported register notes in a core file. For each
1609 supported register note section, the iterator must call CB and pass
1610 CB_DATA unchanged. If REGCACHE is not NULL, the iterator can limit
1611 the supported register note sections based on the current register
1612 values. Otherwise it should enumerate all supported register note
1616 name
="iterate_over_regset_sections",
1618 ("iterate_over_regset_sections_cb *", "cb"),
1619 ("void *", "cb_data"),
1620 ("const struct regcache *", "regcache"),
1627 Create core file notes
1629 type="gdb::unique_xmalloc_ptr<char>",
1630 name
="make_corefile_notes",
1631 params
=[("bfd *", "obfd"), ("int *", "note_size")],
1637 Find core file memory regions
1640 name
="find_memory_regions",
1641 params
=[("find_memory_region_ftype", "func"), ("void *", "data")],
1647 Given a bfd OBFD, segment ADDRESS and SIZE, create a memory tag section to be dumped to a core file
1650 name
="create_memtag_section",
1651 params
=[("bfd *", "obfd"), ("CORE_ADDR", "address"), ("size_t", "size")],
1657 Given a memory tag section OSEC, fill OSEC's contents with the appropriate tag data
1660 name
="fill_memtag_section",
1661 params
=[("asection *", "osec")],
1667 Decode a memory tag SECTION and return the tags of type TYPE contained in
1668 the memory range [ADDRESS, ADDRESS + LENGTH).
1669 If no tags were found, return an empty vector.
1671 type="gdb::byte_vector",
1672 name
="decode_memtag_section",
1674 ("bfd_section *", "section"),
1676 ("CORE_ADDR", "address"),
1677 ("size_t", "length"),
1684 Read offset OFFSET of TARGET_OBJECT_LIBRARIES formatted shared libraries list from
1685 core file into buffer READBUF with length LEN. Return the number of bytes read
1686 (zero indicates failure).
1687 failed, otherwise, return the red length of READBUF.
1690 name
="core_xfer_shared_libraries",
1691 params
=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1697 Read offset OFFSET of TARGET_OBJECT_LIBRARIES_AIX formatted shared
1698 libraries list from core file into buffer READBUF with length LEN.
1699 Return the number of bytes read (zero indicates failure).
1702 name
="core_xfer_shared_libraries_aix",
1703 params
=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1709 How the core target converts a PTID from a core file to a string.
1712 name
="core_pid_to_str",
1713 params
=[("ptid_t", "ptid")],
1719 How the core target extracts the name of a thread from a core file.
1721 type="const char *",
1722 name
="core_thread_name",
1723 params
=[("struct thread_info *", "thr")],
1729 Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
1730 from core file into buffer READBUF with length LEN. Return the number
1731 of bytes read (zero indicates EOF, a negative value indicates failure).
1734 name
="core_xfer_siginfo",
1735 params
=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
1741 Read x86 XSAVE layout information from core file into XSAVE_LAYOUT.
1742 Returns true if the layout was read successfully.
1745 name
="core_read_x86_xsave_layout",
1746 params
=[("x86_xsave_layout &", "xsave_layout")],
1752 BFD target to use when generating a core file.
1754 type="const char *",
1755 name
="gcore_bfd_target",
1757 printer
="pstring (gdbarch->gcore_bfd_target)",
1762 If the elements of C++ vtables are in-place function descriptors rather
1763 than normal function pointers (which may point to code or a descriptor),
1767 name
="vtable_function_descriptors",
1774 Set if the least significant bit of the delta is used instead of the least
1775 significant bit of the pfn for pointers to virtual member functions.
1778 name
="vbit_in_delta",
1784 Advance PC to next instruction in order to skip a permanent breakpoint.
1787 name
="skip_permanent_breakpoint",
1788 params
=[("struct regcache *", "regcache")],
1789 predefault
="default_skip_permanent_breakpoint",
1795 The maximum length of an instruction on this architecture in bytes.
1798 name
="max_insn_length",
1805 Copy the instruction at FROM to TO, and make any adjustments
1806 necessary to single-step it at that address.
1808 REGS holds the state the thread's registers will have before
1809 executing the copied instruction; the PC in REGS will refer to FROM,
1810 not the copy at TO. The caller should update it to point at TO later.
1812 Return a pointer to data of the architecture's choice to be passed
1813 to gdbarch_displaced_step_fixup.
1815 For a general explanation of displaced stepping and how GDB uses it,
1816 see the comments in infrun.c.
1818 The TO area is only guaranteed to have space for
1819 gdbarch_displaced_step_buffer_length (arch) octets, so this
1820 function must not write more octets than that to this area.
1822 If you do not provide this function, GDB assumes that the
1823 architecture does not support displaced stepping.
1825 If the instruction cannot execute out of line, return NULL. The
1826 core falls back to stepping past the instruction in-line instead in
1829 type="displaced_step_copy_insn_closure_up",
1830 name
="displaced_step_copy_insn",
1831 params
=[("CORE_ADDR", "from"), ("CORE_ADDR", "to"), ("struct regcache *", "regs")],
1837 Return true if GDB should use hardware single-stepping to execute a displaced
1838 step instruction. If false, GDB will simply restart execution at the
1839 displaced instruction location, and it is up to the target to ensure GDB will
1840 receive control again (e.g. by placing a software breakpoint instruction into
1841 the displaced instruction buffer).
1843 The default implementation returns false on all targets that provide a
1844 gdbarch_software_single_step routine, and true otherwise.
1847 name
="displaced_step_hw_singlestep",
1849 predefault
="default_displaced_step_hw_singlestep",
1855 Fix up the state after attempting to single-step a displaced
1856 instruction, to give the result we would have gotten from stepping the
1857 instruction in its original location.
1859 REGS is the register state resulting from single-stepping the
1860 displaced instruction.
1862 CLOSURE is the result from the matching call to
1863 gdbarch_displaced_step_copy_insn.
1865 FROM is the address where the instruction was original located, TO is
1866 the address of the displaced buffer where the instruction was copied
1869 COMPLETED_P is true if GDB stopped as a result of the requested step
1870 having completed (e.g. the inferior stopped with SIGTRAP), otherwise
1871 COMPLETED_P is false and GDB stopped for some other reason. In the
1872 case where a single instruction is expanded to multiple replacement
1873 instructions for stepping then it may be necessary to read the current
1874 program counter from REGS in order to decide how far through the
1875 series of replacement instructions the inferior got before stopping,
1876 this may impact what will need fixing up in this function.
1878 For a general explanation of displaced stepping and how GDB uses it,
1879 see the comments in infrun.c.
1882 name
="displaced_step_fixup",
1884 ("struct displaced_step_copy_insn_closure *", "closure"),
1885 ("CORE_ADDR", "from"),
1886 ("CORE_ADDR", "to"),
1887 ("struct regcache *", "regs"),
1888 ("bool", "completed_p"),
1892 invalid
="(gdbarch->displaced_step_copy_insn == nullptr) != (gdbarch->displaced_step_fixup == nullptr)",
1897 Prepare THREAD for it to displaced step the instruction at its current PC.
1899 Throw an exception if any unexpected error happens.
1901 type="displaced_step_prepare_status",
1902 name
="displaced_step_prepare",
1903 params
=[("thread_info *", "thread"), ("CORE_ADDR &", "displaced_pc")],
1909 Clean up after a displaced step of THREAD.
1911 It is possible for the displaced-stepped instruction to have caused
1912 the thread to exit. The implementation can detect this case by
1913 checking if WS.kind is TARGET_WAITKIND_THREAD_EXITED.
1915 type="displaced_step_finish_status",
1916 name
="displaced_step_finish",
1917 params
=[("thread_info *", "thread"), ("const target_waitstatus &", "ws")],
1919 invalid
="(! gdbarch->displaced_step_finish) != (! gdbarch->displaced_step_prepare)",
1924 Return the closure associated to the displaced step buffer that is at ADDR.
1926 type="const displaced_step_copy_insn_closure *",
1927 name
="displaced_step_copy_insn_closure_by_addr",
1928 params
=[("inferior *", "inf"), ("CORE_ADDR", "addr")],
1934 PARENT_INF has forked and CHILD_PTID is the ptid of the child. Restore the
1935 contents of all displaced step buffers in the child's address space.
1938 name
="displaced_step_restore_all_in_ptid",
1939 params
=[("inferior *", "parent_inf"), ("ptid_t", "child_ptid")],
1945 The maximum length in octets required for a displaced-step instruction
1946 buffer. By default this will be the same as gdbarch::max_insn_length,
1947 but should be overridden for architectures that might expand a
1948 displaced-step instruction to multiple replacement instructions.
1951 name
="displaced_step_buffer_length",
1953 postdefault
="gdbarch->max_insn_length",
1954 invalid
="gdbarch->displaced_step_buffer_length < gdbarch->max_insn_length",
1959 Relocate an instruction to execute at a different address. OLDLOC
1960 is the address in the inferior memory where the instruction to
1961 relocate is currently at. On input, TO points to the destination
1962 where we want the instruction to be copied (and possibly adjusted)
1963 to. On output, it points to one past the end of the resulting
1964 instruction(s). The effect of executing the instruction at TO shall
1965 be the same as if executing it at FROM. For example, call
1966 instructions that implicitly push the return address on the stack
1967 should be adjusted to return to the instruction after OLDLOC;
1968 relative branches, and other PC-relative instructions need the
1969 offset adjusted; etc.
1972 name
="relocate_instruction",
1973 params
=[("CORE_ADDR *", "to"), ("CORE_ADDR", "from")],
1980 Refresh overlay mapped state for section OSECT.
1983 name
="overlay_update",
1984 params
=[("struct obj_section *", "osect")],
1989 type="const struct target_desc *",
1990 name
="core_read_description",
1991 params
=[("struct target_ops *", "target"), ("bfd *", "abfd")],
1997 Set if the address in N_SO or N_FUN stabs may be zero.
2000 name
="sofun_address_maybe_missing",
2007 Parse the instruction at ADDR storing in the record execution log
2008 the registers REGCACHE and memory ranges that will be affected when
2009 the instruction executes, along with their current values.
2010 Return -1 if something goes wrong, 0 otherwise.
2013 name
="process_record",
2014 params
=[("struct regcache *", "regcache"), ("CORE_ADDR", "addr")],
2020 Save process state after a signal.
2021 Return -1 if something goes wrong, 0 otherwise.
2024 name
="process_record_signal",
2025 params
=[("struct regcache *", "regcache"), ("enum gdb_signal", "signal")],
2031 Signal translation: translate inferior's signal (target's) number
2032 into GDB's representation. The implementation of this method must
2033 be host independent. IOW, don't rely on symbols of the NAT_FILE
2034 header (the nm-*.h files), the host <signal.h> header, or similar
2035 headers. This is mainly used when cross-debugging core files ---
2036 "Live" targets hide the translation behind the target interface
2037 (target_wait, target_resume, etc.).
2039 type="enum gdb_signal",
2040 name
="gdb_signal_from_target",
2041 params
=[("int", "signo")],
2047 Signal translation: translate the GDB's internal signal number into
2048 the inferior's signal (target's) representation. The implementation
2049 of this method must be host independent. IOW, don't rely on symbols
2050 of the NAT_FILE header (the nm-*.h files), the host <signal.h>
2051 header, or similar headers.
2052 Return the target signal number if found, or -1 if the GDB internal
2053 signal number is invalid.
2056 name
="gdb_signal_to_target",
2057 params
=[("enum gdb_signal", "signal")],
2063 Extra signal info inspection.
2065 Return a type suitable to inspect extra signal information.
2067 type="struct type *",
2068 name
="get_siginfo_type",
2075 Record architecture-specific information from the symbol table.
2078 name
="record_special_symbol",
2079 params
=[("struct objfile *", "objfile"), ("asymbol *", "sym")],
2085 Function for the 'catch syscall' feature.
2086 Get architecture-specific system calls information from registers.
2089 name
="get_syscall_number",
2090 params
=[("thread_info *", "thread")],
2096 The filename of the XML syscall for this architecture.
2098 type="const char *",
2099 name
="xml_syscall_file",
2101 printer
="pstring (gdbarch->xml_syscall_file)",
2106 Information about system calls from this architecture
2108 type="struct syscalls_info *",
2109 name
="syscalls_info",
2111 printer
="host_address_to_string (gdbarch->syscalls_info)",
2116 SystemTap related fields and functions.
2117 A NULL-terminated array of prefixes used to mark an integer constant
2118 on the architecture's assembly.
2119 For example, on x86 integer constants are written as:
2121 $10 ;; integer constant 10
2123 in this case, this prefix would be the character `$'.
2125 type="const char *const *",
2126 name
="stap_integer_prefixes",
2128 printer
="pstring_list (gdbarch->stap_integer_prefixes)",
2133 A NULL-terminated array of suffixes used to mark an integer constant
2134 on the architecture's assembly.
2136 type="const char *const *",
2137 name
="stap_integer_suffixes",
2139 printer
="pstring_list (gdbarch->stap_integer_suffixes)",
2144 A NULL-terminated array of prefixes used to mark a register name on
2145 the architecture's assembly.
2146 For example, on x86 the register name is written as:
2148 %eax ;; register eax
2150 in this case, this prefix would be the character `%'.
2152 type="const char *const *",
2153 name
="stap_register_prefixes",
2155 printer
="pstring_list (gdbarch->stap_register_prefixes)",
2160 A NULL-terminated array of suffixes used to mark a register name on
2161 the architecture's assembly.
2163 type="const char *const *",
2164 name
="stap_register_suffixes",
2166 printer
="pstring_list (gdbarch->stap_register_suffixes)",
2171 A NULL-terminated array of prefixes used to mark a register
2172 indirection on the architecture's assembly.
2173 For example, on x86 the register indirection is written as:
2175 (%eax) ;; indirecting eax
2177 in this case, this prefix would be the charater `('.
2179 Please note that we use the indirection prefix also for register
2180 displacement, e.g., `4(%eax)' on x86.
2182 type="const char *const *",
2183 name
="stap_register_indirection_prefixes",
2185 printer
="pstring_list (gdbarch->stap_register_indirection_prefixes)",
2190 A NULL-terminated array of suffixes used to mark a register
2191 indirection on the architecture's assembly.
2192 For example, on x86 the register indirection is written as:
2194 (%eax) ;; indirecting eax
2196 in this case, this prefix would be the charater `)'.
2198 Please note that we use the indirection suffix also for register
2199 displacement, e.g., `4(%eax)' on x86.
2201 type="const char *const *",
2202 name
="stap_register_indirection_suffixes",
2204 printer
="pstring_list (gdbarch->stap_register_indirection_suffixes)",
2209 Prefix(es) used to name a register using GDB's nomenclature.
2211 For example, on PPC a register is represented by a number in the assembly
2212 language (e.g., `10' is the 10th general-purpose register). However,
2213 inside GDB this same register has an `r' appended to its name, so the 10th
2214 register would be represented as `r10' internally.
2216 type="const char *",
2217 name
="stap_gdb_register_prefix",
2219 printer
="pstring (gdbarch->stap_gdb_register_prefix)",
2224 Suffix used to name a register using GDB's nomenclature.
2226 type="const char *",
2227 name
="stap_gdb_register_suffix",
2229 printer
="pstring (gdbarch->stap_gdb_register_suffix)",
2234 Check if S is a single operand.
2236 Single operands can be:
2237 - Literal integers, e.g. `$10' on x86
2238 - Register access, e.g. `%eax' on x86
2239 - Register indirection, e.g. `(%eax)' on x86
2240 - Register displacement, e.g. `4(%eax)' on x86
2242 This function should check for these patterns on the string
2243 and return 1 if some were found, or zero otherwise. Please try to match
2244 as much info as you can from the string, i.e., if you have to match
2245 something like `(%', do not match just the `('.
2248 name
="stap_is_single_operand",
2249 params
=[("const char *", "s")],
2255 Function used to handle a "special case" in the parser.
2257 A "special case" is considered to be an unknown token, i.e., a token
2258 that the parser does not know how to parse. A good example of special
2259 case would be ARM's register displacement syntax:
2261 [R0, #4] ;; displacing R0 by 4
2263 Since the parser assumes that a register displacement is of the form:
2265 <number> <indirection_prefix> <register_name> <indirection_suffix>
2267 it means that it will not be able to recognize and parse this odd syntax.
2268 Therefore, we should add a special case function that will handle this token.
2270 This function should generate the proper expression form of the expression
2271 using GDB's internal expression mechanism (e.g., `write_exp_elt_opcode'
2272 and so on). It should also return 1 if the parsing was successful, or zero
2273 if the token was not recognized as a special token (in this case, returning
2274 zero means that the special parser is deferring the parsing to the generic
2275 parser), and should advance the buffer pointer (p->arg).
2277 type="expr::operation_up",
2278 name
="stap_parse_special_token",
2279 params
=[("struct stap_parse_info *", "p")],
2285 Perform arch-dependent adjustments to a register name.
2287 In very specific situations, it may be necessary for the register
2288 name present in a SystemTap probe's argument to be handled in a
2289 special way. For example, on i386, GCC may over-optimize the
2290 register allocation and use smaller registers than necessary. In
2291 such cases, the client that is reading and evaluating the SystemTap
2292 probe (ourselves) will need to actually fetch values from the wider
2293 version of the register in question.
2295 To illustrate the example, consider the following probe argument
2300 This argument says that its value can be found at the %ax register,
2301 which is a 16-bit register. However, the argument's prefix says
2302 that its type is "uint32_t", which is 32-bit in size. Therefore, in
2303 this case, GDB should actually fetch the probe's value from register
2304 %eax, not %ax. In this scenario, this function would actually
2305 replace the register name from %ax to %eax.
2307 The rationale for this can be found at PR breakpoints/24541.
2310 name
="stap_adjust_register",
2312 ("struct stap_parse_info *", "p"),
2313 ("const std::string &", "regname"),
2321 DTrace related functions.
2322 The expression to compute the NARTGth+1 argument to a DTrace USDT probe.
2325 type="expr::operation_up",
2326 name
="dtrace_parse_probe_argument",
2327 params
=[("int", "narg")],
2333 True if the given ADDR does not contain the instruction sequence
2334 corresponding to a disabled DTrace is-enabled probe.
2337 name
="dtrace_probe_is_enabled",
2338 params
=[("CORE_ADDR", "addr")],
2344 Enable a DTrace is-enabled probe at ADDR.
2347 name
="dtrace_enable_probe",
2348 params
=[("CORE_ADDR", "addr")],
2354 Disable a DTrace is-enabled probe at ADDR.
2357 name
="dtrace_disable_probe",
2358 params
=[("CORE_ADDR", "addr")],
2364 True if the list of shared libraries is one and only for all
2365 processes, as opposed to a list of shared libraries per inferior.
2366 This usually means that all processes, although may or may not share
2367 an address space, will see the same set of symbols at the same
2371 name
="has_global_solist",
2378 On some targets, even though each inferior has its own private
2379 address space, the debug interface takes care of making breakpoints
2380 visible to all address spaces automatically. For such cases,
2381 this property should be set to true.
2384 name
="has_global_breakpoints",
2391 True if inferiors share an address space (e.g., uClinux).
2394 name
="has_shared_address_space",
2396 predefault
="default_has_shared_address_space",
2402 True if a fast tracepoint can be set at an address.
2405 name
="fast_tracepoint_valid_at",
2406 params
=[("CORE_ADDR", "addr"), ("std::string *", "msg")],
2407 predefault
="default_fast_tracepoint_valid_at",
2413 Guess register state based on tracepoint location. Used for tracepoints
2414 where no registers have been collected, but there's only one location,
2415 allowing us to guess the PC value, and perhaps some other registers.
2416 On entry, regcache has all registers marked as unavailable.
2419 name
="guess_tracepoint_registers",
2420 params
=[("struct regcache *", "regcache"), ("CORE_ADDR", "addr")],
2421 predefault
="default_guess_tracepoint_registers",
2427 Return the "auto" target charset.
2429 type="const char *",
2430 name
="auto_charset",
2432 predefault
="default_auto_charset",
2438 Return the "auto" target wide charset.
2440 type="const char *",
2441 name
="auto_wide_charset",
2443 predefault
="default_auto_wide_charset",
2449 If non-empty, this is a file extension that will be opened in place
2450 of the file extension reported by the shared library list.
2452 This is most useful for toolchains that use a post-linker tool,
2453 where the names of the files run on the target differ in extension
2454 compared to the names of the files GDB should load for debug info.
2456 type="const char *",
2457 name
="solib_symbols_extension",
2459 printer
="pstring (gdbarch->solib_symbols_extension)",
2464 If true, the target OS has DOS-based file system semantics. That
2465 is, absolute paths include a drive name, and the backslash is
2466 considered a directory separator.
2469 name
="has_dos_based_file_system",
2476 Generate bytecodes to collect the return address in a frame.
2477 Since the bytecodes run on the target, possibly with GDB not even
2478 connected, the full unwinding machinery is not available, and
2479 typically this function will issue bytecodes for one or more likely
2480 places that the return address may be found.
2483 name
="gen_return_address",
2485 ("struct agent_expr *", "ax"),
2486 ("struct axs_value *", "value"),
2487 ("CORE_ADDR", "scope"),
2489 predefault
="default_gen_return_address",
2495 Implement the "info proc" command.
2499 params
=[("const char *", "args"), ("enum info_proc_what", "what")],
2505 Implement the "info proc" command for core files. Noe that there
2506 are two "info_proc"-like methods on gdbarch -- one for core files,
2507 one for live targets.
2510 name
="core_info_proc",
2511 params
=[("const char *", "args"), ("enum info_proc_what", "what")],
2517 Iterate over all objfiles in the order that makes the most sense
2518 for the architecture to make global symbol searches.
2520 CB is a callback function passed an objfile to be searched. The iteration stops
2521 if this function returns nonzero.
2523 If not NULL, CURRENT_OBJFILE corresponds to the objfile being
2524 inspected when the symbol search was requested.
2527 name
="iterate_over_objfiles_in_search_order",
2529 ("iterate_over_objfiles_in_search_order_cb_ftype", "cb"),
2530 ("struct objfile *", "current_objfile"),
2532 predefault
="default_iterate_over_objfiles_in_search_order",
2538 Ravenscar arch-dependent ops.
2540 type="struct ravenscar_arch_ops *",
2541 name
="ravenscar_ops",
2544 printer
="host_address_to_string (gdbarch->ravenscar_ops)",
2549 Return non-zero if the instruction at ADDR is a call; zero otherwise.
2552 name
="insn_is_call",
2553 params
=[("CORE_ADDR", "addr")],
2554 predefault
="default_insn_is_call",
2560 Return non-zero if the instruction at ADDR is a return; zero otherwise.
2564 params
=[("CORE_ADDR", "addr")],
2565 predefault
="default_insn_is_ret",
2571 Return non-zero if the instruction at ADDR is a jump; zero otherwise.
2574 name
="insn_is_jump",
2575 params
=[("CORE_ADDR", "addr")],
2576 predefault
="default_insn_is_jump",
2582 Return true if there's a program/permanent breakpoint planted in
2583 memory at ADDRESS, return false otherwise.
2586 name
="program_breakpoint_here_p",
2587 params
=[("CORE_ADDR", "address")],
2588 predefault
="default_program_breakpoint_here_p",
2594 Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
2595 Return 0 if *READPTR is already at the end of the buffer.
2596 Return -1 if there is insufficient buffer for a whole entry.
2597 Return 1 if an entry was read into *TYPEP and *VALP.
2602 ("const gdb_byte **", "readptr"),
2603 ("const gdb_byte *", "endptr"),
2604 ("CORE_ADDR *", "typep"),
2605 ("CORE_ADDR *", "valp"),
2612 Print the description of a single auxv entry described by TYPE and VAL
2616 name
="print_auxv_entry",
2617 params
=[("struct ui_file *", "file"), ("CORE_ADDR", "type"), ("CORE_ADDR", "val")],
2618 predefault
="default_print_auxv_entry",
2624 Find the address range of the current inferior's vsyscall/vDSO, and
2625 write it to *RANGE. If the vsyscall's length can't be determined, a
2626 range with zero length is returned. Returns true if the vsyscall is
2627 found, false otherwise.
2630 name
="vsyscall_range",
2631 params
=[("struct mem_range *", "range")],
2632 predefault
="default_vsyscall_range",
2638 Allocate SIZE bytes of PROT protected page aligned memory in inferior.
2639 PROT has GDB_MMAP_PROT_* bitmask format.
2640 Throw an error if it is not possible. Returned address is always valid.
2643 name
="infcall_mmap",
2644 params
=[("CORE_ADDR", "size"), ("unsigned", "prot")],
2645 predefault
="default_infcall_mmap",
2651 Deallocate SIZE bytes of memory at ADDR in inferior from gdbarch_infcall_mmap.
2652 Print a warning if it is not possible.
2655 name
="infcall_munmap",
2656 params
=[("CORE_ADDR", "addr"), ("CORE_ADDR", "size")],
2657 predefault
="default_infcall_munmap",
2663 Return string (caller has to use xfree for it) with options for GCC
2664 to produce code for this target, typically "-m64", "-m32" or "-m31".
2665 These options are put before CU's DW_AT_producer compilation options so that
2666 they can override it.
2669 name
="gcc_target_options",
2671 predefault
="default_gcc_target_options",
2677 Return a regular expression that matches names used by this
2678 architecture in GNU configury triplets. The result is statically
2679 allocated and must not be freed. The default implementation simply
2680 returns the BFD architecture name, which is correct in nearly every
2683 type="const char *",
2684 name
="gnu_triplet_regexp",
2686 predefault
="default_gnu_triplet_regexp",
2692 Return the size in 8-bit bytes of an addressable memory unit on this
2693 architecture. This corresponds to the number of 8-bit bytes associated to
2694 each address in memory.
2697 name
="addressable_memory_unit_size",
2699 predefault
="default_addressable_memory_unit_size",
2705 Functions for allowing a target to modify its disassembler options.
2707 type="const char *",
2708 name
="disassembler_options_implicit",
2710 printer
="pstring (gdbarch->disassembler_options_implicit)",
2714 type="std::string *",
2715 name
="disassembler_options",
2717 printer
="pstring_ptr (gdbarch->disassembler_options)",
2721 type="const disasm_options_and_args_t *",
2722 name
="valid_disassembler_options",
2724 printer
="host_address_to_string (gdbarch->valid_disassembler_options)",
2729 Type alignment override method. Return the architecture specific
2730 alignment required for TYPE. If there is no special handling
2731 required for TYPE then return the value 0, GDB will then apply the
2732 default rules as laid out in gdbtypes.c:type_align.
2736 params
=[("struct type *", "type")],
2737 predefault
="default_type_align",
2743 Return a string containing any flags for the given PC in the given FRAME.
2746 name
="get_pc_address_flags",
2747 params
=[("const frame_info_ptr &", "frame"), ("CORE_ADDR", "pc")],
2748 predefault
="default_get_pc_address_flags",
2754 Read core file mappings
2757 name
="read_core_file_mappings",
2759 ("struct bfd *", "cbfd"),
2760 ("read_core_file_mappings_pre_loop_ftype", "pre_loop_cb"),
2761 ("read_core_file_mappings_loop_ftype", "loop_cb"),
2763 predefault
="default_read_core_file_mappings",
2769 Return true if the target description for all threads should be read from the
2770 target description core file note(s). Return false if the target description
2771 for all threads should be inferred from the core file contents/sections.
2773 The corefile's bfd is passed through COREFILE_BFD.
2776 name
="use_target_description_from_corefile_notes",
2777 params
=[("struct bfd *", "corefile_bfd")],
2778 predefault
="default_use_target_description_from_corefile_notes",