This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/gdb-8.2-branch] Relocate block range start and end addresses


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cb0f34520d4e4ad233696a293d69c979418f3ccd

commit cb0f34520d4e4ad233696a293d69c979418f3ccd
Author: Kevin Buettner <kevinb@redhat.com>
Date:   Fri Aug 24 22:22:46 2018 -0700

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

Diff:
---
 gdb/ChangeLog  | 2 ++
 gdb/objfiles.c | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f592b3a..71e4aa5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 95c39cf..7e4e5d3 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]