parameter type info, set that from parameter symbols.
* c-typeprint.c (c_type_print_varspec_suffix): For TYPE_CODE_FUNC,
print parameter types, if available.
* ch-typeprint.c (chill_type_print_base): Likewise.
* gdbtypes.h (struct type): Remove function type field.
(TYPE_FUNCTION_TYPE): Remove macro. We can't as simply re-use
function types now that we're also storing parameter types.
And the payoff is much less.
* gdbtypes.c (make_function_type): Don't use/set TYPE_FUNCTION_TYPE.
(recursive_dump_type): Don't print TYPE_FUNCTION_TYPE.
* dwarfread.c (read_subroutine_type): Don't set TYPE_FUNCTION_TYPE.
* 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.
BOOL from TYPE_NAME.
* ch-valprint.c (chill_print_type_scalar): New function, to handle
TYPE_CODE_RANGE better than print_type_scalar does.
(chill_val_print_array_elements): Use above new function.
* ch-typeprint.c, ch-valprint.c: Use TYPE_INDEX_TYPE.
* ch-valprint.c (chill_val_print): Pass index type directly
(instead of its TYPE_TARGET_TYPE) to print_type_scalar.
* stabsread.c (read_type): Don't set TYPE_FLAG_TARGET_STUB
if the index type is a stub.
Change comments regarding TYPE_CODE_BOOL.
* language.c (boolean_type): Always return 1 for TYPE_CODE_BOOL,
regardless of the language.
(value_true): Just call value_logical_not regardless of language.
* coffread.c (coff_read_enum_type), stabsread.c (read_enum_type):
Remove #if 0'd code which makes some enums TYPE_CODE_BOOL.
* language.h: Improve comment for la_builtin_type_vector.
* m2-lang.c (_initialize_m2_language): Don't add any fields to
builtin_type_m2_bool.
* 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.
without interpreting that to mean "adjustable."
* ch-valprint.c (chill_val_print): Handle RANGE types.
* ch-typeprint.c (chill_type_print_base): Handle BOOL.
Handle variant records. Handle RANGE types.
* gdbtypes.c (check_stub_type): On TYPE_FLAG_TARGET_STUB, do
what cleanup_undefined_types does for arrays, except we clear
TYPE_FLAG_TARGET_STUB if we fix up the type.
* stabsread.c (cleanup_undefined_types): Add comments about how
doing arrays here is no longer the clean way to do it.
(read_array_type): Set TYPE_FLAG_TARGET_STUB as well as calling
add_undefined_type.
* c-typeprint.c, ch-typeprint.c: Move call to check_stub_type
outside switch so it happens for all type codes.
* cp-valprint.c (cp_print_value_fields): Recurse to val_print,
instead of c_val_print, so that check_stub_type gets called.
* gdbtypes.h, gdbtypes.c, m2-lang.c, ch-lang.c, c-lang.c: Remove
TYPE_FLAG_SIGNED. It was inconsistently set, never checked
(except in recursive_dump_type), and is pointless.
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.
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.
* ch-typeprint.c (chill_print_type_base): Name changed to
chill_type_print_base to match pattern for C and C++ names.
* ch-typeprint.c (chill_print_type): Change "char" to "CHAR"
to be consistent with other usages.
* ch-typeprint.c (chill_type_print_base): Add support for
printing Chill STRUCT types.
* ch-valprint.c: Include values.h.
* ch-valprint.c (chill_print_value_fields): New function and
prototype for printing Chill STRUCT values.
* ch-valprint.c (chill_val_print): Fix call to val_print_string
that was being called with two args instead of three.
* ch-valprint.c (chill_val_print): Call chill_print_value_fields
to print Chill STRUCT values.
**** end-sanitize-chill ****
of array constants using the obvious syntax.
* c-valprint.c (c_val_print): Set printed string length.
* dwarfread.c (read_tag_string_type): New prototype and
function that handles TAG_string_type DIEs.
* dwarfread.c (process_dies): Add case for TAG_string_type
that calls new read_tag_string_type function.
* expprint.c (print_subexp): Add support for OP_ARRAY.
* gdbtypes.c (create_range_type, create_array_type): Inherit
objfile from the index type.
**** start-sanitize-chill ****
* ch-typeprint.c (chill_print_type): Add case for
TYPE_CODE_STRING.
* ch-valprint.c (chill_val_print): Fix case for
TYPE_CODE_STRING.
**** end-sanitize-chill ****
* Makefile.in (SFILES_MAINDIR): Add typeprint.c, c-typeprint.c,
m2-typeprint.c, c-valprint.c cp-valprint.c m2-valprint.c.
* Makefile.in (HFILES): Add valprint.h.
* Makefile.in (OBS): Add typeprint.o, c-typeprint.o,
m2-typeprint.o, c-valprint.o, cp-valprint.o m2-valprint.o.
* typeprint.c, typeprint.h: New files for language independent
type printing functions.
* c-typeprint.c, m2-typeprint.c: New files for language dependent
type printing functions and definitions.
* valprint.h: New include file for language independent value
printing definitions.
* c-valprint.c, cp-valprint.c, m2-valprint.c: New files for language
dependent value printing functions.
* c-exp.y (production ptype): Add range_type variable and use new
create_range_type function.
* c-exp.y (tokentab2, tokentab3), c-lang.c (c_op_print_tab),
infcmd.c (path_var_name), language.c (unk_op_print_tab),
m2-lang.c (m2_op_print_tab): Change from ANSI-obsolescent
"const static" to ANSI-conformant "static const".
* c-exp.y (c_create_fundamental_type): Remove unused nbytes.
* c-exp.y (c_language_defn, cplus_language_defn): Add c_print_type,
and c_val_print.
* c-lang.h (c_print_type, c_val_print): Add prototypes.
* coffread.c (decode_type): Add range_type variable and call to
new create_range_type function.
* complaints.c (complain): Remove unused val variable.
* complaints.c (_initialize_complaints): Make it void.
* convex-tdep.c (value_of_trapped_internalvar): Add range_type
variable and call new create_range_type function.
* defs.h (enum val_prettyprint): Move enum from value.h to here
so we can avoid having to include value.h just for prototypes that
need the enum (thanks ANSI).
* dwarfread.c (struct_type): Local anonymous_size variable is
only used if !BITS_BIG_ENDIAN.
* dwarfread.c (decode_subscript_data_item): Add rangetype
variable and call new create_range_type function.
* elfread.c (elf_symfile_read): Remove unused dbx and text_sect
variables.
* eval.c (evaluate_subexp): Remove unused local variable name
and the statement with no side effects that initializes it.
* expprint.c (print_subexp): Change local_printstr to
LA_PRINT_STRING.
* gdbtypes.c (create_range_type): New function that creates
a range type using code fragments from object file readers as
an example of what has to be initialized.
* gdbtypes.c (create_array_type): Removed index_type, low_bound,
and high_bound parameters, replaced with a single range_type
parameter. Change function body to use passed in range_type
rather than handcrafting one.
* gdbtypes.h (create_range_type): Add prototype.
* gdbtypes.h (create_array_type): Change prototype parameters.
* infrun.c (normal_stop): Remove unused local variables tem and c.
* infrun.c (hook_stop_stub): Return 0 rather than random value.
* language.c (unk_lang_print_type, unk_lang_val_print): Add
stub functions that call error if called.
* language.c (unknown_language_defn, auto_language_defn,
local_language_defn): Add initializers unk_lang_print_type and
unk_lang_val_print.
* language.h (struct language_defn): Reformat for larger
comments, add la_print_type and la_val_print members. Add
LA_PRINT_TYPE and LA_VAL_PRINT macros. Change local_printchar
to LA_PRINT_CHAR and local_printstr to LA_PRINT_STRING.
* m2-lang.c (m2_create_fundamental_type): Remove unused local
variable nbytes.
* m2-lang.c (m2_language_defn): Add initializers m2_print_type
and m2_val_print.
* m2-lang.h (m2_print_type, m2_val_print): Add prototypes.
* main.c (execute_command): Remove unused local variable cmdlines.
* main.c (echo_command), stabsread.c (read_type), printcmd.c
(clear_displays), symmisc.c (block_depth), values.c
(clear_value_history):
Make testing of truth value of assignment result explicit.
* mipsread.c (upgrade_type): Update FIXME to include future use
of create_range_type.
* printcmd.c (ptype_command, ptype_eval, whatis_command,
whatis_exp, maintenance_print_type): Move prototypes and functions
to new typeprint.c.
* printcmd.c (_initialize_printcmd): Move add_com calls for
ptype_command and whatis_command to new typeprint.c.
* ser-bsd.c (serial_open): Remove unused variable sgttyb.
* source.c (find_source_lines): Local variable c only used
when LSEEK_NOT_LINEAR is defined.
* stabsread.c (read_array_type): Use new create_range_type
function.
* stabsread.c (read_range_type): Add new index_type variable and
call new create_range_type function rather than handcrafting
range types.
* symmisc.c (type_print_1): Change usages to LA_PRINT_TYPE.
* symtab.c (typedef_print usages): Use c_typedef_print, renamed.
* symtab.c (type_print_base usages): Use c_type_print_base.
* symtab.c (type_print_varspec_prefix usages): Use
c_type_print_varspec_prefix.
* symtab.c (type_print_method_args usages): Use
cp_type_print_method_args.
* valprint.c: Completely ripped apart and the fragments used
to create c-valprint.c, cp-valprint.c, m2-valprint.c, and
valprint.h. Remaining stuff is language independent.
* value.h (struct fn_field): Forward declare for prototypes.
* value.h (type_print_1): Remove prototype.
* value.h (enum val_prettyprint): Moved to defs.h.
* value.h (typedef_print): Prototype renamed to c_typedef_print.
* value.h (baseclass_offset): Add prototype.
**** start-sanitize-chill ****
* Makefile.in (SFILES_MAINDIR): Add ch-typeprint.c, ch-valprint.c.
* Makefile.in (OBS): Add ch-typeprint.o, ch-valprint.o.
* ch-typeprint.c: New file for language dependent type printing.
* ch-valprint.c: New file for language dependent value printing.
* ch-exp.y (parse_number): Remove prototype and stub function.
* ch-exp.y (decode_integer_literal): Removed unused digits and
temp variables.
* ch-exp.y (convert_float): Completely ifdef out for now.
* ch-exp.y (tokentab2, tokentab3, tokentab4, tokentab5),
ch-lang.c (chill_op_print_tab):
Change from ANSI-obsolescent "const static" to ANSI-conformant
"static const".
* ch-exp.y (yylex): Add unhandled storage class enumeration
literals to switch statement for completeness.
* ch-lang.c (chill_create_fundamental_types): Remove unused
nbytes variable. Change dummy type to 2 bytes to match int.
Handle FT_VOID types gratuituously added to chill DWARF by
compiler. Change FT_CHAR case to generate an TYPE_CODE_CHAR
type rather than a one byte TYPE_CODE_INT type.
* ch-lang.c (chill_language_defn): Add chill_print_type and
chill_val_print.
* ch-lang.h (chill_print_type, chill_val_print): Add prototypes.
**** end-sanitize-chill ****