GDB (xrefs)

/tmp/gdb-8.1/gdb/bfin-tdep.c
Go to the documentation of this file.
1 /* Target-dependent code for Analog Devices Blackfin processor, for GDB.
2
3 Copyright (C) 2005-2018 Free Software Foundation, Inc.
4
5 Contributed by Analog Devices, Inc.
6
7 This file is part of GDB.
8
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.
13
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.
18
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/>. */
21
22 #include "defs.h"
23 #include "inferior.h"
24 #include "gdbcore.h"
25 #include "arch-utils.h"
26 #include "regcache.h"
27 #include "frame.h"
28 #include "frame-unwind.h"
29 #include "frame-base.h"
30 #include "trad-frame.h"
31 #include "dis-asm.h"
32 #include "sim-regno.h"
33 #include "gdb/sim-bfin.h"
34 #include "dwarf2-frame.h"
35 #include "symtab.h"
36 #include "elf-bfd.h"
37 #include "elf/bfin.h"
38 #include "osabi.h"
39 #include "infcall.h"
40 #include "xml-syscall.h"
41 #include "bfin-tdep.h"
42
43 /* Macros used by prologue functions. */
44 #define P_LINKAGE 0xE800
45 #define P_MINUS_SP1 0x0140
46 #define P_MINUS_SP2 0x05C0
47 #define P_MINUS_SP3 0x0540
48 #define P_MINUS_SP4 0x04C0
49 #define P_SP_PLUS 0x6C06
50 #define P_P2_LOW 0xE10A
51 #define P_P2_HIGH 0XE14A
52 #define P_SP_EQ_SP_PLUS_P2 0X5BB2
53 #define P_SP_EQ_P2_PLUS_SP 0x5B96
54 #define P_MINUS_MINUS_SP_EQ_RETS 0x0167
55
56 /* Macros used for program flow control. */
57 /* 16 bit instruction, max */
58 #define P_16_BIT_INSR_MAX 0xBFFF
59 /* 32 bit instruction, min */
60 #define P_32_BIT_INSR_MIN 0xC000
61 /* 32 bit instruction, max */
62 #define P_32_BIT_INSR_MAX 0xE801
63 /* jump (preg), 16-bit, min */
64 #define P_JUMP_PREG_MIN 0x0050
65 /* jump (preg), 16-bit, max */
66 #define P_JUMP_PREG_MAX 0x0057
67 /* jump (pc+preg), 16-bit, min */
68 #define P_JUMP_PC_PLUS_PREG_MIN 0x0080
69 /* jump (pc+preg), 16-bit, max */
70 #define P_JUMP_PC_PLUS_PREG_MAX 0x0087
71 /* jump.s pcrel13m2, 16-bit, min */
72 #define P_JUMP_S_MIN 0x2000
73 /* jump.s pcrel13m2, 16-bit, max */
74 #define P_JUMP_S_MAX 0x2FFF
75 /* jump.l pcrel25m2, 32-bit, min */
76 #define P_JUMP_L_MIN 0xE200
77 /* jump.l pcrel25m2, 32-bit, max */
78 #define P_JUMP_L_MAX 0xE2FF
79 /* conditional jump pcrel11m2, 16-bit, min */
80 #define P_IF_CC_JUMP_MIN 0x1800
81 /* conditional jump pcrel11m2, 16-bit, max */
82 #define P_IF_CC_JUMP_MAX 0x1BFF
83 /* conditional jump(bp) pcrel11m2, 16-bit, min */
84 #define P_IF_CC_JUMP_BP_MIN 0x1C00
85 /* conditional jump(bp) pcrel11m2, 16-bit, max */
86 #define P_IF_CC_JUMP_BP_MAX 0x1FFF
87 /* conditional !jump pcrel11m2, 16-bit, min */
88 #define P_IF_NOT_CC_JUMP_MIN 0x1000
89 /* conditional !jump pcrel11m2, 16-bit, max */
90 #define P_IF_NOT_CC_JUMP_MAX 0x13FF
91 /* conditional jump(bp) pcrel11m2, 16-bit, min */
92 #define P_IF_NOT_CC_JUMP_BP_MIN 0x1400
93 /* conditional jump(bp) pcrel11m2, 16-bit, max */
94 #define P_IF_NOT_CC_JUMP_BP_MAX 0x17FF
95 /* call (preg), 16-bit, min */
96 #define P_CALL_PREG_MIN 0x0060
97 /* call (preg), 16-bit, max */
98 #define P_CALL_PREG_MAX 0x0067
99 /* call (pc+preg), 16-bit, min */
100 #define P_CALL_PC_PLUS_PREG_MIN 0x0070
101 /* call (pc+preg), 16-bit, max */
102 #define P_CALL_PC_PLUS_PREG_MAX 0x0077
103 /* call pcrel25m2, 32-bit, min */
104 #define P_CALL_MIN 0xE300
105 /* call pcrel25m2, 32-bit, max */
106 #define P_CALL_MAX 0xE3FF
107 /* RTS */
108 #define P_RTS 0x0010
109 /* MNOP */
110 #define P_MNOP 0xC803
111 /* EXCPT, 16-bit, min */
112 #define P_EXCPT_MIN 0x00A0
113 /* EXCPT, 16-bit, max */
114 #define P_EXCPT_MAX 0x00AF
115 /* multi instruction mask 1, 16-bit */
116 #define P_BIT_MULTI_INS_1 0xC000
117 /* multi instruction mask 2, 16-bit */
118 #define P_BIT_MULTI_INS_2 0x0800
119
120 /* The maximum bytes we search to skip the prologue. */
121 #define UPPER_LIMIT 40
122
123 /* ASTAT bits */
124 #define ASTAT_CC_POS 5
125 #define ASTAT_CC (1 << ASTAT_CC_POS)
126
127 /* Initial value: Register names used in BFIN's ISA documentation. */
128
129 static const char * const bfin_register_name_strings[] =
130 {
131 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
132 "p0", "p1", "p2", "p3", "p4", "p5", "sp", "fp",
133 "i0", "i1", "i2", "i3", "m0", "m1", "m2", "m3",
134 "b0", "b1", "b2", "b3", "l0", "l1", "l2", "l3",
135 "a0x", "a0w", "a1x", "a1w", "astat", "rets",
136 "lc0", "lt0", "lb0", "lc1", "lt1", "lb1", "cycles", "cycles2",
137 "usp", "seqstat", "syscfg", "reti", "retx", "retn", "rete",
138 "pc", "cc",
139 };
140
141 #define NUM_BFIN_REGNAMES ARRAY_SIZE (bfin_register_name_strings)
142
143
144 /* In this diagram successive memory locations increase downwards or the
145 stack grows upwards with negative indices. (PUSH analogy for stack.)
146
147 The top frame is the "frame" of the current function being executed.
148
149 +--------------+ SP -
150 | local vars | ^
151 +--------------+ |
152 | save regs | |
153 +--------------+ FP |
154 | old FP -|-- top
155 +--------------+ | frame
156 | RETS | | |
157 +--------------+ | |
158 | param 1 | | |
159 | param 2 | | |
160 | ... | | V
161 +--------------+ | -
162 | local vars | | ^
163 +--------------+ | |
164 | save regs | | |
165 +--------------+<- |
166 | old FP -|-- next
167 +--------------+ | frame
168 | RETS | | |
169 +--------------+ | |
170 | param 1 | | |
171 | param 2 | | |
172 | ... | | V
173 +--------------+ | -
174 | local vars | | ^
175 +--------------+ | |
176 | save regs | | |
177 +--------------+<- next frame
178 | old FP | |
179 +--------------+ |
180 | RETS | V
181 +--------------+ -
182
183 The frame chain is formed as following:
184
185 FP has the topmost frame.
186 FP + 4 has the previous FP and so on. */
187
188
189 /* Map from DWARF2 register number to GDB register number. */
190
191 static const int map_gcc_gdb[] =
192 {
193 BFIN_R0_REGNUM,
194 BFIN_R1_REGNUM,
195 BFIN_R2_REGNUM,
196 BFIN_R3_REGNUM,
197 BFIN_R4_REGNUM,
198 BFIN_R5_REGNUM,
199 BFIN_R6_REGNUM,
200 BFIN_R7_REGNUM,
201 BFIN_P0_REGNUM,
202 BFIN_P1_REGNUM,
203 BFIN_P2_REGNUM,
204 BFIN_P3_REGNUM,
205 BFIN_P4_REGNUM,
206 BFIN_P5_REGNUM,
207 BFIN_SP_REGNUM,
208 BFIN_FP_REGNUM,
209 BFIN_I0_REGNUM,
210 BFIN_I1_REGNUM,
211 BFIN_I2_REGNUM,
212 BFIN_I3_REGNUM,
213 BFIN_B0_REGNUM,
214 BFIN_B1_REGNUM,
215 BFIN_B2_REGNUM,
216 BFIN_B3_REGNUM,
217 BFIN_L0_REGNUM,
218 BFIN_L1_REGNUM,
219 BFIN_L2_REGNUM,
220 BFIN_L3_REGNUM,
221 BFIN_M0_REGNUM,
222 BFIN_M1_REGNUM,
223 BFIN_M2_REGNUM,
224 BFIN_M3_REGNUM,
225 BFIN_A0_DOT_X_REGNUM,
226 BFIN_A1_DOT_X_REGNUM,
227 BFIN_CC_REGNUM,
228 BFIN_RETS_REGNUM,
229 BFIN_RETI_REGNUM,
230 BFIN_RETX_REGNUM,
231 BFIN_RETN_REGNUM,
232 BFIN_RETE_REGNUM,
233 BFIN_ASTAT_REGNUM,
234 BFIN_SEQSTAT_REGNUM,
235 BFIN_USP_REGNUM,
236 BFIN_LT0_REGNUM,
237 BFIN_LT1_REGNUM,
238 BFIN_LC0_REGNUM,
239 BFIN_LC1_REGNUM,
240 BFIN_LB0_REGNUM,
241 BFIN_LB1_REGNUM
242 };
243
244 /* Big enough to hold the size of the largest register in bytes. */
245 #define BFIN_MAX_REGISTER_SIZE 4
246
247 struct bfin_frame_cache
248 {
249 /* Base address. */
250 CORE_ADDR base;
251 CORE_ADDR sp_offset;
252 CORE_ADDR pc;
253 int frameless_pc_value;
254
255 /* Saved registers. */
256 CORE_ADDR saved_regs[BFIN_NUM_REGS];
257 CORE_ADDR saved_sp;
258
259 /* Stack space reserved for local variables. */
260 long locals;
261 };
262
263 /* Allocate and initialize a frame cache. */
264
265 static struct bfin_frame_cache *
266 bfin_alloc_frame_cache (void)
267 {
268 struct bfin_frame_cache *cache;
269 int i;
270
271 cache = FRAME_OBSTACK_ZALLOC (struct bfin_frame_cache);
272
273 /* Base address. */
274 cache->base = 0;
275 cache->sp_offset = -4;
276 cache->pc = 0;
277 cache->frameless_pc_value = 0;
278
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;
283
284 /* Frameless until proven otherwise. */
285 cache->locals = -1;
286
287 return cache;
288 }
289
290 static struct bfin_frame_cache *
291 bfin_frame_cache (struct frame_info *this_frame, void **this_cache)
292 {
293 struct bfin_frame_cache *cache;
294 int i;
295
296 if (*this_cache)
297 return (struct bfin_frame_cache *) *this_cache;
298
299 cache = bfin_alloc_frame_cache ();
300 *this_cache = cache;
301
302 cache->base = get_frame_register_unsigned (this_frame, BFIN_FP_REGNUM);
303 if (cache->base == 0)
304 return cache;
305
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;
309
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;
315
316 cache->pc = get_frame_func (this_frame) ;
317 if (cache->pc == 0 || cache->pc == get_frame_pc (this_frame))
318 {
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. */
322
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;
329 }
330 else
331 {
332 cache->frameless_pc_value = 0;
333
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;
337 }
338
339 return cache;
340 }
341
342 static void
343 bfin_frame_this_id (struct frame_info *this_frame,
344 void **this_cache,
345 struct frame_id *this_id)
346 {
347 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
348
349 /* This marks the outermost frame. */
350 if (cache->base == 0)
351 return;
352
353 /* See the end of bfin_push_dummy_call. */
354 *this_id = frame_id_build (cache->base + 8, cache->pc);
355 }
356
357 static struct value *
358 bfin_frame_prev_register (struct frame_info *this_frame,
359 void **this_cache,
360 int regnum)
361 {
362 struct gdbarch *gdbarch = get_frame_arch (this_frame);
363 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
364
365 if (regnum == gdbarch_sp_regnum (gdbarch) && cache->saved_sp)
366 return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
367
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]);
371
372 return frame_unwind_got_register (this_frame, regnum, regnum);
373 }
374
375 static const struct frame_unwind bfin_frame_unwind =
376 {
377 NORMAL_FRAME,
378 default_frame_unwind_stop_reason,
379 bfin_frame_this_id,
380 bfin_frame_prev_register,
381 NULL,
382 default_frame_sniffer
383 };
384
385 /* Check for "[--SP] = <reg>;" insns. These are appear in function
386 prologues to save misc registers onto the stack. */
387
388 static int
389 is_minus_minus_sp (int op)
390 {
391 op &= 0xFFC0;
392
393 if ((op == P_MINUS_SP1) || (op == P_MINUS_SP2)
394 || (op == P_MINUS_SP3) || (op == P_MINUS_SP4))
395 return 1;
396
397 return 0;
398 }
399
400 /* Skip all the insns that appear in generated function prologues. */
401
402 static CORE_ADDR
403 bfin_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
404 {
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;
408 int done = 0;
409
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! */
414
415 while (!done)
416 {
417 if (is_minus_minus_sp (op))
418 {
419 while (is_minus_minus_sp (op))
420 {
421 pc += 2;
422 op = read_memory_unsigned_integer (pc, 2, byte_order);
423 }
424
425 if (op == P_LINKAGE)
426 pc += 4;
427
428 done = 1;
429 }
430 else if (op == P_LINKAGE)
431 {
432 pc += 4;
433 done = 1;
434 }
435 else if (op == P_MINUS_MINUS_SP_EQ_RETS)
436 {
437 pc += 2;
438 done = 1;
439 }
440 else if (op == P_RTS)
441 {
442 done = 1;
443 }
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))
448 {
449 done = 1;
450 }
451 else if (pc - orig_pc >= UPPER_LIMIT)
452 {
453 warning (_("Function Prologue not recognised; "
454 "pc will point to ENTRY_POINT of the function"));
455 pc = orig_pc + 2;
456 done = 1;
457 }
458 else
459 {
460 pc += 2; /* Not a terminating instruction go on. */
461 op = read_memory_unsigned_integer (pc, 2, byte_order);
462 }
463 }
464
465 /* TODO:
466 Dwarf2 uses entry point value AFTER some register initializations.
467 We should perhaps skip such asssignments as well (R6 = R1, ...). */
468
469 return pc;
470 }
471
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. */
475
476 static struct type *
477 bfin_register_type (struct gdbarch *gdbarch, int regnum)
478 {
479 if ((regnum >= BFIN_P0_REGNUM && regnum <= BFIN_FP_REGNUM)
480 || regnum == BFIN_USP_REGNUM)
481 return builtin_type (gdbarch)->builtin_data_ptr;
482
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;
489
490 return builtin_type (gdbarch)->builtin_int32;
491 }
492
493 static CORE_ADDR
494 bfin_push_dummy_call (struct gdbarch *gdbarch,
495 struct value *function,
496 struct regcache *regcache,
497 CORE_ADDR bp_addr,
498 int nargs,
499 struct value **args,
500 CORE_ADDR sp,
501 int struct_return,
502 CORE_ADDR struct_addr)
503 {
504 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
505 int i;
506 long reg_r0, reg_r1, reg_r2;
507 int total_len = 0;
508
509 for (i = nargs - 1; i >= 0; i--)
510 {
511 struct type *value_type = value_enclosing_type (args[i]);
512
513 total_len += (TYPE_LENGTH (value_type) + 3) & ~3;
514 }
515
516 /* At least twelve bytes of stack space must be allocated for the function's
517 arguments, even for functions that have less than 12 bytes of argument
518 data. */
519
520 if (total_len < 12)
521 sp -= 12 - total_len;
522
523 /* Push arguments in reverse order. */
524
525 for (i = nargs - 1; i >= 0; i--)
526 {
527 struct type *value_type = value_enclosing_type (args[i]);
528 struct type *arg_type = check_typedef (value_type);
529 int container_len = (TYPE_LENGTH (value_type) + 3) & ~3;
530
531 sp -= container_len;
532 write_memory (sp, value_contents (args[i]), container_len);
533 }
534
535 /* Initialize R0, R1, and R2 to the first 3 words of parameters. */
536
537 reg_r0 = read_memory_integer (sp, 4, byte_order);
538 regcache_cooked_write_unsigned (regcache, BFIN_R0_REGNUM, reg_r0);
539 reg_r1 = read_memory_integer (sp + 4, 4, byte_order);
540 regcache_cooked_write_unsigned (regcache, BFIN_R1_REGNUM, reg_r1);
541 reg_r2 = read_memory_integer (sp + 8, 4, byte_order);
542 regcache_cooked_write_unsigned (regcache, BFIN_R2_REGNUM, reg_r2);
543
544 /* Store struct value address. */
545
546 if (struct_return)
547 regcache_cooked_write_unsigned (regcache, BFIN_P0_REGNUM, struct_addr);
548
549 /* Set the dummy return value to bp_addr.
550 A dummy breakpoint will be setup to execute the call. */
551
552 regcache_cooked_write_unsigned (regcache, BFIN_RETS_REGNUM, bp_addr);
553
554 /* Finally, update the stack pointer. */
555
556 regcache_cooked_write_unsigned (regcache, BFIN_SP_REGNUM, sp);
557
558 return sp;
559 }
560
561 /* Convert DWARF2 register number REG to the appropriate register number
562 used by GDB. */
563
564 static int
565 bfin_reg_to_regnum (struct gdbarch *gdbarch, int reg)
566 {
567 if (reg < 0 || reg >= ARRAY_SIZE (map_gcc_gdb))
568 return -1;
569
570 return map_gcc_gdb[reg];
571 }
572
573 /* Implement the breakpoint_kind_from_pc gdbarch method. */
574
575 static int
576 bfin_breakpoint_kind_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr)
577 {
578 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
579 unsigned short iw;
580
581 iw = read_memory_unsigned_integer (*pcptr, 2, byte_order);
582
583 if ((iw & 0xf000) >= 0xc000)
584 /* 32-bit instruction. */
585 return 4;
586 else
587 return 2;
588 }
589
590 /* Implement the sw_breakpoint_from_kind gdbarch method. */
591
592 static const gdb_byte *
593 bfin_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
594 {
595 static unsigned char bfin_breakpoint[] = {0xa1, 0x00, 0x00, 0x00};
596 static unsigned char bfin_sim_breakpoint[] = {0x25, 0x00, 0x00, 0x00};
597
598 *size = kind;
599
600 if (strcmp (target_shortname, "sim") == 0)
601 return bfin_sim_breakpoint;
602 else
603 return bfin_breakpoint;
604 }
605
606 static void
607 bfin_extract_return_value (struct type *type,
608 struct regcache *regs,
609 gdb_byte *dst)
610 {
611 struct gdbarch *gdbarch = regs->arch ();
612 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
613 bfd_byte *valbuf = dst;
614 int len = TYPE_LENGTH (type);
615 ULONGEST tmp;
616 int regno = BFIN_R0_REGNUM;
617
618 gdb_assert (len <= 8);
619
620 while (len > 0)
621 {
622 regcache_cooked_read_unsigned (regs, regno++, &tmp);
623 store_unsigned_integer (valbuf, (len > 4 ? 4 : len), byte_order, tmp);
624 len -= 4;
625 valbuf += 4;
626 }
627 }
628
629 /* Write into appropriate registers a function return value of type
630 TYPE, given in virtual format. */
631
632 static void
633 bfin_store_return_value (struct type *type,
634 struct regcache *regs,
635 const gdb_byte *src)
636 {
637 const bfd_byte *valbuf = src;
638
639 /* Integral values greater than one word are stored in consecutive
640 registers starting with R0. This will always be a multiple of
641 the register size. */
642
643 int len = TYPE_LENGTH (type);
644 int regno = BFIN_R0_REGNUM;
645
646 gdb_assert (len <= 8);
647
648 while (len > 0)
649 {
650 regcache_cooked_write (regs, regno++, valbuf);
651 len -= 4;
652 valbuf += 4;
653 }
654 }
655
656 /* Determine, for architecture GDBARCH, how a return value of TYPE
657 should be returned. If it is supposed to be returned in registers,
658 and READBUF is nonzero, read the appropriate value from REGCACHE,
659 and copy it into READBUF. If WRITEBUF is nonzero, write the value
660 from WRITEBUF into REGCACHE. */
661
662 static enum return_value_convention
663 bfin_return_value (struct gdbarch *gdbarch,
664 struct value *function,
665 struct type *type,
666 struct regcache *regcache,
667 gdb_byte *readbuf,
668 const gdb_byte *writebuf)
669 {
670 if (TYPE_LENGTH (type) > 8)
671 return RETURN_VALUE_STRUCT_CONVENTION;
672
673 if (readbuf)
674 bfin_extract_return_value (type, regcache, readbuf);
675
676 if (writebuf)
677 bfin_store_return_value (type, regcache, writebuf);
678
679 return RETURN_VALUE_REGISTER_CONVENTION;
680 }
681
682 /* Return the BFIN register name corresponding to register I. */
683
684 static const char *
685 bfin_register_name (struct gdbarch *gdbarch, int i)
686 {
687 return bfin_register_name_strings[i];
688 }
689
690 static enum register_status
691 bfin_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
692 int regnum, gdb_byte *buffer)
693 {
694 gdb_byte buf[BFIN_MAX_REGISTER_SIZE];
695 enum register_status status;
696
697 if (regnum != BFIN_CC_REGNUM)
698 internal_error (__FILE__, __LINE__,
699 _("invalid register number %d"), regnum);
700
701 /* Extract the CC bit from the ASTAT register. */
702 status = regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
703 if (status == REG_VALID)
704 {
705 buffer[1] = buffer[2] = buffer[3] = 0;
706 buffer[0] = !!(buf[0] & ASTAT_CC);
707 }
708 return status;
709 }
710
711 static void
712 bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
713 int regnum, const gdb_byte *buffer)
714 {
715 gdb_byte buf[BFIN_MAX_REGISTER_SIZE];
716
717 if (regnum != BFIN_CC_REGNUM)
718 internal_error (__FILE__, __LINE__,
719 _("invalid register number %d"), regnum);
720
721 /* Overlay the CC bit in the ASTAT register. */
722 regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
723 buf[0] = (buf[0] & ~ASTAT_CC) | ((buffer[0] & 1) << ASTAT_CC_POS);
724 regcache_raw_write (regcache, BFIN_ASTAT_REGNUM, buf);
725 }
726
727 static CORE_ADDR
728 bfin_frame_base_address (struct frame_info *this_frame, void **this_cache)
729 {
730 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
731
732 return cache->base;
733 }
734
735 static CORE_ADDR
736 bfin_frame_local_address (struct frame_info *this_frame, void **this_cache)
737 {
738 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
739
740 return cache->base - 4;
741 }
742
743 static CORE_ADDR
744 bfin_frame_args_address (struct frame_info *this_frame, void **this_cache)
745 {
746 struct bfin_frame_cache *cache = bfin_frame_cache (this_frame, this_cache);
747
748 return cache->base + 8;
749 }
750
751 static const struct frame_base bfin_frame_base =
752 {
753 &bfin_frame_unwind,
754 bfin_frame_base_address,
755 bfin_frame_local_address,
756 bfin_frame_args_address
757 };
758
759 static struct frame_id
760 bfin_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
761 {
762 CORE_ADDR sp;
763
764 sp = get_frame_register_unsigned (this_frame, BFIN_SP_REGNUM);
765
766 return frame_id_build (sp, get_frame_pc (this_frame));
767 }
768
769 static CORE_ADDR
770 bfin_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
771 {
772 return frame_unwind_register_unsigned (next_frame, BFIN_PC_REGNUM);
773 }
774
775 static CORE_ADDR
776 bfin_frame_align (struct gdbarch *gdbarch, CORE_ADDR address)
777 {
778 return (address & ~0x3);
779 }
780
781 enum bfin_abi
782 bfin_abi (struct gdbarch *gdbarch)
783 {
784 return gdbarch_tdep (gdbarch)->bfin_abi;
785 }
786
787 /* Initialize the current architecture based on INFO. If possible,
788 re-use an architecture from ARCHES, which is a list of
789 architectures already created during this debugging session.
790
791 Called e.g. at program startup, when reading a core file, and when
792 reading a binary file. */
793
794 static struct gdbarch *
795 bfin_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
796 {
797 struct gdbarch_tdep *tdep;
798 struct gdbarch *gdbarch;
799 enum bfin_abi abi;
800
801 abi = BFIN_ABI_FLAT;
802
803 /* If there is already a candidate, use it. */
804
805 for (arches = gdbarch_list_lookup_by_info (arches, &info);
806 arches != NULL;
807 arches = gdbarch_list_lookup_by_info (arches->next, &info))
808 {
809 if (gdbarch_tdep (arches->gdbarch)->bfin_abi != abi)
810 continue;
811 return arches->gdbarch;
812 }
813
814 tdep = XCNEW (struct gdbarch_tdep);
815 gdbarch = gdbarch_alloc (&info, tdep);
816
817 tdep->bfin_abi = abi;
818
819 set_gdbarch_num_regs (gdbarch, BFIN_NUM_REGS);
820 set_gdbarch_pseudo_register_read (gdbarch, bfin_pseudo_register_read);
821 set_gdbarch_pseudo_register_write (gdbarch, bfin_pseudo_register_write);
822 set_gdbarch_num_pseudo_regs (gdbarch, BFIN_NUM_PSEUDO_REGS);
823 set_gdbarch_sp_regnum (gdbarch, BFIN_SP_REGNUM);
824 set_gdbarch_pc_regnum (gdbarch, BFIN_PC_REGNUM);
825 set_gdbarch_ps_regnum (gdbarch, BFIN_ASTAT_REGNUM);
826 set_gdbarch_dwarf2_reg_to_regnum (gdbarch, bfin_reg_to_regnum);
827 set_gdbarch_register_name (gdbarch, bfin_register_name);
828 set_gdbarch_register_type (gdbarch, bfin_register_type);
829 set_gdbarch_dummy_id (gdbarch, bfin_dummy_id);
830 set_gdbarch_push_dummy_call (gdbarch, bfin_push_dummy_call);
831 set_gdbarch_believe_pcc_promotion (gdbarch, 1);
832 set_gdbarch_return_value (gdbarch, bfin_return_value);
833 set_gdbarch_skip_prologue (gdbarch, bfin_skip_prologue);
834 set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
835 set_gdbarch_breakpoint_kind_from_pc (gdbarch, bfin_breakpoint_kind_from_pc);
836 set_gdbarch_sw_breakpoint_from_kind (gdbarch, bfin_sw_breakpoint_from_kind);
837 set_gdbarch_decr_pc_after_break (gdbarch, 2);
838 set_gdbarch_frame_args_skip (gdbarch, 8);
839 set_gdbarch_unwind_pc (gdbarch, bfin_unwind_pc);
840 set_gdbarch_frame_align (gdbarch, bfin_frame_align);
841
842 /* Hook in ABI-specific overrides, if they have been registered. */
843 gdbarch_init_osabi (info, gdbarch);
844
845 dwarf2_append_unwinders (gdbarch);
846
847 frame_base_set_default (gdbarch, &bfin_frame_base);
848
849 frame_unwind_append_unwinder (gdbarch, &bfin_frame_unwind);
850
851 return gdbarch;
852 }
853
854 void
855 _initialize_bfin_tdep (void)
856 {
857 register_gdbarch_init (bfd_arch_bfin, bfin_gdbarch_init);
858 }
BFIN_P0_REGNUM
Definition: bfin-tdep.h:32
set_gdbarch_num_regs
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
Definition: gdbarch.c:2050
gdbarch
Definition: gdbarch.c:127
set_gdbarch_frame_align
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
Definition: gdbarch.c:3151
BFIN_LC1_REGNUM
Definition: bfin-tdep.h:65
P_JUMP_PREG_MAX
#define P_JUMP_PREG_MAX
Definition: bfin-tdep.c:66
bfin_reg_to_regnum
static int bfin_reg_to_regnum(struct gdbarch *gdbarch, int reg)
Definition: bfin-tdep.c:565
BFIN_FP_REGNUM
Definition: bfin-tdep.h:39
BFIN_B1_REGNUM
Definition: bfin-tdep.h:49
set_gdbarch_ps_regnum
void set_gdbarch_ps_regnum(struct gdbarch *gdbarch, int ps_regnum)
Definition: gdbarch.c:2190
bfin_frame_cache::base
CORE_ADDR base
Definition: bfin-tdep.c:250
frame_id_build
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition: frame.c:624
BFIN_A1_DOT_X_REGNUM
Definition: bfin-tdep.h:58
BFIN_R3_REGNUM
Definition: bfin-tdep.h:27
REG_VALID
Definition: common-regcache.h:32
BFIN_R2_REGNUM
Definition: bfin-tdep.h:26
builtin_type::builtin_func_ptr
struct type * builtin_func_ptr
Definition: gdbtypes.h:1565
get_frame_pc
CORE_ADDR get_frame_pc(struct frame_info *frame)
Definition: frame.c:2376
bfin_frame_args_address
static CORE_ADDR bfin_frame_args_address(struct frame_info *this_frame, void **this_cache)
Definition: bfin-tdep.c:744
BFIN_I0_REGNUM
Definition: bfin-tdep.h:40
P_MINUS_SP2
#define P_MINUS_SP2
Definition: bfin-tdep.c:46
infcall.h
BFIN_NUM_REGS
#define BFIN_NUM_REGS
Definition: bfin-tdep.h:84
CORE_ADDR
bfd_vma CORE_ADDR
Definition: common-types.h:41
gdbarch_init_osabi
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: osabi.c:334
bfin_store_return_value
static void bfin_store_return_value(struct type *type, struct regcache *regs, const gdb_byte *src)
Definition: bfin-tdep.c:633
target_shortname
#define target_shortname
Definition: target.h:1279
bfin_extract_return_value
static void bfin_extract_return_value(struct type *type, struct regcache *regs, gdb_byte *dst)
Definition: bfin-tdep.c:607
BFIN_R6_REGNUM
Definition: bfin-tdep.h:30
bfin_register_name
static const char * bfin_register_name(struct gdbarch *gdbarch, int i)
Definition: bfin-tdep.c:685
BFIN_P2_REGNUM
Definition: bfin-tdep.h:34
frame_unwind_got_memory
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
Definition: frame-unwind.c:233
warning
void warning(const char *fmt,...)
Definition: errors.c:26
bfin_frame_align
static CORE_ADDR bfin_frame_align(struct gdbarch *gdbarch, CORE_ADDR address)
Definition: bfin-tdep.c:776
gdbarch::tdep
struct gdbarch_tdep * tdep
Definition: gdbarch.c:143
P_RTS
#define P_RTS
Definition: bfin-tdep.c:108
bfin_push_dummy_call
static CORE_ADDR bfin_push_dummy_call(struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
Definition: bfin-tdep.c:494
value_enclosing_type
struct type * value_enclosing_type(const struct value *value)
Definition: value.c:1175
bfin_frame_cache::sp_offset
CORE_ADDR sp_offset
Definition: bfin-tdep.c:251
RETURN_VALUE_STRUCT_CONVENTION
Definition: defs.h:258
frame_unwind_register_unsigned
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1279
BFIN_RETI_REGNUM
Definition: bfin-tdep.h:73
builtin_type
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
Definition: gdbtypes.c:5217
BFIN_LB1_REGNUM
Definition: bfin-tdep.h:67
internal_error
void internal_error(const char *file, int line, const char *fmt,...)
Definition: errors.c:50
gdbarch_tdep
Definition: aarch64-tdep.h:55
bfin_frame_cache::locals
long locals
Definition: bfin-tdep.c:260
return_value_convention
return_value_convention
Definition: defs.h:247
bfin_abi
bfin_abi
Definition: bfin-tdep.h:88
BFIN_I2_REGNUM
Definition: bfin-tdep.h:42
P_JUMP_PREG_MIN
#define P_JUMP_PREG_MIN
Definition: bfin-tdep.c:64
frame_info
Definition: frame.c:85
gdbarch_list_lookup_by_info
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
Definition: gdbarch.c:5309
register_status
register_status
Definition: common-regcache.h:25
is_minus_minus_sp
static int is_minus_minus_sp(int op)
Definition: bfin-tdep.c:389
gdbarch_list::next
struct gdbarch_list * next
Definition: gdbarch.h:1623
bfin_gdbarch_init
static struct gdbarch * bfin_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
Definition: bfin-tdep.c:795
_
#define _(String)
Definition: gdb_locale.h:35
BFIN_A0_DOT_X_REGNUM
Definition: bfin-tdep.h:56
set_gdbarch_dwarf2_reg_to_regnum
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
Definition: gdbarch.c:2275
defs.h
gdbarch_tdep
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
Definition: gdbarch.c:1491
bfin_breakpoint_kind_from_pc
static int bfin_breakpoint_kind_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr)
Definition: bfin-tdep.c:576
frame_unwind_append_unwinder
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
Definition: frame-unwind.c:79
builtin_type::builtin_int32
struct type * builtin_int32
Definition: gdbtypes.h:1538
bfin_frame_cache::saved_regs
CORE_ADDR saved_regs[BFIN_NUM_REGS]
Definition: bfin-tdep.c:256
FRAME_OBSTACK_ZALLOC
#define FRAME_OBSTACK_ZALLOC(TYPE)
Definition: frame.h:678
arch-utils.h
frame_unwind_got_constant
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
Definition: frame-unwind.c:246
BFIN_M1_REGNUM
Definition: bfin-tdep.h:45
BFIN_P4_REGNUM
Definition: bfin-tdep.h:36
bfin_abi
enum bfin_abi bfin_abi(struct gdbarch *gdbarch)
Definition: bfin-tdep.c:782
bfin_frame_cache::saved_sp
CORE_ADDR saved_sp
Definition: bfin-tdep.c:257
bfin_skip_prologue
static CORE_ADDR bfin_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition: bfin-tdep.c:403
symtab.h
bfin_frame_cache::frameless_pc_value
int frameless_pc_value
Definition: bfin-tdep.c:253
BFIN_P3_REGNUM
Definition: bfin-tdep.h:35
frame_base_set_default
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
Definition: frame-base.c:95
BFIN_RETS_REGNUM
Definition: bfin-tdep.h:61
set_gdbarch_pseudo_register_write
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype pseudo_register_write)
Definition: gdbarch.c:2032
P_JUMP_S_MIN
#define P_JUMP_S_MIN
Definition: bfin-tdep.c:72
set_gdbarch_register_type
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
Definition: gdbarch.c:2316
check_typedef
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:2421
bfin_frame_cache
static struct bfin_frame_cache * bfin_frame_cache(struct frame_info *this_frame, void **this_cache)
Definition: bfin-tdep.c:291
read_memory_integer
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:316
NORMAL_FRAME
Definition: frame.h:244
value_contents
const gdb_byte * value_contents(struct value *value)
Definition: value.c:1407
BFIN_R5_REGNUM
Definition: bfin-tdep.h:29
bfin_frame_cache::pc
CORE_ADDR pc
Definition: bfin-tdep.c:252
BFIN_USP_REGNUM
Definition: bfin-tdep.h:70
gdbarch_sp_regnum
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
Definition: gdbarch.c:2146
trad-frame.h
bfin_sw_breakpoint_from_kind
static const gdb_byte * bfin_sw_breakpoint_from_kind(struct gdbarch *gdbarch, int kind, int *size)
Definition: bfin-tdep.c:593
BFIN_L0_REGNUM
Definition: bfin-tdep.h:52
regcache_cooked_read_unsigned
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
Definition: regcache.c:777
osabi.h
regcache.h
set_gdbarch_sp_regnum
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
Definition: gdbarch.c:2156
set_gdbarch_decr_pc_after_break
void set_gdbarch_decr_pc_after_break(struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break)
Definition: gdbarch.c:2980
bfin_pseudo_register_read
static enum register_status bfin_pseudo_register_read(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, gdb_byte *buffer)
Definition: bfin-tdep.c:691
set_gdbarch_dummy_id
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
Definition: gdbarch.c:2340
_initialize_bfin_tdep
void _initialize_bfin_tdep(void)
Definition: bfin-tdep.c:855
map_gcc_gdb
static const int map_gcc_gdb[]
Definition: bfin-tdep.c:191
bfin_frame_this_id
static void bfin_frame_this_id(struct frame_info *this_frame, void **this_cache, struct frame_id *this_id)
Definition: bfin-tdep.c:343
struct_return
struct_return
Definition: arm-tdep.h:88
set_gdbarch_believe_pcc_promotion
void set_gdbarch_believe_pcc_promotion(struct gdbarch *gdbarch, int believe_pcc_promotion)
Definition: gdbarch.c:2588
frame.h
BFIN_L1_REGNUM
Definition: bfin-tdep.h:53
BFIN_ABI_FLAT
Definition: bfin-tdep.h:90
bfin_frame_base_address
static CORE_ADDR bfin_frame_base_address(struct frame_info *this_frame, void **this_cache)
Definition: bfin-tdep.c:728
BFIN_M0_REGNUM
Definition: bfin-tdep.h:44
gdbarch_byte_order
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1509
inferior.h
type
Definition: gdbtypes.h:749
sim-regno.h
BFIN_M3_REGNUM
Definition: bfin-tdep.h:47
BFIN_R7_REGNUM
Definition: bfin-tdep.h:31
frame-unwind.h
set_gdbarch_unwind_pc
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
Definition: gdbarch.c:3079
BFIN_RETX_REGNUM
Definition: bfin-tdep.h:74
default_frame_sniffer
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:174
BFIN_L2_REGNUM
Definition: bfin-tdep.h:54
bfin_register_type
static struct type * bfin_register_type(struct gdbarch *gdbarch, int regnum)
Definition: bfin-tdep.c:477
status
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
Definition: gnu-nat.c:1822
BFIN_P5_REGNUM
Definition: bfin-tdep.h:37
ASTAT_CC
#define ASTAT_CC
Definition: bfin-tdep.c:125
BFIN_R0_REGNUM
Definition: bfin-tdep.h:24
BFIN_SP_REGNUM
Definition: bfin-tdep.h:38
gdbarch_list::gdbarch
struct gdbarch * gdbarch
Definition: gdbarch.h:1622
regnum
int regnum
Definition: aarch64-tdep.c:77
frame_base
Definition: frame-base.h:58
xml-syscall.h
BFIN_MAX_REGISTER_SIZE
#define BFIN_MAX_REGISTER_SIZE
Definition: bfin-tdep.c:245
get_frame_register_unsigned
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1308
BFIN_LT1_REGNUM
Definition: bfin-tdep.h:66
frame-base.h
UPPER_LIMIT
#define UPPER_LIMIT
Definition: bfin-tdep.c:121
set_gdbarch_breakpoint_kind_from_pc
void set_gdbarch_breakpoint_kind_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_kind_from_pc_ftype breakpoint_kind_from_pc)
Definition: gdbarch.c:2871
set_gdbarch_frame_args_skip
void set_gdbarch_frame_args_skip(struct gdbarch *gdbarch, CORE_ADDR frame_args_skip)
Definition: gdbarch.c:3055
bfin_frame_base
static const struct frame_base bfin_frame_base
Definition: bfin-tdep.c:751
BFIN_ASTAT_REGNUM
Definition: bfin-tdep.h:60
reg
Definition: regdef.h:22
BFIN_R1_REGNUM
Definition: bfin-tdep.h:25
gdb_assert
#define gdb_assert(expr)
Definition: gdb_assert.h:32
value
Definition: value.c:169
P_JUMP_PC_PLUS_PREG_MIN
#define P_JUMP_PC_PLUS_PREG_MIN
Definition: bfin-tdep.c:68
BFIN_I3_REGNUM
Definition: bfin-tdep.h:43
bfin_return_value
static enum return_value_convention bfin_return_value(struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
Definition: bfin-tdep.c:663
BFIN_LT0_REGNUM
Definition: bfin-tdep.h:63
core_addr_lessthan
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
Definition: arch-utils.c:117
gdb_byte
bfd_byte gdb_byte
Definition: common-types.h:38
BFIN_RETN_REGNUM
Definition: bfin-tdep.h:75
bfin_frame_prev_register
static struct value * bfin_frame_prev_register(struct frame_info *this_frame, void **this_cache, int regnum)
Definition: bfin-tdep.c:358
bfin_frame_local_address
static CORE_ADDR bfin_frame_local_address(struct frame_info *this_frame, void **this_cache)
Definition: bfin-tdep.c:736
set_gdbarch_pseudo_register_read
void set_gdbarch_pseudo_register_read(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype pseudo_register_read)
Definition: gdbarch.c:1984
BFIN_B0_REGNUM
Definition: bfin-tdep.h:48
bfin_pseudo_register_write
static void bfin_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buffer)
Definition: bfin-tdep.c:712
dwarf2-frame.h
XCNEW
#define XCNEW(T)
Definition: poison.h:121
gdbcore.h
P_JUMP_PC_PLUS_PREG_MAX
#define P_JUMP_PC_PLUS_PREG_MAX
Definition: bfin-tdep.c:70
P_MINUS_MINUS_SP_EQ_RETS
#define P_MINUS_MINUS_SP_EQ_RETS
Definition: bfin-tdep.c:54
regcache_raw_read
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
Definition: regcache.c:565
regcache_cooked_write_unsigned
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
Definition: regcache.c:806
frame_unwind_got_register
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
Definition: frame-unwind.c:223
BFIN_R4_REGNUM
Definition: bfin-tdep.h:28
P_MINUS_SP4
#define P_MINUS_SP4
Definition: bfin-tdep.c:48
BFIN_I1_REGNUM
Definition: bfin-tdep.h:41
builtin_type::builtin_data_ptr
struct type * builtin_data_ptr
Definition: gdbtypes.h:1554
gdbarch_tdep::bfin_abi
enum bfin_abi bfin_abi
Definition: bfin-tdep.h:97
bfin_register_name_strings
static const char *const bfin_register_name_strings[]
Definition: bfin-tdep.c:129
buffer
Definition: buffer.h:23
set_gdbarch_num_pseudo_regs
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
Definition: gdbarch.c:2067
regcache::arch
gdbarch * arch() const
Definition: regcache.c:221
dwarf2_append_unwinders
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
Definition: dwarf2-frame.c:1384
frame_unwind
Definition: frame-unwind.h:144
BFIN_RETE_REGNUM
Definition: bfin-tdep.h:76
BFIN_M2_REGNUM
Definition: bfin-tdep.h:46
bfin_alloc_frame_cache
static struct bfin_frame_cache * bfin_alloc_frame_cache(void)
Definition: bfin-tdep.c:266
ULONGEST
unsigned long long ULONGEST
Definition: common-types.h:53
default_frame_unwind_stop_reason
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:184
BFIN_P1_REGNUM
Definition: bfin-tdep.h:33
bfin_dummy_id
static struct frame_id bfin_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
Definition: bfin-tdep.c:760
regcache
Definition: regcache.h:232
gdbarch_info
Definition: gdbarch.h:1626
value_type
struct type * value_type(const struct value *value)
Definition: value.c:1095
BFIN_L3_REGNUM
Definition: bfin-tdep.h:55
BFIN_NUM_PSEUDO_REGS
#define BFIN_NUM_PSEUDO_REGS
Definition: bfin-tdep.h:85
set_gdbarch_return_value
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
Definition: gdbarch.c:2738
bfin_unwind_pc
static CORE_ADDR bfin_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
Definition: bfin-tdep.c:770
TYPE_LENGTH
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1235
P_JUMP_S_MAX
#define P_JUMP_S_MAX
Definition: bfin-tdep.c:74
set_gdbarch_push_dummy_call
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
Definition: gdbarch.c:2381
BFIN_LB0_REGNUM
Definition: bfin-tdep.h:64
P_MINUS_SP1
#define P_MINUS_SP1
Definition: bfin-tdep.c:45
read_memory_unsigned_integer
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:326
set_gdbarch_sw_breakpoint_from_kind
void set_gdbarch_sw_breakpoint_from_kind(struct gdbarch *gdbarch, gdbarch_sw_breakpoint_from_kind_ftype sw_breakpoint_from_kind)
Definition: gdbarch.c:2888
register_gdbarch_init
void register_gdbarch_init(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init)
Definition: gdbarch.c:5299
write_memory
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
Definition: corefile.c:394
set_gdbarch_skip_prologue
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype skip_prologue)
Definition: gdbarch.c:2772
bfin_frame_cache
Definition: bfin-tdep.c:247
RETURN_VALUE_REGISTER_CONVENTION
Definition: defs.h:251
gdbarch::byte_order
enum bfd_endian byte_order
Definition: gdbarch.c:137
ASTAT_CC_POS
#define ASTAT_CC_POS
Definition: bfin-tdep.c:124
BFIN_SEQSTAT_REGNUM
Definition: bfin-tdep.h:71
set_gdbarch_pc_regnum
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
Definition: gdbarch.c:2173
BFIN_PC_REGNUM
Definition: bfin-tdep.h:79
set_gdbarch_register_name
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype register_name)
Definition: gdbarch.c:2292
get_frame_func
CORE_ADDR get_frame_func(struct frame_info *this_frame)
Definition: frame.c:1001
size
size_t size
Definition: go32-nat.c:242
gdbarch_alloc
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, struct gdbarch_tdep *tdep)
Definition: gdbarch.c:361
set_gdbarch_inner_than
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype inner_than)
Definition: gdbarch.c:2837
P_LINKAGE
#define P_LINKAGE
Definition: bfin-tdep.c:44
bfin-tdep.h
BFIN_CC_REGNUM
Definition: bfin-tdep.h:82
frame_id
Definition: frame.h:111
get_frame_arch
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
Definition: frame.c:2691
bfin_frame_unwind
static const struct frame_unwind bfin_frame_unwind
Definition: bfin-tdep.c:375
regcache_cooked_write
void regcache_cooked_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
Definition: regcache.c:873
BFIN_B3_REGNUM
Definition: bfin-tdep.h:51
store_unsigned_integer
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
Definition: defs.h:604
BFIN_LC0_REGNUM
Definition: bfin-tdep.h:62
regcache_raw_write
void regcache_raw_write(struct regcache *regcache, int regnum, const gdb_byte *buf)
Definition: regcache.c:831
BFIN_B2_REGNUM
Definition: bfin-tdep.h:50
gdbarch_list
Definition: gdbarch.h:1620
P_MINUS_SP3
#define P_MINUS_SP3
Definition: bfin-tdep.c:47