aboutsummaryrefslogtreecommitdiff
path: root/gdb/progspace.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-10-16 10:08:19 +0200
committerAndrew Burgess <andrew.burgess@embecosm.com>2015-12-10 09:53:46 +0000
commit28d2bfb9c3e519a3b7619bbe5d061ebe520750ef (patch)
tree6d5d3817360c2c2ae738248ea453e7b1d8b68031 /gdb/progspace.c
parentc74088593761f7e839aa9a97728df146f3dfb3d6 (diff)
downloadgdb-28d2bfb9c3e519a3b7619bbe5d061ebe520750ef.zip
gdb-28d2bfb9c3e519a3b7619bbe5d061ebe520750ef.tar.gz
gdb-28d2bfb9c3e519a3b7619bbe5d061ebe520750ef.tar.bz2
gdb: Handle multiple base address in debug_ranges data.
It is possible to use multiple base addresses within a single address range series, within the .debug_ranges section. The following is a simplified example for 32-bit addresses: .section ".debug_ranges" .4byte 0xffffffff .4byte BASE_1 .4byte START_OFFSET_1 .4byte END_OFFSET_1 .4byte START_OFFSET_2 .4byte END_OFFSET_2 .4byte 0xffffffff .4byte BASE_2 .4byte START_OFFSET_3 .4byte END_OFFSET_3 .4byte 0 .4byte 0 In this example START/END 1 and 2 are relative to BASE_1, while START/END 3 are relative to BASE_2. Currently gdb does not correctly parse this DWARF, resulting in corrupted address range information. This commit fixes this issue, and adds a new test to cover this case. In order to support testing of this feature extensions were made to the testsuite dwarf assembler, additional functionality was added to the .debug_line generation function, and a new function for generating the .debug_ranges section was added. gdb/ChangeLog: * dwarf2read.c (dwarf2_ranges_read): Unify and fix base address reading code. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-ranges-base.c: New file. * gdb.dwarf2/dw2-ranges-base.exp: New file. * lib/dwarf.exp (namespace eval Dwarf): Add new variables to support additional line table, and debug ranges generation. (Dwarf::ranges): New function, generate .debug_ranges. (Dwarf::lines): Support generating simple line table programs. (Dwarf::assemble): Initialise new namespace variables.
Diffstat (limited to 'gdb/progspace.c')
0 files changed, 0 insertions, 0 deletions