diff mbox

[7/8] Relocate block range start and end addresses

Message ID 20180625235520.217392f1@pinnacle.lan
State New
Headers show

Commit Message

Kevin Buettner June 26, 2018, 6:55 a.m. UTC
gdb/ChangeLog:
    
    	* objfiles.c (objfile_relocate1): Relocate start and end addresses
    	for each range in a block.
---
 gdb/objfiles.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Simon Marchi Aug. 1, 2018, 2:30 a.m. UTC | #1
On 2018-06-26 02:55 AM, Kevin Buettner wrote:
> gdb/ChangeLog:
>     
>     	* objfiles.c (objfile_relocate1): Relocate start and end addresses
>     	for each range in a block.
> ---
>  gdb/objfiles.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/gdb/objfiles.c b/gdb/objfiles.c
> index 95c39cf..21ca111 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

Otherwise, LGTM.

Simon
diff mbox

Patch

diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 95c39cf..21ca111 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))
+	    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)