From c841afd52aeb4292e2d9b294b78b71f7bc14313a Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 11 Sep 2008 14:08:33 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 16 ++++++++++++++++ gdb/ada-exp.y | 3 +-- gdb/c-exp.y | 19 +++++-------------- gdb/f-exp.y | 6 +----- gdb/jv-exp.y | 6 +----- gdb/m2-exp.y | 7 +------ gdb/objc-exp.y | 19 +++++-------------- gdb/p-exp.y | 19 +++++-------------- gdb/parse.c | 16 ++++------------ gdb/parser-defs.h | 3 +-- 10 files changed, 40 insertions(+), 74 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 178b5478c12..d427f529f40 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,19 @@ +2008-09-11 Ulrich Weigand + + * 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. + 2008-09-10 Joel Brobecker * ada-lang.c (ada_parent_type): Add handling of the case where diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index c146baf1e2b..e44cc683bcc 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1370,8 +1370,7 @@ write_var_or_type (struct block *block, struct stoken name0) = 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; diff --git a/gdb/c-exp.y b/gdb/c-exp.y index bd04dc28b6a..7ebefcbd9df 100644 --- a/gdb/c-exp.y +++ b/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 diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 121b2472833..c50106cc7f1 100644 --- a/gdb/f-exp.y +++ b/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 diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 33cbdf99ab8..1ec73ab0951 100644 --- a/gdb/jv-exp.y +++ b/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 diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 951f778bf8d..bb1c4ea3ad2 100644 --- a/gdb/m2-exp.y +++ b/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 diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index 367b53515d0..cde056c2a64 100644 --- a/gdb/objc-exp.y +++ b/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."); diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 95ccdf11d89..0988481a7db 100644 --- a/gdb/p-exp.y +++ b/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 diff --git a/gdb/parse.c b/gdb/parse.c index ccd39570ff8..6b32d00a26d 100644 --- a/gdb/parse.c +++ b/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 *msymbol, 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; } diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index f49ff9e76aa..28cd02e0821 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -133,8 +133,7 @@ extern void write_exp_elt_block (struct block *); 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); -- 2.30.2