+2014-12-27 Mark Wielaard <mjw@redhat.com>
+
+ * dwfl_module_getsrc.c (dwfl_module_getsrc): Never match a line that
+ has end_sequence set.
+
2015-01-04 Mark Wielaard <mjw@redhat.com>
* cu.c (intern_cu): Store result and return directly when finding
l = idx;
}
- /* The last line which is less than or equal to addr is what we want,
- except with an end_sequence which can only be strictly equal. */
+ /* The last line which is less than or equal to addr is what
+ we want, unless it is the end_sequence which is after the
+ current line sequence. */
Dwarf_Line *line = &lines->info[l];
- if (line->addr == addr
- || (! line->end_sequence && line->addr < addr))
+ if (! line->end_sequence && line->addr <= addr)
return &cu->lines->idx[l];
}
+2014-12-27 Mark Wielaard <mjw@redhat.com>
+
+ * addrscopes.c (handle_address): Last address in scope is highpc - 1.
+ * funcscopes.c (handle_function): Likewise.
+ * run-addrscopes.sh: Adjust last address in scope.
+ * run-funcscopes.sh: Likewise.
+
2015-01-07 Mark Wielaard <mjw@redhat.com>
* run-addrcfi.sh: Add test for ppc32 eh_frame_hdr address search.
/* 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
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 ("");
/* 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
lowpc += a->dwbias;
highpc += a->dwbias;
Dwfl_Line *loline = dwfl_getsrc (a->dwfl, lowpc);
- Dwfl_Line *hiline = dwfl_getsrc (a->dwfl, highpc);
+ Dwfl_Line *hiline = dwfl_getsrc (a->dwfl, highpc - 1);
paddr (": ", lowpc, loline);
if (highpc != lowpc)
- paddr (" .. ", lowpc, hiline == loline ? NULL : hiline);
+ paddr (" .. ", highpc - 1, hiline == loline ? NULL : hiline);
}
puts ("");
#! /bin/sh
-# 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
testrun_compare ${abs_builddir}/addrscopes -e testfile22 0x8048353 <<\EOF
0x8048353:
- tests/foo.c (0x11): 0x8048348 (tests/foo.c:5) .. 0x804837e (tests/foo.c:16)
+ tests/foo.c (0x11): 0x8048348 (tests/foo.c:5) .. 0x804837c (tests/foo.c:16)
global [ be]
- function (0x2e): 0x8048348 (tests/foo.c:5) .. 0x804835b (tests/foo.c:14)
+ function (0x2e): 0x8048348 (tests/foo.c:5) .. 0x8048359 (tests/foo.c:11)
local [ 8f]
EOF
testfiles testfile24
testrun_compare ${abs_builddir}/addrscopes -e testfile24 0x804834e <<\EOF
0x804834e:
- inline-test.c (0x11): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x8048364 (/home/roland/build/stock-elfutils/inline-test.c:16)
- add (0x1d): 0x804834e (/home/roland/build/stock-elfutils/inline-test.c:3) .. 0x8048350 (/home/roland/build/stock-elfutils/inline-test.c:9)
+ inline-test.c (0x11): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x8048360 (/home/roland/build/stock-elfutils/inline-test.c:16)
+ add (0x1d): 0x804834e (/home/roland/build/stock-elfutils/inline-test.c:3) .. 0x804834f
y [ 9d]
x [ a2]
x (abstract)
#! /bin/sh
-# 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
testrun_compare ${abs_builddir}/funcscopes -e testfile25 incr <<\EOF
testfile25: 0x8048000 .. 0x8049528
- inline-test.c (0x11): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x804834f (/home/roland/build/stock-elfutils/inline-test.c:9)
- incr (0x2e): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x804834f (/home/roland/build/stock-elfutils/inline-test.c:9)
+ inline-test.c (0x11): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x804834e (/home/roland/build/stock-elfutils/inline-test.c:9)
+ incr (0x2e): 0x8048348 (/home/roland/build/stock-elfutils/inline-test.c:7) .. 0x804834e (/home/roland/build/stock-elfutils/inline-test.c:9)
x [ 66]
EOF