OLD | NEW |
1 /* Target-dependent code for Moxie. | 1 /* Target-dependent code for Moxie. |
2 | 2 |
3 Copyright (C) 2009-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2009-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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 return next_addr; | 212 return next_addr; |
213 } | 213 } |
214 | 214 |
215 /* Find the end of function prologue. */ | 215 /* Find the end of function prologue. */ |
216 | 216 |
217 static CORE_ADDR | 217 static CORE_ADDR |
218 moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) | 218 moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) |
219 { | 219 { |
220 CORE_ADDR func_addr = 0, func_end = 0; | 220 CORE_ADDR func_addr = 0, func_end = 0; |
221 char *func_name; | 221 const char *func_name; |
222 | 222 |
223 /* See if we can determine the end of the prologue via the symbol table. | 223 /* See if we can determine the end of the prologue via the symbol table. |
224 If so, then return either PC, or the PC after the prologue, whichever | 224 If so, then return either PC, or the PC after the prologue, whichever |
225 is greater. */ | 225 is greater. */ |
226 if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end)) | 226 if (find_pc_partial_function (pc, &func_name, &func_addr, &func_end)) |
227 { | 227 { |
228 CORE_ADDR post_prologue_pc | 228 CORE_ADDR post_prologue_pc |
229 = skip_prologue_using_sal (gdbarch, func_addr); | 229 = skip_prologue_using_sal (gdbarch, func_addr); |
230 if (post_prologue_pc != 0) | 230 if (post_prologue_pc != 0) |
231 return max (pc, post_prologue_pc); | 231 return max (pc, post_prologue_pc); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (len > 4) | 334 if (len > 4) |
335 { | 335 { |
336 regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp); | 336 regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp); |
337 store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp); | 337 store_unsigned_integer (valbuf + len - 4, 4, byte_order, tmp); |
338 } | 338 } |
339 } | 339 } |
340 | 340 |
341 /* Implement the "return_value" gdbarch method. */ | 341 /* Implement the "return_value" gdbarch method. */ |
342 | 342 |
343 static enum return_value_convention | 343 static enum return_value_convention |
344 moxie_return_value (struct gdbarch *gdbarch, struct type *func_type, | 344 moxie_return_value (struct gdbarch *gdbarch, struct value *function, |
345 struct type *valtype, struct regcache *regcache, | 345 struct type *valtype, struct regcache *regcache, |
346 gdb_byte *readbuf, const gdb_byte *writebuf) | 346 gdb_byte *readbuf, const gdb_byte *writebuf) |
347 { | 347 { |
348 if (TYPE_LENGTH (valtype) > 8) | 348 if (TYPE_LENGTH (valtype) > 8) |
349 return RETURN_VALUE_STRUCT_CONVENTION; | 349 return RETURN_VALUE_STRUCT_CONVENTION; |
350 else | 350 else |
351 { | 351 { |
352 if (readbuf != NULL) | 352 if (readbuf != NULL) |
353 moxie_extract_return_value (valtype, regcache, readbuf); | 353 moxie_extract_return_value (valtype, regcache, readbuf); |
354 if (writebuf != NULL) | 354 if (writebuf != NULL) |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 return -1; | 509 return -1; |
510 } | 510 } |
511 | 511 |
512 return extract_unsigned_integer (buf, length, byte_order); | 512 return extract_unsigned_integer (buf, length, byte_order); |
513 } | 513 } |
514 | 514 |
515 /* Parse the current instruction and record the values of the registers and | 515 /* Parse the current instruction and record the values of the registers and |
516 memory that will be changed in current instruction to "record_arch_list". | 516 memory that will be changed in current instruction to "record_arch_list". |
517 Return -1 if something wrong. */ | 517 Return -1 if something wrong. */ |
518 | 518 |
519 int | 519 static int |
520 moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, | 520 moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, |
521 CORE_ADDR addr) | 521 CORE_ADDR addr) |
522 { | 522 { |
523 gdb_byte buf[4]; | 523 gdb_byte buf[4]; |
524 uint16_t inst; | 524 uint16_t inst; |
525 uint32_t tmpu32; | 525 uint32_t tmpu32; |
526 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 526 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
527 | 527 |
528 if (record_debug > 1) | 528 if (record_debug > 1) |
529 fprintf_unfiltered (gdb_stdlog, "Process record: moxie_process_record " | 529 fprintf_unfiltered (gdb_stdlog, "Process record: moxie_process_record " |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 return gdbarch; | 998 return gdbarch; |
999 } | 999 } |
1000 | 1000 |
1001 /* Register this machine's init routine. */ | 1001 /* Register this machine's init routine. */ |
1002 | 1002 |
1003 void | 1003 void |
1004 _initialize_moxie_tdep (void) | 1004 _initialize_moxie_tdep (void) |
1005 { | 1005 { |
1006 register_gdbarch_init (bfd_arch_moxie, moxie_gdbarch_init); | 1006 register_gdbarch_init (bfd_arch_moxie, moxie_gdbarch_init); |
1007 } | 1007 } |
OLD | NEW |