Commit Graph

37 Commits

Author SHA1 Message Date
Joel Brobecker b811d2c292 Update copyright year range in all GDB files.
gdb/ChangeLog:

        Update copyright year range in all GDB files.
2020-01-01 10:20:53 +04:00
Tom Tromey 268a13a5a3 Rename common to gdbsupport
This is the next patch in the ongoing series to move gdbsever to the
top level.

This patch just renames the "common" directory.  The idea is to do
this move in two parts: first rename the directory (this patch), then
move the directory to the top.  This approach makes the patches a bit
more tractable.

I chose the name "gdbsupport" for the directory.  However, as this
patch was largely written by sed, we could pick a new name without too
much difficulty.

Tested by the buildbot.

gdb/ChangeLog
2019-07-09  Tom Tromey  <tom@tromey.com>

	* contrib/ari/gdb_ari.sh: Change common to gdbsupport.
	* configure: Rebuild.
	* configure.ac: Change common to gdbsupport.
	* gdbsupport: Rename from common.
	* acinclude.m4: Change common to gdbsupport.
	* Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES)
	(HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to
	gdbsupport.
	* aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c,
	amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c,
	amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c,
	amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c,
	amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c,
	arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c,
	arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c,
	arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c,
	arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c,
	auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h,
	btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c,
	charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c,
	cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c,
	coff-pe-read.c, command.h, compile/compile-c-support.c,
	compile/compile-c.h, compile/compile-cplus-symbols.c,
	compile/compile-cplus-types.c, compile/compile-cplus.h,
	compile/compile-loc2c.c, compile/compile.c, completer.c,
	completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c,
	cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c,
	darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c,
	disasm.h, dtrace-probe.c, dwarf-index-cache.c,
	dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c,
	dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c,
	event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c,
	features/aarch64-core.c, features/aarch64-fpu.c,
	features/aarch64-pauth.c, features/aarch64-sve.c,
	features/i386/32bit-avx.c, features/i386/32bit-avx512.c,
	features/i386/32bit-core.c, features/i386/32bit-linux.c,
	features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c,
	features/i386/32bit-segments.c, features/i386/32bit-sse.c,
	features/i386/64bit-avx.c, features/i386/64bit-avx512.c,
	features/i386/64bit-core.c, features/i386/64bit-linux.c,
	features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c,
	features/i386/64bit-segments.c, features/i386/64bit-sse.c,
	features/i386/x32-core.c, features/riscv/32bit-cpu.c,
	features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c,
	features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c,
	features/riscv/64bit-fpu.c, features/tic6x-c6xp.c,
	features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h,
	findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h,
	gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c,
	gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c,
	go32-nat.c, guile/guile.c, guile/scm-ports.c,
	guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c,
	i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c,
	i386-linux-tdep.c, i386-tdep.c, i387-tdep.c,
	ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c,
	inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h,
	inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h,
	inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c,
	linux-tdep.c, linux-thread-db.c, location.c, machoread.c,
	macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h,
	mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c,
	mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h,
	minsyms.c, mips-linux-tdep.c, namespace.h,
	nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h,
	nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c,
	nat/amd64-linux-siginfo.c, nat/fork-inferior.c,
	nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c,
	nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c,
	nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h,
	nat/linux-waitpid.c, nat/mips-linux-watch.c,
	nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c,
	nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c,
	nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h,
	obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c,
	parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c,
	procfs.c, producer.c, progspace.h, psymtab.h,
	python/py-framefilter.c, python/py-inferior.c, python/py-ref.h,
	python/py-type.c, python/python.c, record-btrace.c, record-full.c,
	record.c, record.h, regcache-dump.c, regcache.c, regcache.h,
	remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c,
	riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c,
	selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c,
	ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c,
	source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c,
	stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h,
	symtab.c, symtab.h, target-descriptions.c, target-descriptions.h,
	target-memory.c, target.c, target.h, target/waitstatus.c,
	target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c,
	top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c,
	tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h,
	unittests/array-view-selftests.c,
	unittests/child-path-selftests.c, unittests/cli-utils-selftests.c,
	unittests/common-utils-selftests.c,
	unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c,
	unittests/format_pieces-selftests.c,
	unittests/function-view-selftests.c,
	unittests/lookup_name_info-selftests.c,
	unittests/memory-map-selftests.c, unittests/memrange-selftests.c,
	unittests/mkdir-recursive-selftests.c,
	unittests/observable-selftests.c,
	unittests/offset-type-selftests.c, unittests/optional-selftests.c,
	unittests/parse-connection-spec-selftests.c,
	unittests/ptid-selftests.c, unittests/rsp-low-selftests.c,
	unittests/scoped_fd-selftests.c,
	unittests/scoped_mmap-selftests.c,
	unittests/scoped_restore-selftests.c,
	unittests/string_view-selftests.c, unittests/style-selftests.c,
	unittests/tracepoint-selftests.c, unittests/unpack-selftests.c,
	unittests/utils-selftests.c, unittests/xml-utils-selftests.c,
	utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c,
	value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c,
	xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c,
	xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport.

gdb/gdbserver/ChangeLog
2019-07-09  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* configure.ac: Change common to gdbsupport.
	* acinclude.m4: Change common to gdbsupport.
	* Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS)
	(version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change
	common to gdbsupport.
	* ax.c, event-loop.c, fork-child.c, gdb_proc_service.h,
	gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c,
	inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c,
	linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c,
	linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c,
	linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h,
	nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c,
	server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h,
	thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change
	common to gdbsupport.
2019-07-09 07:45:38 -06:00
Tom Tromey 1a5c25988e Normalize include guards in gdb
While working on my other scripts to deal with gdb headers, I noticed
that some files were missing include guards.  I wrote a script to add
the missing ones, but found that using the obvious names for the
guards ran into clashes -- for example, gdb/nat/linux-nat.h used
"LINUX_NAT_H", but this was also the script's choice for
gdb/linux-nat.h.

So, I changed the script to normalize all include guards in gdb.  This
patch is the result.

As usual the script is available here:

    https://github.com/tromey/gdb-refactoring-scripts

Tested by rebuilding; I also ran it through "Fedora-x86_64-m64" on the
buildbot.

gdb/ChangeLog
2019-02-07  Tom Tromey  <tom@tromey.com>

	* yy-remap.h: Add include guard.
	* xtensa-tdep.h: Add include guard.
	* xcoffread.h: Rename include guard.
	* varobj-iter.h: Add include guard.
	* tui/tui.h: Rename include guard.
	* tui/tui-winsource.h: Rename include guard.
	* tui/tui-wingeneral.h: Rename include guard.
	* tui/tui-windata.h: Rename include guard.
	* tui/tui-win.h: Rename include guard.
	* tui/tui-stack.h: Rename include guard.
	* tui/tui-source.h: Rename include guard.
	* tui/tui-regs.h: Rename include guard.
	* tui/tui-out.h: Rename include guard.
	* tui/tui-layout.h: Rename include guard.
	* tui/tui-io.h: Rename include guard.
	* tui/tui-hooks.h: Rename include guard.
	* tui/tui-file.h: Rename include guard.
	* tui/tui-disasm.h: Rename include guard.
	* tui/tui-data.h: Rename include guard.
	* tui/tui-command.h: Rename include guard.
	* tic6x-tdep.h: Add include guard.
	* target/waitstatus.h: Rename include guard.
	* target/wait.h: Rename include guard.
	* target/target.h: Rename include guard.
	* target/resume.h: Rename include guard.
	* target-float.h: Rename include guard.
	* stabsread.h: Add include guard.
	* rs6000-tdep.h: Add include guard.
	* riscv-fbsd-tdep.h: Add include guard.
	* regformats/regdef.h: Rename include guard.
	* record.h: Rename include guard.
	* python/python.h: Rename include guard.
	* python/python-internal.h: Rename include guard.
	* python/py-stopevent.h: Rename include guard.
	* python/py-ref.h: Rename include guard.
	* python/py-record.h: Rename include guard.
	* python/py-record-full.h: Rename include guard.
	* python/py-record-btrace.h: Rename include guard.
	* python/py-instruction.h: Rename include guard.
	* python/py-events.h: Rename include guard.
	* python/py-event.h: Rename include guard.
	* procfs.h: Add include guard.
	* proc-utils.h: Add include guard.
	* p-lang.h: Add include guard.
	* or1k-tdep.h: Rename include guard.
	* observable.h: Rename include guard.
	* nto-tdep.h: Rename include guard.
	* nat/x86-linux.h: Rename include guard.
	* nat/x86-linux-dregs.h: Rename include guard.
	* nat/x86-gcc-cpuid.h: Add include guard.
	* nat/x86-dregs.h: Rename include guard.
	* nat/x86-cpuid.h: Rename include guard.
	* nat/ppc-linux.h: Rename include guard.
	* nat/mips-linux-watch.h: Rename include guard.
	* nat/linux-waitpid.h: Rename include guard.
	* nat/linux-ptrace.h: Rename include guard.
	* nat/linux-procfs.h: Rename include guard.
	* nat/linux-osdata.h: Rename include guard.
	* nat/linux-nat.h: Rename include guard.
	* nat/linux-namespaces.h: Rename include guard.
	* nat/linux-btrace.h: Rename include guard.
	* nat/glibc_thread_db.h: Rename include guard.
	* nat/gdb_thread_db.h: Rename include guard.
	* nat/gdb_ptrace.h: Rename include guard.
	* nat/fork-inferior.h: Rename include guard.
	* nat/amd64-linux-siginfo.h: Rename include guard.
	* nat/aarch64-sve-linux-sigcontext.h: Rename include guard.
	* nat/aarch64-sve-linux-ptrace.h: Rename include guard.
	* nat/aarch64-linux.h: Rename include guard.
	* nat/aarch64-linux-hw-point.h: Rename include guard.
	* mn10300-tdep.h: Add include guard.
	* mips-linux-tdep.h: Add include guard.
	* mi/mi-parse.h: Rename include guard.
	* mi/mi-out.h: Rename include guard.
	* mi/mi-main.h: Rename include guard.
	* mi/mi-interp.h: Rename include guard.
	* mi/mi-getopt.h: Rename include guard.
	* mi/mi-console.h: Rename include guard.
	* mi/mi-common.h: Rename include guard.
	* mi/mi-cmds.h: Rename include guard.
	* mi/mi-cmd-break.h: Rename include guard.
	* m2-lang.h: Add include guard.
	* location.h: Rename include guard.
	* linux-record.h: Rename include guard.
	* linux-nat.h: Add include guard.
	* linux-fork.h: Add include guard.
	* i386-darwin-tdep.h: Rename include guard.
	* hppa-linux-offsets.h: Add include guard.
	* guile/guile.h: Rename include guard.
	* guile/guile-internal.h: Rename include guard.
	* gnu-nat.h: Rename include guard.
	* gdb-stabs.h: Rename include guard.
	* frv-tdep.h: Add include guard.
	* f-lang.h: Add include guard.
	* event-loop.h: Add include guard.
	* darwin-nat.h: Rename include guard.
	* cp-abi.h: Rename include guard.
	* config/sparc/nm-sol2.h: Rename include guard.
	* config/nm-nto.h: Rename include guard.
	* config/nm-linux.h: Add include guard.
	* config/i386/nm-i386gnu.h: Rename include guard.
	* config/djgpp/nl_types.h: Rename include guard.
	* config/djgpp/langinfo.h: Rename include guard.
	* compile/gcc-cp-plugin.h: Add include guard.
	* compile/gcc-c-plugin.h: Add include guard.
	* compile/compile.h: Rename include guard.
	* compile/compile-object-run.h: Rename include guard.
	* compile/compile-object-load.h: Rename include guard.
	* compile/compile-internal.h: Rename include guard.
	* compile/compile-cplus.h: Rename include guard.
	* compile/compile-c.h: Rename include guard.
	* common/xml-utils.h: Rename include guard.
	* common/x86-xstate.h: Rename include guard.
	* common/version.h: Rename include guard.
	* common/vec.h: Rename include guard.
	* common/tdesc.h: Rename include guard.
	* common/selftest.h: Rename include guard.
	* common/scoped_restore.h: Rename include guard.
	* common/scoped_mmap.h: Rename include guard.
	* common/scoped_fd.h: Rename include guard.
	* common/safe-iterator.h: Rename include guard.
	* common/run-time-clock.h: Rename include guard.
	* common/refcounted-object.h: Rename include guard.
	* common/queue.h: Rename include guard.
	* common/ptid.h: Rename include guard.
	* common/print-utils.h: Rename include guard.
	* common/preprocessor.h: Rename include guard.
	* common/pathstuff.h: Rename include guard.
	* common/observable.h: Rename include guard.
	* common/netstuff.h: Rename include guard.
	* common/job-control.h: Rename include guard.
	* common/host-defs.h: Rename include guard.
	* common/gdb_wait.h: Rename include guard.
	* common/gdb_vecs.h: Rename include guard.
	* common/gdb_unlinker.h: Rename include guard.
	* common/gdb_unique_ptr.h: Rename include guard.
	* common/gdb_tilde_expand.h: Rename include guard.
	* common/gdb_sys_time.h: Rename include guard.
	* common/gdb_string_view.h: Rename include guard.
	* common/gdb_splay_tree.h: Rename include guard.
	* common/gdb_setjmp.h: Rename include guard.
	* common/gdb_ref_ptr.h: Rename include guard.
	* common/gdb_optional.h: Rename include guard.
	* common/gdb_locale.h: Rename include guard.
	* common/gdb_assert.h: Rename include guard.
	* common/filtered-iterator.h: Rename include guard.
	* common/filestuff.h: Rename include guard.
	* common/fileio.h: Rename include guard.
	* common/environ.h: Rename include guard.
	* common/common-utils.h: Rename include guard.
	* common/common-types.h: Rename include guard.
	* common/common-regcache.h: Rename include guard.
	* common/common-inferior.h: Rename include guard.
	* common/common-gdbthread.h: Rename include guard.
	* common/common-exceptions.h: Rename include guard.
	* common/common-defs.h: Rename include guard.
	* common/common-debug.h: Rename include guard.
	* common/cleanups.h: Rename include guard.
	* common/buffer.h: Rename include guard.
	* common/btrace-common.h: Rename include guard.
	* common/break-common.h: Rename include guard.
	* cli/cli-utils.h: Rename include guard.
	* cli/cli-style.h: Rename include guard.
	* cli/cli-setshow.h: Rename include guard.
	* cli/cli-script.h: Rename include guard.
	* cli/cli-interp.h: Rename include guard.
	* cli/cli-decode.h: Rename include guard.
	* cli/cli-cmds.h: Rename include guard.
	* charset-list.h: Add include guard.
	* buildsym-legacy.h: Rename include guard.
	* bfin-tdep.h: Add include guard.
	* ax.h: Rename include guard.
	* arm-linux-tdep.h: Add include guard.
	* arm-fbsd-tdep.h: Add include guard.
	* arch/xtensa.h: Rename include guard.
	* arch/tic6x.h: Add include guard.
	* arch/i386.h: Add include guard.
	* arch/arm.h: Rename include guard.
	* arch/arm-linux.h: Rename include guard.
	* arch/arm-get-next-pcs.h: Rename include guard.
	* arch/amd64.h: Add include guard.
	* arch/aarch64-insn.h: Rename include guard.
	* arch-utils.h: Rename include guard.
	* annotate.h: Add include guard.
	* amd64-darwin-tdep.h: Rename include guard.
	* aarch64-linux-tdep.h: Add include guard.
	* aarch64-fbsd-tdep.h: Add include guard.
	* aarch32-linux-nat.h: Add include guard.

gdb/gdbserver/ChangeLog
2019-02-07  Tom Tromey  <tom@tromey.com>

	* x86-tdesc.h: Rename include guard.
	* x86-low.h: Add include guard.
	* wincecompat.h: Rename include guard.
	* win32-low.h: Add include guard.
	* utils.h: Rename include guard.
	* tracepoint.h: Rename include guard.
	* tdesc.h: Rename include guard.
	* target.h: Rename include guard.
	* server.h: Rename include guard.
	* remote-utils.h: Rename include guard.
	* regcache.h: Rename include guard.
	* nto-low.h: Rename include guard.
	* notif.h: Add include guard.
	* mem-break.h: Rename include guard.
	* lynx-low.h: Add include guard.
	* linux-x86-tdesc.h: Add include guard.
	* linux-s390-tdesc.h: Add include guard.
	* linux-ppc-tdesc-init.h: Add include guard.
	* linux-low.h: Add include guard.
	* linux-aarch64-tdesc.h: Add include guard.
	* linux-aarch32-low.h: Add include guard.
	* inferiors.h: Rename include guard.
	* i387-fp.h: Rename include guard.
	* hostio.h: Rename include guard.
	* gdbthread.h: Rename include guard.
	* gdb_proc_service.h: Rename include guard.
	* event-loop.h: Rename include guard.
	* dll.h: Rename include guard.
	* debug.h: Rename include guard.
	* ax.h: Rename include guard.
2019-02-07 03:27:23 -07:00
Tom Tromey 0747795c08 Normalize includes to use common/
This changes all includes to use the form "common/filename.h" rather
than just "filename.h".  This was written by a script.

gdb/ChangeLog
2019-01-25  Tom Tromey  <tom@tromey.com>

	* xtensa-linux-nat.c: Fix common/ includes.
	* xml-support.h: Fix common/ includes.
	* xml-support.c: Fix common/ includes.
	* x86-linux-nat.c: Fix common/ includes.
	* windows-nat.c: Fix common/ includes.
	* varobj.h: Fix common/ includes.
	* varobj.c: Fix common/ includes.
	* value.c: Fix common/ includes.
	* valops.c: Fix common/ includes.
	* utils.c: Fix common/ includes.
	* unittests/xml-utils-selftests.c: Fix common/ includes.
	* unittests/utils-selftests.c: Fix common/ includes.
	* unittests/unpack-selftests.c: Fix common/ includes.
	* unittests/tracepoint-selftests.c: Fix common/ includes.
	* unittests/style-selftests.c: Fix common/ includes.
	* unittests/string_view-selftests.c: Fix common/ includes.
	* unittests/scoped_restore-selftests.c: Fix common/ includes.
	* unittests/scoped_mmap-selftests.c: Fix common/ includes.
	* unittests/scoped_fd-selftests.c: Fix common/ includes.
	* unittests/rsp-low-selftests.c: Fix common/ includes.
	* unittests/parse-connection-spec-selftests.c: Fix common/
	includes.
	* unittests/optional-selftests.c: Fix common/ includes.
	* unittests/offset-type-selftests.c: Fix common/ includes.
	* unittests/observable-selftests.c: Fix common/ includes.
	* unittests/mkdir-recursive-selftests.c: Fix common/ includes.
	* unittests/memrange-selftests.c: Fix common/ includes.
	* unittests/memory-map-selftests.c: Fix common/ includes.
	* unittests/lookup_name_info-selftests.c: Fix common/ includes.
	* unittests/function-view-selftests.c: Fix common/ includes.
	* unittests/environ-selftests.c: Fix common/ includes.
	* unittests/copy_bitwise-selftests.c: Fix common/ includes.
	* unittests/common-utils-selftests.c: Fix common/ includes.
	* unittests/cli-utils-selftests.c: Fix common/ includes.
	* unittests/array-view-selftests.c: Fix common/ includes.
	* ui-file.c: Fix common/ includes.
	* tui/tui-io.c: Fix common/ includes.
	* tracepoint.h: Fix common/ includes.
	* tracepoint.c: Fix common/ includes.
	* tracefile-tfile.c: Fix common/ includes.
	* top.h: Fix common/ includes.
	* top.c: Fix common/ includes.
	* thread.c: Fix common/ includes.
	* target/waitstatus.h: Fix common/ includes.
	* target/waitstatus.c: Fix common/ includes.
	* target.h: Fix common/ includes.
	* target.c: Fix common/ includes.
	* target-memory.c: Fix common/ includes.
	* target-descriptions.c: Fix common/ includes.
	* symtab.h: Fix common/ includes.
	* symfile.c: Fix common/ includes.
	* stap-probe.c: Fix common/ includes.
	* spu-linux-nat.c: Fix common/ includes.
	* sparc-nat.c: Fix common/ includes.
	* source.c: Fix common/ includes.
	* solib.c: Fix common/ includes.
	* solib-target.c: Fix common/ includes.
	* ser-unix.c: Fix common/ includes.
	* ser-tcp.c: Fix common/ includes.
	* ser-pipe.c: Fix common/ includes.
	* ser-base.c: Fix common/ includes.
	* selftest-arch.c: Fix common/ includes.
	* s12z-tdep.c: Fix common/ includes.
	* rust-exp.y: Fix common/ includes.
	* rs6000-aix-tdep.c: Fix common/ includes.
	* riscv-tdep.c: Fix common/ includes.
	* remote.c: Fix common/ includes.
	* remote-notif.h: Fix common/ includes.
	* remote-fileio.h: Fix common/ includes.
	* remote-fileio.c: Fix common/ includes.
	* regcache.h: Fix common/ includes.
	* regcache.c: Fix common/ includes.
	* record-btrace.c: Fix common/ includes.
	* python/python.c: Fix common/ includes.
	* python/py-type.c: Fix common/ includes.
	* python/py-inferior.c: Fix common/ includes.
	* progspace.h: Fix common/ includes.
	* producer.c: Fix common/ includes.
	* procfs.c: Fix common/ includes.
	* proc-api.c: Fix common/ includes.
	* printcmd.c: Fix common/ includes.
	* ppc-linux-nat.c: Fix common/ includes.
	* parser-defs.h: Fix common/ includes.
	* osdata.c: Fix common/ includes.
	* obsd-nat.c: Fix common/ includes.
	* nat/x86-linux.c: Fix common/ includes.
	* nat/x86-linux-dregs.c: Fix common/ includes.
	* nat/x86-dregs.h: Fix common/ includes.
	* nat/x86-dregs.c: Fix common/ includes.
	* nat/ppc-linux.c: Fix common/ includes.
	* nat/mips-linux-watch.h: Fix common/ includes.
	* nat/mips-linux-watch.c: Fix common/ includes.
	* nat/linux-waitpid.c: Fix common/ includes.
	* nat/linux-ptrace.h: Fix common/ includes.
	* nat/linux-ptrace.c: Fix common/ includes.
	* nat/linux-procfs.c: Fix common/ includes.
	* nat/linux-personality.c: Fix common/ includes.
	* nat/linux-osdata.c: Fix common/ includes.
	* nat/linux-namespaces.c: Fix common/ includes.
	* nat/linux-btrace.h: Fix common/ includes.
	* nat/linux-btrace.c: Fix common/ includes.
	* nat/fork-inferior.c: Fix common/ includes.
	* nat/amd64-linux-siginfo.c: Fix common/ includes.
	* nat/aarch64-sve-linux-ptrace.c: Fix common/ includes.
	* nat/aarch64-linux.c: Fix common/ includes.
	* nat/aarch64-linux-hw-point.h: Fix common/ includes.
	* nat/aarch64-linux-hw-point.c: Fix common/ includes.
	* namespace.h: Fix common/ includes.
	* mips-linux-tdep.c: Fix common/ includes.
	* minsyms.c: Fix common/ includes.
	* mi/mi-parse.h: Fix common/ includes.
	* mi/mi-main.c: Fix common/ includes.
	* mi/mi-cmd-env.c: Fix common/ includes.
	* memrange.h: Fix common/ includes.
	* memattr.c: Fix common/ includes.
	* maint.h: Fix common/ includes.
	* maint.c: Fix common/ includes.
	* main.c: Fix common/ includes.
	* machoread.c: Fix common/ includes.
	* location.c: Fix common/ includes.
	* linux-thread-db.c: Fix common/ includes.
	* linux-nat.c: Fix common/ includes.
	* linux-fork.c: Fix common/ includes.
	* inline-frame.c: Fix common/ includes.
	* infrun.c: Fix common/ includes.
	* inflow.c: Fix common/ includes.
	* inferior.h: Fix common/ includes.
	* inferior.c: Fix common/ includes.
	* infcmd.c: Fix common/ includes.
	* inf-ptrace.c: Fix common/ includes.
	* inf-child.c: Fix common/ includes.
	* ia64-linux-nat.c: Fix common/ includes.
	* i387-tdep.c: Fix common/ includes.
	* i386-tdep.c: Fix common/ includes.
	* i386-linux-tdep.c: Fix common/ includes.
	* i386-linux-nat.c: Fix common/ includes.
	* i386-go32-tdep.c: Fix common/ includes.
	* i386-fbsd-tdep.c: Fix common/ includes.
	* i386-fbsd-nat.c: Fix common/ includes.
	* guile/scm-type.c: Fix common/ includes.
	* guile/guile.c: Fix common/ includes.
	* go32-nat.c: Fix common/ includes.
	* gnu-nat.c: Fix common/ includes.
	* gdbthread.h: Fix common/ includes.
	* gdbarch-selftests.c: Fix common/ includes.
	* gdb_usleep.c: Fix common/ includes.
	* gdb_select.h: Fix common/ includes.
	* gdb_bfd.c: Fix common/ includes.
	* gcore.c: Fix common/ includes.
	* fork-child.c: Fix common/ includes.
	* findvar.c: Fix common/ includes.
	* fbsd-nat.c: Fix common/ includes.
	* event-top.c: Fix common/ includes.
	* event-loop.c: Fix common/ includes.
	* dwarf2read.c: Fix common/ includes.
	* dwarf2loc.c: Fix common/ includes.
	* dwarf2-frame.c: Fix common/ includes.
	* dwarf-index-cache.c: Fix common/ includes.
	* dtrace-probe.c: Fix common/ includes.
	* disasm-selftests.c: Fix common/ includes.
	* defs.h: Fix common/ includes.
	* csky-tdep.c: Fix common/ includes.
	* cp-valprint.c: Fix common/ includes.
	* cp-support.h: Fix common/ includes.
	* cp-support.c: Fix common/ includes.
	* corelow.c: Fix common/ includes.
	* completer.h: Fix common/ includes.
	* completer.c: Fix common/ includes.
	* compile/compile.c: Fix common/ includes.
	* compile/compile-loc2c.c: Fix common/ includes.
	* compile/compile-cplus-types.c: Fix common/ includes.
	* compile/compile-cplus-symbols.c: Fix common/ includes.
	* command.h: Fix common/ includes.
	* cli/cli-dump.c: Fix common/ includes.
	* cli/cli-cmds.c: Fix common/ includes.
	* charset.c: Fix common/ includes.
	* build-id.c: Fix common/ includes.
	* btrace.h: Fix common/ includes.
	* btrace.c: Fix common/ includes.
	* breakpoint.h: Fix common/ includes.
	* breakpoint.c: Fix common/ includes.
	* ax.h:
	(enum agent_op): Fix common/ includes.
	* ax-general.c (struct aop_map): Fix common/ includes.
	* ax-gdb.c: Fix common/ includes.
	* auxv.c: Fix common/ includes.
	* auto-load.c: Fix common/ includes.
	* arm-tdep.c: Fix common/ includes.
	* arch/riscv.c: Fix common/ includes.
	* arch/ppc-linux-common.c: Fix common/ includes.
	* arch/i386.c: Fix common/ includes.
	* arch/arm.c: Fix common/ includes.
	* arch/arm-linux.c: Fix common/ includes.
	* arch/arm-get-next-pcs.c: Fix common/ includes.
	* arch/amd64.c: Fix common/ includes.
	* arch/aarch64.c: Fix common/ includes.
	* arch/aarch64-insn.c: Fix common/ includes.
	* arch-utils.c: Fix common/ includes.
	* amd64-windows-tdep.c: Fix common/ includes.
	* amd64-tdep.c: Fix common/ includes.
	* amd64-sol2-tdep.c: Fix common/ includes.
	* amd64-obsd-tdep.c: Fix common/ includes.
	* amd64-nbsd-tdep.c: Fix common/ includes.
	* amd64-linux-tdep.c: Fix common/ includes.
	* amd64-linux-nat.c: Fix common/ includes.
	* amd64-fbsd-tdep.c: Fix common/ includes.
	* amd64-fbsd-nat.c: Fix common/ includes.
	* amd64-dicos-tdep.c: Fix common/ includes.
	* amd64-darwin-tdep.c: Fix common/ includes.
	* agent.c: Fix common/ includes.
	* ada-lang.h: Fix common/ includes.
	* ada-lang.c: Fix common/ includes.
	* aarch64-tdep.c: Fix common/ includes.

gdb/gdbserver/ChangeLog
2019-01-25  Tom Tromey  <tom@tromey.com>

	* win32-low.c: Fix common/ includes.
	* win32-i386-low.c: Fix common/ includes.
	* tracepoint.c: Fix common/ includes.
	* thread-db.c: Fix common/ includes.
	* target.h: Fix common/ includes.
	* symbol.c: Fix common/ includes.
	* spu-low.c: Fix common/ includes.
	* server.h: Fix common/ includes.
	* server.c: Fix common/ includes.
	* remote-utils.c: Fix common/ includes.
	* regcache.h: Fix common/ includes.
	* regcache.c: Fix common/ includes.
	* nto-x86-low.c: Fix common/ includes.
	* notif.h: Fix common/ includes.
	* mem-break.h: Fix common/ includes.
	* lynx-low.c: Fix common/ includes.
	* lynx-i386-low.c: Fix common/ includes.
	* linux-x86-tdesc-selftest.c: Fix common/ includes.
	* linux-x86-low.c: Fix common/ includes.
	* linux-low.c: Fix common/ includes.
	* inferiors.h: Fix common/ includes.
	* i387-fp.c: Fix common/ includes.
	* hostio.c: Fix common/ includes.
	* hostio-errno.c: Fix common/ includes.
	* gdbthread.h: Fix common/ includes.
	* gdbreplay.c: Fix common/ includes.
	* fork-child.c: Fix common/ includes.
	* event-loop.c: Fix common/ includes.
	* ax.c:
	(enum gdb_agent_op): Fix common/ includes.
2019-01-25 15:28:16 -07:00
Joel Brobecker 42a4f53d2b Update copyright year range in all GDB files.
This commit applies all changes made after running the gdb/copyright.py
script.

Note that one file was flagged by the script, due to an invalid
copyright header
(gdb/unittests/basic_string_view/element_access/char/empty.cc).
As the file was copied from GCC's libstdc++-v3 testsuite, this commit
leaves this file untouched for the time being; a patch to fix the header
was sent to gcc-patches first.

gdb/ChangeLog:

	Update copyright year range in all GDB files.
2019-01-01 10:01:51 +04:00
Joel Brobecker e2882c8578 Update copyright year range in all GDB files
gdb/ChangeLog:

        Update copyright year range in all GDB files
2018-01-02 07:38:06 +04:00
Yao Qi d654162044 Use DISABLE_COPY_AND_ASSIGN
We have many classes that copy cotr and assignment operator are deleted,
so this patch replaces these existing mechanical code with macro
DISABLE_COPY_AND_ASSIGN.

gdb:

2017-09-19  Yao Qi  <yao.qi@linaro.org>

	* annotate.h (struct annotate_arg_emitter): Use
	DISABLE_COPY_AND_ASSIGN.
	* common/refcounted-object.h (refcounted_object): Likewise.
	* completer.h (struct completion_result): Likewise.
	* dwarf2read.c (struct dwarf2_per_objfile): Likewise.
	* filename-seen-cache.h (filename_seen_cache): Likewise.
	* gdbcore.h (thread_section_name): Likewise.
	* gdb_regex.h (compiled_regex): Likewise.
	* gdbthread.h (scoped_restore_current_thread): Likewise.
	* inferior.h (scoped_restore_current_inferior): Likewise.
	* jit.c (jit_reader): Likewise.
	* linespec.h (struct linespec_result): Likewise.
	* mi/mi-parse.h (struct mi_parse): Likewise.
	* nat/fork-inferior.c (execv_argv): Likewise.
	* progspace.h (scoped_restore_current_program_space): Likewise.
	* python/python-internal.h (class gdbpy_enter): Likewise.
	* regcache.h (regcache): Likewise.
	* target-descriptions.c (struct tdesc_reg): Likewise.
	(struct tdesc_type): Likewise.
	(struct tdesc_feature): Likewise.
	* ui-out.h (ui_out_emit_type): Likewise.
2017-09-19 10:10:03 +01:00
Tom Tromey 4d89769a7b C++ify mi_parse
This changes mi_parse to return a unique_ptr, and to use "new"; then
fixes up the users.  This allows removing one cleanup.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

	* mi/mi-parse.h (struct mi_parse): Add constructor, destructor.
	(mi_parse): Update return type.
	(mi_parse_free): Remove.
	* mi/mi-parse.c (mi_parse::mi_parse): New constructor.
	(mi_parse::~mi_parse): Rename from mi_parse_free.
	(mi_parse_cleanup): Remove.
	(mi_parse): Return a unique_ptr.  Use new.
	* mi/mi-main.c (mi_execute_command): Update.
2017-04-12 11:16:18 -06:00
Yao Qi 66c80d0307 Include mi-cmds.h in mi-parse.h
$ make check-headers CHECK_HEADERS="mi/mi-parse.h"
...
../../binutils-gdb/gdb/mi/mi-parse.h:77:6: error: use of enum 'print_values' without previous declaration
 enum print_values mi_parse_print_values (const char *name);
      ^

gdb:

2017-01-06  Yao Qi  <yao.qi@linaro.org>

	* mi/mi-parse.h: Include mi-cmds.h.
2017-01-06 14:33:00 +00:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Pedro Alves dcb07cfa15 gdb: Use C++11 std::chrono
This patch fixes a few problems with GDB's time handling.

#1 - It avoids problems with gnulib's C++ namespace support

On MinGW, the struct timeval that should be passed to gnulib's
gettimeofday replacement is incompatible with libiberty's
timeval_sub/timeval_add.  That's because gnulib also replaces "struct
timeval" with its own definition, while libiberty expects the
system's.

E.g., in code like this:

  gettimeofday (&prompt_ended, NULL);
  timeval_sub (&prompt_delta, &prompt_ended, &prompt_started);
  timeval_add (&prompt_for_continue_wait_time,
               &prompt_for_continue_wait_time, &prompt_delta);

That's currently handled in gdb by not using gnulib's gettimeofday at
all (see common/gdb_sys_time.h), but that #undef hack won't work with
if/when we enable gnulib's C++ namespace support, because that mode
adds compile time warnings for uses of ::gettimeofday, which are hard
errors with -Werror.

#2 - But there's an elephant in the room: gettimeofday is not monotonic...

We're using it to:

  a) check how long functions take, for performance analysis
  b) compute when in the future to fire events in the event-loop
  c) print debug timestamps

But that's exactly what gettimeofday is NOT meant for.  Straight from
the man page:

~~~
       The time returned by gettimeofday() is affected by
       discontinuous jumps in the system time (e.g., if the system
       administrator manually changes the system time).  If you need a
       monotonically increasing clock, see clock_gettime(2).
~~~

std::chrono (part of the C++11 standard library) has a monotonic clock
exactly for such purposes (std::chrono::steady_clock).  This commit
switches to use that instead of gettimeofday, fixing all the issues
mentioned above.

gdb/ChangeLog:
2016-11-23  Pedro Alves  <palves@redhat.com>

	* Makefile.in (SFILES): Add common/run-time-clock.c.
	(HFILES_NO_SRCDIR): Add common/run-time-clock.h.
	(COMMON_OBS): Add run-time-clock.o.
	* common/run-time-clock.c, common/run-time-clock.h: New files.
	* defs.h (struct timeval, print_transfer_performance): Delete
	declarations.
	* event-loop.c (struct gdb_timer) <when>: Now a
	std::chrono::steady_clock::time_point.
	(create_timer): use std::chrono::steady_clock instead of
	gettimeofday.  Use new instead of malloc.
	(delete_timer): Use delete instead of xfree.
	(duration_cast_timeval): New.
	(update_wait_timeout): Use std::chrono::steady_clock instead of
	gettimeofday.
	* maint.c: Include <chrono> instead of "gdb_sys_time.h", <time.h>
	and "timeval-utils.h".
	(scoped_command_stats::~scoped_command_stats)
	(scoped_command_stats::scoped_command_stats): Use
	std::chrono::steady_clock instead of gettimeofday.  Use
	user_cpu_time_clock instead of get_run_time.
	* maint.h: Include "run-time-clock.h" and <chrono>.
	(scoped_command_stats): <m_start_cpu_time>: Now a
	user_cpu_time_clock::time_point.
	<m_start_wall_time>: Now a std::chrono::steady_clock::time_point.
	* mi/mi-main.c: Include "run-time-clock.h" and <chrono> instead of
	"gdb_sys_time.h" and <sys/resource.h>.
	(rusage): Delete.
	(mi_execute_command): Use new instead of XNEW.
	(mi_load_progress): Use std::chrono::steady_clock instead of
	gettimeofday.
	(timestamp): Rewrite in terms of std::chrono::steady_clock,
	user_cpu_time_clock and system_cpu_time_clock.
	(timeval_diff): Delete.
	(print_diff): Adjust to use std::chrono::steady_clock,
	user_cpu_time_clock and system_cpu_time_clock.
	* mi/mi-parse.h: Include "run-time-clock.h" and <chrono> instead
	of "gdb_sys_time.h".
	(struct mi_timestamp): Change fields types to
	std::chrono::steady_clock::time_point, user_cpu_time_clock::time
	and system_cpu_time_clock::time_point, instead of struct timeval.
	* symfile.c: Include <chrono> instead of <time.h> and
	"gdb_sys_time.h".
	(struct time_range): New.
	(generic_load): Use std::chrono::steady_clock instead of
	gettimeofday.
	(print_transfer_performance): Replace timeval parameters with a
	std::chrono::steady_clock::duration parameter.  Adjust.
	* utils.c: Include <chrono> instead of "timeval-utils.h",
	"gdb_sys_time.h", and <time.h>.
	(prompt_for_continue_wait_time): Now a
	std::chrono::steady_clock::duration.
	(defaulted_query, prompt_for_continue): Use
	std::chrono::steady_clock instead of
	gettimeofday/timeval_sub/timeval_add.
	(reset_prompt_for_continue_wait_time): Use
	std::chrono::steady_clock::duration instead of struct timeval.
	(get_prompt_for_continue_wait_time): Return a
	std::chrono::steady_clock::duration instead of struct timeval.
	(vfprintf_unfiltered): Use std::chrono::steady_clock instead of
	gettimeofday.  Use std::string.  Use '.' instead of ':'.
	* utils.h: Include <chrono>.
	(get_prompt_for_continue_wait_time): Return a
	std::chrono::steady_clock::duration instead of struct timeval.

gdb/gdbserver/ChangeLog:
2016-11-23  Pedro Alves  <palves@redhat.com>

	* debug.c: Include <chrono> instead of "gdb_sys_time.h".
	(debug_vprintf): Use std::chrono::steady_clock instead of
	gettimeofday.  Use '.' instead of ':'.
	* tracepoint.c: Include <chrono> instead of "gdb_sys_time.h".
	(get_timestamp): Use std::chrono::steady_clock instead of
	gettimeofday.
2016-11-23 15:36:26 +00:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Pedro Alves 438e1e427e Prepare for gnulib update
After the last gnulib import (Dec 2012), gnulib upstream started
replacing mingw's 'struct timeval' with a version with 64-bit time_t,
for POSIX compliance:

 commit f8e84098084b3b53bc6943a5542af1f607ffd477
 Author: Bruno Haible <bruno@clisp.org>
 Date:   Sat Jan 28 18:12:10 2012 +0100
     sys_time: Override 'struct timeval' on some native Windows platforms.

See:

 https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00372.html

However, that results in conflicts with native Winsock2's 'select':

select()'s argument
	http://sourceforge.net/p/mingw-w64/mailman/message/29610438/

... and libiberty's timeval-utils.h timeval_add/timeval_sub, at the
least.

We don't really need the POSIX compliance, so this patch prepares us
to simply not use gnulib's 'struct timeval' replacement once a more
recent gnulib is imported, thus preserving the current behavior, by
adding a sys/time.h wrapper header that undefs gnulib's replacements,
and including that everywhere instead.

The SIZE -> OSIZE change is necessary because newer gnulib's
sys/time.h also includes windows.h/winsock2.h, which defines a
conflicting SIZE symbol.

Cross build-tested mingw-w64 32-bit and 64-bit.
Regtested on x86_64 Fedora 20.

gdb/ChangeLog:
2015-08-24  Pedro Alves  <palves@redhat.com>

	* Makefile.in (HFILES_NO_SRCDIR): Add common/gdb_sys_time.h.
	* common/gdb_sys_time.h: New file.
	* event-loop.c: Include gdb_sys_time.h instead of sys/time.h.
	* gdb_select.h: Likewise.
	* gdb_usleep.c: Likewise.
	* maint.c: Likewise.
	* mi/mi-main.c: Likewise.
	* mi/mi-parse.h: Likewise.
	* remote-fileio.c: Likewise.
	* remote-m32r-sdi.c: Likewise.
	* remote.c: Likewise.
	* ser-base.c: Likewise.
	* ser-pipe.c: Likewise.
	* ser-tcp.c: Likewise.
	* ser-unix.c: Likewise.
	* symfile.c: Likewise.
	* symfile.c: Likewise.  Rename OSIZE to SIZE throughout.
	* target-memory.c: Include gdb_sys_time.h instead of sys/time.h.
	* utils.c: Likewise.

gdb/gdbserver/ChangeLog:
2015-08-24  Pedro Alves  <palves@redhat.com>

	* debug.c: Include gdb_sys_time.h instead of sys/time.h.
	* event-loop.c: Likewise.
	* remote-utils.c: Likewise.
	* tracepoint.c: Likewise.
2015-08-24 18:50:55 +01:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Joel Brobecker 403cb6b138 GDB/MI: Add new "--language LANG" command option.
Frontend sometimes need to evaluate expressions that are
language-specific. For instance, Eclipse uses the following
expression to determine the size of an address on the target:

    -data-evaluate-expression "sizeof (void*)"

Unfortunately, if the main of the program being debugged is not C,
this may not work. For instance, if the main is in Ada, you get...

    -data-evaluate-expression "sizeof (void*)"
    ^error,msg="No definition of \"sizeof\" in current context."

... and apparently decides to stop the debugging session as a result.
The  recommendation sent was to specifically set the language to C
before trying to evaluate the expression.  Something such as:

    1. save current language
    2. set language c
    3. -data-evaluate-expression "sizeof (void*)"
    4. Restore language

This has the same disadvantages as the ones outlined in the "Context
Management" section of the GDB/MI documentation regarding setting
the current thread or the current frame, thus recommending the use of
general command-line switches such as --frame, or --thread instead.

This patch follows the same steps for the language, adding a similar
new command option: --language LANG. Example of use:

    -data-evaluate-expression --language c "sizeof (void*)"
    ^done,value="4"

gdb/ChangeLog:

        * mi/mi-parse.h (struct mi_parse) <language>: New field.
        * mi/mi-main.c (mi_cmd_execute): Temporarily set language to
        PARSE->LANGUAGE during command execution, if set.
        * mi/mi-parse.c: Add "language.h" #include.
        (mi_parse): Add parsing of "--language" command option.

        * NEWS: Add entry mentioning the new "--language" command option.

gdb/testsuite/ChangeLog:

        * gdb.mi/mi-language.exp: New file.

gdb/doc/ChangeLog:

        * gdb.texinfo (Show): Add xref anchor for "show language" command.
        (Context management): Place current subsection text into its own
        subsubsection.  Add new subsubsection describing the "--language"
        command option.
2013-11-14 14:36:18 +04:00
Yao Qi 87967e273f gdb/
* mi/mi-cmd-var.c (mi_no_values, mi_simple_values): Move to
	mi-parse.c.  Make them static.
	(mi_all_values): Likewise.
	(mi_parse_values_option): Move to mi-parse.c.  Rename it to
	mi_parse_print_values.  Make it external.
	* mi/mi-cmds.h (mi_no_values, mi_simple_values, mi_all_values):
	Remove the declarations.
	* mi/mi-parse.c (mi_parse_print_values): Moved from mi-cmd-var.c.
	* mi/mi-parse.h (mi_parse_print_values): Declare.
	* mi/mi-cmd-stack.c: Include mi-parse.h.
	(parse_print_values): Remove
	(mi_cmd_stack_list_locals): Call mi_parse_print_values instead
	of parse_print_values.
	(mi_cmd_stack_list_args, mi_cmd_stack_list_variables): Likewise.
2013-06-03 03:16:24 +00:00
Keith Seitz ee0475543f * mi/mi-cmds.h (mi_execute_command): Make "cmd" const.
* mi/mi-interp.c (mi_interpreter_exec): Make "command" const.
	Remove temporary copy of input string.
	(mi_execute_command_wrapper): Make "cmd" const.
	* mi/mi-main.c (mi_execute_command): Make "string_ptr" const.
	* mi/mi-parse.c (mi_parse_argv): Make "args" const.
	Use const strings.
	(mi_parse): Make "cmd" const.
	Use const strings.
	* mi/mi-parse.h (mi_parse): Make "cmd" const.
2013-03-12 18:50:39 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:33:28 +00:00
Stan Shebs 2b03b41d6a * mi/mi-cmd-break.c: Enforce coding standards, fix comments.
* mi/mi-cmd-disas.c: Ditto.
	* mi/mi-cmd-env.c: Ditto.
	* mi/mi-cmd-file.c: Ditto.
	* mi/mi-cmd-stack.c: Ditto.
	* mi/mi-cmd-target.c: Ditto.
	* mi/mi-cmd-var.c: Ditto.
	* mi/mi-cmds.c: Ditto.
	* mi/mi-cmds.h: Ditto.
	* mi/mi-console.c: Ditto.
	* mi/mi-getopt.c: Ditto.
	* mi/mi-getopt.h: Ditto.
	* mi/mi-interp.c: Ditto.
	* mi/mi-main.c: Ditto.
	* mi/mi-out.c: Ditto.
	* mi/mi-parse.c: Ditto.
	* mi/mi-parse.h: Ditto.
	* mi/mi-symbol-cmds.c: Ditto.

	* mi/mi-getopt.h: Move mi_opt struct up.
	* mi/mi-main.c (captured_mi_execute_command): Remove redundant
	return.
	* mi/mi-out.c (_initialize_mi_out): Remove empty initialize.
2012-03-06 22:48:53 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
Tom Tromey 305aeedc41 gdb
* mi/mi-parse.h (mi_parse): Update.
	* mi/mi-parse.c (mi_parse_cleanup): New function.
	(mi_parse): Add 'token' argument.  Throw exception on error.
	* mi/mi-main.c (mi_print_exception): New function.
	(mi_execute_command): Use mi_print_exception.  Catch exceptions
	from mi_parse.
gdb/testsuite
	* gdb.base/interp.exp: Add regression test.
2010-12-09 19:23:49 +00:00
Vladimir Prus a79b8f6ea8 Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*.
	* inferior.c (add_inferior_silent): Notify inferior_added
	observer.
	(delete_inferior_1): Notify inferior_removed observer.
	(exit_inferior_1): Pass inferior, not pid, to observer.
	(inferior_appeared): Likewise.
	(add_inferior_with_spaces): New.
	(add_inferior_command): Use the above.
	* inferior.h (delete_inferior_1, add_inferior_with_spaces):
	Declare.

	* inflow.c (inflow_inferior_exit): Likewise.
	* jit.c (jit_inferior_exit_hook): Likewise.

	* mi/mi-cmds.c (mi_cmds): Register add-inferior and
	remove-inferior.
	* mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
	* mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New.
	(report_initial_inferior): New.
	(mi_inferior_removed): Register the above. Make sure
	inferior_added observer is called on the first inferior.
	(mi_new_thread, mi_thread_exit): Thread group is now identified by
	inferior number, not pid.
	(mi_solib_loaded, mi_solib_unloaded): Report which inferiors are
	affected.
	* mi/mi-main.c (current_context): New.
	(proceed_thread_callback): Use typed closure.
	Proceed everything if pid is 0. Most implementation split into
	(proceed_thread): ... this.
	(run_one_inferior): New.
	(mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run):
	Adjust for multiexec behaviour.
	(mi_cmd_add_inferior, mi_cmd_remove_inferior): New.
	(mi_cmd_execute): Handle the 'thread-group' option here.
	Do some extra checks.
	* mi-parse.c (mi_parse): Handle the --all and --thread-group
	options.
	* mi-parse.h (struct mi_parse): New fields all and thread_group.
2010-02-24 07:51:46 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Vladimir Prus 1e92afda99 Implement --thread and --frame.
* gdbthread.h (find_thread_id): Declare.
        * thread.c (find_thread_id): Make non-static.
        * mi/mi-main.c (mi_cmd_execute): Switch to the right
        thread and frame, if necessary.
        * mi/mi-parse.c (mi_parse): Handle --thread and --frame.
        * mi/mi-parse.h (strcut mi_parse): New fields thread and frame.
2008-07-12 16:37:57 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Daniel Jacobowitz 6a089cf2be * mi/mi-parse.h: Include <sys/time.h>. 2007-02-05 13:22:20 +00:00
Nick Roberts d8c83789e9 * mi/mi-main.c: Include <sys/resource.h> if present.
(rusage): Declare if HAVE_GETRUSAGE.
(current_command_ts, do_timings): New static variables.
(timestamp, print_diff_now, print_diff, timeval_diff):
New static timing functions.
(mi_cmd_enable_timings): New function for new MI command.
(captured_mi_execute_command, mi_execute_async_cli_command):
Call timing functions.

* mi/mi-cmds.c (mi_cmds): Add entry for new MI command
-enable-timings.

* mi/mi-cmds.h (mi_cmd_enable_timings): New extern.

* mi/mi-parse.h: (mi_timestamp): New structure.
(mi_parse): Add mi_timestamp* member.
2007-02-02 23:01:27 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Eli Zaretskii 1caae1650b * mi/mi-symbol-cmds.c:
* mi/mi-parse.h:
	* mi/mi-parse.c:
	* mi/mi-out.h:
	* mi/mi-out.c:
	* mi/mi-main.h:
	* mi/mi-main.c:
	* mi/mi-interp.c:
	* mi/mi-getopt.h:
	* mi/mi-getopt.c:
	* mi/mi-console.h:
	* mi/mi-console.c:
	* mi/mi-common.h:
	* mi/mi-common.c:
	* mi/mi-cmds.h:
	* mi/mi-cmds.c:
	* mi/mi-cmd-var.c:
	* mi/mi-cmd-stack.c:
	* mi/mi-cmd-file.c:
	* mi/mi-cmd-env.c:
	* mi/mi-cmd-disas.c:
	* mi/mi-cmd-break.c: Add (C) after Copyright.  Update the FSF
	address.
2005-12-23 18:57:46 +00:00
Kevin Buettner b6ba6518e9 Update/correct copyright notices. 2001-03-06 08:22:02 +00:00
Andrew Cagney 10adc9b50e Rename mi/ChangeLog-mi -> mi/ChangeLog 2000-05-16 05:07:53 +00:00
Andrew Cagney ab91fdd5f8 Fix copyright - Cygnus is a Red Hat company. 2000-02-23 06:19:22 +00:00
Andrew Cagney fb40c20903 Add mi/ and testsuite/gdb.mi/ subdirectories.
Add --enable-gdbmi option to configury.
Add mi rules to Makefile.in
Add mi conditional output to event-top.c infrun.c main.c top.c.
Add -i=mi option.
2000-02-23 00:25:43 +00:00