summaryrefslogtreecommitdiff
path: root/gdb/parser-defs.h
Commit message (Collapse)AuthorAgeFilesLines
* * language.h (language_defn): Add new la_post_parser field.Paul N. Hilfinger2004-04-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * parser-defs.h (null_post_parser): New declaration (default for la_post_parser). * parse.c (parse_exp_1): Move code to parse_exp_in_context and insert call to that function. (parse_exp_in_context): New function, including code formerly in parse_exp_1. Calls language-dependent post-parser after prefixification. (parse_expression_in_context): New exported function. (null_post_parser): New definition. * expression.h (parse_expression_in_context): Add declaration. * p-lang.c (pascal_language_defn): Add trivial post-parser. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * f-lang.c (f_language_defn): Ditto. * jv-lang.c (java_language_defn): Ditto. * language.c (unknown_language_defn): Ditto. (auto_language_defn): Ditto. (local_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * scm-lang.c (scm_language_defn): Ditto. * obj-lang.c (objc_language_defn): Ditto.
* * parser-defs.h (struct exp_descriptor): New definition, containingPaul N. Hilfinger2003-09-251-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | language-specific info for printing, prefixifying, dumping, and evaluating expressions. (exp_descriptor_standard): Declare new variable. (print_subexp): Make global and declare here (from expprint.c). (dump_subexp): Ditto. (dump_subexp_body_standard): Declare. (operator_length_standard): Declare. (op_name_standard): Declare. (print_subexp): Declare. (print_subexp_standard): Declare. * language.h (struct language_defn): Add la_exp_desc field to hold pointer to table for language-specific operators. Remove evaluate_exp field, which is now in struct exp_descriptor. * parse.c (operator_length): Move most code to new operator_length_standard function. Use language-specific information. (operator_length_standard): New function taking most code from operator_length. (exp_descriptor_standard): New constant. * expression.h (enum exp_opcode): Add definitions of OP_EXTENDED0 and OP_EXTENDED_LAST. * expprint.c (print_subexp): Use language-specific print_subexp. Make global; remove static declaration. Move most code to print_subexp_standard. (print_subexp_standard): New function, containing code formerly in print_subexp. (op_name): Add expression to argument signature. Use langauge-specific op_name. Move most code to op_name_standard. (op_name_standard): New function, containing code formerly in op_name. (dump_subexp): Use new version of op_name function. Use language-specific dump_subexp_body, and move most existing code to dump_subexp_body_standard. (dump_raw_expression): Use new op_name interface. (dump_subexp_body): Move most code to dump_subexp_body_standard. (dump_subexp_body_standard): New function, containing code formerly in dump_subexp_body. * language.c (unknown_language): Add default la_exp_desc field and remove evaluate_exp field. (auto_language): Ditto. (local_language): Ditto. * f-lang.c (f_language_defn): Ditto. * c-lang.c (c_language_defn): Ditto. (cplus_language_defn): Ditto. (asm_language_defn): Ditto. (minimal_language_defn): Ditto. * p-lang.c (pascal_language_defn): Ditto. * m2-lang.c (m2_language_defn): Ditto. * objc-lang.c (objc_language_defn): Ditto. * jv-lang.c (exp_descriptor_java): New variable, containing Java-specific expression evaluator. (java_language_defn): Add la_exp_desc field and remove evaluate_exp field. * scm-lang.c (exp_descriptor_scm): New variable, containing Scheme-specific expression evaluator. (scm_language_defn): Add la_exp_desc field and remove evaluate_exp field. * objc-lang.c (print_object_command): Take evaluate_exp from the la_exp_desc field. * Makefile.in (eval.o): Add dependency on parser-defs.h. * eval.c: Include parser-defs.h for the full declaration of la_exp_desc's type. (evaluate_subexp): Get evaluate_exp out of la_exp_desc field.
* * parser-defs.h (operator_length): Declare.Paul N. Hilfinger2003-09-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.c (length_of_subexp): Use operator_length to get operator lengths and arities for operators. Move most code to new operator_length function. (operator_length): New function absorbing most code from length_of_subexp. (prefixify_subexp): Remove large case and use operator_length instead. (parse_exp_1): Use renamings: dump_prefix_expression => dump_raw_expression and dump_postfix_expression => dump_prefix_expression. * expression.h (dump_prefix_expression): Rename to ... (dump_raw_expression): New name. (dump_postfix_expression): Rename to ... (dump_prefix_expression): New name. * expprint.c (dump_subexp): Make global. Add comment. Move most existing code to dump_subexp_body. (dump_subexp_body): New function. (dump_prefix_expression): Rename to dump_raw_expression. Remove attempt to print the expression via print_expression: it can't work before the expression is prefixified. (dump_raw_expression): Renamed from dump_prefix_expression. (dump_postfix_expression): Rename to dump_prefix_expression, since that's what it does. Remove 'note' parameter, since this routine must be used on prefixified expression. (dump_prefix_expression): Renamed from dump_postfix_expression.
* 2003-02-19 David Carlton <carlton@math.stanford.edu>David Carlton2003-02-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.in (SFILES): Add block.c. (block_h): New. (COMMON_OBS): Add block.o. (block.o): New. (x86-64-tdep.o): Add $(block_h). (values.o, valops.o, tracepoint.o, symtab.o, symmisc.o, symfile.o) (stack.o, printcmd.o, p-exp.tab.o, parse.o, objfiles.o) (objc-exp.tab.o, objc-lang.o, nlmread.o, mips-tdep.o, mdebugread.o) (m2-exp.tab.o, linespec.o, jv-lang.o, jv-exp.tab.o, infcmd.o) (f-valprint.o, findvar.o, f-exp.tab.o, expprint.o, coffread.o) (c-exp.tab.o, buildsym.o, breakpoint.o, blockframe.o, ax-gdb.o) (alpha-tdep.o, ada-lang.o, ada-exp.tab.o, mi-cmd-stack.o): Ditto. * value.h: Add opaque declaration for struct block. * parser-defs.h, objc-lang.h, buildsym.h, breakpoint.h: Ditto. * ada-lang.h: Ditto. * x86-64-tdep.c: #include "block.h" * values.c, valops.c, tracepoint.c, symtab.c, symmisc.c: Ditto. * symfile.c, stack.c, printcmd.c, p-exp.y, parse.c: Ditto. * objfiles.c, objc-exp.y, objc-lang.c, nlmread.c: Ditto. * mips-tdep.c, mdebugread.c, m2-exp.y, linespec.c: Ditto. * jv-lang.c, jv-exp.y, infcmd.c, f-valprint.c: Ditto. * findvar.c, f-exp.y, expprint.c, coffread.c, c-exp.y: Ditto. * buildsym.c, breakpoint.c, blockframe.c, ax-gdb.c: Ditto. * alpha-tdep.c, ada-lang.c, ada-exp.y: Ditto. * blockframe.c (blockvector_for_pc_sect): Move to "block.c". (blockvector_for_pc, block_for_pc_sect, block_for_pc): Ditto. * symtab.c (block_function): Ditto. (contained_in): Ditto. * frame.h: Move block_for_pc and block_for_pc_sect declarations to block.h. Add opaque declaration for struct block. * symtab.h: Move block_function and contained_in declarations to block.h. Add opaque declarations for struct block, struct blockvector. (struct block): Move to block.h. (struct blockvector): Ditto. (BLOCK_START, BLOCK_END, BLOCK_FUNCTION, BLOCK_SUPERBLOCK) (BLOCK_GCC_COMPILED, BLOCK_HASHTABLE, BLOCK_NSYMS, BLOCK_SYM) (BLOCK_BUCKETS, BLOCK_BUCKET, BLOCK_HASHTABLE_SIZE) (ALL_BLOCK_SYMBOLS, BLOCK_SHOULD_SORT, BLOCKVECTOR_NBLOCKS) (BLOCKVECTOR_BLOCK, GLOBAL_BLOCK, STATIC_BLOCK, FIRST_LOCAL_BLOCK): Ditto. * block.c: New file. * block.h: New file. 2003-02-19 David Carlton <carlton@math.stanford.edu> * mi-cmd-stack.c: #include "block.h"
* gdb/parser-defs.h: (struct objc_class_str): New structureAdam Fedor2002-11-191-0/+8
| | | | for parsing ObjC classes.
* 2002-09-25 Andrew Cagney <cagney@redhat.com>Andrew Cagney2002-09-251-6/+0
| | | | | | | | | | | | | | | | | | | | | | * frame.c: Include "gdb_string.h" and "builtin-regs.h". (frame_map_regnum_to_name): New function. (frame_map_name_to_regnum): New function. * frame.h (frame_map_name_to_regnum): Declare. (frame_map_regnum_to_name): Declare. * builtin-regs.c (builtin_reg_map_regnum_to_name): New function. * builtin-regs.h (builtin_reg_map_regnum_to_name): Declare. * parse.c: Do not include "builtin-regs.h". (target_map_name_to_register): Delete function. (write_dollar_variable): Use frame_map_name_to_regnum. * parser-defs.h (target_map_name_to_register): Delete declaration. * expprint.c: Include "frame.h". (print_subexp): Use frame_map_regnum_to_name. * eval.c (evaluate_subexp_standard): Use frame_map_regnum_to_name. * infcmd.c (registers_info): Use frame_map_name_to_regnum. 2002-09-25 Andrew Cagney <cagney@redhat.com> * gdb.base/pc-fp.exp, gdb.base/pc-fp.c: New test.
* Revert previous change. Not obvious.Andrew Cagney2002-09-191-13/+0
|
* 2002-09-18 Michael Snyder <msnyder@redhat.com>Michael Snyder2002-09-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Preliminary support for Objective-C: * defs.h (language_objc): New enum value. (puts_filtered_tabular): Declaration only, exported from utils.c. (skip_quoted): Delete, declared in completer.h. * c-exp.y: Include completer.h. * p-exp.y: Ditto. * jv-exp.y: Ditto. * expression.h (OP_MSGCALL, OP_SELECTOR, OP_SELF, OP_NSSTRING): New operator enum values. * language.h (CAST_IS_CONVERSION): Test for language_objc. * language.c (binop_result_type): Handle language_objc case. (integral_type, character_type, string_type, boolean_type, structured_type, binop_type_check): Ditto. * symtab.h (SYMBOL_OBJC_DEMANGLED_NAME): Define. (struct objc_specific): Add to general_symbol_info. (SYMBOL_INIT_LANGUAGE_SPECIFIC): Add objc initialization. (SYMBOL_DEMANGLED_NAME): Handle objc case. * parser-defs.h (struct objc_class_str): New struct type. (start_msglist, end_msglist, add_msglist): Declaration only, exported from objc-lang.c. * value.h (value_of_local, value_nsstring, call_function_by_hand_expecting_type): Exported from valops.c. * valops.c (find_function_addr): Export. (call_function_by_hand_expecting_type): New function. (value_of_local): New function. * symfile.c (init_filename_language_table): Add ".m" extension for Objective-C. * utils.c (puts_filtered_tabular): New function. (fprintf_symbol_filtered): Add objc demangling support (disabled). (set/show demangle): Extend help-string to refer to ObjC. * elfread.c (elf_symtab_read): Skip Objective-C special symbols. * stabsread.c (symbol_reference_defined): Objective-C symbols may contain colons: make allowances when scanning stabs strings for colons. (objc_find_colon): New function. * printcmd.c (address_info): If language == objc then print "self" instead of "this". * parse.c (length_of_subexp): Handle new operators OP_MSGCALL, OP_NSSTRING, and OP_SELF. (prefixify_subexp): Ditto. * source.c (print_source_lines): Mention objc in comment. * breakpoint.c (parse_breakpoint_sals): Recognize Objective-C method names.
* * parser-defs.h (expression_context_pc): Make this extern.Jim Blandy2002-07-241-1/+1
| | | | (Thanks to Michael Snyder.)
* 2002-06-19 Pierre Muller <muller@ics.u-strasbg.fr>Pierre Muller2002-06-211-0/+5
| | | | | | | | | * parse.c (parse_fprintf): New function used to avoid calls to fprintf in bison parser generated debug code. * parser-defs.h: Declaration of new parse_fprintf function. * ada-exp.y, c-exp.y, f-exp.y, jv-exp.y, m2-exp.y, p-exp.y: Set YYDEBUG to 1 by default. Set YYFPRINTF as parse_fprintf.
* Expand preprocessor macros in C expressions.Jim Blandy2002-05-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * c-lang.h: #include "macroexp.h", for macro_lookup_ftype. (scan_macro_expansion, scanning_macro_expansion, finished_macro_expansion): New function declarations. (expression_macro_lookup_func, expression_macro_lookup_baton): New variable declarations. * parser-defs.h (expression_context_pc): New declaration. * parse.c (expression_context_pc): New variable. (parse_exp_1): Set expression_context_pc, as well as expression_context_block. * c-exp.y (yylex): If we're not already reading the result of a macro expansion, try to macro-expand the next token. When we're done scanning a macro expansion, switch back to the mainline text. Commas and `if's in a macro's expansion don't terminate the input. * c-lang.c: #include "macroscope.h" and "gdb_assert.h". (macro_original_text, macro_expanded_text, expression_macro_lookup_func, expression_macro_lookup_baton): New variables. (scan_macro_expansion, scanning_macro_expansion, finished_macro_expansion, scan_macro_cleanup, null_macro_lookup, c_preprocess_and_parse): New functions. (c_language_defn, cplus_language_defn, asm_language_defn): Call c_preprocess_and_parse, instead of c_parse. * Makefile.in (c_lang_h): Note that this #includes macroexp.h. (c-lang.o): Note dependency on macroscope.h and gdb_assert.h.
* 2002-04-24 Michael Snyder <msnyder@redhat.com>Michael Snyder2002-04-241-0/+4
| | | | | | | | * parser-defs.h (prev_lexptr): New external variable. * parse.c (parse_exp_1): Set prev_lexptr to null before calling the language-specific parser. * c-exp.y (yylex): Set prev_lexptr to start of current token. (yyerror): Use prev_lexptr in error reporting.
* * frame.c (read_relative_register_raw_bytes_for_frame): Do notAndrew Cagney2002-04-091-13/+6
| | | | | | | | | | override FP_REGNUM with frame->fp. Update copyright. * parse.c (num_std_regs, std_regs): Delete. (target_map_name_to_register): Do not search std_regs. Update function description. * parser-defs.h (num_std_regs, std_regs, struct std_regs): Delete declarations. Update copyright. Fix PR gdb/251.
* 2001-11-14 Michael Snyder <msnyder@redhat.com>Michael Snyder2001-11-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Add address space identifiers to expression language for types. * c-exp.y (space_identifier, cv_with_space_id, const_or_volatile_or_space_identifier_noopt, const_or_volatile_or_space_identifier): New terminals. (ptype): Accept const_or_volatile_or_space_identifier. (typebase): Accept const_or_volatile_or_space_identifier. * c-typeprint.c (c_type_print_cv_qualifier): Rename to c_type_print_modifier. Handle address space modified types. * gdbtypes.h (TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE): New type flags. (struct type): Add new field as_type for addr-space qualified types. (TYPE_AS_TYPE): New macro, retrieves the chain of types that are identical to this one except for address-space qualification. * gdbtypes.c (alloc_type): Initialize new field 'as_type'. (address_space_name_to_int): New function. (address_space_int_to_name): New function. (make_type_with_address_space): New function. (make_cv_type): Handle as_type field of new struct type object. * parse.c (check_type_stack_depth): New function. (push_type_address_space): New function. (follow_types): Handle types with address-space qualifier. * parser-defs.h (enum type_pieces): Add enum tp_space_identifier.
* 2001-09-20 Michael Snyder <msnyder@redhat.com>Michael Snyder2001-09-271-1/+7
| | | | | | | | | | | | Changes by Daniel Berlin <dan@cgsoftware.com>, to support better parsing of const and volatile type expressions. * c-exp.y (const_and_volatile, const_or_volatile_noopt, const_or_volatile): New non-terminals. (ptype): Use new rule for const_or_volatile. (typebase): Use new rule for const_or_volatile_noopt. * parser-defs.h (enum type_pieces): New values tp_const, tp_volatile. * parse.c (follow_types): Handle tp_const and tp_volatile on the type stack: call make_cv_type to create new const/volatile type.
* * defs.h (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)Andrew Cagney2001-08-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT) (HOST_LONG_DOUBLE_FORMAT, DOUBLEST) (floatformat_to_doublest, floatformat_from_doublest) (floatformat_is_negative, floatformat_is_nan) (floatformat_mantissa, store_floating) (extract_floating): Move declaration from here. * doublest.h: To here. New file. * utils.c (get_field, floatformat_to_doublest, put_field) (ldfrexp, floatformat_from_doublest, floatformat_is_negative) (floatformat_is_nan, floatformat_mantissa) (FLOATFORMAT_CHAR_BIT): Move from here. * doublest.c: To here. New file. * findvar.c (store_floating, extract_floating): Move from here. * doublest.c: To here. * Makefile.in (SFILES): Add doublest.c. (COMMON_OBS): Add doublest.o. (doublest.o): Specify dependencies. (doublest_h): Define. * config/m88k/tm-m88k.h: Include "doublest.h". * config/i960/tm-i960.h: Ditto. * config/i386/tm-symmetry.h: Ditto. * rs6000-tdep.c, valarith.c: Ditto. * valprint.c, stabsread.c, sh-tdep.c: Ditto. * ia64-tdep.c, i387-tdep.c, i386-tdep.c: Ditto. * values.c, arm-tdep.c, arm-linux-tdep.c: Ditto. * alpha-tdep.c, ax.h, expression.h: Ditto. * sh-tdep.c, parse.c, top.c, value.h: Ditto. * Makefile.in (arm-tdep.o): Add $(doublest_h). (i386-tdep.o, i387-tdep.o, ia64-tdep.o): Ditto. (rs6000-tdep.o, stabsread.o, valarith.o): Ditto. (values.o, valprint.o, arm-linux-tdep.o): Ditto. (alpha-tdep.o, ax_h, parse.o, top.o, value_h): Ditto. (parser_defs_h): Ditto. (expression_h): Add $(doublest_h) and $(symtab_h).
* Update/correct copyright notices.Kevin Buettner2001-03-061-1/+2
|
* PARAMS removal.gdb-post-params-removal-2000-05-28Kevin Buettner2000-05-281-33/+26
|
* import gdb-1999-07-07 post reformatJason Molenda1999-07-071-41/+48
|
* import gdb-1999-06-07 snapshotJason Molenda1999-06-071-1/+1
|
* import gdb-1999-05-25 snapshotJason Molenda1999-05-251-0/+6
|
* Initial revisionStan Shebs1999-04-161-0/+198