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] Relocate block range start and end addresses


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

commit 9644dc3a478d9ae85f1ca327ab3fa5ac0ce9fe64
Author: Kevin Buettner <kevinb@redhat.com>
Date:   Thu Aug 23 16:00:50 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  | 8 ++++++++
 gdb/objfiles.c | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 319c196..9da1125 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -49,6 +49,14 @@
 	* tracepoint.c (info_scope_command): Likewise.
 	* value.c (value_fn_field): Likewise.
 
+	* infrun.c (fill_in_stop_func): Use find_function_entry_range_from_pc
+	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-23  Xavier Roirand  <roirand@adacore.com>
 
 	* machoread.c (macho_symfile_read_all_oso): Remove uneeded
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index df28da5..4bffd20 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]