| OLD | NEW |
| 1 /* Target-dependent code for the Renesas RX for GDB, the GNU debugger. | 1 /* Target-dependent code for the Renesas RX for GDB, the GNU debugger. |
| 2 | 2 |
| 3 Copyright (C) 2008-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2008-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 Contributed by Red Hat, Inc. | 5 Contributed by Red Hat, Inc. |
| 6 | 6 |
| 7 This file is part of GDB. | 7 This file is part of GDB. |
| 8 | 8 |
| 9 This program is free software; you can redistribute it and/or modify | 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 | 10 it under the terms of the GNU General Public License as published by |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 result->prologue_end = after_last_frame_setup_insn; | 346 result->prologue_end = after_last_frame_setup_insn; |
| 347 | 347 |
| 348 do_cleanups (back_to); | 348 do_cleanups (back_to); |
| 349 } | 349 } |
| 350 | 350 |
| 351 | 351 |
| 352 /* Implement the "skip_prologue" gdbarch method. */ | 352 /* Implement the "skip_prologue" gdbarch method. */ |
| 353 static CORE_ADDR | 353 static CORE_ADDR |
| 354 rx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) | 354 rx_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) |
| 355 { | 355 { |
| 356 char *name; | 356 const char *name; |
| 357 CORE_ADDR func_addr, func_end; | 357 CORE_ADDR func_addr, func_end; |
| 358 struct rx_prologue p; | 358 struct rx_prologue p; |
| 359 | 359 |
| 360 /* Try to find the extent of the function that contains PC. */ | 360 /* Try to find the extent of the function that contains PC. */ |
| 361 if (!find_pc_partial_function (pc, &name, &func_addr, &func_end)) | 361 if (!find_pc_partial_function (pc, &name, &func_addr, &func_end)) |
| 362 return pc; | 362 return pc; |
| 363 | 363 |
| 364 rx_analyze_prologue (pc, func_end, &p); | 364 rx_analyze_prologue (pc, func_end, &p); |
| 365 return p.prologue_end; | 365 return p.prologue_end; |
| 366 } | 366 } |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 695 |
| 696 /* Update the stack pointer. */ | 696 /* Update the stack pointer. */ |
| 697 regcache_cooked_write_unsigned (regcache, RX_SP_REGNUM, sp); | 697 regcache_cooked_write_unsigned (regcache, RX_SP_REGNUM, sp); |
| 698 | 698 |
| 699 return cfa; | 699 return cfa; |
| 700 } | 700 } |
| 701 | 701 |
| 702 /* Implement the "return_value" gdbarch method. */ | 702 /* Implement the "return_value" gdbarch method. */ |
| 703 static enum return_value_convention | 703 static enum return_value_convention |
| 704 rx_return_value (struct gdbarch *gdbarch, | 704 rx_return_value (struct gdbarch *gdbarch, |
| 705 » » struct type *func_type, | 705 » » struct value *function, |
| 706 struct type *valtype, | 706 struct type *valtype, |
| 707 struct regcache *regcache, | 707 struct regcache *regcache, |
| 708 gdb_byte *readbuf, const gdb_byte *writebuf) | 708 gdb_byte *readbuf, const gdb_byte *writebuf) |
| 709 { | 709 { |
| 710 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 710 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 711 ULONGEST valtype_len = TYPE_LENGTH (valtype); | 711 ULONGEST valtype_len = TYPE_LENGTH (valtype); |
| 712 | 712 |
| 713 if (TYPE_LENGTH (valtype) > 16 | 713 if (TYPE_LENGTH (valtype) > 16 |
| 714 || ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT | 714 || ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT |
| 715 || TYPE_CODE (valtype) == TYPE_CODE_UNION) | 715 || TYPE_CODE (valtype) == TYPE_CODE_UNION) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 valtype_len -= len; | 749 valtype_len -= len; |
| 750 offset += len; | 750 offset += len; |
| 751 argreg++; | 751 argreg++; |
| 752 } | 752 } |
| 753 } | 753 } |
| 754 | 754 |
| 755 return RETURN_VALUE_REGISTER_CONVENTION; | 755 return RETURN_VALUE_REGISTER_CONVENTION; |
| 756 } | 756 } |
| 757 | 757 |
| 758 /* Implement the "breakpoint_from_pc" gdbarch method. */ | 758 /* Implement the "breakpoint_from_pc" gdbarch method. */ |
| 759 const gdb_byte * | 759 static const gdb_byte * |
| 760 rx_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) | 760 rx_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) |
| 761 { | 761 { |
| 762 static gdb_byte breakpoint[] = { 0x00 }; | 762 static gdb_byte breakpoint[] = { 0x00 }; |
| 763 *lenptr = sizeof breakpoint; | 763 *lenptr = sizeof breakpoint; |
| 764 return breakpoint; | 764 return breakpoint; |
| 765 } | 765 } |
| 766 | 766 |
| 767 /* Allocate and initialize a gdbarch object. */ | 767 /* Allocate and initialize a gdbarch object. */ |
| 768 static struct gdbarch * | 768 static struct gdbarch * |
| 769 rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) | 769 rx_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 set_gdbarch_dummy_id (gdbarch, rx_dummy_id); | 852 set_gdbarch_dummy_id (gdbarch, rx_dummy_id); |
| 853 set_gdbarch_push_dummy_call (gdbarch, rx_push_dummy_call); | 853 set_gdbarch_push_dummy_call (gdbarch, rx_push_dummy_call); |
| 854 set_gdbarch_return_value (gdbarch, rx_return_value); | 854 set_gdbarch_return_value (gdbarch, rx_return_value); |
| 855 | 855 |
| 856 /* Virtual tables. */ | 856 /* Virtual tables. */ |
| 857 set_gdbarch_vbit_in_delta (gdbarch, 1); | 857 set_gdbarch_vbit_in_delta (gdbarch, 1); |
| 858 | 858 |
| 859 return gdbarch; | 859 return gdbarch; |
| 860 } | 860 } |
| 861 | 861 |
| 862 /* -Wmissing-prototypes */ |
| 863 extern initialize_file_ftype _initialize_rx_tdep; |
| 864 |
| 862 /* Register the above initialization routine. */ | 865 /* Register the above initialization routine. */ |
| 866 |
| 863 void | 867 void |
| 864 _initialize_rx_tdep (void) | 868 _initialize_rx_tdep (void) |
| 865 { | 869 { |
| 866 register_gdbarch_init (bfd_arch_rx, rx_gdbarch_init); | 870 register_gdbarch_init (bfd_arch_rx, rx_gdbarch_init); |
| 867 } | 871 } |
| OLD | NEW |