ft32-tdep.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. /* Target-dependent code for FT32.
  2. Copyright (C) 2009-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #include "defs.h"
  15. #include "frame.h"
  16. #include "frame-unwind.h"
  17. #include "frame-base.h"
  18. #include "symtab.h"
  19. #include "gdbtypes.h"
  20. #include "gdbcmd.h"
  21. #include "gdbcore.h"
  22. #include "value.h"
  23. #include "inferior.h"
  24. #include "symfile.h"
  25. #include "objfiles.h"
  26. #include "osabi.h"
  27. #include "language.h"
  28. #include "arch-utils.h"
  29. #include "regcache.h"
  30. #include "trad-frame.h"
  31. #include "dis-asm.h"
  32. #include "record.h"
  33. #include "opcode/ft32.h"
  34. #include "ft32-tdep.h"
  35. #include "gdb/sim-ft32.h"
  36. #include <algorithm>
  37. #define RAM_BIAS 0x800000 /* Bias added to RAM addresses. */
  38. /* Use an invalid address -1 as 'not available' marker. */
  39. enum { REG_UNAVAIL = (CORE_ADDR) (-1) };
  40. struct ft32_frame_cache
  41. {
  42. /* Base address of the frame */
  43. CORE_ADDR base;
  44. /* Function this frame belongs to */
  45. CORE_ADDR pc;
  46. /* Total size of this frame */
  47. LONGEST framesize;
  48. /* Saved registers in this frame */
  49. CORE_ADDR saved_regs[FT32_NUM_REGS];
  50. /* Saved SP in this frame */
  51. CORE_ADDR saved_sp;
  52. /* Has the new frame been LINKed. */
  53. bfd_boolean established;
  54. };
  55. /* Implement the "frame_align" gdbarch method. */
  56. static CORE_ADDR
  57. ft32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
  58. {
  59. /* Align to the size of an instruction (so that they can safely be
  60. pushed onto the stack. */
  61. return sp & ~1;
  62. }
  63. constexpr gdb_byte ft32_break_insn[] = { 0x02, 0x00, 0x34, 0x00 };
  64. typedef BP_MANIPULATION (ft32_break_insn) ft32_breakpoint;
  65. /* FT32 register names. */
  66. static const char *const ft32_register_names[] =
  67. {
  68. "fp", "sp",
  69. "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
  70. "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
  71. "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
  72. "r24", "r25", "r26", "r27", "r28", "cc",
  73. "pc"
  74. };
  75. /* Implement the "register_name" gdbarch method. */
  76. static const char *
  77. ft32_register_name (struct gdbarch *gdbarch, int reg_nr)
  78. {
  79. if (reg_nr < 0)
  80. return NULL;
  81. if (reg_nr >= FT32_NUM_REGS)
  82. return NULL;
  83. return ft32_register_names[reg_nr];
  84. }
  85. /* Implement the "register_type" gdbarch method. */
  86. static struct type *
  87. ft32_register_type (struct gdbarch *gdbarch, int reg_nr)
  88. {
  89. if (reg_nr == FT32_PC_REGNUM)
  90. {
  91. ft32_gdbarch_tdep *tdep = (ft32_gdbarch_tdep *) gdbarch_tdep (gdbarch);
  92. return tdep->pc_type;
  93. }
  94. else if (reg_nr == FT32_SP_REGNUM || reg_nr == FT32_FP_REGNUM)
  95. return builtin_type (gdbarch)->builtin_data_ptr;
  96. else
  97. return builtin_type (gdbarch)->builtin_int32;
  98. }
  99. /* Write into appropriate registers a function return value
  100. of type TYPE, given in virtual format. */
  101. static void
  102. ft32_store_return_value (struct type *type, struct regcache *regcache,
  103. const gdb_byte *valbuf)
  104. {
  105. struct gdbarch *gdbarch = regcache->arch ();
  106. enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  107. CORE_ADDR regval;
  108. int len = TYPE_LENGTH (type);
  109. /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */
  110. regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order);
  111. regcache_cooked_write_unsigned (regcache, FT32_R0_REGNUM, regval);
  112. if (len > 4)
  113. {
  114. regval = extract_unsigned_integer (valbuf + 4,
  115. len - 4, byte_order);
  116. regcache_cooked_write_unsigned (regcache, FT32_R1_REGNUM, regval);
  117. }
  118. }
  119. /* Fetch a single 32-bit instruction from address a. If memory contains
  120. a compressed instruction pair, return the expanded instruction. */
  121. static ULONGEST
  122. ft32_fetch_instruction (CORE_ADDR a, int *isize,
  123. enum bfd_endian byte_order)
  124. {
  125. unsigned int sc[2];
  126. ULONGEST inst;
  127. CORE_ADDR a4 = a & ~3;
  128. inst = read_code_unsigned_integer (a4, 4, byte_order);
  129. *isize = ft32_decode_shortcode (a4, inst, sc) ? 2 : 4;
  130. if (*isize == 2)
  131. return sc[1 & (a >> 1)];
  132. else
  133. return inst;
  134. }
  135. /* Decode the instructions within the given address range. Decide
  136. when we must have reached the end of the function prologue. If a
  137. frame_info pointer is provided, fill in its saved_regs etc.
  138. Returns the address of the first instruction after the prologue. */
  139. static CORE_ADDR
  140. ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
  141. struct ft32_frame_cache *cache,
  142. struct gdbarch *gdbarch)
  143. {
  144. enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  145. CORE_ADDR next_addr;
  146. ULONGEST inst;
  147. int isize = 0;
  148. int regnum, pushreg;
  149. struct bound_minimal_symbol msymbol;
  150. const int first_saved_reg = 13; /* The first saved register. */
  151. /* PROLOGS are addresses of the subroutine prologs, PROLOGS[n]
  152. is the address of __prolog_$rN.
  153. __prolog_$rN pushes registers from 13 through n inclusive.
  154. So for example CALL __prolog_$r15 is equivalent to:
  155. PUSH $r13
  156. PUSH $r14
  157. PUSH $r15
  158. Note that PROLOGS[0] through PROLOGS[12] are unused. */
  159. CORE_ADDR prologs[32];
  160. cache->saved_regs[FT32_PC_REGNUM] = 0;
  161. cache->framesize = 0;
  162. for (regnum = first_saved_reg; regnum < 32; regnum++)
  163. {
  164. char prolog_symbol[32];
  165. snprintf (prolog_symbol, sizeof (prolog_symbol), "__prolog_$r%02d",
  166. regnum);
  167. msymbol = lookup_minimal_symbol (prolog_symbol, NULL, NULL);
  168. if (msymbol.minsym)
  169. prologs[regnum] = BMSYMBOL_VALUE_ADDRESS (msymbol);
  170. else
  171. prologs[regnum] = 0;
  172. }
  173. if (start_addr >= end_addr)
  174. return end_addr;
  175. cache->established = 0;
  176. for (next_addr = start_addr; next_addr < end_addr; next_addr += isize)
  177. {
  178. inst = ft32_fetch_instruction (next_addr, &isize, byte_order);
  179. if (FT32_IS_PUSH (inst))
  180. {
  181. pushreg = FT32_PUSH_REG (inst);
  182. cache->framesize += 4;
  183. cache->saved_regs[FT32_R0_REGNUM + pushreg] = cache->framesize;
  184. }
  185. else if (FT32_IS_CALL (inst))
  186. {
  187. for (regnum = first_saved_reg; regnum < 32; regnum++)
  188. {
  189. if ((4 * (inst & 0x3ffff)) == prologs[regnum])
  190. {
  191. for (pushreg = first_saved_reg; pushreg <= regnum;
  192. pushreg++)
  193. {
  194. cache->framesize += 4;
  195. cache->saved_regs[FT32_R0_REGNUM + pushreg] =
  196. cache->framesize;
  197. }
  198. }
  199. }
  200. break;
  201. }
  202. else
  203. break;
  204. }
  205. for (regnum = FT32_R0_REGNUM; regnum < FT32_PC_REGNUM; regnum++)
  206. {
  207. if (cache->saved_regs[regnum] != REG_UNAVAIL)
  208. cache->saved_regs[regnum] =
  209. cache->framesize - cache->saved_regs[regnum];
  210. }
  211. cache->saved_regs[FT32_PC_REGNUM] = cache->framesize;
  212. /* It is a LINK? */
  213. if (next_addr < end_addr)
  214. {
  215. inst = ft32_fetch_instruction (next_addr, &isize, byte_order);
  216. if (FT32_IS_LINK (inst))
  217. {
  218. cache->established = 1;
  219. for (regnum = FT32_R0_REGNUM; regnum < FT32_PC_REGNUM; regnum++)
  220. {
  221. if (cache->saved_regs[regnum] != REG_UNAVAIL)
  222. cache->saved_regs[regnum] += 4;
  223. }
  224. cache->saved_regs[FT32_PC_REGNUM] = cache->framesize + 4;
  225. cache->saved_regs[FT32_FP_REGNUM] = 0;
  226. cache->framesize += FT32_LINK_SIZE (inst);
  227. next_addr += isize;
  228. }
  229. }
  230. return next_addr;
  231. }
  232. /* Find the end of function prologue. */
  233. static CORE_ADDR
  234. ft32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
  235. {
  236. CORE_ADDR func_addr = 0, func_end = 0;
  237. const char *func_name;
  238. /* See if we can determine the end of the prologue via the symbol table.
  239. If so, then return either PC, or the PC after the prologue, whichever
  240. is greater. */
  241. if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end))
  242. {
  243. CORE_ADDR post_prologue_pc
  244. = skip_prologue_using_sal (gdbarch, func_addr);
  245. if (post_prologue_pc != 0)
  246. return std::max (pc, post_prologue_pc);
  247. else
  248. {
  249. /* Can't determine prologue from the symbol table, need to examine
  250. instructions. */
  251. struct symtab_and_line sal;
  252. struct symbol *sym;
  253. struct ft32_frame_cache cache;
  254. CORE_ADDR plg_end;
  255. memset (&cache, 0, sizeof cache);
  256. plg_end = ft32_analyze_prologue (func_addr,
  257. func_end, &cache, gdbarch);
  258. /* Found a function. */
  259. sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL).symbol;
  260. /* Don't use line number debug info for assembly source files. */
  261. if ((sym != NULL) && sym->language () != language_asm)
  262. {
  263. sal = find_pc_line (func_addr, 0);
  264. if (sal.end && sal.end < func_end)
  265. {
  266. /* Found a line number, use it as end of prologue. */
  267. return sal.end;
  268. }
  269. }
  270. /* No useable line symbol. Use result of prologue parsing method. */
  271. return plg_end;
  272. }
  273. }
  274. /* No function symbol -- just return the PC. */
  275. return pc;
  276. }
  277. /* Implementation of `pointer_to_address' gdbarch method.
  278. On FT32 address space zero is RAM, address space 1 is flash.
  279. RAM appears at address RAM_BIAS, flash at address 0. */
  280. static CORE_ADDR
  281. ft32_pointer_to_address (struct gdbarch *gdbarch,
  282. struct type *type, const gdb_byte *buf)
  283. {
  284. enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  285. CORE_ADDR addr
  286. = extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
  287. if (TYPE_ADDRESS_CLASS_1 (type))
  288. return addr;
  289. else
  290. return addr | RAM_BIAS;
  291. }
  292. /* Implementation of `address_class_type_flags' gdbarch method.
  293. This method maps DW_AT_address_class attributes to a
  294. type_instance_flag_value. */
  295. static type_instance_flags
  296. ft32_address_class_type_flags (int byte_size, int dwarf2_addr_class)
  297. {
  298. /* The value 1 of the DW_AT_address_class attribute corresponds to the
  299. __flash__ qualifier, meaning pointer to data in FT32 program memory.
  300. */
  301. if (dwarf2_addr_class == 1)
  302. return TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
  303. return 0;
  304. }
  305. /* Implementation of `address_class_type_flags_to_name' gdbarch method.
  306. Convert a type_instance_flag_value to an address space qualifier. */
  307. static const char*
  308. ft32_address_class_type_flags_to_name (struct gdbarch *gdbarch,
  309. type_instance_flags type_flags)
  310. {
  311. if (type_flags & TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1)
  312. return "flash";
  313. else
  314. return NULL;
  315. }
  316. /* Implementation of `address_class_name_to_type_flags' gdbarch method.
  317. Convert an address space qualifier to a type_instance_flag_value. */
  318. static bool
  319. ft32_address_class_name_to_type_flags (struct gdbarch *gdbarch,
  320. const char* name,
  321. type_instance_flags *type_flags_ptr)
  322. {
  323. if (strcmp (name, "flash") == 0)
  324. {
  325. *type_flags_ptr = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
  326. return true;
  327. }
  328. else
  329. return false;
  330. }
  331. /* Given a return value in `regbuf' with a type `valtype',
  332. extract and copy its value into `valbuf'. */
  333. static void
  334. ft32_extract_return_value (struct type *type, struct regcache *regcache,
  335. gdb_byte *dst)
  336. {
  337. struct gdbarch *gdbarch = regcache->arch ();
  338. enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  339. bfd_byte *valbuf = dst;
  340. int len = TYPE_LENGTH (type);
  341. ULONGEST tmp;
  342. /* By using store_unsigned_integer we avoid having to do
  343. anything special for small big-endian values. */
  344. regcache_cooked_read_unsigned (regcache, FT32_R0_REGNUM, &tmp);
  345. store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp);
  346. /* Ignore return values more than 8 bytes in size because the ft32
  347. returns anything more than 8 bytes in the stack. */
  348. if (len > 4)
  349. {
  350. regcache_cooked_read_unsigned (regcache, FT32_R1_REGNUM, &tmp);
  351. store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp);
  352. }
  353. }
  354. /* Implement the "return_value" gdbarch method. */
  355. static enum return_value_convention
  356. ft32_return_value (struct gdbarch *gdbarch, struct value *function,
  357. struct type *valtype, struct regcache *regcache,
  358. gdb_byte *readbuf, const gdb_byte *writebuf)
  359. {
  360. if (TYPE_LENGTH (valtype) > 8)
  361. return RETURN_VALUE_STRUCT_CONVENTION;
  362. else
  363. {
  364. if (readbuf != NULL)
  365. ft32_extract_return_value (valtype, regcache, readbuf);
  366. if (writebuf != NULL)
  367. ft32_store_return_value (valtype, regcache, writebuf);
  368. return RETURN_VALUE_REGISTER_CONVENTION;
  369. }
  370. }
  371. /* Allocate and initialize a ft32_frame_cache object. */
  372. static struct ft32_frame_cache *
  373. ft32_alloc_frame_cache (void)
  374. {
  375. struct ft32_frame_cache *cache;
  376. int i;
  377. cache = FRAME_OBSTACK_ZALLOC (struct ft32_frame_cache);
  378. for (i = 0; i < FT32_NUM_REGS; ++i)
  379. cache->saved_regs[i] = REG_UNAVAIL;
  380. return cache;
  381. }
  382. /* Populate a ft32_frame_cache object for this_frame. */
  383. static struct ft32_frame_cache *
  384. ft32_frame_cache (struct frame_info *this_frame, void **this_cache)
  385. {
  386. struct ft32_frame_cache *cache;
  387. CORE_ADDR current_pc;
  388. int i;
  389. if (*this_cache)
  390. return (struct ft32_frame_cache *) *this_cache;
  391. cache = ft32_alloc_frame_cache ();
  392. *this_cache = cache;
  393. cache->base = get_frame_register_unsigned (this_frame, FT32_FP_REGNUM);
  394. if (cache->base == 0)
  395. return cache;
  396. cache->pc = get_frame_func (this_frame);
  397. current_pc = get_frame_pc (this_frame);
  398. if (cache->pc)
  399. {
  400. struct gdbarch *gdbarch = get_frame_arch (this_frame);
  401. ft32_analyze_prologue (cache->pc, current_pc, cache, gdbarch);
  402. if (!cache->established)
  403. cache->base = get_frame_register_unsigned (this_frame, FT32_SP_REGNUM);
  404. }
  405. cache->saved_sp = cache->base - 4;
  406. for (i = 0; i < FT32_NUM_REGS; ++i)
  407. if (cache->saved_regs[i] != REG_UNAVAIL)
  408. cache->saved_regs[i] = cache->base + cache->saved_regs[i];
  409. return cache;
  410. }
  411. /* Given a GDB frame, determine the address of the calling function's
  412. frame. This will be used to create a new GDB frame struct. */
  413. static void
  414. ft32_frame_this_id (struct frame_info *this_frame,
  415. void **this_prologue_cache, struct frame_id *this_id)
  416. {
  417. struct ft32_frame_cache *cache = ft32_frame_cache (this_frame,
  418. this_prologue_cache);
  419. /* This marks the outermost frame. */
  420. if (cache->base == 0)
  421. return;
  422. *this_id = frame_id_build (cache->saved_sp, cache->pc);
  423. }
  424. /* Get the value of register regnum in the previous stack frame. */
  425. static struct value *
  426. ft32_frame_prev_register (struct frame_info *this_frame,
  427. void **this_prologue_cache, int regnum)
  428. {
  429. struct ft32_frame_cache *cache = ft32_frame_cache (this_frame,
  430. this_prologue_cache);
  431. gdb_assert (regnum >= 0);
  432. if (regnum == FT32_SP_REGNUM && cache->saved_sp)
  433. return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
  434. if (regnum < FT32_NUM_REGS && cache->saved_regs[regnum] != REG_UNAVAIL)
  435. return frame_unwind_got_memory (this_frame, regnum,
  436. RAM_BIAS | cache->saved_regs[regnum]);
  437. return frame_unwind_got_register (this_frame, regnum, regnum);
  438. }
  439. static const struct frame_unwind ft32_frame_unwind =
  440. {
  441. "ft32 prologue",
  442. NORMAL_FRAME,
  443. default_frame_unwind_stop_reason,
  444. ft32_frame_this_id,
  445. ft32_frame_prev_register,
  446. NULL,
  447. default_frame_sniffer
  448. };
  449. /* Return the base address of this_frame. */
  450. static CORE_ADDR
  451. ft32_frame_base_address (struct frame_info *this_frame, void **this_cache)
  452. {
  453. struct ft32_frame_cache *cache = ft32_frame_cache (this_frame,
  454. this_cache);
  455. return cache->base;
  456. }
  457. static const struct frame_base ft32_frame_base =
  458. {
  459. &ft32_frame_unwind,
  460. ft32_frame_base_address,
  461. ft32_frame_base_address,
  462. ft32_frame_base_address
  463. };
  464. /* Allocate and initialize the ft32 gdbarch object. */
  465. static struct gdbarch *
  466. ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
  467. {
  468. struct gdbarch *gdbarch;
  469. struct type *void_type;
  470. struct type *func_void_type;
  471. /* If there is already a candidate, use it. */
  472. arches = gdbarch_list_lookup_by_info (arches, &info);
  473. if (arches != NULL)
  474. return arches->gdbarch;
  475. /* Allocate space for the new architecture. */
  476. ft32_gdbarch_tdep *tdep = new ft32_gdbarch_tdep;
  477. gdbarch = gdbarch_alloc (&info, tdep);
  478. /* Create a type for PC. We can't use builtin types here, as they may not
  479. be defined. */
  480. void_type = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
  481. func_void_type = make_function_type (void_type, NULL);
  482. tdep->pc_type = arch_pointer_type (gdbarch, 4 * TARGET_CHAR_BIT, NULL,
  483. func_void_type);
  484. tdep->pc_type->set_instance_flags (tdep->pc_type->instance_flags ()
  485. | TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1);
  486. set_gdbarch_num_regs (gdbarch, FT32_NUM_REGS);
  487. set_gdbarch_sp_regnum (gdbarch, FT32_SP_REGNUM);
  488. set_gdbarch_pc_regnum (gdbarch, FT32_PC_REGNUM);
  489. set_gdbarch_register_name (gdbarch, ft32_register_name);
  490. set_gdbarch_register_type (gdbarch, ft32_register_type);
  491. set_gdbarch_return_value (gdbarch, ft32_return_value);
  492. set_gdbarch_pointer_to_address (gdbarch, ft32_pointer_to_address);
  493. set_gdbarch_skip_prologue (gdbarch, ft32_skip_prologue);
  494. set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
  495. set_gdbarch_breakpoint_kind_from_pc (gdbarch, ft32_breakpoint::kind_from_pc);
  496. set_gdbarch_sw_breakpoint_from_kind (gdbarch, ft32_breakpoint::bp_from_kind);
  497. set_gdbarch_frame_align (gdbarch, ft32_frame_align);
  498. frame_base_set_default (gdbarch, &ft32_frame_base);
  499. /* Hook in ABI-specific overrides, if they have been registered. */
  500. gdbarch_init_osabi (info, gdbarch);
  501. /* Hook in the default unwinders. */
  502. frame_unwind_append_unwinder (gdbarch, &ft32_frame_unwind);
  503. /* Support simple overlay manager. */
  504. set_gdbarch_overlay_update (gdbarch, simple_overlay_update);
  505. set_gdbarch_address_class_type_flags (gdbarch, ft32_address_class_type_flags);
  506. set_gdbarch_address_class_name_to_type_flags
  507. (gdbarch, ft32_address_class_name_to_type_flags);
  508. set_gdbarch_address_class_type_flags_to_name
  509. (gdbarch, ft32_address_class_type_flags_to_name);
  510. return gdbarch;
  511. }
  512. /* Register this machine's init routine. */
  513. void _initialize_ft32_tdep ();
  514. void
  515. _initialize_ft32_tdep ()
  516. {
  517. register_gdbarch_init (bfd_arch_ft32, ft32_gdbarch_init);
  518. }