OLD | NEW |
1 /* Target-dependent code for PowerPC systems using the SVR4 ABI | 1 /* Target-dependent code for PowerPC systems using the SVR4 ABI |
2 for GDB, the GNU debugger. | 2 for GDB, the GNU debugger. |
3 | 3 |
4 Copyright (C) 2000-2003, 2005, 2007-2012 Free Software Foundation, | 4 Copyright (C) 2000-2003, 2005, 2007-2012 Free Software Foundation, |
5 Inc. | 5 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 if (TYPE_LENGTH (type) > tdep->wordsize) | 1034 if (TYPE_LENGTH (type) > tdep->wordsize) |
1035 regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, | 1035 regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4, |
1036 regvals + 1 * tdep->wordsize); | 1036 regvals + 1 * tdep->wordsize); |
1037 } | 1037 } |
1038 return RETURN_VALUE_REGISTER_CONVENTION; | 1038 return RETURN_VALUE_REGISTER_CONVENTION; |
1039 } | 1039 } |
1040 return RETURN_VALUE_STRUCT_CONVENTION; | 1040 return RETURN_VALUE_STRUCT_CONVENTION; |
1041 } | 1041 } |
1042 | 1042 |
1043 enum return_value_convention | 1043 enum return_value_convention |
1044 ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, | 1044 ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, |
1045 struct type *valtype, struct regcache *regcache, | 1045 struct type *valtype, struct regcache *regcache, |
1046 gdb_byte *readbuf, const gdb_byte *writebuf) | 1046 gdb_byte *readbuf, const gdb_byte *writebuf) |
1047 { | 1047 { |
1048 return do_ppc_sysv_return_value (gdbarch, func_type, valtype, regcache, | 1048 return do_ppc_sysv_return_value (gdbarch, |
1049 » » » » readbuf, writebuf, 0); | 1049 » » » » function ? value_type (function) : NULL, |
| 1050 » » » » valtype, regcache, readbuf, writebuf, 0); |
1050 } | 1051 } |
1051 | 1052 |
1052 enum return_value_convention | 1053 enum return_value_convention |
1053 ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch, | 1054 ppc_sysv_abi_broken_return_value (struct gdbarch *gdbarch, |
1054 » » » » struct type *func_type, | 1055 » » » » struct value *function, |
1055 struct type *valtype, | 1056 struct type *valtype, |
1056 struct regcache *regcache, | 1057 struct regcache *regcache, |
1057 gdb_byte *readbuf, const gdb_byte *writebuf) | 1058 gdb_byte *readbuf, const gdb_byte *writebuf) |
1058 { | 1059 { |
1059 return do_ppc_sysv_return_value (gdbarch, func_type, valtype, regcache, | 1060 return do_ppc_sysv_return_value (gdbarch, |
1060 » » » » readbuf, writebuf, 1); | 1061 » » » » function ? value_type (function) : NULL, |
| 1062 » » » » valtype, regcache, readbuf, writebuf, 1); |
1061 } | 1063 } |
1062 | 1064 |
1063 /* The helper function for 64-bit SYSV push_dummy_call. Converts the | 1065 /* The helper function for 64-bit SYSV push_dummy_call. Converts the |
1064 function's code address back into the function's descriptor | 1066 function's code address back into the function's descriptor |
1065 address. | 1067 address. |
1066 | 1068 |
1067 Find a value for the TOC register. Every symbol should have both | 1069 Find a value for the TOC register. Every symbol should have both |
1068 ".FN" and "FN" in the minimal symbol table. "FN" points at the | 1070 ".FN" and "FN" in the minimal symbol table. "FN" points at the |
1069 FN's descriptor, while ".FN" points at the entry point (which | 1071 FN's descriptor, while ".FN" points at the entry point (which |
1070 matches FUNC_ADDR). Need to reverse from FUNC_ADDR back to the | 1072 matches FUNC_ADDR). Need to reverse from FUNC_ADDR back to the |
1071 FN's descriptor address (while at the same time being careful to | 1073 FN's descriptor address (while at the same time being careful to |
1072 find "FN" in the same object file as ".FN"). */ | 1074 find "FN" in the same object file as ".FN"). */ |
1073 | 1075 |
1074 static int | 1076 static int |
1075 convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr) | 1077 convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr) |
1076 { | 1078 { |
1077 struct obj_section *dot_fn_section; | 1079 struct obj_section *dot_fn_section; |
1078 struct minimal_symbol *dot_fn; | 1080 struct minimal_symbol *dot_fn; |
1079 struct minimal_symbol *fn; | 1081 struct minimal_symbol *fn; |
1080 CORE_ADDR toc; | |
1081 /* Find the minimal symbol that corresponds to CODE_ADDR (should | 1082 /* Find the minimal symbol that corresponds to CODE_ADDR (should |
1082 have a name of the form ".FN"). */ | 1083 have a name of the form ".FN"). */ |
1083 dot_fn = lookup_minimal_symbol_by_pc (code_addr); | 1084 dot_fn = lookup_minimal_symbol_by_pc (code_addr); |
1084 if (dot_fn == NULL || SYMBOL_LINKAGE_NAME (dot_fn)[0] != '.') | 1085 if (dot_fn == NULL || SYMBOL_LINKAGE_NAME (dot_fn)[0] != '.') |
1085 return 0; | 1086 return 0; |
1086 /* Get the section that contains CODE_ADDR. Need this for the | 1087 /* Get the section that contains CODE_ADDR. Need this for the |
1087 "objfile" that it contains. */ | 1088 "objfile" that it contains. */ |
1088 dot_fn_section = find_pc_section (code_addr); | 1089 dot_fn_section = find_pc_section (code_addr); |
1089 if (dot_fn_section == NULL || dot_fn_section->objfile == NULL) | 1090 if (dot_fn_section == NULL || dot_fn_section->objfile == NULL) |
1090 return 0; | 1091 return 0; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 | 1704 |
1704 Return non-zero if the return-value is stored in a register, return | 1705 Return non-zero if the return-value is stored in a register, return |
1705 0 if the return-value is instead stored on the stack (a.k.a., | 1706 0 if the return-value is instead stored on the stack (a.k.a., |
1706 struct return convention). | 1707 struct return convention). |
1707 | 1708 |
1708 For a return-value stored in a register: when WRITEBUF is non-NULL, | 1709 For a return-value stored in a register: when WRITEBUF is non-NULL, |
1709 copy the buffer to the corresponding register return-value location | 1710 copy the buffer to the corresponding register return-value location |
1710 location; when READBUF is non-NULL, fill the buffer from the | 1711 location; when READBUF is non-NULL, fill the buffer from the |
1711 corresponding register return-value location. */ | 1712 corresponding register return-value location. */ |
1712 enum return_value_convention | 1713 enum return_value_convention |
1713 ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, | 1714 ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, |
1714 struct type *valtype, struct regcache *regcache, | 1715 struct type *valtype, struct regcache *regcache, |
1715 gdb_byte *readbuf, const gdb_byte *writebuf) | 1716 gdb_byte *readbuf, const gdb_byte *writebuf) |
1716 { | 1717 { |
1717 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); | 1718 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); |
1718 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 1719 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 1720 struct type *func_type = function ? value_type (function) : NULL; |
1719 int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0; | 1721 int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0; |
1720 | 1722 |
1721 /* This function exists to support a calling convention that | 1723 /* This function exists to support a calling convention that |
1722 requires floating-point registers. It shouldn't be used on | 1724 requires floating-point registers. It shouldn't be used on |
1723 processors that lack them. */ | 1725 processors that lack them. */ |
1724 gdb_assert (ppc_floating_point_unit_p (gdbarch)); | 1726 gdb_assert (ppc_floating_point_unit_p (gdbarch)); |
1725 | 1727 |
1726 /* Floats and doubles in F1. */ | 1728 /* Floats and doubles in F1. */ |
1727 if (TYPE_CODE (valtype) == TYPE_CODE_FLT && TYPE_LENGTH (valtype) <= 8) | 1729 if (TYPE_CODE (valtype) == TYPE_CODE_FLT && TYPE_LENGTH (valtype) <= 8) |
1728 { | 1730 { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 if (readbuf != NULL) | 1958 if (readbuf != NULL) |
1957 regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1 + i, | 1959 regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1 + i, |
1958 (bfd_byte *) readbuf + i * 8); | 1960 (bfd_byte *) readbuf + i * 8); |
1959 } | 1961 } |
1960 } | 1962 } |
1961 return RETURN_VALUE_REGISTER_CONVENTION; | 1963 return RETURN_VALUE_REGISTER_CONVENTION; |
1962 } | 1964 } |
1963 return RETURN_VALUE_STRUCT_CONVENTION; | 1965 return RETURN_VALUE_STRUCT_CONVENTION; |
1964 } | 1966 } |
1965 | 1967 |
OLD | NEW |