GDB (xrefs)
/tmp/gdb-7.10/gdb/ft32-tdep.c
Go to the documentation of this file.
1 /* Target-dependent code for FT32.
2 
3  Copyright (C) 2009-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
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.
11 
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.
16 
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/>. */
19 
20 #include "defs.h"
21 #include "frame.h"
22 #include "frame-unwind.h"
23 #include "frame-base.h"
24 #include "symtab.h"
25 #include "gdbtypes.h"
26 #include "gdbcmd.h"
27 #include "gdbcore.h"
28 #include "value.h"
29 #include "inferior.h"
30 #include "symfile.h"
31 #include "objfiles.h"
32 #include "osabi.h"
33 #include "language.h"
34 #include "arch-utils.h"
35 #include "regcache.h"
36 #include "trad-frame.h"
37 #include "dis-asm.h"
38 #include "record.h"
39 
40 #include "ft32-tdep.h"
41 #include "gdb/sim-ft32.h"
42 
43 #define RAM_BIAS 0x800000 /* Bias added to RAM addresses. */
44 
45 /* Local functions. */
46 
47 extern void _initialize_ft32_tdep (void);
48 
49 /* Use an invalid address -1 as 'not available' marker. */
50 enum { REG_UNAVAIL = (CORE_ADDR) (-1) };
51 
53 {
54  /* Base address of the frame */
56  /* Function this frame belongs to */
58  /* Total size of this frame */
60  /* Saved registers in this frame */
61  CORE_ADDR saved_regs[FT32_NUM_REGS];
62  /* Saved SP in this frame */
64  /* Has the new frame been LINKed. */
65  bfd_boolean established;
66 };
67 
68 /* Implement the "frame_align" gdbarch method. */
69 
70 static CORE_ADDR
71 ft32_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
72 {
73  /* Align to the size of an instruction (so that they can safely be
74  pushed onto the stack. */
75  return sp & ~1;
76 }
77 
78 /* Implement the "breakpoint_from_pc" gdbarch method. */
79 
80 static const unsigned char *
81 ft32_breakpoint_from_pc (struct gdbarch *gdbarch,
82  CORE_ADDR *pcptr, int *lenptr)
83 {
84  static const gdb_byte breakpoint[] = { 0x02, 0x00, 0x34, 0x00 };
85 
86  *lenptr = sizeof (breakpoint);
87  return breakpoint;
88 }
89 
90 /* FT32 register names. */
91 
92 static const char *const ft32_register_names[] =
93 {
94  "fp", "sp",
95  "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
96  "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
97  "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
98  "r24", "r25", "r26", "r27", "r28", "cc",
99  "pc"
100 };
101 
102 /* Implement the "register_name" gdbarch method. */
103 
104 static const char *
105 ft32_register_name (struct gdbarch *gdbarch, int reg_nr)
106 {
107  if (reg_nr < 0)
108  return NULL;
109  if (reg_nr >= FT32_NUM_REGS)
110  return NULL;
111  return ft32_register_names[reg_nr];
112 }
113 
114 /* Implement the "register_type" gdbarch method. */
115 
116 static struct type *
117 ft32_register_type (struct gdbarch *gdbarch, int reg_nr)
118 {
119  if (reg_nr == FT32_PC_REGNUM)
120  return builtin_type (gdbarch)->builtin_func_ptr;
121  else if (reg_nr == FT32_SP_REGNUM || reg_nr == FT32_FP_REGNUM)
122  return builtin_type (gdbarch)->builtin_data_ptr;
123  else
124  return builtin_type (gdbarch)->builtin_int32;
125 }
126 
127 /* Write into appropriate registers a function return value
128  of type TYPE, given in virtual format. */
129 
130 static void
132  const gdb_byte *valbuf)
133 {
134  struct gdbarch *gdbarch = get_regcache_arch (regcache);
135  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
136  CORE_ADDR regval;
137  int len = TYPE_LENGTH (type);
138 
139  /* Things always get returned in RET1_REGNUM, RET2_REGNUM. */
140  regval = extract_unsigned_integer (valbuf, len > 4 ? 4 : len, byte_order);
141  regcache_cooked_write_unsigned (regcache, FT32_R0_REGNUM, regval);
142  if (len > 4)
143  {
144  regval = extract_unsigned_integer (valbuf + 4,
145  len - 4, byte_order);
146  regcache_cooked_write_unsigned (regcache, FT32_R1_REGNUM, regval);
147  }
148 }
149 
150 /* Decode the instructions within the given address range. Decide
151  when we must have reached the end of the function prologue. If a
152  frame_info pointer is provided, fill in its saved_regs etc.
153 
154  Returns the address of the first instruction after the prologue. */
155 
156 #define IS_PUSH(inst) (((inst) & 0xfff00000) == 0x84000000)
157 #define PUSH_REG(inst) (FT32_R0_REGNUM + (((inst) >> 15) & 0x1f))
158 #define IS_LINK(inst) (((inst) & 0xffff0000) == 0x95d00000)
159 #define LINK_SIZE(inst) ((inst) & 0xffff)
160 
161 static CORE_ADDR
163  struct ft32_frame_cache *cache,
164  struct gdbarch *gdbarch)
165 {
166  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
167  CORE_ADDR next_addr;
168  ULONGEST inst, inst2;
169  LONGEST offset;
170  int regnum;
171 
172  cache->saved_regs[FT32_PC_REGNUM] = 0;
173  cache->framesize = 0;
174 
175  if (start_addr >= end_addr)
176  return end_addr;
177 
178  cache->established = 0;
179  for (next_addr = start_addr; next_addr < end_addr; )
180  {
181  inst = read_memory_unsigned_integer (next_addr, 4, byte_order);
182 
183  if (IS_PUSH (inst))
184  {
185  regnum = PUSH_REG (inst);
186  cache->framesize += 4;
187  cache->saved_regs[regnum] = cache->framesize;
188  next_addr += 4;
189  }
190  else
191  break;
192  }
193  for (regnum = FT32_R0_REGNUM; regnum < FT32_PC_REGNUM; regnum++)
194  {
195  if (cache->saved_regs[regnum] != REG_UNAVAIL)
196  cache->saved_regs[regnum] = cache->framesize - cache->saved_regs[regnum];
197  }
198  cache->saved_regs[FT32_PC_REGNUM] = cache->framesize;
199 
200  /* It is a LINK? */
201  if (next_addr < end_addr)
202  {
203  inst = read_memory_unsigned_integer (next_addr, 4, byte_order);
204  if (IS_LINK (inst))
205  {
206  cache->established = 1;
207  for (regnum = FT32_R0_REGNUM; regnum < FT32_PC_REGNUM; regnum++)
208  {
209  if (cache->saved_regs[regnum] != REG_UNAVAIL)
210  cache->saved_regs[regnum] += 4;
211  }
212  cache->saved_regs[FT32_PC_REGNUM] = cache->framesize + 4;
213  cache->saved_regs[FT32_FP_REGNUM] = 0;
214  cache->framesize += LINK_SIZE (inst);
215  next_addr += 4;
216  }
217  }
218 
219  return next_addr;
220 }
221 
222 /* Find the end of function prologue. */
223 
224 static CORE_ADDR
225 ft32_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
226 {
227  CORE_ADDR func_addr = 0, func_end = 0;
228  const char *func_name;
229 
230  /* See if we can determine the end of the prologue via the symbol table.
231  If so, then return either PC, or the PC after the prologue, whichever
232  is greater. */
233  if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end))
234  {
235  CORE_ADDR post_prologue_pc
236  = skip_prologue_using_sal (gdbarch, func_addr);
237  if (post_prologue_pc != 0)
238  return max (pc, post_prologue_pc);
239  else
240  {
241  /* Can't determine prologue from the symbol table, need to examine
242  instructions. */
243  struct symtab_and_line sal;
244  struct symbol *sym;
245  struct ft32_frame_cache cache;
246  CORE_ADDR plg_end;
247 
248  memset (&cache, 0, sizeof cache);
249 
250  plg_end = ft32_analyze_prologue (func_addr,
251  func_end, &cache, gdbarch);
252  /* Found a function. */
253  sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL);
254  /* Don't use line number debug info for assembly source files. */
255  if ((sym != NULL) && SYMBOL_LANGUAGE (sym) != language_asm)
256  {
257  sal = find_pc_line (func_addr, 0);
258  if (sal.end && sal.end < func_end)
259  {
260  /* Found a line number, use it as end of prologue. */
261  return sal.end;
262  }
263  }
264  /* No useable line symbol. Use result of prologue parsing method. */
265  return plg_end;
266  }
267  }
268 
269  /* No function symbol -- just return the PC. */
270  return pc;
271 }
272 
273 /* Implement the "read_pc" gdbarch method. */
274 
275 static CORE_ADDR
277 {
278  ULONGEST pc;
279 
280  regcache_cooked_read_unsigned (regcache, FT32_PC_REGNUM, &pc);
281  return pc;
282 }
283 
284 /* Implement the "write_pc" gdbarch method. */
285 
286 static void
288 {
289  regcache_cooked_write_unsigned (regcache, FT32_PC_REGNUM, val);
290 }
291 
292 /* Implement the "unwind_sp" gdbarch method. */
293 
294 static CORE_ADDR
295 ft32_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
296 {
297  return frame_unwind_register_unsigned (next_frame, FT32_SP_REGNUM);
298 }
299 
300 /* Given a return value in `regbuf' with a type `valtype',
301  extract and copy its value into `valbuf'. */
302 
303 static void
305  gdb_byte *dst)
306 {
307  struct gdbarch *gdbarch = get_regcache_arch (regcache);
308  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
309  bfd_byte *valbuf = dst;
310  int len = TYPE_LENGTH (type);
311  ULONGEST tmp;
312 
313  /* By using store_unsigned_integer we avoid having to do
314  anything special for small big-endian values. */
315  regcache_cooked_read_unsigned (regcache, FT32_R0_REGNUM, &tmp);
316  store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp);
317 
318  /* Ignore return values more than 8 bytes in size because the ft32
319  returns anything more than 8 bytes in the stack. */
320  if (len > 4)
321  {
322  regcache_cooked_read_unsigned (regcache, FT32_R1_REGNUM, &tmp);
323  store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp);
324  }
325 }
326 
327 /* Implement the "return_value" gdbarch method. */
328 
329 static enum return_value_convention
330 ft32_return_value (struct gdbarch *gdbarch, struct value *function,
331  struct type *valtype, struct regcache *regcache,
332  gdb_byte *readbuf, const gdb_byte *writebuf)
333 {
334  if (TYPE_LENGTH (valtype) > 8)
336  else
337  {
338  if (readbuf != NULL)
339  ft32_extract_return_value (valtype, regcache, readbuf);
340  if (writebuf != NULL)
341  ft32_store_return_value (valtype, regcache, writebuf);
343  }
344 }
345 
346 /* Allocate and initialize a ft32_frame_cache object. */
347 
348 static struct ft32_frame_cache *
350 {
351  struct ft32_frame_cache *cache;
352  int i;
353 
354  cache = FRAME_OBSTACK_ZALLOC (struct ft32_frame_cache);
355 
356  for (i = 0; i < FT32_NUM_REGS; ++i)
357  cache->saved_regs[i] = REG_UNAVAIL;
358 
359  return cache;
360 }
361 
362 /* Populate a ft32_frame_cache object for this_frame. */
363 
364 static struct ft32_frame_cache *
365 ft32_frame_cache (struct frame_info *this_frame, void **this_cache)
366 {
367  struct ft32_frame_cache *cache;
368  CORE_ADDR current_pc;
369  int i;
370 
371  if (*this_cache)
372  return *this_cache;
373 
374  cache = ft32_alloc_frame_cache ();
375  *this_cache = cache;
376 
377  cache->base = get_frame_register_unsigned (this_frame, FT32_FP_REGNUM);
378  if (cache->base == 0)
379  return cache;
380 
381  cache->pc = get_frame_func (this_frame);
382  current_pc = get_frame_pc (this_frame);
383  if (cache->pc)
384  {
385  struct gdbarch *gdbarch = get_frame_arch (this_frame);
386 
387  ft32_analyze_prologue (cache->pc, current_pc, cache, gdbarch);
388  if (!cache->established)
389  cache->base = get_frame_register_unsigned (this_frame, FT32_SP_REGNUM);
390  }
391 
392  cache->saved_sp = cache->base - 4;
393 
394  for (i = 0; i < FT32_NUM_REGS; ++i)
395  if (cache->saved_regs[i] != REG_UNAVAIL)
396  cache->saved_regs[i] = cache->base + cache->saved_regs[i];
397 
398  return cache;
399 }
400 
401 /* Implement the "unwind_pc" gdbarch method. */
402 
403 static CORE_ADDR
404 ft32_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
405 {
406  return frame_unwind_register_unsigned (next_frame, FT32_PC_REGNUM);
407 }
408 
409 /* Given a GDB frame, determine the address of the calling function's
410  frame. This will be used to create a new GDB frame struct. */
411 
412 static void
413 ft32_frame_this_id (struct frame_info *this_frame,
414  void **this_prologue_cache, struct frame_id *this_id)
415 {
416  struct ft32_frame_cache *cache = ft32_frame_cache (this_frame,
417  this_prologue_cache);
418 
419  /* This marks the outermost frame. */
420  if (cache->base == 0)
421  return;
422 
423  *this_id = frame_id_build (cache->saved_sp, cache->pc);
424 }
425 
426 /* Get the value of register regnum in the previous stack frame. */
427 
428 static struct value *
430  void **this_prologue_cache, int regnum)
431 {
432  struct ft32_frame_cache *cache = ft32_frame_cache (this_frame,
433  this_prologue_cache);
434 
435  gdb_assert (regnum >= 0);
436 
437  if (regnum == FT32_SP_REGNUM && cache->saved_sp)
438  return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
439 
440  if (regnum < FT32_NUM_REGS && cache->saved_regs[regnum] != REG_UNAVAIL)
441  return frame_unwind_got_memory (this_frame, regnum,
442  RAM_BIAS | cache->saved_regs[regnum]);
443 
444  return frame_unwind_got_register (this_frame, regnum, regnum);
445 }
446 
447 static const struct frame_unwind ft32_frame_unwind =
448 {
449  NORMAL_FRAME,
453  NULL,
455 };
456 
457 /* Return the base address of this_frame. */
458 
459 static CORE_ADDR
460 ft32_frame_base_address (struct frame_info *this_frame, void **this_cache)
461 {
462  struct ft32_frame_cache *cache = ft32_frame_cache (this_frame,
463  this_cache);
464 
465  return cache->base;
466 }
467 
468 static const struct frame_base ft32_frame_base =
469 {
473  ft32_frame_base_address
474 };
475 
476 static struct frame_id
477 ft32_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
478 {
479  CORE_ADDR sp = get_frame_register_unsigned (this_frame, FT32_SP_REGNUM);
480 
481  return frame_id_build (sp, get_frame_pc (this_frame));
482 }
483 
484 /* Allocate and initialize the ft32 gdbarch object. */
485 
486 static struct gdbarch *
487 ft32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
488 {
489  struct gdbarch *gdbarch;
490  struct gdbarch_tdep *tdep;
491 
492  /* If there is already a candidate, use it. */
493  arches = gdbarch_list_lookup_by_info (arches, &info);
494  if (arches != NULL)
495  return arches->gdbarch;
496 
497  /* Allocate space for the new architecture. */
498  tdep = XNEW (struct gdbarch_tdep);
499  gdbarch = gdbarch_alloc (&info, tdep);
500 
504 
505  set_gdbarch_num_regs (gdbarch, FT32_NUM_REGS);
506  set_gdbarch_sp_regnum (gdbarch, FT32_SP_REGNUM);
507  set_gdbarch_pc_regnum (gdbarch, FT32_PC_REGNUM);
510 
512 
517 
518  frame_base_set_default (gdbarch, &ft32_frame_base);
519 
520  /* Methods for saving / extracting a dummy frame's ID. The ID's
521  stack address must match the SP value returned by
522  PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */
524 
526 
527  set_gdbarch_print_insn (gdbarch, print_insn_ft32);
528 
529  /* Hook in ABI-specific overrides, if they have been registered. */
530  gdbarch_init_osabi (info, gdbarch);
531 
532  /* Hook in the default unwinders. */
533  frame_unwind_append_unwinder (gdbarch, &ft32_frame_unwind);
534 
535  /* Support simple overlay manager. */
537 
538  return gdbarch;
539 }
540 
541 /* Register this machine's init routine. */
542 
543 void
545 {
546  register_gdbarch_init (bfd_arch_ft32, ft32_gdbarch_init);
547 }
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
Definition: gdbarch.c:1909
#define IS_PUSH(inst)
Definition: ft32-tdep.c:156
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
Definition: gdbarch.c:2935
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:84
void _initialize_ft32_tdep(void)
Definition: ft32-tdep.c:544
#define LINK_SIZE(inst)
Definition: ft32-tdep.c:159
static void ft32_write_pc(struct regcache *regcache, CORE_ADDR val)
Definition: ft32-tdep.c:287
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition: frame.c:554
static void ft32_frame_this_id(struct frame_info *this_frame, void **this_prologue_cache, struct frame_id *this_id)
Definition: ft32-tdep.c:413
struct type * builtin_func_ptr
Definition: gdbtypes.h:1544
CORE_ADDR get_frame_pc(struct frame_info *frame)
Definition: frame.c:2217
bfd_vma CORE_ADDR
Definition: common-types.h:41
void gdbarch_init_osabi(struct gdbarch_info info, struct gdbarch *gdbarch)
Definition: osabi.c:341
#define RAM_BIAS
Definition: ft32-tdep.c:43
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
Definition: regcache.c:297
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
Definition: frame-unwind.c:228
static struct value * ft32_frame_prev_register(struct frame_info *this_frame, void **this_prologue_cache, int regnum)
Definition: ft32-tdep.c:429
CORE_ADDR end
Definition: symtab.h:1377
void set_gdbarch_overlay_update(struct gdbarch *gdbarch, gdbarch_overlay_update_ftype overlay_update)
Definition: gdbarch.c:3792
void set_gdbarch_write_pc(struct gdbarch *gdbarch, gdbarch_write_pc_ftype write_pc)
Definition: gdbarch.c:1802
static CORE_ADDR ft32_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
Definition: ft32-tdep.c:71
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1182
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
Definition: gdbtypes.c:4766
return_value_convention
Definition: defs.h:206
static struct frame_id ft32_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
Definition: ft32-tdep.c:477
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
Definition: gdbarch.c:4985
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
Definition: symtab.c:3882
CORE_ADDR saved_sp
Definition: ft32-tdep.c:63
static struct ft32_frame_cache * ft32_alloc_frame_cache(void)
Definition: ft32-tdep.c:349
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
Definition: frame-unwind.c:78
CORE_ADDR saved_regs[FT32_NUM_REGS]
Definition: ft32-tdep.c:61
struct type * builtin_int32
Definition: gdbtypes.h:1518
#define FRAME_OBSTACK_ZALLOC(TYPE)
Definition: frame.h:660
void store_unsigned_integer(gdb_byte *, int, enum bfd_endian, ULONGEST)
Definition: findvar.c:212
struct value * frame_unwind_got_constant(struct frame_info *frame, int regnum, ULONGEST val)
Definition: frame-unwind.c:241
static CORE_ADDR ft32_unwind_pc(struct gdbarch *gdbarch, struct frame_info *next_frame)
Definition: ft32-tdep.c:404
void frame_base_set_default(struct gdbarch *gdbarch, const struct frame_base *default_base)
Definition: frame-base.c:94
bfd_boolean established
Definition: ft32-tdep.c:65
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
Definition: gdbarch.c:2151
static CORE_ADDR ft32_unwind_sp(struct gdbarch *gdbarch, struct frame_info *next_frame)
Definition: ft32-tdep.c:295
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
Definition: symtab.c:3315
LONGEST framesize
Definition: ft32-tdep.c:59
enum register_status regcache_cooked_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
Definition: regcache.c:837
void set_gdbarch_sp_regnum(struct gdbarch *gdbarch, int sp_regnum)
Definition: gdbarch.c:1991
static CORE_ADDR ft32_frame_base_address(struct frame_info *this_frame, void **this_cache)
Definition: ft32-tdep.c:460
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
Definition: gdbarch.c:2175
CORE_ADDR base
Definition: ft32-tdep.c:55
static enum return_value_convention ft32_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
Definition: ft32-tdep.c:330
#define IS_LINK(inst)
Definition: ft32-tdep.c:158
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1420
static void ft32_extract_return_value(struct type *type, struct regcache *regcache, gdb_byte *dst)
Definition: ft32-tdep.c:304
Definition: gdbtypes.h:749
int find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
Definition: blockframe.c:321
static struct ft32_frame_cache * ft32_frame_cache(struct frame_info *this_frame, void **this_cache)
Definition: ft32-tdep.c:365
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
Definition: gdbarch.c:2863
void set_gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
Definition: gdbarch.c:2672
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:170
static struct gdbarch * ft32_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
Definition: ft32-tdep.c:487
#define gdb_assert(expr)
Definition: gdb_assert.h:33
static CORE_ADDR ft32_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition: ft32-tdep.c:225
void set_gdbarch_read_pc(struct gdbarch *gdbarch, gdbarch_read_pc_ftype read_pc)
Definition: gdbarch.c:1778
void simple_overlay_update(struct obj_section *osect)
Definition: symfile.c:3671
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
Definition: gdbarch.c:2887
struct gdbarch * gdbarch
Definition: gdbarch.h:1542
int regnum
Definition: aarch64-tdep.c:69
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1194
Definition: value.c:172
#define PUSH_REG(inst)
Definition: ft32-tdep.c:157
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
Definition: arch-utils.c:138
bfd_byte gdb_byte
Definition: common-types.h:38
static const unsigned char * ft32_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
Definition: ft32-tdep.c:81
#define max(a, b)
Definition: defs.h:109
CORE_ADDR pc
Definition: ft32-tdep.c:57
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
Definition: frame-unwind.c:218
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
Definition: regcache.c:871
struct type * builtin_data_ptr
Definition: gdbtypes.h:1533
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
Definition: symtab.c:1967
int offset
Definition: agent.c:65
static const char *const ft32_register_names[]
Definition: ft32-tdep.c:92
#define SYMBOL_LANGUAGE(symbol)
Definition: symtab.h:187
static CORE_ADDR ft32_analyze_prologue(CORE_ADDR start_addr, CORE_ADDR end_addr, struct ft32_frame_cache *cache, struct gdbarch *gdbarch)
Definition: ft32-tdep.c:162
static void ft32_store_return_value(struct type *type, struct regcache *regcache, const gdb_byte *valbuf)
Definition: ft32-tdep.c:131
unsigned long long ULONGEST
Definition: common-types.h:53
enum unwind_stop_reason default_frame_unwind_stop_reason(struct frame_info *this_frame, void **this_cache)
Definition: frame-unwind.c:180
static const char * ft32_register_name(struct gdbarch *gdbarch, int reg_nr)
Definition: ft32-tdep.c:105
Definition: symtab.h:703
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
Definition: gdbarch.c:2556
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1237
ULONGEST read_memory_unsigned_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:321
void register_gdbarch_init(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init)
Definition: gdbarch.c:4975
static struct type * ft32_register_type(struct gdbarch *gdbarch, int reg_nr)
Definition: ft32-tdep.c:117
static const struct frame_unwind ft32_frame_unwind
Definition: ft32-tdep.c:447
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype skip_prologue)
Definition: gdbarch.c:2590
enum bfd_endian byte_order
Definition: gdbarch.c:128
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
Definition: gdbarch.c:2008
void set_gdbarch_register_name(struct gdbarch *gdbarch, gdbarch_register_name_ftype register_name)
Definition: gdbarch.c:2127
CORE_ADDR get_frame_func(struct frame_info *this_frame)
Definition: frame.c:920
struct gdbarch * gdbarch_alloc(const struct gdbarch_info *info, struct gdbarch_tdep *tdep)
Definition: gdbarch.c:339
void set_gdbarch_inner_than(struct gdbarch *gdbarch, gdbarch_inner_than_ftype inner_than)
Definition: gdbarch.c:2655
struct gdbarch * get_frame_arch(struct frame_info *this_frame)
Definition: frame.c:2535
long long LONGEST
Definition: common-types.h:52
static CORE_ADDR ft32_read_pc(struct regcache *regcache)
Definition: ft32-tdep.c:276
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
Definition: gdbarch.c:3067
const ULONGEST const LONGEST len
Definition: target.h:309