From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22881 invoked by alias); 23 Oct 2002 21:17:10 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22856 invoked from network); 23 Oct 2002 21:17:09 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 23 Oct 2002 21:17:09 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g9NLH9K14463; Wed, 23 Oct 2002 14:17:09 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb-patches@sources.redhat.com Subject: [patch] some mindless additions of BLOCK_ macros From: David Carlton Date: Wed, 23 Oct 2002 14:17:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-10/txt/msg00476.txt.bz2 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 * 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;