PageRenderTime 2523ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 1ms

/src/freebsd/contrib/gdb/gdb/gdbarch.sh

https://bitbucket.org/killerpenguinassassins/open_distrib_devel
Shell | 1173 lines | 649 code | 154 blank | 370 comment | 49 complexity | 87532d4f8cef2c74eb43c867de756945 MD5 | raw file
Possible License(s): CC0-1.0, MIT, LGPL-2.0, LGPL-3.0, WTFPL, GPL-2.0, BSD-2-Clause, AGPL-3.0, CC-BY-SA-3.0, MPL-2.0, JSON, BSD-3-Clause-No-Nuclear-License-2014, LGPL-2.1, CPL-1.0, AGPL-1.0, 0BSD, ISC, Apache-2.0, GPL-3.0, IPL-1.0, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. #!/bin/sh -u
  2. # Architecture commands for GDB, the GNU debugger.
  3. #
  4. # Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
  5. # Foundation, Inc.
  6. #
  7. #
  8. # This file is part of GDB.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  23. # Make certain that the script is running in an internationalized
  24. # environment.
  25. LANG=c ; export LANG
  26. LC_ALL=c ; export LC_ALL
  27. compare_new ()
  28. {
  29. file=$1
  30. if test ! -r ${file}
  31. then
  32. echo "${file} missing? cp new-${file} ${file}" 1>&2
  33. elif diff -u ${file} new-${file}
  34. then
  35. echo "${file} unchanged" 1>&2
  36. else
  37. echo "${file} has changed? cp new-${file} ${file}" 1>&2
  38. fi
  39. }
  40. # Format of the input table
  41. read="class level macro returntype function formal actual attrib staticdefault predefault postdefault invalid_p fmt print print_p description"
  42. do_read ()
  43. {
  44. comment=""
  45. class=""
  46. while read line
  47. do
  48. if test "${line}" = ""
  49. then
  50. continue
  51. elif test "${line}" = "#" -a "${comment}" = ""
  52. then
  53. continue
  54. elif expr "${line}" : "#" > /dev/null
  55. then
  56. comment="${comment}
  57. ${line}"
  58. else
  59. # The semantics of IFS varies between different SH's. Some
  60. # treat ``::' as three fields while some treat it as just too.
  61. # Work around this by eliminating ``::'' ....
  62. line="`echo "${line}" | sed -e 's/::/: :/g' -e 's/::/: :/g'`"
  63. OFS="${IFS}" ; IFS="[:]"
  64. eval read ${read} <<EOF
  65. ${line}
  66. EOF
  67. IFS="${OFS}"
  68. # .... and then going back through each field and strip out those
  69. # that ended up with just that space character.
  70. for r in ${read}
  71. do
  72. if eval test \"\${${r}}\" = \"\ \"
  73. then
  74. eval ${r}=""
  75. fi
  76. done
  77. case "${level}" in
  78. 1 ) gt_level=">= GDB_MULTI_ARCH_PARTIAL" ;;
  79. 2 ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;;
  80. "" ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;;
  81. * ) error "Error: bad level for ${function}" 1>&2 ; kill $$ ; exit 1 ;;
  82. esac
  83. case "${class}" in
  84. m ) staticdefault="${predefault}" ;;
  85. M ) staticdefault="0" ;;
  86. * ) test "${staticdefault}" || staticdefault=0 ;;
  87. esac
  88. # come up with a format, use a few guesses for variables
  89. case ":${class}:${fmt}:${print}:" in
  90. :[vV]::: )
  91. if [ "${returntype}" = int ]
  92. then
  93. fmt="%d"
  94. print="${macro}"
  95. elif [ "${returntype}" = long ]
  96. then
  97. fmt="%ld"
  98. print="${macro}"
  99. fi
  100. ;;
  101. esac
  102. test "${fmt}" || fmt="%ld"
  103. test "${print}" || print="(long) ${macro}"
  104. case "${class}" in
  105. F | V | M )
  106. case "${invalid_p}" in
  107. "" )
  108. if test -n "${predefault}"
  109. then
  110. #invalid_p="gdbarch->${function} == ${predefault}"
  111. predicate="gdbarch->${function} != ${predefault}"
  112. elif class_is_variable_p
  113. then
  114. predicate="gdbarch->${function} != 0"
  115. elif class_is_function_p
  116. then
  117. predicate="gdbarch->${function} != NULL"
  118. fi
  119. ;;
  120. * )
  121. echo "Predicate function ${function} with invalid_p." 1>&2
  122. kill $$
  123. exit 1
  124. ;;
  125. esac
  126. esac
  127. # PREDEFAULT is a valid fallback definition of MEMBER when
  128. # multi-arch is not enabled. This ensures that the
  129. # default value, when multi-arch is the same as the
  130. # default value when not multi-arch. POSTDEFAULT is
  131. # always a valid definition of MEMBER as this again
  132. # ensures consistency.
  133. if [ -n "${postdefault}" ]
  134. then
  135. fallbackdefault="${postdefault}"
  136. elif [ -n "${predefault}" ]
  137. then
  138. fallbackdefault="${predefault}"
  139. else
  140. fallbackdefault="0"
  141. fi
  142. #NOT YET: See gdbarch.log for basic verification of
  143. # database
  144. break
  145. fi
  146. done
  147. if [ -n "${class}" ]
  148. then
  149. true
  150. else
  151. false
  152. fi
  153. }
  154. fallback_default_p ()
  155. {
  156. [ -n "${postdefault}" -a "x${invalid_p}" != "x0" ] \
  157. || [ -n "${predefault}" -a "x${invalid_p}" = "x0" ]
  158. }
  159. class_is_variable_p ()
  160. {
  161. case "${class}" in
  162. *v* | *V* ) true ;;
  163. * ) false ;;
  164. esac
  165. }
  166. class_is_function_p ()
  167. {
  168. case "${class}" in
  169. *f* | *F* | *m* | *M* ) true ;;
  170. * ) false ;;
  171. esac
  172. }
  173. class_is_multiarch_p ()
  174. {
  175. case "${class}" in
  176. *m* | *M* ) true ;;
  177. * ) false ;;
  178. esac
  179. }
  180. class_is_predicate_p ()
  181. {
  182. case "${class}" in
  183. *F* | *V* | *M* ) true ;;
  184. * ) false ;;
  185. esac
  186. }
  187. class_is_info_p ()
  188. {
  189. case "${class}" in
  190. *i* ) true ;;
  191. * ) false ;;
  192. esac
  193. }
  194. # dump out/verify the doco
  195. for field in ${read}
  196. do
  197. case ${field} in
  198. class ) : ;;
  199. # # -> line disable
  200. # f -> function
  201. # hiding a function
  202. # F -> function + predicate
  203. # hiding a function + predicate to test function validity
  204. # v -> variable
  205. # hiding a variable
  206. # V -> variable + predicate
  207. # hiding a variable + predicate to test variables validity
  208. # i -> set from info
  209. # hiding something from the ``struct info'' object
  210. # m -> multi-arch function
  211. # hiding a multi-arch function (parameterised with the architecture)
  212. # M -> multi-arch function + predicate
  213. # hiding a multi-arch function + predicate to test function validity
  214. level ) : ;;
  215. # See GDB_MULTI_ARCH description. Having GDB_MULTI_ARCH >=
  216. # LEVEL is a predicate on checking that a given method is
  217. # initialized (using INVALID_P).
  218. macro ) : ;;
  219. # The name of the MACRO that this method is to be accessed by.
  220. returntype ) : ;;
  221. # For functions, the return type; for variables, the data type
  222. function ) : ;;
  223. # For functions, the member function name; for variables, the
  224. # variable name. Member function names are always prefixed with
  225. # ``gdbarch_'' for name-space purity.
  226. formal ) : ;;
  227. # The formal argument list. It is assumed that the formal
  228. # argument list includes the actual name of each list element.
  229. # A function with no arguments shall have ``void'' as the
  230. # formal argument list.
  231. actual ) : ;;
  232. # The list of actual arguments. The arguments specified shall
  233. # match the FORMAL list given above. Functions with out
  234. # arguments leave this blank.
  235. attrib ) : ;;
  236. # Any GCC attributes that should be attached to the function
  237. # declaration. At present this field is unused.
  238. staticdefault ) : ;;
  239. # To help with the GDB startup a static gdbarch object is
  240. # created. STATICDEFAULT is the value to insert into that
  241. # static gdbarch object. Since this a static object only
  242. # simple expressions can be used.
  243. # If STATICDEFAULT is empty, zero is used.
  244. predefault ) : ;;
  245. # An initial value to assign to MEMBER of the freshly
  246. # malloc()ed gdbarch object. After initialization, the
  247. # freshly malloc()ed object is passed to the target
  248. # architecture code for further updates.
  249. # If PREDEFAULT is empty, zero is used.
  250. # A non-empty PREDEFAULT, an empty POSTDEFAULT and a zero
  251. # INVALID_P are specified, PREDEFAULT will be used as the
  252. # default for the non- multi-arch target.
  253. # A zero PREDEFAULT function will force the fallback to call
  254. # internal_error().
  255. # Variable declarations can refer to ``gdbarch'' which will
  256. # contain the current architecture. Care should be taken.
  257. postdefault ) : ;;
  258. # A value to assign to MEMBER of the new gdbarch object should
  259. # the target architecture code fail to change the PREDEFAULT
  260. # value.
  261. # If POSTDEFAULT is empty, no post update is performed.
  262. # If both INVALID_P and POSTDEFAULT are non-empty then
  263. # INVALID_P will be used to determine if MEMBER should be
  264. # changed to POSTDEFAULT.
  265. # If a non-empty POSTDEFAULT and a zero INVALID_P are
  266. # specified, POSTDEFAULT will be used as the default for the
  267. # non- multi-arch target (regardless of the value of
  268. # PREDEFAULT).
  269. # You cannot specify both a zero INVALID_P and a POSTDEFAULT.
  270. # Variable declarations can refer to ``current_gdbarch'' which
  271. # will contain the current architecture. Care should be
  272. # taken.
  273. invalid_p ) : ;;
  274. # A predicate equation that validates MEMBER. Non-zero is
  275. # returned if the code creating the new architecture failed to
  276. # initialize MEMBER or the initialized the member is invalid.
  277. # If POSTDEFAULT is non-empty then MEMBER will be updated to
  278. # that value. If POSTDEFAULT is empty then internal_error()
  279. # is called.
  280. # If INVALID_P is empty, a check that MEMBER is no longer
  281. # equal to PREDEFAULT is used.
  282. # The expression ``0'' disables the INVALID_P check making
  283. # PREDEFAULT a legitimate value.
  284. # See also PREDEFAULT and POSTDEFAULT.
  285. fmt ) : ;;
  286. # printf style format string that can be used to print out the
  287. # MEMBER. Sometimes "%s" is useful. For functions, this is
  288. # ignored and the function address is printed.
  289. # If FMT is empty, ``%ld'' is used.
  290. print ) : ;;
  291. # An optional equation that casts MEMBER to a value suitable
  292. # for formatting by FMT.
  293. # If PRINT is empty, ``(long)'' is used.
  294. print_p ) : ;;
  295. # An optional indicator for any predicte to wrap around the
  296. # print member code.
  297. # () -> Call a custom function to do the dump.
  298. # exp -> Wrap print up in ``if (${print_p}) ...
  299. # ``'' -> No predicate
  300. # If PRINT_P is empty, ``1'' is always used.
  301. description ) : ;;
  302. # Currently unused.
  303. *)
  304. echo "Bad field ${field}"
  305. exit 1;;
  306. esac
  307. done
  308. function_list ()
  309. {
  310. # See below (DOCO) for description of each field
  311. cat <<EOF
  312. i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL
  313. #
  314. i:2:TARGET_BYTE_ORDER:int:byte_order::::BFD_ENDIAN_BIG
  315. #
  316. i:2:TARGET_OSABI:enum gdb_osabi:osabi::::GDB_OSABI_UNKNOWN
  317. # Number of bits in a char or unsigned char for the target machine.
  318. # Just like CHAR_BIT in <limits.h> but describes the target machine.
  319. # v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
  320. #
  321. # Number of bits in a short or unsigned short for the target machine.
  322. v:2:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0
  323. # Number of bits in an int or unsigned int for the target machine.
  324. v:2:TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0
  325. # Number of bits in a long or unsigned long for the target machine.
  326. v:2:TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0
  327. # Number of bits in a long long or unsigned long long for the target
  328. # machine.
  329. v:2:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
  330. # Number of bits in a float for the target machine.
  331. v:2:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0
  332. # Number of bits in a double for the target machine.
  333. v:2:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0
  334. # Number of bits in a long double for the target machine.
  335. v:2:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARGET_CHAR_BIT::0
  336. # For most targets, a pointer on the target and its representation as an
  337. # address in GDB have the same size and "look the same". For such a
  338. # target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
  339. # / addr_bit will be set from it.
  340. #
  341. # If TARGET_PTR_BIT and TARGET_ADDR_BIT are different, you'll probably
  342. # also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
  343. #
  344. # ptr_bit is the size of a pointer on the target
  345. v:2:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0
  346. # addr_bit is the size of a target address as represented in gdb
  347. v:2:TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT:
  348. # Number of bits in a BFD_VMA for the target object file format.
  349. v:2:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
  350. #
  351. # One if \`char' acts like \`signed char', zero if \`unsigned char'.
  352. v:2:TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
  353. #
  354. F:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid
  355. f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
  356. # UNWIND_SP is a direct replacement for TARGET_READ_SP.
  357. F:2:TARGET_READ_SP:CORE_ADDR:read_sp:void
  358. # Function for getting target's idea of a frame pointer. FIXME: GDB's
  359. # whole scheme for dealing with "frames" and "frame pointers" needs a
  360. # serious shakedown.
  361. f:2:TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0
  362. #
  363. M:::void:pseudo_register_read:struct regcache *regcache, int cookednum, void *buf:regcache, cookednum, buf
  364. M:::void:pseudo_register_write:struct regcache *regcache, int cookednum, const void *buf:regcache, cookednum, buf
  365. #
  366. v:2:NUM_REGS:int:num_regs::::0:-1
  367. # This macro gives the number of pseudo-registers that live in the
  368. # register namespace but do not get fetched or stored on the target.
  369. # These pseudo-registers may be aliases for other registers,
  370. # combinations of other registers, or they may be computed by GDB.
  371. v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0:::
  372. # GDB's standard (or well known) register numbers. These can map onto
  373. # a real register or a pseudo (computed) register or not be defined at
  374. # all (-1).
  375. # SP_REGNUM will hopefully be replaced by UNWIND_SP.
  376. v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0
  377. v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
  378. v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
  379. v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
  380. # Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
  381. f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
  382. # Provide a default mapping from a ecoff register number to a gdb REGNUM.
  383. f:2:ECOFF_REG_TO_REGNUM:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr:::no_op_reg_to_regnum::0
  384. # Provide a default mapping from a DWARF register number to a gdb REGNUM.
  385. f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no_op_reg_to_regnum::0
  386. # Convert from an sdb register number to an internal gdb register number.
  387. f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
  388. f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
  389. f::REGISTER_NAME:const char *:register_name:int regnr:regnr
  390. # REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
  391. M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr
  392. # REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
  393. F:2:DEPRECATED_REGISTER_VIRTUAL_TYPE:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr
  394. # DEPRECATED_REGISTER_BYTES can be deleted. The value is computed
  395. # from REGISTER_TYPE.
  396. v::DEPRECATED_REGISTER_BYTES:int:deprecated_register_bytes
  397. # If the value returned by DEPRECATED_REGISTER_BYTE agrees with the
  398. # register offsets computed using just REGISTER_TYPE, this can be
  399. # deleted. See: maint print registers. NOTE: cagney/2002-05-02: This
  400. # function with predicate has a valid (callable) initial value. As a
  401. # consequence, even when the predicate is false, the corresponding
  402. # function works. This simplifies the migration process - old code,
  403. # calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified.
  404. F::DEPRECATED_REGISTER_BYTE:int:deprecated_register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
  405. # If all registers have identical raw and virtual sizes and those
  406. # sizes agree with the value computed from REGISTER_TYPE,
  407. # DEPRECATED_REGISTER_RAW_SIZE can be deleted. See: maint print
  408. # registers.
  409. F:2:DEPRECATED_REGISTER_RAW_SIZE:int:deprecated_register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
  410. # If all registers have identical raw and virtual sizes and those
  411. # sizes agree with the value computed from REGISTER_TYPE,
  412. # DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted. See: maint print
  413. # registers.
  414. F:2:DEPRECATED_REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
  415. # DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted. It has been
  416. # replaced by the constant MAX_REGISTER_SIZE.
  417. V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
  418. # DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE can be deleted. It has been
  419. # replaced by the constant MAX_REGISTER_SIZE.
  420. V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size
  421. # See gdbint.texinfo, and PUSH_DUMMY_CALL.
  422. M::UNWIND_DUMMY_ID:struct frame_id:unwind_dummy_id:struct frame_info *info:info
  423. # Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
  424. # SAVE_DUMMY_FRAME_TOS.
  425. F:2:DEPRECATED_SAVE_DUMMY_FRAME_TOS:void:deprecated_save_dummy_frame_tos:CORE_ADDR sp:sp
  426. # Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
  427. # DEPRECATED_FP_REGNUM.
  428. v:2:DEPRECATED_FP_REGNUM:int:deprecated_fp_regnum::::-1:-1::0
  429. # Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
  430. # DEPRECATED_TARGET_READ_FP.
  431. F::DEPRECATED_TARGET_READ_FP:CORE_ADDR:deprecated_target_read_fp:void
  432. # See gdbint.texinfo. See infcall.c. New, all singing all dancing,
  433. # replacement for DEPRECATED_PUSH_ARGUMENTS.
  434. M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr
  435. # PUSH_DUMMY_CALL is a direct replacement for DEPRECATED_PUSH_ARGUMENTS.
  436. F:2:DEPRECATED_PUSH_ARGUMENTS:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr
  437. # DEPRECATED_USE_GENERIC_DUMMY_FRAMES can be deleted. Always true.
  438. v::DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0
  439. # Implement PUSH_RETURN_ADDRESS, and then merge in
  440. # DEPRECATED_PUSH_RETURN_ADDRESS.
  441. F:2:DEPRECATED_PUSH_RETURN_ADDRESS:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp
  442. # Implement PUSH_DUMMY_CALL, then merge in DEPRECATED_DUMMY_WRITE_SP.
  443. F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val
  444. # DEPRECATED_REGISTER_SIZE can be deleted.
  445. v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
  446. v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
  447. # DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted.
  448. v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset
  449. # DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted.
  450. v::DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:deprecated_call_dummy_breakpoint_offset
  451. # DEPRECATED_CALL_DUMMY_LENGTH can be deleted.
  452. v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length
  453. # DEPRECATED_CALL_DUMMY_WORDS can be deleted.
  454. v::DEPRECATED_CALL_DUMMY_WORDS:LONGEST *:deprecated_call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
  455. # Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS.
  456. v::DEPRECATED_SIZEOF_CALL_DUMMY_WORDS:int:deprecated_sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
  457. # DEPRECATED_FIX_CALL_DUMMY can be deleted. For the SPARC, implement
  458. # PUSH_DUMMY_CODE and set CALL_DUMMY_LOCATION to ON_STACK.
  459. F::DEPRECATED_FIX_CALL_DUMMY:void:deprecated_fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
  460. # This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al.
  461. M::PUSH_DUMMY_CODE:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr
  462. # Implement PUSH_DUMMY_CALL, then delete DEPRECATED_PUSH_DUMMY_FRAME.
  463. F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-
  464. F:2:DEPRECATED_DO_REGISTERS_INFO:void:deprecated_do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs
  465. m:2:PRINT_REGISTERS_INFO:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0
  466. M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
  467. M:2:PRINT_VECTOR_INFO:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
  468. # MAP a GDB RAW register number onto a simulator register number. See
  469. # also include/...-sim.h.
  470. f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0
  471. F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes
  472. f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
  473. f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
  474. # setjmp/longjmp support.
  475. F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc
  476. # NOTE: cagney/2002-11-24: This function with predicate has a valid
  477. # (callable) initial value. As a consequence, even when the predicate
  478. # is false, the corresponding function works. This simplifies the
  479. # migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
  480. # doesn't need to be modified.
  481. F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::generic_pc_in_call_dummy:generic_pc_in_call_dummy
  482. F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
  483. F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
  484. #
  485. v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
  486. v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
  487. F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
  488. #
  489. # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
  490. # For raw <-> cooked register conversions, replaced by pseudo registers.
  491. F::DEPRECATED_REGISTER_CONVERTIBLE:int:deprecated_register_convertible:int nr:nr
  492. # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
  493. # For raw <-> cooked register conversions, replaced by pseudo registers.
  494. f:2:DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL:void:deprecated_register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
  495. # For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
  496. # For raw <-> cooked register conversions, replaced by pseudo registers.
  497. f:2:DEPRECATED_REGISTER_CONVERT_TO_RAW:void:deprecated_register_convert_to_raw:struct type *type, int regnum, const char *from, char *to:type, regnum, from, to:::0::0
  498. #
  499. f:1:CONVERT_REGISTER_P:int:convert_register_p:int regnum, struct type *type:regnum, type::0:legacy_convert_register_p::0
  500. f:1:REGISTER_TO_VALUE:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, void *buf:frame, regnum, type, buf::0:legacy_register_to_value::0
  501. f:1:VALUE_TO_REGISTER:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const void *buf:frame, regnum, type, buf::0:legacy_value_to_register::0
  502. #
  503. f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, const void *buf:type, buf:::unsigned_pointer_to_address::0
  504. f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0
  505. F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
  506. #
  507. F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-
  508. # NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS.
  509. F:2:DEPRECATED_STORE_STRUCT_RETURN:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp
  510. # It has been suggested that this, well actually its predecessor,
  511. # should take the type/value of the function to be called and not the
  512. # return type. This is left as an exercise for the reader.
  513. M:::enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf:valtype, regcache, readbuf, writebuf
  514. # The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
  515. # STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
  516. # into RETURN_VALUE.
  517. f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
  518. f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
  519. f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0
  520. f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf
  521. f:2:DEPRECATED_STORE_RETURN_VALUE:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf
  522. f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
  523. # As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
  524. # ABI suitable for the implementation of a robust extract
  525. # struct-convention return-value address method (the sparc saves the
  526. # address in the callers frame). All the other cases so far examined,
  527. # the DEPRECATED_EXTRACT_STRUCT_VALUE implementation has been
  528. # erreneous - the code was incorrectly assuming that the return-value
  529. # address, stored in a register, was preserved across the entire
  530. # function call.
  531. # For the moment retain DEPRECATED_EXTRACT_STRUCT_VALUE as a marker of
  532. # the ABIs that are still to be analyzed - perhaps this should simply
  533. # be deleted. The commented out extract_returned_value_address method
  534. # is provided as a starting point for the 32-bit SPARC. It, or
  535. # something like it, along with changes to both infcmd.c and stack.c
  536. # will be needed for that case to work. NB: It is passed the callers
  537. # frame since it is only after the callee has returned that this
  538. # function is used.
  539. #M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame
  540. F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache
  541. F:2:DEPRECATED_FRAME_INIT_SAVED_REGS:void:deprecated_frame_init_saved_regs:struct frame_info *frame:frame
  542. F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame
  543. #
  544. f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
  545. f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
  546. f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0:
  547. M:2:ADJUST_BREAKPOINT_ADDRESS:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
  548. f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
  549. f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
  550. v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:::0
  551. v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:::0
  552. #
  553. m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
  554. #
  555. v::FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:::0
  556. # DEPRECATED_FRAMELESS_FUNCTION_INVOCATION is not needed. The new
  557. # frame code works regardless of the type of frame - frameless,
  558. # stackless, or normal.
  559. F::DEPRECATED_FRAMELESS_FUNCTION_INVOCATION:int:deprecated_frameless_function_invocation:struct frame_info *fi:fi
  560. F:2:DEPRECATED_FRAME_CHAIN:CORE_ADDR:deprecated_frame_chain:struct frame_info *frame:frame
  561. F:2:DEPRECATED_FRAME_CHAIN_VALID:int:deprecated_frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe
  562. # DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC. Please
  563. # note, per UNWIND_PC's doco, that while the two have similar
  564. # interfaces they have very different underlying implementations.
  565. F:2:DEPRECATED_FRAME_SAVED_PC:CORE_ADDR:deprecated_frame_saved_pc:struct frame_info *fi:fi
  566. M::UNWIND_PC:CORE_ADDR:unwind_pc:struct frame_info *next_frame:next_frame
  567. M::UNWIND_SP:CORE_ADDR:unwind_sp:struct frame_info *next_frame:next_frame
  568. # DEPRECATED_FRAME_ARGS_ADDRESS as been replaced by the per-frame
  569. # frame-base. Enable frame-base before frame-unwind.
  570. F::DEPRECATED_FRAME_ARGS_ADDRESS:CORE_ADDR:deprecated_frame_args_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
  571. # DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
  572. # frame-base. Enable frame-base before frame-unwind.
  573. F::DEPRECATED_FRAME_LOCALS_ADDRESS:CORE_ADDR:deprecated_frame_locals_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
  574. F::DEPRECATED_SAVED_PC_AFTER_CALL:CORE_ADDR:deprecated_saved_pc_after_call:struct frame_info *frame:frame
  575. F:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame
  576. #
  577. # DEPRECATED_STACK_ALIGN has been replaced by an initial aligning call
  578. # to frame_align and the requirement that methods such as
  579. # push_dummy_call and frame_red_zone_size maintain correct stack/frame
  580. # alignment.
  581. F:2:DEPRECATED_STACK_ALIGN:CORE_ADDR:deprecated_stack_align:CORE_ADDR sp:sp
  582. M:::CORE_ADDR:frame_align:CORE_ADDR address:address
  583. # DEPRECATED_REG_STRUCT_HAS_ADDR has been replaced by
  584. # stabs_argument_has_addr.
  585. F:2:DEPRECATED_REG_STRUCT_HAS_ADDR:int:deprecated_reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type
  586. m:::int:stabs_argument_has_addr:struct type *type:type:::default_stabs_argument_has_addr::0
  587. v::FRAME_RED_ZONE_SIZE:int:frame_red_zone_size
  588. v:2:PARM_BOUNDARY:int:parm_boundary
  589. #
  590. v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (current_gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name
  591. v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_DOUBLE_FORMAT)->name
  592. v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_LONG_DOUBLE_FORMAT)->name
  593. m:::CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ:addr, targ:::convert_from_func_ptr_addr_identity::0
  594. # On some machines there are bits in addresses which are not really
  595. # part of the address, but are used by the kernel, the hardware, etc.
  596. # for special purposes. ADDR_BITS_REMOVE takes out any such bits so
  597. # we get a "real" address such as one would find in a symbol table.
  598. # This is used only for addresses of instructions, and even then I'm
  599. # not sure it's used in all contexts. It exists to deal with there
  600. # being a few stray bits in the PC which would mislead us, not as some
  601. # sort of generic thing to handle alignment or segmentation (it's
  602. # possible it should be in TARGET_READ_PC instead).
  603. f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_identity::0
  604. # It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
  605. # ADDR_BITS_REMOVE.
  606. f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_addr_identity::0
  607. # FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
  608. # the target needs software single step. An ISA method to implement it.
  609. #
  610. # FIXME/cagney/2001-01-18: This should be replaced with something that inserts breakpoints
  611. # using the breakpoint system instead of blatting memory directly (as with rs6000).
  612. #
  613. # FIXME/cagney/2001-01-18: The logic is backwards. It should be asking if the target can
  614. # single step. If not, then implement single step using breakpoints.
  615. F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p
  616. # FIXME: cagney/2003-08-28: Need to find a better way of selecting the
  617. # disassembler. Perhaphs objdump can handle it?
  618. f::TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:vma, info:::0:
  619. f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
  620. # If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
  621. # evaluates non-zero, this is the address where the debugger will place
  622. # a step-resume breakpoint to get us past the dynamic linker.
  623. m:2:SKIP_SOLIB_RESOLVER:CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc:::generic_skip_solib_resolver::0
  624. # For SVR4 shared libraries, each call goes through a small piece of
  625. # trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
  626. # to nonzero if we are currently stopped in one of these.
  627. f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
  628. # Some systems also have trampoline code for returning from shared libs.
  629. f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_return_trampoline::0
  630. # Sigtramp is a routine that the kernel calls (which then calls the
  631. # signal handler). On most machines it is a library routine that is
  632. # linked into the executable.
  633. #
  634. # This macro, given a program counter value and the name of the
  635. # function in which that PC resides (which can be null if the name is
  636. # not known), returns nonzero if the PC and name show that we are in
  637. # sigtramp.
  638. #
  639. # On most machines just see if the name is sigtramp (and if we have
  640. # no name, assume we are not in sigtramp).
  641. #
  642. # FIXME: cagney/2002-04-21: The function find_pc_partial_function
  643. # calls find_pc_sect_partial_function() which calls PC_IN_SIGTRAMP.
  644. # This means PC_IN_SIGTRAMP function can't be implemented by doing its
  645. # own local NAME lookup.
  646. #
  647. # FIXME: cagney/2002-04-21: PC_IN_SIGTRAMP is something of a mess.
  648. # Some code also depends on SIGTRAMP_START and SIGTRAMP_END but other
  649. # does not.
  650. f:2:PC_IN_SIGTRAMP:int:pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp::0
  651. F:2:SIGTRAMP_START:CORE_ADDR:sigtramp_start:CORE_ADDR pc:pc
  652. F:2:SIGTRAMP_END:CORE_ADDR:sigtramp_end:CORE_ADDR pc:pc
  653. # A target might have problems with watchpoints as soon as the stack
  654. # frame of the current function has been destroyed. This mostly happens
  655. # as the first action in a funtion's epilogue. in_function_epilogue_p()
  656. # is defined to return a non-zero value if either the given addr is one
  657. # instruction after the stack destroying instruction up to the trailing
  658. # return instruction or if we can figure out that the stack frame has
  659. # already been invalidated regardless of the value of addr. Targets
  660. # which don't suffer from that problem could just let this functionality
  661. # untouched.
  662. m:::int:in_function_epilogue_p:CORE_ADDR addr:addr::0:generic_in_function_epilogue_p::0
  663. # Given a vector of command-line arguments, return a newly allocated
  664. # string which, when passed to the create_inferior function, will be
  665. # parsed (on Unix systems, by the shell) to yield the same vector.
  666. # This function should call error() if the argument vector is not
  667. # representable for this target or if this target does not support
  668. # command-line arguments.
  669. # ARGC is the number of elements in the vector.
  670. # ARGV is an array of strings, one per argument.
  671. m::CONSTRUCT_INFERIOR_ARGUMENTS:char *:construct_inferior_arguments:int argc, char **argv:argc, argv:::construct_inferior_arguments::0
  672. f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
  673. f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
  674. v:2:NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF_MALLOC
  675. v:2:CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
  676. v:2:HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
  677. F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
  678. M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_name:int type_flags:type_flags
  679. M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr
  680. # Is a register in a group
  681. m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0
  682. # Fetch the pointer to the ith function argument.
  683. F::FETCH_POINTER_ARGUMENT:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct type *type:frame, argi, type
  684. # Return the appropriate register set for a core file section with
  685. # name SECT_NAME and size SECT_SIZE.
  686. M:::const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size
  687. EOF
  688. }
  689. #
  690. # The .log file
  691. #
  692. exec > new-gdbarch.log
  693. function_list | while do_read
  694. do
  695. cat <<EOF
  696. ${class} ${macro}(${actual})
  697. ${returntype} ${function} ($formal)${attrib}
  698. EOF
  699. for r in ${read}
  700. do
  701. eval echo \"\ \ \ \ ${r}=\${${r}}\"
  702. done
  703. if class_is_predicate_p && fallback_default_p
  704. then
  705. echo "Error: predicate function ${macro} can not have a non- multi-arch default" 1>&2
  706. kill $$
  707. exit 1
  708. fi
  709. if [ "x${invalid_p}" = "x0" -a -n "${postdefault}" ]
  710. then
  711. echo "Error: postdefault is useless when invalid_p=0" 1>&2
  712. kill $$
  713. exit 1
  714. fi
  715. if class_is_multiarch_p
  716. then
  717. if class_is_predicate_p ; then :
  718. elif test "x${predefault}" = "x"
  719. then
  720. echo "Error: pure multi-arch function must have a predefault" 1>&2
  721. kill $$
  722. exit 1
  723. fi
  724. fi
  725. echo ""
  726. done
  727. exec 1>&2
  728. compare_new gdbarch.log
  729. copyright ()
  730. {
  731. cat <<EOF
  732. /* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
  733. /* Dynamic architecture support for GDB, the GNU debugger.
  734. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
  735. Software Foundation, Inc.
  736. This file is part of GDB.
  737. This program is free software; you can redistribute it and/or modify
  738. it under the terms of the GNU General Public License as published by
  739. the Free Software Foundation; either version 2 of the License, or
  740. (at your option) any later version.
  741. This program is distributed in the hope that it will be useful,
  742. but WITHOUT ANY WARRANTY; without even the implied warranty of
  743. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  744. GNU General Public License for more details.
  745. You should have received a copy of the GNU General Public License
  746. along with this program; if not, write to the Free Software
  747. Foundation, Inc., 59 Temple Place - Suite 330,
  748. Boston, MA 02111-1307, USA. */
  749. /* This file was created with the aid of \`\`gdbarch.sh''.
  750. The Bourne shell script \`\`gdbarch.sh'' creates the files
  751. \`\`new-gdbarch.c'' and \`\`new-gdbarch.h and then compares them
  752. against the existing \`\`gdbarch.[hc]''. Any differences found
  753. being reported.
  754. If editing this file, please also run gdbarch.sh and merge any
  755. changes into that script. Conversely, when making sweeping changes
  756. to this file, modifying gdbarch.sh and using its output may prove
  757. easier. */
  758. EOF
  759. }
  760. #
  761. # The .h file
  762. #
  763. exec > new-gdbarch.h
  764. copyright
  765. cat <<EOF
  766. #ifndef GDBARCH_H
  767. #define GDBARCH_H
  768. struct floatformat;
  769. struct ui_file;
  770. struct frame_info;
  771. struct value;
  772. struct objfile;
  773. struct minimal_symbol;
  774. struct regcache;
  775. struct reggroup;
  776. struct regset;
  777. struct disassemble_info;
  778. struct target_ops;
  779. extern struct gdbarch *current_gdbarch;
  780. /* If any of the following are defined, the target wasn't correctly
  781. converted. */
  782. #if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PURE) && defined (GDB_TM_FILE)
  783. #error "GDB_TM_FILE: Pure multi-arch targets do not have a tm.h file."
  784. #endif
  785. EOF
  786. # function typedef's
  787. printf "\n"
  788. printf "\n"
  789. printf "/* The following are pre-initialized by GDBARCH. */\n"
  790. function_list | while do_read
  791. do
  792. if class_is_info_p
  793. then
  794. printf "\n"
  795. printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
  796. printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n"
  797. printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
  798. printf "#error \"Non multi-arch definition of ${macro}\"\n"
  799. printf "#endif\n"
  800. printf "#if !defined (${macro})\n"
  801. printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
  802. printf "#endif\n"
  803. fi
  804. done
  805. # function typedef's
  806. printf "\n"
  807. printf "\n"
  808. printf "/* The following are initialized by the target dependent code. */\n"
  809. function_list | while do_read
  810. do
  811. if [ -n "${comment}" ]
  812. then
  813. echo "${comment}" | sed \
  814. -e '2 s,#,/*,' \
  815. -e '3,$ s,#, ,' \
  816. -e '$ s,$, */,'
  817. fi
  818. if class_is_multiarch_p
  819. then
  820. if class_is_predicate_p
  821. then
  822. printf "\n"
  823. printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
  824. fi
  825. else
  826. if class_is_predicate_p
  827. then
  828. printf "\n"
  829. printf "#if defined (${macro})\n"
  830. printf "/* Legacy for systems yet to multi-arch ${macro} */\n"
  831. #printf "#if (GDB_MULTI_ARCH <= GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
  832. printf "#if !defined (${macro}_P)\n"
  833. printf "#define ${macro}_P() (1)\n"
  834. printf "#endif\n"
  835. printf "#endif\n"
  836. printf "\n"
  837. printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
  838. printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro}_P)\n"
  839. printf "#error \"Non multi-arch definition of ${macro}\"\n"
  840. printf "#endif\n"
  841. printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro}_P)\n"
  842. printf "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))\n"
  843. printf "#endif\n"
  844. fi
  845. fi
  846. if class_is_variable_p
  847. then
  848. printf "\n"
  849. printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
  850. printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});\n"
  851. printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
  852. printf "#error \"Non multi-arch definition of ${macro}\"\n"
  853. printf "#endif\n"
  854. printf "#if !defined (${macro})\n"
  855. printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
  856. printf "#endif\n"
  857. fi
  858. if class_is_function_p
  859. then
  860. printf "\n"
  861. if [ "x${formal}" = "xvoid" ] && class_is_multiarch_p
  862. then
  863. printf "typedef ${returntype} (gdbarch_${function}_ftype) (struct gdbarch *gdbarch);\n"
  864. elif class_is_multiarch_p
  865. then
  866. printf "typedef ${returntype} (gdbarch_${function}_ftype) (struct gdbarch *gdbarch, ${formal});\n"
  867. else
  868. printf "typedef ${returntype} (gdbarch_${function}_ftype) (${formal});\n"
  869. fi
  870. if [ "x${formal}" = "xvoid" ]
  871. then
  872. printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
  873. else
  874. printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch, ${formal});\n"
  875. fi
  876. printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});\n"
  877. if class_is_multiarch_p ; then :
  878. else
  879. printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
  880. printf "#error \"Non multi-arch definition of ${macro}\"\n"
  881. printf "#endif\n"
  882. if [ "x${actual}" = "x" ]
  883. then
  884. d="#define ${macro}() (gdbarch_${function} (current_gdbarch))"
  885. elif [ "x${actual}" = "x-" ]
  886. then
  887. d="#define ${macro} (gdbarch_${function} (current_gdbarch))"
  888. else
  889. d="#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))"
  890. fi
  891. printf "#if !defined (${macro})\n"
  892. if [ "x${actual}" = "x" ]
  893. then
  894. printf "#define ${macro}() (gdbarch_${function} (current_gdbarch))\n"
  895. elif [ "x${actual}" = "x-" ]
  896. then
  897. printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
  898. else
  899. printf "#define ${macro}(${actual}) (gdbarch_${function} (current_gdbarch, ${actual}))\n"
  900. fi
  901. printf "#endif\n"
  902. fi
  903. fi
  904. done
  905. # close it off
  906. cat <<EOF
  907. extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
  908. /* Mechanism for co-ordinating the selection of a specific
  909. architecture.
  910. GDB targets (*-tdep.c) can register an interest in a specific
  911. architecture. Other GDB components can register a need to maintain
  912. per-architecture data.
  913. The mechanisms below ensures that there is only a loose connection
  914. between the set-architecture command and the various GDB
  915. components. Each component can independently register their need
  916. to maintain architecture specific data with gdbarch.
  917. Pragmatics:
  918. Previously, a single TARGET_ARCHITECTURE_HOOK was provided. It
  919. didn't scale.
  920. The more traditional mega-struct containing architecture specific
  921. data for all the various GDB components was also considered. Since
  922. GDB is built from a variable number of (fairly independent)
  923. components it was determined that the global aproach was not
  924. applicable. */
  925. /* Register a new architectural family with GDB.
  926. Register support for the specified ARCHITECTURE with GDB. When
  927. gdbarch determines that the specified architecture has been
  928. selected, the corresponding INIT function is called.
  929. --
  930. The INIT function takes two parameters: INFO which contains the
  931. information available to gdbarch about the (possibly new)
  932. architecture; ARCHES which is a list of the previously created
  933. \`\`struct gdbarch'' for this architecture.
  934. The INFO parameter is, as far as possible, be pre-initialized with
  935. information obtained from INFO.ABFD or the previously selected
  936. architecture.
  937. The ARCHES parameter is a linked list (sorted most recently used)
  938. of all the previously created architures for this architecture
  939. family. The (possibly NULL) ARCHES->gdbarch can used to access
  940. values from the previously selected architecture for this
  941. architecture family. The global \`\`current_gdbarch'' shall not be
  942. used.
  943. The INIT function shall return any of: NULL - indicating that it
  944. doesn't recognize the selected architecture; an existing \`\`struct
  945. gdbarch'' from the ARCHES list - indicating that the new
  946. architecture is just a synonym for an earlier architecture (see
  947. gdbarch_list_lookup_by_info()); a newly created \`\`struct gdbarch''
  948. - that describes the selected architecture (see gdbarch_alloc()).
  949. The DUMP_TDEP function shall print out all target specific values.
  950. Care should be taken to ensure that the function works in both the
  951. multi-arch and non- multi-arch cases. */
  952. struct gdbarch_list
  953. {
  954. struct gdbarch *gdbarch;
  955. struct gdbarch_list *next;
  956. };
  957. struct gdbarch_info
  958. {
  959. /* Use default: NULL (ZERO). */
  960. const struct bfd_arch_info *bfd_arch_info;
  961. /* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
  962. int byte_order;
  963. /* Use default: NULL (ZERO). */
  964. bfd *abfd;
  965. /* Use default: NULL (ZERO). */
  966. struct gdbarch_tdep_info *tdep_info;
  967. /* Use default: GDB_OSABI_UNINITIALIZED (-1). */
  968. enum gdb_osabi osabi;
  969. };
  970. typedef struct gdbarch *(gdbarch_init_ftype) (struct gdbarch_info info, struct gdbarch_list *arches);
  971. typedef void (gdbarch_dump_tdep_ftype) (struct gdbarch *gdbarch, struct ui_file *file);
  972. /* DEPRECATED - use gdbarch_register() */
  973. extern void register_gdbarch_init (enum bfd_architecture architecture, gdbarch_init_ftype *);
  974. extern void gdbarch_register (enum bfd_architecture architecture,
  975. gdbarch_init_ftype *,
  976. gdbarch_dump_tdep_ftype *);
  977. /* Return a freshly allocated, NULL terminated, array of the valid
  978. architecture names. Since architectures are registered during the
  979. _initialize phase this function only returns useful information
  980. once initialization has been completed. */
  981. extern const char **gdbarch_printable_names (void);
  982. /* Helper function. Search the list of ARCHES for a GDBARCH that
  983. matches the information provided by INFO. */
  984. extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
  985. /* Helper function. Create a preliminary \`\`struct gdbarch''. Perform
  986. basic initialization using values obtained from the INFO andTDEP
  987. parameters. set_gdbarch_*() functions are called to complete the
  988. initialization of the object. */
  989. extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
  990. /* Helper function. Free a partially-constructed \`\`struct gdbarch''.
  991. It is assumed that the caller freeds the \`\`struct
  992. gdbarch_tdep''. */
  993. extern void gdbarch_free (struct gdbarch *);
  994. /* Helper function. Allocate memory from the \`\`struct gdbarch''
  995. obstack. The memory is freed when the corresponding architecture
  996. is also freed. */
  997. extern void *gdbarch_obstack_zalloc (struct gdbarch *gdbarch, long size);
  998. #define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), (NR) * sizeof (TYPE)))
  999. #define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), sizeof (TYPE)))
  1000. /* Helper function. Force an update of the current architecture.
  1001. The actual architecture selected is determined by INFO, \`\`(gdb) set
  1002. architecture'' et.al., the existing architecture and BFD's default
  1003. architecture. INFO should be initialized to zero and then selected
  1004. fields should be updated.
  1005. Returns non-zero if the update succeeds */
  1006. extern