GDB (xrefs)
/tmp/gdb-7.10/gdb/msp430-tdep.c
Go to the documentation of this file.
1 /* Target-dependent code for the Texas Instruments MSP430 for GDB, the
2  GNU debugger.
3 
4  Copyright (C) 2012-2015 Free Software Foundation, Inc.
5 
6  Contributed by Red Hat, Inc.
7 
8  This file is part of GDB.
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 3 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 
23 #include "defs.h"
24 #include "arch-utils.h"
25 #include "prologue-value.h"
26 #include "target.h"
27 #include "regcache.h"
28 #include "dis-asm.h"
29 #include "gdbtypes.h"
30 #include "frame.h"
31 #include "frame-unwind.h"
32 #include "frame-base.h"
33 #include "value.h"
34 #include "gdbcore.h"
35 #include "dwarf2-frame.h"
36 #include "reggroups.h"
37 
38 #include "elf/msp430.h"
39 #include "opcode/msp430-decode.h"
40 #include "elf-bfd.h"
41 
42 /* Register Numbers. */
43 
44 enum
45 {
62 
64 
81 
84 };
85 
86 enum
87 {
88  /* TI MSP430 Architecture. */
90 
91  /* TI MSP430X Architecture. */
93 };
94 
95 enum
96 {
97  /* The small code model limits code addresses to 16 bits. */
99 
100  /* The large code model uses 20 bit addresses for function
101  pointers. These are stored in memory using four bytes (32 bits). */
103 };
104 
105 /* Architecture specific data. */
106 
107 struct gdbarch_tdep
108 {
109  /* The ELF header flags specify the multilib used. */
110  int elf_flags;
111 
112  /* One of MSP_ISA_MSP430 or MSP_ISA_MSP430X. */
113  int isa;
114 
115  /* One of MSP_SMALL_CODE_MODEL or MSP_LARGE_CODE_MODEL. If, at
116  some point, we support different data models too, we'll probably
117  structure things so that we can combine values using logical
118  "or". */
120 };
121 
122 /* This structure holds the results of a prologue analysis. */
123 
125 {
126  /* The offset from the frame base to the stack pointer --- always
127  zero or negative.
128 
129  Calling this a "size" is a bit misleading, but given that the
130  stack grows downwards, using offsets for everything keeps one
131  from going completely sign-crazy: you never change anything's
132  sign for an ADD instruction; always change the second operand's
133  sign for a SUB instruction; and everything takes care of
134  itself. */
136 
137  /* Non-zero if this function has initialized the frame pointer from
138  the stack pointer, zero otherwise. */
140 
141  /* If has_frame_ptr is non-zero, this is the offset from the frame
142  base to where the frame pointer points. This is always zero or
143  negative. */
145 
146  /* The address of the first instruction at which the frame has been
147  set up and the arguments are where the debug info says they are
148  --- as best as we can tell. */
150 
151  /* reg_offset[R] is the offset from the CFA at which register R is
152  saved, or 1 if register R has not been saved. (Real values are
153  always zero or negative.) */
155 };
156 
157 /* Implement the "register_type" gdbarch method. */
158 
159 static struct type *
160 msp430_register_type (struct gdbarch *gdbarch, int reg_nr)
161 {
162  if (reg_nr < MSP430_NUM_REGS)
163  return builtin_type (gdbarch)->builtin_uint32;
164  else if (reg_nr == MSP430_PC_REGNUM)
165  return builtin_type (gdbarch)->builtin_func_ptr;
166  else
167  return builtin_type (gdbarch)->builtin_uint16;
168 }
169 
170 /* Implement another version of the "register_type" gdbarch method
171  for msp430x. */
172 
173 static struct type *
174 msp430x_register_type (struct gdbarch *gdbarch, int reg_nr)
175 {
176  if (reg_nr < MSP430_NUM_REGS)
177  return builtin_type (gdbarch)->builtin_uint32;
178  else if (reg_nr == MSP430_PC_REGNUM)
179  return builtin_type (gdbarch)->builtin_func_ptr;
180  else
181  return builtin_type (gdbarch)->builtin_uint32;
182 }
183 
184 /* Implement the "register_name" gdbarch method. */
185 
186 static const char *
187 msp430_register_name (struct gdbarch *gdbarch, int regnr)
188 {
189  static const char *const reg_names[] = {
190  /* Raw registers. */
191  "", "", "", "", "", "", "", "",
192  "", "", "", "", "", "", "", "",
193  /* Pseudo registers. */
194  "pc", "sp", "sr", "cg", "r4", "r5", "r6", "r7",
195  "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
196  };
197 
198  return reg_names[regnr];
199 }
200 
201 /* Implement the "register_reggroup_p" gdbarch method. */
202 
203 static int
204 msp430_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
205  struct reggroup *group)
206 {
207  if (group == all_reggroup)
208  return 1;
209 
210  /* All other registers are saved and restored. */
211  if (group == save_reggroup || group == restore_reggroup)
212  return (MSP430_NUM_REGS <= regnum && regnum < MSP430_NUM_TOTAL_REGS);
213 
214  return group == general_reggroup;
215 }
216 
217 /* Implement the "pseudo_register_read" gdbarch method. */
218 
219 static enum register_status
220 msp430_pseudo_register_read (struct gdbarch *gdbarch,
221  struct regcache *regcache,
222  int regnum, gdb_byte *buffer)
223 {
225 
226  if (MSP430_NUM_REGS <= regnum && regnum < MSP430_NUM_TOTAL_REGS)
227  {
228  ULONGEST val;
229  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
230  int regsize = register_size (gdbarch, regnum);
231  int raw_regnum = regnum - MSP430_NUM_REGS;
232 
233  status = regcache_raw_read_unsigned (regcache, raw_regnum, &val);
234  if (status == REG_VALID)
235  store_unsigned_integer (buffer, regsize, byte_order, val);
236 
237  }
238  else
239  gdb_assert_not_reached ("invalid pseudo register number");
240 
241  return status;
242 }
243 
244 /* Implement the "pseudo_register_write" gdbarch method. */
245 
246 static void
247 msp430_pseudo_register_write (struct gdbarch *gdbarch,
248  struct regcache *regcache,
249  int regnum, const gdb_byte *buffer)
250 {
251  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
252  if (MSP430_NUM_REGS <= regnum && regnum < MSP430_NUM_TOTAL_REGS)
253 
254  {
255  ULONGEST val;
256  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
257  int regsize = register_size (gdbarch, regnum);
258  int raw_regnum = regnum - MSP430_NUM_REGS;
259 
260  val = extract_unsigned_integer (buffer, regsize, byte_order);
261  regcache_raw_write_unsigned (regcache, raw_regnum, val);
262 
263  }
264  else
265  gdb_assert_not_reached ("invalid pseudo register number");
266 }
267 
268 /* Implement the `register_sim_regno' gdbarch method. */
269 
270 static int
271 msp430_register_sim_regno (struct gdbarch *gdbarch, int regnum)
272 {
273  gdb_assert (regnum < MSP430_NUM_REGS);
274 
275  /* So long as regnum is in [0, RL78_NUM_REGS), it's valid. We
276  just want to override the default here which disallows register
277  numbers which have no names. */
278  return regnum;
279 }
280 
281 /* Implement the "breakpoint_from_pc" gdbarch method. */
282 
283 static const gdb_byte *
284 msp430_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
285  int *lenptr)
286 {
287  static gdb_byte breakpoint[] = { 0x43, 0x43 };
288 
289  *lenptr = sizeof breakpoint;
290  return breakpoint;
291 }
292 
293 /* Define a "handle" struct for fetching the next opcode. */
294 
296 {
298 };
299 
300 /* Fetch a byte on behalf of the opcode decoder. HANDLE contains
301  the memory address of the next byte to fetch. If successful,
302  the address in the handle is updated and the byte fetched is
303  returned as the value of the function. If not successful, -1
304  is returned. */
305 
306 static int
308 {
309  struct msp430_get_opcode_byte_handle *opcdata = handle;
310  int status;
311  gdb_byte byte;
312 
313  status = target_read_memory (opcdata->pc, &byte, 1);
314  if (status == 0)
315  {
316  opcdata->pc += 1;
317  return byte;
318  }
319  else
320  return -1;
321 }
322 
323 /* Function for finding saved registers in a 'struct pv_area'; this
324  function is passed to pv_area_scan.
325 
326  If VALUE is a saved register, ADDR says it was saved at a constant
327  offset from the frame base, and SIZE indicates that the whole
328  register was saved, record its offset. */
329 
330 static void
331 check_for_saved (void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
332 {
333  struct msp430_prologue *result = (struct msp430_prologue *) result_untyped;
334 
335  if (value.kind == pvk_register
336  && value.k == 0
338  && size == register_size (target_gdbarch (), value.reg))
339  result->reg_offset[value.reg] = addr.k;
340 }
341 
342 /* Analyze a prologue starting at START_PC, going no further than
343  LIMIT_PC. Fill in RESULT as appropriate. */
344 
345 static void
346 msp430_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc,
347  CORE_ADDR limit_pc, struct msp430_prologue *result)
348 {
349  CORE_ADDR pc, next_pc;
350  int rn;
352  struct pv_area *stack;
353  struct cleanup *back_to;
354  CORE_ADDR after_last_frame_setup_insn = start_pc;
355  int code_model = gdbarch_tdep (gdbarch)->code_model;
356  int sz;
357 
358  memset (result, 0, sizeof (*result));
359 
360  for (rn = 0; rn < MSP430_NUM_TOTAL_REGS; rn++)
361  {
362  reg[rn] = pv_register (rn, 0);
363  result->reg_offset[rn] = 1;
364  }
365 
366  stack = make_pv_area (MSP430_SP_REGNUM, gdbarch_addr_bit (gdbarch));
367  back_to = make_cleanup_free_pv_area (stack);
368 
369  /* The call instruction has saved the return address on the stack. */
370  sz = code_model == MSP_LARGE_CODE_MODEL ? 4 : 2;
372  pv_area_store (stack, reg[MSP430_SP_REGNUM], sz, reg[MSP430_PC_REGNUM]);
373 
374  pc = start_pc;
375  while (pc < limit_pc)
376  {
377  int bytes_read;
378  struct msp430_get_opcode_byte_handle opcode_handle;
379  MSP430_Opcode_Decoded opc;
380 
381  opcode_handle.pc = pc;
382  bytes_read = msp430_decode_opcode (pc, &opc, msp430_get_opcode_byte,
383  &opcode_handle);
384  next_pc = pc + bytes_read;
385 
386  if (opc.id == MSO_push && opc.op[0].type == MSP430_Operand_Register)
387  {
388  int rsrc = opc.op[0].reg;
389 
390  reg[MSP430_SP_REGNUM] = pv_add_constant (reg[MSP430_SP_REGNUM], -2);
391  pv_area_store (stack, reg[MSP430_SP_REGNUM], 2, reg[rsrc]);
392  after_last_frame_setup_insn = next_pc;
393  }
394  else if (opc.id == MSO_push /* PUSHM */
395  && opc.op[0].type == MSP430_Operand_None
396  && opc.op[1].type == MSP430_Operand_Register)
397  {
398  int rsrc = opc.op[1].reg;
399  int count = opc.repeats + 1;
400  int size = opc.size == 16 ? 2 : 4;
401 
402  while (count > 0)
403  {
404  reg[MSP430_SP_REGNUM]
405  = pv_add_constant (reg[MSP430_SP_REGNUM], -size);
406  pv_area_store (stack, reg[MSP430_SP_REGNUM], size, reg[rsrc]);
407  rsrc--;
408  count--;
409  }
410  after_last_frame_setup_insn = next_pc;
411  }
412  else if (opc.id == MSO_sub
413  && opc.op[0].type == MSP430_Operand_Register
414  && opc.op[0].reg == MSR_SP
415  && opc.op[1].type == MSP430_Operand_Immediate)
416  {
417  int addend = opc.op[1].addend;
418 
419  reg[MSP430_SP_REGNUM] = pv_add_constant (reg[MSP430_SP_REGNUM],
420  -addend);
421  after_last_frame_setup_insn = next_pc;
422  }
423  else if (opc.id == MSO_mov
424  && opc.op[0].type == MSP430_Operand_Immediate
425  && 12 <= opc.op[0].reg && opc.op[0].reg <= 15)
426  after_last_frame_setup_insn = next_pc;
427  else
428  {
429  /* Terminate the prologue scan. */
430  break;
431  }
432 
433  pc = next_pc;
434  }
435 
436  /* Is the frame size (offset, really) a known constant? */
437  if (pv_is_register (reg[MSP430_SP_REGNUM], MSP430_SP_REGNUM))
438  result->frame_size = reg[MSP430_SP_REGNUM].k;
439 
440  /* Record where all the registers were saved. */
441  pv_area_scan (stack, check_for_saved, result);
442 
443  result->prologue_end = after_last_frame_setup_insn;
444 
445  do_cleanups (back_to);
446 }
447 
448 /* Implement the "skip_prologue" gdbarch method. */
449 
450 static CORE_ADDR
451 msp430_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
452 {
453  const char *name;
454  CORE_ADDR func_addr, func_end;
455  struct msp430_prologue p;
456 
457  /* Try to find the extent of the function that contains PC. */
458  if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
459  return pc;
460 
461  msp430_analyze_prologue (gdbarch, pc, func_end, &p);
462  return p.prologue_end;
463 }
464 
465 /* Implement the "unwind_pc" gdbarch method. */
466 
467 static CORE_ADDR
468 msp430_unwind_pc (struct gdbarch *arch, struct frame_info *next_frame)
469 {
471 }
472 
473 /* Implement the "unwind_sp" gdbarch method. */
474 
475 static CORE_ADDR
476 msp430_unwind_sp (struct gdbarch *arch, struct frame_info *next_frame)
477 {
479 }
480 
481 /* Given a frame described by THIS_FRAME, decode the prologue of its
482  associated function if there is not cache entry as specified by
483  THIS_PROLOGUE_CACHE. Save the decoded prologue in the cache and
484  return that struct as the value of this function. */
485 
486 static struct msp430_prologue *
488  void **this_prologue_cache)
489 {
490  if (!*this_prologue_cache)
491  {
492  CORE_ADDR func_start, stop_addr;
493 
494  *this_prologue_cache = FRAME_OBSTACK_ZALLOC (struct msp430_prologue);
495 
496  func_start = get_frame_func (this_frame);
497  stop_addr = get_frame_pc (this_frame);
498 
499  /* If we couldn't find any function containing the PC, then
500  just initialize the prologue cache, but don't do anything. */
501  if (!func_start)
502  stop_addr = func_start;
503 
504  msp430_analyze_prologue (get_frame_arch (this_frame), func_start,
505  stop_addr, *this_prologue_cache);
506  }
507 
508  return *this_prologue_cache;
509 }
510 
511 /* Given a frame and a prologue cache, return this frame's base. */
512 
513 static CORE_ADDR
514 msp430_frame_base (struct frame_info *this_frame, void **this_prologue_cache)
515 {
516  struct msp430_prologue *p
517  = msp430_analyze_frame_prologue (this_frame, this_prologue_cache);
519 
520  return sp - p->frame_size;
521 }
522 
523 /* Implement the "frame_this_id" method for unwinding frames. */
524 
525 static void
526 msp430_this_id (struct frame_info *this_frame,
527  void **this_prologue_cache, struct frame_id *this_id)
528 {
529  *this_id = frame_id_build (msp430_frame_base (this_frame,
530  this_prologue_cache),
531  get_frame_func (this_frame));
532 }
533 
534 /* Implement the "frame_prev_register" method for unwinding frames. */
535 
536 static struct value *
537 msp430_prev_register (struct frame_info *this_frame,
538  void **this_prologue_cache, int regnum)
539 {
540  struct msp430_prologue *p
541  = msp430_analyze_frame_prologue (this_frame, this_prologue_cache);
542  CORE_ADDR frame_base = msp430_frame_base (this_frame, this_prologue_cache);
543 
544  if (regnum == MSP430_SP_REGNUM)
545  return frame_unwind_got_constant (this_frame, regnum, frame_base);
546 
547  /* If prologue analysis says we saved this register somewhere,
548  return a description of the stack slot holding it. */
549  else if (p->reg_offset[regnum] != 1)
550  {
551  struct value *rv = frame_unwind_got_memory (this_frame, regnum,
552  frame_base +
553  p->reg_offset[regnum]);
554 
555  if (regnum == MSP430_PC_REGNUM)
556  {
557  ULONGEST pc = value_as_long (rv);
558 
559  return frame_unwind_got_constant (this_frame, regnum, pc);
560  }
561  return rv;
562  }
563 
564  /* Otherwise, presume we haven't changed the value of this
565  register, and get it from the next frame. */
566  else
567  return frame_unwind_got_register (this_frame, regnum, regnum);
568 }
569 
570 static const struct frame_unwind msp430_unwind = {
571  NORMAL_FRAME,
575  NULL,
577 };
578 
579 /* Implement the "dwarf2_reg_to_regnum" gdbarch method. */
580 
581 static int
582 msp430_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
583 {
584  if (reg < MSP430_NUM_REGS)
585  return reg + MSP430_NUM_REGS;
586  else
587  {
588  warning (_("Unmapped DWARF Register #%d encountered."), reg);
589  return -1;
590  }
591 }
592 
593 /* Implement the "return_value" gdbarch method. */
594 
595 static enum return_value_convention
596 msp430_return_value (struct gdbarch *gdbarch,
597  struct value *function,
598  struct type *valtype,
599  struct regcache *regcache,
600  gdb_byte *readbuf, const gdb_byte *writebuf)
601 {
602  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
603  LONGEST valtype_len = TYPE_LENGTH (valtype);
604  int code_model = gdbarch_tdep (gdbarch)->code_model;
605 
606  if (TYPE_LENGTH (valtype) > 8
607  || TYPE_CODE (valtype) == TYPE_CODE_STRUCT
608  || TYPE_CODE (valtype) == TYPE_CODE_UNION)
610 
611  if (readbuf)
612  {
613  ULONGEST u;
614  int argreg = MSP430_R12_REGNUM;
615  int offset = 0;
616 
617  while (valtype_len > 0)
618  {
619  int size = 2;
620 
621  if (code_model == MSP_LARGE_CODE_MODEL
622  && TYPE_CODE (valtype) == TYPE_CODE_PTR)
623  {
624  size = 4;
625  }
626 
627  regcache_cooked_read_unsigned (regcache, argreg, &u);
628  store_unsigned_integer (readbuf + offset, size, byte_order, u);
629  valtype_len -= size;
630  offset += size;
631  argreg++;
632  }
633  }
634 
635  if (writebuf)
636  {
637  ULONGEST u;
638  int argreg = MSP430_R12_REGNUM;
639  int offset = 0;
640 
641  while (valtype_len > 0)
642  {
643  int size = 2;
644 
645  if (code_model == MSP_LARGE_CODE_MODEL
646  && TYPE_CODE (valtype) == TYPE_CODE_PTR)
647  {
648  size = 4;
649  }
650 
651  u = extract_unsigned_integer (writebuf + offset, size, byte_order);
652  regcache_cooked_write_unsigned (regcache, argreg, u);
653  valtype_len -= size;
654  offset += size;
655  argreg++;
656  }
657  }
658 
660 }
661 
662 
663 /* Implement the "frame_align" gdbarch method. */
664 
665 static CORE_ADDR
666 msp430_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
667 {
668  return align_down (sp, 2);
669 }
670 
671 
672 /* Implement the "dummy_id" gdbarch method. */
673 
674 static struct frame_id
675 msp430_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
676 {
677  return
679  (this_frame, MSP430_SP_REGNUM),
680  get_frame_pc (this_frame));
681 }
682 
683 
684 /* Implement the "push_dummy_call" gdbarch method. */
685 
686 static CORE_ADDR
687 msp430_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
688  struct regcache *regcache, CORE_ADDR bp_addr,
689  int nargs, struct value **args, CORE_ADDR sp,
690  int struct_return, CORE_ADDR struct_addr)
691 {
692  enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
693  int write_pass;
694  int sp_off = 0;
695  CORE_ADDR cfa;
696  int code_model = gdbarch_tdep (gdbarch)->code_model;
697 
698  struct type *func_type = value_type (function);
699 
700  /* Dereference function pointer types. */
701  while (TYPE_CODE (func_type) == TYPE_CODE_PTR)
702  func_type = TYPE_TARGET_TYPE (func_type);
703 
704  /* The end result had better be a function or a method. */
705  gdb_assert (TYPE_CODE (func_type) == TYPE_CODE_FUNC
706  || TYPE_CODE (func_type) == TYPE_CODE_METHOD);
707 
708  /* We make two passes; the first does the stack allocation,
709  the second actually stores the arguments. */
710  for (write_pass = 0; write_pass <= 1; write_pass++)
711  {
712  int i;
713  int arg_reg = MSP430_R12_REGNUM;
714  int args_on_stack = 0;
715 
716  if (write_pass)
717  sp = align_down (sp - sp_off, 4);
718  sp_off = 0;
719 
720  if (struct_return)
721  {
722  if (write_pass)
723  regcache_cooked_write_unsigned (regcache, arg_reg, struct_addr);
724  arg_reg++;
725  }
726 
727  /* Push the arguments. */
728  for (i = 0; i < nargs; i++)
729  {
730  struct value *arg = args[i];
731  const gdb_byte *arg_bits = value_contents_all (arg);
732  struct type *arg_type = check_typedef (value_type (arg));
733  ULONGEST arg_size = TYPE_LENGTH (arg_type);
734  int offset;
735  int current_arg_on_stack;
736 
737  current_arg_on_stack = 0;
738 
739  if (TYPE_CODE (arg_type) == TYPE_CODE_STRUCT
740  || TYPE_CODE (arg_type) == TYPE_CODE_UNION)
741  {
742  /* Aggregates of any size are passed by reference. */
743  gdb_byte struct_addr[4];
744 
745  store_unsigned_integer (struct_addr, 4, byte_order,
746  value_address (arg));
747  arg_bits = struct_addr;
748  arg_size = (code_model == MSP_LARGE_CODE_MODEL) ? 4 : 2;
749  }
750  else
751  {
752  /* Scalars bigger than 8 bytes such as complex doubles are passed
753  on the stack. */
754  if (arg_size > 8)
755  current_arg_on_stack = 1;
756  }
757 
758 
759  for (offset = 0; offset < arg_size; offset += 2)
760  {
761  /* The condition below prevents 8 byte scalars from being split
762  between registers and memory (stack). It also prevents other
763  splits once the stack has been written to. */
764  if (!current_arg_on_stack
765  && (arg_reg
766  + ((arg_size == 8 || args_on_stack)
767  ? ((arg_size - offset) / 2 - 1)
768  : 0) <= MSP430_R15_REGNUM))
769  {
770  int size = 2;
771 
772  if (code_model == MSP_LARGE_CODE_MODEL
773  && TYPE_CODE (arg_type) == TYPE_CODE_PTR)
774  {
775  /* Pointer arguments using large memory model are passed
776  using entire register. */
777  if (offset != 0)
778  continue;
779  size = 4;
780  }
781 
782  if (write_pass)
783  regcache_cooked_write_unsigned (regcache, arg_reg,
785  (arg_bits + offset, size,
786  byte_order));
787 
788  arg_reg++;
789  }
790  else
791  {
792  if (write_pass)
793  write_memory (sp + sp_off, arg_bits + offset, 2);
794 
795  sp_off += 2;
796  args_on_stack = 1;
797  current_arg_on_stack = 1;
798  }
799  }
800  }
801  }
802 
803  /* Keep track of the stack address prior to pushing the return address.
804  This is the value that we'll return. */
805  cfa = sp;
806 
807  /* Push the return address. */
808  {
809  int sz = (gdbarch_tdep (gdbarch)->code_model == MSP_SMALL_CODE_MODEL)
810  ? 2 : 4;
811  sp = sp - sz;
812  write_memory_unsigned_integer (sp, sz, byte_order, bp_addr);
813  }
814 
815  /* Update the stack pointer. */
817 
818  return cfa;
819 }
820 
821 /* In order to keep code size small, the compiler may create epilogue
822  code through which more than one function epilogue is routed. I.e.
823  the epilogue and return may just be a branch to some common piece of
824  code which is responsible for tearing down the frame and performing
825  the return. These epilog (label) names will have the common prefix
826  defined here. */
827 
828 static const char msp430_epilog_name_prefix[] = "__mspabi_func_epilog_";
829 
830 /* Implement the "in_return_stub" gdbarch method. */
831 
832 static int
833 msp430_in_return_stub (struct gdbarch *gdbarch, CORE_ADDR pc,
834  const char *name)
835 {
836  return (name != NULL
838 }
839 
840 /* Implement the "skip_trampoline_code" gdbarch method. */
841 static CORE_ADDR
843 {
844  struct bound_minimal_symbol bms;
845  const char *stub_name;
846  struct gdbarch *gdbarch = get_frame_arch (frame);
847 
848  bms = lookup_minimal_symbol_by_pc (pc);
849  if (!bms.minsym)
850  return pc;
851 
852  stub_name = MSYMBOL_LINKAGE_NAME (bms.minsym);
853 
854  if (gdbarch_tdep (gdbarch)->code_model == MSP_SMALL_CODE_MODEL
855  && msp430_in_return_stub (gdbarch, pc, stub_name))
856  {
858 
859  return read_memory_integer
860  (sp + 2 * (stub_name[strlen (msp430_epilog_name_prefix)] - '0'),
861  2, gdbarch_byte_order (gdbarch));
862  }
863 
864  return pc;
865 }
866 
867 /* Allocate and initialize a gdbarch object. */
868 
869 static struct gdbarch *
870 msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
871 {
872  struct gdbarch *gdbarch;
873  struct gdbarch_tdep *tdep;
874  int elf_flags, isa, code_model;
875 
876  /* Extract the elf_flags if available. */
877  if (info.abfd != NULL
878  && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
879  elf_flags = elf_elfheader (info.abfd)->e_flags;
880  else
881  elf_flags = 0;
882 
883  if (info.abfd != NULL)
884  switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
885  OFBA_MSPABI_Tag_ISA))
886  {
887  case 1:
888  isa = MSP_ISA_MSP430;
889  code_model = MSP_SMALL_CODE_MODEL;
890  break;
891  case 2:
892  isa = MSP_ISA_MSP430X;
893  switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
894  OFBA_MSPABI_Tag_Code_Model))
895  {
896  case 1:
897  code_model = MSP_SMALL_CODE_MODEL;
898  break;
899  case 2:
900  code_model = MSP_LARGE_CODE_MODEL;
901  break;
902  default:
903  internal_error (__FILE__, __LINE__,
904  _("Unknown msp430x code memory model"));
905  break;
906  }
907  break;
908  case 0:
909  /* This can happen when loading a previously dumped data structure.
910  Use the ISA and code model from the current architecture, provided
911  it's compatible. */
912  {
913  struct gdbarch *ca = get_current_arch ();
914  if (ca && gdbarch_bfd_arch_info (ca)->arch == bfd_arch_msp430)
915  {
916  struct gdbarch_tdep *ca_tdep = gdbarch_tdep (ca);
917 
918  elf_flags = ca_tdep->elf_flags;
919  isa = ca_tdep->isa;
920  code_model = ca_tdep->code_model;
921  break;
922  }
923  /* Otherwise, fall through... */
924  }
925  default:
926  error (_("Unknown msp430 isa"));
927  break;
928  }
929  else
930  {
931  isa = MSP_ISA_MSP430;
932  code_model = MSP_SMALL_CODE_MODEL;
933  }
934 
935 
936  /* Try to find the architecture in the list of already defined
937  architectures. */
938  for (arches = gdbarch_list_lookup_by_info (arches, &info);
939  arches != NULL;
940  arches = gdbarch_list_lookup_by_info (arches->next, &info))
941  {
942  struct gdbarch_tdep *candidate_tdep = gdbarch_tdep (arches->gdbarch);
943 
944  if (candidate_tdep->elf_flags != elf_flags
945  || candidate_tdep->isa != isa
946  || candidate_tdep->code_model != code_model)
947  continue;
948 
949  return arches->gdbarch;
950  }
951 
952  /* None found, create a new architecture from the information
953  provided. */
954  tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
955  gdbarch = gdbarch_alloc (&info, tdep);
956  tdep->elf_flags = elf_flags;
957  tdep->isa = isa;
958  tdep->code_model = code_model;
959 
960  /* Registers. */
964  if (isa == MSP_ISA_MSP430)
966  else
975 
976  /* Data types. */
977  set_gdbarch_char_signed (gdbarch, 0);
978  set_gdbarch_short_bit (gdbarch, 16);
979  set_gdbarch_int_bit (gdbarch, 16);
980  set_gdbarch_long_bit (gdbarch, 32);
981  set_gdbarch_long_long_bit (gdbarch, 64);
982  if (code_model == MSP_SMALL_CODE_MODEL)
983  {
984  set_gdbarch_ptr_bit (gdbarch, 16);
985  set_gdbarch_addr_bit (gdbarch, 16);
986  }
987  else /* MSP_LARGE_CODE_MODEL */
988  {
989  set_gdbarch_ptr_bit (gdbarch, 32);
990  set_gdbarch_addr_bit (gdbarch, 32);
991  }
992  set_gdbarch_dwarf2_addr_size (gdbarch, 4);
993  set_gdbarch_float_bit (gdbarch, 32);
995  set_gdbarch_double_bit (gdbarch, 64);
996  set_gdbarch_long_double_bit (gdbarch, 64);
999 
1000  /* Breakpoints. */
1002  set_gdbarch_decr_pc_after_break (gdbarch, 1);
1003 
1004  /* Disassembly. */
1005  set_gdbarch_print_insn (gdbarch, print_insn_msp430);
1006 
1007  /* Frames, prologues, etc. */
1013  dwarf2_append_unwinders (gdbarch);
1014  frame_unwind_append_unwinder (gdbarch, &msp430_unwind);
1015 
1016  /* Dummy frames, return values. */
1020 
1021  /* Trampolines. */
1024 
1025  /* Virtual tables. */
1026  set_gdbarch_vbit_in_delta (gdbarch, 0);
1027 
1028  return gdbarch;
1029 }
1030 
1031 /* -Wmissing-prototypes */
1033 
1034 /* Register the initialization routine. */
1035 
1036 void
1038 {
1039  register_gdbarch_init (bfd_arch_msp430, msp430_gdbarch_init);
1040 }
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5143
void set_gdbarch_num_regs(struct gdbarch *gdbarch, int num_regs)
Definition: gdbarch.c:1909
static CORE_ADDR msp430_frame_base(struct frame_info *this_frame, void **this_prologue_cache)
Definition: msp430-tdep.c:514
void set_gdbarch_double_bit(struct gdbarch *gdbarch, int double_bit)
Definition: gdbarch.c:1634
void set_gdbarch_frame_align(struct gdbarch *gdbarch, gdbarch_frame_align_ftype frame_align)
Definition: gdbarch.c:2935
void set_gdbarch_float_format(struct gdbarch *gdbarch, const struct floatformat **float_format)
Definition: gdbarch.c:1617
ULONGEST extract_unsigned_integer(const gdb_byte *, int, enum bfd_endian)
Definition: findvar.c:84
static int msp430_register_reggroup_p(struct gdbarch *gdbarch, int regnum, struct reggroup *group)
Definition: msp430-tdep.c:204
static struct type * msp430x_register_type(struct gdbarch *gdbarch, int reg_nr)
Definition: msp430-tdep.c:174
struct frame_id frame_id_build(CORE_ADDR stack_addr, CORE_ADDR code_addr)
Definition: frame.c:554
struct type * builtin_func_ptr
Definition: gdbtypes.h:1544
void set_gdbarch_float_bit(struct gdbarch *gdbarch, int float_bit)
Definition: gdbarch.c:1601
void set_gdbarch_dwarf2_addr_size(struct gdbarch *gdbarch, int dwarf2_addr_size)
Definition: gdbarch.c:1736
CORE_ADDR get_frame_pc(struct frame_info *frame)
Definition: frame.c:2217
#define MSYMBOL_LINKAGE_NAME(symbol)
Definition: symtab.h:409
static struct value * msp430_prev_register(struct frame_info *this_frame, void **this_prologue_cache, int regnum)
Definition: msp430-tdep.c:537
bfd_vma CORE_ADDR
Definition: common-types.h:41
pv_t pv_add_constant(pv_t v, CORE_ADDR k)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
Definition: gdbtypes.c:74
LONGEST value_as_long(struct value *val)
Definition: value.c:2654
struct value * frame_unwind_got_memory(struct frame_info *frame, int regnum, CORE_ADDR addr)
Definition: frame-unwind.c:228
void write_memory_unsigned_integer(CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value)
Definition: corefile.c:412
void set_gdbarch_skip_trampoline_code(struct gdbarch *gdbarch, gdbarch_skip_trampoline_code_ftype skip_trampoline_code)
Definition: gdbarch.c:3084
void warning(const char *fmt,...)
Definition: errors.c:26
struct cleanup * make_cleanup_free_pv_area(struct pv_area *area)
ULONGEST align_down(ULONGEST v, int n)
Definition: utils.c:2971
ULONGEST frame_unwind_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1182
void set_gdbarch_short_bit(struct gdbarch *gdbarch, int short_bit)
Definition: gdbarch.c:1483
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
Definition: gdbtypes.c:4766
int pv_is_register(pv_t a, int r)
void internal_error(const char *file, int line, const char *fmt,...)
Definition: errors.c:50
return_value_convention
Definition: defs.h:206
struct type * builtin_uint16
Definition: gdbtypes.h:1517
void set_gdbarch_register_reggroup_p(struct gdbarch *gdbarch, gdbarch_register_reggroup_p_ftype register_reggroup_p)
Definition: gdbarch.c:3350
enum prologue_value_kind kind
struct gdbarch_list * gdbarch_list_lookup_by_info(struct gdbarch_list *arches, const struct gdbarch_info *info)
Definition: gdbarch.c:4985
struct gdbarch_list * next
Definition: gdbarch.h:1543
struct reggroup *const restore_reggroup
Definition: reggroups.c:298
struct reggroup *const all_reggroup
Definition: reggroups.c:296
#define _(String)
Definition: gdb_locale.h:40
static int msp430_register_sim_regno(struct gdbarch *gdbarch, int regnum)
Definition: msp430-tdep.c:271
void set_gdbarch_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
Definition: gdbarch.c:2110
struct gdbarch_tdep * gdbarch_tdep(struct gdbarch *gdbarch)
Definition: gdbarch.c:1402
void frame_unwind_append_unwinder(struct gdbarch *gdbarch, const struct frame_unwind *unwinder)
Definition: frame-unwind.c:78
#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
void set_gdbarch_addr_bit(struct gdbarch *gdbarch, int addr_bit)
Definition: gdbarch.c:1718
const char *const name
Definition: aarch64-tdep.c:68
static const char msp430_epilog_name_prefix[]
Definition: msp430-tdep.c:828
void set_gdbarch_pseudo_register_write(struct gdbarch *gdbarch, gdbarch_pseudo_register_write_ftype pseudo_register_write)
Definition: gdbarch.c:1891
void set_gdbarch_register_type(struct gdbarch *gdbarch, gdbarch_register_type_ftype register_type)
Definition: gdbarch.c:2151
static CORE_ADDR msp430_skip_prologue(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition: msp430-tdep.c:451
struct type * check_typedef(struct type *type)
Definition: gdbtypes.c:2217
LONGEST read_memory_integer(CORE_ADDR memaddr, int len, enum bfd_endian byte_order)
Definition: corefile.c:311
static int msp430_in_return_stub(struct gdbarch *gdbarch, CORE_ADDR pc, const char *name)
Definition: msp430-tdep.c:833
struct reggroup *const general_reggroup
Definition: reggroups.c:292
void initialize_file_ftype(void)
Definition: defs.h:281
register_status
Definition: regcache.h:50
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 msp430_frame_align(struct gdbarch *gdbarch, CORE_ADDR sp)
Definition: msp430-tdep.c:666
bfd * abfd
Definition: gdbarch.h:1557
void set_gdbarch_decr_pc_after_break(struct gdbarch *gdbarch, CORE_ADDR decr_pc_after_break)
Definition: gdbarch.c:2764
void set_gdbarch_dummy_id(struct gdbarch *gdbarch, gdbarch_dummy_id_ftype dummy_id)
Definition: gdbarch.c:2175
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
Definition: gnu-nat.c:1816
void set_gdbarch_in_solib_return_trampoline(struct gdbarch *gdbarch, gdbarch_in_solib_return_trampoline_ftype in_solib_return_trampoline)
Definition: gdbarch.c:3118
struct_return
Definition: arm-tdep.h:148
const gdb_byte * value_contents_all(struct value *value)
Definition: value.c:1188
#define gdb_assert_not_reached(message)
Definition: gdb_assert.h:56
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
Definition: gdbarch.c:1420
void set_gdbarch_register_sim_regno(struct gdbarch *gdbarch, gdbarch_register_sim_regno_ftype register_sim_regno)
Definition: gdbarch.c:2332
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
void set_gdbarch_unwind_pc(struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype unwind_pc)
Definition: gdbarch.c:2863
static CORE_ADDR msp430_unwind_sp(struct gdbarch *arch, struct frame_info *next_frame)
Definition: msp430-tdep.c:476
void set_gdbarch_breakpoint_from_pc(struct gdbarch *gdbarch, gdbarch_breakpoint_from_pc_ftype breakpoint_from_pc)
Definition: gdbarch.c:2672
static const gdb_byte * msp430_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
Definition: msp430-tdep.c:284
struct type * builtin_uint32
Definition: gdbtypes.h:1519
struct gdbarch * get_current_arch(void)
Definition: arch-utils.c:781
int default_frame_sniffer(const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache)
Definition: frame-unwind.c:170
void pv_area_store(struct pv_area *area, pv_t addr, CORE_ADDR size, pv_t value)
static void check_for_saved(void *result_untyped, pv_t addr, CORE_ADDR size, pv_t value)
Definition: msp430-tdep.c:331
#define gdb_assert(expr)
Definition: gdb_assert.h:33
static int startswith(const char *string, const char *pattern)
Definition: common-utils.h:75
enum register_status regcache_raw_read_unsigned(struct regcache *regcache, int regnum, ULONGEST *val)
Definition: regcache.c:690
int gdbarch_addr_bit(struct gdbarch *gdbarch)
Definition: gdbarch.c:1707
void set_gdbarch_unwind_sp(struct gdbarch *gdbarch, gdbarch_unwind_sp_ftype unwind_sp)
Definition: gdbarch.c:2887
int reg_offset[MSP430_NUM_TOTAL_REGS]
Definition: msp430-tdep.c:154
struct gdbarch * gdbarch
Definition: gdbarch.h:1542
static CORE_ADDR msp430_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: msp430-tdep.c:687
int regnum
Definition: aarch64-tdep.c:69
ULONGEST get_frame_register_unsigned(struct frame_info *frame, int regnum)
Definition: frame.c:1194
void * xmalloc(YYSIZE_T)
static enum return_value_convention msp430_return_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf)
Definition: msp430-tdep.c:596
void pv_area_scan(struct pv_area *area, void(*func)(void *closure, pv_t addr, CORE_ADDR size, pv_t value), void *closure)
void set_gdbarch_long_long_bit(struct gdbarch *gdbarch, int long_long_bit)
Definition: gdbarch.c:1534
Definition: regdef.h:22
Definition: value.c:172
static CORE_ADDR msp430_unwind_pc(struct gdbarch *arch, struct frame_info *next_frame)
Definition: msp430-tdep.c:468
static void msp430_pseudo_register_write(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, const gdb_byte *buffer)
Definition: msp430-tdep.c:247
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
Definition: gdbtypes.c:70
struct pv_area * make_pv_area(int base_reg, int addr_bit)
static int msp430_dwarf2_reg_to_regnum(struct gdbarch *gdbarch, int reg)
Definition: msp430-tdep.c:582
int core_addr_lessthan(CORE_ADDR lhs, CORE_ADDR rhs)
Definition: arch-utils.c:138
bfd_byte gdb_byte
Definition: common-types.h:38
void set_gdbarch_pseudo_register_read(struct gdbarch *gdbarch, gdbarch_pseudo_register_read_ftype pseudo_register_read)
Definition: gdbarch.c:1843
void set_gdbarch_char_signed(struct gdbarch *gdbarch, int char_signed)
Definition: gdbarch.c:1754
#define TYPE_TARGET_TYPE(thistype)
Definition: gdbtypes.h:1229
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
Definition: minsyms.c:801
static const char * msp430_register_name(struct gdbarch *gdbarch, int regnr)
Definition: msp430-tdep.c:187
#define TYPE_CODE(thistype)
Definition: gdbtypes.h:1240
void regcache_cooked_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
Definition: regcache.c:871
struct value * frame_unwind_got_register(struct frame_info *frame, int regnum, int new_regnum)
Definition: frame-unwind.c:218
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
Definition: target.c:1393
void set_gdbarch_int_bit(struct gdbarch *gdbarch, int int_bit)
Definition: gdbarch.c:1500
struct minimal_symbol * minsym
Definition: minsyms.h:32
int offset
Definition: agent.c:65
void regcache_raw_write_unsigned(struct regcache *regcache, int regnum, ULONGEST val)
Definition: regcache.c:723
Definition: buffer.h:23
void set_gdbarch_num_pseudo_regs(struct gdbarch *gdbarch, int num_pseudo_regs)
Definition: gdbarch.c:1926
void dwarf2_append_unwinders(struct gdbarch *gdbarch)
static struct gdbarch * msp430_gdbarch_init(struct gdbarch_info info, struct gdbarch_list *arches)
Definition: msp430-tdep.c:870
static void msp430_this_id(struct frame_info *this_frame, void **this_prologue_cache, struct frame_id *this_id)
Definition: msp430-tdep.c:526
CORE_ADDR prologue_end
Definition: msp430-tdep.c:149
void set_gdbarch_double_format(struct gdbarch *gdbarch, const struct floatformat **double_format)
Definition: gdbarch.c:1650
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 enum register_status msp430_pseudo_register_read(struct gdbarch *gdbarch, struct regcache *regcache, int regnum, gdb_byte *buffer)
Definition: msp430-tdep.c:220
int register_size(struct gdbarch *gdbarch, int regnum)
Definition: regcache.c:169
void set_gdbarch_long_double_bit(struct gdbarch *gdbarch, int long_double_bit)
Definition: gdbarch.c:1667
struct type * value_type(const struct value *value)
Definition: value.c:1021
void set_gdbarch_long_bit(struct gdbarch *gdbarch, int long_bit)
Definition: gdbarch.c:1517
void set_gdbarch_return_value(struct gdbarch *gdbarch, gdbarch_return_value_ftype return_value)
Definition: gdbarch.c:2556
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
Definition: gdbarch.c:1411
initialize_file_ftype _initialize_msp430_tdep
void set_gdbarch_long_double_format(struct gdbarch *gdbarch, const struct floatformat **long_double_format)
Definition: gdbarch.c:1683
static struct type * msp430_register_type(struct gdbarch *gdbarch, int reg_nr)
Definition: msp430-tdep.c:160
struct reggroup *const save_reggroup
Definition: reggroups.c:297
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1237
void set_gdbarch_ptr_bit(struct gdbarch *gdbarch, int ptr_bit)
Definition: gdbarch.c:1700
void set_gdbarch_push_dummy_call(struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype push_dummy_call)
Definition: gdbarch.c:2216
static struct frame_id msp430_dummy_id(struct gdbarch *gdbarch, struct frame_info *this_frame)
Definition: msp430-tdep.c:675
void register_gdbarch_init(enum bfd_architecture bfd_architecture, gdbarch_init_ftype *init)
Definition: gdbarch.c:4975
void write_memory(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
Definition: corefile.c:389
void set_gdbarch_skip_prologue(struct gdbarch *gdbarch, gdbarch_skip_prologue_ftype skip_prologue)
Definition: gdbarch.c:2590
static int msp430_get_opcode_byte(void *handle)
Definition: msp430-tdep.c:307
static void msp430_analyze_prologue(struct gdbarch *gdbarch, CORE_ADDR start_pc, CORE_ADDR limit_pc, struct msp430_prologue *result)
Definition: msp430-tdep.c:346
CORE_ADDR value_address(const struct value *value)
Definition: value.c:1440
void set_gdbarch_pc_regnum(struct gdbarch *gdbarch, int pc_regnum)
Definition: gdbarch.c:2008
static struct msp430_prologue * msp430_analyze_frame_prologue(struct frame_info *this_frame, void **this_prologue_cache)
Definition: msp430-tdep.c:487
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
static CORE_ADDR msp430_skip_trampoline_code(struct frame_info *frame, CORE_ADDR pc)
Definition: msp430-tdep.c:842
void error(const char *fmt,...)
Definition: errors.c:38
pv_t pv_register(int reg, CORE_ADDR k)
size_t size
Definition: go32-nat.c:242
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
void do_cleanups(struct cleanup *old_chain)
Definition: cleanups.c:175
void set_gdbarch_print_insn(struct gdbarch *gdbarch, gdbarch_print_insn_ftype print_insn)
Definition: gdbarch.c:3067
void set_gdbarch_vbit_in_delta(struct gdbarch *gdbarch, int vbit_in_delta)
Definition: gdbarch.c:3601