* expression.h (enum exp_opcode): Added UNOP_LOWER, UNOP_UPPER,
UNUP_LENGTH.
* expprint.c (dump_expression): Handle the new exp_opcodes.
(print_subexp): Handle PREC_BUILTIN_FUNCTION.
(print_simple_m2_func): Removed.
(print_subexp): Remove support for Modula2 builtin functions.
* m2-lang.c (m2_op_print_tab): Add support for builtin functions.
* ch-exp.y: Parse LOWER, UPPER, and LENGTH builtins.
(write_lower_upper_value): Convenience function for LOWER and UPPER.
(upper_lower_argument, length_argument): Removed non-terminals.
* ch-lang.c (chill_op_print_tab): Entries for UPPER, LOWER, LENGTH.
(type_lower_upper): New function. Calculate LOWER/UPPER of type.
(value_chill_length): New function. Calcalate LENGTH of ARRAY/STRING.
(evaluate_subexp_chill): Handle UNOP_LOWER, UNOP_UPPER, UNOP_LENGTH.
This fixes PR 5015 (and 5826 which is a duplicate).
start_element, left_element, right_element, slice_size,
lower_element, upper_element, first_element): Removed.
(value_string_slice, value_array_slice): Replaced by ...
(slice): New non-terminal, with working slice support.
(primitive_value_lparen, rparen): New non-terminals.
(maybe_tuple_elements): New non-terminal, to allow empty tuples.
(idtokentab): Added "up".
* value.h (COERCE_VARYING_ARRAY): New macro.
* valarith.c (value_subscript): Use it.
* valops.c (value_cast): Likewise. Also, do nothing if already
correct type, and allow converting from/to range to/from scalar.
* valops.c, value.h (varying_to_slice, value_slice): New functions.
* eval.c (OP_ARRAY): Add cast for array element.
* expression.h (TERNOP_SLICE, TERNOP_SLICE_COUNT): New exp_opcodes.
* valops.c (chill_varying_type): Moved function frp, here ...
* gdbtypes.c (chill_varying_type), gdbtypes.h: ... to here.
* parse.c (length_of_subexp, prefixify_subexp): Add support
for TERNOP_SLICE, TERNOP_SLICE_COUNT.
* expprint.c (print_subexp, dump_expression): Likewise.
* eval.c (evaluate_subexp): Likewise.
* eval.c (evaluate_subexp case MULTI_SUBSCRIPT): Don't call
value_x_binop on a Chill varying string.
* ch-exp.y (match_bitstring_literal): Fix for proper endianness.
* expprint.c (print_subexp): Don't call error on OP_BITSTRING,
just print B'<unimlemented>'.
* gdbtypes.c (create_set_type): Fix bug in length calculation.
* valops.c, value.h (value_bitstring): New function.
* eval.c (evaluate_subexp): Implement support for OP_BITSTRING.
* ch-typeprint.c (chill_type_print_base): For TYPE_CODE_FUNC,
check that return type is non-void, and print in proper Chill syntax.
labeled structre tuples.
* ch-exp.y (tuple_element, named_record_element, tuple_elements):
New non-terminals, to handle labeled structure tuples.
(tuple): Re-define using tuple_elements.
* eval.c (evaluate_labeled_field_init): New function, to handle
initialization of structure fields, possibly using OP_LABELED.
(evaluate_subexp): Use it.
* expprint.c (print_subexp case): For OP_ARRAY, use Chill syntax
for Chill. Handled OP_LABELED.
* parse.c (length_of_subexp, prefixify_subexp): Handle OP_LABELED.
* eval.c (evaluate_subexp): Handle Chill Powerset tuples.
* valarith.c (value_bit_index): Just treat bitstring as represented
by an array of bytes. Alignment is handled by compiler.
(tuple): Parse simple unlabelled tuples.
* eval.c (evaluate_subexp case OP_ARRAY): Use expect_type to
evaluate brace-initializer-expressions depending on context.
(evaluate_subexp case UNOP_CAST): Pass the target type as
expected type when evaluating the expression.
match_bitstring_literal): Guard tolower calls with isupper,
tolower on old BSD systems blindly subtracts a constant.
* dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as
well when determining the producer of the object file.
* mdebugread.c (has_opaque_xref): New function to check for
cross reference to an opaque aggregate.
* mdebugread.c (parse_symbol, parse_partial_symbols): Do not
enter typedefs to opaque aggregates into the symbol tables.
* mdebugread.c (parse_external): Remove skip_procedures argument,
it has always been 1. Remove code that handled stProc symbols,
it was never executed and was wrong, as the index of a
stProc symbol points to the local symbol table and not to the
auxiliary symbol info. Update caller.
* mdebugread.c (parse_partial_symbols): Do not enter external
stProc symbols into the partial symbol table, they are already
entered into the minimal symbol table.
* config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix.
Remove all conditionals and definitions for ptx.
I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c.
Fix addresses of floating point registers in REGISTER_U_ADDR.
STORE_STRUCT_RETURN now handles cc and gcc conventions.
FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC,
IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through
signal trampoline code work.
* config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix.
Remove all conditionals and definitions for ptx.
Remove KDB definitions.
* symm-nat.c (store_inferior_registers): Fetch registers before
storing them to obtain valid floating point control registers.
Store fpu registers.
* symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines
FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value.
* symm-nat.c (fetch_inferior_registers, child_xfer_memory):
Fix typos.
* symm-nat.c (child_resume): Update type of `signal' parameter.
* symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
gone now.
* c-exp.y, ch-exp.y, core.c, corelow.c, eval.c, fork-child.c,
m2-exp.y, minsyms.c, nlmread.c, parse.c, putenv.c, regex.c
remote-utils.c, stabsread.c: Include <string.h>.
* regex.c: Include "defs.h", change re_comp argument to const char *.
* infptrace.c (fetch_register, store_inferior_registers): Change
regaddr to type CORE_ADDR.
* config/alpha/alpha-nw.mt, config/alpha/alpha-osf1.mt (MT_CFLAGS):
Remove, no longer necessary now that we use bfd_vma for a CORE_ADDR.
* ch-lang.c (chill_is_varying_struct), ch-lang.h: New function.
* ch-lang.c (chill_printstr): Use double quotes, not single quotes.
* ch-typeprint.c (chill_type_print_base): Handle TYPE_CODE_BITSTRING.
Improve printing of TYPE_CODE_STRING, TYPE_CODE_SET, and
TYPE_CODE_STRUCT (including checking chill_is_varying_struct).
Print TYPE_DUMMY_RANGE by printing its TYPE_TARGET_TYPE.
Handle TYPE_CODE_ENUM.
* ch-valprint.c (chill_val_print): Handle TYPE_CODE_BITSTRING.
For TYPE_CODE_STRING, never print address. Handle VARYING strings.
* gdbtypes.c (force_to_range_type): New.
* gdbtypes.c (create_set_type): Make work, following Chill layout.
* gdbtypes.h (TYPE_LOW_BOUND, TYPE_HIGH_BOUND, TYPE_DUMMY_RANGE): New.
* stabsread.c (read_type): Distinguish string and bitstring from
char-array and set.
* valarith.c (value_subscript), valops.c (value_coerce_array):
Handle STRINGs as well as ARRAYs.
* valarith.c (value_bit_index): Fix think. Use new macros.
Change all references to stdout/stderr to gdb_stdout/gdb_stderr.
Replace all calls to stdio output functions with calls to
corresponding _unfiltered functions (`fprintf_unfiltered')
Replaced calls to fopen for output to gdb_fopen.
Added sufficient goo to utils.c and defs.h to make the above work.
The net effect is that stdio output functions are only directly used
in utils.c. Elsewhere, the _unfiltered and _filtered functions and
GDB_FILE type are used.
In the near future, GDB_FILE will stop being equivalant to FILE.
The semantics of some commands has changed in a very subtle way:
called in the right context, they may cause new occurences of
prompt_for_continue() behavior. The testsuite doesn't notice anything
like this, though.
Please respect this change by not reintroducing stdio output
dependencies in the main body of gdb code. All output from commands
should go to a GDB_FILE.
Target-specific code can still use stdio directly to communicate with
targets.
support to use LOC_BASEREG rather than SYMBOL_BASEREG_VALID.
* dwarfread.c: Use LOC_BASEREG where appropriate.
* Various: Support LOC_BASEREG and LOC_BASEREG_ARG.
* Makefile.in: Add $(YFLAGS) when using $(YACC).
* Makefile.in: Remove message to expect conflicts and unused
rules in ch-exp.y, since there no longer are any such.
UNOP_IND, UNOP_CAST, UNOP_ADDR, STRUCOP_STRUCT, OP_TYPE.
* ch-typeprint.c (chill_print_type): Move support
for TYPE_CODE_ARRAY and TYPE_CODE_STRING from here ...
* ch-typeprint.c (chill_type_print_base): ... here.
* ch-typeprint.c (chill_type_print_base): Improve
support for PTR, REF, and FUNC types.
* ch-valprint.c: Prefer H'%x format to 0x%s.
* ch-valprint.c (chill_val_print): Add support for printing
TYPE_CODE_REF (return for LOC parameters and variables).
Use c_val_print to print random types (including ENUM).
* ch-valprint,c (chill_print_value_fields): Make
output look more like Chill tuples.
* stabsread.c (read_struct_type): Factor common code.
* ieee-float.h: Moved to ../include.
* Makefile.in: Update accordingly.
* i386-pinsn.c (print_insn), m68k-pinsn.c (print_insn):
Convert to stubs that call disassemblers in ../opcodes/*-dis.c.
* m68k-tdep.c: Removed definition of ext_format ext_format_68881;
it is now in ../opcodes/m68881-ext.c.
* mips-tdep.c (mips_skip_prologue): Try to skip more of the
prologue (some callers _do_ care).
* mips-pinsn.c (print_insn), z8k-tdep.c (print_insn): Convert to
new interface of ../opcodes/*-dis.c.
* ch-exp.y: Add #include <ctype.h>.
* c-exp.y (exp): Use lcurly and rcurly for arrays and UNOP_MEMVAL
constructs.
* parse.c (free_funcalls): Moved prototype from parser-defs.h,
made function static.
* parse.c (struct funcall): Moved struct def from parser-defs.h.
* parse.c (funcall_chain): Moved from parser-defs.h, made static.
* parse.c (start_arglist):
* parser-defs.h (free_funcalls): Moved prototype to parse.c.
* parser-defs.h (struct funcall): Moved struct def to parse.c.
* parser-defs.h (funcall_chain): Moved to parse.c.
* printcmd.c (print_frame_nameless_args): Fix prototype.
* tm-mips.h (setup_arbitrary_frame): Fix prototype.
* tm-sparc.h (setup_arbitrary_frame): Fix prototype.
* valops.c (typecmp): Moved prototype from values.h.
* value.h (typecmp): Moved prototype to valops.c, made static.
**** start-sanitize-chill ****
* ch-exp.y (yylex): Change way control sequences are disabled.
**** end-sanitize-chill ****
an integral number of times.
* language.c (binop_type_check): Extend BINOP_CONCAT for self
concatenation case.
* valarith.c (value_concat): Rewrite to support self
concatenation an integral number of times.
**** start-sanitize-chill ****
* Makefile.in (ch-exp.tab.c): Change "expect" message.
* ch-exp.y (FIXME's): Make all FIXME tokens distinct, to
eliminate hundreds of spurious shift/reduce and reduce/reduce
conflicts that mask the 5 real ones.
* ch-exp.y (STRING, CONSTANT, SC): Remove unused tokens.
* ch-exp.y (integer_literal_expression): Remove production,
no longer used.
**** end-sanitize-chill ****
implied that "no side effects" was nonfunctional.
* eval.c (evaluate_subexp): Add BINOP_CONCAT case to deal with
character string and bitstring concatenation.
* expprint.c (dump_expression): Add case for BINOP_CONCAT.
* expression.h (exp_opcode): Add BINOP_CONCAT.
* gdbtypes.h (type_code): Add TYPE_CODE_BITSTRING.
* language.c (string_type): Add function to determine if a type
is a string type.
* language.c (binop_type_check): Add case for BINOP_CONCAT.
* valarith.c (value_concat): New function to concatenate two
values, such as character strings or bitstrings.
* valops.c (value_string): Remove error stub and implement
function body.
* value.h (value_concat): Add prototype.
**** start-sanitize-chill ****
* ch-exp.y (operand_3): Add actions for SLASH_SLASH (//).
* ch-exp.y (yylex): Recognize SLASH_SLASH.
* ch-lang.c (chill_op_print_tab): Add SLASH_SLASH (//) as
BINOP_CONCAT.
**** end-sanitize-chill ****
constants with an explicit null byte terminator. OP_STRING is
now used for real string types.
* c-lang.c (builtin_type_*): Move declarations to lang.c since
they are used by all languages.
* c-lang.c (_initialize_c_language): Move initializations of
builtin_type_* to lang.c.
* c-typeprint.c (c_type_print_varspec_prefix,
c_type_print_varspec_suffix): TYPE_CODE_PASCAL_ARRAY renamed
to TYPE_CODE_STRING.
* c-valprint.c (c_val_print): Change the way character arrays
are printed as strings to be consistent with the way strings
are printed when pointer-to-char types are dereferenced.
Remove test of print_max before calling val_print_string, which
now does it's own test.
* eval.c (evaluate_subexp): Add case for OP_ARRAY.
* expprint.c (print_subexp, dump_expression): Add case for OP_ARRAY.
* expression.h (enum exp_opcode): Add OP_ARRAY and document.
* gdbtypes.c (builtin_type_*): Add declarations moved from
c-lang.c.
* gdbtypes.c (create_string_type): New function to create real
string types.
* gdbtypes.c (recursive_dump_type): TYPE_CODE_PASCAL_ARRAY
renamed to TYPE_CODE_STRING.
* gdbtypes.c (_initialize_gdbtypes): Add initializations of
builtin_type_* types moved from c-lang.c.
* gdbtypes.h (enum type_code): TYPE_CODE_PASCAL_ARRAY renamed
to TYPE_CODE_STRING.
* gdbtypes.h (builtin_type_string): Add extern declaration.
* gdbtypes.h (create_string_type): Add prototype.
* m2-lang.c (m2_create_fundamental_type): TYPE_CODE_PASCAL_ARRAY
renamed to TYPE_CODE_STRING.
* m88k-tdep.c (pushed_size): TYPE_CODE_PASCAL_ARRAY renamed to
TYPE_CODE_STRING.
* mipsread.c (_initialize_mipsread): TYPE_CODE_PASCAL_ARRAY
renamed to TYPE_CODE_STRING.
* parse.c (length_of_subexp, prefixify_subexp): Add case for
OP_ARRAY.
* printcmd.c (print_formatted): Recognize TYPE_CODE_STRING.
* typeprint.c (print_type_scalar): TYPE_CODE_PASCAL_ARRAY renamed
to TYPE_CODE_STRING.
* valops.c (allocate_space_in_inferior): New function and
prototype, using code ripped out of value_string.
* valops.c (value_string): Rewritten to use new function
allocate_space_in_inferior, but temporarily disabled until some
other support is in place.
* valops.c (value_array): New function to create array constants.
* valprint.c (val_print_string): Add comment to document use,
complete rewrite to fix several small buglets.
* value.h (value_array): Add prototype.
* value.h (val_print_string): Change prototype to match rewrite.
**** start-sanitize-chill ****
* ch-valprint.c (chill_val_print): Add case for TYPE_CODE_STRING.
* ch-exp.y (match_character_literal): Disable recognition of
control sequence form of character literals and document why.
**** end-sanitize-chill ****
* c-valprint.c (c_val_print): Extract code for printing methods
and move it to cp_print_class_method in cp-valprint.c.
* c-valprint.c (c_val_print): Extract code to print strings and
move it to val_print_string in valprint.c.
* cp-valprint.c (cp_print_class_method): New function using
code extracted from c_val_print.
* valprint.c (val_print_string): New function using code
extracted from c_val_print.
* value.h (val_print_string): Add prototype.
**** start-sanitize-chill ****
* ch-exp.y (CHARACTER_STRING_LITERAL): Set correct token type.
* ch-exp.y (literal): Add action for CHARACTER_STRING_LITERAL.
* ch-exp.y (tempbuf, tempbufsize, tempbufindex, GROWBY_MIN_SIZE,
CHECKBUF, growbuf_by_size): New variables, macros, and support
functions for implementing a dynamically expandable temp buffer.
* ch-exp.y (match_string_literal): New lexer function.
* ch-exp.y (match_bitstring_literal): Dynamic buffer code
removed and replaced with new CHECKBUF macro.
* ch-exp.y (yylex): Call match_string_literal when appropriate.
* ch-valprint.c (ch_val_print): Add code for TYPE_CODE_PTR.
**** end-sanitize-chill ****
from a configuration file (typically including <limits.h>), or to
TARGET_CHAR_BIT if CHAR_BIT is not defined.
* eval.c (evaluate_subexp): Use new BYTES_TO_EXP_ELEM macro.
* eval.c (evaluate_subexp): Add case for OP_BITSTRING.
* expprint.c (print_subexp): Use new BYTES_TO_EXP_ELEM macro.
* exppritn.c (print_subexp, dump_expression): Add case for
OP_BITSTRING.
* expression.h (OP_BITSTRING): New expression element type for
packed bitstrings.
* expression.h (EXP_ELEM_TO_BYTES, BYTES_TO_EXP_ELEM): New
macros to convert between number of expression elements and bytes
to store that many elements.
* i960-tdep.c (leafproc_return): Use new macros to access
minimal symbol name and address fields.
* m88k-pinsn.c (sprint_address): Use new macros to access
minimal symbol name and address fields.
* nindy-tdep.c (nindy_frame_chain_valid): Use new macro to access
minimal symbol address field.
* parse.c (write_exp_elt, write_exp_string, prefixify_expression,
parse_exp_1): Use new EXP_ELEM_TO_BYTES macro.
* parse.c (write_exp_string, length_of_subexp, prefixify_expression):
Use new BYTES_TO_EXP_ELEM macro.
* parse.c (write_exp_bitstring): New function to write packed
bitstrings into the expression element vector.
* parse.c (length_of_subexp, prefixify_subexp): Add case for
OP_BITSTRING.
* parser-defs.h (struct stoken): Document that it is used for
OP_BITSTRING as well as OP_STRING.
* parser-defs.h (write_exp_bitstring): Add prototype.
**** start-sanitize-chill ****
* ch-exp.y (BIT_STRING_LITERAL): Change token type to sval.
* ch-exp.y (NUM, PRED, SUCC, ABS, CARD, MAX, MIN, SIZE, UPPER,
LOWER, LENGTH): New tokens for keywords.
* ch-exp.y (chill_value_built_in_routine_call, mode_argument,
upper_lower_argument, length_argument, array_mode_name,
string_mode_name, variant_structure_mode_name): New non-terminals
and productions.
* ch-exp.y (literal): Useful production for BIT_STRING_LITERAL.
* ch-exp.y (match_bitstring_literal): New lexer support function
to recognize bitstring literals.
* ch-exp.y (tokentab6): New token table for 6 character keywords.
* ch-exp.y (tokentab5): Add LOWER, UPPER.
* ch-exp.y (tokentab4): Add PRED, SUCC, CARD, SIZE.
* ch-exp.y (tokentab3): Add NUM, ABS, MIN, MAX.
* ch-exp.y (yylex): Check tokentab6.
* ch-exp.y (yylex): Call match_bitstring_literal.
**** end-sanitize-chill ****
* eval.c (evaluate_subexp): Handle new BINOP_MOD.
* expprint.c (dump_expression): Handle new BINOP_MOD.
* language.c (binop_type_check): Handle new BINOP_MOD.
* main.c (float_handler): Re-enable float handler when hit.
* valarith.c (language.h): Include, need current_language.
* valarith.c (TRUNCATION_TOWARDS_ZERO): Define default macro
for integer divide truncates towards zero for negative results.
* valarith.c (value_x_binop): Handle BINOP_MOD if seen.
* valarith.c (value_binop): Allow arithmetic operations on
TYPE_CODE_CHAR variables. Add case to handle new BINOP_MOD.
**** start-sanitize-chill ****
* ch-exp.y (operand_4): Add useful actions for MOD and REM.
* ch-exp.y (tokentab3): Add MOD and REM.
* ch-exp.y (yylex): Set innermost_block for symbols found
in local scopes. Return LOCATION_NAME for local symbols.
* ch-lang.c (chill_op_print_tab): Fix MOD entry to use
BINOP_MOD instead of BINOP_REM. Add REM entry, using BINOP_REM.
**** end-sanitize-chill ****
* expprint.c (print_subexp): Rename BINOP_MULTI_SUBSCRIPT to
MULTI_SUBSCRIPT.
* expprint.c (dump_expression): New function for dumping
expression vectors during gdb debugging.
* expression.h (BINOP_MULTI_SUBSCRIPT): Name changed to
MULTI_SUBSCRIPT and moved out of BINOP range.
* expression.h (DUMP_EXPRESSION): New macro that calls
dump_expression if DEBUG_EXPRESSIONS is defined.
* m2-exp.y (BINOP_MULTI_SUBSCRIPT): Changed to MULTI_SUBSCRIPT.
* parse.c (length_of_subexp, prefixify_subexp): Change
BINOP_MULTI_SUBSCRIPT to MULTI_SUBSCRIPT.
* parse.c (parse_exp_1): Call DUMP_EXPRESSION before and after
prefixify'ing the expression.
* printcmd.c (print_command_1): Add comment.
**** start-sanitize-chill ****
* ch-exp.y (expression_list): Add useful actions.
* ch-exp.y (value_array_element): Add useful actions.
* ch-exp.y (array_primitive_value): Add production.
* ch-exp.y (yylex): Recognize ',' as a token.
**** end-sanitize-chill ****
must include the "-y" option.
* c-exp.y, m2-exp.y (yyrule, yyname, yyss, yyssp, yyvs, yyvsp):
Remove defines to remap non-yacc symbols, thus backing out of
previous recent changes. Standard policy is that non-yacc parser
generators get fixed, rather than adding bug workarounds in gdb
for each new one that pops up. Expand comment to note this.
* c-exp.y, m2-exp.y (YYDEBUG): Revert back to disabled by default.
* c-exp.y, m2-exp.y (YYDEBUG): Define if MAINTENANCE_CMDS is defined
and YYDEBUG is not already defined.
* c-exp.y (strncmp): Replace throughout with STREQN, missed
them during the previous replacements.
* printcmd.c (_initialize_printcmd): Update internal documentation
for "set" command to note that the assignment syntax is language
dependent.
**** start-sanitize-chill ****
* ch-exp.y (yyreds, yytoks): Remap like other yy* names.
* ch-exp.y (YYDEBUG): Define if MAINTENANCE_CMDS is defined
and YYDEBUG is not already defined.
* ch-exp.y (GDB_REGNAME, GDB_LAST, GDB_VARIABLE, GDB_ASSIGNMENT,
single_assignment_action): New terminals and nonterminal for gdb
extensions to chill expression grammer.
* ch-exp.y (match_dollar_tokens): Lexer routine to match all
tokens that start with '$' (register names, convenience vars, etc).
* ch-exp.y (tokentab2): Add GDB_ASSIGNMENT.
* ch-exp.y (yylex): Call match_dollar_tokens.
**** end-sanitize-chill ****