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