gdb/lm32-tdep.c - gdb

Global variables defined

Data types defined

Functions defined

Macros defined

Source code

  1. /* Target-dependent code for Lattice Mico32 processor, for GDB.
  2.    Contributed by Jon Beniston <jon@beniston.com>

  3.    Copyright (C) 2009-2015 Free Software Foundation, Inc.

  4.    This file is part of GDB.

  5.    This program is free software; you can redistribute it and/or modify
  6.    it under the terms of the GNU General Public License as published by
  7.    the Free Software Foundation; either version 3 of the License, or
  8.    (at your option) any later version.

  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.

  13.    You should have received a copy of the GNU General Public License
  14.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  15. #include "defs.h"
  16. #include "frame.h"
  17. #include "frame-unwind.h"
  18. #include "frame-base.h"
  19. #include "inferior.h"
  20. #include "dis-asm.h"
  21. #include "symfile.h"
  22. #include "remote.h"
  23. #include "gdbcore.h"
  24. #include "gdb/sim-lm32.h"
  25. #include "gdb/callback.h"
  26. #include "gdb/remote-sim.h"
  27. #include "sim-regno.h"
  28. #include "arch-utils.h"
  29. #include "regcache.h"
  30. #include "trad-frame.h"
  31. #include "reggroups.h"
  32. #include "opcodes/lm32-desc.h"

  33. /* Macros to extract fields from an instruction.  */
  34. #define LM32_OPCODE(insn)       ((insn >> 26) & 0x3f)
  35. #define LM32_REG0(insn)         ((insn >> 21) & 0x1f)
  36. #define LM32_REG1(insn)         ((insn >> 16) & 0x1f)
  37. #define LM32_REG2(insn)         ((insn >> 11) & 0x1f)
  38. #define LM32_IMM16(insn)        ((((long)insn & 0xffff) << 16) >> 16)

  39. struct gdbarch_tdep
  40. {
  41.   /* gdbarch target dependent data here.  Currently unused for LM32.  */
  42. };

  43. struct lm32_frame_cache
  44. {
  45.   /* The frame's base.  Used when constructing a frame ID.  */
  46.   CORE_ADDR base;
  47.   CORE_ADDR pc;
  48.   /* Size of frame.  */
  49.   int size;
  50.   /* Table indicating the location of each and every register.  */
  51.   struct trad_frame_saved_reg *saved_regs;
  52. };

  53. /* Add the available register groups.  */

  54. static void
  55. lm32_add_reggroups (struct gdbarch *gdbarch)
  56. {
  57.   reggroup_add (gdbarch, general_reggroup);
  58.   reggroup_add (gdbarch, all_reggroup);
  59.   reggroup_add (gdbarch, system_reggroup);
  60. }

  61. /* Return whether a given register is in a given group.  */

  62. static int
  63. lm32_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
  64.                           struct reggroup *group)
  65. {
  66.   if (group == general_reggroup)
  67.     return ((regnum >= SIM_LM32_R0_REGNUM) && (regnum <= SIM_LM32_RA_REGNUM))
  68.       || (regnum == SIM_LM32_PC_REGNUM);
  69.   else if (group == system_reggroup)
  70.     return ((regnum >= SIM_LM32_EA_REGNUM) && (regnum <= SIM_LM32_BA_REGNUM))
  71.       || ((regnum >= SIM_LM32_EID_REGNUM) && (regnum <= SIM_LM32_IP_REGNUM));
  72.   return default_register_reggroup_p (gdbarch, regnum, group);
  73. }

  74. /* Return a name that corresponds to the given register number.  */

  75. static const char *
  76. lm32_register_name (struct gdbarch *gdbarch, int reg_nr)
  77. {
  78.   static char *register_names[] = {
  79.     "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
  80.     "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
  81.     "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
  82.     "r24", "r25", "gp", "fp", "sp", "ra", "ea", "ba",
  83.     "PC", "EID", "EBA", "DEBA", "IE", "IM", "IP"
  84.   };

  85.   if ((reg_nr < 0) || (reg_nr >= ARRAY_SIZE (register_names)))
  86.     return NULL;
  87.   else
  88.     return register_names[reg_nr];
  89. }

  90. /* Return type of register.  */

  91. static struct type *
  92. lm32_register_type (struct gdbarch *gdbarch, int reg_nr)
  93. {
  94.   return builtin_type (gdbarch)->builtin_int32;
  95. }

  96. /* Return non-zero if a register can't be written.  */

  97. static int
  98. lm32_cannot_store_register (struct gdbarch *gdbarch, int regno)
  99. {
  100.   return (regno == SIM_LM32_R0_REGNUM) || (regno == SIM_LM32_EID_REGNUM);
  101. }

  102. /* Analyze a function's prologue.  */

  103. static CORE_ADDR
  104. lm32_analyze_prologue (struct gdbarch *gdbarch,
  105.                        CORE_ADDR pc, CORE_ADDR limit,
  106.                        struct lm32_frame_cache *info)
  107. {
  108.   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  109.   unsigned long instruction;

  110.   /* Keep reading though instructions, until we come across an instruction
  111.      that isn't likely to be part of the prologue.  */
  112.   info->size = 0;
  113.   for (; pc < limit; pc += 4)
  114.     {

  115.       /* Read an instruction.  */
  116.       instruction = read_memory_integer (pc, 4, byte_order);

  117.       if ((LM32_OPCODE (instruction) == OP_SW)
  118.           && (LM32_REG0 (instruction) == SIM_LM32_SP_REGNUM))
  119.         {
  120.           /* Any stack displaced store is likely part of the prologue.
  121.              Record that the register is being saved, and the offset
  122.              into the stack.  */
  123.           info->saved_regs[LM32_REG1 (instruction)].addr =
  124.             LM32_IMM16 (instruction);
  125.         }
  126.       else if ((LM32_OPCODE (instruction) == OP_ADDI)
  127.                && (LM32_REG1 (instruction) == SIM_LM32_SP_REGNUM))
  128.         {
  129.           /* An add to the SP is likely to be part of the prologue.
  130.              Adjust stack size by whatever the instruction adds to the sp.  */
  131.           info->size -= LM32_IMM16 (instruction);
  132.         }
  133.       else if (                        /* add fp,fp,sp */
  134.                 ((LM32_OPCODE (instruction) == OP_ADD)
  135.                  && (LM32_REG2 (instruction) == SIM_LM32_FP_REGNUM)
  136.                  && (LM32_REG0 (instruction) == SIM_LM32_FP_REGNUM)
  137.                  && (LM32_REG1 (instruction) == SIM_LM32_SP_REGNUM))
  138.                 /* mv fp,imm */
  139.                 || ((LM32_OPCODE (instruction) == OP_ADDI)
  140.                     && (LM32_REG1 (instruction) == SIM_LM32_FP_REGNUM)
  141.                     && (LM32_REG0 (instruction) == SIM_LM32_R0_REGNUM)))
  142.         {
  143.           /* Likely to be in the prologue for functions that require
  144.              a frame pointer.  */
  145.         }
  146.       else
  147.         {
  148.           /* Any other instruction is likely not to be part of the
  149.              prologue.  */
  150.           break;
  151.         }
  152.     }

  153.   return pc;
  154. }

  155. /* Return PC of first non prologue instruction, for the function at the
  156.    specified address.  */

  157. static CORE_ADDR
  158. lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
  159. {
  160.   CORE_ADDR func_addr, limit_pc;
  161.   struct lm32_frame_cache frame_info;
  162.   struct trad_frame_saved_reg saved_regs[SIM_LM32_NUM_REGS];

  163.   /* See if we can determine the end of the prologue via the symbol table.
  164.      If so, then return either PC, or the PC after the prologue, whichever
  165.      is greater.  */
  166.   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
  167.     {
  168.       CORE_ADDR post_prologue_pc
  169.         = skip_prologue_using_sal (gdbarch, func_addr);
  170.       if (post_prologue_pc != 0)
  171.         return max (pc, post_prologue_pc);
  172.     }

  173.   /* Can't determine prologue from the symbol table, need to examine
  174.      instructions.  */

  175.   /* Find an upper limit on the function prologue using the debug
  176.      information.  If the debug information could not be used to provide
  177.      that bound, then use an arbitrary large number as the upper bound.  */
  178.   limit_pc = skip_prologue_using_sal (gdbarch, pc);
  179.   if (limit_pc == 0)
  180.     limit_pc = pc + 100;        /* Magic.  */

  181.   frame_info.saved_regs = saved_regs;
  182.   return lm32_analyze_prologue (gdbarch, pc, limit_pc, &frame_info);
  183. }

  184. /* Create a breakpoint instruction.  */

  185. static const gdb_byte *
  186. lm32_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
  187.                          int *lenptr)
  188. {
  189.   static const gdb_byte breakpoint[4] = { OP_RAISE << 2, 0, 0, 2 };

  190.   *lenptr = sizeof (breakpoint);
  191.   return breakpoint;
  192. }

  193. /* Setup registers and stack for faking a call to a function in the
  194.    inferior.  */

  195. static CORE_ADDR
  196. lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
  197.                       struct regcache *regcache, CORE_ADDR bp_addr,
  198.                       int nargs, struct value **args, CORE_ADDR sp,
  199.                       int struct_return, CORE_ADDR struct_addr)
  200. {
  201.   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  202.   int first_arg_reg = SIM_LM32_R1_REGNUM;
  203.   int num_arg_regs = 8;
  204.   int i;

  205.   /* Set the return address.  */
  206.   regcache_cooked_write_signed (regcache, SIM_LM32_RA_REGNUM, bp_addr);

  207.   /* If we're returning a large struct, a pointer to the address to
  208.      store it at is passed as a first hidden parameter.  */
  209.   if (struct_return)
  210.     {
  211.       regcache_cooked_write_unsigned (regcache, first_arg_reg, struct_addr);
  212.       first_arg_reg++;
  213.       num_arg_regs--;
  214.       sp -= 4;
  215.     }

  216.   /* Setup parameters.  */
  217.   for (i = 0; i < nargs; i++)
  218.     {
  219.       struct value *arg = args[i];
  220.       struct type *arg_type = check_typedef (value_type (arg));
  221.       gdb_byte *contents;
  222.       ULONGEST val;

  223.       /* Promote small integer types to int.  */
  224.       switch (TYPE_CODE (arg_type))
  225.         {
  226.         case TYPE_CODE_INT:
  227.         case TYPE_CODE_BOOL:
  228.         case TYPE_CODE_CHAR:
  229.         case TYPE_CODE_RANGE:
  230.         case TYPE_CODE_ENUM:
  231.           if (TYPE_LENGTH (arg_type) < 4)
  232.             {
  233.               arg_type = builtin_type (gdbarch)->builtin_int32;
  234.               arg = value_cast (arg_type, arg);
  235.             }
  236.           break;
  237.         }

  238.       /* FIXME: Handle structures.  */

  239.       contents = (gdb_byte *) value_contents (arg);
  240.       val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
  241.                                       byte_order);

  242.       /* First num_arg_regs parameters are passed by registers,
  243.          and the rest are passed on the stack.  */
  244.       if (i < num_arg_regs)
  245.         regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val);
  246.       else
  247.         {
  248.           write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type));
  249.           sp -= 4;
  250.         }
  251.     }

  252.   /* Update stack pointer.  */
  253.   regcache_cooked_write_signed (regcache, SIM_LM32_SP_REGNUM, sp);

  254.   /* Return adjusted stack pointer.  */
  255.   return sp;
  256. }

  257. /* Extract return value after calling a function in the inferior.  */

  258. static void
  259. lm32_extract_return_value (struct type *type, struct regcache *regcache,
  260.                            gdb_byte *valbuf)
  261. {
  262.   struct gdbarch *gdbarch = get_regcache_arch (regcache);
  263.   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  264.   ULONGEST l;
  265.   CORE_ADDR return_buffer;

  266.   if (TYPE_CODE (type) != TYPE_CODE_STRUCT
  267.       && TYPE_CODE (type) != TYPE_CODE_UNION
  268.       && TYPE_CODE (type) != TYPE_CODE_ARRAY && TYPE_LENGTH (type) <= 4)
  269.     {
  270.       /* Return value is returned in a single register.  */
  271.       regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
  272.       store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, l);
  273.     }
  274.   else if ((TYPE_CODE (type) == TYPE_CODE_INT) && (TYPE_LENGTH (type) == 8))
  275.     {
  276.       /* 64-bit values are returned in a register pair.  */
  277.       regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
  278.       memcpy (valbuf, &l, 4);
  279.       regcache_cooked_read_unsigned (regcache, SIM_LM32_R2_REGNUM, &l);
  280.       memcpy (valbuf + 4, &l, 4);
  281.     }
  282.   else
  283.     {
  284.       /* Aggregate types greater than a single register are returned
  285.          in memory.  FIXME: Unless they are only 2 regs?.  */
  286.       regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
  287.       return_buffer = l;
  288.       read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
  289.     }
  290. }

  291. /* Write into appropriate registers a function return value of type
  292.    TYPE, given in virtual format.  */
  293. static void
  294. lm32_store_return_value (struct type *type, struct regcache *regcache,
  295.                          const gdb_byte *valbuf)
  296. {
  297.   struct gdbarch *gdbarch = get_regcache_arch (regcache);
  298.   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
  299.   ULONGEST val;
  300.   int len = TYPE_LENGTH (type);

  301.   if (len <= 4)
  302.     {
  303.       val = extract_unsigned_integer (valbuf, len, byte_order);
  304.       regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
  305.     }
  306.   else if (len <= 8)
  307.     {
  308.       val = extract_unsigned_integer (valbuf, 4, byte_order);
  309.       regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
  310.       val = extract_unsigned_integer (valbuf + 4, len - 4, byte_order);
  311.       regcache_cooked_write_unsigned (regcache, SIM_LM32_R2_REGNUM, val);
  312.     }
  313.   else
  314.     error (_("lm32_store_return_value: type length too large."));
  315. }

  316. /* Determine whether a functions return value is in a register or memory.  */
  317. static enum return_value_convention
  318. lm32_return_value (struct gdbarch *gdbarch, struct value *function,
  319.                    struct type *valtype, struct regcache *regcache,
  320.                    gdb_byte *readbuf, const gdb_byte *writebuf)
  321. {
  322.   enum type_code code = TYPE_CODE (valtype);

  323.   if (code == TYPE_CODE_STRUCT
  324.       || code == TYPE_CODE_UNION
  325.       || code == TYPE_CODE_ARRAY || TYPE_LENGTH (valtype) > 8)
  326.     return RETURN_VALUE_STRUCT_CONVENTION;

  327.   if (readbuf)
  328.     lm32_extract_return_value (valtype, regcache, readbuf);
  329.   if (writebuf)
  330.     lm32_store_return_value (valtype, regcache, writebuf);

  331.   return RETURN_VALUE_REGISTER_CONVENTION;
  332. }

  333. static CORE_ADDR
  334. lm32_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
  335. {
  336.   return frame_unwind_register_unsigned (next_frame, SIM_LM32_PC_REGNUM);
  337. }

  338. static CORE_ADDR
  339. lm32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
  340. {
  341.   return frame_unwind_register_unsigned (next_frame, SIM_LM32_SP_REGNUM);
  342. }

  343. static struct frame_id
  344. lm32_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
  345. {
  346.   CORE_ADDR sp = get_frame_register_unsigned (this_frame, SIM_LM32_SP_REGNUM);

  347.   return frame_id_build (sp, get_frame_pc (this_frame));
  348. }

  349. /* Put here the code to store, into fi->saved_regs, the addresses of
  350.    the saved registers of frame described by FRAME_INFO.  This
  351.    includes special registers such as pc and fp saved in special ways
  352.    in the stack frame.  sp is even more special: the address we return
  353.    for it IS the sp for the next frame.  */

  354. static struct lm32_frame_cache *
  355. lm32_frame_cache (struct frame_info *this_frame, void **this_prologue_cache)
  356. {
  357.   CORE_ADDR current_pc;
  358.   ULONGEST prev_sp;
  359.   ULONGEST this_base;
  360.   struct lm32_frame_cache *info;
  361.   int i;

  362.   if ((*this_prologue_cache))
  363.     return (*this_prologue_cache);

  364.   info = FRAME_OBSTACK_ZALLOC (struct lm32_frame_cache);
  365.   (*this_prologue_cache) = info;
  366.   info->saved_regs = trad_frame_alloc_saved_regs (this_frame);

  367.   info->pc = get_frame_func (this_frame);
  368.   current_pc = get_frame_pc (this_frame);
  369.   lm32_analyze_prologue (get_frame_arch (this_frame),
  370.                          info->pc, current_pc, info);

  371.   /* Compute the frame's base, and the previous frame's SP.  */
  372.   this_base = get_frame_register_unsigned (this_frame, SIM_LM32_SP_REGNUM);
  373.   prev_sp = this_base + info->size;
  374.   info->base = this_base;

  375.   /* Convert callee save offsets into addresses.  */
  376.   for (i = 0; i < gdbarch_num_regs (get_frame_arch (this_frame)) - 1; i++)
  377.     {
  378.       if (trad_frame_addr_p (info->saved_regs, i))
  379.         info->saved_regs[i].addr = this_base + info->saved_regs[i].addr;
  380.     }

  381.   /* The call instruction moves the caller's PC in the callee's RA register.
  382.      Since this is an unwind, do the reverse.  Copy the location of RA register
  383.      into PC (the address / regnum) so that a request for PC will be
  384.      converted into a request for the RA register.  */
  385.   info->saved_regs[SIM_LM32_PC_REGNUM] = info->saved_regs[SIM_LM32_RA_REGNUM];

  386.   /* The previous frame's SP needed to be computed.  Save the computed
  387.      value.  */
  388.   trad_frame_set_value (info->saved_regs, SIM_LM32_SP_REGNUM, prev_sp);

  389.   return info;
  390. }

  391. static void
  392. lm32_frame_this_id (struct frame_info *this_frame, void **this_cache,
  393.                     struct frame_id *this_id)
  394. {
  395.   struct lm32_frame_cache *cache = lm32_frame_cache (this_frame, this_cache);

  396.   /* This marks the outermost frame.  */
  397.   if (cache->base == 0)
  398.     return;

  399.   (*this_id) = frame_id_build (cache->base, cache->pc);
  400. }

  401. static struct value *
  402. lm32_frame_prev_register (struct frame_info *this_frame,
  403.                           void **this_prologue_cache, int regnum)
  404. {
  405.   struct lm32_frame_cache *info;

  406.   info = lm32_frame_cache (this_frame, this_prologue_cache);
  407.   return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
  408. }

  409. static const struct frame_unwind lm32_frame_unwind = {
  410.   NORMAL_FRAME,
  411.   default_frame_unwind_stop_reason,
  412.   lm32_frame_this_id,
  413.   lm32_frame_prev_register,
  414.   NULL,
  415.   default_frame_sniffer
  416. };

  417. static CORE_ADDR
  418. lm32_frame_base_address (struct frame_info *this_frame, void **this_cache)
  419. {
  420.   struct lm32_frame_cache *info = lm32_frame_cache (this_frame, this_cache);

  421.   return info->base;
  422. }

  423. static const struct frame_base lm32_frame_base = {
  424.   &lm32_frame_unwind,
  425.   lm32_frame_base_address,
  426.   lm32_frame_base_address,
  427.   lm32_frame_base_address
  428. };

  429. static CORE_ADDR
  430. lm32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
  431. {
  432.   /* Align to the size of an instruction (so that they can safely be
  433.      pushed onto the stack.  */
  434.   return sp & ~3;
  435. }

  436. static struct gdbarch *
  437. lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
  438. {
  439.   struct gdbarch *gdbarch;
  440.   struct gdbarch_tdep *tdep;

  441.   /* If there is already a candidate, use it.  */
  442.   arches = gdbarch_list_lookup_by_info (arches, &info);
  443.   if (arches != NULL)
  444.     return arches->gdbarch;

  445.   /* None found, create a new architecture from the information provided.  */
  446.   tdep = XNEW (struct gdbarch_tdep);
  447.   gdbarch = gdbarch_alloc (&info, tdep);

  448.   /* Type sizes.  */
  449.   set_gdbarch_short_bit (gdbarch, 16);
  450.   set_gdbarch_int_bit (gdbarch, 32);
  451.   set_gdbarch_long_bit (gdbarch, 32);
  452.   set_gdbarch_long_long_bit (gdbarch, 64);
  453.   set_gdbarch_float_bit (gdbarch, 32);
  454.   set_gdbarch_double_bit (gdbarch, 64);
  455.   set_gdbarch_long_double_bit (gdbarch, 64);
  456.   set_gdbarch_ptr_bit (gdbarch, 32);

  457.   /* Register info.  */
  458.   set_gdbarch_num_regs (gdbarch, SIM_LM32_NUM_REGS);
  459.   set_gdbarch_sp_regnum (gdbarch, SIM_LM32_SP_REGNUM);
  460.   set_gdbarch_pc_regnum (gdbarch, SIM_LM32_PC_REGNUM);
  461.   set_gdbarch_register_name (gdbarch, lm32_register_name);
  462.   set_gdbarch_register_type (gdbarch, lm32_register_type);
  463.   set_gdbarch_cannot_store_register (gdbarch, lm32_cannot_store_register);

  464.   /* Frame info.  */
  465.   set_gdbarch_skip_prologue (gdbarch, lm32_skip_prologue);
  466.   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
  467.   set_gdbarch_decr_pc_after_break (gdbarch, 0);
  468.   set_gdbarch_frame_args_skip (gdbarch, 0);

  469.   /* Frame unwinding.  */
  470.   set_gdbarch_frame_align (gdbarch, lm32_frame_align);
  471.   frame_base_set_default (gdbarch, &lm32_frame_base);
  472.   set_gdbarch_unwind_pc (gdbarch, lm32_unwind_pc);
  473.   set_gdbarch_unwind_sp (gdbarch, lm32_unwind_sp);
  474.   set_gdbarch_dummy_id (gdbarch, lm32_dummy_id);
  475.   frame_unwind_append_unwinder (gdbarch, &lm32_frame_unwind);

  476.   /* Breakpoints.  */
  477.   set_gdbarch_breakpoint_from_pc (gdbarch, lm32_breakpoint_from_pc);
  478.   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);

  479.   /* Calling functions in the inferior.  */
  480.   set_gdbarch_push_dummy_call (gdbarch, lm32_push_dummy_call);
  481.   set_gdbarch_return_value (gdbarch, lm32_return_value);

  482.   /* Instruction disassembler.  */
  483.   set_gdbarch_print_insn (gdbarch, print_insn_lm32);

  484.   lm32_add_reggroups (gdbarch);
  485.   set_gdbarch_register_reggroup_p (gdbarch, lm32_register_reggroup_p);

  486.   return gdbarch;
  487. }

  488. /* -Wmissing-prototypes */
  489. extern initialize_file_ftype _initialize_lm32_tdep;

  490. void
  491. _initialize_lm32_tdep (void)
  492. {
  493.   register_gdbarch_init (bfd_arch_lm32, lm32_gdbarch_init);
  494. }