Commit Graph

157 Commits

Author SHA1 Message Date
Fred Fish 77636dea0a * config/d10v/tm-d10v.h (CALL_DUMMY): Define as "{ 0 }".
(TARGET_READ_FP): Define to d10v_read_fp rather than d10v_read_sp.
	(TARGET_WRITE_FP): Define to d10v_write_fp rather than d10v_write_sp.
	(d10v_write_fp, d10v_read_fp): Add prototypes.
	* symtab.c (decode_line_1): Remove assignment of sals[0].pc field.
	* symfile.c (simple_overlay_update, simple_overlay_update_1):
	Ignore the size of overlay sections.  This check is redundant anyway.
	* printcmd.c (print_frame_args): Ditto.
	* valops.c (value_fetch_lazy): Ditto.
	* values.c (unpack_long): Ditto.
	* d10v-tdep.c (d10v_frame_chain, d10v_frame_find_saved_regs,
	d10v_init_extra_frame_info): Fix some minor bugs so the finish command
 	works properly.
	(show_regs): Change num1 and num2 types from "long long" to "LONGEST".
	(d10v_read_fp, d10v_write_fp): New functions.
	(d10v_push_arguments): Remove unneeded assigns to "val" and "contents".
	(d10v_push_arguments): Fix for pointers and structs.
	(d10v_extract_return_value): Fix for pointers and chars.
1998-01-23 15:44:12 +00:00
Peter Schauer 93e7a07fd7 * values.c (value_primitive_field): Account for offset when
extracting the value of a bitfield.
	From Paul Hilfinger <hilfingr@CS.Berkeley.EDU>.
1997-08-09 08:51:41 +00:00
Per Bothner f7f37388dc * gdbtypes.h: Re-interpret struct field. Suppport address of static.
Add a bunch of macros.
	* coffread.c, dwarf2read.c, dwarfread.c, mdebugread.c, stabsread.c:
	Update to use new macros.
	* coffread.c, hpread.c, stabsread.c:  Remove bugus TYPE_FIELD_VALUE.
	* value.h, values.c (value_static_field):  New function.
	* cp-valprint.c, valops.c:  Modify to use value_static_field.
1997-08-05 21:58:57 +00:00
Stu Grossman 6c310da826 * Makefile.in configure configure.in: Remove ENABLE_CLIBS,
ENABLE_OBS, and THREAD_DB_OBS.  These are consolidated into LIBS
	and CONFIG_OBS.
	* configure configure.in:  Clean up test cases around thread support.
start-sanitize-v850
	* configure.tgt (v850-*-*):  Include v850ice.o and v850.lib if
	host is Windows.
end-sanitize-v850
	* c-valprint.c ch-valprint.c cp-valprint.c eval.c expprint.c
	printcmd.c valops.c value.h values.c:  Add bfd_section arg to
	value_at and value_at_lazy.
	* coffread.c dbxread.c elfread.c mdebugread.c minsyms.c symtab.h:
	Add bfd_section arg to prim_record_minimal_symbol_and_info.
	* corefile.c gdbcore.h printcmd.c valops.c:  Use read_memory_section
	instead of read_memory.  It takes a bfd_section arg.
	* coffread.c dbxread.c elfread.c gdb-stabs.h objfiles.h:  Remove
	unnecessary cast for assignment of struct dbx_symfile_info.
	Struct objfile now uses a real pointer instead of PTR for this
	element.
	* dbxread.c (dbx_symfile_init): Stash bfd section pointers for
	text, data and bss into dbx_symfile_info.
	* exec.c (xfer_memory):  Handle transfers for user-specified
	sections.
	* findvar.c (read_var_value locate_var_value):  Copy bfd section
	from the symbol to the value.
	* gdb-stabs.h:  Add section pointers for text, data and bss
	sections.
	* maint.c (translate address command):  Add test code for overlay
	address translation.
	* printcmd.c (do_examine do_one_display):  Now takes a bfd section
	arg.
	* (print_formatted x_command):  Record current section along with
	current address for repeated commands.
	* sparc-nat.c (fetch_inferior_registers):  Change
	target_xfer_memory to target_{read write}_memory to allow changes
	to target_xfer_memory interface for section info.
	* symmisc.c (dump_msymbols print_symbol):  Print section
	assocaited with symbol.
	* symtab.c (fixup_symbol_section):  New routine to
	add section info to symbols returned by lookup_symbol.
	* symtab.h (struct general_symbol_info):  Add bfd section to
	symbols.
	* target.c target.h (target_xfer_memory):  Add bfd section to
	args.
	* (target_read_memory_section):  New routine to read data from a
	specific section.
	* (target_memory_bfd_section):  New global variable to pass bfd
	section in to targets.
	* valarith.c (value_add value_addr value_array):  Preserve bfd
	section when computing new value.
	* value.h (struct value):  Add bfd section to values.
	* values.c (allocate_value value_copy):  Initialize/preserve bfd
	section.
	* (unpack_double):  Clean up _MSC_VER conditionals to remove
	duplicate code.
start-sanitize-v850
	* v850ice.c:  New module to support communication with NEC's
	PC-based ICE.
	* config/v850/tm-v850.h (REGISTER_NAMES):  Replace sp, gp, fp, and
	ep names with rxx names.  sp and fp are renamed via a different
	mechanism.
end-sanitize-v850
1997-01-04 00:25:53 +00:00
Mark Alexander 214e969267 * values.c (unpack_double): Make it compile with MSVC++ 2.x.
* remote-mips.c (S_IROTH): Define if not defined by stat.h, e.g.
	when using MSVC++.
	(common_open): Fix help string.
1996-12-19 17:45:57 +00:00
Martin Hunt d9b9cbf3cc Fri Nov 22 15:55:22 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* valops.c (value_at, value_fetch_lazy): Put in D10V call
	to fix up address pointers.
	* values.c (value_from_longest): Removed previous d10v changes.
	* config/d10v/tm-d10v.h (TARGET_PTR_BIT): Change to 4 bytes.
1996-11-22 23:59:34 +00:00
Martin Hunt d716b33d85 Wed Nov 20 19:09:16 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
* infcmd.c (do_registers_info): Call val_print with the
	virtual buf instead of the raw buf.  Needed for REGISTER_CONVERT
	to work with non-floating point regs.

start-sanitize-d10v
	* d10v-tdep.c (d10v_skip_prologue): If we have line debugging
	information, then the end of the prologue should the first
	assembly instruction of the first source line.

	* values.c (value_from_longest): Put in D10V call to
	fix up address pointers.

	* config/d10v/tm-d10v.h (REGISTER_VIRTUAL_SIZE): Modified.
	(REGISTER_VIRTUAL_TYPE): Modified for PC_REGNUM and SP_REGNUM.
	(REGISTER_CONVERTIBLE): Make PC and SP convertible.
	(REGISTER_CONVERT_TO_VIRTUAL): Define.
	(REGISTER_CONVERT_TO_RAW): Define.
	(D10V_MAKE_DADDR): Define.
	(D10V_MAKE_IADDR): Define.
end-sanitize-d10v
1996-11-21 03:19:37 +00:00
Jim Wilson 119dfbb7c1 Patches to add Irix6 host support. 1996-11-12 23:33:32 +00:00
Dawn Perchik 28444bf3a1 * mips-tdep.c, remote-mips.c, values.c, mdebugread.c,
config/mips/tm-mips.h: Add/fix bugs for 64-bit mips support.
	* defs.h: Cleanup; add prototypess
	* corefile.c: Change FIXME #ifdef
	* win32-nat.c: Include windefs instead of windows.h.
	* utils.c: Add routines for printing addresses and registers
	based on type size.
1996-11-11 21:02:55 +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
Fred Fish b52cac6b76 * core-aout.c (fetch_core_registers): Cast core_reg_size to int
before testing against reg_ptr.
	* eval.c (evaluate_subexp_standard): Cast type of
	TYPE_FN_FIELD_VOFFSET to int.
	* findvar.c (extract_signed_integer, extract_unsigned_integer,
	extract_long_unsigned_integer): Cast type of sizeof to int.
	* values.c (unpack_field_as_long, modify_field): Ditto.
	* valops.c (value_assign, call_function_by_hand): Ditto.
	* infcmd.c (do_registers_info): Ditto.
	* ser-tcp.c (tcp_open): Ditto
	* remote.c (putpkt): Ditto.
	* dcache.c (dcache_peek): Ditto.
	* dcache.c (dcache_poke): Ditto.
	* m2-exp.y (yylex): Ditto.
	* gnu-regex.c (re_match_2): Ditto.
	* f-lang.c (ADD_BF_SYMNUM, saved_bf_list_end, tmp_bf_ptr): Ifdef
	out unused macro definition and variables.
	* inftarg.c (proc_wait): Move from main.c to here, and make static.
	* valprint.c (val_print_string): Change bufsize from int to unsigned.
	* main.c (wait.h): Include
	* top.c (command_line_input): Remove unused variable "c".
	* f-typeprint.c (f_type_print_varspec_prefix): Add missing enum
	value TYPE_CODE_TYPEDEF to switch statement.
	(f_type_print_varspec_suffix): Add missing enum value
	TYPE_CODE_TYPEDEF to switch statement.
	* ch-exp.c (parse_primval): Add remaining enumeration values to
	switch statement, with no specific action.
	(ch_lex): Add LOC_UNRESOLVED in switch statement.
	(pushback_token): Ifdef out, since code using it is ifdef'd out.
	* stabsread.c (cleanup_undefined_types): Remove unused label
	"badtype".
	* objfiles.h (print_symbol_bcache_statistics): Add prototype.
	* maint.c (objfiles.h): Include.
	(maintenance_print_statistics): Remove unused variable "temp".
	* minsyms.c (lookup_minimal_symbol_solib_trampoline): Remove
	unused variable "found_file_symbol".
	* m2-exp.y (yylex): Add LOC_UNRESOLVED case to switch.
	* language.c (lang_bool_type): Use existing function local type
	variable rather than create block local variables.
	* solib.c (disable_break): Enclose in ifndef SVR4_SHARED_LIBS.
	* infptrace.c (wait.h, command.h): Include.
	* ser-tcp.c (gdb_string.h): Include
	* i386-tdep.c (codestream_seek): Change "place" to CORE_ADDR.
	(i386_get_frame_setup): Change "pc" from int to CORE_ADDR.
	* command.c (complete_on_enum): Make assignment used as truth value
	explictly check against NULL.
	(wait.h): Include.
	* infrun.c (wait_for_inferior): Ifdef out prologue_pc since code
	that uses it is ifdef'd out.
	* parser-defs.h: Add prototype for write_dollar_variable.
	* infrun.c: Add prototype for write_pc_pid.
	* breakpoint.h: Add prototype for re_enable_breakpoints_in_shlibs.
	* symmisc.c (bcache.h): Include.
	* bcache.h: Add prototype for print_bcache_statistics.
	* symfile.c: Include <time.h>.
	* printcmd.c (print_scalar_formatted): Change len to unsigned int.
	* valarith.c (value_equal): Cast result of TYPE_LENGTH to int.
	* valarith.c (value_binop): Change result_len, promoted_len1,
 	and promoted_len2 to unsigned int.
	* valarith.c (value_subscripted_rvalue): Change elt_offs and
 	elt_size to unsigned int.
	* valops.c (value_array): Change typelength to unsigned int.
	(destructor_name_p): Change len to unsigned int.
	* scm-lang.h (scm_parse): Add prototype for scm_unpack.
	* symfile.c (decrement_reading_symtab): Change return type to void.
	* valarith.c (value_subscript): Remove unused variable "word".
	(value_subscript): Remove unused variable "tint".
	* valops.c (auto_abandon): Ifdef out, since code using it is also
	ifdef'd out.
	* eval.c (init_array_element): Remove unused variable "val".
	* Makefile.in (values.o): Depends on scm-lang.h.
	(command.o): Depends upon wait_h.
	(ser-tcp.o): Depends upon gdb_string.h.
	(infptrace.o): Depends upon wait_h and command_h.
	(maint.o): Depends on objfiles.h and symfile.h.
	* values.c (allocate_repeat_value): Remove unused variable
	"element_type".
	(scm-lang.h): Include.
	* breakpoint.c (create_longjmp_breakpoint): Enclose in
	GET_LONGJMP_TARGET define, unused otherwise.
	* config/i386/nm-linux.h: Add prototypes for i386_insert_watchpoint,
	i386_remove_watchpoint and i386_stopped_by_watchpoint.
1996-03-30 05:45:10 +00:00
Stu Grossman aa220473ba * Add native support for long double data type.
* c-exp.y (%union):  Change dval to typed_val_float.  Use DOUBLEST
	to store actual data.  Change types of INT and FLOAT tokens to
	typed_val_int and typed_val_float respectively.  Create new token
	DOUBLE_KEYWORD to specify the string `double'.  Make production
	for FLOAT use type determined by parse_number.  Add production for
	"long double" data type.
	* (parse_number):  Use sscanf to parse numbers as float, double or
	long double depending upon the type of typed_val_float.dval.  Also
	allow user to specify `f' or `l' suffix to explicitly specify
	float or long double constants.  Change typed_val to
	typed_val_int.
	* (yylex):  Change typed_val to typed_val_int.  Also, scan for
	"double" keyword.
	* coffread.c (decode_base_type):  Add support for T_LNGDBL basic
	type.
	* configure, configure.in:  Add check for long double support in
	the host compiler.
	* defs.h:  Define DOUBLEST appropriatly depending on whether
	HAVE_LONG_DOUBLE (from autoconf) is defined.  Also, fix prototypes
	for functions that handle this type.
	* expression.h (union exp_element):  doubleconst is now type
	DOUBLEST.
	* m2-exp.y f-exp.y (%union):  dval becomes type DOUBLEST.
	* findvar.c (extract_floating):  Make return value be DOUBLEST.
	Also, add support for numbers with size of long double.
	* (store_floating):  Arg `val' is now type DOUBLEST.  Handle all
	floating types.
	* parser-defs.h parse.c (write_exp_elt_dblcst):  Arg expelt is now
	DOUBLEST.
	* valarith.c (value_binop):  Change temp variables v1, v2 and v to
	type DOUBLEST.  Coerce type of result to long double if either op
	was of that type.
	* valops.c (value_arg_coerce):  If argument type is bigger than
	double, coerce to long double.
	* (call_function_by_hand):  If REG_STRUCT_HAS_ADDR is defined, and
	arg type is float and > 8 bytes, then use pointer-to-object
	calling conventions.
	* valprint.c (print_floating):  Arg doub is now type DOUBLEST.
	Use appropriate format and precision to print out floating point
	values.
	* value.h:  Fixup prototypes for value_as_double,
	value_from_double, and unpack_double to use DOUBLEST.
	* values.c (record_latest_value):  Remove check for invalid
	floats.  Allow history to store them so that people may examine
	them in hex if they want.
	* (value_as_double unpack_double):  Change return value to DOUBLEST.
	* (value_from_double):  Arg `num' is now DOUBLEST.
	* (using_struct_return):  Use RETURN_VALUE_ON_STACK macro (target
	specific) to expect certain types to always be returned on the stack.
1996-02-17 00:07:35 +00:00
Fred Fish 81afee37d0 * demangle.c (is_cplus_marker): New function, checks if a
character is one of the commonly used C++ marker characters.
	* defs.h (is_cplus_marker):  Add prototype.
	* c-typeprint.c (c_type_print_base), ch-lang.c (chill_demangle),
	cp-valprint.c (cp_print_class_method), mdebugread.c (parse_symbol),
	stabsread.c (define_symbol, read_member_functions, read_struct_fields),
	symtab.h (OPNAME_PREFIX_P, VTBL_PREFIX_P, DESTRUCTOR_PREFIX_P),
	values.c (vb_match):  Use is_cplus_marker instead of comparison
	with CPLUS_MARKER.
1996-02-16 06:14:15 +00:00
Per Bothner 533bda7704 * value.h (COERCE_ARRAY): Don't coerce enums.
(COERCE_ENUM):  Don't COERCE_REF.
	(COERCE_NUMBER):  New macro (same as COERCE_ARRAY then COERCE_ENUM).
	* valops.c (value_assign):  Only do COERCE_ARRAY if internalvar (let
 	value_cast handle it otherwise); do *not* COERCE_ENUM either way.
	* valarith.c:  Use COERCE_NUMBER instead od COEREC_ARRAY.
	Add COERCE_REF before COERCE_ENUM.
	* values.c (value_as_long):  Simplify.
This fixes PR chill/8869.
	* valops.c (value_array):  Create internalvar if !c_style_arrays.
1996-01-24 00:35:09 +00:00
Per Bothner 5e54886116 * ch-exp.y: Replaced by ...
* ch-exp.c:  New file.  Use recursive-descent.
	Recognize labelled array tuples and powerset ranges.
	* Makefile.in:  Update for no longer using yacc for ch-exp.

	* c-lang.c:  Make various functions non-static.
	* c-lang.h:  Add bunches of prototypes.
	* cp-valprint.c (cp_print_value_fields):  Also take address.
	(cp_print_value):  Likewise.  Use baselcass_offset.
	* stabsread.c (current_symbol):  New static variable.
	(type_synonym_name):  Remove.
	(read_type):  If copying, make copy be a TYPE_CODE_TYPEDEF.
	(read_array_type):  Don't need to handle undefined element type here.
	(cleanup_undefined_types):  Ditto.
	(read_range_type):  Look for Chill ranges.
	* valops.c (value_assign):  Fix case lval_internalvar - don't try
	to assign into old value (which might be too small!).
	(value_coerce_array):  No longer need special VALUE_REPEATED handling.
	(value_arg_coerce):  Cleaner array->pointer decay mechanism.
	(search_struct_field):  Use baseclass_offset rather than
	baseclass_addr.
	(value_slice):  Use get_discrete_bounds.
	* value.h (COERCE_VARYING_ARRAY):  Take type argumnt as well.
	* values.c (baseclass_offset):  Change parameter interface.
	(baseclass_addr):  Removed.
	* c-typeprint.c, c-valprint.c, ch-valprint.c, values.c, valops.c:
	Add check_typedef/CHECK_TYPEDEF as needed.
1995-11-30 03:26:34 +00:00
Per Bothner 398f584f64 * values.c allocate_repeat_value): Allocate an array type, and
a value of that type; use that instead of setting VALUE_REPEATED.
	* value.h (struct value):  Remove fields repetitions and repeated.
	(VALUE_REPEATED, VALUE_REPETITIONS):  Removed, no longer used.
	* c-valprint.c, ch-valprint.c, eval.c, printcmd.c, valops.c,
	value.h, values.c:  Simplify, since now VALUE_REPEATED is never used.
	* valprint.c (value_print_array_elemen):  Removed never-used function.
1995-10-06 00:37:40 +00:00
Per Bothner 3c02944a98 * expression.h (enum exp_code): Added OP_NAME.
* expprint.c (print_subexp):  Add OP_NAME support.
	* parse.c (length_of_subexp, prefixify_subexp):  Likewise.
	* scm-lang.c (scm_unpack, in_eval_c, scm_lookup_name):  new function.
	* scm-lang.h:  Declare builtin_type_scm;  other minor tweaks.
	* values.c (unpack_long):  If type is SCM, call scm_unpack.
	* scm-valprint.c (scm_val_print):  Use extract_signed_integer,
	instead unpack_long
	* scm-lang.c: More Scheme expression parsing from here ...
	* scm-exp.c:  ... to here.  New file.
	Also, provide for gdb to evaluate simple constants and names..
	* Makefile.in:  Note new scm-exp.{c,o}.
1995-10-05 05:24:41 +00:00
Peter Schauer 5e711e7f50 * configure.in: Explicitly `exit 0' for broken shells.
* configure:  Rebuilt.

	* symtab.c (list_symbols):  Add missing blank after
	`<function, no debug info>' output.

	* valops.c (value_assign):  Handle truncation when assigning
	to bitfields. Use value_copy to construct the return value
	from toval.
	* values.c (value_copy):  Copy VALUE_FRAME and VALUE_OPTIMIZED_OUT.
1995-09-02 13:48:16 +00:00
Peter Schauer 080868b466 * mdebugread.c (parse_symbol): Handle sh.value of zero for enums.
Determine signedness of enum type from enumerators.
	(parse_type):  Handle btIndirect types, handle fBitfield for
	some non-member types.
	(upgrade_type):  Use TYPE_FLAG_TARGET_STUB for arrays with
	unknown length.
	(cross_ref):  Handle stIndirect forward reference to btTypedef.

	* stabsread.c (read_enum_type):  Determine signedness of enum
	type from enumerators.

	* top.c (execute_command):  Remove trailing whitespace from
	command arguments, except for `set' and `complete' commands.
	(validate_comname):  Allow underscores in user defined command
	names.

	* values.c (modify_field):  Change `Value does not fit in %d bits'
	error to a warning. Exclude sign extension bits of negative field
	values from fit check.
1995-08-26 07:35:13 +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
Jim Kingdon ade016526a * values.c (set_internalvar): Set modifiable flag of newval. 1995-04-13 00:36:37 +00:00
Per Bothner acc4efdecd * language.h (struct language_defn): New field c_style_arrays.
* language.c (unknown_language_defn, auto_language_defn,
	local_language_defn), c-lang.c (c_language_defn, cplus_language_defn,
	asm_language_defn):  Set c_style_arrays to true.
	* m2-lang.c (m2_language_defn), ch-lang.c (chill_language_defn),
	f-lang.c (f_language_defn):  Set c_style_arrays to false.
	* valops.c (value_string):  If c_style_array is not set,
	allocate string in gdb (not inferior) using allocate_value.

	* value.h (COERCE_ARRAY), valops.c (value_addr, value_arg_coerce):
	Only call value_coerce_array if current_language->c_style_arrays.
	* values.c:  Add #include "language.h".  (Needed for COERCE_ARRAY.)

	* valops.c (chill_varying_type):  New predicate.
	* valops.c (value_cast):  Support assigning a fixed string or array
	to a variable string/array structure.

	* valarith.c (value_subscripted_rvalue):  Extra parameter lowerbound.
	Check index>=lowerbound, and then add lowerbound to index here,
	instead of in caller.  Generalize to arbitrary lval_types.
	(value_subscript):  Use enhanced value_subscripted_rvalue if
	c_style_arrays is false (and index is in range).
1995-01-26 02:32:25 +00:00
Peter Schauer 07aa9fdc6b * eval.c (evaluate_subexp): Make fnptr a LONGEST instead
of using longest_to_int.

	* infcmd.c (run_stack_dummy):  Reinstate set_current_frame call,
	mips and alpha targets need the real breakpoint pc for
	creating the breakpoint frame.

	* stack.c (return_command):  Cast return value to the return
	type of the function from which we return.
	* values.c (set_return_value):  Pass VALUE_CONTENTS unmodified
	to STORE_RETURN_VALUE.

	* symtab.c (lookup_symbol):  Remove search for `static mangled
	symbols', the search for `static symbols' already looks for
	mangled and demangled symbols via lookup_block_symbol.

	* valarith.c (value_binop):  Use ANSI C arithmetic conversions
	when performing integral evaluations, implement BINOP_EQUAL and
	BINOP_LESS.
	(value_equal, value_less):  Use value_binop to perform the
	comparison if both operands have TYPE_CODE_INT.

	* rs6000-tdep.c (pop_frame):  Make sure all registers are valid,
	as they are written back later. Handle sp restore for frameless
	functions. Use fdata.nosavedpc instead of fdata.frameless to
	determine if the pc has been saved.
	(function_frame_info):  Handle `mr r31,r1', which is generated by
	gcc-2.6, as a synonym for `oril r31,r1,0'.
	(skip_trampoline_code):  Handle shared library trampolines.
	* xcoffread.c (read_xcoff_symtabs):  Record XMC_GL symbols with
	their real name. Enables setting of breakpoints in shared libraries
	before the executable is run.
1994-10-15 10:50:07 +00:00
Ian Lance Taylor b8176214a5 * defs.h: If TARGET_BYTE_ORDER_SELECTABLE is defined by tm.h,
define TARGET_BYTE_ORDER as target_byte_order, and declare
	target_byte_order as an extern int, and define BITS_BIG_ENDIAN as
	a test of TARGET_BYTE_ORDER.
	* top.c: Several additions if TARGET_BYTE_ORDER_SELECTABLE is
	defined:
	(endianlist, target_byte_order): New variables.
	(set_endian, set_endian_big, set_endian_little): New functions.
	(show_endian): New function.
	(init_cmd_lists): Initialize endianlist.
	(init_main): Add commands ``set endian big'', ``set endian
	little'', and ``show endian''.
	* a29k-pinsn.c: Rewrite uses of TARGET_BYTE_ORDER and
	BITS_BIG_ENDIAN to switch at run time rather than at compile time.
	* coffread.c, dwarfread.c, findvar.c, mips-tdep.c: Likewise.
	* remote-os9k.c, stabsread.c, valarith.c, valprint.c: Likewise.
	* values.c: Likewise.
	* mips-tdep.c: Rewrite uses of GDB_TARGET_IS_MIPS64 to switch at
	run time rather than at compile time.
1994-10-06 16:47:32 +00:00
Stan Shebs ac57e5adda * infcmd.c (do_registers_info) [INVALID_FLOAT]: Only use if
defined.
	* values.c (unpack_double) [INVALID_FLOAT]: Ditto.
	* mips-tdep.c (mips_print_register): Don't test float validity.
	* config/a29k/tm-a29k.h, config/alpha/tm-alpha.h,
	config/arm/tm-arm.h, config/convex/tm-convex.h,
	config/h8300/tm-h8300.h, config/h8500/tm-h8500.h,
	config/i386/tm-i386v.h, config/i386/tm-sun386.h,
	config/i960/tm-i960.h, config/m68k/tm-m68k.h,
	config/m88k/tm-m88k.h, config/mips/tm-mips.h,
	config/ns32k/tm-merlin.h, config/ns32k/tm-nbsd.h,
	config/ns32k/tm-ns32km3.h, config/ns32k/tm-umax.h,
	config/pa/tm-hppa.h, config/pyr/tm-pyr.h,
	config/rs6000/tm-rs6000.h, config/sh/tm-sh.h,
	config/sparc/tm-sparc.h, config/z8k/tm-z8k.h (INVALID_FLOAT):
	Remove definition.
1994-09-25 21:13:24 +00:00
Peter Schauer 8918bce035 * Update copyright message to include 1993, 1994. 1994-09-10 10:10:05 +00:00
Peter Schauer 26a859ec83 * corelow.c (add_solib_stub): Copy to_sections changes from
core_ops to current_target after adding the shared libraries.
	* partial-stab.h (N_EXCL), dbxread.c (add_old_header_file,
	find_corresponding_bincl_psymtab):  Change `repeated header not seen'
	error to a complaint, simplify complaint.
	* procfs.c (signalname, errnoname):  Make `name' const.
	* symfile.c (reread_symbols):  Use filename from old BFD to
	reopen the objfile.
	* values.c (record_latest_value):  Don't record value in the
	history chain until we are sure there won't be an error.
1994-09-10 08:50:10 +00:00
Per Bothner 36a2283dad Add partial support for g++ code compiled with -fvtable-thunks.
* c-valprint.c (c_val_print):  Add vtblprint support
	when using thunks.
	* cp-valprint.c (cp_is_vtbl_member):  A vtable can be an array of
	pointers (if using thunks) as well as array of structs (otherwise).
	* cp-valprint.c (vtbl_ptr_name_old, vtbl_ptr_name):  Move to global
	level, and make the latter non-static (so define_symbol can use it).
	* stabsread.c (define_symbol):  If the type being defined is a
	pointer type named "__vtbl_ptr_type", set the TYPE_NAME to that name.
	* symtab.h (VTBL_PREFIX_P):  Allow "_VT" as well as "_vt".
	* values.c (value_virtual_fn_field):  Handle thunks.
	* values.c (value_headof):  Minor efficiency hack.
	* values.c (value_headof):   Incomplete thunk support.  FIXME.
1994-05-05 00:19:33 +00:00
Jeff Law 999dd04b89 * breakpoint.h (enum bptype): Add bp_hardware_watchpoint and
bp_watchpoint_scope breakpoints.
	(struct breakpoint): Add val_chain and related_breakpoint fields
	for use by watchpoints.

	* breakpoint.c (within_scope): Delete.  No longer used.
	(TARGET_CAN_USE_HARDWARE_WATCHPOINT): Provide default definition.
	(target_{remove,insert}_watchpoint): Likewise.
	(can_use_hardware_watchpoint): New function.
	(remove_breakpoint): New function to remove a single breakpoint
	or hardware watchpoint.
	(insert_breakpoints): Handle insertion of hardware watchpoints.
	Store a copy of the value chain derived from the watchpoint
	expression.
	(remove_breakpoints): Simplify by using remove_breakpoint.
	(delete_breakpoint): Likewise.
	(watchpoint_check): Delete the watchpoint and watchpoint scope
	breakpoints when the watchpoint goes out of scope.  Save & restore
	the current frame after checking watchpoints.
	(breakpoint_init_inferior): Likewise (restarting the program
	makes all local watchpoints go out of scope).
	(bpstat_stop_status): Handle hardware watchpoints much like normal
	watchpoints. Delete the watchpoint and watchpoint scope breakpoint
	when the watchpoint goes out of scope.  Remove and reinsert all
	breakpoints before returning if we stopped when a hardware watchpoint
	fired.
	(watch_command): Use a hardware watchpoint when possible.  If
	watching a local expression, build a scope breakpoint too.
	(map_breakpoint_numbers): Also call given function for any
	related breakpoints.
	(disable_breakpoint): Never disable a scope breakpoint.
	(enable_breakpoint): Handle hardware breakpoints much like normal
	breakpoints, but recompute the watchpoint_scope breakpoint's
	frame and address  (if we have an associated scope breakpoint).
	(read_memory_nobpt): Handle hardware watchpoints like normal
	watchpoints.  When necessary handle watchpoint_scope breakpoints.
	(print_it_normal, bpstat_what, breakpoint_1, mention): Likewise.
	(clear_command, breakpoint_re_set_one, enable_command): Likewise.
	(disable_command): Likewise.

	* blockframe.c (find_frame_addr_in_frame_chain): New function.
	Extern prototype added to frame.h

	* infrun.c (wait_for_inferior): Set current_frame and select
	a frame before checking if we stopped due to a hardare watchpoint
	firing.  Handle stepping over hardware watchpoints.
	(normal_stop): Remove unnecessary call to select_frame.

	* value.h (value_release_to_mark): Declare.
	* values.c (value_release_to_mark): New function.

	* procfs.c (procfs_wait): Add cases for hardware watchpoints.
	(procfs_set_watchpoint, procfs_stopped_by_watchpoint): New functions.

	* hppab-nat.c (hppa_set_watchpoint): New function.

	* config/pa/nm-hppab.h (STOPPED_BY_WATCHPOINT): Define.
	(HAVE_STEPPABLE_WATCHPOINT): Define.
	(TARGET_CAN_USE_HARDWARE_WATCHPOINT): Define.
	(target_{insert,delete}_watchpoint): Define.
1994-04-13 21:57:00 +00:00
Jim Kingdon a110a1c30b * values.c (unpack_long): Remove obsolete comment about using a
switch statement.
1994-04-08 22:30:55 +00:00
Per Bothner b96bc1e41f * values.c (unpack_long, value_from_longest),
valarith.c (value_binop):  Allow TYPE_CODE_RANGE.
1994-04-05 20:10:31 +00:00
Jim Kingdon 51f8393319 * values.c (set_internalvar): Don't set var->value until we are
sure there won't be an error().
1994-03-23 00:34:44 +00:00
Peter Schauer 849d0896f9 Fix typo, value has not been changed to value_ptr in all places. 1994-03-05 22:45:47 +00:00
Jim Kingdon 82a2edfbcf * breakpoint.c, breakpoint.h, c-valprint.c, ch-valprint.c,
cp-valprint.c, eval.c, expprint.c, findvar.c, language.c,
	objfiles.h, infcmd.c, printcmd.c, stack.c, typeprint.c,
	valarith.c, valops.c, valprint.c, value.h, values.c: Replace
	value with value_ptr.  This is for the ptx compiler.
	* objfiles.h, target.h: Don't declare a "sec_ptr" field using a
	"sec_ptr" typedef.
	* symm-nat.c: Add a bunch of stuff for symmetry's ptrace stuff.
	#if 0 i386_float_info.
	* symm-tdep.c (round): Remove.  Also remove sgttyb.
	* symm-tdep.c: Remove lots of stuff which duplicates stuff from
	i386-tdep.c.  Remove register_addr and ptx_coff_regno_to_gdb.
	* i386-tdep.c (i386_frame_find_saved_regs): Put in
	I386_REGNO_TO_SYMMETRY check in case it is needed for Dynix
	someday.
	* config/i386/nm-symmetry.h: Change KERNEL_U_ADDR.  Move
	stuff from PTRACE_READ_REGS, PTRACE_WRITE_REGS macros to
	symm-nat.c.  Define CHILD_WAIT and declare child_wait().
	* config/i386/tm-symmetry.h: Remove call function stuff; stuff in
	tm-i386v.h is apparently OK.
	* config/i386/xm-symmetry.h [_SEQUENT_]: Define HAVE_TERMIOS not
	HAVE_TERMIO.  Define MEM_FNS_DECLARED, NEED_POSIX_SETPGID, and
	USE_O_NOCTTY.
1994-03-03 01:00:57 +00:00
Jim Kingdon 30974778c1 * value.h (struct value): Add modifiable field.
* values.c (allocate_value, record_latest_value, value_copy): Set it.
	(record_latest_value): Don't mess with VALUE_LVAL of value.
	* valops.c (value_assign): Check it.  Reword existing error
	message on not_lval.
1994-03-01 02:20:39 +00:00
Jim Kingdon ca0865db54 * values.c (unpack_long): Fix garbled error message. 1993-12-30 22:49:48 +00:00
Jim Kingdon 89ce0c8f50 gcc -Wall lint:
* thread.c: Include "gdbcmd.h" and <ctype.h>.
	* Makefile.in: Update dependency.
	* thread.c (thread_command): Remove unused variable p.
	* values.c (unpack_double): Use len instead of TYPE_LENGTH (type).
	* valprint.c (print_floating): Correctly check sign bit now that
	we are using unsigned arithmetic.
	* symtab.c (find_pc_line_range): Remove unused variables exact_match,
	ind, and l.
1993-11-10 15:58:48 +00:00
Kung Hsu f1c6dbf683 Modified Files:
values.c valops.c ChangeLog

        * values.c (value_fn_field): when physical name not found, do not
        error, but return null.
        * valops.c (value_struct_elt): when name and args match does not
        mean it is the one, some times a typedef class can have the same
        memeber method and args. This probably will not happen with new
        version of g++, but it does happen in old g++ and cause gdb error.
1993-11-04 00:49:24 +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 bf5c0d6448 * defs.h, findvar.c (extract_floating, store_floating): New functions.
* Move SWAP_TARGET_AND_HOST from defs.h to findvar.c because it is
	now used only by extract_floating and store_floating.
	* valprint.c (print_floating): Use unsigned arithmetic.  Use
	extract_unsigned_integer instead of SWAP_TARGET_AND_HOST.
	Change sizeof (float) to 4 and sizeof (double) to 8 (those are always
	the relevant sizes for this code, which is in #ifdef IEEE_FLOAT).
	* values.c (unpack_long, unpack_double, value_from_double),
	valarith.c (value_binop), stabsread.c (define_symbol):
	Use extract_floating and store_floating instead of
	SWAP_TARGET_AND_HOST.
	* config/m68k/tm-m68k.h, config/i960/tm-i960.h (REGISTER_CONVERT_*):
	Use extract_floating and store_floating.
	* config/m88k/tm-m88k.h: Add comments (it should be doing the same).
	* i386-tdep.c (i386_extract_return_value),
	* remote-nindy.c (nindy_store_registers): Use store_floating.
1993-10-29 18:16:33 +00:00
Kung Hsu dcd8fd8c17 Modified Files:
values.c eval.c

        * values.c (value_virtual_fn_field): Fix the offset calculation
        when calling virtual functions. (gdb.t22/virtfunc.exp).
        * eval.c (evaluate_subexp): same as above.
1993-10-19 21:20:37 +00:00
Jim Kingdon 4abc83b995 Mon Oct 4 11:02:11 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* values.c (record_latest_value): Fetch lazy values and set VALUE_LVAL
	to not_lval.

Sun Oct  3 15:54:51 1993  Stan Shebs  (shebs@rtl.cygnus.com)

	* objfiles.h (objfile): New slot sym_stab_info, use by most
	stab-reading formats.
1993-10-04 16:43:41 +00:00
K. Richard Pixley 46c28185ab some gcc lint 1993-09-08 20:15:34 +00:00
Jim Kingdon b2ccb6a465 * printcmd.c (print_address), values.c (value_as_pointer): Don't
use ADDR_BITS_REMOVE.
1993-08-18 20:31:12 +00:00
Jim Kingdon 1410f5f13b * cp-valprint.c (cplus_print_value): Don't dump core if the
baseclass doesn't have a name.
	* values.c (vb_match): New function, which finds the virtual
	base class pointer even if the types are nameless.
	(baseclass_{addr,offset}): Use it.
1993-07-30 01:42:09 +00:00
Jim Kingdon 58e49e2178 * values.c, value.h (modify_field), callers: Make fieldval a LONGEST.
* h8300-tdep.c (NEXT_PROLOGUE_INSN): Make pword1 an INSN_WORD *
	not short *.

	* findvar.c, defs.h
	({extract,store}_{signed_integer,unsigned_integer,address}):
	New routines to replace SWAP_TARGET_AND_HOST.
	All over: All uses of SWAP_TARGET_AND_HOST on integers replaced.
1993-07-10 05:03:22 +00:00
Jim Kingdon 34df79fc9d * findvar.c, defs.h
({extract,store}_{signed_integer,unsigned_integer,address}):
	New routines to replace SWAP_TARGET_AND_HOST.
	All over: All uses of SWAP_TARGET_AND_HOST on integers replaced.
1993-07-10 01:35:53 +00:00
Steve Chamberlain 7ccb1e4401 * configure.in (alpha-*-osf*), config/alpha/alpha-osf.mh: New
host.
	* sh-tdep.c (frame_find_saved_regs): Use NUM_REGS rather than hard
	wired (and wrong) constant.
	* values.c (unpack_long): Add case to unpack when target object is
	sizeof(int).
	* config/sh/tm-sh.h (REGISTER_NAMES): Know about the news ones the
	simulator defines.
1993-06-17 22:16:07 +00:00
Fred Fish 7efb57c33d * defs.h (CC_HAS_LONG_LONG): Set up to define CC_HAS_LONG_LONG
when compiling with gcc, but disable it for now.  See comment.
	* defs.h (LONGEST):  Define as either "long" or "long long"
	based on CC_HAS_LONG_LONG.
	* defs.h (longest_to_int):  Use CC_HAS_LONG_LONG to control
	how longest_to_int is defined.
	* c-valprint.c (c_val_print):  Call print_longest.
	* expprint.c (dump_expression):  Use PRINTF_HAS_LONG_LONG
	instead of LONG_LONG.
	* {printcmd.c, gdbtypes.h} (LONG_LONG):  Replace usages with
	CC_HAS_LONG_LONG.
	* printcmd.c (print_scalar_formatted):  Call print_longest
	and let it figure out what to do for PRINTF_HAS_LONG_LONG.
	* typeprint.c (print_type_scalar):  Call print_longest and let
	it figure out what to do for PRINTF_HAS_LONG_LONG.
	* valprint.c (val_print_type_code_int):  Call print_longest
	and let it figure out what to do for PRINTF_HAS_LONG_LONG.
	* stabsread.c (LONG_LONG):  Replace usages with CC_HAS_LONG_LONG.
	* value.h (struct value):  Replace usage of LONG_LONG with
	CC_HAS_LONG_LONG.
	* value.h (print_longest):  Add prototype.
	* values.c (LONG_LONG):  Replace usages with CC_HAS_LONG_LONG.
	* values.c (unpack_double):  Collapse code that was unnecessarily
	dependent on CC_HAS_LONG_LONG.  Use LONGEST instead of direct types.
	* values.c (value_from_longest):  Remove dependency on
	CC_HAS_LONG_LONG and just use LONGEST.
	* solib.c (solib_map_sections):  Use bfd_get_filename
	to access filename field.
	* solib.c (clear_solib):  Save filename and free it later, after
	bfd_close, since bfd_close may reference it.  Use bfd_get_filename
	to access the field.
	* config/convex/xm-convex.h (LONG_LONG):  Replace with
	CC_HAS_LONG_LONG.  Add define for PRINTF_HAS_LONG_LONG.
	* doc/gdbint.texinfo (LONG_LONG):  Replace with CC_HAS_LONG_LONG.
	Add PRINTF_HAS_LONG_LONG references.
1993-04-29 07:07:39 +00:00
Jim Kingdon 9925b92861 * values.c (USE_STRUCT_RETURN): Only use gcc wierdness for gcc1. 1993-04-06 21:20:30 +00:00
Michael Tiemann 7cb0f87089 * values.c (value_headof): Fix typo in which VTBL and ARG were
being confused for one another.
1993-02-01 01:16:35 +00:00
Fred Fish c4413e2c9b * c-exp.y (exp:STRING): Convert C strings into array-of-char
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 ****
1993-01-16 05:15:58 +00:00
Fred Fish 2e4964adfc * defs.h (STRCMP, STREQ, STREQN): New macros.
* defs.h (demangle_and_match):  Remove prototype.
	* dwarfread.c (STREQ, STREQN):  Remove macros, replaced with STREQ
	  and STREQN defined in defs.h.
	* dwarfread.c (set_cu_language):  For completely unknown languages,
	  try to deduce the language from the filename.  Retain behavior
	  that for known languages we don't know how to handle, we use
	  language_unknown.
	* dwarfread.c (enum_type, symthesize_typedef):  Initialize language
	  and demangled name fields in symbol.
	* dwarfread.c, mipsread.c, partial-stab.h:  For all usages of
	  ADD_PSYMBOL_TO_LIST, add language and objfile parameters.
	* dwarfread.c (new_symbol):  Attempt to demangle C++ symbol names
	  and cache the results in SYMBOL_DEMANGLED_NAME for the symbol.
	* elfread.c (STREQ):  Remove macro, use STREQ defined in defs.h.
	  Replace usages throughout.
	* elfread.c (demangle.h):  Include.
	* elfread.c (record_minimal_symbol):  Remove prototype and function.
	* gdbtypes.h, symtab.h (B_SET, B_CLR, B_TST, B_TYPE, B_BYTES,
	  B_CLRALL):  Moved from symtab.h to gdbtypes.h.
	* infcmd.c (jump_command):  Remove code to demangle name and add
	  it to a cleanup list.  Now just use SYMBOL_DEMANGLED_NAME.
	* minsyms.c (demangle.h):  Include.
	* minsyms.c (lookup_minimal_symbol):  Indent comment to match code.
	* minsyms.c (install_minimal_symbols):  Attempt to demangle symbol
	  names as C++ names, and cache them in SYMBOL_DEMANGLED_NAME.
	* mipsread.c (psymtab_language):  Add static variable.
	* stabsread.c (demangle.h):  Include.
	* stabsread.c (define_symbol):  Attempt to demangle C++ symbol
	  names and cache them in the SYMBOL_DEMANGLED_NAME field.
	* stack.c (return_command):  Remove explicit demangling of name
	  and use of cleanups.  Just use SYMBOL_DEMANGLED_NAME.
	* symfile.c (demangle.h):  Include.
	* symfile.c (add_psymbol_to_list, add_psymbol_addr_to_list):  Fix
	  to match macros in symfile.h and allow them to be compiled
	  if INLINE_ADD_PSYMBOL is not true.
	* symfile.h (INLINE_ADD_PSYMBOL):  Default to true if not set.
	* symfile.h (ADD_PSYMBOL_*):  Add language and objfile parameters.
	  Add code to demangle and cache C++ symbol names.  Use macro form
	  if INLINE_ADD_PSYMBOL is true, otherwise use C function form.
	* symmisc.c (add_psymbol_to_list, add_psymbol_addr_to_list):
	  Remove, also defined in symfile.c, which we already fixed.
	* symtab.c (expensive_mangler):  Remove prototype and function.
	* symtab.c (find_methods):  Remove physnames parameter and fix
	  prototype to match.
	* symtab.c (completion_list_add_symbol):  Name changed to
	  completion_list_add_name.
	* symtab.c (COMPLETION_LIST_ADD_SYMBOL):  New macro, adds both
	  the normal symbol name and the cached C++ demangled name.
	* symtab.c (lookup_demangled_partial_symbol,
	  lookup_demangled_block_symbol):  Remove prototypes and functions.
	* symtab.c (lookup_symbol):  Remove use of expensive_mangler,
	  use lookup_block_symbol instead of lookup_demangled_block_symbol.
	  Remove code to try demangling names and matching them.
	* symtab.c (lookup_partial_symbol, lookup_block_symbol):
	  Fix to try matching the cached demangled name if no match is
	  found using the regular symbol name.
	* symtab.c (find_methods):  Remove unused physnames array.
	* symtab.c (name_match, NAME_MATCH):  Remove function and macro,
	  replaced with SYMBOL_MATCHES_REGEXP from symtab.h.
	* symtab.c (completion_list_add_symbol):  Rewrite to use cached
	  C++ demangled symbol names.
	* symtab.h:  Much reformatting of structures and such to add
	  whitespace to make them more readable, and make them more
	  consistent with other gdb structure definitions.
	* symtab.h (general_symbol_info): New struct containing fields
	  common to all symbols.
	* symtab.h (SYMBOL_LANGUAGE, SYMBOL_DEMANGLED_NAME,
	  SYMBOL_SOURCE_NAME, SYMBOL_LINKAGE_NAME, SYMBOL_MATCHES_NAME,
	  SYMBOL_MATCHES_REGEXP, MSYMBOL_INFO, MSYMBOL_TYPE):  New macros.
	* symtab. (struct minimal_symbol, struct partial_symbol, struct
	  symbol): Use general_symbol_info struct.
	* utils.c (demangle_and_match):  Remove, no longer used.
	* valops.c (demangle.h):  Include.
	* xcoffexec.c (eq):  Remove macro, replace usages with STREQ.
	* blockframe.c, breakpoint.c, c-exp.y, c-valprint.c, dbxread.c,
	  infcmd.c, m2-exp.y, minsyms.c, objfiles.h, solib.c, stack.c,
	  symmisc.c, symtab.c, valops.c:  Replace references to minimal
	  symbol fields with appropriate macros.
	* breakpoint.c, buildsym.c, c-exp.y, c-typeprint.c, c-valprint.c,
	  coffread.c, command.c, convex-tdep.c, cp-valprint.c, dbxread.c,
	  demangle.c, elfread.c, energize.c, environ.c, exec.c,
	  gdbtypes.c, i960-tdep.c, infrun.c, infrun-hacked.c, language.c,
	  main.c, minsyms.c, mipsread.c, partial-stab.h, remote-es1800.c,
	  remote-nindy.c, remote-udi.c, rs6000-tdep.c, solib.c, source.c,
	  sparc-pinsn.c, stabsread.c, standalone.c, state.c, stuff.c,
	  symfile.c, symmisc.c, symtab.c, symtab.h, tm-sysv4.h,
	  tm-ultra3.h, values.c, xcoffexec.c, xcoffread.c:  Replace strcmp
	  and strncmp usages with STREQ, STREQN, or STRCMP as appropriate.
	* breakpoint.c, buildsym.c, c-typeprint.c, expprint.c, findvar.c,
	  mipsread.c, printcmd.c, source.c, stabsread.c, stack.c,
	  symmisc.c, tm-29k.h, valops.c, values.c:  Replace SYMBOL_NAME
	  references with SYMBOL_SOURCE_NAME or SYMBOL_LINKAGE_NAME as
	  appropriate.
	* buildsym.c (start_subfile, patch_subfile_names):  Default the
	  source language to what can be deduced from the filename.
	* buildsym.c (end_symtab):  Update the source language in the
	  allocated symtab to match what we have been using.
	* buildsym.h (struct subfile):  Add a language field.
	* c-typeprint.c (c_print_type):  Remove code to do explicit
	  demangling.
	* dbxread.c (psymtab_language):  Add static variable.
	* dbxread.c (start_psymtab):  Initialize psymtab_language using
	  deduce_language_from_filename.
1992-12-23 06:34:57 +00:00
Fred Fish a8a69e6332 * Makefile.in (VERSION): Bump to 4.7.4.
* 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 ****
1992-12-18 20:21:32 +00:00
Fred Fish 394171ace4 * tm-sun4sol2.h: Add CPLUS_MARKER. Solaris 2.0 requires '.'
rather than '$'.  This particular piece of braindamage is
	spreading like ooze. It's now infected libiberty, deja-gnu,
	gdb, and gcc.
	* values.c (baseclass_addr):  Use CPLUS_MARKER rather than
	hardwired '$' character.
1992-11-30 20:07:35 +00:00
Fred Fish e58de8a230 * Makefile.in (SFILES_MAINDIR): Add ch-exp.y.
* Makefile.in (YYFILES):  Add ch-exp.tab.c.
	* Makefile.in (YYOBJ):  Add ch-exp.tab.o.
	* Makefile.in (saber_gdb):  Add unload of ch-exp.y and load
	of ch-exp.tab.c.
	* Makefile.in (distclean):  Add target ch-exp.tab.c.
	* Makefile.in (realclean):  Add rm of ch-exp.tab.c.
	* Makefile.in (c-exp.tab.c, m2-exp.tab.c):  Add dependency on
	Makefile since it contains sed patterns used in generation.
	Add sed pattern to also delete #include of any malloc.h.
	* Makefile.in (ch-exp.tab.o, ch-exp.tab.c):  New targets.
	* ch-exp.y:  New expression parser, for GNU-Chill.
	* c-exp.y, expr.c, expression.h, language.c, m2-exp.y,
	parser-defs.h, valarith.c, valops.c, value.h:  Remap macros and
	function names to conform to K&R terminology with respect to
	logical and bitwise operators:
	UNOP_ZEROP => UNOP_LOGICAL_NOT
	UNOP_LOGNOT => UNOP_COMPLEMENT
	BINOP_LOGAND => BINOP_BITWISE_AND
	BINOP_LOGXOR => BINOP_BITWISE_XOR
	BINOP_LOGIOR => BINOP_BITWISE_IOR
	BINOP_AND => BINOP_LOGICAL_AND
	BINOP_OR => BINOP_LOGICAL_OR
	PREC_OR => PREC_LOGICAL_OR
	PREC_AND => PREC_LOGICAL_AND
	PREC_LOGIOR => PREC_BITWISE_IOR
	PREC_LOGXOR => PREC_BITWISE_XOR
	PREC_LOGAND => PREC_BITWISE_AND
	value_zerop() => value_logical_not()
	value_lognot() => value_complement()
	* c-exp.y (c_op_print_tab):  Add explicit empty terminator.
	* m2-exp.y (m2_op_print_tab):  Add explicit empty terminator.
	* defs.h (enum language):  Add language_chill.
	* dwarfread.c (set_cu_language):  Add LANG_CHILL case and make
	LANG_MODULA2 a recognized language.
	* eval.c (evaluate_subexp):  Add OP_BOOL case.
	* expprint.c (print_subexp):  Add OP_BOOL case.
	* gdbtypes.h (enum_typecode):  Note TYPE_CODE_BOOL used for
	Chill as well as Modula-2.
	* gdbtypes.y (builtin_type_chill_bool, builtin_type_chill_long,
	builtin_type_chill_ulong, builtin_type_chill_real):  Add.
	* i387-tdep.c (sys/dir.h):  Remove, appears to be unnecessary
	and is nonexistant in some SVR4 based systems.
	* language.c (DEFAULT_ALLOCSIZE):  Change from 3 => 4.
	* language.c (set_language_command):  Add chill.
	* language.c (binop_result_type, integral_type, character_type,
	boolean_type, structured_type, value_true, binop_type_check):
	Add language_chill cases.
	* language.h (_LANG_chill):  Define.
	* m2-exp.y (number_sign, modblock):  Make static, #ifdef out
	unused modblock.
	* m2-exp.y (ANDAND):  Rename to LOGICAL_AND.
	* source.c (source_info):  Fix minor nits, print "1 line" rather
	than "1 lines", and "language is <lang>".
	* symfile.c (deduce_language_from_filename):  Recognize the
	filename extensions ".chill", ".c186", and ".c286" for Chill.
	* valarith.c (value_binop):  Handle TYPE_CODE_BOOL as well
	as TYPE_CODE_INT and TYPE_CODE_FLOAT.
	* valprint.c (val_print):  Print TYPE_CODE_BOOL type values as
	"TRUE" or "FALSE".
	* valprint.c (typedef_print):  Add case for language_chill.
	* values.c (value_from_longest):  Handle TYPE_CODE_BOOL.
1992-11-15 17:28:02 +00:00
John Gilmore 94603999f9 A bunch of changes mostly to improve debugging of C++ programs.
Specifically, the calling of inferiors methods is improved.

	* value.h:  New macros METHOD_PTR_IS_VIRTUAL,
	METHOD_PTR_FROM_VOFFSET, METHOD_PTR_TO_VOFFSET to partially
	hide the implementation details of pointer-to-method objects.
	How to tell if the pointer points to a virtual method is
	still very dependent on the particular compiler, but this
	should make it easier to find the places to change.
	* eval.c (evaluate_subexp [case OP_FUNCALL]), valprint.c
	(val_print [case TYPE_CODE_PTR]):  Use the new METHOD_PTR_*
	macros, instead of a hard-wired-in code that incorrectly
	assumed a no-longerused representation of pointer-to-method
	values.  And otherwise fix the relevant bit-rotted code.

	* valprint.c (type_print_base [case TYPE_CODE_STRUCT]):
	If there are both fields and methods, put a space between.

	* stabsread.c (read_struct_type):  Fix bug in handling of
	GNU C++ anonymous type (indicated by CPLUS_MARKER followed
	by '_').  (It used to prematurely exit the loop reading in
	the fields, so it would think it should start reading
	methods while still in the fields.  This could crash gdb
	given a gcc that can emit nested type information.)

	* valops.c (search_struct_method):  Pass 'this' value by
	reference instead of by value.  This provides a more
	consistent interface through a recursive search where the
	"bottom" functions may need to adjust offsets (due to multiple
	inheritance).
	* valops.c, value.h, values.c:  Pass extra parameters to
	value_fn_field and value_virtual_fn_field so we can
	correctly adjust offset for multiple inheritance.
	* eval.c (evaluate_subexp [case OP_FUNCALL]):  Simplify
	virtual function calls by using value_virtual_fn_field().
	* values.c: New function baseclass_offset, derived from
	baseclass_addr (which perhaps can be made obsolete?).
	It returns an offset rather than an address.  This is a
	cleaner interface since it doesn't mess around allocating
	new values.
	* valops.c (search_struct_method):  Use baseclass_offset
	rather than baseclass_addr.
1992-10-06 09:22:43 +00:00
John Gilmore 2640f7e138 Removed a large number of changes inserted by Per Bothner
for C++ support.  These will go back in when they've been
examined.
1992-09-10 00:07:06 +00:00
Per Bothner 35fcebce93 A ton of changes to improve C++ debugging. See ChangeLog. 1992-09-04 07:37:18 +00:00
Fred Fish 8050a57b2c * dwarfread.c (alloc_utype, decode_subscr_data): Call alloc_type
to create new blank types, instead of handcrafting them.
	* defs.h (printfi_filtered):  Add prototype.
	* utils.c (printfi_filtered):  New function.
	* gdbtypes.c (recursive_dump_type):  Use printfi_filtered to
	to simplify the code.  Other cleanups.
	* gdbtypes.c (check_stub_method):  Demangle using DMGL_ANSI.
	* gdbtypes.h (struct cplus_struct_type):  Add comments describing
	use of various fields.
	* gdbtypes.c (print_bit_vector, print_cplus_stuff):  New functions.
	* c-exp.y (%token):  Add CLASS as a token for C++, add grammar
	production that currently treats it exactly the same as STRUCT.
	* c-exp.y (yylex):  Recognize "class" as token CLASS.
	* symtab.c (gdb_mangle_name):  Rewrite to match current g++ stabs.
	* symtab.c (decode_line_1):  Fix to pass quoted args on down to
	general symbol handling code.  Call cplus_mangle_opname with
	DMGL_ANSI.
	* symtab.c (decode_line_2):  Print demangled function names in
	breakpoint menus, instead of just file and line number.
	* symtab.c (name_match):  Call cplus_demangle with DMGL_ANSI.
	* valprint.c (type_print_base):  Print "class" for C++ classes,
	rather than "struct".  Print section labels for public, protected
	and private members of C++ classes.
	* values.c:  Include demangle.h.
	* values.c (value_headof):  Call cplus_demangle with DMGL_ANSI.
1992-07-09 04:40:39 +00:00
Fred Fish 4ed3a9ea66 * breakpoint.c, buildsym.c, c-exp.y, coffread.c, command.c,
core.c, cplus-dem.c, dbxread.c, dwarfread.c, elfread.c, environ.c,
	eval.c, findvar.c, gdbtypes.c, hppabsd-tdep.c, hppahpux-tdep.c,
	i386-tdep.c, ieee-float.c, infcmd.c, inflow.c, infptrace.c,
	infrun.c, m2-exp.y, mipsread.c, objfiles.c, parse.c, procfs.c,
	putenv.c, remote-mm.c, remote-vx.c, solib.c, sparc-tdep.c,
	sparc-xdep.c, stack.c, symfile.c, symtab.c, symtab.h, target.c,
	tm-i386v.h, tm-sparc.h, utils.c, valarith.c, valops.c, valprint.c,
	values.c, xcoffread.c:
	Remove "(void)" casts from function calls where the return value
	is ignored, in accordance with GNU coding standards.
1992-07-04 03:22:08 +00:00
Fred Fish 51b57ded88 * dbxread.c, i386-pinsn.c, i386-tdep.c, regex.c, solib.c, symmisc.c,
symtab.h, tm-i386v4.h, valprint.c, values.c:  Lint.
	* breakpoint.c, c-exp.y, coffread.c, command.c, environ.c, eval.c,
	findvar.c, infcmd.c, infptrace.c, infrun.c, m2-exp.y, parse.c,
	putenv.c, solib.c, sparc-xdep.c, symtab.c, tm-i386v.h, tm-sparc.h,
	utils.c, valarith.c, valops.c, valprint.c, values.c:
	Replace bcopy() use with memcpy(), which is more standard and can
	take advantage of gcc's builtin functions for increased performance.
	* breakpoint.c, buildsym.c, coffread.c, dbxread.c, i386-tdep.c,
	ieee-float.c, infcmd.c, sparc-tdep.c, stack.c, symtab.c, symtab.h,
	target.c, values.c:
	Replace bzero() use with memset(), which is more standard and can
	take advantage of gcc's builtin functions for increased performance.
	* i386-tdep.c, main.c, valprint.c:
	Replace bcmp() use with memcmp(), which is more standard and can
	take advantage of gcc's builtin functions for increased performance.
1992-06-29 23:34:38 +00:00
Steve Chamberlain ae0ea72ee2 Changes to support GDB running on DOS using GO32 and H8 support
* defs.h: if xm.h doesn't define FOPEN_RB, include "fopen-same.h",
	allowing hosts with different text and binary file formats to
	work.
	* coffread.c (read_coff_symtab): changed calling convention and
	operation - now it opens its own file with FOPEN_RB rather than
	duping and fdopening the provided handle.
	* dbxread.c, cplus-dem.c: #include mangling.
	* exec.c: If O_BINARY isn't defined, set it to 0, call openp for
	binary files oring in the right bit.
	* utils.c, terminal.h, inflow.c: hackery because dos doesn't have terminals.
	* remote-hms.c: cleanup to use the new remote serial stuff
	* serial.h, ser-termios.c, ser-go32.c: newfiles to provide host
	independent remote terminal I/O.
	* remote.c: if DONT_USE_REMOTE is defined, then don't use it.
	* source.c (openp): fix off by one problem removing / - can now
	open a source file in the root directory with DOS.
	* values.c (value_as_pointer): remove bogus address bits from
	long. (unpack_long): unpack into unsigned long/short if pointer.
1992-05-13 01:12:18 +00:00
Fred Fish 8f793aa541 * Makefile.in (DEMANGLER): Define and default to cplus-dem.
Allows selection of C++ demangler to be a configuration option
	until multiple demanglers are supported.
	* demangle.h:  New include file for extended demangler support.
	* breakpoint.c, gdbtypes.c, printcmd.c, stack.c, symtab.c,
	utils.c, valprint.c:  Include "demangle.h" and change all calls
	to cplus_demangle() or fputs_demangled() to use individual
	demangling options.
	* valprint.c (type_print_1):  Change options to cplus_demangle
	to print demangled function args.  Still broken, but now less so.
	* cplus-dem.c:  Include demangle.h, reorganize and update some
	comments to reflect reality.
	* cplus-dem.c (cplus_demangle, cplus_mangle_opname):  Change
	second arg from fixed integer to bit based multiple options.
	* cplus-dem.c (optable):  Reformat and replace ansi members with
	bit based options.
	* cplus-dem.c (do_type):  Fix bug with parsing missing return type.
1992-05-05 18:16:23 +00:00
John Gilmore 6fab5bef69 * values.c (set_internalvar): Force evaluation of lazy values.
Bug reported by RMS.
1992-05-05 05:31:21 +00:00
Fred Fish 4db8e515c4 * Makefile.in (VERSION): Bump to 4.5.2.
* Makefile.in (DEMANGLE_OPTS):  Add, default to -Dnounderscore.
	* configure.in:  Simplify ncr3000 gdb_host logic, add gdb_target.
	* dwarfread.c (struct_type):  Apply fix from Peggy Fieland for
	proper handling of bit fields.
	* gdbtypes.h (struct type):  Clarify use of field.bitpos.
	* symtab.h:  Fix couple of misspellings in comments.
	* value.h (struct value):  Clarify use of bitpos.
	* value.h (unpack_field_as_long):  Change prototype, returns
	LONGEST.
	* values.c (unpack_field_as_long):  Change return type to LONGEST,
	sign extend unpacked fields that are signed, other rewriting.
	* config/ncr3000.mt:  New target config file.
1992-05-03 23:05:07 +00:00
Fred Fish 5c1c5e6745 Fix bug in values.c unpacking signed characters on hosts where the default
character type is unsigned.  Add some cases to the tables in procfs.c
for constants defined in newer SVR4 systems and reorder the tests for
ioctl support of resetting the inherit-on-fork flag to favor the latest
method using PIOCRESET.
1992-04-02 18:00:10 +00:00
John Gilmore ac88ca205c Lint.
* symfile.c (add_symbol_file_command):  Initialize mapped/readnow.
1992-04-02 10:35:19 +00:00
John Gilmore be772100b5 Lint 1992-03-29 23:26:47 +00:00
Per Bothner 01be69139e More C++ improvements (pointers to members, qualified names). See ChangeLog. 1992-03-20 21:57:17 +00:00
Per Bothner 2cd9998540 Some improvements to g++ debugging.
* symtab.c (list_symbols): demangle before pattern matching.
	* symtab.c:  Other fixes to improve handing of operators.
	* valprint.c (type_print_base):  Fix test for constructor.
	* values.c (value_static_field):  Allow evaluation of
	CLASS::METHOD, returning a function pointer.
1992-03-19 00:05:35 +00:00
Michael Tiemann d747e0af3d Tue Mar 3 15:11:52 1992 Michael Tiemann (tiemann@cygnus.com)
* All GDB files that #include defs.h: Removed stdio.h.
	(defs.h): #include stdio.h.

This has been tested by building GDBs for all targets hosted on Sun4.
None of the build problems were related to stdio.h inclusion.  (n.b.
many configurations don't build for other reasons.)
1992-03-03 23:26:26 +00:00
John Gilmore 1ab3bf1b14 * Check in Fred Fish's changes in these modules. Fred
will make ChangeLog entries for all of them.
1992-02-22 01:46:16 +00:00
Steve Chamberlain 1f46923ff4 * coffread.c (read_enum_type): Use the size of a target int when
describing enum.
	* defs.h: added new #define for TARGET_PTR_BIT, defaults to size
	of target int.
	* h8300-tdep.c, remote-hms.c, tm-h8300.h: too many changes to count
	* symtab.c (lookup_reference_type, lookup_ptr_type): use
	TARGET_PTR_BIT to determine size of a pointer
	* values.c (unpack_long): when unpacking a REF or a PTR don't
	assume the size of the type.
1992-02-06 20:03:31 +00:00
Per Bothner 8e9a3f3b18 Mainly stuff to improve handling of TYPE_CODE_REF (C++ reference)
values. (See ChangeLog.)
1991-12-30 19:22:29 +00:00
John Gilmore f1d77e9053 Improve G++ debugging support. 1991-11-27 09:43:59 +00:00
John Gilmore 7d9884b927 * defs.h: Incorporate param.h. All users changed.
* param-no-tm.h:  Change users to define TM_FILE_OVERRIDE instead.
* param.h, param-no-tm.h:  Removed.
* Update copyrights in all changed files.
* dbxread.c, dwarfread.c, inflow.c, infrun.c, m2-exp.y, putenv.c,
solib.c, symtab.h, tm-umax.h, valprint.c:  Lint.
* tm-convex.h, tm-hp300hpux.h, tm-merlin.h, tm-sparc.h,
xm-merlin.h:  Avoid host include files in target descriptions.
* getpagesize.h:  Removed, libiberty copes now.
1991-11-21 18:42:05 +00:00
Per Bothner 0e2a896cf5 Fixes related to handling of C++ methods (handle destructors
and parameters that are functions).
1991-11-12 22:20:02 +00:00
Fred Fish 58ae87f612 Remove internal gdb definition of fixed arg count concat() function and
convert to use of variable arg count concat() in libiberty.
1991-11-12 17:50:14 +00:00
Per Bothner 545af6ce07 Add C++ as a separate language.
Also, fix a C++ problem when looking for methods in super-classes.
(There was confusion between base and derived types.)
1991-11-06 01:08:21 +00:00
Per Bothner bcccec8c8d Various fixes to improve g++ debugging. See ChangeLog. 1991-10-26 02:05:14 +00:00
John Gilmore afe4ca159b Changes from Fred Fish:
* tm-68k.h (FPI_REGNUM):  Add.
* infrun.c (child_create_inferior):  flush stdout and stderr
before forking.
* configure.in:  Handle amigados, amix hosts and targets.
* inflow.c:  Handle TIOCGLTC_BROKEN for Amiga.

From Andreas Schwab:
* values.c (show_convenience):  Use printf_filtered.
* main.c (define_command):  Check result of lookup_command for
exact match.
(echo_command):  Use printf_filtered, and force output out.

* dbxread.c (read_enum_type):  Avoid Modula-2 kludge that breaks C
programs.
* i387-tdep.c (double_to_i387):  Fix typo for double_to_ieee_extended.
* utils.c (_initialize_utils):  If !ISATTY, don't paginate.
1991-10-15 23:29:34 +00:00
John Gilmore 35505d07d7 * values.c (unpack_long, value_from_longest): Handle
TYPE_CODE_BOOL and TYPE_CODE_CHAR.
1991-09-19 03:07:56 +00:00
John Gilmore 96b2f51cdc Fix some infrastructure to be able to cope with host and target
machines with different sized basic types (ints, ptrs, etc).
(Idea from pierre@la.tce.com (Pierre Willard).)

* values.c (value_from_longest):  Rename from value_from_long.
Handle pointer types as well as integers, so that targets with
different pointer sizes from the host can be accomodated.
* breakpoint.c, convex-tdep.c, eval.c, expprint.c, printcmd.c,
valarith.c, valops.c, valprint.c, value.h, values.c:  Rename
uses of value_from_long to value_from_longest.
1991-09-06 07:13:38 +00:00
Stu Grossman 61a7292f6f lint 1991-08-22 22:50:50 +00:00
John Gilmore 4f6f12f989 Only read the right number of bytes in reading basetypes, so we don't
overrun malloc.
1991-08-03 02:02:03 +00:00
John Gilmore c3a2180180 Eliminate LOC_EXTERNAL. Improve select_source_symtab. Bug fixes. 1991-07-19 06:45:19 +00:00
John Gilmore 99a7de40cb Change GDB over to GNU General Public License version 2. 1991-06-04 07:31:55 +00:00
Jim Kingdon 2bff8e38bc *** empty log message *** 1991-05-03 00:50:18 +00:00
Jim Kingdon e1ce8aa5ed The list of changes is too long to fit in the cvs log (since it truncates!).
Look at the ChangeLog for Apr 30 and May 1.
1991-05-02 04:28:42 +00:00
Michael Tiemann aec4cb918e Tue Apr 30 13:13:33 1991 Michael Tiemann (tiemann at cygint.cygnus.com)
* valprint.c (type_print_base): If the type being printed is a
	struct containing undefined types, print "<undefine type>"
	as the type instead of crashing.
	* values.c (value_headof): Get the vtable pointer taking
	TYPE_VPTR_BASETYPE into account.
	* symtab.c, symtab.h, dbxread.c: Fix various whitespace splotches.
1991-04-30 20:19:02 +00:00
Jim Kingdon 122ad9abf2 * param-no-tm.h: Make BITS_BIG_ENDIAN defined to 0/1, not defined
or not defined.  Don't define it based on TARGET_BYTE_ORDER if
	it's already defined (in the tm.h file).
	mips-opcode.h (BIT_FIELDS_*),
	values.c (modify_field, unpack_field_as_long):
	Use #if BITS_BIG_ENDIAN not #ifdef BITS_BIG_ENDIAN.
1991-04-29 05:27:04 +00:00
Jim Kingdon 71b16efa43 * values.c (check_stub_method): Do lookup_method_type and stuff
rather than smash_to_method_type.
	* values.c (check_stub_method): Deal with operator names.
	* values.c: Move declaration of cplus_demangle to top of file.
	* values.c (baseclass_addr): If can't read memory, set *ERRP
	rather than calling error().
	* values.c (value_static_field): Recursively check all baseclasses.
	Return NULL if not found.
	* values.c, value.h: New functions value_{headof,from_vtable_info}.
	values.c (value_virtual_fn_field):
	Don't bother to do anything with
	return value from fill_in_vptr_fieldno.CVS: Modified Files:
1991-04-26 23:04:10 +00:00
Jim Kingdon e532974c43 values.c (value_virtual_fn_field): If there is no fcontext,
then do things the way GDB 3.x did.
	valops.c (search_struct_method): Add type to value_virtual_fn_field
	arguments.
1991-04-24 01:01:09 +00:00
Jim Kingdon fcb887ffcd * breakpoint.c (bpstat_print): Try all elements on the bpstat
chain before giving up with an internal error.

Sun Apr 21 21:43:10 1991  Jim Kingdon  (kingdon at cygint.cygnus.com)

	* value.h, values.c (value_{,free_to_}mark): New functions.
	breakpoint.c (bpstat_stop_status): Use them.
1991-04-22 07:08:07 +00:00
Jim Kingdon f266e5641b *** empty log message *** 1991-04-19 01:32:08 +00:00
John Gilmore 3f2e006b77 *** empty log message *** 1991-04-05 09:02:10 +00:00
K. Richard Pixley dd3b648e8b Johns release 1991-03-28 16:28:29 +00:00
John Gilmore 831c851165 Initial revision 1990-09-05 17:54:31 +00:00