This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] some mindless additions of BLOCK_ macros
- From: David Carlton <carlton at math dot stanford dot edu>
- To: gdb-patches at sources dot redhat dot com
- Date: 23 Oct 2002 14:17:08 -0700
- Subject: [patch] some mindless additions of BLOCK_ macros
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;