From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23786 invoked by alias); 31 Aug 2008 17:52:25 -0000 Received: (qmail 23130 invoked by uid 22791); 31 Aug 2008 17:52:10 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 31 Aug 2008 17:51:22 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id m7VHpHTM587332 for ; Sun, 31 Aug 2008 17:51:17 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m7VHpHea2326576 for ; Sun, 31 Aug 2008 19:51:17 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m7VHpHQP019976 for ; Sun, 31 Aug 2008 19:51:17 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m7VHpGgd019973 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 31 Aug 2008 19:51:16 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (localhost.localdomain [127.0.0.1]) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8) with ESMTP id m7VHpG4B002243 for ; Sun, 31 Aug 2008 19:51:16 +0200 Received: (from uweigand@localhost) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8/Submit) id m7VHpGww002242 for gdb-patches@sourceware.org; Sun, 31 Aug 2008 19:51:16 +0200 Message-Id: <20080831175116.375171000@de.ibm.com> References: <20080831175045.128504000@de.ibm.com> User-Agent: quilt/0.46-1 Date: Sun, 31 Aug 2008 17:52:00 -0000 From: uweigand@de.ibm.com To: gdb-patches@sourceware.org Subject: [rfc][01/37] Eliminate builtin_type_ macros: Unused write_exp_msymbol parameters Content-Disposition: inline; filename=diff-type-msym 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: 2008-08/txt/msg00684.txt.bz2 Hello, this patch removes the (unused) TEXT_SYMBOL_TYPE and DATA_SYMBOL_TYPE arguments from write_exp_msymbol, removing the need for all callers to construct type parameters to pass in. Bye, Ulrich ChangeLog: * parser-defs.h (write_exp_msymbol): Remove TEXT_SYMBOL_TYPE and DATA_SYMBOL_TYPE arguments. * parse.c (write_exp_msymbol): Remove TEXT_SYMBOL_TYPE and DATA_SYMBOL_TYPE arguments. Replace use of builtin_type_CORE_ADDR. (write_dollar_variable): Update call. * ada-exp.y (write_var_or_type): Update call. * c-exp.y: Likewise. * f-exp.y: Likewise. * jv-exp.y: Likewise. * m2-exp.y: Likewise. * objc-exp.y: Likewise. * p-exp.y: Likewise. Index: gdb-head/gdb/ada-exp.y =================================================================== --- gdb-head.orig/gdb/ada-exp.y +++ gdb-head/gdb/ada-exp.y @@ -1370,8 +1370,7 @@ write_var_or_type (struct block *block, = ada_lookup_simple_minsym (encoded_name); if (msym != NULL) { - write_exp_msymbol (msym, lookup_function_type (type_int ()), - type_int ()); + write_exp_msymbol (msym); /* Maybe cause error here rather than later? FIXME? */ write_selectors (encoded_name + tail_index); return NULL; Index: gdb-head/gdb/c-exp.y =================================================================== --- gdb-head.orig/gdb/c-exp.y +++ gdb-head/gdb/c-exp.y @@ -700,16 +700,11 @@ variable: qualified_name msymbol = lookup_minimal_symbol (name, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type (current_gdbarch)->builtin_int), - builtin_type (current_gdbarch)->builtin_int); - } + write_exp_msymbol (msymbol); + else if (!have_full_symbols () && !have_partial_symbols ()) + error ("No symbol table is loaded. Use the \"file\" command."); else - if (!have_full_symbols () && !have_partial_symbols ()) - error ("No symbol table is loaded. Use the \"file\" command."); - else - error ("No symbol \"%s\" in current context.", name); + error ("No symbol \"%s\" in current context.", name); } ; @@ -756,11 +751,7 @@ variable: name_not_typename msymbol = lookup_minimal_symbol (arg, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type (current_gdbarch)->builtin_int), - builtin_type (current_gdbarch)->builtin_int); - } + write_exp_msymbol (msymbol); else if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); else Index: gdb-head/gdb/f-exp.y =================================================================== --- gdb-head.orig/gdb/f-exp.y +++ gdb-head/gdb/f-exp.y @@ -510,11 +510,7 @@ variable: name_not_typename msymbol = lookup_minimal_symbol (arg, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); else if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); else Index: gdb-head/gdb/jv-exp.y =================================================================== --- gdb-head.orig/gdb/jv-exp.y +++ gdb-head/gdb/jv-exp.y @@ -1397,11 +1397,7 @@ push_expression_name (name) msymbol = lookup_minimal_symbol (tmp, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); else if (!have_full_symbols () && !have_partial_symbols ()) error (_("No symbol table is loaded. Use the \"file\" command")); else Index: gdb-head/gdb/m2-exp.y =================================================================== --- gdb-head.orig/gdb/m2-exp.y +++ gdb-head/gdb/m2-exp.y @@ -630,12 +630,7 @@ variable: NAME msymbol = lookup_minimal_symbol (arg, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol - (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); else if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"symbol-file\" command."); else Index: gdb-head/gdb/objc-exp.y =================================================================== --- gdb-head.orig/gdb/objc-exp.y +++ gdb-head/gdb/objc-exp.y @@ -715,16 +715,11 @@ variable: qualified_name msymbol = lookup_minimal_symbol (name, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); + else if (!have_full_symbols () && !have_partial_symbols ()) + error ("No symbol table is loaded. Use the \"file\" command."); else - if (!have_full_symbols () && !have_partial_symbols ()) - error ("No symbol table is loaded. Use the \"file\" command."); - else - error ("No symbol \"%s\" in current context.", name); + error ("No symbol \"%s\" in current context.", name); } ; @@ -771,11 +766,7 @@ variable: name_not_typename msymbol = lookup_minimal_symbol (arg, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); else if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); Index: gdb-head/gdb/parse.c =================================================================== --- gdb-head.orig/gdb/parse.c +++ gdb-head/gdb/parse.c @@ -400,16 +400,10 @@ write_exp_bitstring (struct stoken str) } /* Add the appropriate elements for a minimal symbol to the end of - the expression. The rationale behind passing in text_symbol_type and - data_symbol_type was so that Modula-2 could pass in WORD for - data_symbol_type. Perhaps it still is useful to have those types vary - based on the language, but they no longer have names like "int", so - the initial rationale is gone. */ + the expression. */ void -write_exp_msymbol (struct minimal_symbol *msymbol, - struct type *text_symbol_type, - struct type *data_symbol_type) +write_exp_msymbol (struct minimal_symbol *msymbol) { struct objfile *objfile = msymbol_objfile (msymbol); struct gdbarch *gdbarch = get_objfile_arch (objfile); @@ -436,7 +430,7 @@ write_exp_msymbol (struct minimal_symbol write_exp_elt_opcode (OP_LONG); /* Let's make the type big enough to hold a 64-bit address. */ - write_exp_elt_type (builtin_type_CORE_ADDR); + write_exp_elt_type (builtin_type (gdbarch)->builtin_core_addr); write_exp_elt_longcst ((LONGEST) addr); write_exp_elt_opcode (OP_LONG); @@ -576,9 +570,7 @@ write_dollar_variable (struct stoken str msym = lookup_minimal_symbol (copy_name (str), NULL, NULL); if (msym) { - write_exp_msymbol (msym, - lookup_function_type (builtin_type_int), - builtin_type_int); + write_exp_msymbol (msym); return; } Index: gdb-head/gdb/parser-defs.h =================================================================== --- gdb-head.orig/gdb/parser-defs.h +++ gdb-head/gdb/parser-defs.h @@ -133,8 +133,7 @@ extern void write_exp_elt_block (struct extern void write_exp_elt_objfile (struct objfile *objfile); -extern void write_exp_msymbol (struct minimal_symbol *, - struct type *, struct type *); +extern void write_exp_msymbol (struct minimal_symbol *); extern void write_dollar_variable (struct stoken str); Index: gdb-head/gdb/p-exp.y =================================================================== --- gdb-head.orig/gdb/p-exp.y +++ gdb-head/gdb/p-exp.y @@ -654,16 +654,11 @@ variable: qualified_name msymbol = lookup_minimal_symbol (name, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); + else if (!have_full_symbols () && !have_partial_symbols ()) + error ("No symbol table is loaded. Use the \"file\" command."); else - if (!have_full_symbols () && !have_partial_symbols ()) - error ("No symbol table is loaded. Use the \"file\" command."); - else - error ("No symbol \"%s\" in current context.", name); + error ("No symbol \"%s\" in current context.", name); } ; @@ -725,11 +720,7 @@ variable: name_not_typename msymbol = lookup_minimal_symbol (arg, NULL, NULL); if (msymbol != NULL) - { - write_exp_msymbol (msymbol, - lookup_function_type (builtin_type_int), - builtin_type_int); - } + write_exp_msymbol (msymbol); else if (!have_full_symbols () && !have_partial_symbols ()) error ("No symbol table is loaded. Use the \"file\" command."); else -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com