Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] some mindless additions of BLOCK_ macros
@ 2002-10-23 14:17 David Carlton
  2002-10-23 16:04 ` Andrew Cagney
  2002-10-23 17:18 ` Elena Zannoni
  0 siblings, 2 replies; 8+ messages in thread
From: David Carlton @ 2002-10-23 14:17 UTC (permalink / raw)
  To: gdb-patches

I recently noticed that the BLOCK_ macros weren't used everywhere they
could be.  I know Andrew doesn't like macros, but given that these
ones are used almost everywhere, they might as well be used
everywhere.

I've tested the parse.c part of this by doing a make check, the
x86-64-tdep.c part by doing an all targets build and noticing that it
still compiles, and the objc-lang.c part hasn't been tested at all.
They're all trivial changes, so that amount of testing seems to me to
be sufficient.

This patch seems obvious to me; if nobody complains, I'll commit it in
a day or two.

David Carlton
carlton@math.stanford.edu

2002-10-23  David Carlton  <carlton@math.stanford.edu>

	* parse.c (parse_exp_1): Use BLOCK_START.
	* x86-64-tdep.c (x86_64_skip_prologue): Use BLOCK_END,
	SYMBOL_BLOCK_VALUE.
	* objc-lang.c (find_methods): Use BLOCK_START, BLOCK_END.

Index: parse.c
===================================================================
RCS file: /cvs/src/src/gdb/parse.c,v
retrieving revision 1.29
diff -u -p -r1.29 parse.c
--- parse.c	14 Oct 2002 01:50:44 -0000	1.29
+++ parse.c	23 Oct 2002 20:23:36 -0000
@@ -1123,7 +1123,7 @@ parse_exp_1 (char **stringptr, struct bl
   if (block)
     {
       expression_context_block = block;
-      expression_context_pc = block->startaddr;
+      expression_context_pc = BLOCK_START (block);
     }
   else
     expression_context_block = get_selected_block (&expression_context_pc);
Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.27
diff -u -p -r1.27 x86-64-tdep.c
--- x86-64-tdep.c	12 Sep 2002 08:39:26 -0000	1.27
+++ x86-64-tdep.c	23 Oct 2002 20:23:52 -0000
@@ -889,7 +889,7 @@ x86_64_skip_prologue (CORE_ADDR pc)
   if (!v_function || !v_function->ginfo.value.block || !v_sal.symtab)
     return pc;
 
-  endaddr = v_function->ginfo.value.block->endaddr;
+  endaddr = BLOCK_END (SYMBOL_BLOCK_VALUE (v_function));
 
   for (i = 0; i < v_sal.symtab->linetable->nitems; i++)
     if (v_sal.symtab->linetable->item[i].pc >= pc
Index: objc-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/objc-lang.c,v
retrieving revision 1.4
diff -u -p -r1.4 objc-lang.c
--- objc-lang.c	4 Oct 2002 01:18:48 -0000	1.4
+++ objc-lang.c	23 Oct 2002 20:24:04 -0000
@@ -1320,8 +1320,8 @@ find_methods (struct symtab *symtab, cha
 	continue;
 
       if (symtab)
-	if ((SYMBOL_VALUE_ADDRESS (msymbol) <  block->startaddr) ||
-	    (SYMBOL_VALUE_ADDRESS (msymbol) >= block->endaddr))
+	if ((SYMBOL_VALUE_ADDRESS (msymbol) <  BLOCK_START (block)) ||
+	    (SYMBOL_VALUE_ADDRESS (msymbol) >= BLOCK_END (block)))
 	  /* Not in the specified symtab.  */
 	  continue;
 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-10-24  0:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-23 14:17 [patch] some mindless additions of BLOCK_ macros David Carlton
2002-10-23 16:04 ` Andrew Cagney
2002-10-23 16:19   ` David Carlton
2002-10-23 16:59     ` Andrew Cagney
2002-10-23 17:20       ` David Carlton
2002-10-23 16:24   ` Daniel Jacobowitz
2002-10-23 16:50     ` David Carlton
2002-10-23 17:18 ` Elena Zannoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox