blob: 423aa2a2a5b605fd9f78c12ca54c58bcc04ad17c [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001/* Check whether DIE has specific attribute, integrating DW_AT_abstract_origin.
2 Copyright (C) 2005 Red Hat, Inc.
3
4 This program is Open Source software; you can redistribute it and/or
5 modify it under the terms of the Open Software License version 1.0 as
6 published by the Open Source Initiative.
7
8 You should have received a copy of the Open Software License along
9 with this program; if not, you may obtain a copy of the Open Software
10 License version 1.0 from http://www.opensource.org/licenses/osl.php or
11 by writing the Open Source Initiative c/o Lawrence Rosen, Esq.,
12 3001 King Ranch Road, Ukiah, CA 95482. */
13
14#ifdef HAVE_CONFIG_H
15# include <config.h>
16#endif
17
18#include <dwarf.h>
19#include "libdwP.h"
20
21int
22dwarf_hasattr_integrate (Dwarf_Die *die, unsigned int search_name)
23{
24 Dwarf_Die die_mem;
25
26 do
27 {
28 if (INTUSE(dwarf_hasattr) (die, search_name))
29 return 1;
30
31 Dwarf_Attribute attr_mem;
32 Dwarf_Attribute *attr = INTUSE(dwarf_attr) (die, DW_AT_abstract_origin,
33 &attr_mem);
34 if (attr == NULL)
35 break;
36
37 die = INTUSE(dwarf_formref_die) (attr, &die_mem);
38 }
39 while (die != NULL);
40
41 return 0;
42}