1 /* Target-dependent code for Analog Devices Blackfin processor, for GDB.
3 Copyright (C) 2005-2012 Free Software Foundation, Inc.
5 Contributed by Analog Devices, Inc.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "gdb_string.h"
26 #include "arch-utils.h"
29 #include "frame-unwind.h"
30 #include "frame-base.h"
31 #include "trad-frame.h"
33 #include "gdb_assert.h"
34 #include "sim-regno.h"
35 #include "gdb/sim-bfin.h"
36 #include "dwarf2-frame.h"
42 #include "xml-syscall.h"
43 #include "bfin-tdep.h"
45 /* Macros used by prologue functions. */
46 #define P_LINKAGE 0xE800
47 #define P_MINUS_SP1 0x0140
48 #define P_MINUS_SP2 0x05C0
49 #define P_MINUS_SP3 0x0540
50 #define P_MINUS_SP4 0x04C0
51 #define P_SP_PLUS 0x6C06
52 #define P_P2_LOW 0xE10A
53 #define P_P2_HIGH 0XE14A
54 #define P_SP_EQ_SP_PLUS_P2 0X5BB2
55 #define P_SP_EQ_P2_PLUS_SP 0x5B96
56 #define P_MINUS_MINUS_SP_EQ_RETS 0x0167
58 /* Macros used for program flow control. */
59 /* 16 bit instruction, max */
60 #define P_16_BIT_INSR_MAX 0xBFFF
61 /* 32 bit instruction, min */
62 #define P_32_BIT_INSR_MIN 0xC000
63 /* 32 bit instruction, max */
64 #define P_32_BIT_INSR_MAX 0xE801
65 /* jump (preg), 16-bit, min */
66 #define P_JUMP_PREG_MIN 0x0050
67 /* jump (preg), 16-bit, max */
68 #define P_JUMP_PREG_MAX 0x0057
69 /* jump (pc+preg), 16-bit, min */
70 #define P_JUMP_PC_PLUS_PREG_MIN 0x0080
71 /* jump (pc+preg), 16-bit, max */
72 #define P_JUMP_PC_PLUS_PREG_MAX 0x0087
73 /* jump.s pcrel13m2, 16-bit, min */
74 #define P_JUMP_S_MIN 0x2000
75 /* jump.s pcrel13m2, 16-bit, max */
76 #define P_JUMP_S_MAX 0x2FFF
77 /* jump.l pcrel25m2, 32-bit, min */
78 #define P_JUMP_L_MIN 0xE200
79 /* jump.l pcrel25m2, 32-bit, max */
80 #define P_JUMP_L_MAX 0xE2FF
81 /* conditional jump pcrel11m2, 16-bit, min */
82 #define P_IF_CC_JUMP_MIN 0x1800
83 /* conditional jump pcrel11m2, 16-bit, max */
84 #define P_IF_CC_JUMP_MAX 0x1BFF
85 /* conditional jump(bp) pcrel11m2, 16-bit, min */
86 #define P_IF_CC_JUMP_BP_MIN 0x1C00
87 /* conditional jump(bp) pcrel11m2, 16-bit, max */
88 #define P_IF_CC_JUMP_BP_MAX 0x1FFF
89 /* conditional !jump pcrel11m2, 16-bit, min */
90 #define P_IF_NOT_CC_JUMP_MIN 0x1000
91 /* conditional !jump pcrel11m2, 16-bit, max */
92 #define P_IF_NOT_CC_JUMP_MAX 0x13FF
93 /* conditional jump(bp) pcrel11m2, 16-bit, min */
94 #define P_IF_NOT_CC_JUMP_BP_MIN 0x1400
95 /* conditional jump(bp) pcrel11m2, 16-bit, max */
96 #define P_IF_NOT_CC_JUMP_BP_MAX 0x17FF
97 /* call (preg), 16-bit, min */
98 #define P_CALL_PREG_MIN 0x0060
99 /* call (preg), 16-bit, max */
100 #define P_CALL_PREG_MAX 0x0067
101 /* call (pc+preg), 16-bit, min */
102 #define P_CALL_PC_PLUS_PREG_MIN 0x0070
103 /* call (pc+preg), 16-bit, max */
104 #define P_CALL_PC_PLUS_PREG_MAX 0x0077
105 /* call pcrel25m2, 32-bit, min */
106 #define P_CALL_MIN 0xE300
107 /* call pcrel25m2, 32-bit, max */
108 #define P_CALL_MAX 0xE3FF
112 #define P_MNOP 0xC803
113 /* EXCPT, 16-bit, min */
114 #define P_EXCPT_MIN 0x00A0
115 /* EXCPT, 16-bit, max */
116 #define P_EXCPT_MAX 0x00AF
117 /* multi instruction mask 1, 16-bit */
118 #define P_BIT_MULTI_INS_1 0xC000
119 /* multi instruction mask 2, 16-bit */
120 #define P_BIT_MULTI_INS_2 0x0800
122 /* The maximum bytes we search to skip the prologue. */
123 #define UPPER_LIMIT 40
126 #define ASTAT_CC_POS 5
127 #define ASTAT_CC (1 << ASTAT_CC_POS)
129 /* Initial value: Register names used in BFIN's ISA documentation. */
131 static const char * const bfin_register_name_strings[] =
133 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
134 "p0", "p1", "p2", "p3", "p4", "p5", "sp", "fp",
135 "i0", "i1", "i2", "i3", "m0", "m1", "m2", "m3",
136 "b0", "b1", "b2", "b3", "l0", "l1", "l2", "l3",
137 "a0x", "a0w", "a1x", "a1w", "astat", "rets",
138 "lc0", "lt0", "lb0", "lc1", "lt1", "lb1", "cycles", "cycles2",
139 "usp", "seqstat", "syscfg", "reti", "retx", "retn", "rete",
143 #define NUM_BFIN_REGNAMES ARRAY_SIZE (bfin_register_name_strings)
146 /* In this diagram successive memory locations increase downwards or the
147 stack grows upwards with negative indices. (PUSH analogy for stack.)
149 The top frame is the "frame" of the current function being executed.
151 +--------------+ SP -
155 +--------------+ FP |
157 +--------------+ | frame
169 +--------------+ | frame
179 +--------------+<- next frame
185 The frame chain is formed as following:
187 FP has the topmost frame.
188 FP + 4 has the previous FP and so on. */
191 /* Map from DWARF2 register number to GDB register number. */
193 static const int map_gcc_gdb[] =
227 BFIN_A0_DOT_X_REGNUM,
228 BFIN_A1_DOT_X_REGNUM,
247 struct bfin_frame_cache
253 int frameless_pc_value;
255 /* Saved registers. */
256 CORE_ADDR saved_regs[BFIN_NUM_REGS];
259 /* Stack space reserved for local variables. */
263 /* Allocate and initialize a frame cache. */
265 static struct bfin_frame_cache *
266 bfin_alloc_frame_cache (void)
268 struct bfin_frame_cache *cache;
271 cache = FRAME_OBSTACK_ZALLOC (struct bfin_frame_cache);
275 cache->sp_offset = -4;
277 cache->frameless_pc_value = 0;
279 /* Saved registers. We initialize these to -1 since zero is a valid
280 offset (that's where fp is supposed to be stored). */
281 for (i = 0; i < BFIN_NUM_REGS; i++)
282 cache->saved_regs[i] = -1;
284 /* Frameless until proven otherwise. */
290 static struct bfin_frame_cache *
291 bfin_frame_cache (struct frame_info *this_frame, void **this_cache)
293 struct bfin_frame_cache *cache;
299 cache = bfin_alloc_frame_cache ();
302 cache->base = get_frame_register_unsigned (this_frame, BFIN_FP_REGNUM);
303 if (cache->base == 0)
306 /* For normal frames, PC is stored at [FP + 4]. */
307 cache->saved_regs[BFIN_PC_REGNUM] = 4;
308 cache->saved_regs[BFIN_FP_REGNUM] = 0;
310 /* Adjust all the saved registers such that they contain addresses
311 instead of offsets. */
312 for (i = 0; i < BFIN_NUM_REGS; i++)
313 if (cache->saved_regs[i] != -1)
314 cache->saved_regs[i] += cache->base;
316 cache->pc = get_frame_func (this_frame) ;
317 if (cache->pc == 0 || cache->pc == get_frame_pc (this_frame))
319 /* Either there is no prologue (frameless function) or we are at
320 the start of a function. In short we do not have a frame.
321 PC is stored in rets register. FP points to previous frame. */
323 cache->saved_regs[BFIN_PC_REGNUM] =
324 get_frame_register_unsigned (this_frame, BFIN_RETS_REGNUM);
325 cache->frameless_pc_value = 1;
326 cache->base = get_frame_register_unsigned (this_frame, BFIN_FP_REGNUM);
327 cache->saved_regs[BFIN_FP_REGNUM] = cache->base;
328 cache->saved_sp = cache->base;
332 cache->frameless_pc_value = 0;
334 /* Now that we have the base address for the stack frame we can
335 calculate the value of SP in the calling frame. */
336 cache->saved_sp = cache->base + 8;
343 bfin_frame_this_id (struct frame_info *this_frame,
345 struct frame_id *this_id)
347 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
349 /* This marks the outermost frame. */
350 if (cache->base == 0)
353 /* See the end of bfin_push_dummy_call. */
354 *this_id = frame_id_build (cache->base + 8, cache->pc);
357 static struct value *
358 bfin_frame_prev_register (struct frame_info *this_frame,
362 struct gdbarch *gdbarch = get_frame_arch (this_frame);
363 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
365 if (regnum == gdbarch_sp_regnum (gdbarch) && cache->saved_sp)
366 return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
368 if (regnum < BFIN_NUM_REGS && cache->saved_regs[regnum] != -1)
369 return frame_unwind_got_memory (this_frame, regnum,
370 cache->saved_regs[regnum]);
372 return frame_unwind_got_register (this_frame, regnum, regnum);
375 static const struct frame_unwind bfin_frame_unwind =
378 default_frame_unwind_stop_reason,
380 bfin_frame_prev_register,
382 default_frame_sniffer
385 /* Check for "[--SP] = <reg>;" insns. These are appear in function
386 prologues to save misc registers onto the stack. */
389 is_minus_minus_sp (int op)
393 if ((op == P_MINUS_SP1) || (op == P_MINUS_SP2)
394 || (op == P_MINUS_SP3) || (op == P_MINUS_SP4))
400 /* Skip all the insns that appear in generated function prologues. */
403 bfin_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
405 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
406 int op = read_memory_unsigned_integer (pc, 2, byte_order);
407 CORE_ADDR orig_pc = pc;
410 /* The new gcc prologue generates the register saves BEFORE the link
411 or RETS saving instruction.
412 So, our job is to stop either at those instructions or some upper
413 limit saying there is no frame! */
417 if (is_minus_minus_sp (op))
419 while (is_minus_minus_sp (op))
422 op = read_memory_unsigned_integer (pc, 2, byte_order);
430 else if (op == P_LINKAGE)
435 else if (op == P_MINUS_MINUS_SP_EQ_RETS)
440 else if (op == P_RTS)
444 else if ((op >= P_JUMP_PREG_MIN && op <= P_JUMP_PREG_MAX)
445 || (op >= P_JUMP_PC_PLUS_PREG_MIN
446 && op <= P_JUMP_PC_PLUS_PREG_MAX)
447 || (op == P_JUMP_S_MIN && op <= P_JUMP_S_MAX))
451 else if (pc - orig_pc >= UPPER_LIMIT)
453 warning (_("Function Prologue not recognised; "
454 "pc will point to ENTRY_POINT of the function"));
460 pc += 2; /* Not a terminating instruction go on. */
461 op = read_memory_unsigned_integer (pc, 2, byte_order);
466 Dwarf2 uses entry point value AFTER some register initializations.
467 We should perhaps skip such asssignments as well (R6 = R1, ...). */
472 /* Return the GDB type object for the "standard" data type of data in
473 register N. This should be void pointer for P0-P5, SP, FP;
474 void pointer to function for PC; int otherwise. */
477 bfin_register_type (struct gdbarch *gdbarch, int regnum)
479 if ((regnum >= BFIN_P0_REGNUM && regnum <= BFIN_FP_REGNUM)
480 || regnum == BFIN_USP_REGNUM)
481 return builtin_type (gdbarch)->builtin_data_ptr;
483 if (regnum == BFIN_PC_REGNUM || regnum == BFIN_RETS_REGNUM
484 || regnum == BFIN_RETI_REGNUM || regnum == BFIN_RETX_REGNUM
485 || regnum == BFIN_RETN_REGNUM || regnum == BFIN_RETE_REGNUM
486 || regnum == BFIN_LT0_REGNUM || regnum == BFIN_LB0_REGNUM
487 || regnum == BFIN_LT1_REGNUM || regnum == BFIN_LB1_REGNUM)
488 return builtin_type (gdbarch)->builtin_func_ptr;
490 return builtin_type (gdbarch)->builtin_int32;
494 bfin_push_dummy_call (struct gdbarch *gdbarch,
495 struct value *function,
496 struct regcache *regcache,
502 CORE_ADDR struct_addr)
504 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
505 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
508 long reg_r0, reg_r1, reg_r2;
510 enum bfin_abi abi = bfin_abi (gdbarch);
511 CORE_ADDR func_addr = find_function_addr (function, NULL);
513 for (i = nargs - 1; i >= 0; i--)
515 struct type *value_type = value_enclosing_type (args[i]);
516 int len = TYPE_LENGTH (value_type);
518 total_len += (len + 3) & ~3;
521 /* At least twelve bytes of stack space must be allocated for the function's
522 arguments, even for functions that have less than 12 bytes of argument
526 sp -= 12 - total_len;
528 /* Push arguments in reverse order. */
530 for (i = nargs - 1; i >= 0; i--)
532 struct type *value_type = value_enclosing_type (args[i]);
533 struct type *arg_type = check_typedef (value_type);
534 int len = TYPE_LENGTH (value_type);
535 int container_len = (len + 3) & ~3;
538 write_memory (sp, value_contents_writeable (args[i]), container_len);
541 /* Initialize R0, R1, and R2 to the first 3 words of parameters. */
543 reg_r0 = read_memory_integer (sp, 4, byte_order);
544 regcache_cooked_write_unsigned (regcache, BFIN_R0_REGNUM, reg_r0);
545 reg_r1 = read_memory_integer (sp + 4, 4, byte_order);
546 regcache_cooked_write_unsigned (regcache, BFIN_R1_REGNUM, reg_r1);
547 reg_r2 = read_memory_integer (sp + 8, 4, byte_order);
548 regcache_cooked_write_unsigned (regcache, BFIN_R2_REGNUM, reg_r2);
550 /* Store struct value address. */
553 regcache_cooked_write_unsigned (regcache, BFIN_P0_REGNUM, struct_addr);
555 /* Set the dummy return value to bp_addr.
556 A dummy breakpoint will be setup to execute the call. */
558 regcache_cooked_write_unsigned (regcache, BFIN_RETS_REGNUM, bp_addr);
560 /* Finally, update the stack pointer. */
562 regcache_cooked_write_unsigned (regcache, BFIN_SP_REGNUM, sp);
567 /* Convert DWARF2 register number REG to the appropriate register number
571 bfin_reg_to_regnum (struct gdbarch *gdbarch, int reg)
573 if (reg > ARRAY_SIZE (map_gcc_gdb))
576 return map_gcc_gdb[reg];
579 /* This function implements the BREAKPOINT_FROM_PC macro. It returns
580 a pointer to a string of bytes that encode a breakpoint instruction,
581 stores the length of the string to *lenptr, and adjusts the program
582 counter (if necessary) to point to the actual memory location where
583 the breakpoint should be inserted. */
585 static const unsigned char *
586 bfin_breakpoint_from_pc (struct gdbarch *gdbarch,
587 CORE_ADDR *pcptr, int *lenptr)
589 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
591 static unsigned char bfin_breakpoint[] = {0xa1, 0x00, 0x00, 0x00};
592 static unsigned char bfin_sim_breakpoint[] = {0x25, 0x00, 0x00, 0x00};
594 iw = read_memory_unsigned_integer (*pcptr, 2, byte_order);
596 if ((iw & 0xf000) >= 0xc000)
597 /* 32-bit instruction. */
602 if (strcmp (target_shortname, "sim") == 0)
603 return bfin_sim_breakpoint;
605 return bfin_breakpoint;
609 bfin_extract_return_value (struct type *type,
610 struct regcache *regs,
613 struct gdbarch *gdbarch = get_regcache_arch (regs);
614 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
615 bfd_byte *valbuf = dst;
616 int len = TYPE_LENGTH (type);
618 int regno = BFIN_R0_REGNUM;
620 gdb_assert (len <= 8);
624 regcache_cooked_read_unsigned (regs, regno++, &tmp);
625 store_unsigned_integer (valbuf, (len > 4 ? 4 : len), byte_order, tmp);
631 /* Write into appropriate registers a function return value of type
632 TYPE, given in virtual format. */
635 bfin_store_return_value (struct type *type,
636 struct regcache *regs,
639 const bfd_byte *valbuf = src;
641 /* Integral values greater than one word are stored in consecutive
642 registers starting with R0. This will always be a multiple of
643 the register size. */
645 int len = TYPE_LENGTH (type);
646 int regno = BFIN_R0_REGNUM;
648 gdb_assert (len <= 8);
652 regcache_cooked_write (regs, regno++, valbuf);
658 /* Determine, for architecture GDBARCH, how a return value of TYPE
659 should be returned. If it is supposed to be returned in registers,
660 and READBUF is nonzero, read the appropriate value from REGCACHE,
661 and copy it into READBUF. If WRITEBUF is nonzero, write the value
662 from WRITEBUF into REGCACHE. */
664 static enum return_value_convention
665 bfin_return_value (struct gdbarch *gdbarch,
666 struct type *func_type,
668 struct regcache *regcache,
670 const gdb_byte *writebuf)
672 if (TYPE_LENGTH (type) > 8)
673 return RETURN_VALUE_STRUCT_CONVENTION;
676 bfin_extract_return_value (type, regcache, readbuf);
679 bfin_store_return_value (type, regcache, writebuf);
681 return RETURN_VALUE_REGISTER_CONVENTION;
684 /* Return the BFIN register name corresponding to register I. */
687 bfin_register_name (struct gdbarch *gdbarch, int i)
689 return bfin_register_name_strings[i];
692 static enum register_status
693 bfin_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
694 int regnum, gdb_byte *buffer)
696 gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
697 enum register_status status;
699 if (regnum != BFIN_CC_REGNUM)
700 internal_error (__FILE__, __LINE__,
701 _("invalid register number %d"), regnum);
703 /* Extract the CC bit from the ASTAT register. */
704 status = regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
705 if (status == REG_VALID)
707 buffer[1] = buffer[2] = buffer[3] = 0;
708 buffer[0] = !!(buf[0] & ASTAT_CC);
714 bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
715 int regnum, const gdb_byte *buffer)
717 gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
719 if (regnum != BFIN_CC_REGNUM)
720 internal_error (__FILE__, __LINE__,
721 _("invalid register number %d"), regnum);
723 /* Overlay the CC bit in the ASTAT register. */
724 regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
725 buf[0] = (buf[0] & ~ASTAT_CC) | ((buffer[0] & 1) << ASTAT_CC_POS);
726 regcache_raw_write (regcache, BFIN_ASTAT_REGNUM, buf);
730 bfin_frame_base_address (struct frame_info *this_frame, void **this_cache)
732 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
738 bfin_frame_local_address (struct frame_info *this_frame, void **this_cache)
740 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
742 return cache->base - 4;
746 bfin_frame_args_address (struct frame_info *this_frame, void **this_cache)
748 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
750 return cache->base + 8;
753 static const struct frame_base bfin_frame_base =
756 bfin_frame_base_address,
757 bfin_frame_local_address,
758 bfin_frame_args_address
761 static struct frame_id
762 bfin_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
766 sp = get_frame_register_unsigned (this_frame, BFIN_SP_REGNUM);
768 return frame_id_build (sp, get_frame_pc (this_frame));
772 bfin_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
774 return frame_unwind_register_unsigned (next_frame, BFIN_PC_REGNUM);
778 bfin_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
780 return (address & ~0x3);
784 bfin_abi (struct gdbarch *gdbarch)
786 return gdbarch_tdep (gdbarch)->bfin_abi;
789 /* Initialize the current architecture based on INFO. If possible,
790 re-use an architecture from ARCHES, which is a list of
791 architectures already created during this debugging session.
793 Called e.g. at program startup, when reading a core file, and when
794 reading a binary file. */
796 static struct gdbarch *
797 bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
799 struct gdbarch_tdep *tdep;
800 struct gdbarch *gdbarch;
804 /* Extract the ELF flags, if available. */
805 if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
806 elf_flags = elf_elfheader (info.abfd)->e_flags;
812 /* If there is already a candidate, use it. */
814 for (arches = gdbarch_list_lookup_by_info (arches, &info);
816 arches = gdbarch_list_lookup_by_info (arches->next, &info))
818 if (gdbarch_tdep (arches->gdbarch)->bfin_abi != abi)
820 return arches->gdbarch;
823 tdep = XMALLOC (struct gdbarch_tdep);
824 gdbarch = gdbarch_alloc (&info, tdep);
826 tdep->bfin_abi = abi;
828 set_gdbarch_num_regs (gdbarch, BFIN_NUM_REGS);
829 set_gdbarch_pseudo_register_read (gdbarch, bfin_pseudo_register_read);
830 set_gdbarch_pseudo_register_write (gdbarch, bfin_pseudo_register_write);
831 set_gdbarch_num_pseudo_regs (gdbarch, BFIN_NUM_PSEUDO_REGS);
832 set_gdbarch_sp_regnum (gdbarch, BFIN_SP_REGNUM);
833 set_gdbarch_pc_regnum (gdbarch, BFIN_PC_REGNUM);
834 set_gdbarch_ps_regnum (gdbarch, BFIN_ASTAT_REGNUM);
835 set_gdbarch_dwarf2_reg_to_regnum (gdbarch, bfin_reg_to_regnum);
836 set_gdbarch_register_name (gdbarch, bfin_register_name);
837 set_gdbarch_register_type (gdbarch, bfin_register_type);
838 set_gdbarch_dummy_id (gdbarch, bfin_dummy_id);
839 set_gdbarch_push_dummy_call (gdbarch, bfin_push_dummy_call);
840 set_gdbarch_believe_pcc_promotion (gdbarch, 1);
841 set_gdbarch_return_value (gdbarch, bfin_return_value);
842 set_gdbarch_skip_prologue (gdbarch, bfin_skip_prologue);
843 set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
844 set_gdbarch_breakpoint_from_pc (gdbarch, bfin_breakpoint_from_pc);
845 set_gdbarch_decr_pc_after_break (gdbarch, 2);
846 set_gdbarch_frame_args_skip (gdbarch, 8);
847 set_gdbarch_unwind_pc (gdbarch, bfin_unwind_pc);
848 set_gdbarch_frame_align (gdbarch, bfin_frame_align);
849 set_gdbarch_print_insn (gdbarch, print_insn_bfin);
851 /* Hook in ABI-specific overrides, if they have been registered. */
852 gdbarch_init_osabi (info, gdbarch);
854 dwarf2_append_unwinders (gdbarch);
856 frame_base_set_default (gdbarch, &bfin_frame_base);
858 frame_unwind_append_unwinder (gdbarch, &bfin_frame_unwind);
863 /* Provide a prototype to silence -Wmissing-prototypes. */
864 extern initialize_file_ftype _initialize_bfin_tdep;
867 _initialize_bfin_tdep (void)
869 register_gdbarch_init (bfd_arch_bfin, bfin_gdbarch_init);