[obv] Fix build on i686
by Jan Kratochvil
Hi,
this is a regression by me. It fails the build on i686 but not on x86_64.
It was filed by Andrey Ponomarenko:
https://bugzilla.redhat.com/show_bug.cgi?id=985438
Checked in.
Jan
commit 8af254a19665c3baf6074a36ba2618413b80d169
Author: Jan Kratochvil <jan.kratochvil(a)redhat.com>
Date: Fri Jul 19 21:41:31 2013 +0200
__libdwfl_find_elf_build_id: Add missing internal_function keyword.
Signed-off-by: Jan Kratochvil <jan.kratochvil(a)redhat.com>
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 68406c9..af665f4 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-19 Jan Kratochvil <jan.kratochvil(a)redhat.com>
+
+ * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
+
2013-07-02 Mark Wielaard <mjw(a)redhat.com>
* relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
diff --git a/libdwfl/libdwflP.h b/libdwfl/libdwflP.h
index 69e6e12..1ca4763 100644
--- a/libdwfl/libdwflP.h
+++ b/libdwfl/libdwflP.h
@@ -370,7 +370,8 @@ extern Dwfl_Error __libdwfl_cu_getsrclines (struct dwfl_cu *cu)
extern int __libdwfl_find_elf_build_id (Dwfl_Module *mod, Elf *elf,
const void **build_id_bits,
GElf_Addr *build_id_elfaddr,
- int *build_id_len);
+ int *build_id_len)
+ internal_function;
/* Look in ELF for an NT_GNU_BUILD_ID note. If SET is true, store it
in MOD and return its length. If SET is false, instead compare it
10 years, 9 months
[PATCH] getcfi_scn_eh_frame: Don't crash and burn when .eh_frame bits aren't there.
by Mark Wielaard
Trying to read non-existing bits sometimes works and normally a sanity
check will fail. But it could also lead to an unexpected crash much later
when trying to use the non-existing data.
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
libdw/ChangeLog | 4 ++++
libdw/dwarf_getcfi_elf.c | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 59b6c63..7e39a2d 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-02 Mark Wielaard <mjw(a)redhat.com>
+
+ * dwarf_getcfi_elf.c (getcfi_shdr): Check sh_type == SHT_PROGBITS.
+
2013-05-03 Mark Wielaard <mjw(a)redhat.com>
* dwarf_getsrclines.c (dwarf_getsrclines): Only set end_sequence
diff --git a/libdw/dwarf_getcfi_elf.c b/libdw/dwarf_getcfi_elf.c
index ba00e05..a423ef3 100644
--- a/libdw/dwarf_getcfi_elf.c
+++ b/libdw/dwarf_getcfi_elf.c
@@ -280,8 +280,13 @@ getcfi_shdr (Elf *elf, const GElf_Ehdr *ehdr)
hdr_vaddr = shdr->sh_addr;
}
else if (!strcmp (name, ".eh_frame"))
- return getcfi_scn_eh_frame (elf, ehdr, scn, shdr,
- hdr_scn, hdr_vaddr);
+ {
+ if (shdr->sh_type == SHT_PROGBITS)
+ return getcfi_scn_eh_frame (elf, ehdr, scn, shdr,
+ hdr_scn, hdr_vaddr);
+ else
+ return NULL;
+ }
}
}
--
1.7.1
10 years, 9 months
[PATCH] readelf: print actual DW_OP_GNU_parameter_ref DIE offset.
by Mark Wielaard
DW_OP_GNU_parameter_ref takes as argument a CU relative offset to a
DW_TAG_formal_parameter DIE. Printing the just that relative offset
makes it hard to find the actual DIE in the output. Now print the
actual DIE offset instead (unless -U is given). We already passed
around the base address of the CU. Now we pass around the actual CU
so we can use it to find both the base address and the CU offset.
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
src/ChangeLog | 17 ++++++++++++
src/readelf.c | 81 ++++++++++++++++++++++++++++++++++----------------------
2 files changed, 66 insertions(+), 32 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 8373b70..051f964 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,20 @@
+2013-07-05 Mark Wielaard <mjw(a)redhat.com>
+
+ * readelf.c (print_ops): Take CU as argument, use it to print
+ parameter_ref DIE offset.
+ (struct listptr): Replace base field with cu.
+ (listptr_base): New function.
+ (compare_listptr): Use listptr_base.
+ (notice_listptr): Take CU as argument.
+ (skip_listptr_hole): Likewise.
+ (print_debug_ranges_section): Pass NULL as CU to skip_listptr_hole.
+ (print_cfa_program): Pass NULL as CU to print_ops.
+ (struct attrcb_args): Replace cu_base field with cu.
+ (attr_callback): Pass cu not cu_base to notice_listptr.
+ (print_debug_units): Don't calculate base, just set cu.
+ (print_debug_loc_section): Pass cu to skip_listptr_hole and
+ print_ops.
+
2013-05-06 Mark Wielaard <mjw(a)redhat.com>
* readelf.c (print_ops): Format first DW_OP_GNU_implicit_pointer
diff --git a/src/readelf.c b/src/readelf.c
index 236d088..d6208cb 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -3749,7 +3749,7 @@ print_block (size_t n, const void *block)
static void
print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
unsigned int vers, unsigned int addrsize, unsigned int offset_size,
- Dwarf_Word len, const unsigned char *data)
+ struct Dwarf_CU *cu, Dwarf_Word len, const unsigned char *data)
{
const unsigned int ref_size = vers < 3 ? addrsize : offset_size;
@@ -4035,7 +4035,7 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
indent, "", (uintmax_t) offset, op_name);
NEED (uleb);
print_ops (dwflmod, dbg, indent + 6, indent + 6, vers,
- addrsize, offset_size, uleb, data);
+ addrsize, offset_size, cu, uleb, data);
data += uleb;
CONSUME (data - start);
offset += 1 + (data - start);
@@ -4094,9 +4094,11 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
/* 4 byte CU relative reference to the abstract optimized away
DW_TAG_formal_parameter. */
NEED (4);
+ uintmax_t param_off = (uintmax_t) read_4ubyte_unaligned (dbg, data);
+ if (! print_unresolved_addresses && cu != NULL)
+ param_off += cu->start;
printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "]\n",
- indent, "", (uintmax_t) offset, op_name,
- (uintmax_t) read_4ubyte_unaligned (dbg, data));
+ indent, "", (uintmax_t) offset, op_name, param_off);
CONSUME (4);
data += 4;
offset += 5;
@@ -4127,12 +4129,32 @@ struct listptr
bool addr64:1;
bool dwarf64:1;
bool warned:1;
- Dwarf_Addr base;
+ struct Dwarf_CU *cu;
};
#define listptr_offset_size(p) ((p)->dwarf64 ? 8 : 4)
#define listptr_address_size(p) ((p)->addr64 ? 8 : 4)
+static Dwarf_Addr
+listptr_base (struct listptr *p)
+{
+ Dwarf_Addr base;
+ Dwarf_Die cu = CUDIE (p->cu);
+ /* Find the base address of the compilation unit. It will normally
+ be specified by DW_AT_low_pc. In DWARF-3 draft 4, the base
+ address could be overridden by DW_AT_entry_pc. It's been
+ removed, but GCC emits DW_AT_entry_pc and not DW_AT_lowpc for
+ compilation units with discontinuous ranges. */
+ if (unlikely (dwarf_lowpc (&cu, &base) != 0))
+ {
+ Dwarf_Attribute attr_mem;
+ if (dwarf_formaddr (dwarf_attr (&cu, DW_AT_entry_pc, &attr_mem),
+ &base) != 0)
+ base = 0;
+ }
+ return base;
+}
+
static int
compare_listptr (const void *a, const void *b, void *arg)
{
@@ -4161,7 +4183,7 @@ compare_listptr (const void *a, const void *b, void *arg)
gettext ("%s %#" PRIx64 " used with different offset sizes"),
name, (uint64_t) p1->offset);
}
- if (p1->base != p2->base)
+ if (listptr_base (p1) != listptr_base (p2))
{
p1->warned = p2->warned = true;
error (0, 0,
@@ -4194,7 +4216,7 @@ reset_listptr (struct listptr_table *table)
static void
notice_listptr (enum section_e section, struct listptr_table *table,
uint_fast8_t address_size, uint_fast8_t offset_size,
- Dwarf_Addr base, Dwarf_Off offset)
+ struct Dwarf_CU *cu, Dwarf_Off offset)
{
if (print_debug_sections & section)
{
@@ -4215,7 +4237,7 @@ notice_listptr (enum section_e section, struct listptr_table *table,
.addr64 = address_size == 8,
.dwarf64 = offset_size == 8,
.offset = offset,
- .base = base
+ .cu = cu
};
assert (p->offset == offset);
}
@@ -4232,7 +4254,7 @@ sort_listptr (struct listptr_table *table, const char *name)
static bool
skip_listptr_hole (struct listptr_table *table, size_t *idxp,
uint_fast8_t *address_sizep, uint_fast8_t *offset_sizep,
- Dwarf_Addr *base, ptrdiff_t offset,
+ Dwarf_Addr *base, struct Dwarf_CU **cu, ptrdiff_t offset,
unsigned char **readp, unsigned char *endp)
{
if (table->n == 0)
@@ -4265,7 +4287,9 @@ skip_listptr_hole (struct listptr_table *table, size_t *idxp,
if (offset_sizep != NULL)
*offset_sizep = listptr_offset_size (p);
if (base != NULL)
- *base = p->base;
+ *base = listptr_base (p);
+ if (cu != NULL)
+ *cu = p->cu;
return false;
}
@@ -4594,7 +4618,7 @@ print_debug_ranges_section (Dwfl_Module *dwflmod,
ptrdiff_t offset = readp - (unsigned char *) data->d_buf;
if (first && skip_listptr_hole (&known_rangelistptr, &listptr_idx,
- &address_size, NULL, &base,
+ &address_size, NULL, &base, NULL,
offset, &readp, endp))
continue;
@@ -4796,7 +4820,8 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
// XXX overflow check
get_uleb128 (op1, readp); /* Length of DW_FORM_block. */
printf (" def_cfa_expression %" PRIu64 "\n", op1);
- print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, op1, readp);
+ print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, NULL,
+ op1, readp);
readp += op1;
break;
case DW_CFA_expression:
@@ -4805,7 +4830,8 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
get_uleb128 (op2, readp); /* Length of DW_FORM_block. */
printf (" expression r%" PRIu64 " (%s) \n",
op1, regname (op1));
- print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, op2, readp);
+ print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, NULL,
+ op2, readp);
readp += op2;
break;
case DW_CFA_offset_extended_sf:
@@ -4848,7 +4874,8 @@ print_cfa_program (const unsigned char *readp, const unsigned char *const endp,
get_uleb128 (op2, readp); /* Length of DW_FORM_block. */
printf (" val_expression r%" PRIu64 " (%s)\n",
op1, regname (op1));
- print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0, op2, readp);
+ print_ops (dwflmod, dbg, 10, 10, version, ptr_size, 0,
+ NULL, op2, readp);
readp += op2;
break;
case DW_CFA_MIPS_advance_loc8:
@@ -5423,7 +5450,7 @@ struct attrcb_args
unsigned int version;
unsigned int addrsize;
unsigned int offset_size;
- Dwarf_Addr cu_base;
+ struct Dwarf_CU *cu;
};
@@ -5558,7 +5585,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_AT_GNU_call_site_target_clobbered:
notice_listptr (section_loc, &known_loclistptr,
cbargs->addrsize, cbargs->offset_size,
- cbargs->cu_base, num);
+ cbargs->cu, num);
if (!cbargs->silent)
printf (" %*s%-20s (%s) location list [%6" PRIxMAX "]\n",
(int) (level * 2), "", dwarf_attr_name (attr),
@@ -5568,7 +5595,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
case DW_AT_ranges:
notice_listptr (section_ranges, &known_rangelistptr,
cbargs->addrsize, cbargs->offset_size,
- cbargs->cu_base, num);
+ cbargs->cu, num);
if (!cbargs->silent)
printf (" %*s%-20s (%s) range list [%6" PRIxMAX "]\n",
(int) (level * 2), "", dwarf_attr_name (attr),
@@ -5707,7 +5734,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
print_ops (cbargs->dwflmod, cbargs->dbg,
12 + level * 2, 12 + level * 2,
cbargs->version, cbargs->addrsize, cbargs->offset_size,
- block.length, block.data);
+ attrp->cu, block.length, block.data);
break;
}
break;
@@ -5806,18 +5833,7 @@ print_debug_units (Dwfl_Module *dwflmod,
goto do_return;
}
- /* Find the base address of the compilation unit. It will
- normally be specified by DW_AT_low_pc. In DWARF-3 draft 4,
- the base address could be overridden by DW_AT_entry_pc. It's
- been removed, but GCC emits DW_AT_entry_pc and not DW_AT_lowpc
- for compilation units with discontinuous ranges. */
- if (unlikely (dwarf_lowpc (&dies[0], &args.cu_base) != 0))
- {
- Dwarf_Attribute attr_mem;
- if (dwarf_formaddr (dwarf_attr (&dies[0], DW_AT_entry_pc, &attr_mem),
- &args.cu_base) != 0)
- args.cu_base = 0;
- }
+ args.cu = dies[0].cu;
do
{
@@ -6509,6 +6525,7 @@ print_debug_loc_section (Dwfl_Module *dwflmod,
uint_fast8_t offset_size = 4;
bool first = true;
+ struct Dwarf_CU *cu = NULL;
Dwarf_Addr base = 0;
unsigned char *readp = data->d_buf;
unsigned char *const endp = (unsigned char *) data->d_buf + data->d_size;
@@ -6518,7 +6535,7 @@ print_debug_loc_section (Dwfl_Module *dwflmod,
if (first && skip_listptr_hole (&known_loclistptr, &listptr_idx,
&address_size, &offset_size, &base,
- offset, &readp, endp))
+ &cu, offset, &readp, endp))
continue;
if (unlikely (data->d_size - offset < address_size * 2))
@@ -6580,7 +6597,7 @@ print_debug_loc_section (Dwfl_Module *dwflmod,
}
print_ops (dwflmod, dbg, 1, 18 + (address_size * 4),
- 3 /*XXX*/, address_size, offset_size, len, readp);
+ 3 /*XXX*/, address_size, offset_size, cu, len, readp);
first = false;
readp += len;
--
1.7.1
10 years, 9 months
[PATCH] Don't assert on mod->e_type in __libdwfl_relocate_value.
by Mark Wielaard
When setting up the module and searching for an ELF file with a correct
build_id __libdwfl_relocate_value will be called for an ET_REL file in
__libdwfl_find_elf_build_id but mod->e_type is not yet setup in that case
because the Dwfl_Module isn't yet complete (the build-id could mismatch).
This can happen when using the dwfl_linux_kernel_find_elf callback when
it searches for the ELF file matching a kernel module.
---
libdwfl/ChangeLog | 4 ++++
libdwfl/relocate.c | 2 --
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index e000413..68406c9 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-02 Mark Wielaard <mjw(a)redhat.com>
+
+ * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
+
2013-06-05 Mark Wielaard <mjw(a)redhat.com>
* link_map.c (report_r_debug): Always call release_buffer after
diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c
index e06819d..bd51ad6 100644
--- a/libdwfl/relocate.c
+++ b/libdwfl/relocate.c
@@ -38,8 +38,6 @@ internal_function
__libdwfl_relocate_value (Dwfl_Module *mod, Elf *elf, size_t *shstrndx,
Elf32_Word shndx, GElf_Addr *value)
{
- assert (mod->e_type == ET_REL);
-
Elf_Scn *refscn = elf_getscn (elf, shndx);
GElf_Shdr refshdr_mem, *refshdr = gelf_getshdr (refscn, &refshdr_mem);
if (refshdr == NULL)
--
1.7.1
10 years, 9 months
[PATCH] libdw. Don't blow up stack in dwarf_getsrclines with lots of lines.
by Mark Wielaard
When a CU has a really large number of lines dwarf_getsrclines could blow
up the stack because it uses alloca for temporary storage. Use malloc and
free if the number of lines gets too big.
---
libdw/ChangeLog | 6 ++++++
libdw/dwarf_getsrclines.c | 22 ++++++++++++++++++++--
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 59b6c63..c595891 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-02 Mark Wielaard <mjw(a)redhat.com>
+
+ * dwarf_getsrclines.c (dwarf_getsrclines): Add new stack allocation
+ limit MAX_STACK_ALLOC. After MAX_STACK_ALLOC lines use malloc in
+ NEW_LINE macro. Free malloced line records if any at the end.
+
2013-05-03 Mark Wielaard <mjw(a)redhat.com>
* dwarf_getsrclines.c (dwarf_getsrclines): Only set end_sequence
diff --git a/libdw/dwarf_getsrclines.c b/libdw/dwarf_getsrclines.c
index fa4dd18..fb01465 100644
--- a/libdw/dwarf_getsrclines.c
+++ b/libdw/dwarf_getsrclines.c
@@ -328,12 +328,22 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
struct linelist *linelist = NULL;
unsigned int nlinelist = 0;
+ /* If there are a large number of lines don't blow up the stack.
+ Keep track of the last malloced linelist record and free them
+ through the next pointer at the end. */
+#define MAX_STACK_ALLOC 4096
+ struct linelist *malloc_linelist = NULL;
+
/* Adds a new line to the matrix.
We cannot simply define a function because we want to use alloca. */
#define NEW_LINE(end_seq) \
do { \
- if (unlikely (add_new_line (alloca (sizeof (struct linelist)), \
- end_seq))) \
+ struct linelist *ll = (nlinelist < MAX_STACK_ALLOC \
+ ? alloca (sizeof (struct linelist)) \
+ : malloc (sizeof (struct linelist))); \
+ if (nlinelist >= MAX_STACK_ALLOC) \
+ malloc_linelist = ll; \
+ if (unlikely (add_new_line (ll, end_seq))) \
goto invalid_data; \
} while (0)
@@ -712,6 +722,14 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
cu->lines->info[i].files = files;
}
+ /* Free malloced line records, if any. */
+ for (i = MAX_STACK_ALLOC; i < nlinelist; i++)
+ {
+ struct linelist *ll = malloc_linelist->next;
+ free (malloc_linelist);
+ malloc_linelist = ll;
+ }
+
/* Make sure the highest address for the CU is marked as end_sequence.
This is required by the DWARF spec, but some compilers forget and
dwfl_module_getsrc depends on it. */
--
1.7.1
10 years, 9 months
[PATCH] libdw_visit_scopes: Don't recurse into imported unit children.
by Mark Wielaard
There were two issues with __libdw_visit_scopes. First it returned an
error whenever called with a root DIE that didn't have any children.
However a DIE abbrev can have DW_CHILDREN_yes set and still have an
empty child list. It is inefficient and should be fixed in the DWARF
producer, but it is legal DWARF. Secondly __libdw_visit_scopes would
recurse into an imported unit and then forget about the rest of the
children of the root DIE. For an imported unit the children of that
unit DIE should be treated as if they were logical children of the
root DIE and not increase the recursion depth. Both issues were shown
by a systemtap bug using dwarf_getscopes () on a CU that had various
partial units imported through dwz.
See http://sourceware.org/bugzilla/show_bug.cgi?id=15671
Signed-off-by: Mark Wielaard <mjw(a)redhat.com>
---
libdw/ChangeLog | 7 +++
libdw/libdw_visit_scopes.c | 95 ++++++++++++++++++++++++--------------------
2 files changed, 59 insertions(+), 43 deletions(-)
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 59b6c63..31f1f48 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,10 @@
+2013-06-26 Mark Wielaard <mjw(a)redhat.com>
+
+ * libdw_visit_scopes.c (__libdw_visit_scopes): Don't reject root
+ DIEs without children. Don't call recurse and increase the depth
+ for an imported unit. Walk the children of an imported unit as
+ if they are logical children of the parent root DIE.
+
2013-05-03 Mark Wielaard <mjw(a)redhat.com>
* dwarf_getsrclines.c (dwarf_getsrclines): Only set end_sequence
diff --git a/libdw/libdw_visit_scopes.c b/libdw/libdw_visit_scopes.c
index ea0c6b4..7d27851 100644
--- a/libdw/libdw_visit_scopes.c
+++ b/libdw/libdw_visit_scopes.c
@@ -87,7 +87,7 @@ __libdw_visit_scopes (depth, root, previsit, postvisit, arg)
child.parent = root;
if (INTUSE(dwarf_child) (&root->die, &child.die) != 0)
- return -1;
+ return 0; // Having zero children is legal.
inline int recurse (void)
{
@@ -95,63 +95,72 @@ __libdw_visit_scopes (depth, root, previsit, postvisit, arg)
previsit, postvisit, arg);
}
- do
- {
- child.prune = false;
-
- if (previsit != NULL)
- {
- int result = (*previsit) (depth + 1, &child, arg);
- if (result != DWARF_CB_OK)
- return result;
- }
-
- if (!child.prune)
- switch (classify_die (&child.die))
+ inline int walk_children ()
+ {
+ do
+ {
+ /* For an imported unit, it is logically as if the children of
+ that unit are siblings of the other children. So don't do
+ a full recursion into the imported unit, but just walk the
+ children in place before moving to the next real child. */
+ while (classify_die (&child.die) == imported)
{
- case match:
- case match_inline:
- case walk:
- if (INTUSE(dwarf_haschildren) (&child.die))
+ Dwarf_Die orig_child_die = child.die;
+ Dwarf_Attribute attr_mem;
+ Dwarf_Attribute *attr = INTUSE(dwarf_attr) (&child.die,
+ DW_AT_import,
+ &attr_mem);
+ if (INTUSE(dwarf_formref_die) (attr, &child.die) != NULL
+ && INTUSE(dwarf_child) (&child.die, &child.die) == 0)
{
- int result = recurse ();
+ int result = walk_children ();
if (result != DWARF_CB_OK)
return result;
}
- break;
- case imported:
+ /* Any "real" children left? */
+ if (INTUSE(dwarf_siblingof) (&orig_child_die, &child.die) != 0)
+ return 0;
+ };
+
+ child.prune = false;
+
+ if (previsit != NULL)
+ {
+ int result = (*previsit) (depth + 1, &child, arg);
+ if (result != DWARF_CB_OK)
+ return result;
+ }
+
+ if (!child.prune)
+ switch (classify_die (&child.die))
{
- /* This imports another compilation unit to appear
- as part of this one, inside the current scope.
- Recurse to search the referenced unit, but without
- recording it as an inner scoping level. */
-
- Dwarf_Attribute attr_mem;
- Dwarf_Attribute *attr = INTUSE(dwarf_attr) (&child.die,
- DW_AT_import,
- &attr_mem);
- if (INTUSE(dwarf_formref_die) (attr, &child.die) != NULL)
+ case match:
+ case match_inline:
+ case walk:
+ if (INTUSE(dwarf_haschildren) (&child.die))
{
int result = recurse ();
if (result != DWARF_CB_OK)
return result;
}
+ break;
+
+ default:
+ break;
}
- break;
- default:
- break;
+ if (postvisit != NULL)
+ {
+ int result = (*postvisit) (depth + 1, &child, arg);
+ if (result != DWARF_CB_OK)
+ return result;
}
+ }
+ while (INTUSE(dwarf_siblingof) (&child.die, &child.die) == 0);
- if (postvisit != NULL)
- {
- int result = (*postvisit) (depth + 1, &child, arg);
- if (result != DWARF_CB_OK)
- return result;
- }
- }
- while (INTUSE(dwarf_siblingof) (&child.die, &child.die) == 0);
+ return 0;
+ }
- return 0;
+ return walk_children ();
}
--
1.7.1
10 years, 9 months
[COMMITTED] tests EXTRA_DIST typo, forgot extension in testfilenolines.bz2.
by Mark Wielaard
diff --git a/tests/ChangeLog b/tests/ChangeLog
index eca60c3..a080a73 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-02 Mark Wielaard <mjw(a)redhat.com>
+
+ * Makefile.am (EXTRA_DIST): Fix typo, forgot extension in
+ testfilenolines.bz2.
+
2013-05-30 Jan Kratochvil <jan.kratochvil(a)redhat.com>
* Makefile.am (EXTRA_DIST): Add test-core-lib.so.bz2,
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2d819c5..4fe0022 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -199,7 +199,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfile70.core.bz2 testfile70.exec.bz2 \
run-dwfllines.sh run-dwfl-report-elf-align.sh \
testfile-dwfl-report-elf-align-shlib.so.bz2 \
- testfilenolines test-core-lib.so.bz2 test-core.core.bz2 \
+ testfilenolines.bz2 test-core-lib.so.bz2 test-core.core.bz2 \
test-core.exec.bz2
if USE_VALGRIND
--
1.7.1
10 years, 9 months