aboutsummaryrefslogtreecommitdiff
path: root/gdb/d-lang.h
AgeCommit message (Collapse)AuthorFilesLines
2017-01-01update copyright year range in GDB filesJoel Brobecker1-1/+1
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-11-08Remove parameter valaddr from la_val_printYao Qi1-2/+2
Nowadays, we pass both val and return value of value_contents_for_printing (val) to la_val_print. The latter is unnecessary. This patch removes the second parameter of la_val_print, and get valaddr in each language's implementation by calling value_contents_for_printing. Since value_contents_for_printing calls value_fetch_lazy, I also make VAL non-const. Note that - I don't clean up the valaddr usages in each language's routines, - I don't remove valaddr from apply_ext_lang_val_pretty_printer, and extension language ops apply_val_pretty_printer. They can be done in followup patches. gdb: 2016-11-08 Yao Qi <yao.qi@linaro.org> * ada-lang.h (ada_val_print): Remove second parameter. Remove const from "struct value *". * ada-valprint.c (print_field_values): Remove const from "struct value *". (val_print_packed_array_elements): Likewise. (print_variant_part): Likewise. (ada_val_print_string): Likewise. (ada_val_print_gnat_array): Likewise. (ada_val_print_ptr): Likewise. (ada_val_print_num): Likewise. (ada_val_print_enum): Likewise. (ada_val_print_flt): Likewise. (ada_val_print_union): Likewise. (ada_val_print_struct_union): Likewise. (ada_val_print_ref): Likewise. (ada_val_print_1): Remove second parameter. Remove const from "struct value *". (ada_val_print): Likewise. * c-lang.h (c_val_print): Likewise. * c-valprint.c (c_val_print_array): Remove const from "struct value *". (c_val_print_ptr): Likewise. (c_val_print_struct): Likewise. (c_val_print_union): Likewise. (c_val_print_int): Likewise. (c_val_print_memberptr): Likewise. (c_val_print): Remove second parameter. Remove const from "struct value *". All callers updated. * cp-valprint.c (cp_print_value): Remove const from "struct value *". (cp_print_value_fields): Likewise. (c_val_print_value): Likewise. * d-lang.h (d_val_print): Remove second parameter. Remove const from "struct value *". * d-valprint.c (dynamic_array_type): Likewise. (d_val_print): Likewise. * f-lang.h (f_val_print): Likewise. * f-valprint.c (f_val_print): Likewise. * go-lang.h (go_val_print): Likewise. * go-valprint.c (print_go_string): Likewise. (go_val_print): Likewise. * language.c (unk_lang_val_print): Likewise. * language.h (struct language_defn) <la_val_print>: Likewise. Update comments. (LA_VAL_PRINT): Remove. * m2-lang.h (m2_val_print): Remove const from "struct value *". * m2-valprint.c (m2_print_array_contents): Likewise. (m2_val_print): Likewise. * p-lang.h (pascal_val_print): Remove second parameter. Remove const from "struct value *". (pascal_object_print_value_fields): Likewise. * p-valprint.c (pascal_val_print): Likewise. (pascal_object_print_value_fields): Likewise. (pascal_object_print_value): Likewise. * rust-lang.c (rust_get_disr_info): Likewise. (val_print_struct): Likewise. (rust_val_print): Likewise. * valprint.c (generic_val_print_array): Likewise. (generic_val_print_ptr): Likewise. (generic_val_print_memberptr): Likewise. (generic_val_print_ref): Likewise. (generic_val_print_enum): Likewise. (generic_val_print_flags): Likewise. (generic_val_print_func): Likewise. (generic_val_print_bool): Likewise. (generic_val_print_int): Likewise. (generic_val_print_char): Likewise. (generic_val_print_float): Likewise. (generic_val_print_decfloat): Likewise. (generic_val_print_complex): Likewise. (generic_val_print): Likewise. (val_print): Likewise. (common_val_print): Likewise. (val_print_type_code_flags): Likewise. (val_print_scalar_formatted): Likewise. (val_print_array_elements): Likewise. * valprint.h (val_print_array_elements): Update declaration. (val_print_scalar_formatted): Likewise. (generic_val_print): Likewise. * value.h (val_print): Likewise.
2016-04-22Centralize yacc interface names remapping (yyparse, yylex, yyerror, etc)Pedro Alves1-1/+1
This factors out all the yy-variables remapping to a single file, instead of each parser having to do the same, with different prefixes. With this, a parser just needs to define the prefix they want and include yy-remap.h, which does the dirty job. Note this renames the c_error, ada_error, etc. functions. Writing the remapping pattern as: #define yyerror GDB_YY_REMAP (error) instead of: #define yyerror GDB_YY_REMAP (yyerror) would have avoided the renaming. However, that would be problematic if we have a macro 'foo' in scope, when we write: #define yyfoo GDB_YY_REMAP (foo) as that would expand 'foo'. The c_yyerror etc. naming end ups indicating that this is a yacc related function more clearly, so feels like a good change, anyway. gdb/ChangeLog: 2016-04-22 Pedro Alves <palves@redhat.com> * ada-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * ada-lang.c (ada_language_defn): Adjust. * ada-lang.h (ada_error): Rename to ... (ada_yyerror): ... this. * c-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Adjust. * c-lang.h (c_error): Rename to ... (c_yyerror): ... this. * d-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * d-lang.c (d_language_defn): Adjust. * d-lang.h (d_error): Rename to ... (d_yyerror): ... this. * f-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * f-lang.c (f_language_defn): Adjust. * f-lang.h (f_error): Rename to ... (f_yyerror): ... this. * go-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * go-lang.c (go_language_defn): Adjust. * go-lang.h (go_error): Rename to ... (go_yyerror): ... this. * jv-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * jv-lang.c (java_language_defn): Adjust. * jv-lang.h (java_error): Rename to ... (java_yyerror): ... this. * m2-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * m2-lang.c (m2_language_defn): Adjust. * m2-lang.h (m2_error): Rename to ... (m2_yyerror): ... this. * objc-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * objc-lang.c (objc_language_defn): Adjust. * opencl-lang.c (opencl_language_defn): Adjust. * p-exp.y: Remove all yy symbol remappings. (GDB_YY_REMAP_PREFIX): Define. Include "yy-remap.h". * p-lang.c (pascal_language_defn): Adjust. * p-lang.h (pascal_error): Rename to ... (pascal_yyerror): ... this. * yy-remap.h: New file.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-08-13[D] Support looking up symbols in the current and imported modules.Iain Buclaw1-0/+10
In D, there is the notion of modules, and importing from one to the other, whether it is a basic, selective or renamed import declaration. module A; import X; void foo() { import Y : bar; } If the compiler emits DW_TAG_imported_declaration at the appropriate locations, then we can make use of what gdb stores in using_direct when performing nonlocal symbol lookups. gdb/ChangeLog * Makefile.in (SFILES): Add d-namespace.c. (COMMON_OBS): Add d-namespace.o. * d-lang.c (d_language_defn): Use d_lookup_symbol_nonlocal as the la_lookup_symbol_nonlocal callback function pointer. * d-lang.h (d_lookup_symbol_nonlocal): New declaration. (d_lookup_nested_symbol): New declaration. * d-namespace.c: New file.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-10-15Remove d-support.c and use gdb_demangle for demangling D symbols.Iain Buclaw1-4/+0
gdb/ChangeLog * Makefile.in (SFILES): Remove d-support.c. (COMMON_OBS): Remove d-support.o. * d-lang.h (d_parse_symbol): Remove declaration. * d-lang.c (d_demangle): Use gdb_demangle to demangle D symbols. * d-support.c: Remove file. gdb/testsuite/ChangeLog * gdb.dlang/demangle.exp: Update for demangling changes.
2014-06-19Initial pass at D language expression parser support.Iain Buclaw1-0/+6
gdb/ 2014-06-05 Iain Buclaw <ibuclaw@gdcproject.org> * Makefile.in (SFILES): Add d-exp.y. (YYFILES): Add d-exp.c. (YYOBJ): Add d-exp.o. (local-maintainer-clean): Delete d-exp.c. * d-exp.y: New file. * d-lang.h (d_parse): New declaration. (d_error): New declaration. * d-lang.c (d_op_print_tab): Add entry for BINOP_CONCAT and BINOP_EXP. Set BINOP_EQUAL and BINOP_NOTEQUAL to same precedence as other PREC_ORDER operators. (d_language_defn): Use d_parse, d_error instead of c_parse, c_error. gdb/testsuite/ 2014-06-05 Iain Buclaw <ibuclaw@gdcproject.org> * gdb.dlang/expression.exp: New file.
2014-01-18Move D demangling routines out of d-lang.c and into d-support.c, whichIain Buclaw1-0/+2
is intended to house other D language support functions. gdb/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * Makefile.in (SFILES): Add d-support.c. (COMMON_OBS): Add d-support.o. * d-lang.h (d_parse_symbol): Add comment, now defined in d-support.c. * d-lang.c (parse_call_convention) (parse_attributes, parse_function_types) (parse_function_args, parse_type, parse_identifier) (call_convention_p, d_parse_symbol): Move functions to ... * d-support.c: ... New file.
2014-01-18Fix and update D demangling support in gdb to the current mangling ABI.Iain Buclaw1-0/+2
gdb/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * d-lang.h (d_parse_symbol): Add declaration. * d-lang.c (extract_identifiers) (extract_type_info): Remove functions. (parse_call_convention, parse_attributes) (parse_function_types, parse_function_args) (parse_type, parse_identifier, call_convention_p) (d_parse_symbol): New functions. (d_demangle): Use d_parse_symbol to demangle D symbols. gdb/testsuite/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * gdb.dlang/demangle.exp: New file.
2014-01-18Define all basic data types of D and add them to the primitive typeIain Buclaw1-0/+36
language vector. gdb/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * d-lang.h (struct builtin_d_type): New data type. (builtin_d_type): Add declaration. * d-lang.c (d_language_arch_info, build_d_types) (builtin_d_type): New functions. (enum d_primitive_types): New data type. (d_language_defn): Change c_language_arch_info to d_language_arch_info. (d_type_data): New static variable. (_initialize_d_language): Initialize d_type_data. gdb/testsuite/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * gdb.dlang/primitive-types.exp: New file.
2014-01-18Add d_main_name to set the logical entry point for D programs.Iain Buclaw1-0/+4
gdb/ChangeLog: 2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org> * d-lang.h (d_main_name): Add declaration. * d-lang.c (d_main_name): New function. * symtab.c (find_main_name): Add call to d_main_name.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+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.
2012-03-01 * valprint.c (val_print): Update.Tom Tromey1-5/+5
* p-valprint (pascal_val_print): Return void. * p-lang.h (pascal_val_print): Return void. * m2-valprint.c (m2_val_print): Return void. * m2-lang.h (m2_val_print): Return void. * language.h (struct language_defn) <la_val_print>: Return void. * language.c (unk_lang_val_print): Return void. * jv-valprint.c (java_val_print): Return void. * jv-lang.h (java_val_print): Return void. * f-valprint.c (f_val_print): Return void. * f-lang.h (f_val_print): Return void. * d-valprint.c (d_val_print): Return void. (dynamic_array_type): Update. * d-lang.h (d_val_print): Return void. * c-valprint.c (c_val_print): Return void. * c-lang.h (c_val_print): Return void. * ada-valprint.c (ada_vada_val_print, ada_val_print_1): Return void. * ada-lang.h (ada_val_print): Return void.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-2/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+2
2010-06-11gdbTom Tromey1-0/+1
PR gdb/9977, PR exp/11636: * value.h (value_offset): Update. (struct lval_funcs) <check_validity>: New field. <copy_closure>: Make argument const. (value_computed_closure): Update. (value_contents_for_printing): Declare. (value_bits_valid): Likewise. (val_print): Likewise. (set_value_component_location): Update. (value_entirely_optimized_out): Declare. * value.c (value_offset): Argument now const. (require_not_optimized_out): New function. (value_contents_for_printing): New function. (value_contents_all): Call require_not_optimized_out. (value_contents): Likewise. (value_bits_valid): New function. (value_computed_closure): Argument now const. (set_value_component_location): Make 'whole' argument const. (value_entirely_optimized_out): New function. (value_bitsize): Argument now 'const'. (value_bitpos): Likewise. (value_type): Likewise. * valprint.h (val_print_array_elements): Update. * valprint.c (val_print): Add 'val' argument. Use valprint_check_validity. (valprint_check_validity): New function. (value_check_printable): Use value_entirely_optimized_out. (common_val_print): Update. (value_print): Likewise. (val_print_array_elements): Add 'val' argument. * valops.c (value_fetch_lazy): Use value_contents_for_printing, value_bits_valid. Reinit frame cache for lval_computed. * sh64-tdep.c (sh64_do_register): Update. * scm-valprint.c (scm_val_print): Add 'val' argument. * scm-lang.h (scm_val_print): Update. * python/python.h (apply_val_pretty_printer): Update. * python/py-prettyprint.c (apply_val_pretty_printer): Add 'val' argument. Call set_value_component_location. * printcmd.c (print_scalar_formatted): Update. * p-valprint.c (pascal_val_print): Add 'val' argument. (pascal_object_print_value_fields): Likewise. (pascal_object_print_value): Likewise. (pascal_object_print_static_field): Update. * p-lang.h (pascal_val_print): Update. (pascal_object_print_value_fields): Update. * mt-tdep.c (mt_registers_info): Update. * mi/mi-main.c (get_register): Update. (mi_cmd_data_evaluate_expression): Use common_val_print. * m2-valprint.c (m2_print_array_contents): Add 'val' argument. (m2_print_unbounded_array): Likewise. (m2_val_print): Likewise. * m2-lang.h (m2_val_print): Update. * language.h (struct language_defn) <la_val_print>: Add 'val' argument. (LA_VAL_PRINT): Likewise. * language.c (unk_lang_val_print): Add 'val' argument. * jv-valprint.c (java_print_value_fields): Add 'val' argument. (java_val_print): Likewise. * jv-lang.h (java_val_print): Add 'val' argument. * infcmd.c (default_print_registers_info): Update. * f-valprint.c (f77_print_array_1): Add 'val' argument. (f77_print_array): Likewise. (f_val_print): Likewise. * f-lang.h (f_val_print): Add 'val' argument. * dwarf2loc.c (read_pieced_value): Use value_bitsize and value_bitpos. <DWARF_VALUE_OPTIMIZED_OUT>: Don't print warning. Call set_value_optimized_out. (write_pieced_value): Use value_bitsize and value_bitpos. <default>: Don't exit loop. (check_pieced_value_validity): New function. (pieced_value_funcs): Reference check_pieced_value_validity, check_pieced_value_invalid. (copy_pieced_value_closure): Update. (check_pieced_value_bits): New function. (check_pieced_value_invalid): New function. * d-valprint.c (dynamic_array_type): Add 'val' argument. (d_val_print): Likewise. * d-lang.h (d_val_print): Update. * cp-valprint.c (cp_print_value_fields): Add 'val' argument. (cp_print_value_fields_rtti): Likewise. (cp_print_value): Likewise. (cp_print_static_field): Update. * c-valprint.c (c_val_print): Add 'val' argument. (c_value_print): Update. * c-lang.h (c_val_print): Update. (cp_print_value_fields): Likewise. (cp_print_value_fields_rtti): Likewise. * ada-valprint.c (struct ada_val_print_args): Remove. (val_print_packed_array_elements): Add 'val' argument. (ada_val_print): Likewise. Rewrite. (ada_val_print_stub): Remove. (ada_val_print_array): Add 'val' argument. (ada_val_print_1): Likewise. (print_variant_part): Likewise. (ada_value_print): Update. (print_record): Add 'val' argument. (print_field_values): Likewise. * ada-lang.h (ada_val_print): Update. gdb/testsuite PR gdb/9977, PR exp/11636:: * gdb.dwarf2/pieces.exp (pieces_test_f3): Remove kfail. (pieces_test_f6): Update expected output.
2010-04-29D language support.Joel Brobecker1-0/+32
gdb/ChangeLog: D language support. * Makefile.in (SFILES): Add d-lang.c d-valprint.c. (COMMON_OBS): Add d-lang.o d-valprint.o. (HFILES_NO_SRCDIR): Add d-lang.h. * NEWS: Mention D language support. * c-lang.c (c_emit_char, exp_descriptor_c): Make public. * c-lang.h (c_emit_char, exp_descriptor_c): Add declaration. * d-lang.c: New file. * d-lang.h: New file. * d-valprint.c: New file. * defs.h (enum language): Add language_d. * dwarf2read.c (set_cu_language): Add DW_LANG_D. * language.c (binop_result_type, integral_type, character_type) (string_type, boolean_type, structured_type): Add language_d. * symfile.c (init_filename_language_table): Add language_d. * symtab.c: Include d-lang.h. (symbol_init_language_specific, symbol_find_demangled_name) (symbol_natural_name, lookup_symbol_in_language) (symbol_demangled_name, symbol_matches_domain): Add language_d. gdb/doc/ChangeLog: * gdb.texinfo: (Summary) Add mention about D language support. (Filenames): Add D suffixes. (D): New node. gdb/testsuite/ChangeLog: * gdb.base/default.exp: Fix "set language" test.