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