summaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
Commit message (Collapse)AuthorAgeFilesLines
* Constification of parse_linespec and fallout:Keith Seitz2013-10-021-21/+32
| | | | | | | https://sourceware.org/ml/gdb-patches/2013-09/msg01017.html https://sourceware.org/ml/gdb-patches/2013-09/msg01018.html https://sourceware.org/ml/gdb-patches/2013-09/msg01019.html https://sourceware.org/ml/gdb-patches/2013-09/msg01020.html
* remove msymbol_objfileTom Tromey2013-08-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another patch in my ongoing series to "split" objfile to share more read-only data across inferiors. See http://sourceware.org/gdb/wiki/ObjfileSplitting When symbols are finally shared, there will be no back-link from the symbol to its containing objfile, because there may be more than one such objfile. So, all such back-links must be removed. One hidden back-link is the msymbol_objfile function. Since (eventually) a symbol may appear in more than one objfile, trying to look up the objfile given just a symbol cannot work. This patch removes msymbol_objfile in favor of using a bound minimal symbol. It introduces a new function to make this conversion simpler in some spots. The bonus of this patch is that using msymbol_objfile is slower than simply looking up the owning objfile in the first place. Built and regtested on x86-64 Fedora 18. * ada-exp.y (write_var_or_type): Use bound_minimal_symbol. * ada-lang.c (ada_lookup_simple_minsym): Return bound_minimal_symbol. * ada-lang.h (ada_lookup_simple_minsym): Update. * c-exp.y (variable): Use lookup_bound_minimal_symbol. * f-exp.y (variable): Use lookup_bound_minimal_symbol. * go-exp.y (variable): Use lookup_bound_minimal_symbol. * jv-exp.y (push_expression_name): Use lookup_bound_minimal_symbol. * m2-exp.y (variable): Use lookup_bound_minimal_symbol. * minsyms.c (msymbol_objfile): Remove. (lookup_minimal_symbol_internal): New function, from lookup_minimal_symbol. (lookup_minimal_symbol): Rewrite using lookup_minimal_symbol_internal. (lookup_bound_minimal_symbol): New function. * minsyms.h (msymbol_objfile): Remove. (lookup_bound_minimal_symbol): Declare. * p-exp.y (variable): Use lookup_bound_minimal_symbol. * parse.c (write_exp_msymbol): Change parameter to a bound_minimal_symbol. (write_dollar_variable): Use lookup_bound_minimal_symbol. * parser-defs.h (write_exp_msymbol): Update. * printcmd.c (address_info): Use lookup_bound_minimal_symbol. * symfile.c (simple_read_overlay_table): Use lookup_bound_minimal_symbol. * symtab.c (skip_prologue_sal): Don't use msymbol_objfile. (search_symbols): Likewise. (print_msymbol_info): Take a bound_minimal_symbol argument. (symtab_symbol_info, rbreak_command): Update. * symtab.h (struct symbol_search) <msymbol>: Change type to bound_minimal_symbol. * valops.c (find_function_in_inferior): Use lookup_bound_minimal_symbol. * value.c (value_fn_field): Use lookup_bound_minimal_symbol.
* PR c++/9065:Tom Tromey2013-04-151-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Update. * breakpoint.c (watchpoint_exp_is_const): Add OP_TYPEID. * c-exp.y (TYPEID): New token. (exp): Add new TYPEID productions. (ident_tokens): Add "typeid". * cp-abi.c (cplus_typeid, cplus_typeid_type): New functions. * cp-abi.h (cplus_typeid, cplus_typeid_type): Declare. (struct cp_abi_ops) <get_typeid, get_typeid_type>: New fields. * eval.c (evaluate_subexp_standard) <OP_TYPEID>: New case. * expprint.c (dump_subexp_body_standard) <OP_TYPEID>: New case. * gnu-v3-abi.c (std_type_info_gdbarch_data): New global. (build_std_type_info_type, gnuv3_get_typeid_type) (gnuv3_get_typeid): New functions. (init_gnuv3_ops): Initialize std_type_info_gdbarch_data. Set new fields on ABI object. * parse.c (operator_length_standard) <OP_TYPEID>: New case. * std-operator.def (OP_TYPEID): New. gdb/testsuite * gdb.cp/typeid.cc: New file. * gdb.cp/typeid.exp: New file.
* PR symtab/11462:Tom Tromey2013-03-251-0/+43
| | | | | | | | * c-exp.y (exp): Add new productions for destructors after '.' and '->'. (write_destructor_name): New function. gdb/testsuite * gdb.cp/m-static.exp: Add destructor-printing tests.
* PR exp/15109:Tom Tromey2013-03-211-51/+78
| | | | | | | | * c-exp.y (yylex): Rewrite to push all tokens onto the FIFO. Handle FILENAME token. gdb/testsuite * gdb.cp/cpexprs.exp: Add test for FILENAME:: case. * gdb.cp/misc.exp: Add test for FILENAME:: case.
* * c-exp.y (YYPRINT): Define.Tom Tromey2013-03-211-0/+56
| | | | (c_print_token): New function.
* * c-exp.y (%union) <sym, ivar, ivec>: Remove.Tom Tromey2013-03-211-3/+0
|
* PR symtab/11464:Tom Tromey2013-02-121-11/+23
| | | | | | | | | | | | * c-exp.y (lex_one_token): Initialize other fields of yylval on NAME return. (classify_inner_name): Remove 'first_name' argument, add 'context'. Remove unused variable. (yylex): Explicitly maintain the context type. Exit loop earlier if NAME result is seen. gdb/testsuite * gdb.cp/m-static.cc (gnu_obj_1::~gnu_obj_1): New destructor. * gdb.cp/m-static.exp: Add tests to print quoted destructor.
* 2013-01-31 Aleksandar Ristovski <aristovski@qnx.com>Aleksandar Ristovski2013-01-311-1/+1
| | | | | | | | | | | * c-exp.y (classify_inner_name): Remove unused type. * c-lang.c (c_printstr): Remove unused byte_order, i, things_printed, in_quotes, need_comma, wchar_buf, output, cleanup, iter, finished, need_escape. (c_get_string): Remove unused kind. * c-typeprint.c (c_type_print_args): Remove unused i, len, args, table2. Reference: http://sourceware.org/ml/gdb-patches/2013-01/msg00759.html
* * c-exp.y (qualified_name): Use TYPE_SAFE_NAME.Tom Tromey2013-01-251-3/+3
|
* Update years in copyright notice for the GDB files.Joel Brobecker2013-01-011-2/+1
| | | | | | | Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
* PR c++/8888:Tom Tromey2012-12-141-0/+21
| | | | | | | | | | * symtab.c (lookup_symbol_aux): If constructor is found, consider returning the type instead. * c-exp.y (classify_name): Check STRUCT_DOMAIN if a constructor is found. testsuite * gdb.cp/member-name.exp: New file. * gdb.cp/member-name.cc: New file.
* * c-exp.y (block, variable, name_not_typename, lex_one_token,Tom Tromey2012-12-141-11/+19
| | | | | | | | | | | | | | | | | | | | | classify_name): Update. * c-valprint.c (c_val_print): Update. * f-exp.y (yylex): Update. * go-exp.y (package_name_p, classify_packaged_name) (classify_name): Update. * jv-exp.y (push_variable): Update. * m2-exp.y (variable): Update. * mi/mi-cmd-stack.c (list_args_or_locals): Update. * p-exp.y (block, variable, yylex): Update. * p-valprint.c (pascal_val_print): Update. * parse.c (write_dollar_variable): Update. * printcmd.c (address_info): Update. * python/py-symbol.c (gdbpy_lookup_symbol): Update. * symtab.c (lookup_symbol_aux, lookup_symbol_in_language) (lookup_symbol): Change type of 'is_a_field_of_this'. (check_field): Add 'is_a_field_of_this' argument. * symtab.h (struct field_of_this_result): New. (lookup_symbol, lookup_symbol_in_language): Update.
* * ada-lang.c (ada_make_symbol_completion_list): Add 'code'Tom Tromey2012-12-071-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | argument, assertion. * c-exp.y (typebase): Add completion productions. * completer.c (expression_completer): Handle tag completion. * expression.h (parse_expression_for_completion): Add argument. * f-lang.c (f_make_symbol_completion_list): Add 'code' argument. * language.h (struct language_defn) <la_make_symbol_completion_list>: Add 'code' argument. * parse.c (expout_tag_completion_type, expout_completion_name): New globals. (mark_struct_expression): Add assertion. (mark_completion_tag): New function. (parse_exp_in_context): Initialize new globals. (parse_expression_for_completion): Add 'code' argument. Handle tag completion. * parser-defs.h (mark_completion_tag): Declare. * symtab.c (default_make_symbol_completion_list_break_on): Add 'code' argument. Update. (default_make_symbol_completion_list): Add 'code' argument. (make_symbol_completion_list): Update. (make_symbol_completion_type): New function. * symtab.h (default_make_symbol_completion_list_break_on) (default_make_symbol_completion_list): Update. (make_symbol_completion_type): Declare. testsuite * gdb.base/break1.c (enum some_enum, union some_union): New. (some_enum_global, some_union_global, some_value): New globals. * gdb.base/completion.exp: Add tag completion tests.
* * expression.h (parse_expression_for_completion): RenameTom Tromey2012-12-071-3/+3
| | | | | | | | | | | | | from parse_field_expression. (parse_completion): Rename from in_parse_field. * c-exp.y (lex_one_token): Update. * completer.c (expression_completer): Update. * go-exp.y (lex_one_token): Update. * p-exp.y (yylex): Update. * parse.c (parse_completion): Rename from in_parse_field. (parse_exp_in_context): Update. (parse_expression_for_completion): Rename from parse_field_expression. Update.
* * ada-exp.y (write_object_renaming, write_var_or_type)Tom Tromey2012-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (write_ambiguous_var, write_var_from_sym): Make blocks const. * ada-lang.c (replace_operator_with_call) (find_old_style_renaming_symbol): Make blocks const. * ada-lang.h (ada_find_renaming_symbol): Update. (struct ada_symbol_info) <block>: Now const. * breakpoint.c (watch_command_1): Update. * breakpoint.h (struct watchpoint) <exp_valid_block, cond_exp_valid_block>: Now const. * c-exp.y (classify_inner_name, classify_name): Make block argument const. * expprint.c (print_subexp_standard) <OP_VAR_VALUE>: Make 'b' const. * expression.h (innermost_block, parse_exp_1): Update. (union exp_element) <block>: Now const. * gdbtypes.c (lookup_template_type, lookup_enum, lookup_union) (lookup_struct): Make block argument const. * gdbtypes.h (lookup_template_type): Update. * go-exp.y (classify_name, classify_packaged_name) (package_name_p): Make block argument const. * objc-lang.c (lookup_struct_typedef): Make block argument const. * objc-lang.h (lookup_struct_typedef): Update. * parse.c (parse_exp_in_context, parse_exp_1) (write_exp_elt_block): Make block arguments const. (expression_context_block, innermost_block): Now const. * parser-defs.h (write_exp_elt_block): Update. (expression_context_block, innermost_block, block_found): Now const. * printcmd.c (struct display) <block>: Now const. * symtab.h (lookup_struct, lookup_union, lookup_enum): Update. * valops.c (address_of_variable): Make block argument const. * value.h (value_of_variable): Update. * varobj.c (struct varobj_root) <valid_block>: Now const.
* * ada-lang.c (user_select_syms, ada_print_subexp): Pass flagsTom Tromey2012-11-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to type-printing functions. * ada-lang.h (ada_print_type): Add argument. * ada-typeprint.c (print_array_type, print_variant_clauses, print_variant_part, print_selected_record_field_types, print_record_field_types, print_unchecked_union_type, print_func_type, ada_print_type): Add flags argument. (ada_print_typedef): Update. * c-exp.y (OPERATOR conversion_type_id): Update. * c-lang.h (c_print_type, c_type_print_base): Update. * c-typeprint.c (c_print_type, c_type_print_varspec_prefix, c_type_print_modifier, c_type_print_args, c_type_print_varspec_suffix, c_type_print_base): Add flags argument. * cp-valprint.c (cp_print_class_member): Update. * dwarf2read.c (dwarf2_compute_name): Update. * f-lang.h (f_print_type): Add argument. * f-typeprint.c (f_print_type): Add flags argument. * gnu-v3-abi.c (gnuv3_print_method_ptr): Update. * go-lang.h (go_print_type): Add argument. * go-typeprint.c (go_print_type): Add flags argument. * jv-lang.h (java_print_type): Add argument. * jv-typeprint.c (java_type_print_base, java_print_type): Add flags argument. * language.c (unk_lang_print_type): Add flags argument. * language.h (struct language_defn) <la_print_type>: Add flags argument. (LA_PRINT_TYPE): Likewise. * m2-lang.h (m2_print_type): Add argument. * m2-typeprint.c (m2_print_type, m2_range, m2_typedef, m2_array, m2_pointer, m2_ref, m2_procedure, m2_long_set, m2_unbounded_array, m2_record_fields): Add flags argument. * p-lang.h (pascal_print_type, pascal_type_print_base, pascal_type_print_varspec_prefix): Add argument. * p-typeprint.c (pascal_print_type, pascal_type_print_varspec_prefix, pascal_print_func_args, pascal_type_print_varspec_suffix, pascal_type_print_base): Add flags argument. * symmisc.c (print_symbol): Update. * typeprint.c (type_print_raw_options, default_ptype_flags): New globals. (type_print): Update. * typeprint.h (struct type_print_options): New. (type_print_raw_options): Declare. (c_type_print_varspec_suffix, c_type_print_args): Add argument.
* * c-exp.y (classify_name): Avoid assignment in condition.Tom Tromey2012-07-271-2/+2
|
* * Makefile.in (SFILES): Remove objc-exp.y.Tom Tromey2012-07-261-3/+151
| | | | | | | | | | | | | | | | | | | | | | | (YYFILES): Remove objc-exp.c. (YYOBJ): Remove objc-exp.o. (local-maintainer-clean): Don't mention objc-exp.c. * c-exp.y: Include objc-lang.h. (%union) <class>: New field. (NSSTRING, SELECTOR, CLASSNAME, OBJC_LBRAC): New tokens. (exp): Clone subscript production for OBJC_LBRAC. Add various Objective C productions. (msglist, msgarglist, msgarg): New productions. (array_mod, func_mod, operator): Clone productions for OBJC_LBRAC. (parse_string_or_char): Handle '@' strings. (lex_one_token): Return OBJC_LBRAC. Recognize @selector. (classify_name): Check la_name_of_this. Recognize ObjC class names. * objc-exp.y: Remove. * objc-lang.c (objc_language_defn): Use c_parse, c_error. * objc-lang.h (objc_parse, objc_error): Don't declare. gdb/testsuite * gdb.objc/print.exp (test_float_accepted): Remove kfails.
* PR exp/13206:Tom Tromey2012-07-191-1/+23
| | | | | | | | | | | | | | | | | | | | | | * ax-gdb.c (gen_expr) <OP_TYPEOF, OP_DECLTYPE>: New cases. * breakpoint.c (watchpoint_exp_is_const) <OP_TYPEOF, OP_DECLTYPE>: New cases. * c-exp.y (TYPEOF, DECLTYPE): New tokens. (type_exp): Add new productions. (ident_tokens): Add __typeof__, typeof, __typeof, __decltype, and decltype. * eval.c (evaluate_subexp_standard) <OP_TYPEOF, OP_DECLTYPE>: New case. * expprint.c (dump_subexp_body_standard) <OP_TYPEOF, OP_DECLTYPE>: New case. * parse.c (operator_length_standard) <OP_TYPEOF, OP_DECLTYPE>: New case. * std-operator.def (OP_TYPEOF, OP_DECLTYPE): New constants. * varobj.c (varobj_create): Handle OP_TYPEOF, OP_DECLTYPE. gdb/testsuite * gdb.cp/casts.exp: Add tests for typeof and decltype. * gdb.cp/casts.cc (decltype): New function. (main): Use it.
* * c-exp.y (enum token_flags): New.Tom Tromey2012-07-191-30/+61
| | | | | | | (struct token) <cxx_only>: Remove. <flags>: New field. (tokentab3, tokentab2, ident_tokens): Update. (lex_one_token): Update. Handle FLAG_SHADOW.
* * ax-gdb.c (gen_expr): Handle UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE.Tom Tromey2012-07-191-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | * breakpoint.c (watchpoint_exp_is_const): Handle UNOP_CAST_TYPE, UNOP_REINTERPRET_CAST, UNOP_DYNAMIC_CAST. * c-exp.y (exp): Emit UNOP_MEMVAL_TYPE, UNOP_CAST_TYPE. Update for changes to UNOP_REINTERPRET_CAST, UNOP_DYNAMIC_CAST. Use type_exp production where appropriate. * eval.c (evaluate_subexp_standard) <UNOP_CAST_TYPE>: New case. <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_MEMVAL_TYPE>: New case. (evaluate_subexp_for_address) <UNOP_MEMVAL_TYPE>: New case. (evaluate_subexp_for_sizeof) <UNOP_MEMVAL_TYPE>: New case. * expprint.c (print_subexp_standard) <UNOP_CAST_TYPE>: New case. <UNOP_MEMVAL_TYPE>: New case. (dump_subexp_body_standard) <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE>: New cases. * parse.c (operator_length_standard) <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE>: New cases. * stack.c (return_command): Also check for UNOP_CAST_TYPE. * std-operator.def (UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE): New constants.
* * c-exp.y (check_parameter_typelist): New function.Tom Tromey2012-07-091-0/+34
| | | | | | | | | | | (parameter_typelist): Call it. * eval.c (make_params): Handle '(void)' case. * gdbtypes.c (lookup_function_type_with_arguments): Handle '(void)' case. testsuite * gdb.base/whatis.exp: Add error checks for improper 'void' uses. * gdb.base/callfuncs.exp: Add cast-based test. * gdb.base/callfuncs.c (voidfunc): New function.
* * c-exp.y (DOTDOTDOT): New token.Tom Tromey2012-07-061-4/+16
| | | | | | | | | | | (func_mod, exp): Use parameter_typelist. (parameter_typelist): New production. (tokentab3): Add "..." token. * eval.c (make_params): Handle varargs. * gdbtypes.c (lookup_function_type_with_arguments): Handle varargs. testsuite * gdb.base/whatis.exp: Add test.
* PR exp/9608:Tom Tromey2012-07-061-16/+24
| | | | | | | | | | | | | | | | | | | | * c-exp.y (%union) <tvec>: Change type. (func_mod): Now uses <tvec> type. (exp): Update for tvec change. (direct_abs_decl): Push the typelist. (func_mod): Return a typelist. (nonempty_typelist): Update for tvec change. * gdbtypes.c (lookup_function_type_with_arguments): New function. * gdbtypes.h (lookup_function_type_with_arguments): Declare. * parse.c (pop_type_list): New function. (push_typelist): New function. (follow_types): Handle tp_function_with_arguments. * parser-defs.h (type_ptr): New typedef. Define a VEC. (enum type_pieces) <tp_function_with_arguments>: New constant. (union type_stack_elt) <typelist_val>: New field. (push_typelist): Declare. testsuite * gdb.base/whatis.exp: Add regression test.
* * c-exp.y (%union) <type_stack>: New field.Tom Tromey2012-07-061-5/+33
| | | | | | | | | | | | | | | | | | | (abs_decl, direct_abs_decl): Use <type_stack> type. Update. (ptr_operator_ts): New production. (ptype): Update. * parse.c (type_stack_reserve): New function. (check_type_stack_depth): Use it. (pop_type_stack, append_type_stack, push_type_stack) (get_type_stack, type_stack_cleanup): New functions. (follow_types): Handle tp_type_stack. (_initialize_parse): Simplify initialization. * parser-defs.h (enum type_pieces) <tp_type_stack>: New constant. (union type_stack_elt) <stack_val>: New field. (get_type_stack, append_type_stack, push_type_stack) (type_stack_cleanup): Declare. testsuite * gdb.base/whatis.exp: Add tests.
* * c-exp.y (func_mod, direct_abs_decl, abs_decl, ptr_operator):Tom Tromey2012-07-061-9/+3
| | | | Remove %type.
* PR exp/9514:Tom Tromey2012-06-191-17/+33
| | | | | | | | | | | | | | | | | | * parser-defs.h (insert_type, insert_type_address_space): Declare. (push_type_address_space): Remove. * parse.c (insert_into_type_stack): New function. (insert_type): Likewise. (insert_type_address_space): Rename from push_type_address_space. Insert tp_space_identifier. * c-exp.y (ptr_operator): New production. (abs_decl): Use ptr_operator. (space_identifier): Call insert_type_address_space. (ptype): Don't use const_or_volatile_or_space_identifier. (const_or_volatile_noopt): Call insert_type. (conversion_type_id, conversion_declarator): New productions. (operator): Use conversion_type_id. testsuite * gdb.base/whatis.exp: Add tests.
* * c-exp.y (operator): Remove trailing space after "delete" andTom Tromey2012-06-181-2/+2
| | | | "delete[]".
* gdb/Jan Kratochvil2012-06-131-12/+21
| | | | | | | | | | | | | | | | | | | | | | PR c++/14177 - Fix parsing TYPENAME:: in parentheses. * c-exp.y (classify_inner_name): Remove caller assumptions in the function comment. Return ERROR for unresolved cases. Implement returning proper NAME. (yylex): Accept also NAME from classify_inner_name. * cp-namespace.c (cp_lookup_nested_type): Rename to ... (cp_lookup_nested_symbol): ... here. Return any found symbol, not just LOC_TYPEDEF type. * cp-support.h (cp_lookup_nested_type): Update its declaration. gdb/testsuite/ PR c++/14177 - Fix parsing TYPENAME:: in parentheses. * gdb.cp/cpexprs.cc (class CV, CV::i, ATTRIBUTE_USED, CV_f): New. (test_function): Call CV_f. * gdb.cp/cpexprs.exp (p 'CV::m(int)', p CV::m(int)) (p 'CV::m(int) const', p CV::m(int) const, p 'CV::m(int) volatile') (p CV::m(int) volatile, p 'CV::m(int) const volatile') (p CV::m(int) const volatile, p CV_f(int), p CV_f(CV::t)) (p CV_f(CV::i)): New tests.
* 2012-05-18 Sergio Durigan Junior <sergiodj@redhat.com>sergiodj2012-05-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ada-lang.c: * ada-tasks.c: * ada-varobj.c: * amd64-darwin-tdep.c: * arm-symbian-tdep.c: * arm-tdep.c: * avr-tdep.c: * ax-gdb.c: * bfin-linux-tdep.c: * breakpoint.c: * c-valprint.c: * cli/cli-cmds.c: * coffread.c: * cp-support.c: * cris-tdep.c: * dwarf2-frame-tailcall.c: * dwarf2-frame.c: * dwarf2expr.c: * dwarf2loc.c: * dwarf2read.c: * elfread.c: * eval.c: * expprint.c: * f-valprint.c: * frv-tdep.c: * h8300-tdep.c: * hppa-hpux-tdep.c: * hppa-tdep.c: * hppanbsd-tdep.c: * i386-nto-tdep.c: * i386-tdep.c: * i387-tdep.c: * ia64-tdep.c: * jit.c: * linespec.c: * linux-tdep.c: * lm32-tdep.c: * m2-valprint.c: * m32c-tdep.c: * m32r-rom.c: * m32r-tdep.c: * m68k-tdep.c: * m68klinux-tdep.c: * mi/mi-main.c: * microblaze-tdep.c: * mips-linux-tdep.c: * mips-tdep.c: * mn10300-tdep.c: * p-valprint.c: * parse.c: * ppc-linux-tdep.c: * ppc-sysv-tdep.c: * printcmd.c: * python/py-finishbreakpoint.c: * python/py-inferior.c: * python/py-infthread.c: * python/py-type.c: * python/python.c: * remote-fileio.c: * remote-m32r-sdi.c: * remote-mips.c: * reverse.c: * rl78-tdep.c: * rs6000-aix-tdep.c: * rs6000-tdep.c: * s390-tdep.c: * score-tdep.c: * sh64-tdep.c: * skip.c: * solib-darwin.c: * solib-dsbt.c: * solib-frv.c: * sparc-tdep.c: * spu-multiarch.c: * spu-tdep.c: * stack.c: * symfile.c: * symtab.c: * tic6x-tdep.c: * tracepoint.c: * v850-tdep.c: * valarith.c: * valprint.c: * value.c: * xcoffread.c: * xtensa-tdep.c: * ada-lang.c: * ada-tasks.c: * ada-varobj.c: * amd64-darwin-tdep.c: * arm-symbian-tdep.c: * arm-tdep.c: Delete unused variables.
* * ada-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): NewMark Kettenis2012-04-091-0/+6
| | | | | | | | | | | | | | | | | | defines. * c-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New defines. * cp-name-parser.y (yyss, yysslim, yyssp, yystacksize, yyvs) (yyvsp): New defines. * f-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New defines. * jv-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New defines. * m2-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New defines. * objc-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New defines. * p-exp.y (yyss, yysslim, yyssp, yystacksize, yyvs, yyvsp): New defines.
* Have block_innermost_frame start from selected frame and document.Paul N. Hilfinger2012-01-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GDB used to search for the frame containing variables in a particular lexical block starting from the current (top) frame, ignoring any currently selected frame. It is not clear why this is desirable for variables that require a frame; why would a user deliberately select one frame and then expect to see the value of a variable in a more recent frame? This change causes block_innermost_frame to start looking from the selected frame, if there is one. It may be unnecessarily conservative: we use get_selected_frame_if_set rather than get_selected_frame in order to avoid the side effect of calling select_frame, which would probably be harmless. Expression-parsing routines previously made the unwarranted assumption that all block-qualified variables (written with the GDB extension <block>::<variable>) are static. As a result, they failed to update innermost_block, which confused the watch commands about when variables in watched expressions went out of scope, and also caused the wrong variables to be watched. This patch also modifies these routines to treat all local variables the same whether or not they are block-qualified. Finally, we add a paragraph to the "Program Variables" section of the texinfo documentation concerning the use of "::" for accessing non-static variables. 2012-01-11 Paul Hilfinger <hilfingr@adacore.com> * gdb/blockframe.c (block_innermost_frame): Start search from selected frame, if present, or otherwise the current frame. * gdb/c-exp.y (variable): Update innermost_block for 'block COLONCOLON NAME' clause. * gdb/m2-exp.y (variable): Ditto. * gdb/objc-exp.y (variable): Ditto. * gdb/doc/gdb.texinfo (Variables): Document use of :: for non-static variables.
* gdb/Jan Kratochvil2012-01-101-2/+2
| | | | | | | | | | | | | | Fix regression after libiberty/ update for GCC PR 6057 and others. * c-exp.y (operator) <OPERATOR DELETE> (operator) <OPERATOR DELETE '[' ']'>: Add trailing space. * cp-name-parser.y (fill_comp, make_operator, make_dtor) (make_builtin_type, make_name): New variable i, add gdb_assert. (operator) <OPERATOR NEW>: Update ARGS to 3. (operator) <OPERATOR DELETE>: Add trailing space. (operator) <OPERATOR NEW '[' ']'>: Update ARGS to 3. (operator) <OPERATOR DELETE '[' ']'>: Add trailing space. * cp-support.c (cp_canonicalize_string): Check NULL from cp_comp_to_string, call warning and return.
* Copyright year update in most files of the GDB Project.Joel Brobecker2012-01-041-3/+2
| | | | | | gdb/ChangeLog: Copyright year update in most files of the GDB Project.
* gdb/Jan Kratochvil2011-10-111-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Revert this part of: 2011-10-09 Jan Kratochvil <jan.kratochvil@redhat.com> Support @entry in input expressions. * c-exp.y (ENTRY, unknown_cpp_name): New. (exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'. (unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY) (variable: name_not_typename '@' ENTRY, name: ENTRY) (name_not_typename: ENTRY): New. (yylex): Recognize ENTRY. Reimplement @entry in input expressions. * c-exp.y (ENTRY): New. (variable: name_not_typename ENTRY): New. (lex_one_token): Optionally return ENTRY instead of the '@' lex. gdb/testsuite/ Reimplement @entry in input expressions. * gdb.base/exprs.c (v_int_array_init): New variable. * gdb.base/exprs.exp (print v_int_array_init) (print *v_int_array_init@1, print *v_int_array_init@2) (print v_int_array_init[0]@1, print v_int_array_init[0]@2) (print v_int_array_init[1]@1): New tests.
* gdb/Jan Kratochvil2011-10-091-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support @entry in input expressions. * c-exp.y (ENTRY, unknown_cpp_name): New. (exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'. (unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY) (variable: name_not_typename '@' ENTRY, name: ENTRY) (name_not_typename: ENTRY): New. (yylex): Recognize ENTRY. * eval.c (evaluate_subexp_standard): Support also OP_VAR_ENTRY_VALUE. * expprint.c (print_subexp_standard, dump_subexp_body_standard): Likewise. * parse.c (operator_length_standard): Likewise. * std-operator.def: New operator OP_VAR_ENTRY_VALUE. gdb/doc/ Support @entry in input expressions. * gdb.texinfo (Variables): Describe @entry names suffix. (Print Settings): Add anchor for `set print entry-values'. gdb/testsuite/ Support @entry in input expressions. * gdb.arch/amd64-entry-value.exp (entry: p i@entry, entry: p j@entry) (entry_stack: p s1@entry, entry_stack: p s2@entry) (entry_stack: p d9@entry, entry_stack: p da@entry, tailcall: p i@entry) (tailcall: p j@entry): New tests. * gdb.cp/koenig.cc (A::entry): New function. (main): Call it. * gdb.cp/koenig.exp (p entry (c)): New test.
* gdb/Jan Kratochvil2011-05-061-2/+2
| | | | | | | | | | | | | | | | * c-exp.y (qualified_name): Call destructor_name_p with $1.type. (classify_inner_name): Call cp_lookup_nested_type with yylval.tsym.type. * cp-namespace.c (cp_lookup_nested_type): New variable saved_parent_type. Call CHECK_TYPEDEF for parent_type. Call type_name_no_tag_or_error with saved_parent_type. * dwarf2read.c (load_partial_dies): Read in any children of DW_TAG_typedef with complaint in such case. * gdbtypes.c (type_name_no_tag_or_error): New function. * gdbtypes.h (type_name_no_tag_or_error): New prototype. * valops.c (destructor_name_p): New comment for parameter type. Remove type const. Make dname and cp const. Call type_name_no_tag_or_error. * value.h (destructor_name_p): Remove type const.
* ARI fixes: Add missing internationalization markups throughoutPierre Muller2011-03-181-18/+18
| | | | | | | | | | yacc files. * c-exp.y: Ditto. * cp-name-parser.y: Ditto. * f-exp.y: Ditto. * m2-exp.y: Ditto. * objc-exp.y: Ditto. * p-exp.y: Ditto.
* run copyright.sh for 2011.Joel Brobecker2011-01-011-1/+1
|
* gdb:kwerner2010-11-051-34/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention OpenCL C language support. * Makefile.in (SFILES): Add opencl-lang.c. (COMMON_OBS): Add opencl-lang.o. * opencl-lang.c: New File * defs.h (enum language): Add language_opencl. * dwarf2read.c (read_file_scope): Handle DW_AT_producer for the IBM XL C OpenCL compiler. * c-lang.h: Include "parser-defs.h". (evaluate_subexp_c): Declare. * c-lang.c (evaluate_subexp_c): Remove the static qualifier. (c_op_print_tab): Add declaration. * eval.c (binop_promote): Handle language_opencl. * c-exp.y: Lookup the primitive types instead of referring to the builtins. gdb/testsuite: * Makefile.in (ALL_SUBDIRS): Add gdb.opencl. * configure.ac (AC_OUTPUT): Add gdb.opencl/Makefile. * configure: Regenerate. * gdb.opencl/Makefile.in: New File. * gdb.opencl/datatypes.exp: Likewise. * gdb.opencl/datatypes.cl: Likewise. * gdb.opencl/operators.exp: Likewise. * gdb.opencl/operators.cl: Likewise. * gdb.opencl/vec_comps.exp: Likewise. * gdb.opencl/vec_comps.cl: Likewise. * gdb.opencl/convs_casts.exp: Likewise. * gdb.opencl/convs_casts.cl: Likewise. * lib/opencl.exp: Likewise. * lib/opencl_hostapp.c: Likewise. * lib/opencl_kernel.cl: Likewise. * lib/cl_util.c: Likewise. * lib/cl_util.c: Likewise. * gdb.base/default.exp (set language): Add "opencl" to the list of languages. gdb/doc: * gdb.texinfo: (Summary) Add mention about OpenCL C language support. (OpenCL C): New node.
* Fix PR 11992: C++ 'this' scope sometimes does not workswagiaal2010-09-131-0/+1
| | | | | | | | | | | | | 2010-09-13 Sami Wagiaalla <swagiaal@redhat.com> PR symtab/11992: * c-exp.y (classify_name): Check is_a_member_of_this before returning UNKNOWN_CPP_NAME. 2010-09-13 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.cc: created class for testing member lookup. * gdb.cp/koenig.exp: Added test for member lookup.
* PR exp/11926Doug Evans2010-08-191-33/+6
| | | | | | | | | | | | | | | | | | | * parser-defs.h (parse_float, parse_c_float): Declare. * parse.c (parse_float, parse_c_float): New function. * c-exp.y (parse_number): Call parse_c_float. * objc-exp.y (parse_number): Ditto. * p-exp.y (parse_number): Ditto. Use ANSI/ISO-style definition. * jv-exp.y (parse_number): Call parse_float, fix suffix handling. testsuite/ * gdb.base/printcmds.exp (test_float_accepted): New function. Move existing float tests there. Add tests for floats with suffixes. (test_float_rejected): New function. * gdb.java/jv-print.exp (test_float_accepted): New function. (test_float_rejected): New function. * gdb.objc/print.exp: New file. * gdb.pascal/print.exp: New file. * lib/objc.exp: New file.
* gdb/Jan Kratochvil2010-06-281-1/+1
| | | | | | | | | | | Fix PR c++/11703 and PR gdb/1448. * c-exp.y (yylex) <last_was_coloncolon && first_was_coloncolon>: Add FIRST_ITER check. gdb/testsuite/ Test PR c++/11703 and PR gdb/1448. * gdb.cp/namespace.exp (ptype ::C::NestedClass): Remove KFAIL for gdb/1448.
* Add ADL supportswagiaal2010-05-071-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2010-05-07 Sami Wagiaalla <swagiaal@redhat.com> PR C++/7943: * valops.c (find_overload_match): Handle fsym == NULL case. Add int no_adl argument. (find_oload_champ_namespace_loop): Call make_symbol_overload_list_adl when appropriate. Add int no_adl argument. (find_oload_champ_namespace): Add int no_adl argument. * parse.c (operator_length_standard): Return length for OP_ADL_FUNC expression. * expprint.c (op_name_standard): Added string for OP_ADL_FUNC case. * eval.c (evaluate_subexp_standard): Added OP_ADL_FUNC case. Evaluate arguments and use them to perform ADL lookup. Pass no_adl argument to find_overload_match. Disable adl lookup when evaluating a fully qualified OP_FUNCALL. * cp-support.h: Added prototype for make_symbol_overload_list_namespace. * cp-support.c (make_symbol_overload_list_namespace): New function. (make_symbol_overload_list_adl_namespace): New function. (make_symbol_overload_list_adl): New function. (make_symbol_overload_list_using): Moved code to add function to overload set to make_symbol_overload_list_namespace. * c-exp.y: create UNKNOWN_CPP_NAME token. Add parse rule for ADL functions. (classify_name): Recognize an UNKNOWN_CPP_NAME. 2010-05-07 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.exp: New test. * gdb.cp/koenig.cc: New test program.
* 2010-05-05 Michael Snyder <msnyder@vmware.com>Michael Snyder2010-05-061-2/+1
| | | | | | | | | | | * c-exp.y (parse_string_or_char): Delete unused variable. (c_lex): Delete unused variable. * cp-name-parser.y (cpname_lex): Delete unused variable. * ada-exp.y (find_primitive_type): Delete unused variable. (write_var_or_type): Delete unused variable. * jv-exp.y (java_parse): Delete unused variable. (push_expression_name): Delete unused variable. * p-exp.y (pascal_lex): Delete unused variable.
* gdbTom Tromey2010-03-151-0/+8
| | | | | | | | * c-exp.y (name_not_typename): Add 'operator' clause. gdb/testsuite * gdb.cp/userdef.exp: Add tests for explicit calls to operator==. * gdb.cp/userdef.cc (operator==): New function. (main): New locals mem1, mem2.
* 2010-02-23 Harald Koenig <H.Koenig@science-computing.de>Pedro Alves2010-02-231-1/+1
| | | | * c-exp.y (token_and_value): s/union YYSTYPE/YYSTYPE.
* gdbTom Tromey2010-02-191-152/+260
| | | | | | | | | | | | | | | | | | | | | | | PR c++/8693, PR c++/9496: * cp-namespace.c (cp_lookup_nested_type): Handle TYPE_CODE_UNION. * c-exp.y (lex_one_token): Rename from yylex. Don't call write_dollar_variable. Don't try to classify NAME tokens. (token_and_value): New type. (token_fifo, popping, name_obstack): New globals. (classify_name): New function. (classify_inner_name): Likewise. (yylex): Likewise. (VARIABLE): Now has type sval. (exp : VARIABLE): Call write_dollar_variable. (qualified_name): Use TYPENAME, not typebase. Add production for multiple "::" instances. (variable): Use name_not_typename. (qualified_type): Remove. (typebase): Update. gdb/testsuite PR c++/8693, PR c++/9496: * gdb.cp/namespace.exp: Remove some setup_kfail calls. Added regression tests.
* gdbTom Tromey2010-02-101-0/+3
| | | | | | | | | | | | * parser-defs.h (parser_debug): Declare. * parse.c (_initialize_parse): Install "debug parser" set/show command. (parser_debug): New global. (show_parserdebug): New function. * c-exp.y (c_parse): Set yydebug. gdb/testsuite * gdb.texinfo (Debugging Output): Document set debug parser and show debug parser.