[Bug libdw/22546] dwarf_aggregate_size() doesn't work for multi-dimensional arrays

2017-12-08 Thread sourceware at dima dot secretsauce.net
https://sourceware.org/bugzilla/show_bug.cgi?id=22546 --- Comment #3 from dima kogan --- Created attachment 10672 --> https://sourceware.org/bugzilla/attachment.cgi?id=10672&action=edit Update to the test suite to show this problem -- You are receiving this mail because: You are on the CC lis

[Bug libdw/22546] dwarf_aggregate_size() doesn't work for multi-dimensional arrays

2017-12-08 Thread sourceware at dima dot secretsauce.net
https://sourceware.org/bugzilla/show_bug.cgi?id=22546 --- Comment #4 from dima kogan --- Here's a patch to add the failing case to the test suite. This test update fails in the stock sources, but succeeds with my patch applied. Note that this patch contains a diff to a binary file (that's how the

[PATCH 1/2] Don't overflow in __libdw_in_section

2017-12-08 Thread Ulf Hermann
This exposes a bug in dwarf_formstring as detected by the dwarf-getmacros test. We cannot unconditionally assume that a string is in either the IDX_debug_info or the IDX_debug_types section as determined by cu_sec_idx. Change-Id: I6544d42b719587dd94330db484512bde6ce34e55 --- libdw/ChangeLog | 4

[PATCH 2/2] Generalize cu_sec_idx

2017-12-08 Thread Ulf Hermann
Apparently CUs can appear in other sections than IDX_debug_info and IDX_types. Rather than relying on the indirect indication provided by type_offset we compare the addresses directly to figure out which section a given CU belongs to. This fixes the dwarf-getmacros test. Change-Id: I83260622b55d

[PATCH 1/2 v2] Don't overflow in __libdw_in_section

2017-12-08 Thread Ulf Hermann
This exposes a bug in dwarf_formstring as detected by the dwarf-getmacros test. We cannot unconditionally assume that a string is in either the IDX_debug_info or the IDX_debug_types section as determined by cu_sec_idx. (Signed-off instead of Change-Id ...) Signed-off-by: Ulf Hermann --- libdw/

[PATCH 2/2 v2] Generalize cu_sec_idx

2017-12-08 Thread Ulf Hermann
Apparently CUs can appear in other sections than IDX_debug_info and IDX_types. Rather than relying on the indirect indication provided by type_offset we compare the addresses directly to figure out which section a given CU belongs to. This fixes the dwarf-getmacros test. (Signed-off instead of C