diff options
| author | Mark Wielaard <[email protected]> | 2014-12-27 16:16:29 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-01-16 09:01:57 +0100 |
| commit | f8198f2322b93dea4efbcf491b073a89e8aab1bf (patch) | |
| tree | 8fd39b0f2f54649e0fe8398cb0ef891b3cf1e03d /tests/addrscopes.c | |
| parent | b4b2de9f1f1fb694b77371a61f808a1641bbafea (diff) | |
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 <[email protected]>
Diffstat (limited to 'tests/addrscopes.c')
| -rw-r--r-- | tests/addrscopes.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 (""); |
