public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-multi-inferior: make BLOCK_START and BLOCK_END rvalues
@ 2010-10-01 15:29 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2010-10-01 15:29 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-multi-inferior has been updated
       via  bc524ff8d86e65d8315fe8708e67b775f4d4861f (commit)
      from  a87db5751bce6197360540b4d6a01bd088f8969b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit bc524ff8d86e65d8315fe8708e67b775f4d4861f
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Oct 1 09:27:57 2010 -0600

    make BLOCK_START and BLOCK_END rvalues

-----------------------------------------------------------------------

Summary of changes:
 gdb/block.c      |    4 ++--
 gdb/block.h      |    7 +++++--
 gdb/buildsym.c   |   10 +++++-----
 gdb/mdebugread.c |   37 ++++++++++++++++++++-----------------
 gdb/objfiles.c   |    6 ++++--
 5 files changed, 36 insertions(+), 28 deletions(-)

First 500 lines of diff:
diff --git a/gdb/block.c b/gdb/block.c
index 48ac21b..6825534 100644
--- a/gdb/block.c
+++ b/gdb/block.c
@@ -312,8 +312,8 @@ allocate_block (struct obstack *obstack)
 {
   struct block *bl = obstack_alloc (obstack, sizeof (struct block));
 
-  BLOCK_START (bl) = 0;
-  BLOCK_END (bl) = 0;
+  SET_BLOCK_START (bl, 0);
+  SET_BLOCK_END (bl, 0);
   BLOCK_FUNCTION (bl) = NULL;
   BLOCK_SUPERBLOCK (bl) = NULL;
   BLOCK_DICT (bl) = NULL;
diff --git a/gdb/block.h b/gdb/block.h
index 7eedb6c..476b331 100644
--- a/gdb/block.h
+++ b/gdb/block.h
@@ -98,13 +98,16 @@ struct block
   language_specific;
 };
 
-#define BLOCK_START(bl)		(bl)->startaddr
-#define BLOCK_END(bl)		(bl)->endaddr
+#define BLOCK_START(bl)		((bl)->startaddr + 0)
+#define BLOCK_END(bl)		((bl)->endaddr + 0)
 #define BLOCK_FUNCTION(bl)	(bl)->function
 #define BLOCK_SUPERBLOCK(bl)	(bl)->superblock
 #define BLOCK_DICT(bl)		(bl)->dict
 #define BLOCK_NAMESPACE(bl)   (bl)->language_specific.cplus_specific.namespace
 
+#define SET_BLOCK_START(bl, start) ((bl)->startaddr = (start))
+#define SET_BLOCK_END(bl, end) ((bl)->endaddr = (end))
+
 /* Macro to loop through all symbols in a block BL, in no particular
    order.  ITER helps keep track of the iteration, and should be a
    struct dict_iterator.  SYM points to the current symbol.  */
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 98b5d20..81ba842 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -254,8 +254,8 @@ finish_block (struct symbol *symbol, struct pending **listhead,
 					       *listhead);
     }
 
-  BLOCK_START (block) = start;
-  BLOCK_END (block) = end;
+  SET_BLOCK_START (block, start);
+  SET_BLOCK_END (block, end);
   /* Superblock filled in when containing block is made */
   BLOCK_SUPERBLOCK (block) = NULL;
   BLOCK_NAMESPACE (block) = NULL;
@@ -337,7 +337,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
 		     paddress (gdbarch, BLOCK_START (block)));
 	}
       /* Better than nothing */
-      BLOCK_END (block) = BLOCK_START (block);
+      SET_BLOCK_END (block, BLOCK_START (block));
     }
 
   /* Install this block as the superblock of all blocks made since the
@@ -377,9 +377,9 @@ finish_block (struct symbol *symbol, struct pending **listhead,
 			     paddress (gdbarch, BLOCK_END (block)));
 		}
 	      if (BLOCK_START (pblock->block) < BLOCK_START (block))
-		BLOCK_START (pblock->block) = BLOCK_START (block);
+		SET_BLOCK_START (pblock->block, BLOCK_START (block));
 	      if (BLOCK_END (pblock->block) > BLOCK_END (block))
-		BLOCK_END (pblock->block) = BLOCK_END (block);
+		SET_BLOCK_END (pblock->block, BLOCK_END (block));
 	    }
 	  BLOCK_SUPERBLOCK (pblock->block) = block;
 	}
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 234874e..49b7cfe 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -781,7 +781,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       b = new_block (FUNCTION_BLOCK);
       SYMBOL_BLOCK_VALUE (s) = b;
       BLOCK_FUNCTION (b) = s;
-      BLOCK_START (b) = BLOCK_END (b) = sh->value;
+      SET_BLOCK_START (b, sh->value);
+      SET_BLOCK_END (b, sh->value);
       BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
       add_block (b, top_stack->cur_st);
 
@@ -1113,7 +1114,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 
       top_stack->blocktype = stBlock;
       b = new_block (NON_FUNCTION_BLOCK);
-      BLOCK_START (b) = sh->value + top_stack->procadr;
+      SET_BLOCK_START (b, sh->value + top_stack->procadr);
       BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
       top_stack->cur_block = b;
       add_block (b, top_stack->cur_st);
@@ -1136,7 +1137,9 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 	  struct type *ftype = top_stack->cur_type;
 	  int i;
 
-	  BLOCK_END (top_stack->cur_block) += sh->value;	/* size */
+	  SET_BLOCK_END (top_stack->cur_block,
+			 BLOCK_END (top_stack->cur_block)
+			 + sh->value);	/* size */
 
 	  /* Make up special symbol to contain procedure specific info */
 	  s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
@@ -1162,8 +1165,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 		  && BLOCK_START (b_bad) == top_stack->procadr
 		  && BLOCK_END (b_bad) == top_stack->procadr)
 		{
-		  BLOCK_START (b_bad) = BLOCK_START (b);
-		  BLOCK_END (b_bad) = BLOCK_END (b);
+		  SET_BLOCK_START (b_bad, BLOCK_START (b));
+		  SET_BLOCK_END (b_bad, BLOCK_END (b));
 		}
 	    }
 
@@ -1204,7 +1207,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
 	  /* End of (code) block. The value of the symbol is the
 	     displacement from the procedure`s start address of the
 	     end of this block. */
-	  BLOCK_END (top_stack->cur_block) = sh->value + top_stack->procadr;
+	  SET_BLOCK_END (top_stack->cur_block, sh->value + top_stack->procadr);
 	}
       else if (sh->sc == scText && top_stack->blocktype == stNil)
 	{
@@ -4166,8 +4169,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
       top_stack->cur_st = st;
       top_stack->cur_block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (st),
 						STATIC_BLOCK);
-      BLOCK_START (top_stack->cur_block) = pst->textlow;
-      BLOCK_END (top_stack->cur_block) = 0;
+      SET_BLOCK_START (top_stack->cur_block, pst->textlow);
+      SET_BLOCK_END (top_stack->cur_block, 0);
       top_stack->blocktype = stFile;
       top_stack->cur_type = 0;
       top_stack->procadr = 0;
@@ -4631,9 +4634,9 @@ sort_blocks (struct symtab *s)
     {
       /* Cosmetic */
       if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) == 0)
-	BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) = 0;
+	SET_BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK), 0);
       if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) == 0)
-	BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) = 0;
+	SET_BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK), 0);
       return;
     }
   /*
@@ -4655,16 +4658,16 @@ sort_blocks (struct symtab *s)
     for (i = FIRST_LOCAL_BLOCK; i < j; i++)
       if (high < BLOCK_END (BLOCKVECTOR_BLOCK (bv, i)))
 	high = BLOCK_END (BLOCKVECTOR_BLOCK (bv, i));
-    BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) = high;
+    SET_BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK), high);
   }
 
-  BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) =
-    BLOCK_START (BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK));
+  SET_BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK),
+		   BLOCK_START (BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK)));
 
-  BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
-    BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
-  BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
-    BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
+  SET_BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK),
+		   BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)));
+  SET_BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK),
+		 BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)));
 }
 \f
 
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 70a1f2d..fdcd3f5 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -751,8 +751,10 @@ objfile_relocate1 (struct objfile *objfile,
 	  struct dict_iterator iter;
 
 	  b = BLOCKVECTOR_BLOCK (bv, i);
-	  BLOCK_START (b) += ANOFFSET (delta, s->block_line_section);
-	  BLOCK_END (b) += ANOFFSET (delta, s->block_line_section);
+	  SET_BLOCK_START (b, (BLOCK_START (b)
+			       + ANOFFSET (delta, s->block_line_section)));
+	  SET_BLOCK_END (b, (BLOCK_END (b)
+			     + ANOFFSET (delta, s->block_line_section)));
 
 	  ALL_BLOCK_SYMBOLS (b, iter, sym)
 	    {


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-01 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-01 15:29 [SCM] archer-tromey-multi-inferior: make BLOCK_START and BLOCK_END rvalues tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).