tidy up: parse DW_AT_specification like DW_AT_abstract_origin
This commit is contained in:
parent
22c82d5b7b
commit
6f5d40c1b7
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dwarf_attrval.c,v 1.6 2016/03/17 19:02:38 christos Exp $ */
|
||||
/* $NetBSD: dwarf_attrval.c,v 1.7 2016/03/18 14:58:18 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2007 John Birrell (jb@freebsd.org)
|
||||
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "_libdwarf.h"
|
||||
|
||||
__RCSID("$NetBSD: dwarf_attrval.c,v 1.6 2016/03/17 19:02:38 christos Exp $");
|
||||
__RCSID("$NetBSD: dwarf_attrval.c,v 1.7 2016/03/18 14:58:18 christos Exp $");
|
||||
ELFTC_VCSID("Id: dwarf_attrval.c 3159 2015-02-15 21:43:27Z emaste ");
|
||||
|
||||
int
|
||||
|
@ -177,7 +177,8 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dwarf_Half attr, Dwarf_Unsigned *valp, Dwa
|
|||
}
|
||||
|
||||
if (at == NULL &&
|
||||
(at = _dwarf_attr_find(die, DW_AT_abstract_origin)) != NULL) {
|
||||
((at = _dwarf_attr_find(die, DW_AT_specification)) != NULL ||
|
||||
(at = _dwarf_attr_find(die, DW_AT_abstract_origin)) != NULL)) {
|
||||
switch (at->at_form) {
|
||||
case DW_FORM_ref1:
|
||||
case DW_FORM_ref2:
|
||||
|
@ -192,11 +193,6 @@ dwarf_attrval_unsigned(Dwarf_Die die, Dwarf_Half attr, Dwarf_Unsigned *valp, Dwa
|
|||
}
|
||||
}
|
||||
|
||||
if (at == NULL &&
|
||||
(at = _dwarf_attr_find(die, DW_AT_specification)) != NULL) {
|
||||
at = dwarf_indirect_find(dbg, die, attr, at->u[0].u64);
|
||||
}
|
||||
|
||||
if (at == NULL) {
|
||||
DWARF_SET_ERROR(dbg, err, DW_DLE_NO_ENTRY);
|
||||
return (DW_DLV_NO_ENTRY);
|
||||
|
|
Loading…
Reference in New Issue