GDB (API)
/home/stan/gdb/src/gdb/lm32-tdep.c
Go to the documentation of this file.
00001 /* Target-dependent code for Lattice Mico32 processor, for GDB.
00002    Contributed by Jon Beniston <jon@beniston.com>
00003 
00004    Copyright (C) 2009-2013 Free Software Foundation, Inc.
00005 
00006    This file is part of GDB.
00007 
00008    This program is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU General Public License as published by
00010    the Free Software Foundation; either version 3 of the License, or
00011    (at your option) any later version.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00020 
00021 #include "defs.h"
00022 #include "frame.h"
00023 #include "frame-unwind.h"
00024 #include "frame-base.h"
00025 #include "inferior.h"
00026 #include "dis-asm.h"
00027 #include "symfile.h"
00028 #include "remote.h"
00029 #include "gdbcore.h"
00030 #include "gdb/sim-lm32.h"
00031 #include "gdb/callback.h"
00032 #include "gdb/remote-sim.h"
00033 #include "sim-regno.h"
00034 #include "arch-utils.h"
00035 #include "regcache.h"
00036 #include "trad-frame.h"
00037 #include "reggroups.h"
00038 #include "opcodes/lm32-desc.h"
00039 
00040 #include "gdb_string.h"
00041 
00042 /* Macros to extract fields from an instruction.  */
00043 #define LM32_OPCODE(insn)       ((insn >> 26) & 0x3f)
00044 #define LM32_REG0(insn)         ((insn >> 21) & 0x1f)
00045 #define LM32_REG1(insn)         ((insn >> 16) & 0x1f)
00046 #define LM32_REG2(insn)         ((insn >> 11) & 0x1f)
00047 #define LM32_IMM16(insn)        ((((long)insn & 0xffff) << 16) >> 16)
00048 
00049 struct gdbarch_tdep
00050 {
00051   /* gdbarch target dependent data here.  Currently unused for LM32.  */
00052 };
00053 
00054 struct lm32_frame_cache
00055 {
00056   /* The frame's base.  Used when constructing a frame ID.  */
00057   CORE_ADDR base;
00058   CORE_ADDR pc;
00059   /* Size of frame.  */
00060   int size;
00061   /* Table indicating the location of each and every register.  */
00062   struct trad_frame_saved_reg *saved_regs;
00063 };
00064 
00065 /* Add the available register groups.  */
00066 
00067 static void
00068 lm32_add_reggroups (struct gdbarch *gdbarch)
00069 {
00070   reggroup_add (gdbarch, general_reggroup);
00071   reggroup_add (gdbarch, all_reggroup);
00072   reggroup_add (gdbarch, system_reggroup);
00073 }
00074 
00075 /* Return whether a given register is in a given group.  */
00076 
00077 static int
00078 lm32_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
00079                           struct reggroup *group)
00080 {
00081   if (group == general_reggroup)
00082     return ((regnum >= SIM_LM32_R0_REGNUM) && (regnum <= SIM_LM32_RA_REGNUM))
00083       || (regnum == SIM_LM32_PC_REGNUM);
00084   else if (group == system_reggroup)
00085     return ((regnum >= SIM_LM32_EA_REGNUM) && (regnum <= SIM_LM32_BA_REGNUM))
00086       || ((regnum >= SIM_LM32_EID_REGNUM) && (regnum <= SIM_LM32_IP_REGNUM));
00087   return default_register_reggroup_p (gdbarch, regnum, group);
00088 }
00089 
00090 /* Return a name that corresponds to the given register number.  */
00091 
00092 static const char *
00093 lm32_register_name (struct gdbarch *gdbarch, int reg_nr)
00094 {
00095   static char *register_names[] = {
00096     "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
00097     "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
00098     "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
00099     "r24", "r25", "gp", "fp", "sp", "ra", "ea", "ba",
00100     "PC", "EID", "EBA", "DEBA", "IE", "IM", "IP"
00101   };
00102 
00103   if ((reg_nr < 0) || (reg_nr >= ARRAY_SIZE (register_names)))
00104     return NULL;
00105   else
00106     return register_names[reg_nr];
00107 }
00108 
00109 /* Return type of register.  */
00110 
00111 static struct type *
00112 lm32_register_type (struct gdbarch *gdbarch, int reg_nr)
00113 {
00114   return builtin_type (gdbarch)->builtin_int32;
00115 }
00116 
00117 /* Return non-zero if a register can't be written.  */
00118 
00119 static int
00120 lm32_cannot_store_register (struct gdbarch *gdbarch, int regno)
00121 {
00122   return (regno == SIM_LM32_R0_REGNUM) || (regno == SIM_LM32_EID_REGNUM);
00123 }
00124 
00125 /* Analyze a function's prologue.  */
00126 
00127 static CORE_ADDR
00128 lm32_analyze_prologue (struct gdbarch *gdbarch,
00129                        CORE_ADDR pc, CORE_ADDR limit,
00130                        struct lm32_frame_cache *info)
00131 {
00132   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
00133   unsigned long instruction;
00134 
00135   /* Keep reading though instructions, until we come across an instruction 
00136      that isn't likely to be part of the prologue.  */
00137   info->size = 0;
00138   for (; pc < limit; pc += 4)
00139     {
00140 
00141       /* Read an instruction.  */
00142       instruction = read_memory_integer (pc, 4, byte_order);
00143 
00144       if ((LM32_OPCODE (instruction) == OP_SW)
00145           && (LM32_REG0 (instruction) == SIM_LM32_SP_REGNUM))
00146         {
00147           /* Any stack displaced store is likely part of the prologue.
00148              Record that the register is being saved, and the offset 
00149              into the stack.  */
00150           info->saved_regs[LM32_REG1 (instruction)].addr =
00151             LM32_IMM16 (instruction);
00152         }
00153       else if ((LM32_OPCODE (instruction) == OP_ADDI)
00154                && (LM32_REG1 (instruction) == SIM_LM32_SP_REGNUM))
00155         {
00156           /* An add to the SP is likely to be part of the prologue.
00157              Adjust stack size by whatever the instruction adds to the sp.  */
00158           info->size -= LM32_IMM16 (instruction);
00159         }
00160       else if (                 /* add fp,fp,sp */
00161                 ((LM32_OPCODE (instruction) == OP_ADD)
00162                  && (LM32_REG2 (instruction) == SIM_LM32_FP_REGNUM)
00163                  && (LM32_REG0 (instruction) == SIM_LM32_FP_REGNUM)
00164                  && (LM32_REG1 (instruction) == SIM_LM32_SP_REGNUM))
00165                 /* mv fp,imm */
00166                 || ((LM32_OPCODE (instruction) == OP_ADDI)
00167                     && (LM32_REG1 (instruction) == SIM_LM32_FP_REGNUM)
00168                     && (LM32_REG0 (instruction) == SIM_LM32_R0_REGNUM)))
00169         {
00170           /* Likely to be in the prologue for functions that require 
00171              a frame pointer.  */
00172         }
00173       else
00174         {
00175           /* Any other instruction is likely not to be part of the
00176              prologue.  */
00177           break;
00178         }
00179     }
00180 
00181   return pc;
00182 }
00183 
00184 /* Return PC of first non prologue instruction, for the function at the 
00185    specified address.  */
00186 
00187 static CORE_ADDR
00188 lm32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
00189 {
00190   CORE_ADDR func_addr, limit_pc;
00191   struct lm32_frame_cache frame_info;
00192   struct trad_frame_saved_reg saved_regs[SIM_LM32_NUM_REGS];
00193 
00194   /* See if we can determine the end of the prologue via the symbol table.
00195      If so, then return either PC, or the PC after the prologue, whichever
00196      is greater.  */
00197   if (find_pc_partial_function (pc, NULL, &func_addr, NULL))
00198     {
00199       CORE_ADDR post_prologue_pc
00200         = skip_prologue_using_sal (gdbarch, func_addr);
00201       if (post_prologue_pc != 0)
00202         return max (pc, post_prologue_pc);
00203     }
00204 
00205   /* Can't determine prologue from the symbol table, need to examine
00206      instructions.  */
00207 
00208   /* Find an upper limit on the function prologue using the debug
00209      information.  If the debug information could not be used to provide
00210      that bound, then use an arbitrary large number as the upper bound.  */
00211   limit_pc = skip_prologue_using_sal (gdbarch, pc);
00212   if (limit_pc == 0)
00213     limit_pc = pc + 100;        /* Magic.  */
00214 
00215   frame_info.saved_regs = saved_regs;
00216   return lm32_analyze_prologue (gdbarch, pc, limit_pc, &frame_info);
00217 }
00218 
00219 /* Create a breakpoint instruction.  */
00220 
00221 static const gdb_byte *
00222 lm32_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
00223                          int *lenptr)
00224 {
00225   static const gdb_byte breakpoint[4] = { OP_RAISE << 2, 0, 0, 2 };
00226 
00227   *lenptr = sizeof (breakpoint);
00228   return breakpoint;
00229 }
00230 
00231 /* Setup registers and stack for faking a call to a function in the 
00232    inferior.  */
00233 
00234 static CORE_ADDR
00235 lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
00236                       struct regcache *regcache, CORE_ADDR bp_addr,
00237                       int nargs, struct value **args, CORE_ADDR sp,
00238                       int struct_return, CORE_ADDR struct_addr)
00239 {
00240   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
00241   int first_arg_reg = SIM_LM32_R1_REGNUM;
00242   int num_arg_regs = 8;
00243   int i;
00244 
00245   /* Set the return address.  */
00246   regcache_cooked_write_signed (regcache, SIM_LM32_RA_REGNUM, bp_addr);
00247 
00248   /* If we're returning a large struct, a pointer to the address to
00249      store it at is passed as a first hidden parameter.  */
00250   if (struct_return)
00251     {
00252       regcache_cooked_write_unsigned (regcache, first_arg_reg, struct_addr);
00253       first_arg_reg++;
00254       num_arg_regs--;
00255       sp -= 4;
00256     }
00257 
00258   /* Setup parameters.  */
00259   for (i = 0; i < nargs; i++)
00260     {
00261       struct value *arg = args[i];
00262       struct type *arg_type = check_typedef (value_type (arg));
00263       gdb_byte *contents;
00264       ULONGEST val;
00265 
00266       /* Promote small integer types to int.  */
00267       switch (TYPE_CODE (arg_type))
00268         {
00269         case TYPE_CODE_INT:
00270         case TYPE_CODE_BOOL:
00271         case TYPE_CODE_CHAR:
00272         case TYPE_CODE_RANGE:
00273         case TYPE_CODE_ENUM:
00274           if (TYPE_LENGTH (arg_type) < 4)
00275             {
00276               arg_type = builtin_type (gdbarch)->builtin_int32;
00277               arg = value_cast (arg_type, arg);
00278             }
00279           break;
00280         }
00281 
00282       /* FIXME: Handle structures.  */
00283 
00284       contents = (gdb_byte *) value_contents (arg);
00285       val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
00286                                       byte_order);
00287 
00288       /* First num_arg_regs parameters are passed by registers, 
00289          and the rest are passed on the stack.  */
00290       if (i < num_arg_regs)
00291         regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val);
00292       else
00293         {
00294           write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type));
00295           sp -= 4;
00296         }
00297     }
00298 
00299   /* Update stack pointer.  */
00300   regcache_cooked_write_signed (regcache, SIM_LM32_SP_REGNUM, sp);
00301 
00302   /* Return adjusted stack pointer.  */
00303   return sp;
00304 }
00305 
00306 /* Extract return value after calling a function in the inferior.  */
00307 
00308 static void
00309 lm32_extract_return_value (struct type *type, struct regcache *regcache,
00310                            gdb_byte *valbuf)
00311 {
00312   struct gdbarch *gdbarch = get_regcache_arch (regcache);
00313   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
00314   ULONGEST l;
00315   CORE_ADDR return_buffer;
00316 
00317   if (TYPE_CODE (type) != TYPE_CODE_STRUCT
00318       && TYPE_CODE (type) != TYPE_CODE_UNION
00319       && TYPE_CODE (type) != TYPE_CODE_ARRAY && TYPE_LENGTH (type) <= 4)
00320     {
00321       /* Return value is returned in a single register.  */
00322       regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
00323       store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, l);
00324     }
00325   else if ((TYPE_CODE (type) == TYPE_CODE_INT) && (TYPE_LENGTH (type) == 8))
00326     {
00327       /* 64-bit values are returned in a register pair.  */
00328       regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
00329       memcpy (valbuf, &l, 4);
00330       regcache_cooked_read_unsigned (regcache, SIM_LM32_R2_REGNUM, &l);
00331       memcpy (valbuf + 4, &l, 4);
00332     }
00333   else
00334     {
00335       /* Aggregate types greater than a single register are returned
00336          in memory.  FIXME: Unless they are only 2 regs?.  */
00337       regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
00338       return_buffer = l;
00339       read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
00340     }
00341 }
00342 
00343 /* Write into appropriate registers a function return value of type
00344    TYPE, given in virtual format.  */
00345 static void
00346 lm32_store_return_value (struct type *type, struct regcache *regcache,
00347                          const gdb_byte *valbuf)
00348 {
00349   struct gdbarch *gdbarch = get_regcache_arch (regcache);
00350   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
00351   ULONGEST val;
00352   int len = TYPE_LENGTH (type);
00353 
00354   if (len <= 4)
00355     {
00356       val = extract_unsigned_integer (valbuf, len, byte_order);
00357       regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
00358     }
00359   else if (len <= 8)
00360     {
00361       val = extract_unsigned_integer (valbuf, 4, byte_order);
00362       regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val);
00363       val = extract_unsigned_integer (valbuf + 4, len - 4, byte_order);
00364       regcache_cooked_write_unsigned (regcache, SIM_LM32_R2_REGNUM, val);
00365     }
00366   else
00367     error (_("lm32_store_return_value: type length too large."));
00368 }
00369 
00370 /* Determine whether a functions return value is in a register or memory.  */
00371 static enum return_value_convention
00372 lm32_return_value (struct gdbarch *gdbarch, struct value *function,
00373                    struct type *valtype, struct regcache *regcache,
00374                    gdb_byte *readbuf, const gdb_byte *writebuf)
00375 {
00376   enum type_code code = TYPE_CODE (valtype);
00377 
00378   if (code == TYPE_CODE_STRUCT
00379       || code == TYPE_CODE_UNION
00380       || code == TYPE_CODE_ARRAY || TYPE_LENGTH (valtype) > 8)
00381     return RETURN_VALUE_STRUCT_CONVENTION;
00382 
00383   if (readbuf)
00384     lm32_extract_return_value (valtype, regcache, readbuf);
00385   if (writebuf)
00386     lm32_store_return_value (valtype, regcache, writebuf);
00387 
00388   return RETURN_VALUE_REGISTER_CONVENTION;
00389 }
00390 
00391 static CORE_ADDR
00392 lm32_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
00393 {
00394   return frame_unwind_register_unsigned (next_frame, SIM_LM32_PC_REGNUM);
00395 }
00396 
00397 static CORE_ADDR
00398 lm32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
00399 {
00400   return frame_unwind_register_unsigned (next_frame, SIM_LM32_SP_REGNUM);
00401 }
00402 
00403 static struct frame_id
00404 lm32_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
00405 {
00406   CORE_ADDR sp = get_frame_register_unsigned (this_frame, SIM_LM32_SP_REGNUM);
00407 
00408   return frame_id_build (sp, get_frame_pc (this_frame));
00409 }
00410 
00411 /* Put here the code to store, into fi->saved_regs, the addresses of
00412    the saved registers of frame described by FRAME_INFO.  This
00413    includes special registers such as pc and fp saved in special ways
00414    in the stack frame.  sp is even more special: the address we return
00415    for it IS the sp for the next frame.  */
00416 
00417 static struct lm32_frame_cache *
00418 lm32_frame_cache (struct frame_info *this_frame, void **this_prologue_cache)
00419 {
00420   CORE_ADDR current_pc;
00421   ULONGEST prev_sp;
00422   ULONGEST this_base;
00423   struct lm32_frame_cache *info;
00424   int i;
00425 
00426   if ((*this_prologue_cache))
00427     return (*this_prologue_cache);
00428 
00429   info = FRAME_OBSTACK_ZALLOC (struct lm32_frame_cache);
00430   (*this_prologue_cache) = info;
00431   info->saved_regs = trad_frame_alloc_saved_regs (this_frame);
00432 
00433   info->pc = get_frame_func (this_frame);
00434   current_pc = get_frame_pc (this_frame);
00435   lm32_analyze_prologue (get_frame_arch (this_frame),
00436                          info->pc, current_pc, info);
00437 
00438   /* Compute the frame's base, and the previous frame's SP.  */
00439   this_base = get_frame_register_unsigned (this_frame, SIM_LM32_SP_REGNUM);
00440   prev_sp = this_base + info->size;
00441   info->base = this_base;
00442 
00443   /* Convert callee save offsets into addresses.  */
00444   for (i = 0; i < gdbarch_num_regs (get_frame_arch (this_frame)) - 1; i++)
00445     {
00446       if (trad_frame_addr_p (info->saved_regs, i))
00447         info->saved_regs[i].addr = this_base + info->saved_regs[i].addr;
00448     }
00449 
00450   /* The call instruction moves the caller's PC in the callee's RA register.
00451      Since this is an unwind, do the reverse.  Copy the location of RA register
00452      into PC (the address / regnum) so that a request for PC will be
00453      converted into a request for the RA register.  */
00454   info->saved_regs[SIM_LM32_PC_REGNUM] = info->saved_regs[SIM_LM32_RA_REGNUM];
00455 
00456   /* The previous frame's SP needed to be computed.  Save the computed
00457      value.  */
00458   trad_frame_set_value (info->saved_regs, SIM_LM32_SP_REGNUM, prev_sp);
00459 
00460   return info;
00461 }
00462 
00463 static void
00464 lm32_frame_this_id (struct frame_info *this_frame, void **this_cache,
00465                     struct frame_id *this_id)
00466 {
00467   struct lm32_frame_cache *cache = lm32_frame_cache (this_frame, this_cache);
00468 
00469   /* This marks the outermost frame.  */
00470   if (cache->base == 0)
00471     return;
00472 
00473   (*this_id) = frame_id_build (cache->base, cache->pc);
00474 }
00475 
00476 static struct value *
00477 lm32_frame_prev_register (struct frame_info *this_frame,
00478                           void **this_prologue_cache, int regnum)
00479 {
00480   struct lm32_frame_cache *info;
00481 
00482   info = lm32_frame_cache (this_frame, this_prologue_cache);
00483   return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
00484 }
00485 
00486 static const struct frame_unwind lm32_frame_unwind = {
00487   NORMAL_FRAME,
00488   default_frame_unwind_stop_reason,
00489   lm32_frame_this_id,
00490   lm32_frame_prev_register,
00491   NULL,
00492   default_frame_sniffer
00493 };
00494 
00495 static CORE_ADDR
00496 lm32_frame_base_address (struct frame_info *this_frame, void **this_cache)
00497 {
00498   struct lm32_frame_cache *info = lm32_frame_cache (this_frame, this_cache);
00499 
00500   return info->base;
00501 }
00502 
00503 static const struct frame_base lm32_frame_base = {
00504   &lm32_frame_unwind,
00505   lm32_frame_base_address,
00506   lm32_frame_base_address,
00507   lm32_frame_base_address
00508 };
00509 
00510 static CORE_ADDR
00511 lm32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
00512 {
00513   /* Align to the size of an instruction (so that they can safely be
00514      pushed onto the stack.  */
00515   return sp & ~3;
00516 }
00517 
00518 static struct gdbarch *
00519 lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
00520 {
00521   struct gdbarch *gdbarch;
00522   struct gdbarch_tdep *tdep;
00523 
00524   /* If there is already a candidate, use it.  */
00525   arches = gdbarch_list_lookup_by_info (arches, &info);
00526   if (arches != NULL)
00527     return arches->gdbarch;
00528 
00529   /* None found, create a new architecture from the information provided.  */
00530   tdep = XMALLOC (struct gdbarch_tdep);
00531   gdbarch = gdbarch_alloc (&info, tdep);
00532 
00533   /* Type sizes.  */
00534   set_gdbarch_short_bit (gdbarch, 16);
00535   set_gdbarch_int_bit (gdbarch, 32);
00536   set_gdbarch_long_bit (gdbarch, 32);
00537   set_gdbarch_long_long_bit (gdbarch, 64);
00538   set_gdbarch_float_bit (gdbarch, 32);
00539   set_gdbarch_double_bit (gdbarch, 64);
00540   set_gdbarch_long_double_bit (gdbarch, 64);
00541   set_gdbarch_ptr_bit (gdbarch, 32);
00542 
00543   /* Register info.  */
00544   set_gdbarch_num_regs (gdbarch, SIM_LM32_NUM_REGS);
00545   set_gdbarch_sp_regnum (gdbarch, SIM_LM32_SP_REGNUM);
00546   set_gdbarch_pc_regnum (gdbarch, SIM_LM32_PC_REGNUM);
00547   set_gdbarch_register_name (gdbarch, lm32_register_name);
00548   set_gdbarch_register_type (gdbarch, lm32_register_type);
00549   set_gdbarch_cannot_store_register (gdbarch, lm32_cannot_store_register);
00550 
00551   /* Frame info.  */
00552   set_gdbarch_skip_prologue (gdbarch, lm32_skip_prologue);
00553   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
00554   set_gdbarch_decr_pc_after_break (gdbarch, 0);
00555   set_gdbarch_frame_args_skip (gdbarch, 0);
00556 
00557   /* Frame unwinding.  */
00558   set_gdbarch_frame_align (gdbarch, lm32_frame_align);
00559   frame_base_set_default (gdbarch, &lm32_frame_base);
00560   set_gdbarch_unwind_pc (gdbarch, lm32_unwind_pc);
00561   set_gdbarch_unwind_sp (gdbarch, lm32_unwind_sp);
00562   set_gdbarch_dummy_id (gdbarch, lm32_dummy_id);
00563   frame_unwind_append_unwinder (gdbarch, &lm32_frame_unwind);
00564 
00565   /* Breakpoints.  */
00566   set_gdbarch_breakpoint_from_pc (gdbarch, lm32_breakpoint_from_pc);
00567   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
00568 
00569   /* Calling functions in the inferior.  */
00570   set_gdbarch_push_dummy_call (gdbarch, lm32_push_dummy_call);
00571   set_gdbarch_return_value (gdbarch, lm32_return_value);
00572 
00573   /* Instruction disassembler.  */
00574   set_gdbarch_print_insn (gdbarch, print_insn_lm32);
00575 
00576   lm32_add_reggroups (gdbarch);
00577   set_gdbarch_register_reggroup_p (gdbarch, lm32_register_reggroup_p);
00578 
00579   return gdbarch;
00580 }
00581 
00582 /* -Wmissing-prototypes */
00583 extern initialize_file_ftype _initialize_lm32_tdep;
00584 
00585 void
00586 _initialize_lm32_tdep (void)
00587 {
00588   register_gdbarch_init (bfd_arch_lm32, lm32_gdbarch_init);
00589 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines