From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1100 invoked by alias); 17 May 2010 17:20:21 -0000 Received: (qmail 1088 invoked by uid 22791); 17 May 2010 17:20:19 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,TW_BJ X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 May 2010 17:20:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7F45F2BABF0; Mon, 17 May 2010 13:20:10 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sVU3YTxSUZsf; Mon, 17 May 2010 13:20:10 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 233082BABE2; Mon, 17 May 2010 13:20:10 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id BA184F58F9; Mon, 17 May 2010 19:20:05 +0200 (CEST) Date: Mon, 17 May 2010 17:24:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: Michael Snyder , "gdb-patches@sourceware.org" Subject: Re: [patch] ada-lang, c-lang, f-lang, objc-lang, jv-lang, m2-lang, ada-tasks.c: delete unused variables Message-ID: <20100517172005.GH2805@adacore.com> References: <4BE35310.9020704@vmware.com> <20100507031644.GZ2768@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="rJwd6BRFiFCcLxzm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00357.txt.bz2 --rJwd6BRFiFCcLxzm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 415 > Joel> Can you explain why using #if 0 instead of deleting these variables? > > I looked at that, too. There is (pseudo-)code that references these > variables, also in #if 0. > > I think any code in jv-* that has been #if 0 for 10 years can be deleted > with no loss. Definitely agree. Attached is what I just committed. I verified that every one of the #if 0 was from 1999 (probably version 1.1!). -- Joel --rJwd6BRFiFCcLxzm Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="jv-lang.diff" Content-length: 3339 commit 143c87d009f457090d320ab4b208447c32a32ce9 Author: Joel Brobecker Date: Mon May 17 10:16:55 2010 -0700 Remove commented-out code in jv-lang.c 2010-05-17 Joel Brobecker * jv-lang.c (java_lookup_class): Remove commented out code. (type_from_class): Likewise. (java_op_print_tab): Remove commented-out elements. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 171527d..1797f35 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2010-05-17 Joel Brobecker + * jv-lang.c (java_lookup_class): Remove commented out code. + (type_from_class): Likewise. + (java_op_print_tab): Remove commented-out elements. + +2010-05-17 Joel Brobecker + * ada-lang.c (to_fixed_range_type): The the raw index type as argument instead of the raw type name. Remove orig_type parameter. Update calls throughout. diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 2e700e3..53fd9a2 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -190,32 +190,8 @@ java_lookup_class (char *name) sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, NULL); if (sym != NULL) return SYMBOL_TYPE (sym); -#if 0 - CORE_ADDR addr; - - if (called from parser) - { - call lookup_class (or similar) in inferior; - if not - found: - return NULL; - addr = found in inferior; - } - else - addr = 0; - struct type *type; - - type = alloc_type (objfile); - TYPE_CODE (type) = TYPE_CODE_STRUCT; - INIT_CPLUS_SPECIFIC (type); - TYPE_TAG_NAME (type) = obsavestring (name, strlen (name), &objfile->objfile_obstack); - TYPE_STUB (type) = 1; - TYPE ? = addr; - return type; -#else /* FIXME - should search inferior's symbol table. */ return NULL; -#endif } /* Return a nul-terminated string (allocated on OBSTACK) for @@ -276,10 +252,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) struct value *utf8_name; char *nptr; CORE_ADDR addr; -#if 0 - struct block *bl; - struct dict_iterator iter; -#endif int is_array = 0; type = check_typedef (value_type (clas)); @@ -291,16 +263,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) } addr = value_address (clas); -#if 0 - get_java_class_symtab (); - bl = BLOCKVECTOR_BLOCK (BLOCKVECTOR (class_symtab), GLOBAL_BLOCK); - ALL_BLOCK_SYMBOLS (block, iter, sym) - { - if (SYMBOL_VALUE_ADDRESS (sym) == addr) - return SYMBOL_TYPE (sym); - } -#endif - objfile = get_dynamics_objfile (gdbarch); if (java_class_is_primitive (clas)) { @@ -1114,9 +1076,6 @@ const struct op_print java_op_print_tab[] = {"<", BINOP_LESS, PREC_ORDER, 0}, {">>", BINOP_RSH, PREC_SHIFT, 0}, {"<<", BINOP_LSH, PREC_SHIFT, 0}, -#if 0 - {">>>", BINOP_ ? ? ?, PREC_SHIFT, 0}, -#endif {"+", BINOP_ADD, PREC_ADD, 0}, {"-", BINOP_SUB, PREC_ADD, 0}, {"*", BINOP_MUL, PREC_MUL, 0}, @@ -1126,9 +1085,6 @@ const struct op_print java_op_print_tab[] = {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, {"~", UNOP_COMPLEMENT, PREC_PREFIX, 0}, {"*", UNOP_IND, PREC_PREFIX, 0}, -#if 0 - {"instanceof", ? ? ?, ? ? ?, 0}, -#endif {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0}, {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0}, {NULL, 0, 0, 0} --rJwd6BRFiFCcLxzm--