diff options
author | Roland McGrath <roland@redhat.com> | 2007-09-27 07:31:33 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2007-09-27 07:31:33 +0000 |
commit | c76f0b05676f6207affbfd85e75063db3b6eeccf (patch) | |
tree | 8ccc124a5908a03d34113a7dcdeb2abad7d71522 /backends | |
parent | cb6d865011ad98a8ac2018f072f396a2268739ca (diff) | |
download | elfutils-c76f0b05676f6207affbfd85e75063db3b6eeccf.tar.gz |
2007-09-27 Roland McGrath <roland@redhat.com>
* alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate.
* i386_retval.c: Likewise.
* ia64_retval.c: Likewise.
* ppc64_retval.c: Likewise.
* ppc_retval.c: Likewise.
* s390_retval.c: Likewise.
* sparc_retval.c: Likewise.
* x86_64_retval.c: Likewise.
Diffstat (limited to 'backends')
-rw-r--r-- | backends/ChangeLog | 11 | ||||
-rw-r--r-- | backends/alpha_retval.c | 20 | ||||
-rw-r--r-- | backends/i386_retval.c | 20 | ||||
-rw-r--r-- | backends/ia64_retval.c | 39 | ||||
-rw-r--r-- | backends/ppc64_retval.c | 32 | ||||
-rw-r--r-- | backends/ppc_retval.c | 25 | ||||
-rw-r--r-- | backends/s390_retval.c | 14 | ||||
-rw-r--r-- | backends/sparc_retval.c | 24 | ||||
-rw-r--r-- | backends/x86_64_retval.c | 24 |
9 files changed, 120 insertions, 89 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog index 159e6dc1..9c51f986 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,14 @@ +2007-09-27 Roland McGrath <roland@redhat.com> + + * alpha_retval.c: Use dwarf_attr_integrate and dwarf_hasattr_integrate. + * i386_retval.c: Likewise. + * ia64_retval.c: Likewise. + * ppc64_retval.c: Likewise. + * ppc_retval.c: Likewise. + * s390_retval.c: Likewise. + * sparc_retval.c: Likewise. + * x86_64_retval.c: Likewise. + 2007-08-23 Roland McGrath <roland@redhat.com> * x86_64_regs.c (x86_64_register_info): Put %rflags in "integer" set. diff --git a/backends/alpha_retval.c b/backends/alpha_retval.c index 09f8bb4c..57ba867b 100644 --- a/backends/alpha_retval.c +++ b/backends/alpha_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Alpha ELF ABI. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -66,7 +66,8 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -80,7 +81,7 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -91,9 +92,9 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -105,8 +106,8 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_ptr_to_member_type: { Dwarf_Word size; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) size = 8; @@ -116,8 +117,9 @@ alpha_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; *locp = loc_fpreg; diff --git a/backends/i386_retval.c b/backends/i386_retval.c index cfd50579..c3bab108 100644 --- a/backends/i386_retval.c +++ b/backends/i386_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Linux/i386 ABI. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -66,7 +66,8 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -80,7 +81,7 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -91,9 +92,9 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -105,8 +106,8 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_ptr_to_member_type: { Dwarf_Word size; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) size = 4; @@ -116,8 +117,9 @@ i386_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; if (encoding == DW_ATE_float) { diff --git a/backends/ia64_retval.c b/backends/ia64_retval.c index 4100328c..238cd9ef 100644 --- a/backends/ia64_retval.c +++ b/backends/ia64_retval.c @@ -1,5 +1,5 @@ /* Function return value location for IA64 ABI. - Copyright (C) 2006 Red Hat, Inc. + Copyright (C) 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -119,8 +119,8 @@ hfa_type (Dwarf_Die *typedie, const Dwarf_Op **locp, int fpregs_used) return -1; Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), &encoding) != 0) return -1; switch (encoding) @@ -174,8 +174,9 @@ hfa_type (Dwarf_Die *typedie, const Dwarf_Op **locp, int fpregs_used) case DW_TAG_member:; Dwarf_Die child_type_mem; Dwarf_Die *child_typedie - = dwarf_formref_die (dwarf_attr (&child_mem, DW_AT_type, - &attr_mem), + = dwarf_formref_die (dwarf_attr_integrate (&child_mem, + DW_AT_type, + &attr_mem), &child_type_mem); if (tag == DW_TAG_union_type) { @@ -207,10 +208,10 @@ hfa_type (Dwarf_Die *typedie, const Dwarf_Op **locp, int fpregs_used) break; Dwarf_Die base_type_mem; - Dwarf_Die *base_typedie = dwarf_formref_die (dwarf_attr (typedie, - DW_AT_type, - &attr_mem), - &base_type_mem); + Dwarf_Die *base_typedie + = dwarf_formref_die (dwarf_attr_integrate (typedie, DW_AT_type, + &attr_mem), + &base_type_mem); int used = hfa_type (base_typedie, locp, 0); if (used < 0 || used > 8) @@ -235,7 +236,8 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -261,9 +263,9 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -273,8 +275,8 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_enumeration_type: case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) size = 8; @@ -284,8 +286,9 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; switch (encoding) @@ -343,8 +346,8 @@ ia64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_class_type: case DW_TAG_union_type: case DW_TAG_array_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) return -1; /* If this qualifies as an homogeneous floating-point aggregate diff --git a/backends/ppc64_retval.c b/backends/ppc64_retval.c index 7f5e6f83..454897cc 100644 --- a/backends/ppc64_retval.c +++ b/backends/ppc64_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Linux/PPC64 ABI. - Copyright (C) 2005, 2006 Red Hat, Inc. + Copyright (C) 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -69,7 +69,8 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -83,7 +84,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -95,9 +96,9 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -107,8 +108,8 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_enumeration_type: case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) size = 8; @@ -118,8 +119,9 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; if (encoding == DW_ATE_float || encoding == DW_ATE_complex_float) @@ -150,20 +152,22 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_string_type: case DW_TAG_array_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) == 0 + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) == 0 && size <= 8) { if (tag == DW_TAG_array_type) { /* Check if it's a character array. */ - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); if (tag != DW_TAG_base_type) goto aggregate; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, + DW_AT_byte_size, + &attr_mem), + &size) != 0) return -1; if (size != 1) goto aggregate; diff --git a/backends/ppc_retval.c b/backends/ppc_retval.c index b8d86aca..fa0e303c 100644 --- a/backends/ppc_retval.c +++ b/backends/ppc_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Linux/PPC ABI. - Copyright (C) 2005, 2006 Red Hat, Inc. + Copyright (C) 2005, 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -71,7 +71,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -85,7 +86,7 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -97,9 +98,9 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -109,8 +110,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_enumeration_type: case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) size = 4; @@ -122,8 +123,10 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, + DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; if (encoding == DW_ATE_float) { @@ -145,8 +148,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_union_type: case DW_TAG_array_type: if (SVR4_STRUCT_RETURN - && dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) == 0 + && dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) == 0 && size > 0 && size <= 8) goto intreg; goto aggregate; diff --git a/backends/s390_retval.c b/backends/s390_retval.c index 6c430828..15bd97bf 100644 --- a/backends/s390_retval.c +++ b/backends/s390_retval.c @@ -1,5 +1,5 @@ /* Function return value location for S/390 ABI. - Copyright (C) 2006 Red Hat, Inc. + Copyright (C) 2006, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -67,7 +67,8 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -81,7 +82,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -93,7 +94,7 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); @@ -122,8 +123,9 @@ s390_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; if (encoding == DW_ATE_float && size <= 8) { diff --git a/backends/sparc_retval.c b/backends/sparc_retval.c index cfde0d2f..7cd38273 100644 --- a/backends/sparc_retval.c +++ b/backends/sparc_retval.c @@ -1,5 +1,5 @@ /* Function return value location for SPARC. - Copyright (C) 2006 Red Hat, Inc. + Copyright (C) 2006, 2007 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -59,7 +59,8 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -73,7 +74,7 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -85,9 +86,9 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -97,8 +98,8 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_enumeration_type: case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { uint8_t asize; Dwarf_Die cudie; @@ -111,8 +112,9 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; if (encoding == DW_ATE_float) { @@ -140,8 +142,8 @@ sparc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_class_type: case DW_TAG_union_type: case DW_TAG_array_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) == 0 + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) == 0 && size > 0 && size <= 8) goto intreg; goto aggregate; diff --git a/backends/x86_64_retval.c b/backends/x86_64_retval.c index 1920abf9..3109431e 100644 --- a/backends/x86_64_retval.c +++ b/backends/x86_64_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Linux/x86-64 ABI. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -80,7 +80,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) which is the type of the return value. */ Dwarf_Attribute attr_mem; - Dwarf_Attribute *attr = dwarf_attr (functypedie, DW_AT_type, &attr_mem); + Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, + &attr_mem); if (attr == NULL) /* The function has no return value, like a `void' function in C. */ return 0; @@ -94,7 +95,7 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -106,9 +107,9 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return -1; case DW_TAG_subrange_type: - if (! dwarf_hasattr (typedie, DW_AT_byte_size)) + if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size)) { - attr = dwarf_attr (typedie, DW_AT_type, &attr_mem); + attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem); typedie = dwarf_formref_die (attr, &die_mem); tag = dwarf_tag (typedie); } @@ -118,8 +119,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_enumeration_type: case DW_TAG_pointer_type: case DW_TAG_ptr_to_member_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) { if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type) size = 8; @@ -129,8 +130,9 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) if (tag == DW_TAG_base_type) { Dwarf_Word encoding; - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_encoding, - &attr_mem), &encoding) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding, + &attr_mem), + &encoding) != 0) return -1; switch (encoding) @@ -179,8 +181,8 @@ x86_64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_class_type: case DW_TAG_union_type: case DW_TAG_array_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, - &attr_mem), &size) != 0) + if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size, + &attr_mem), &size) != 0) return -1; if (size > 16) goto large; |