Commit Graph

192 Commits

Author SHA1 Message Date
Elena Zannoni 73d322b1b9 2002-04-19 Elena Zannoni <ezannoni@redhat.com>
Fix PR gdb/471.
	* gdbtypes.c (init_simd_type): Rewrite using new functions.
	(build_builtin_type_vec128): Ditto..
	(append_composite_type_field): Fix calculation of type length in
	union case.
2002-04-20 01:09:28 +00:00
Andrew Cagney 0e10145828 * gdbtypes.c (append_composite_type_field): New function.
(init_composite_type): New function.
* gdbtypes.h (append_composite_type_field): Declare.
(init_composite_type): Ditto.
2002-03-23 01:24:54 +00:00
Corinna Vinschen 9c9532c936 * gdbtypes.c (build_gdbtypes): Disable setting a specific float format
on builtin float types.
2002-02-08 17:34:33 +00:00
Daniel Jacobowitz 493d28d51b 2002-02-03 Daniel Jacobowitz <drow@mvista.com>
* gdbtypes.c (init_simd_type): Use TYPE_TAG_NAME instead of
        accessing tag_name directly.
2002-02-03 23:18:11 +00:00
Daniel Jacobowitz dd6bda650a 2002-02-01 Daniel Jacobowitz <drow@mvista.com>
PR gdb/280
        * gdbtypes.c (replace_type): New function.
        * gdbtypes.h (replace_type): Add prototype.
        * stabsread.c (read_type): Use replace_type.
2002-02-03 22:57:56 +00:00
Andrew Cagney 069e84fd96 Initialize the TYPE_FLOATFORMAT field of the h/w floating-point
builtin types.
2002-01-22 19:57:40 +00:00
Daniel Jacobowitz d7f0b9ce2d 2002-01-20 Daniel Jacobowitz <drow@mvista.com>
* buildsym.c: Update copyright years.
	* c-typeprint.c: Likewise.
	* dwarf2read.c: Likewise.
	* f-typeprint.c: Likewise.
	* gdbtypes.c: Likewise.
	* gdbtypes.h: Likewise.
	* hp-symtab-read.c: Likewise.
	* hpread.c: Likewise.
	* mdebugread.c: Likewise.
	* p-typeprint.c: Likewise.
2002-01-20 19:42:04 +00:00
Elena Zannoni 08cf96df0e 2002-01-15 Elena Zannoni <ezannoni@redhat.com>
[Based on work by Jim Blandy]

	* gdbtypes.h (builtin_type_v16qi, builtin_type_v8hi): Export.
	(builtin_type_vec128): Export.

	* gdbtypes.c (builtin_type_v16qi, builtin_type_v8hi): New SIMD
	types.
	(builtin_type_vec128): New builtin type for 128 bit vector
	registers.
	(build_gdbtypes): Initialize builtin_type_v16qi and
	builtin_type_v8hi. Create the vec128 register builtin type
	structure.
	(build_builtin_type_vec128): New function.
 	(_initialize_gdbtypes): Register builtin_type_v16qi and
	builtin_type_v8hi with gdbarch. Same for builtin_type_vec128.

	* rs6000-tdep.c (rs6000_register_virtual_type): Change type of
	AltiVec register to new builtin type.
2002-01-15 19:38:19 +00:00
Jim Blandy 4e40929968 * gdbarch.sh (TARGET_CHAR_SIGNED): New macro.
* gdbarch.c, gdbarch.h: Regenerated.
* gdbtypes.c (build_gdbtypes): If TARGET_CHAR_SIGNED is zero,
set the TYPE_FLAG_UNSIGNED bit on the type.
* s390-tdep.c (s390_gdbarch_init): On the S/390, characters
are unsigned by default.
* rs6000-tdep.c (rs6000_gdbarch_init): Same for PowerPC and
RS6000.
2001-12-20 03:26:08 +00:00
Fred Fish 74a9bb82c5 Approved by Jim Blandy:
2001-12-11  Fred Fish  <fnf@redhat.com>
	* c-typeprint.c (c_type_print_base): Use type flags access macros
	to test bits.
	* ch-typeprint.c (chill_type_print_base): Ditto.
	* ch-valprint.c (chill_val_print): Ditto.
	* d10v-tdep.c (d10v_pointer_to_address): Ditto.
	* dwarf2read.c (dwarf2_add_member_fn): Ditto.
	* dwarfread.c (read_structure_scope): Ditto.
	* gdbtypes.c (create_range_type): Dittol
	(create_set_type): Ditto.
	(check_typedef): Ditto.
	* jv-typeprint.c (java_type_print_base): Ditto.
	* p-typeprint.c (pascal_type_print_base): Ditto
	* p-valprint.c (pascal_val_print): Ditto.
	* stabsread.c (read_cfront_member_functions): Ditto.
	(read_member_functions): Ditto.
	(cleanup_undefined_types): Ditto.
	* valprint.c (val_print): Ditto.
	* valops.c (hand_function_call): Remove is_prototyped
	variable and just use type flag test macro directly.
2001-12-12 02:11:52 +00:00
Fred Fish e9e79dd9fc Approved by Jim Blandy:
2001-12-11  Fred Fish  <fnf@redhat.com>

	* gdbtypes.c (print_bound_type): New function.
	(recursive_dump_type): Print type struct code values
	TYPE_CODE_BITSTRING, TYPE_CODE_COMPLEX, TYPE_CODE_TEMPLATE,
	and TYPE_CODE_TEMPLATE_ARG.
	(recursive_dump_type): Print type struct members
	upper_bound_type, lower_bound_type, cv_type, and as_type.
	Also always print the tagname member, even when it is NULL.

	* testsuite/gdb.base/maint.exp: Update to match changes in
	type dumping code.
2001-12-12 02:07:12 +00:00
Fred Fish 762a036f9a Approved by Jim Blandy:
2001-12-09  Fred Fish  <fnf@redhat.com>
	* gdbtypes.c (TYPE_FLAG_UNSIGNED, TYPE_FLAG_STUB): Use
	TYPE_UNSIGNED and TYPE_NOSIGN to determine when to print these
	rather than testing the bits directly.
	(TYPE_FLAG_NOSIGN, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC,
	TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_PROTOTYPED,
	TYPE_FLAG_INCOMPLETE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE,
	TYPE_FLAG_VARARGS): Test for and print these bits as well.
2001-12-10 06:23:21 +00:00
Fred Fish 34a2fedd5a Approved by Jim Blandy:
2001-12-09  Fred Fish  <fnf@redhat.com>
	* gdbtypes.c (build_gdbtypes): For builtin_type_char, pass
	TYPE_FLAG_NOSIGN to init_type() rather than setting it after the
	type is created.
2001-12-10 06:19:51 +00:00
Fred Fish 7e956337e5 Approved by Jim Blandy:
2001-12-09  Fred Fish  <fnf@redhat.com>
	* gdbtypes.c (allocate_stub_method): Replace hand crafted type
	initialization with call to the init_type() function.
2001-12-10 06:13:11 +00:00
Daniel Jacobowitz a02fd225ed * gdbtypes.c (finish_cv_type): New function.
(check_typedef): Remove ``register'' keyword from argument.
        Preserve const and volatile attributes across filling in
        opaque types.
        * gdbtypes.h (finish_cv_type): Add prototype.

        * hp-symtab-read.c (hpread_read_struct_type): Call finish_cv_type.
        * stabsread.c (read_struct_type): Likewise.
        * dwarf2read.c (read_structure_scope): Likewise.  Remove redundant
        assignment to die->type.
2001-12-07 22:11:51 +00:00
Michael Snyder 47663de598 2001-11-14 Michael Snyder <msnyder@redhat.com>
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-11-15 01:55:59 +00:00
Elena Zannoni 8b982acfc6 2001-11-13 Elena Zannoni <ezannoni@redhat.com>
From Andrew Cagney <cagney@redhat.com>:
	* gdbtypes.h (builtin_type_int128, builtin_type_uint128): Declare.
	* gdbtypes.c (_initialize_gdbtypes, build_gdbtypes): Initialize
	new builtin types.
2001-11-13 19:07:00 +00:00
Mark Kettenis e371b258f8 * gdbtypes.c (_initialize_gdbtypes): Set floating-point type for
builtin_type_i387_ext to floatformat_i387_ext.
2001-10-28 12:43:12 +00:00
Andrew Cagney 598f52dfcc * gdbtypes.h (builtin_type_ieee_single_big)
(builtin_type_ieee_single_little, builtin_type_ieee_double_big)
(builtin_type_ieee_double_little)
(builtin_type_ieee_double_littlebyte_bigword)
(builtin_type_i387_ext, builtin_type_m68881_ext)
(builtin_type_i960_ext, builtin_type_m88110_ext)
(builtin_type_m88110_harris_ext, builtin_type_arm_ext_big)
(builtin_type_arm_ext_littlebyte_bigword)
(builtin_type_ia64_spill_big, builtin_type_ia64_spill_little)
(builtin_type_ia64_quad_big)
(builtin_type_ia64_quad_little): Declare.
* gdbtypes.c (builtin_type_ieee_single_big)
(builtin_type_ieee_single_little, builtin_type_ieee_double_big)
(builtin_type_ieee_double_little)
(builtin_type_ieee_double_littlebyte_bigword)
(builtin_type_i387_ext, builtin_type_m68881_ext)
(builtin_type_i960_ext, builtin_type_m88110_ext)
(builtin_type_m88110_harris_ext, builtin_type_arm_ext_big)
(builtin_type_arm_ext_littlebyte_bigword)
(builtin_type_ia64_spill_big, builtin_type_ia64_spill_little)
(builtin_type_ia64_quad_big)
(builtin_type_ia64_quad_little): Define.
(_initialize_gdbtypes): Initialize builtin floatformat types.
2001-08-24 04:46:43 +00:00
Andrew Cagney 701c159d91 Add TYPE_FLOATFORMAT(). 2001-08-23 01:09:38 +00:00
Andrew Cagney 090a2205b5 * gdbtypes.h (builtin_type_void_data_ptr): Rename
builtin_type_ptr.
* gdbtypes.c (builtin_type_void_data_ptr): Update.
(build_gdbtypes): Update.
(_initialize_gdbtypes): Update.
* values.c (value_as_pointer): Update.
* utils.c (host_pointer_to_address): Update.
(address_to_host_pointer): Update.
2001-07-08 20:42:15 +00:00
Jim Blandy ee3a7b7f0d * gdbtypes.h (builtin_type_void_func_ptr): New builtin type.
* gdbtypes.c (builtin_type_void_func_ptr): Define the variable.
(build_gdbtypes): Initialize it.
(_initialize_gdbtypes): Swap it.
2001-07-06 14:44:19 +00:00
Andrew Cagney 502dcf4e39 Always initialize `p'. 2001-04-30 17:09:19 +00:00
Jim Blandy 015a42b4cf (Changes from Daniel Berlin, with revisions by Jim Blandy.)
Abstract out operations specific to particular C++ ABI's, and
invoke them through a function table.  This removes the C++ ABI
dependencies scattered throughout the code, and allows us to
cleanly add support for new C++ ABI's.
* cp-abi.h, cp-abi.h, gnu-v2-abi.c, hpacc-abi.c: New files.
* c-typeprint.c, c-valprint.c, dbxread.c, eval.c, gdbtypes.c,
jv-typeprint.c, linespec.c, symtab.c, typeprint.c, valops.c:
#include "cp-abi.h".  These files all use functions now declared
there.
* symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P):
Deleted.  These services are now provided by functions declared in
cp-abi.h.
* value.h (value_rtti_type, value_virtual_fn_field): Same.
* values.c (value_virtual_fn_field): Same, for this definition.
* valops.c (value_rtti_type): Same.
* c-typeprint.c (c_type_print_base): Use the functions from
"cp-abi.h", instead of the old macros, or hard-coded ABI-specific
tests.
* dbxread.c (record_minimal_symbol): Same.
* gdbtypes.c (get_destructor_fn_field, virtual_base_index,
virtual_base_index_skip_primaries): Same.
* jv-typeprint.c (java_type_print_base): Same.
* linespec.c (find_methods, decode_line_1): Same.
* symtab.c (gdb_mangle_name): Same.
* Makefile.in (SFILES): Add the new .c files mentioned above.
(cp_abi_h): New variable.
(COMMON_OBS): Add gnu-v2-abi.o, hpacc-abi.o, and cp-abi.o.
(cp-abi.o, gnu-v2-abi.o, hpacc-abi.o): New targets.
(c-typeprint.o, c-valprint.o, dbxread.o, eval.o, gdbtypes.o,
jv-typeprint.o, symtab.o, linespec.o, typeprint.o, valops.o): Add
dependency on $(cp_abi_h).
2001-04-27 00:19:09 +00:00
Andrew Cagney 3c37485b16 malloc() -> xmalloc.
Move malloc() decl to utils.c
2001-03-20 01:37:10 +00:00
J.T. Conklin 5565b5569b 2001-03-06 J.T. Conklin <jtc@redback.com>
* symtab.h (decode_line_1): Removed declaration.

        * symfile.c (#include <assert.h>): Removed.

        * arch-utils.c (#include <ctype.h>): Removed.
        * c-typeprint.c: Likewise.
        * dbxread.c: Likewise.
        * gdbtypes.c: Likewise.
        * target.c: Likewise.
        * os9kread.c: Likewise.

        * c-valprint.c (#include "demangle.h"): Removed.
        * ch-typeprint.c: Likewise.
        * eval.c: Likewise.
        * f-typeprint.c: Likewise.
        * f-valprint.c: Likewise.
        * m2-typeprint.c: Likewise.
        * typeprint.c: Likewise.
        * p-typeprint.c: Likewise.
        * valarith.c: Likewise.
        * valprint.c: Likewise.

        * m2-typeprint.c (#include "gdb_string.h"): Removed.
        * nlmread.c: Likewise.

        * mdebugread.c (#include "gdb-stabs.h"): Removed.
        * minsyms.c: Likewise.
        * mipsread.c: Likewise.
        * nlmread.c: Likewise.

        * m2-typeprint.c (#include "obstack.h"): Removed.
        * m2-valprint.c: Likewise.

        * event-loop.c (#include <setjmp.h>): Removed.
2001-03-07 02:57:08 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Kevin Buettner b8c9b27d1e Replace free() with xfree(). 2000-12-15 01:01:51 +00:00
Andrew Cagney 7f7e9482db * remote.c (remote_write_bytes): Add default case to switch
initializing ``todo''. Ditto for ``nr_bytes''.
* top.c (catch_errors): Always initialize ``val''.
* solib.c (info_sharedlibrary_command): Handle bfd_get_arch_size
returning an unknown size.
* gdbtypes.c (count_virtual_fns): Always initialize ``vfuncs''.
* breakpoint.c (break_at_finish_at_depth_command_1): Initialise
extra_args to NULL.
(break_at_finish_command_1): Ditto.
2000-11-27 02:18:44 +00:00
David Anderson 8c990f3c14 Corrected spelling in comment: extention-> to extension. 2000-09-02 00:05:02 +00:00
David Taylor 52204a0b3a Fri Aug 25 12:11:21 2000 David Taylor <taylor@texas.cygnus.com>
* symtab.c (search_symbols): Fix off by one error in index for
 	initializing variables ourtype, ourtype2, ourtype3, and ourtype4.
	(symtab_symbol_info): fix similar off by one error.

Fri Aug 25 12:03:15 2000  David Taylor  <taylor@texas.cygnus.com>

	* gdbarch.sh (TARGET_ADDR_BIT): New macro for the number
	of bits in gdb's representation of a target address.
	* gdbarch.c, gdbarch.h: Regenerated.
	* gdbtypes.c (build_gdbtypes): Use TARGET_ADDR_BIT instead of
 	TARGET_PTR_BIT when initializing builtin_type_CORE_ADDR.
	* printcmd.c (print_address_numeric): Use TARGET_ADDR_BIT instead
 	of TARGET_PTR_BIT, because we're printing an address, not a pointer.
2000-08-25 20:51:19 +00:00
Kevin Buettner fba45db2fa Protoization. 2000-07-30 01:48:28 +00:00
Andrew Cagney 67b2adb2c3 Cast integers into pointers before converting them into canonical
addresses.
2000-07-17 03:39:34 +00:00
Nicholas Duffek 6b1ba9a002 * gdbtypes.c (is_ancestor): Infer type equivalence from name
equivalence.
	(rank_one_type): Use strcmp instead of == to compare type names.
	Don't swap parm with arg when checking TYPE_CODE_REF types.
	* valops.c (find_overload_match): Fix indentation.  Compare
	parameter rankings to 0..9, 10..99, and 100+ instead of 0, 10,
	and 100.
2000-07-09 05:15:50 +00:00
Kevin Buettner a14ed312fd PARAMS removal. 2000-05-28 01:12:42 +00:00
Daniel Berlin 070ad9f02e C++ changes for 5.0, finally committed. 2000-04-04 04:53:50 +00:00
Nicholas Duffek c91ecb25c3 * gdbtypes.c (safe_parse_type): New wrapper function to ignore
error() during parse_and_eval_type().
	(check_stub_method): Call safe_parse_type instead of
	parse_and_eval_type().
	* wrapper.c (gdb_parse_and_eval_type): New wrapper function.
	(wrap_parse_and_eval_type): New support function.
	* wrapper.h (gdb_parse_and_eval_type): Prototype.
	(wrap_parse_and_eval_type): Prototype.
2000-04-03 03:39:09 +00:00
Daniel Berlin 5d161b2419 The set debug changes 2000-03-28 02:25:14 +00:00
Daniel Berlin 74cc24b096 FIx regression 2000-03-24 01:51:13 +00:00
Andrew Cagney db577aea67 From Daniel Berlin:
Fix C++ overloading, add support for seeing through references.
2000-03-13 10:01:23 +00:00
Andrew Cagney 7b83ea04b2 Revert: ``Fix C++ overload support, see through references''.
Change also contained numerous white-space changes.
2000-03-13 07:30:00 +00:00
Daniel Berlin 09b59ee380 Fix C++ overload support, see through references 2000-03-10 08:02:58 +00:00
Jason Molenda c4093a6ab3 import gdb-1999-12-13 snapshot 1999-12-14 01:06:04 +00:00
Jason Molenda c2d11a7da0 import gdb-1999-12-06 snapshot 1999-12-07 03:56:43 +00:00
Jason Molenda 5c44784c11 import gdb-1999-11-01 snapshot 1999-11-02 04:44:47 +00:00
Jason Molenda 917317f4c6 import gdb-1999-10-18 snapshot 1999-10-19 02:47:02 +00:00
Stan Shebs d4f3574e77 import gdb-1999-09-08 snapshot 1999-09-09 00:02:17 +00:00
Jason Molenda adf40b2e16 import gdb-1999-07-19 snapshot 1999-07-19 23:30:11 +00:00
Jason Molenda c5aa993b1f import gdb-1999-07-07 post reformat 1999-07-07 20:19:36 +00:00
Jason Molenda 9846de1bb5 import gdb-1999-07-07 pre reformat 1999-07-07 17:31:57 +00:00
Jason Molenda 9e0b60a847 import gdb-1999-06-21 snapshot 1999-06-21 13:27:42 +00:00
Jason Molenda 0f71a2f66f import gdb-1999-06-14 snapshot 1999-06-14 18:08:47 +00:00
Stan Shebs 7a292a7adf import gdb-19990422 snapshot 1999-04-26 18:34:20 +00:00
Stan Shebs c906108c21 Initial creation of sourceware repository 1999-04-16 01:35:26 +00:00
Stan Shebs 071ea11e85 Initial creation of sourceware repository 1999-04-16 01:34:07 +00:00
David Taylor 4ef1f46773 hp merge changes -- too numerous to mention here; see ChangeLog and
ChangeLog-gdbtk for details.
1998-12-28 23:06:13 +00:00
Andrew Cagney 115c338d20 CARP:
Swap the GDB builtin types when ever the architecture changes.
1998-12-16 15:05:19 +00:00
Andrew Cagney e81bad50a8 * gdbtypes.c (build_gdbtypes): New function.
(_initialize_gdbtypes): Call.
1998-12-16 14:57:08 +00:00
Jason Molenda 24418cfbac 1998-10-16 Jason Molenda (jsm@bugshack.cygnus.com)
* command.c copying.c copying.awk core-aout.c core-regset.c
          corelow.c dcache.c i386-tdep.c i386v4-nat.c i387-tdep.c
          infcmd.c infptrace.c infrun.c remote.c solib.c symfile.c
          symmisc.c valarith.c: Add prototypes.

        * defs.h: Add prototype for utils.c::do_run_cleanups.

        * gdbtypes.c: Add prototypes.
        (make_pointer_type): Add braces to remove nested if-else ambiguity.
        (make_reference_type): Ditto.

        * printcmd.c (printf_command): Initialize 'f' and 'string' at
        function startup to suppress possibly-used-before-initialized warning.

        * remote-utils.c: Add prototypes.
        (sr_pollchar): Add braces to remove nested if-else ambiguity.

        * ser-tcp.c: Add prototypes.
        (wait_for): Add braces to remove nested if-else ambiguity.
        (tcp_readchar): Ditto.

        * ser-unix.c: Add prototypes.
        (get_tty_state): Don't define errno here.

        (get_tty_state): Don't define errno here.
        (hardwire_readchar): Only define 't' if we are compiling in a Cygwin
        environment.

        * symtab.c: Add prototypes.
        (find_methods): Add braces to remove nested if-else ambiguity.
        (search_symbols): Set 'i' to an initial value to suppress a
        possibly-used-before-initialized warning.

        * valops.c: Add prototypes.
        (value_cast): Set 'eltype2' to an initial value to suppress a
        possibly-used-before-initialized warning.
        (value_of_variable): Add braces to remove nested if-else ambiguity.
        (value_of_this): Ditto.

        * valprint.c: Add prototypes.
        (print_floating): Add braces to remove nested if-else ambiguity.


Looks like a big change, but it is really just a lot of small stuff.

In the cases where GCC was flagging a possible use-before-initialized
warning on variables, it turned out that these were being used properly
but GCC couldn't see that.
1998-10-16 21:45:06 +00:00
Frank Ch. Eigler 7924771e5d * PR 15693 fix.
Wed Jun 10 18:04:35 1998  Frank Ch. Eigler  <fche@cygnus.com>
	* gdbtypes.c (get_discrete_bounds): Assign unsigned type flag for
	all-positive enum.
	(create_set_type): Ditto for all-positive set values.
	* values.c (unpack_field_as_long): Check for typedef in struct
	field unpacking.
1998-06-16 08:30:47 +00:00
Stu Grossman f6d23b6f3b * c-exp.y: Fix problems with parsing "'foo.bar'::func". Some languages
allow symbols with dots.

	* gdbtypes.c (check_stub_method):  Cosmetic.  Use more descriptive
	names for parameters.

start-sanitize-java
	* jv-exp.y:  Parser now accepts primitive types.
	* (parse_number):  Use correct ifdef for scanf long double support.
	* jv-lang.c (java_array_type):  Initial cut at array support.
end-sanitize-java

	* language.c language.h (set_language):  Now returns previous language.

	* symtab.c (find_methods):  Make static.  Cosmetic changes, including
	indentation, and adding descriptive comments.  Move local variable defs
	into the block they are used in.
	* Don't call check_stub_method any more.  Use gdb_mangle_name to
	generate the full method name.  find_method doesn't need all the other
	goobldegook that check_stub_method does.
	* (gdb_mangle_name):  Use more descriptive names for parameters.  Fix
	comment.
start-sanitize-java
	* (lookup_partial_symbol lookup_block_symbol):  Check for java to
	ensure we can find mangled names.
end-sanitize-java
	* (decode_line_1):  Move local variable defs into the block they are
	used in.  (Improves code readability.)
1998-06-10 23:29:59 +00:00
Frank Ch. Eigler ce22529028 * Fixes for chill PR 15681
Fri May  1 19:51:32 1998  Frank Ch. Eigler  <fche@cygnus.com>

	* stabsread.c (read_one_struct_field): Do not override supplied
 	bitfield size for a range type value.

	* gdbtypes.c (create_range_type): For a range with positive
	lower limit, declare range type as unsigned.
1998-05-04 15:16:42 +00:00
Andrew Cagney 980714f9c8 Add builtin explicitly sized 8, 16, 32, 64 and 128 bit int and
unsigned types.
Specify size of r5900 FSR using 32 bit unsigned type.
Correctly format mips registers when some are not 64 bits in size
Check that REGISTER_{RAW,VIRTUAL}_SIZE are consistent when the target
specifies that no conversion is needed when moving from one to the
other.
1998-03-20 07:50:33 +00:00
Jason Molenda dd60073596 Tue Feb 17 14:28:33 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
* acconfig.h: FORCE_MMCHECK changed to MMCHECK_FORCE.
        * configure.in: Ditto.
        * configure: Regenerated.

Tue Feb 17 14:07:34 1998  Peter Schauer <pes@regent.e-technik.tu-muenchen.de>

        * gdbtypes.c (check_typedef): Do not try to resolve the length of
        a type which has TYPE_FLAG_TARGET_STUB set, if the target type has
        set TYPE_FLAG_TARGET_STUB as well.



Patches from Peter.
1998-02-17 22:42:02 +00:00
Peter Schauer a46d92a736 * c-exp.y (qualified_name): Replace explicit check for valid
destructor name with call to destructor_name_p.

	* c-lang.h, c-typeprint.c (cp_type_print_method_args):  Removed,
	no longer needed.

	* c-typeprint.c (c_type_print_varspec_prefix, c_type_print_base):
	Replace remaining fprintf_unfiltered calls with their filtered variant.
	(c_type_print_base):  Do not print return type for destructors from
	template classes.
	Replace cp_type_print_method_args with cplus_demangle call to get
	consistent type output for stubbed and unstubbed methods.

	* cp-valprint.c (cp_print_class_method):  Replace
	cp_type_print_method_args with cplus_demangle call to get consistent
	type output for stubbed and unstubbed methods.

	* gdbtypes.c, gdbtypes.h (get_destructor_fn_field):  New function
	to find the destructor field indices for a type.

	* gdbtypes.h (struct type):  Clarify comments for vptr_basetype
	and arg_types fields.
	(struct fn_field):  Remove args field, no longer used.

	* symtab.c (decode_line_1), valops.c (value_struct_elt,
	check_field_in):  Use get_destructor_fn_field to find the destructor
	field indices instead of assuming that the compiler passes the member
	function fields in a specific order.

	* symtab.c (find_methods):  Pass NULL instead of SYMBOL_BLOCK_VALUE
	to lookup_symbol.
	(list_symbol):  Replace cp_type_print_method_args with cplus_demangle
	call in zapped out code and explain why this code is zapped out.
1996-12-14 09:17:22 +00:00
Fred Fish b607efe714 See gdb ChangeLog entry with header:
Thu Jul 25 19:41:31 1996  Fred Fish  <fnf@cygnus.com>

for a rather huge set of changes.  I was going to put them here, but it
made cvs dump core.  :-(
1996-07-26 03:01:51 +00:00
Wilfried Moser 81508b2759 * gdbtypes.c (create_array_type): If TYPE_LENGTH (result_type)
is zero, set TYPE_FLAG_TARGET_STUB to force reevaluation of the type.

        * ch-exp.c (calculate_array_length): Function removed.
1996-06-26 13:13:45 +00:00
Dawn Perchik 94f5a25f2e Add new support for parsing cfront stabs. 1996-04-24 19:34:45 +00:00
Wilfried Moser d221b17e83 * ch-valprint.c (calculate_array_length): New function to determine
the length of an array type (see comment).
        (chill_val_print (case TYPE_CODE_ARRAY)): If the length of an
        array type is zero, call calculate_array_length.

        * gdbtypes.c (get_discrete_bounds (case TYPE_CODE_ENUM)): They values
        may not be sorted. Scan all entries and set the real lower and
1996-01-29 08:17:22 +00:00
Per Bothner 7ef893139c * symfile.c (decrement_reading_symtab): New function.
* symfile.c, symtab.h (currently_reading_symtab):  New variable.
	* symfile.c (psymtab_to_symtab):  Adjust currently_reading_symtab.
	* gdbtypes.c (check_typedef):  Don't call lookup_symbol if
	currently_reading_symtab (since that could infinitely recurse).
This fixes PR chill/8793.
1996-01-12 07:16:20 +00:00
Fred Fish 2dd30c722b * defs.h: Delete extraneous whitespace at end of file.
* symfile.h: Move #include of demangle.h outside conditional.
	* objfiles.h (struct objstats, OBJSTAT, OBJSTATS): New struct
	and macros to hold per-objfile statistics for internal instrumentation.
	(struct objfile): Add OBJSTATS member, which is optional.
	* buildsym.h (next_symbol_text_func): Now takes objfile argument.
	Also update copyright to 1995.
	* dbxread.c (dbx_next_symbol_text): Now takes objfile argument.
	(dbx_symfile_init, coffstab_build_psymtabs, elfstab_build_psymtabs,
	stabsect_build_psymtabs): Accumulate string table size.
	(dbx_next_symbol_text, read_dbx_symtab, read_ofile_symtab):
	Accumulate number of stabs symbols read.
	* dwarfread.c (new_symbol, symthesize_typedef):
	Accumulate number of full symbols created.
	* gdbtypes.c (alloc_type): Accumulate number of types.
	* maint.c (maintenance_print_statistics): New function.
	* mdebugread.c (mdebug_next_symbol_text): Now takes objfile argument.
	* minsyms.c (prim_record_minimal_symbol_and_info): Accumulate
	number of minimal symbols read.
	* os9kread.c (read_os9k_psymtab): next_symbol_text takes objfile arg.
	* partial-stab.h: next_symbol_text takes objfile arg.
	* stabsread.c (error_type, STABS_CONTINUE): Now takes objfile arg and
 	uses it to call next_symbol_text.
	* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):
	Accumulate number of partial symbols created.
	* symfile.h (ADD_PSYMBOL_VT_TO_LIST): Accumulate number of partial
	symbols created.
	* symmisc.c (print_objfile_statistics): Print the per-objfile
	internal instrumentation statistics gathered.
	* xcoffread.c (xcoff_next_symbol_text): Now takes objfile argument.
1995-12-21 04:08:27 +00:00
Per Bothner f6d165855e * valops.c (value_cast): Handle casts to and from TYPE_CODE_CHAR.
* ch-exp.c (match_integer_literal):  Fix long long support.
	* gdbtypes.c (get_discrete_bounds):  Make TYPE_LENGTH (type) ==
	sizeof (LONGEST) case work OK.
1995-12-11 09:02:26 +00:00
Brendan Kehoe e045712fa8 * gdbtypes.c (check_stub_method): Make sure we get back a function
string in the demangled name before we try to use it.

fixes gdb/8306 (Mentor, ser/med)
1995-12-06 02:34:53 +00:00
Per Bothner c8b2ba5d48 * gdbtypes.c (check_stub_type): Removed; no longes needed.
* ch-exp.c (expect, parse_call):  Tweak error messages.
1995-12-01 08:04:51 +00:00
Per Bothner d1f4065e64 * gdbtypes.h (enum type_code): Added TYPE_CODE_TYPEDEF.
(check_typedef):  New prototype.
	(CHECK_TYPEDEF):  New macro.
	(TYPE_DUMMY_RANGE):  Removed.
	* gdbtypes.c (get_discrete_bounds):  Fix paren error; make more robust.
	(create_array_type):  Don't force_to_range_type;  users of the
	array are responsible for handling non-range index types.
	(create_set_type):  Likewise.
	(force_to_range_type):  Removed.
	(check_typedef):  New function handles stub types and typedefs.
	(check_stub_type):  Just call check_typedef. (To be removed.)
	(recursive_dump_type):  Handle TYPE_CODE_TYPEDEF.
	* ch-lang.c (type_lower_upper):  Use get_discrete_bounds.
	(evaluate_subexp_chill):  Handle string repetition.
	Re-arrange to handle EVAL_AVOID_SIDE_EFFECTS better.
	* ch-typeprint.c (chill_type_print_base):  Handle TYPE_CODE_TYPEDEF.
	Pass show=0 in recursive calls various places.
	(case TYPE_CODE_ARRAY):  Don't require index type to have
	TYPE_CODE_RANGE.
	(case TYPE_CODE_RANGE):  Don't need to support TYPE_DUMMY_RANGE.
	* gdbtypes.c, ch-lang.c, ch-typeprint.c (numerous places):
	Add check_typedef/CHECK_TYPEDEF as needed.
1995-11-30 01:07:28 +00:00
Per Bothner 4dda8ef3ff * gdbtypes.c (get_discrete_bounds): Fix typo. 1995-10-20 02:05:29 +00:00
Per Bothner 706bfe5a1c * gdbtypes.c (get_discrete_bounds): New function.
(force_to_range_type):  Use get_discrete_bounds.
	* gdbtypes.h (get_discrete_bounds):  Add declaration.
	* valarith.c (value_bit_index):  Generalize to use get_discrete_bounds.
	* ch-valprint.c (chill_val_print):  Make (power)sets and bitstring
	support use get_discrete_bounds and generally be more robust.
This fixes PR chill/8136.
1995-10-05 01:09:53 +00:00
Per Bothner b46805224b * gdbtypes.c (create_set_type): Set TYPE_LENGTH in bytes, not bits.
* valops.c (value_bitstring):  TYPE_LENGTH is bytes, not bits.

	* gdbtypes.c (force_to_range_type):  Calculate upper limit of
	TYPE_CODE_CHAR depending on TYPE_LENGTH (instead of just using 255).
1995-09-19 22:39:04 +00:00
Peter Schauer 2447e9afab * gdbtypes.c (recursive_dump_type): Add dont_print_type_obstack
to inhibit infinite recursion when printing aggregate types.
1995-08-19 08:21:23 +00:00
Fred Fish 6c9638b444 Update FSF address. 1995-08-02 03:41:12 +00:00
J.T. Conklin 2b57629364 * configure.in: Check for working mmap, ansi headers, string.h,
strings.h, and memory.h.
* configure: Regenerated.

* gdb_stat.h: New file, "portable" <sys/stat.h>.
* gdb_string.h: New file, "portable" <string.h>.

* altos-xdep.c, arm-tdep.c, arm-xdep.c, convex-tdep.c,
convex-xdep.c, coredep.c, cxux-nat.c, dbxread.c, exec.c,
gould-xdep.c, hppa-tdep.c, i386aix-nat.c, i386b-nat.c,
i386mach-nat.c, i386v-nat.c, infptrace.c, m88k-nat.c, main.c,
mdebugread.c, objfiles.c, os9kread.c, procfs.c, pyr-xdep.c,
rs6000-nat.c, source.c, standalone.c, stuff.c, sun386-nat.c,
symfile.c, symm-nat.c, symm-tdep.c, symtab.c, top.c, ultra3-nat.c,
ultra3-xdep.c, umax-xdep.c, xcoffread.c: Include "gdb_stat.h"
instead of <sys/stat.h>.

* alpha-tdep.c, breakpoint.c, buildsym.c, c-typeprint.c,
ch-typeprint.c, coffread.c, command.c, core-sol2.c, core-svr4.c,
core.c, corelow.c, cp-valprint.c, dbxread.c, dcache.c, demangle.c,
dpx2-nat.c, dstread.c, dwarfread.c, elfread.c, environ.c, eval.c,
exec.c, f-lang.c, f-typeprint.c, f-valprint.c, findvar.c,
fork-child.c, gdbtypes.c, hpread.c, i386-tdep.c, infcmd.c,
inflow.c, infptrace.c, infrun.c, irix5-nat.c, language.c,
m2-typeprint.c, main.c, mdebugread.c, minsyms.c, mipsread.c,
monitor.c, nlmread.c, objfiles.c, os9kread.c, osfsolib.c, parse.c,
printcmd.c, procfs.c, regex.c, remote-adapt.c, remote-arc.c,
remote-array.c, remote-bug.c, remote-e7000.c, remote-eb.c,
remote-es.c, remote-hms.c, remote-mm.c, remote-os9k.c,
remote-pa.c, remote-sim.c, remote-st.c, remote-udi.c,
remote-utils.c, remote-vx.c, remote-vx29k.c, remote-vx68.c,
remote-vx960.c, remote-vxmips.c, remote-vxsparc.c, remote.c,
solib.c, somread.c, source.c, stabsread.c, stack.c, symfile.c,
symmisc.c, symtab.c, target.c, top.c, typeprint.c, utils.c,
valarith.c, valops.c, valprint.c, values.c, xcoffread.c: Include
"gdb_string.h" instead of <string.h>.
* gdbtk.c: Likewise.

* config/xm-sysv4.h, i386/xm-ptx.h, m68k/xm-sun3os4.h,
sparc/xm-sun4os4.h (HAVE_MMAP): Removed.

* config/xm-lynx.h, config/i386/xm-ptx.h,
config/m68k/nm-apollo68b.h, config/m68k/xm-hp300hpux.h,
config/mips/xm-irix3.h, config/mips/xm-mips.h,
config/mips/xm-news-mips.h, config/mips/xm-riscos.h,
config/pa/hppah.h, config/rs6000/xm-rs6000.h,
config/sparc/xm-sun4os4.h, config/sparc/xm-sun4sol2.h,
config/vax/xm-vaxbsd.h, config/vax/xm-vaxult.h,
config/vax/xm-vaxult2.h (MEM_FNS_DECLARED): Removed.
* config/mips/xm-irix3.h, config/mips/xm-mips.h,
config/pa/xm-hppah.h (memcpy, memset): Removed declarations.
1995-08-01 20:14:27 +00:00
Per Bothner e55a579687 * gdbtypes.c (create_range_type): If indextype has TYPE_FLAG_STUB
set, set TYPE_FLAG_TARGET_STUB.
	(check_stub_type):  Recalculate TYPE_LENGTH for range type.
	* stabsread.c (read_range_type):  If index type number is followed
	by '=', back up, call read_type. and assume we have a true range.
	* gdbtypes.h (TYPE_FLAG_TARGET_STUB):  Update comment.
This fixes PR 6632.
1995-03-29 01:11:45 +00:00
Per Bothner 27202b6a47 * buildsym.c (finish_block): If finishing a function without known
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.
1995-02-12 18:46:45 +00:00
Per Bothner ead95f8ac2 * eval.c (evaluate_subexp): Clean up handling of
OP_UNDETERMINED_ARGLIST (no backtracking, more general).

	* f-valprint.c (f_val_print):  Print TYPE_CODE_STRING using
	LA_PRINT_STRING, and not val_print_string (which reads from inferior).

	* ch-lang.c (chill_is_varying_struct), ch-lang.h:  Remve function
	duplicate function made redundant by chill_varying_type.

	Re-write of f77 string and complex number support:

	* language.h (struct language_defn):  New fields string_lower_bound
	and string_char_type.
	* c-lang.c (c_language_defn, cplus_language_defn, asm_language_defn),
	language.c (unknown_language_defn, auto_language_defn,
	local_language_defn), m2-lang.c (m2_language_defn), f-lang.c
	(f_language_defn), ch-lang.c (chill_language_defn):  Set new fields.
	* gdbtypes.c (create_string_type):  Use new string_char_type field.
	* valops.c (value_string):  Use new string_lower_bound field.

	* defs.h (TARGET_COMPLEX_BIT, TARGET_DOUBLE_COMPLEX_BIT):  Removed.
	* f-lang.c (f_create_fundamental_type, _initialize_f_language),
	m2-lang.c (m2_create_fundamental_type),
	gdbtypes.c (_initialize_gdbtypes):  Set TYPE_TARGET_TYPE of complex
	types.  Set their TYPE_CODEs to TYPE_CODE_COMPLEX.
	* mdebugread.c (mdebug_type_complex, mdebug_type_double_complex):
	Removed.  Use builtin_type_complex and builtin_type_double_complex.

	* gdbtypes.h (enum type_code):  Removed TYPE_CODE_LITERAL_STRING
	and TYPE_CODE_LITERAL_COMPLEX.
	* c-typeprint.c, f-typeprint.c, f-valprint.c, eval.c:  Removed uses of
	TYPE_CODE_LITERAL_STRING and TYPE_CODE_LITERAL_COMPLEX.
	* gdbtypes.c, gdbtypes.h (f77_create_literal_complex_type,
	f77_create_literal_string_type):  Removed.
	* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_MEMADDR,
	VALUE_SUBSTRING_MYADDR):  Removed.

	* expression.h (enum exp_opcode):  Rename OP_F77_LITERAL_COMPLEX to
	OP_COMPLEX.
	* parse.c:  Update accordingly.

	* f-valprint.c (f77_print_cmplx):  Removed.
	(f_val_print case TYPE_CODE_COMPLEX):  Re-write to use print_floating.

	* f-exp.y (STRING_LITERAL):  Use OP_STRING instead of OP_ARRAY.
	* eval.c (evaluate_subexp):  For case OP_ARRAY, don't call
	f77_value_literal_string.
	* valops.c, value.h (f77_value_literal_string, f77_value_substring,
	f77_assign_from_literal_string, f77_assign_from_literal_complex):
	Removed.
	(value_assign):  No longer need to handle literal types.
	* valops.c (f77_value_literal_complex), value.h:  Re-written and
	renamed to value_literal_complex.  Last arg is now a (complex) type.
	* valops.c (f77_cast_into_complex):  Re-written and renamed to
	cast_into_complex.
	* eval.c (evaluate_subexp):  Update accordingly.
1995-02-02 03:37:26 +00:00
Per Bothner f91a9e05e0 * ch-exp.y (value_string_element, string_primitive_value,
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.
1995-02-01 21:02:51 +00:00
Per Bothner 6d34c23688 Add support for Chill bitstring literals (e.h. H'FF00').
* 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.
1995-01-23 21:20:58 +00:00
Per Bothner 576f97700b * stabsread.c (read_type): Handle stub types for bitstrings.
* stabsread.c (read_array_type):  Check for stub domain type
	using TYPE_FLAG_STUB, not its length.
	* gdbtypes.c (create_set_type):  Handle a stub domain type.
1994-09-16 07:29:44 +00:00
Stan Shebs a91a61923d Initial Fortran language support, adapted from work by Farooq Butt
(fmbutt@engage.sps.mot.com).
	* Makefile.in: Add Fortran-related files and dependencies.
	* defs.h (language_fortran): New language enum.
	* language.h (_LANG_fortran): Define.
	(MAX_FORTRAN_DIMS): Define.
	* expression.h: Reformat to standard.
	(MULTI_F77_SUBSCRIPT, OP_F77_UNDETERMINED_ARGLIST,
	OP_F77_LITERAL_COMPLEX, OP_F77_SUBSTR): New expression opcodes.
	* gdbtypes.h (TYPE_CODE_COMPLEX, TYPE_CODE_LITERAL_COMPLEX,
	TYPE_CODE_LITERAL_STRING): New type codes.
	(type): New fields upper_bound_type and lower_bound_type.
	(TYPE_ARRAY_UPPER_BOUND_TYPE, TYPE_ARRAY_LOWER_BOUND_TYPE,
	TYPE_ARRAY_UPPER_BOUND_VALUE, TYPE_ARRAY_LOWER_BOUND_VALUE): New
	macros.
	(builtin_type_f_character, etc): Declare.
	* value.h (VALUE_LITERAL_DATA, VALUE_SUBSTRING_START): Define.
	* f-exp.y: New file, Fortran expression grammar.
	* f-lang.c: New file, Fortran language support functions.
	* f-lang.h: New file, Fortran language support declarations.
	* f-typeprint.c: New file, Fortran type printing.
	* f-valprint.c: New file, Fortran value printing.
	* eval.c (evaluate_subexp): Add code for new expression opcodes,
	fix wording of error message.
	* gdbtypes.c (f77_create_literal_complex_type,
	f77_create_literal_string_type): New functions.
	* language.c (set_language_command): Add Fortran info.
	(calc_f77_array_dims): New function.
	* parse.c (length_of_subexp, prefixify_subexp): Add cases for new
	expression opcodes.
	* symfile.c (deduce_language_from_filename): Recognize .f and .F
	as Fortran source files.
	* valops.c (f77_value_literal_string, f77_value_substring,
	f77_value_literal_complex): New functions.
1994-08-19 21:59:05 +00:00
Jim Kingdon 9c036bd836 * utils.c (vfprintf_maybe_filtered, vfprintf_unfiltered): Call
fputs_unfiltered and exit directly, rather than fatal.  The latter
	calls vfprintf_unfiltered!

	* gdbtypes.h, gdbtypes.c (can_dereference): New function.
	* value.h, printcmd.c (print_value_flags): Move from here...
	* annotate.c: ...to here, and make it use can_dereference.
1994-05-17 20:13:50 +00:00
Jim Kingdon e552788b73 * gdbtypes.h, gdbtypes.c: Add comments regarding whether static
member functions have an element in args for a (nonexistent) this
	pointer.
1994-03-23 15:52:11 +00:00
Jim Kingdon 5e67875203 Fix many sins which will come up in 32 bit x 64 bit GDB, and
various miscellaneous things discovered in the process:
	* printcmd.c, defs.h (print_address_numeric): New function.
	* c-valprint.c (c_val_print), ch-valprint.c (chill_val_print)
	breakpoint.c (describe_other_breakpoints, breakpoint_1, mention),
	cp-valprint.c (cplus_print_value), infcmd.c (jump_command),
	printcmd.c, stack.c, symfile.c, symmisc.c, valprint.c:
	Use it.
	* utils.c, defs.h (gdb_print_address): New function.
	* expprint (dump_expression), gdbtypes.h: Use it.
	* breakpoint.c (describe_other_breakpoints),
	symmisc.c (dump_symtab, print_symbol):
	Use filtered not unfiltered I/O.
	(remove_breakpoints): Remove BREAKPOINT_DEBUG code.  Might as well
	just run gdb under a debugger for this (and it had problems with
	printing addresses, how to print b->shadow, etc.).
	* buildsym.c (make_blockvector), core.c (memory_error),
	exec.c (print_section_info), maint.c (print_section_table),
	mdebugread.c (parse_procedure), solib.c, source.c, symfile.c,
	symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
	Add comments saying code is broken.  Marked with "FIXME-32x64".
	* dbxread.c (process_one_symbol), partial-stab.h (default),
	remote-vx.c (vx_run_files_info):
	Don't cast int being passed to local_hex_string.
	* symmisc.c (print_symbol): Don't cast long being passed to %lx.
	* symtab.h (general_symbol_info): Add comment about SYMBOL_VALUE
	only being a long.
	* symmisc.c (print_symbol): Print "offset" in message for LOC_ARG
	and LOC_LOCAL.
	* printcmd.c (print_address): Remove #if 0 code with ADDR_BITS_REMOVE.
	* source.c: Include <sys/types.h> regardless of USG.
1994-01-27 01:12:06 +00:00
Jim Kingdon 833e0d94cc Fix many sins which will come up in 32 bit x 64 bit GDB, and
various miscellaneous things discovered in the process:
	* printcmd.c, defs.h (print_address_numeric): New function.
	* c-valprint.c (c_val_print), ch-valprint.c (chill_val_print)
	breakpoint.c (describe_other_breakpoints, breakpoint_1, mention),
	cp-valprint.c (cplus_print_value), infcmd.c (jump_command),
	printcmd.c, stack.c, symfile.c, symmisc.c, valprint.c:
	Use it.
	* utils.c, defs.h (gdb_print_address): New function.
	* expprint (dump_expression), gdbtypes.h: Use it.
	* breakpoint.c (describe_other_breakpoints),
	symmisc.c (dump_symtab, print_symbol):
	Use filtered not unfiltered I/O.
	(remove_breakpoints): Remove BREAKPOINT_DEBUG code.  Might as well
	just run gdb under a debugger for this (and it had problems with
	printing addresses, how to print b->shadow, etc.).
	* buildsym.c (make_blockvector), core.c (memory_error),
	exec.c (print_section_info), maint.c (print_section_table),
	mdebugread.c (parse_procedure), solib.c, source.c, symfile.c,
	symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
	Add comments saying code is broken.  Marked with "FIXME-32x64".
	* dbxread.c (process_one_symbol), partial-stab.h (default),
	remote-vx.c (vx_run_files_info):
	Don't cast int being passed to local_hex_string.
	* symmisc.c (print_symbol): Don't cast long being passed to %lx.
	* symtab.h (general_symbol_info): Add comment about SYMBOL_VALUE
	only being a long.
	* symmisc.c (print_symbol): Print "offset" in message for LOC_ARG
	and LOC_LOCAL.
	* printcmd.c (print_address): Remove #if 0 code with ADDR_BITS_REMOVE.
	* source.c: Include <sys/types.h> regardless of USG.
1994-01-27 00:36:05 +00:00
Jim Kingdon 393e55bac4 * c-exp.y: Revert Kung's change. "..." is not a type, and the
change caused "p (...)0" to dump core.
	* gdbtypes.c (check_stub_method): Don't pass "..." to
	parse_and_eval_type.  This should fix the bug which Kung was
	trying to fix.
1993-12-29 20:52:06 +00:00
Jim Kingdon 5461330147 * gdbtypes.c (force_to_range_type): Use switch statement.
complain() not warning() if the TYPE_CODE isn't one we know how to
	deal with gracefully.  Use builtin_type_int not
	lookup_fundamental_type (the objfile we passed to
	lookup_fundamental_type was sometimes NULL).
1993-12-26 22:37:47 +00:00
Per Bothner cba009211a * ch-exp.y (match_dollar_tokens): Fix off-by-one bug.
* 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.
1993-12-21 22:18:51 +00:00
Per Bothner e909f287a8 Implement support for Chill POWERSETs.
* ch-exp.y (operand_2):  Implement 'Element IN PowerSet'.
	* ch-typeprint.c (chill_type_print_base):  Handle POWERSETs.
	* ch-valprint.c (chill_val_print):  Handle TYPE_CODE_SET.
	* eval.c (evaluate_subexp):  Implement BINOP_IN.
	* expression.h (enum exp_opcode):  Added BINOP_IN.
	* gdbtypes.c (create_set_type), gdbtypes.h:  New function.
	* stabsread.c (read_type):  If 'S', create a set type.
	* valarith.c (value_bit_index, value_in), value.h:  New functions,
	for indexing in SETs.
1993-12-14 04:32:51 +00:00
Jim Kingdon dda398c369 * gdbtypes.h: Add TYPE_FLAG_TARGET_STUB.
* 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.
1993-11-15 20:13:30 +00:00
Kung Hsu 624456be75 Modified Files:
gdbtypes.c ChangeLog

        * gdbtypes.c (lookup_struct_elt_type): Handle type ref or pointer
        to struct/union case. (fix pr3857)
1993-11-12 19:21:13 +00:00
Thomas Lord 199b2450f6 Change the stream argument to _filtered to GDB_FILE *.
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.
1993-11-01 22:25:23 +00:00
Jim Kingdon 5573d7d4b1 Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* symmisc.c (print_symbol): Use %02x not %2x for LOC_CONST_BYTES.

	Clean up problems with targets and hosts that have 64 bit longs
	and pointers and 32 bit ints.
	* breakpoint.c, buildsym.c, c-lang.c, c-valprint.c, ch-lang.c,
	ch-valprint.c, core.c, cp-valprint.c, dbxread.c, exec.c,
	expprint.c, gdbtypes.c, infcmd.c, language.c, language.h,
	m2-lang.c, maint.c, mips-tdep.c, mipsread.c, partial-stab.h,
	printcmd.c, remote-vx.c, solib.c, source.c, stack.c, symfile.c,
	symmisc.c, symtab.c, valops.c, valprint.c, xcoffexec.c:
	Change all printf formats from %x to %lx if outputting an address.
	Change la_*_format to use long format.
	local_hex_string, local_hex_string_custom now take an unsigned long
	argument, change all callers.
	* coffread.c (read_coff_symtab):  Remove superfluous cast for
	complaint output.
	* dbxread.c (end_psymtab):  Cast MSYMBOL_INFO to long, not int.
	* findvar.c, value.h (write_register):  Change register value to long.
	* gdbtypes.h (struct type):  Change `bitsize' to long as
	TYPE_FIELD_STATIC_PHYSNAME uses this field as a pointer.
	* inferior.h (struct inferior_status):  Change type of stop_pc to
	CORE_ADDR.
	* language.h (local_octal_string, local_octal_string_custom):
	Remove prototype, the functions are neither defined nor used.
	* mipsread.c (parse_symbol):  Use temporary variable for bitsize as
	f->bitsize is a long now.
	* objfiles.c (add_to_objfile_sections, build_objfile_section_table):
	Use unsigned long casts instead of int for abusing sections_end
	pointer as integer.
	* stack.c (parse_frame_specification):  Change type of `args' to
	CORE_ADDR for SETUP_ARBITRARY_FRAME.

	* printcmd.c (make_vasize):  Allow redefinition via MAKEVA_SIZE.
	* mipsread.c (parse_type):  Alpha cc now supports the t->continued
	bit, update algorithm to match the way the compiler uses it.
1993-09-28 17:43:25 +00:00