Relocate block range start and end addresses
authorKevin Buettner <kevinb@redhat.com>
Sat, 25 Aug 2018 05:22:46 +0000 (22:22 -0700)
committerKevin Buettner <kevinb@redhat.com>
Sat, 25 Aug 2018 05:24:04 +0000 (22:24 -0700)
gdb/ChangeLog:

* objfiles.c (objfile_relocate1): Relocate start and end addresses
for each range in a block.

gdb/ChangeLog
gdb/objfiles.c

index f592b3a..71e4aa5 100644 (file)
@@ -54,6 +54,8 @@
        in place of find_pc_partial_function.
        * blockframe.c (find_function_entry_range_from_pc): New function.
        * symtab.h (find_function_entry_range_from_pc): Declare and document.
+       * objfiles.c (objfile_relocate1): Relocate start and end addresses
+       for each range in a block.
 
 2018-08-24  Pedro Alves  <palves@redhat.com>
            Simon Marchi  <simon.marchi@ericsson.com>
index 95c39cf..7e4e5d3 100644 (file)
@@ -831,6 +831,14 @@ objfile_relocate1 (struct objfile *objfile,
          BLOCK_START (b) += ANOFFSET (delta, block_line_section);
          BLOCK_END (b) += ANOFFSET (delta, block_line_section);
 
+         if (BLOCK_RANGES (b) != nullptr)
+           for (int j = 0; j < BLOCK_NRANGES (b); j++)
+             {
+               BLOCK_RANGE_START (b, j)
+                 += ANOFFSET (delta, block_line_section);
+               BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
+             }
+
          /* We only want to iterate over the local symbols, not any
             symbols in included symtabs.  */
          ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)