1 /* Target-dependent code for Moxie.
3 Copyright (C) 2009-2012 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 #include "frame-unwind.h"
23 #include "frame-base.h"
28 #include "gdb_string.h"
35 #include "arch-utils.h"
37 #include "trad-frame.h"
41 #include "gdb_assert.h"
43 #include "moxie-tdep.h"
45 /* Local functions. */
47 extern void _initialize_moxie_tdep (void);
49 /* Use an invalid address value as 'not available' marker. */
50 enum { REG_UNAVAIL = (CORE_ADDR) -1 };
52 struct moxie_frame_cache
58 CORE_ADDR saved_regs[MOXIE_NUM_REGS];
62 /* Implement the "frame_align" gdbarch method. */
65 moxie_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
67 /* Align to the size of an instruction (so that they can safely be
68 pushed onto the stack. */
72 /* Implement the "breakpoint_from_pc" gdbarch method. */
74 const static unsigned char *
75 moxie_breakpoint_from_pc (struct gdbarch *gdbarch,
76 CORE_ADDR *pcptr, int *lenptr)
78 static unsigned char breakpoint[] = { 0x35, 0x00 };
80 *lenptr = sizeof (breakpoint);
84 /* Moxie register names. */
86 char *moxie_register_names[] = {
87 "$fp", "$sp", "$r0", "$r1", "$r2",
88 "$r3", "$r4", "$r5", "$r6", "$r7",
89 "$r8", "$r9", "$r10", "$r11", "$r12",
90 "$r13", "$pc", "$cc" };
92 /* Implement the "register_name" gdbarch method. */
95 moxie_register_name (struct gdbarch *gdbarch, int reg_nr)
99 if (reg_nr >= MOXIE_NUM_REGS)
101 return moxie_register_names[reg_nr];
104 /* Implement the "register_type" gdbarch method. */
107 moxie_register_type (struct gdbarch *gdbarch, int reg_nr)
109 if (reg_nr == MOXIE_PC_REGNUM)
110 return builtin_type (gdbarch)->builtin_func_ptr;
111 else if (reg_nr == MOXIE_SP_REGNUM || reg_nr == MOXIE_FP_REGNUM)
112 return builtin_type (gdbarch)->builtin_data_ptr;
114 return builtin_type (gdbarch)->builtin_int32;
117 /* Write into appropriate registers a function return value
118 of type TYPE, given in virtual format. */
121 moxie_store_return_value (struct type *type, struct regcache *regcache,
124 struct gdbarch *gdbarch = get_regcache_arch (regcache);
125 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
127 int len = TYPE_LENGTH (type);
129 /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */
130 regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order);
131 regcache_cooked_write_unsigned (regcache, RET1_REGNUM, regval);
134 regval = extract_unsigned_integer ((gdb_byte *) valbuf + 4,
135 len - 4, byte_order);
136 regcache_cooked_write_unsigned (regcache, RET1_REGNUM + 1, regval);
140 /* Decode the instructions within the given address range. Decide
141 when we must have reached the end of the function prologue. If a
142 frame_info pointer is provided, fill in its saved_regs etc.
144 Returns the address of the first instruction after the prologue. */
147 moxie_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr,
148 struct moxie_frame_cache *cache,
149 struct gdbarch *gdbarch)
151 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
153 ULONGEST inst, inst2;
157 /* Record where the jsra instruction saves the PC and FP. */
158 cache->saved_regs[MOXIE_PC_REGNUM] = -4;
159 cache->saved_regs[MOXIE_FP_REGNUM] = 0;
160 cache->framesize = 0;
162 if (start_addr >= end_addr)
165 for (next_addr = start_addr; next_addr < end_addr; )
167 inst = read_memory_unsigned_integer (next_addr, 2, byte_order);
169 /* Match "push $sp $rN" where N is between 0 and 13 inclusive. */
170 if (inst >= 0x0612 && inst <= 0x061f)
172 regnum = inst & 0x000f;
173 cache->framesize += 4;
174 cache->saved_regs[regnum] = cache->framesize;
181 inst = read_memory_unsigned_integer (next_addr, 2, byte_order);
183 /* Optional stack allocation for args and local vars <= 4
185 if (inst == 0x01e0) /* ldi.l $r12, X */
187 offset = read_memory_integer (next_addr + 2, 4, byte_order);
188 inst2 = read_memory_unsigned_integer (next_addr + 6, 2, byte_order);
190 if (inst2 == 0x291e) /* sub.l $sp, $r12 */
192 cache->framesize += offset;
195 return (next_addr + 8);
197 else if ((inst & 0xff00) == 0x9100) /* dec $sp, X */
199 cache->framesize += (inst & 0x00ff);
202 while (next_addr < end_addr)
204 inst = read_memory_unsigned_integer (next_addr, 2, byte_order);
205 if ((inst & 0xff00) != 0x9100) /* no more dec $sp, X */
207 cache->framesize += (inst & 0x00ff);
215 /* Find the end of function prologue. */
218 moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
220 CORE_ADDR func_addr = 0, func_end = 0;
221 const char *func_name;
223 /* See if we can determine the end of the prologue via the symbol table.
224 If so, then return either PC, or the PC after the prologue, whichever
226 if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end))
228 CORE_ADDR post_prologue_pc
229 = skip_prologue_using_sal (gdbarch, func_addr);
230 if (post_prologue_pc != 0)
231 return max (pc, post_prologue_pc);
234 /* Can't determine prologue from the symbol table, need to examine
236 struct symtab_and_line sal;
238 struct moxie_frame_cache cache;
241 memset (&cache, 0, sizeof cache);
243 plg_end = moxie_analyze_prologue (func_addr,
244 func_end, &cache, gdbarch);
245 /* Found a function. */
246 sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
247 /* Don't use line number debug info for assembly source
249 if (sym && SYMBOL_LANGUAGE (sym) != language_asm)
251 sal = find_pc_line (func_addr, 0);
252 if (sal.end && sal.end < func_end)
254 /* Found a line number, use it as end of
259 /* No useable line symbol. Use result of prologue parsing
265 /* No function symbol -- just return the PC. */
266 return (CORE_ADDR) pc;
269 struct moxie_unwind_cache
271 /* The previous frame's inner most stack address. Used as this
272 frame ID's stack_addr. */
274 /* The frame's base, optionally used by the high-level debug info. */
277 /* How far the SP and r13 (FP) have been offset from the start of
278 the stack frame (as defined by the previous frame's stack
283 /* Table indicating the location of each and every register. */
284 struct trad_frame_saved_reg *saved_regs;
287 /* Implement the "read_pc" gdbarch method. */
290 moxie_read_pc (struct regcache *regcache)
294 regcache_cooked_read_unsigned (regcache, MOXIE_PC_REGNUM, &pc);
298 /* Implement the "write_pc" gdbarch method. */
301 moxie_write_pc (struct regcache *regcache, CORE_ADDR val)
303 regcache_cooked_write_unsigned (regcache, MOXIE_PC_REGNUM, val);
306 /* Implement the "unwind_sp" gdbarch method. */
309 moxie_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
311 return frame_unwind_register_unsigned (next_frame, MOXIE_SP_REGNUM);
314 /* Given a return value in `regbuf' with a type `valtype',
315 extract and copy its value into `valbuf'. */
318 moxie_extract_return_value (struct type *type, struct regcache *regcache,
321 struct gdbarch *gdbarch = get_regcache_arch (regcache);
322 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
323 bfd_byte *valbuf = dst;
324 int len = TYPE_LENGTH (type);
327 /* By using store_unsigned_integer we avoid having to do
328 anything special for small big-endian values. */
329 regcache_cooked_read_unsigned (regcache, RET1_REGNUM, &tmp);
330 store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp);
332 /* Ignore return values more than 8 bytes in size because the moxie
333 returns anything more than 8 bytes in the stack. */
336 regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp);
337 store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp);
341 /* Implement the "return_value" gdbarch method. */
343 static enum return_value_convention
344 moxie_return_value (struct gdbarch *gdbarch, struct value *function,
345 struct type *valtype, struct regcache *regcache,
346 gdb_byte *readbuf, const gdb_byte *writebuf)
348 if (TYPE_LENGTH (valtype) > 8)
349 return RETURN_VALUE_STRUCT_CONVENTION;
353 moxie_extract_return_value (valtype, regcache, readbuf);
354 if (writebuf != NULL)
355 moxie_store_return_value (valtype, regcache, writebuf);
356 return RETURN_VALUE_REGISTER_CONVENTION;
360 /* Allocate and initialize a moxie_frame_cache object. */
362 static struct moxie_frame_cache *
363 moxie_alloc_frame_cache (void)
365 struct moxie_frame_cache *cache;
368 cache = FRAME_OBSTACK_ZALLOC (struct moxie_frame_cache);
373 cache->framesize = 0;
374 for (i = 0; i < MOXIE_NUM_REGS; ++i)
375 cache->saved_regs[i] = REG_UNAVAIL;
380 /* Populate a moxie_frame_cache object for this_frame. */
382 static struct moxie_frame_cache *
383 moxie_frame_cache (struct frame_info *this_frame, void **this_cache)
385 struct moxie_frame_cache *cache;
386 CORE_ADDR current_pc;
392 cache = moxie_alloc_frame_cache ();
395 cache->base = get_frame_register_unsigned (this_frame, MOXIE_FP_REGNUM);
396 if (cache->base == 0)
399 cache->pc = get_frame_func (this_frame);
400 current_pc = get_frame_pc (this_frame);
403 struct gdbarch *gdbarch = get_frame_arch (this_frame);
404 moxie_analyze_prologue (cache->pc, current_pc, cache, gdbarch);
407 cache->saved_sp = cache->base - cache->framesize;
409 for (i = 0; i < MOXIE_NUM_REGS; ++i)
410 if (cache->saved_regs[i] != REG_UNAVAIL)
411 cache->saved_regs[i] = cache->base - cache->saved_regs[i];
416 /* Implement the "unwind_pc" gdbarch method. */
419 moxie_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
421 return frame_unwind_register_unsigned (next_frame, MOXIE_PC_REGNUM);
424 /* Given a GDB frame, determine the address of the calling function's
425 frame. This will be used to create a new GDB frame struct. */
428 moxie_frame_this_id (struct frame_info *this_frame,
429 void **this_prologue_cache, struct frame_id *this_id)
431 struct moxie_frame_cache *cache = moxie_frame_cache (this_frame,
432 this_prologue_cache);
434 /* This marks the outermost frame. */
435 if (cache->base == 0)
438 *this_id = frame_id_build (cache->saved_sp, cache->pc);
441 /* Get the value of register regnum in the previous stack frame. */
443 static struct value *
444 moxie_frame_prev_register (struct frame_info *this_frame,
445 void **this_prologue_cache, int regnum)
447 struct moxie_frame_cache *cache = moxie_frame_cache (this_frame,
448 this_prologue_cache);
450 gdb_assert (regnum >= 0);
452 if (regnum == MOXIE_SP_REGNUM && cache->saved_sp)
453 return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
455 if (regnum < MOXIE_NUM_REGS && cache->saved_regs[regnum] != REG_UNAVAIL)
456 return frame_unwind_got_memory (this_frame, regnum,
457 cache->saved_regs[regnum]);
459 return frame_unwind_got_register (this_frame, regnum, regnum);
462 static const struct frame_unwind moxie_frame_unwind = {
464 default_frame_unwind_stop_reason,
466 moxie_frame_prev_register,
468 default_frame_sniffer
471 /* Return the base address of this_frame. */
474 moxie_frame_base_address (struct frame_info *this_frame, void **this_cache)
476 struct moxie_frame_cache *cache = moxie_frame_cache (this_frame,
482 static const struct frame_base moxie_frame_base = {
484 moxie_frame_base_address,
485 moxie_frame_base_address,
486 moxie_frame_base_address
489 static struct frame_id
490 moxie_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
492 CORE_ADDR sp = get_frame_register_unsigned (this_frame, MOXIE_SP_REGNUM);
494 return frame_id_build (sp, get_frame_pc (this_frame));
497 /* Read an unsigned integer from the inferior, and adjust
500 moxie_process_readu (CORE_ADDR addr, char *buf,
501 int length, enum bfd_endian byte_order)
503 if (target_read_memory (addr, buf, length))
506 printf_unfiltered (_("Process record: error reading memory at "
507 "addr 0x%s len = %d.\n"),
508 paddress (target_gdbarch (), addr), length);
512 return extract_unsigned_integer (buf, length, byte_order);
515 /* Parse the current instruction and record the values of the registers and
516 memory that will be changed in current instruction to "record_arch_list".
517 Return -1 if something wrong. */
520 moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
526 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
528 if (record_debug > 1)
529 fprintf_unfiltered (gdb_stdlog, "Process record: moxie_process_record "
531 paddress (target_gdbarch (), addr));
533 inst = (uint16_t) moxie_process_readu (addr, buf, 2, byte_order);
535 /* Decode instruction. */
536 if (inst & (1 << 15))
538 if (inst & (1 << 14))
540 /* This is a Form 3 instruction. */
541 int opcode = (inst >> 10 & 0xf);
549 case 0x04: /* bltu */
550 case 0x05: /* bgtu */
553 case 0x08: /* bgeu */
554 case 0x09: /* bleu */
566 /* This is a Form 2 instruction. */
567 int opcode = (inst >> 12 & 0x3);
574 int reg = (inst >> 8) & 0xf;
575 if (record_arch_list_add_reg (regcache, reg))
581 /* Do nothing until GDB learns about moxie's special
593 /* This is a Form 1 instruction. */
594 int opcode = inst >> 8;
601 case 0x01: /* ldi.l (immediate) */
602 case 0x02: /* mov (register-to-register) */
604 int reg = (inst >> 4) & 0xf;
605 if (record_arch_list_add_reg (regcache, reg))
609 case 0x03: /* jsra */
611 regcache_raw_read (regcache,
612 MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32);
613 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
615 if (record_arch_list_add_reg (regcache, MOXIE_FP_REGNUM)
616 || (record_arch_list_add_reg (regcache,
618 || record_arch_list_add_mem (tmpu32 - 12, 12))
624 if (record_arch_list_add_reg (regcache, MOXIE_FP_REGNUM)
625 || (record_arch_list_add_reg (regcache,
630 case 0x05: /* add.l */
632 int reg = (inst >> 4) & 0xf;
633 if (record_arch_list_add_reg (regcache, reg))
637 case 0x06: /* push */
639 int reg = (inst >> 4) & 0xf;
640 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
641 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
643 if (record_arch_list_add_reg (regcache, reg)
644 || record_arch_list_add_mem (tmpu32 - 4, 4))
650 int a = (inst >> 4) & 0xf;
652 if (record_arch_list_add_reg (regcache, a)
653 || record_arch_list_add_reg (regcache, b))
657 case 0x08: /* lda.l */
659 int reg = (inst >> 4) & 0xf;
660 if (record_arch_list_add_reg (regcache, reg))
664 case 0x09: /* sta.l */
666 tmpu32 = (uint32_t) moxie_process_readu (addr+2, buf,
668 if (record_arch_list_add_mem (tmpu32, 4))
672 case 0x0a: /* ld.l (register indirect) */
674 int reg = (inst >> 4) & 0xf;
675 if (record_arch_list_add_reg (regcache, reg))
679 case 0x0b: /* st.l */
681 int reg = (inst >> 4) & 0xf;
682 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
683 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
685 if (record_arch_list_add_mem (tmpu32, 4))
689 case 0x0c: /* ldo.l */
691 int reg = (inst >> 4) & 0xf;
692 if (record_arch_list_add_reg (regcache, reg))
696 case 0x0d: /* sto.l */
698 int reg = (inst >> 4) & 0xf;
699 uint32_t offset = (uint32_t) moxie_process_readu (addr+2, buf, 4,
701 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
702 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
705 if (record_arch_list_add_mem (tmpu32, 4))
711 if (record_arch_list_add_reg (regcache, MOXIE_CC_REGNUM))
731 regcache_raw_read (regcache,
732 MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32);
733 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
735 if (record_arch_list_add_reg (regcache, MOXIE_FP_REGNUM)
736 || (record_arch_list_add_reg (regcache,
738 || record_arch_list_add_mem (tmpu32 - 12, 12))
742 case 0x1a: /* jmpa */
747 case 0x1b: /* ldi.b (immediate) */
748 case 0x1c: /* ld.b (register indirect) */
749 case 0x1d: /* lda.b */
751 int reg = (inst >> 4) & 0xf;
752 if (record_arch_list_add_reg (regcache, reg))
756 case 0x1e: /* st.b */
758 int reg = (inst >> 4) & 0xf;
759 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
760 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
762 if (record_arch_list_add_mem (tmpu32, 1))
766 case 0x1f: /* sta.b */
768 tmpu32 = moxie_process_readu (addr+2, (char *) buf,
770 if (record_arch_list_add_mem (tmpu32, 1))
774 case 0x20: /* ldi.s (immediate) */
775 case 0x21: /* ld.s (register indirect) */
776 case 0x22: /* lda.s */
778 int reg = (inst >> 4) & 0xf;
779 if (record_arch_list_add_reg (regcache, reg))
783 case 0x23: /* st.s */
785 int reg = (inst >> 4) & 0xf;
786 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
787 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
789 if (record_arch_list_add_mem (tmpu32, 2))
793 case 0x24: /* sta.s */
795 tmpu32 = moxie_process_readu (addr+2, (char *) buf,
797 if (record_arch_list_add_mem (tmpu32, 2))
807 case 0x27: /* lshr */
808 case 0x28: /* ashl */
809 case 0x29: /* sub.l */
813 case 0x2d: /* ashr */
815 case 0x2f: /* mul.l */
817 int reg = (inst >> 4) & 0xf;
818 if (record_arch_list_add_reg (regcache, reg))
824 /* We currently implement support for libgloss'
827 int inum = moxie_process_readu (addr+2, (char *) buf,
832 case 0x1: /* SYS_exit */
837 case 0x2: /* SYS_open */
839 if (record_arch_list_add_reg (regcache, RET1_REGNUM))
843 case 0x4: /* SYS_read */
845 uint32_t length, ptr;
847 /* Read buffer pointer is in $r1. */
848 regcache_raw_read (regcache, 3, (gdb_byte *) & ptr);
849 ptr = extract_unsigned_integer ((gdb_byte *) & ptr,
852 /* String length is at 0x12($fp). */
853 regcache_raw_read (regcache,
854 MOXIE_FP_REGNUM, (gdb_byte *) & tmpu32);
855 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
857 length = moxie_process_readu (tmpu32+20, (char *) buf,
860 if (record_arch_list_add_mem (ptr, length))
864 case 0x5: /* SYS_write */
866 if (record_arch_list_add_reg (regcache, RET1_REGNUM))
875 case 0x31: /* div.l */
876 case 0x32: /* udiv.l */
877 case 0x33: /* mod.l */
878 case 0x34: /* umod.l */
880 int reg = (inst >> 4) & 0xf;
881 if (record_arch_list_add_reg (regcache, reg))
888 case 0x36: /* ldo.b */
890 int reg = (inst >> 4) & 0xf;
891 if (record_arch_list_add_reg (regcache, reg))
895 case 0x37: /* sto.b */
897 int reg = (inst >> 4) & 0xf;
898 uint32_t offset = (uint32_t) moxie_process_readu (addr+2, buf, 4,
900 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
901 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
904 if (record_arch_list_add_mem (tmpu32, 1))
908 case 0x38: /* ldo.s */
910 int reg = (inst >> 4) & 0xf;
911 if (record_arch_list_add_reg (regcache, reg))
915 case 0x39: /* sto.s */
917 int reg = (inst >> 4) & 0xf;
918 uint32_t offset = (uint32_t) moxie_process_readu (addr+2, buf, 4,
920 regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
921 tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
924 if (record_arch_list_add_mem (tmpu32, 2))
934 if (record_arch_list_add_reg (regcache, MOXIE_PC_REGNUM))
936 if (record_arch_list_add_end ())
941 /* Allocate and initialize the moxie gdbarch object. */
943 static struct gdbarch *
944 moxie_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
946 struct gdbarch *gdbarch;
947 struct gdbarch_tdep *tdep;
949 /* If there is already a candidate, use it. */
950 arches = gdbarch_list_lookup_by_info (arches, &info);
952 return arches->gdbarch;
954 /* Allocate space for the new architecture. */
955 tdep = XMALLOC (struct gdbarch_tdep);
956 gdbarch = gdbarch_alloc (&info, tdep);
958 set_gdbarch_read_pc (gdbarch, moxie_read_pc);
959 set_gdbarch_write_pc (gdbarch, moxie_write_pc);
960 set_gdbarch_unwind_sp (gdbarch, moxie_unwind_sp);
962 set_gdbarch_num_regs (gdbarch, MOXIE_NUM_REGS);
963 set_gdbarch_sp_regnum (gdbarch, MOXIE_SP_REGNUM);
964 set_gdbarch_pc_regnum (gdbarch, MOXIE_PC_REGNUM);
965 set_gdbarch_register_name (gdbarch, moxie_register_name);
966 set_gdbarch_register_type (gdbarch, moxie_register_type);
968 set_gdbarch_return_value (gdbarch, moxie_return_value);
970 set_gdbarch_skip_prologue (gdbarch, moxie_skip_prologue);
971 set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
972 set_gdbarch_breakpoint_from_pc (gdbarch, moxie_breakpoint_from_pc);
973 set_gdbarch_frame_align (gdbarch, moxie_frame_align);
975 frame_base_set_default (gdbarch, &moxie_frame_base);
977 /* Methods for saving / extracting a dummy frame's ID. The ID's
978 stack address must match the SP value returned by
979 PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */
980 set_gdbarch_dummy_id (gdbarch, moxie_dummy_id);
982 set_gdbarch_unwind_pc (gdbarch, moxie_unwind_pc);
984 set_gdbarch_print_insn (gdbarch, print_insn_moxie);
986 /* Hook in ABI-specific overrides, if they have been registered. */
987 gdbarch_init_osabi (info, gdbarch);
989 /* Hook in the default unwinders. */
990 frame_unwind_append_unwinder (gdbarch, &moxie_frame_unwind);
992 /* Support simple overlay manager. */
993 set_gdbarch_overlay_update (gdbarch, simple_overlay_update);
995 /* Support reverse debugging. */
996 set_gdbarch_process_record (gdbarch, moxie_process_record);
1001 /* Register this machine's init routine. */
1004 _initialize_moxie_tdep (void)
1006 register_gdbarch_init (bfd_arch_moxie, moxie_gdbarch_init);