[PATCH, testsuite] Fix gdb.cp/nsalias.exp issues

Luis Machado lgustavo@codesourcery.com
Wed Jun 18 11:37:00 GMT 2014


On 06/18/2014 09:48 AM, Luis Machado wrote:
> Hi,
>
> I've been chasing failures on gdb.cp/nsalias.exp for MIPS, but the
> strange thing is that the failures only reproduced with a GDB built
> without optimization.
>
> Upon further investigation, i noticed the testcase was generating
> DW_AT_high_pc and DW_AT_low_pc entries with type DW_FORM_string, which
> is wrong.
>
> GDB was using that information to load data as strings, and then
> proceeded to use the string pointers as addresses.
>
> Even then, the test was passing just fine, because we were lucky enough
> to have the low_pc string pointer smaller than the high_pc string pointer.
>
> The following patch fixes two issues. The first one is the
> DW_FORM_string type. The second one is adjusting the addresses so that
> they are non-zero, since GDB doesn't like seeing 0 in these fields due
> to a check contained in dwarf2_get_pc_bounds:
>
>    if (low == 0 && !dwarf2_per_objfile->has_section_at_zero)
>      return 0;
>
> With both fixes, the testcase passes deterministically, and the failures
> i saw for the MIPS case were bad luck with the pointer comparisons.
>
> OK?

Updated patch without the spurious whitespaces before the closing brackets.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: nsalias.diff
Type: text/x-patch
Size: 876 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20140618/f5237770/attachment.bin>


More information about the Gdb-patches mailing list