From f8198f2322b93dea4efbcf491b073a89e8aab1bf Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sat, 27 Dec 2014 16:16:29 +0100 Subject: libdwfl: dwfl_module_getsrc should never match end_sequence line. The line with end_sequence set has an address outside the current line sequence. An end_sequence line has no other useful information except marking the address as out of range. Two tests, addrscopes and funcscopes, depended on matching the end_sequence line. But that was because they included the high_pc address in the scope. However the high_pc attributes has as address the first location past the range associated with a given DIE. Adjust the tests to use high_pc - 1 as end of the scope. Signed-off-by: Mark Wielaard --- tests/addrscopes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/addrscopes.c') diff --git a/tests/addrscopes.c b/tests/addrscopes.c index fca61d33..2285d2ca 100644 --- a/tests/addrscopes.c +++ b/tests/addrscopes.c @@ -1,5 +1,5 @@ /* Test program for dwarf_getscopes. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2014 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -125,10 +125,10 @@ handle_address (GElf_Addr pc, Dwfl *dwfl) lowpc += cubias; highpc += cubias; Dwfl_Line *loline = dwfl_getsrc (dwfl, lowpc); - Dwfl_Line *hiline = dwfl_getsrc (dwfl, highpc); + Dwfl_Line *hiline = dwfl_getsrc (dwfl, highpc - 1); paddr (": ", lowpc, loline); if (highpc != lowpc) - paddr (" .. ", lowpc, hiline == loline ? NULL : hiline); + paddr (" .. ", highpc - 1, hiline == loline ? NULL : hiline); } puts (""); -- cgit v1.2.3