| OLD | NEW |
| 1 /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger. | 1 /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger. |
| 2 | 2 |
| 3 Copyright (C) 1996-2005, 2007-2012 Free Software Foundation, Inc. | 3 Copyright (C) 1996-2005, 2007-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GDB. | 5 This file is part of GDB. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 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 | 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 | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 _("Cannot extract return value %d bytes long."), len); | 226 _("Cannot extract return value %d bytes long."), len); |
| 227 } | 227 } |
| 228 | 228 |
| 229 /* Determine, for architecture GDBARCH, how a return value of TYPE | 229 /* Determine, for architecture GDBARCH, how a return value of TYPE |
| 230 should be returned. If it is supposed to be returned in registers, | 230 should be returned. If it is supposed to be returned in registers, |
| 231 and READBUF is non-zero, read the appropriate value from REGCACHE, | 231 and READBUF is non-zero, read the appropriate value from REGCACHE, |
| 232 and copy it into READBUF. If WRITEBUF is non-zero, write the value | 232 and copy it into READBUF. If WRITEBUF is non-zero, write the value |
| 233 from WRITEBUF into REGCACHE. */ | 233 from WRITEBUF into REGCACHE. */ |
| 234 | 234 |
| 235 static enum return_value_convention | 235 static enum return_value_convention |
| 236 mn10300_return_value (struct gdbarch *gdbarch, struct type *func_type, | 236 mn10300_return_value (struct gdbarch *gdbarch, struct value *function, |
| 237 struct type *type, struct regcache *regcache, | 237 struct type *type, struct regcache *regcache, |
| 238 gdb_byte *readbuf, const gdb_byte *writebuf) | 238 gdb_byte *readbuf, const gdb_byte *writebuf) |
| 239 { | 239 { |
| 240 if (mn10300_use_struct_convention (type)) | 240 if (mn10300_use_struct_convention (type)) |
| 241 return RETURN_VALUE_STRUCT_CONVENTION; | 241 return RETURN_VALUE_STRUCT_CONVENTION; |
| 242 | 242 |
| 243 if (readbuf) | 243 if (readbuf) |
| 244 mn10300_extract_return_value (gdbarch, type, regcache, readbuf); | 244 mn10300_extract_return_value (gdbarch, type, regcache, readbuf); |
| 245 if (writebuf) | 245 if (writebuf) |
| 246 mn10300_store_return_value (gdbarch, type, regcache, writebuf); | 246 mn10300_store_return_value (gdbarch, type, regcache, writebuf); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 /* Analyze the prologue to determine where registers are saved, | 380 /* Analyze the prologue to determine where registers are saved, |
| 381 the end of the prologue, etc. The result of this analysis is | 381 the end of the prologue, etc. The result of this analysis is |
| 382 returned in RESULT. See struct mn10300_prologue above for more | 382 returned in RESULT. See struct mn10300_prologue above for more |
| 383 information. */ | 383 information. */ |
| 384 static void | 384 static void |
| 385 mn10300_analyze_prologue (struct gdbarch *gdbarch, | 385 mn10300_analyze_prologue (struct gdbarch *gdbarch, |
| 386 CORE_ADDR start_pc, CORE_ADDR limit_pc, | 386 CORE_ADDR start_pc, CORE_ADDR limit_pc, |
| 387 struct mn10300_prologue *result) | 387 struct mn10300_prologue *result) |
| 388 { | 388 { |
| 389 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 389 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 390 CORE_ADDR pc, next_pc; | 390 CORE_ADDR pc; |
| 391 int rn; | 391 int rn; |
| 392 pv_t regs[MN10300_MAX_NUM_REGS]; | 392 pv_t regs[MN10300_MAX_NUM_REGS]; |
| 393 struct pv_area *stack; | 393 struct pv_area *stack; |
| 394 struct cleanup *back_to; | 394 struct cleanup *back_to; |
| 395 CORE_ADDR after_last_frame_setup_insn = start_pc; | 395 CORE_ADDR after_last_frame_setup_insn = start_pc; |
| 396 int am33_mode = AM33_MODE (gdbarch); | 396 int am33_mode = AM33_MODE (gdbarch); |
| 397 | 397 |
| 398 memset (result, 0, sizeof (*result)); | 398 memset (result, 0, sizeof (*result)); |
| 399 result->gdbarch = gdbarch; | 399 result->gdbarch = gdbarch; |
| 400 | 400 |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 | 1054 |
| 1055 do_cleanups (back_to); | 1055 do_cleanups (back_to); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 /* Function: skip_prologue | 1058 /* Function: skip_prologue |
| 1059 Return the address of the first inst past the prologue of the function. */ | 1059 Return the address of the first inst past the prologue of the function. */ |
| 1060 | 1060 |
| 1061 static CORE_ADDR | 1061 static CORE_ADDR |
| 1062 mn10300_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) | 1062 mn10300_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) |
| 1063 { | 1063 { |
| 1064 char *name; | 1064 const char *name; |
| 1065 CORE_ADDR func_addr, func_end; | 1065 CORE_ADDR func_addr, func_end; |
| 1066 struct mn10300_prologue p; | 1066 struct mn10300_prologue p; |
| 1067 | 1067 |
| 1068 /* Try to find the extent of the function that contains PC. */ | 1068 /* Try to find the extent of the function that contains PC. */ |
| 1069 if (!find_pc_partial_function (pc, &name, &func_addr, &func_end)) | 1069 if (!find_pc_partial_function (pc, &name, &func_addr, &func_end)) |
| 1070 return pc; | 1070 return pc; |
| 1071 | 1071 |
| 1072 mn10300_analyze_prologue (gdbarch, pc, func_end, &p); | 1072 mn10300_analyze_prologue (gdbarch, pc, func_end, &p); |
| 1073 return p.prologue_end; | 1073 return p.prologue_end; |
| 1074 } | 1074 } |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 | 1469 |
| 1470 /* Provide a prototype to silence -Wmissing-prototypes. */ | 1470 /* Provide a prototype to silence -Wmissing-prototypes. */ |
| 1471 extern initialize_file_ftype _initialize_mn10300_tdep; | 1471 extern initialize_file_ftype _initialize_mn10300_tdep; |
| 1472 | 1472 |
| 1473 void | 1473 void |
| 1474 _initialize_mn10300_tdep (void) | 1474 _initialize_mn10300_tdep (void) |
| 1475 { | 1475 { |
| 1476 gdbarch_register (bfd_arch_mn10300, mn10300_gdbarch_init, mn10300_dump_tdep); | 1476 gdbarch_register (bfd_arch_mn10300, mn10300_gdbarch_init, mn10300_dump_tdep); |
| 1477 } | 1477 } |
| 1478 | 1478 |
| OLD | NEW |