Commit Graph

270 Commits

Author SHA1 Message Date
Steve Chamberlain 686941a9cb Sat Oct 28 23:51:48 1995 steve chamberlain <sac@slash.cygnus.com>
* defs.h: Test on name __WIN32__ rather than WIN32.
	* inflow.c (new_tty): Likewise
	* terminal.h: Likewise.
	* utils.c (initialize_utils): Likewise.
	* win32-nat.c (child_create_inferiror): Print error code when failing.
	* config/i386/win32.mh (XM_CLIBS): Need -lkernel32.
1995-10-29 06:58:26 +00:00
Stu Grossman cd10c7e388 * breakpoint.c (breakpoint_re_set): #ifdef GET_LONGJMP_TARGET
around calls to create_longjmp_breakpoint.  Why install the
	breakpoints if we can't find the longjmp target?
	* infrun.c (wait_for_inferior):  Cleanup comments near call test.
	* remote-mips.c:  Fixed a bunch of prototypes to avoid char/int
	complaint from picky compilers.  Add comment to mips_expect.
	Replace all instances of sr_get_debug with remote_debug.
	* (mips_readchar):  Don't jam init string to monitor.
	mips_initialize() handles that.
	* (mips_receive_header):  Print better message when we get too
	much garbage.
	* (mips_request):  Allow caller to pass in buff to allow them to
	analyze the returned message.
	* (mips_initialize):  Re-do initialization to try sending a BREAK,
	a ^C, and then a download escape sequence.  Cleanup protocol
	startup.  Eliminate sleeps.  Clear breakpoints (if using monitor
	breakpoints).  Re-init frame.
	* (mips_detach):  Close down target.
start-sanitize-gm
	* (mips_resume):  Pass signal down to target.
	* (mips_create_inferior):  Start target with TARGET_SIGNAL_PWR.
end-sanitize-gm
	* (mips_wait):  Handle return status with registers, or breakpoint stuff.
	* (mips_kill):  Add ^C handling.
	* (mips_insert_breakpoint mips_remove_breakpoint):  Call new
	breakpoint stuff if enabled.
	* (calculate_mask remote_mips_set_watchpoint
	remote_mips_remove_watchpoint remote_mips_stopped_by_watchpoint):
	Hardware watchpoint/breakpoint stuff.
	* (common_breakpoint):  Common code for new monitor breakpoint commands.
	* (mips_load):  Don't use `prompt'.  It's a global variable.
	* top.c (dont_repeat_command):  New command for use in
	user-defined commands to suppress auto-repeat (by hittin return key).
start-sanitize-gm
	* utils.c (request_quit):  Call target_kill here.  Good idea.
	Needs a better implementation.
end-sanitize-gm
	* valops.c:  Add start of auto function-call abandonment capability.

start-sanitize-gm
	* c-exp.y:  Add code (currently disabled) to handle GM dynamic
	structures (it conflicts with @!).
	* eval.c (evaluate_subexp_standard):  ditto.
	* expprint.c (print_subexp dump_expression):  ditto.
	* expression.h (enum exp_opcode):  ditto.
	* parse.c (length_of_subexp):  ditto.
	* configure, configure.in:  Add mip*-*-magic* target.
	* magic.c magic.h:  Special routines to handle GM stuff (like
	stepping through dispatcher).
end-sanitize-gm
1995-10-27 17:48:36 +00:00
Steve Chamberlain dedcc91de6 Thu Sep 28 14:32:11 1995 steve chamberlain <sac@slash.cygnus.com>
* callback.[ch]: New files.
	* remote-rdp.c: Support for the ARM RDP monitor.
	* Makefile: Update.
	* arm-tdep.c (arm_othernames): New.
	(_initialize_arm_tdep): install 'othernames' command.
	(arm_nullified_insn, shifted_reg_val, arm_get_next_pc): New.
	* configure.in: Check for termios.h, termio.h and sgtty.h.
	(i[345]86-*-win32*): New host.
	* configure: Regenerated.
	* inflow.c: Clean up inclusions.
	* main.c (main): Check for WINGDB, not WIN32.
	* printcmd.c (do_examine): Put QUIT test in loop.
	* remote-hms.c (e7000_load): Delete.
	(hms_ops): Point to generic_load instead.
	* remote-hms.c (hms_ops): Point to generic_load.
	* remote-sim.c (sim_callback_write_stdout): Becomes
	gdbsim_write_stdout.
	(gdbsim_load): Call generic_load.
	* remote-utils.c (gr_load_image): Delete.
	* ser-unix.c (terminal.h): Include instead of havig
	own #if tree.
	(hardwire_flush_input): Reset input buffer too.
	* source.c (openp): If WIN32 then open file in binary mode.
	* terminal.h: Configure IO mechanism using autoconf defines if available and
	not overriden.
	* utils.c (quit, pollquit, notice_quit): WIN32 check becomes WINGDB check.
	* config/arm/arm.mt (TDEPFILES): Add remote-rdp.o
	* config/arm/tm-arm.h (TARGET_BYTE_ORDER): becomes TARGET_BYTE_ORDER_SELECTABLE.
	(ADDR_BITS_REMOVE): New.
	(ORIGINAL_REGISTER_NAMES, ADDITIONAL_REGISTER_NAMES): New.
	(INST_xx): New
	(FRAME_FIND_SAVED_REGS): Pass the right argument.
	(arm_get_next_pc): Declare.
	* mswin/prebuilt/*/bfdtarget.h (SELECT_ARCHITECTURES): Need leading &.
1995-09-29 00:14:01 +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
J.T. Conklin 1a49497348 * configure.in: Check for unistd.h.
* configure: Regenerated.

* command.c, cp-valprint.c, fork-child.c, i386-tdep.c,
i386b-nat.c, inflow.c, main.c, maint.c, objfiles.c, solib.c,
source.c, stack.c, symfile.c, top.c, utils.c: Include strings.h
and/or unistd.h to bring prototypes into scope.
1995-07-31 22:46:03 +00:00
Steve Chamberlain 45993f6118 Hmm.. The ChangeLog went in, but not the code....
* monitor.c: Turn on caching.
	(monitor_printf): If a ^C was sent, don't expect to see its
	echo.
	(monitor_open): Enable caching.
	(monitor_resume, monitor_load): Flush cache.
	(monitor_xfer_memory): Call cache routine.
	(monitor_dump_regs): New.
	(monitor_fetch_registers):  If monitor_dump_regs available
	then use it.
	(monitor_load): Don't ref exec_bfd if it's NULL.
	(monitor_load_srec): Use new monitor_make_srec calling convention.
	(monitor_make_srec): Rewrite to cope with two, three and four byte
	addresses.
	* remote-hms.c (hms_cmds): Initialze end-of-command delim.
	* dcache.h, dcache.h: Rewritten.
	* remote.c: Reenable caching.
	(getpkt): Reduce MAX_TRIES to 3.
	(remote_xfer_memory): Use dcache_xfer_memory.
	* defs.h (error_hook): New.
	* top.c (error_hook): New definition.
	* utils.c (error): Use error_hook if initialized.
	* sparcl-tdep.c (HAVE_SOCKETS): Don't define if GO32 or WIN32. Use
	HAVE_SOCKETS in place of #ifndef GO32.
1995-06-21 21:47:06 +00:00
J.T. Conklin 85c613aaa7 * utils.c (fprintf_filtered, fprintf_unfiltered, fprintfi_filtered,
printf_filtered, printf_unfiltered, printfi_filtered, query, warning,
          error, fatal, fatal_dump_core): Use stdarg.h macros when compiling
          with an ANSI compiler.
        * complain.c (complain): Likewise.
        * language.c (type_error, range_error): Likewise.
        * monitor.c (monitor_printf, monitor_printf_noecho): Likewise.
        * remote-array.c (printf_monitor, debuglogs): Likewise.
        * remote-mips.c (mips_error): Likewise.
        * remote-os9k.c (printf_monitor): Likewise.
        * remote-st.c (printf_stdebug): Likewise.
        * gdbtk.c (gdbtk_query): Likewise.

        * defs.h, complain.h, language.h, monitor.h: Add prototypes to
          match above changes.

        * printcmd.c: Remove uneeded #include <varargs.h>.
        * remote-e7000.c: Likewise.

        * f-typeprint.c (f_type_print_base): Fix typo found by above
          changes.
1995-05-18 23:45:31 +00:00
Jim Kingdon 8989d4fc4b * utils.c, defs.h (warning_begin): Renamed from warning_setup, for
consistency with error_begin.  Also print warning_pre_print.
	Document it better.
	* utils.c (warning): Use it.
	* utils.c (error_begin): Doc fix.
	* rs6000-nat.c (vmap_ldinfo): If symfile_objfile is not part of
	any vmap, nuke it.
1995-04-11 22:26:14 +00:00
Stan Shebs 49073be098 Always keep MPW support 1995-04-11 02:08:59 +00:00
Jim Kingdon a7f6f40b3c * utils.c, defs.h (putchar_unfiltered, fputc_unfiltered): Make
argument be an int, not a char.  Using a prototype followed by an
	old-style function definition in a case where an argument is
	widened is a GCC-ism not supported by the native AIX compiler.
1995-03-15 23:24:24 +00:00
Jim Kingdon 0d172a2ef4 * utils.c [_AIX]: Include stddef.h instead of #defining size_t. 1995-03-03 21:38:54 +00:00
Stu Grossman cad1498f8a * Makefile.in: Add stuff to build nlmstub.
* Add rule for annotate.o to keep Sun make happy.
	* configure.in:  Add config for powerpc/Netware.

	* partial-stab.h (near N_SO):  Don't call START_PSYMTAB with null
	filename.  This speeds up handling of trailing N_SO stabs (they
	mark the end of a .o file).

	* target.c, target.h:  Change the way pushing and popping of
	targets work to support target overlays and inheritance.
	* corelow.c, hppa-tdep.c, inflow.c, remote-nindy.c, utils.c:
	Fixup references to current_target, due to previous changes.

	* config/i386/tm-i386nw.h:  Enable longjmp support.  More work is
	needed to get the address of longjmp out of the target.
1994-07-23 00:53:28 +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
Stan Shebs 16d2cc8084 Sat May 14 15:13:52 1994 Stan Shebs (shebs@andros.cygnus.com)
* inflow.c (job_control, attach_flag, generic_mourn_inferior):
	Remove, needed for both native and cross.
	* target.c (attach_flag, generic_mourn_inferior): Put here.
	* utils.c (job_control): Put here.
	(terminal.h): Don't include anymore.
1994-05-14 23:12:29 +00:00
Jim Kingdon d8fc877318 * source.c (find_source_lines): Always use code that was #ifdef
BROKEN_LARGE_ALLOCA.  Do the cleanup before returning, rather than
	leaving it on the chain.  Reindent much of this function.
	* config/sparc/{xm-sun4sol2.h,xm-sun4os4.h},
	config/i386/{xm-sun386.h,xm-i386m3.h,xm-i386mach.h},
	config/m68k/{sun3os4.h,xm-news.h,xm-hp300hpux.h},
	config/ns32k/xm-ns32km3.h: Remove all references to
	BROKEN_LARGE_ALLOCA; with the above change it is no longer needed.
	* main.c, fork-child.c, many config files: Remove all
	SET_STACK_LIMIT_HUGE code; with the above changes it should no
	longer be needed.

	* symtab.c (lookup_partial_symbol): Use if and abort, not assert.
	This avoids __eprintf troubles.

	* main.c (main): Surround in #ifndef MAIN_OVERRIDE.  Move
	initialization code which needs to be called even if we bypass the
	command line stuff into gdb_init.
	* utils.c (fputs_unfiltered): Surround in #ifndef
	FPUTS_UNFILTERED_OVERRIDE.
	* Makefile.in (libgdb.a): New target.

	* utils.c: Rearrange I/O stuff a bit so that all output goes
	through fputs_unfiltered.  Use vasprintf; removes arbitrary limit
	which made %s not work with arbitrarily large strings.
	* printcmd.c (printf_command): Use printf_filtered, not
	printf_unfiltered and printf, now that arbitrary limit is gone.
1994-05-14 19:37:57 +00:00
Jim Kingdon 1c95d7ab2e gcc -Wall lint:
* breakpoint.c (watchpoint_check): Remove unused variable b.
	* stack.c (print_frame_info): Move sp and buf inside #if.
	* eval.c (evaluate_subexp): Remove unused variables pp,
	mangle_ptr, ptr, and mangle_tstr.
	* valarith.c (value_x_binop): Remove unused variables mangle_tstr
	and mangle_ptr.
	* symtab.c (lookup_symtab): Put variable copy inside #if.
	(decode_line_1): Put variable q1 inside #if 0.
	* target.h: Declare target_link.
	* infrun.c (wait_for_inferior): Remove unused variables signame.
	* remote.c (remote_resume): Remove unused variable name.
	* c-exp.y (parse_number): Parenthesize operand of shift.
	* dbxread.c (record_minimal_symbol): Parenthesize operand of &&
	(this is a semantic change, the warning seems to have detected a bug).
	* dbxread.c (end_psymtab): Move variable p1 inside #if.
	* coffread.c: Move variable temptype inside #if.
	* ch-typeprint.c (chill_type_print_base): Remove unused variable
	name.
	* ch-valprint.c: #include typeprint.h and ch-lang.h.
	(chill_val_print): Remove unused variable in_range.
	(chill_val_print): Remove statement "length > TYPE_LENGTH (type);".
	(chill_val_print): Add default case for switch.
	* stabsread.h: Declare stabsect_build_psymtabs.
	* os9kread.c (read_minimal_symbols): Make this return void.
	(os9k_symfile_read): Remove unused variables stb_exist and val.
	(os9k_symfile_init): Remove unused variable val.
	(fill_sym): Remove unused variable id.
	(read_os9k_psymtab): Put variable back_to inside #if 0.  Remove
	unused variable nsl.
	Remove unused variable symfile_bfd.
	#if 0 unused variables lbrac_unmatched_complaint and
	lbrac_mismatch_complaint.
	Remove declaration for non-existent function os9k_next_symbol_text.

	* annotate.c, annotate.h: New files, containing a function for
	each annotation which outputs it.
	* Move breakpoints_changed from breakpoint.c to annotate.c.
	* breakpoint.c, blockframe.c, infrun.c, cp-valprint.c, main.c,
	printcmd.c, source.c, stack.c, utils.c, valprint.c:
	Use annotate.c functions to output annotations.
	* Makefile.in (OBS): Add annotate.o.
1994-05-13 18:18:57 +00:00
Stan Shebs a6b26c4431 Changes for MacGDB:
Thu May 12 17:04:58 1994  Stan Shebs  (shebs@andros.cygnus.com)

	* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
	(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
	(TSOBS): Don't compile inflow.c.
	(all, install): Add MacGDB.
	* main.c (main): Do Mac-specific init and command loop if a
	standalone app, skip full option help message if compiling
	with MPW C.
	(gdb_readline): If MPW, add a newline after the (gdb) prompt.
	* utils.c (_initialize_utils): If MPW, don't try to use termcap to
	compute the window size.
	* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
	fflush): Define as macros that expand into hacked_... versions.
	(StandAlone, mac_app): Declare.
	* macgdb.r (SIZE): Set the default partition to 4000K.
	* mac-xdep.c (readline.h, history.h): Include.
	(terminal.h): Don't include.
	(mac_app): Define.
	(gdb_has_a_terminal): Define Mac-specific version.
	(do_keyboard_command): Simplify search for command string.
	(readline): Define as gdb_readline.
	Add other history/readline stubs to make main gdb link.
	(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
	hacked_fputc, hacked_fflush): New functions, intercept output to
	stdout and stderr, send to console window.
1994-05-13 00:31:31 +00:00
Jim Kingdon a0cf46812c * utils.c, defs.h (error_begin): New function.
(quit): Print annotation before printing the error message.
	* main.c (return_to_top_level): Print annotation before doing the
	longjmp.
	* symtab.c (decode_line_1): Call error not warning and then
	return_to_top_level.  Call error_begin and printf_unfiltered
	rather calling warning (before calls to return_to_top_level).
	* core.c (memory_error): Use error_begin, printf_unfiltered,
	print_address_numeric and return_to_top_level instead of error.
	Cleans up a FIXME-32x64.
	* language.c (type_error, range_error): Call error_begin
	not just target_terminal_ours.
1994-04-28 21:38:15 +00:00
Jim Kingdon 4dd876ac2e (prompt_for_continue): Likewise for prompt-for-continue annotation. 1994-04-28 16:04:36 +00:00
Jim Kingdon d8742f4673 * utils.c (query): Change syntax of query annotations to be
consistent with other input annotations.
1994-04-28 15:48:15 +00:00
Jim Kingdon a94100d198 * utils.c (prompt_for_continue): Call readline, not gdb_readline. 1994-03-19 06:36:18 +00:00
Steve Chamberlain 8eec331072 * utils.c (prompt_for_continue): Call readline, not gdb_readline. 1994-03-19 03:16:10 +00:00
Jim Kingdon f29351d98b * utils.c (fputs_unfiltered): Call fputs, not fputs_maybe_filtered. 1994-01-15 20:14:43 +00:00
Jim Kingdon 44a09a68f2 * utils.c (request_quit): Re-establish signal handler regardless
of USG.

	* config/mips/xm-irix4.h: Define HAVE_TERMIOS.
1994-01-15 03:43:01 +00:00
Thomas Lord 69fb299ec3 Don't let printf_unfiltered functions inherit a fixed-size buffer
from their _filtered counterparts.
1993-11-02 23:03:41 +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 159dd2aa93 * main.c, utils.c: Add comments about immediate_quit. 1993-09-28 16:23:44 +00:00
Fred Fish 5aefc1ca23 Remove chill sanitizations, which are no longer necessary. 1993-04-16 23:22:41 +00:00
John Gilmore 65ce5df44f * dbxread.c (unknown_symchar_complaint): Add new complaint.
* stabsread.c:  Declare it.
* partial-stab.h:  Use it.

* utils.c (malloc_botch):  Don't forward-declare if NO_MMALLOC.
1993-04-15 09:41:59 +00:00
Fred Fish bd5d07d94c * utils.c (fputs_demangled): Complete rewrite to clean up and
add a language parameter that is used to select the demangling
	algorithm.
	* defs.h (enum language):  Move further up in file so enum can
	be used in prototypes.
	* defs.h (fputs_demangled):  Update prototype to add lang arg.
	* c-typeprint.c (cp_type_print_method_args):  Add language arg
	to fputs_demangled calls, remove DMGL_PARAMS flag.
	* stack.c (print_frame_info):  Remove obsolete code so we don't
	have to update fputs_demangled usage in it.
	* stack.c (print_frame_info, frame_info):  Add language variable
	to pass to fputs_demangled and initialize it from the symbol's
	language.  Call fputs_demangled with language arg.
	* symtab.c (find_methods):  Add language arg to fputs_demangled
	call.
1993-03-11 17:44:39 +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 51b80b0072 * complaints.c: New file, code moved from utils.c.
* complaints.c (complain):  Made into a varargs function.
	* complaints.h:  New file, code moved from symfile.h.
	* Makefile.in (SFILES_MAINDIR):  Add complaints.c.
	* Makefile.in (HFILES):  Add complaints.h.
	* Makefile.in (OBS):  Add complaints.o.
	* symfile.c (complaint_root, stop_whining, complaint_series,
	complain, clear_complaints, add_show_from_set for stop_whining):
	Moved to complaints.c.
	* symfile.h (struct complaint, complaint_root decl, complain
	prototype, clear_complaints prototype):  Moved to complaints.h.
	* buildsym.c, coffread.c, dbxread.c, dwarfread.c, elfread.c,
	gdbtypes.c, mipsread.c, stbsread.c, symfile.c:  Include
	complaints.h.  Remove casts from arguments to complain(),
	which is now a varargs function, and remove unnecessary
	placeholder zero args.
	* defs.h (begin_line):  Add prototype.
	* defs.h (vprintf_filtered):  Add prototype.
	* dwarfread.c (varargs.h):  Remove, no longer needed.
	* dwarfread.c (dwarfwarn):  Remove prototype and function.
	* dwarfread.c (complaints):  Define a bunch of complaints.
	* dwarfread.c (SQUAWK):  Remove macro defs, convert all
	usages to standard complain() calls.
	* utils.c (begin_line):  New function that ensures that
	whatever gets filter-printed next starts on its own line.
	* utils.c (vprintf_filtered):  New func, like vfprintf_filtered,
	but to stdout (calls vfprintf_filtered internally).
1992-12-15 12:18:53 +00:00
John Gilmore d974236f80 * utils.c (prompt_for_continue): Reinitialize more-counts
before printing anything, and again afterward.  Fix comments.
(vfprintf_filtered):  Eliminate static buffer; use auto buffer,
or alloca() if needed.

* rs6000-xdep.c:  Use correct conditional (IBM6000_TARGET) to
detect native versus cross-host.
1992-09-17 10:58:53 +00:00
Stu Grossman a8e033f2a2 * breakpoint.c, core.c, exec.c, language.c, main.c, printcmd.c,
symfile.c, target.c, valprint.c:  Use _filtered form of *printf.
defs.h, utils.c:  Make vfprintf_filtered global.
1992-09-15 06:27:18 +00:00
Stu Grossman b36e3a9b49 Oops! Retract last change. Didn't mean to pollute things with energize just
yet!
1992-09-15 05:11:52 +00:00
Stu Grossman 3e3b0eb9d9 * utils.c (query): Remove test for energize from top. Now
handled in input_from_terminal_p().
1992-09-15 05:04:08 +00:00
Per Bothner 546014f750 * utils.c (strcmp_iw): Add a hack to allow "FOO(ARGS)" to
match "FOO".  This allows 'break Foo' to work when Foo is
	a mangled C++ function.  (See comment before function.)
1992-09-03 05:03:47 +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
John Gilmore 0f552c5fc6 * buildsym.c (scan_file_globals): Beware the null file.
Fix from Jim Williams.

* stack.c (return_command):  Evaluate expression *before* popping
off the stack frames!  Fix inspired by Jim Williams.
(up_silently_command, down_silently_command):  No sel frame is error.

* defs.h (memcpy, memset):  Conditionalize decls on
#ifndef MEM_FNS_DECLARED, since DECstation differs.
(alloca):  Break out the STDC and non-STDC alloca cases, to make
it work on old preprocessors as well as "picky ANSI" ones.
* xm-mips.h (memcpy, memset):  Declare, and set MEM_FNS_DECLARED.

* mips-tdep.c (heuristic_proc_start):  Zero arg produces zero.
* utils.c (fputs_demangled):  Rename SLOP since DECstation system
header files define it!
1992-06-30 08:53:28 +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
Stu Grossman bcf2e6ab49 * infrun.c (child_attach): Don't allow gdb to attach to itself.
It gets permanently stuck in many OSes.
* breakpoint.c, infcmd.c, infrun.c, utils.c:  Change many printfs
to printf_filtered.
* breakpoint.c: Improve	help text for info breakpoints.
1992-05-12 21:32:52 +00:00
John Gilmore 7e7e2d40c1 One more try... 1992-05-01 09:53:13 +00:00
John Gilmore fcdb113e57 * utils.c (printchar): Print 0x7F and 0x80-0x9F in \nnn notation
even when printing 8-bit characters.
1992-05-01 09:39:30 +00:00
Fred Fish 4ace50a510 Remove now obsolete signame.c and signame.h; functionality is handled by
libiberty/strsignal.c.  Widespread changes to use libiberty/strerror.c
functions for errno manipulations and libiberty/strsignal.c for signo
(signals) manipulations.
1992-04-22 16:46:47 +00:00
John Gilmore be772100b5 Lint 1992-03-29 23:26:47 +00:00
Per Bothner 1eeba68641 Merged in latest RS6000 diffs from Metin G. Ozisik. 1992-03-29 22:33:35 +00:00
Fred Fish 3624c87592 Mostly changes to dbxread.c to preserve stringtab's on a per-objfile
basis, for use in expanding psymtabs to full symtabs.  See ChangeLog
for other details.
1992-03-27 01:04:14 +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 7919c3ed86 * tm-sparc.h, tm-sysv4.h, solib.h: Move shared lib definitions
into solib.h.
* sparc-pinsn.c, sparc-tdep.c, standalonec, sun3-xdep.c,
sun386-xdep.c, symm-xdep.c, target.c, ultra3-xdep.c, utils.c,
value.h: Prototypes for static functions; lint.
* gdbtypes.h:  Empty file to ease transition.
1992-02-21 03:35:37 +00:00
John Gilmore 088c3a0b74 * defs.h: Include ansidecl.h and PARAMS macro. Use PARAMS
to make prototypes for all functions declared here.
* cplus-dem.c:  Avoid declaring xmalloc and xrealloc.
* c-exp.y:  Rename SIGNED, OR, and AND to avoid conflict.
* environ.c:  Include <stdio.h> before defs.h.  Minor cleanup.
* ieee-float.h:  Use PARAMS for prototypes; make some params const.
* ieee-float.c, valarith.c:  Include <stdio.h>.  Lint.  b*=>mem*.
* m2-exp.y:  Remove unused CONST; Rename OR and AND.
* utils.c:  Avoid declaring malloc and realloc.  Lint.
(request_quit):  Accept signal-number parameter.
1992-02-20 19:23:42 +00:00
Fred Fish ee1ad69ccd * configure.in, tm-amix.h, tm-i386v4.h, xm-amix.h, xm-i386v4.h:
Change svr4 references to sysv4.

* source.c:  Move declaration of external function index to
front of file so it is in scope for all references.

* utils.c (error, fatal):  Make definitions consistent with
defs.h declarations (declared as "volatile void").
1991-12-20 19:44:16 +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
Fred Fish ed317bb309 Remove local BSD/USG hacks that are now in libiberty. 1991-10-25 06:13:22 +00:00
Fred Fish 2bc2e684ad Add new function warning() which behaves the same as error() but returns
rather than jumping back to command level.  Modules that want to print
their own warnings without calling warning() can call warning_setup() to
handle the terminal compatibly with warning() and error().
1991-10-24 10:38:56 +00:00
John Gilmore 8106620887 * utils.c (error): if error_pre_print is set, print the string
first.
* main.c (main, print_gnu_advertisement, print_gdb_version):
Reformat legalese so it always prints, but acts as an "I'm here"
message while symbols are being read.  If any errors occur,
print a few newlines to set off the message and start it at the
left margin.  Remove mention of "help" command, and don't yak about
symbol reading.
(catch_errors):  Error string is now printed first in case of
error, not last.
* command.c (undef_cmd_error, lookup_cmd):  On undefined command,
suggest the "help" command.

* Makefile.in (VERSION):  Set to 4.0.2.
1991-09-10 08:56:09 +00:00
John Gilmore bdbd5f5086 Make writing to files work properly. (Fixes to BFD are also needed.)
* core.c (core_open):  Open file ourselves, read or r/w, depending on
write_files.  Use bfd_fdopenr.
* gdbcore.h (write_files):  New variable.
* exec.c (write_files):  Define variable, add set&show for it.
(exec_file_command):  Use write_files to open for read or r/write.

Make shared library reading happen automatically.  These changes
are mostly from Peter Schauer <pes@regent.e-technik.tu-muenchen.de>.

* inferior.h (stop_soon_quietly):  Add to exported variables.
* infrun.c (child_create_inferior):  call solib hook, if defined.
(child_attach):  call solib hook, if defined.
* solib.c:  Include inferior.h.  Add from_tty to so_list as kludge.
(find_solib):  Use lookup_misc_func rather than hand-rolled.
(symbol_add_stub):  New stub for catch_errors.
(solib_add):  Avoid output if !from_tty.  Catch errors rather
than just calling symbol_file_add and bombing.
(solib_create_inferior_hook):  Interface with the target process
to let it read and alloc shared libs, then figure out what it did.

* core.c (validate_files):  Fix typo, soften warning.
(Fix from Hiroto Kagotani <kagotani@cs.titech.ac.jp>.)

* utils.c (fputs_demangled):  Avoid duplicate printing if
demangling is off.  (Fix from J.T. Conklin <jtc@cayenne.com>.)

* infrun.c (proceed):  Cast -1 to (CORE_ADDR) before comparing.
(Fix from pierre@la.tce.com (Pierre Willard).)

* main.c (catch_errors):  Change argument to a char * from an int,
since a char * can point to a struct full of glop, but an int
is not guaranteed to be able to hold a pointer.
* breakpoint.c (breakpoint_cond_eval, bpstat_stop_status,
breakpoint_re_set_one, breakpoint_re_set):  Adapt.
* core.c (core_open, solib_add_stub):  Adapt.
* remote-vx.c (symbol_stub, add_symbol_stub, callers):  Adapt.
1991-09-04 07:43:50 +00:00
John Gilmore 5e5215eba7 * mcheck.c: Avoid warning about undeclared abort fn.
* tm-sparc.h (PC_ADJUST):  Avoid calling error() from this;
it causes recursive calls to error() when used in cleanups.
To do so requires that we make it a function, so we do.
* sparc-tdep.c (sparc_pc_adjust):  New implem of PC_ADJUST.
* utils.c (do_cleanups):  Remove the current cleanup from the
chain *before* calling it, in case error() is called from it.
The result won't be pretty, but won't be an infinite loop either.
1991-08-20 03:02:39 +00:00
John Gilmore 351b221ded * main.c: Remove unused terminating_signals and catch_termination().
(long_options):  Terminate with a zero element.
        [Bugfix from Atsuo Kawaguchi <atsuo@hark86.harl.hitachi.co.jp>.]
        (gdb_readline):  Make call-compatible with readline.
        (init_signals):  Improve comments re vfork vs. signal.

        * utils.c (prompt_for_continue):  Use new gdb_readline().
        If we prompt for continuation, we don't let CR repeat the previous
        command, once we get back to a prompt.  It's too easy to keep
        hitting CR, expecting "--more--" prompts, and have some long
        command start repeating on you.
1991-08-16 01:49:30 +00:00
John Gilmore d11c44f1ee Roll in Tiemann changes for gcc -ansi. Fix assorted bugs. See ChangeLog. 1991-05-30 08:52:52 +00:00
Jim Kingdon 8aa13b8777 Make it run on wingnut (88k, DGUX). Complete list of changes in the ChangeLog. 1991-05-03 06:02:03 +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
Jim Kingdon f88e7af831 * utils.c: Use CPLUS_MARKER not '$'.
* cplus-dem.c: Use CPLUS_MARKER not '$'.  If CPLUS_MARKER isn't
	defined, define it to '$'.
1991-04-19 23:50:06 +00:00
Jim Kingdon f266e5641b *** empty log message *** 1991-04-19 01:32:08 +00:00
K. Richard Pixley bd5635a1e2 Initial revision 1991-03-28 16:26:26 +00:00
John Gilmore 831c851165 Initial revision 1990-09-05 17:54:31 +00:00
gdb-3.4 1c997a4ae8 gdb-3.4 2012-06-03 15:36:32 +01:00
gdb-3.3 4187119d59 gdb-3.3 2012-06-03 15:36:32 +01:00
gdb-3.1 e91b87a368 gdb-3.1 2012-06-03 15:36:31 +01:00
gdb-2.8 3bf57d2108 gdb-2.8 2012-06-03 15:36:31 +01:00
gdb-2.5.1 632ea0ccc5 gdb-2.5.1 2012-06-03 15:36:30 +01:00