Commit Graph

20341 Commits

Author SHA1 Message Date
Tom Tromey 4db1a1dc03 change gdb to use BFD's "dwz" functions
BFD recently got a few functions related to "dwz" files.  This patch
changes gdb to use them, just to share a bit more code.

This changes dwarf2_get_dwz_file to possibly return NULL.  This
simplified a bit of code elsewhere.

Built and regtested on x86-64 Fedora 18.  I specifically regtested it
using my pending dwz test case.

	* dwarf2read.c (dwarf2_get_dwz_file): Return NULL if
	.gnu_debugaltlink not found.  Use bfd_get_alt_debug_link_info.
	(dwarf2_read_index, create_all_comp_units): Update.
2013-07-01 19:55:17 +00:00
Tom Tromey dd9aa0484e add -Wold-style-definition
This adds -Wold-style-definition to gdb's list of warnings.  This
found a couple of spots where "()" was used where "(void)" is more
correct.

Tested by rebuilding on x86-64 Fedora 18.

	* configure.ac (build_warnings): Add -Wold-style-definition.
	* configure: Rebuild.
	* machoread.c (_initialize_machoread): Use "(void)".
	* macrocmd.c (macro_inform_no_debuginfo): Fix formatting;
	use "(void)".
2013-07-01 19:52:32 +00:00
Tom Tromey 44d100c3b9 add -Wold-style-declaration
This adds -Wold-style-declaration to gdb's list of warnings.

It turns out that a few places use "const static" rather than
"static const".  The former is deprecated according to the C standard.

Tested by rebuilding with --enable-targets=all on x86-64 Fedora 18.

	* configure.ac (build_warnings): Add -Wold-style-declaration.
	* configure: Rebuild.
	* dsrec.c (make_srec): Use "static const", not "const static".
	* h8300-tdep.c (h8300_breakpoint_from_pc): Use "static const",
	not "const static".
	* mi/mi-parse.c (mi_no_values, mi_simple_values, mi_all_values):
	Use "static const", not "const static".
	* mn10300-tdep.c (mn10300_breakpoint_from_pc): Use "static const",
	not "const static".
	* moxie-tdep.c (moxie_breakpoint_from_pc): Use "static const",
	not "const static".
	* rs6000-tdep.c (rs6000_breakpoint_from_pc): Use "static const",
	not "const static".
	* v850-tdep.c (v850_breakpoint_from_pc): Use "static const",
	not "const static".
	(v850_dbtrap_breakpoint_from_pc): Likewise.
	* xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Use "static const",
	not "const static".
2013-07-01 19:50:11 +00:00
Tom Tromey 2945b8076c add -Wmissing-parameter-type
This adds -Wmissing-parameter-type to gdb's list of warnings.

This one doesn't happen to trigger for a --enable-targets=all build on
x86-64 Fedora 18.

	* configure.ac (build_warnings): Add -Wmissing-parameter-type.
	* configure: Rebuild.
2013-07-01 19:48:05 +00:00
Pedro Alves d8d2a3ee47 Normalize on PATH_MAX instead of MAXPATHLEN throughout.
With the pathmax gnulib module in place, we can use PATH_MAX
consistently throughout, instead of the current mixbag of PATH_MAX and
MAXPATHLEN uses.  It's no longer necessary to include sys/param.h
(supposedly, I can't check all ports touched here) for MAXPATHLEN.

Don't remove sys/param.h from GDB's configure.ac, as later tests in
the file use HAVE_SYS_PARAM_H checks.

Tested on x86_64 Fedora 17.

Also cross-built for --host=i686-w64-mingw32, and --host=i586-pc-msdosdjgpp.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* defs.h: Include "pathmax.h".
	* utils.c: Don't include sys/param.h.
	(gdb_realpath): Remove code that checks for MAXPATHLEN.
	* solib-ia64-hpux.c (ia64_hpux_handle_load_event): Use PATH_MAX
	instead of MAXPATHLEN.
	* solib-sunos.c: Don't include sys/param.h.
	* xcoffread.c: Don't include sys/param.h.
	* bsd-kvm.c: Don't include sys/param.h.
	* darwin-nat.c: Don't include sys/param.h.
	(darwin_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN.
	* darwin-nat-info.c: Don't include sys/param.h.
	* fbsd-nat.c (fbsd_pid_to_exec_file): Use PATH_MAX instead of
	MAXPATHLEN.
	* i386obsd-nat.c: Don't include sys/param.h.
	* inf-child.c: Don't include sys/param.h.
	(inf_child_fileio_readlink): Use PATH_MAX instead of MAXPATHLEN.
	* linux-fork.c: Don't include sys/param.h.
	(fork_save_infrun_state): Use PATH_MAX instead of MAXPATHLEN.
	* linux-nat.c: Don't include sys/param.h.
	(linux_child_pid_to_exec_file, linux_proc_pending_signals)
	(linux_proc_pending_signals): Use PATH_MAX instead of MAXPATHLEN.
	* m68klinux-nat.c: Don't include sys/param.h.
	* nbsd-nat.c: Don't include sys/param.h.
	(nbsd_pid_to_exec_file): Use PATH_MAX instead of MAXPATHLEN.
	* ppc-linux-nat.c: Don't include sys/param.h.
	* rs6000-nat.c: Don't include sys/param.h.
	* spu-linux-nat.c. Don't include sys/param.h.
	* windows-nat.c: Don't include sys/param.h.
	* xtensa-linux-nat.c: Don't include sys/param.h.
	* config/i386/nm-fbsd.h: Don't include sys/param.h.

gdb/gdbserver/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* server.h: Include "pathmax.h".
	* linux-low.c: Don't include sys/param.h.
	(linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
	MAXPATHLEN.
	* win32-low.c: Don't include sys/param.h.
	(win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
2013-07-01 11:28:30 +00:00
Pedro Alves 38ec22075a Import the "pathmax" gnulib module.
This imports the "pathmax" gnulib module, making PATH_MAX always
available on systems that have the notion of a constant max path limit
(i.e., practically everywhere except the Hurd), along with fixing a
couple broken systems --- see pathmax.h in the patch.

This means we can normalize on PATH_MAX throughout the tree (instead
of some places using MAXPATHLEN, or defining fallback constants
ourselves).

This is the just the importing step.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add pathmax.
	* gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/pathmax.m4.
	* gnulib/aclocal.m4: Regenerate.
	* gnulib/config.in: Regenerate.
	* gnulib/configure: Regenerate.
	* gnulib/import/pathmax.h: New file.
	* gnulib/import/Makefile.am: Regenerate.
	* gnulib/import/Makefile.in: Regenerate.
	* gnulib/import/m4/gnulib-cache.m4: Regenerate.
	* gnulib/import/m4/gnulib-comp.m4: Regenerate.
	* gnulib/import/m4/pathmax.m4: New file.
2013-07-01 11:25:43 +00:00
Pedro Alves e655c1a2f5 Reimplement DJGPP's .gdbinit -> gdb.ini renaming.
This simplifies the .gdbinit filename selection logic.

We have a GDBINIT_FILENAME define that supposedly configurations would
override, but none do so.  Instead, the only configuration that wants
a different file name instead of ".gdbinit", djgpp, does a strcpy over
the gdbinit global array.  This means the array needs to be sized, and
the code that does that is doing the usual
'PATH_MAX/FILENAME_MAX/fallback constant/etc.' mess.

Instead of all that, it's much simpler to have configure specificy the
.gdbinit filename.  As bonus, we can then make the "gdbinit" global
array const.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* configure.ac (GDBINIT): Define, depending on host.
	* go32-nat.c (init_go32_ops): Don't override gdbinit here.
	* top.c (PATH_MAX): Delete fallback definition.
	(GDBINIT_FILENAME): Delete.
	(gdbinit): Reimplement as const char array set to the GDBINIT
	string constant.
	* top.h (gdbinit): Make const.
2013-07-01 11:24:17 +00:00
Pedro Alves 50dd979345 Constify main.c:get_init_files.
A following patch will want to make the "gdbinit" global array const.
As usual, that forces in a cascading series of const additions.  This
patch preemptively does those.  I went all the way up to constifying
catch_command_errors, but then that would require constifying
execute_command as well (which is a much more significant effort).  So
as stop point, I found the cleanest would be to add a variant of
catch_command_errors that takes const args, and use that in the few
spots that needed it due to the the get_init_files constification.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* cli/cli-cmds.c (source_script): Make 'file' parameter const.
	* cli/cli-cmds.h (source_script): Likewise.
	* exceptions.c (catch_command_errors_const): New function.
	* exceptions.h (catch_command_errors_const): Declare.
	* main.c (get_init_files): Make parameters const, and adjust.
	(captured_main): Make 'system_gdbinit', 'home_gdbinit' and
	'local_gdbinit' locals const.  Adjust to use
	catch_command_errors_const.
	(print_gdb_help): Make 'system_gdbinit', 'home_gdbinit' and
	'local_gdbinit' locals const.
2013-07-01 11:22:12 +00:00
Pedro Alves bc7dea8de9 Rely on gnulib's unistd.h replacement.
With gnulib's unistd module, we can assume unistd.h is always present, and that
STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO are always defined.

Don't remove unistd.h from GDB's configure.ac, as later tests in the
file use HAVE_UNISTD_H checks.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* defs.h: Don't check HAVE_UNISTD_H before including <unistd.h>.
	(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete.
	* tracepoint.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.

gdb/gdbserver/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* event-loop.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.
	* gdbreplay.c: Likewise.
	* remote-utils.c: Likewise.
	* server.c: Likewise.
	* configure.ac: Don't check for unistd.h.
	* configure: Regenerate.
2013-07-01 11:19:27 +00:00
Pedro Alves 8839a007ad Import the "unistd" gnulib module.
I wanted to import the pathmax module, and that pulls in the unistd
module as dependency.  The unistd module is actually bigger than the
pathmax module.  If we're going to end up with it, might as well
import it explicitly, and make use of it throughout.

The "unistd" module makes a GNU-like <unistd.h> always available.
This means we no longer need to do:

 +#ifdef HAVE_UNISTD_H
  #include <unistd.h>
 +#endif

and we can remove a few constants from defs.h.

This is just the importing step.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	Import the "unistd" gnulib module.
	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add "unistd".
	* gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/off_t.m4,
	import/m4/ssize_t.m4, import/m4/sys_types_h.m4 and
	import/m4/unistd_h.m4.
	* gnulib/aclocal.m4: Renenerate.
	* gnulib/config.in: Renenerate.
	* gnulib/configure: Renenerate.
	* gnulib/import/Makefile.am: Renenerate.
	* gnulib/import/Makefile.in: Renenerate.
	* gnulib/import/m4/gnulib-cache.m4: Renenerate.
	* gnulib/import/m4/gnulib-comp.m4: Renenerate.
	* gnulib/import/m4/off_t.m4: New file.
	* gnulib/import/m4/ssize_t.m4: New file.
	* gnulib/import/m4/sys_types_h.m4: New file.
	* gnulib/import/m4/unistd_h.m4: New file.
	* gnulib/import/sys_types.in.h: New file.
	* gnulib/import/unistd.c: New file.
	* gnulib/import/unistd.in.h: New file.
2013-07-01 11:18:09 +00:00
Pedro Alves 8c0da261b5 utils.c: pathconf call, check for _PC_PATH_MAX instead of HAVE_UNISTD_H.
This check in utils.c for HAVE_UNISTD_H is being used as proxy for
"HAVE_PATHCONF", as pathconf is supposed to be declared in unistd.h.

It's possible that there are systems out there that have realpath,
unistd.h and alloca, but not pathconf+_PC_PATH_MAX.  I don't know of
any by heart, but if we import gnulib's unistd module (which a
following patch will do), then unistd.h ends up always available, so
the check ends up incorrect.  As pathconf is being called with
_PC_PATH_MAX, check for that instead.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* utils.c <pathconf/_PC_PATH_MAX use>: Check if _PC_PATH_MAX is
	defined instead of checking HAVE_UNISTD_H.
2013-07-01 11:15:39 +00:00
Pedro Alves 3574124b5f Reimport gnulib from scratch.
Moving aside gnulib/import/, and re-running our
gnulib/update-gnulib.sh script, surprisingly, one gets a different
result compared to what's in the tree.  This is with pristine FSF
autoconf and FSF automake, at the versions required by
update-gnulib.sh.  However, if one just runs the update-gnulib.sh
scripts against the _existing_ tree, then nothing changes...  I
suspect gnulib-tool's merge logic might be preserving some things by
design.  This gets rid of cruft that might have accumulated over
gnulib updates.  onceonly.m4 seems to fit in that category.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	Reimport gnulib from scratch.
	* gnulib/Makefile.in (aclocal_m4_deps): Remove reference to
	import/m4/onceonly.m4.
	* gnulib/aclocal.m4: Renegerate.
	* gnulib/config.in: Renegerate.
	* gnulib/configure: Renegerate.
	* gnulib/import/Makefile.in: Renegerate.
	* gnulib/import/extra/update-copyright: Renegerate.
	* gnulib/import/m4/onceonly.m4: Delete.
2013-07-01 11:14:42 +00:00
Pedro Alves 702dc4fd25 Delete pagination_enabled extern declaration in tui/tui-regs.c.
It's declared in utils.h.

gdb/
2013-07-01  Pedro Alves  <palves@redhat.com>

	* tui/tui-regs.c (pagination_enabled): Delete declaration.
2013-07-01 10:09:27 +00:00
Jan Kratochvil 47e1ce27f4 gdb/
Code cleanup.
	* remote.c (async_remote_interrupt_twice): Make it static.
	* remote.h (async_remote_interrupt_twice): Remove the declaration.
2013-06-30 17:14:59 +00:00
Sergio Durigan Junior e82839d425 This patch implements the support for SystemTap SDT probes on IA-64.
Joel Brobecker reported a bug which was happening because of the
"Improved linker-debugger interface", by Gary Benson, when tested on
IA-64 with rhES5.  The message is:

<http://sourceware.org/ml/gdb-patches/2013-06/msg00745.html>

The failure happened because GDB was trying to parse the probes'
operands using only the generic parser (implemented on stap-probe.c),
because the arch-specific parser was not implemented.  Thus, I am
committing the following changes which solve the bug.

2013-06-29  Sergio Durigan Junior  <sergiodj@redhat.com>

	* ia64-linux-tdep.c: Include <ctype.h>.
	(ia64_linux_stap_is_single_operand): New function.
	(ia64_linux_init_abi): Initialize SystemTap related attributes.
2013-06-30 00:35:39 +00:00
Tom Tromey d6c2da5446 move version.in from gdb/common back to gdb
This reverts part of the earlier version.in change.  It moves
version.in back to the gdb directory.  This works around the CVS bug
we've found.

gdb
	* Makefile.in (version.c): Use version.in, not
	common/version.in.
	* common/create-version.sh: Likewise.
	* common/version.in: Move...
	* version.in: ...here.
gdb/doc
	* Makefile.in (version.subst): Use version.in, not
	common/version.in.
	* gdbint.texinfo (Versions and Branches, Releasing GDB):
	Likewise.
gdb/gdbserver
	* Makefile.in (version.c): Use version.in, not
	common/version.in.
sim/common
	* Make-common.in (version.c): Use version.in, not
	common/version.in.
	* create-version.sh: Likewise.
sim/ppc:
	* Make-common.in (version.c): Use version.in, not
	common/version.in.
2013-06-28 18:59:51 +00:00
Pedro Alves 74da6f00a3 Move pagination_enabled declaration to a proper place.
Declare it close to other related declarations in utils.h, and remove
local extern declaration hack.

gdb/
2013-06-28  Pedro Alves  <palves@redhat.com>

	* infrun.c (set_observer_mode): Don't declare pagination_enabled
	here.
	* utils.h (pagination_enabled): Declare.
2013-06-28 17:19:39 +00:00
Pedro Alves d32dc48ed4 infrun.c: Move non_stop_1 etc., higher up in file.
The "non_stop_1" global is out of place, mixed with the observer bits.
This moves all the non-stop user-interface-related bits together.

gdb/
2013-06-28  Pedro Alves  <palves@redhat.com>

	* infrun.c (non_stop, non_stop_1, set_non_stop, show_non_stop):
	Move higher up in file.
2013-06-28 17:06:14 +00:00
Tom Tromey 0edd9e3b86 * tracepoint.c (deprecated_readline_begin_hook)
(deprecated_readline_hook, deprecated_readline_end_hook): Don't
	declare.
2013-06-28 14:23:11 +00:00
Pedro Alves 4eb5910882 [PR tui/14880] Fetch values before comparing their contents.
PR tui/14880 shows a reproducer that triggers this assertion:

  int
  value_available_contents_eq (const struct value *val1, int offset1,
  			     const struct value *val2, int offset2,
  			     int length)
  {
    int idx1 = 0, idx2 = 0;

    /* This routine is used by printing routines, where we should
       already have read the value.  Note that we only know whether a
       value chunk is available if we've tried to read it.  */
    gdb_assert (!val1->lazy && !val2->lazy);

(top-gdb) bt
#0  internal_error (file=0x88a26c "../../src/gdb/value.c", line=549, string=0x88a220 "%s: Assertion `%s' failed.") at ../../src/gdb/utils.c:844
#1  0x000000000057b9cd in value_available_contents_eq (val1=0x10fa900, offset1=0, val2=0x10f9e10, offset2=0, length=8) at ../../src/gdb/value.c:549
#2  0x00000000004fd756 in tui_get_register (frame=0xd5c430, data=0x109a548, regnum=0, changedp=0x109a560) at ../../src/gdb/tui/tui-regs.c:736
#3  0x00000000004fd111 in tui_check_register_values (frame=0xd5c430) at ../../src/gdb/tui/tui-regs.c:521
#4  0x0000000000501884 in tui_check_data_values (frame=0xd5c430) at ../../src/gdb/tui/tui-windata.c:234
#5  0x00000000004f976f in tui_selected_frame_level_changed_hook (level=1) at ../../src/gdb/tui/tui-hooks.c:222
#6  0x00000000006f0681 in select_frame (fi=0xd5c430) at ../../src/gdb/frame.c:1490
#7  0x00000000005dd94b in up_silently_base (count_exp=0x0) at ../../src/gdb/stack.c:2268
#8  0x00000000005dd985 in up_command (count_exp=0x0, from_tty=1) at ../../src/gdb/stack.c:2280
#9  0x00000000004dc5cf in do_cfunc (c=0xd3f720, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:113
#10 0x00000000004df664 in cmd_func (cmd=0xd3f720, args=0x0, from_tty=1) at ../../src/gdb/cli/cli-decode.c:1888
#11 0x00000000006e43e1 in execute_command (p=0xc7e6c2 "", from_tty=1) at ../../src/gdb/top.c:489

The fix is to fetch the value before comparing the contents.  The
comment additions to value.h explain why it can't be
value_available_contents_eq itself that fetches the contents.

Tested on x86_64 Fedora 17.

gdb/
2013-06-28  Pedro Alves  <palves@redhat.com>

	PR tui/14880
	* tui/tui-regs.c (tui_get_register): Fetch register value contents
	before checking whether they're available.
	* value.c (value_available_contents_eq): Change comment.
	* value.h (value_available_contents_eq): Expand comment.
2013-06-28 12:36:48 +00:00
Tom Tromey 97b1715633 * target.c (find_run_target): Remove.
* target.h (find_run_target): Remove.
2013-06-27 19:52:41 +00:00
Tom Tromey 6a3bfc5cda * corelow.c (core_gdbarch): Now static. 2013-06-27 19:38:55 +00:00
Tom Tromey c9ef825d2e * target.c (target_struct_index): Remove. 2013-06-27 19:38:24 +00:00
Pedro Alves e5823f1cb5 Move comment on the 'stepping over resolver' mechanism to the internals manual.
This whole comment is now a bit out of place.  I looked into moving it
to handle_inferior_event, close to where in_solib_dynsym_resolve_code
is used, but then there are 3 such places.  I then looked at
fragmenting it, pushing bits closer to the definitions of
in_solib_dynsym_resolve_code and gdbarch_skip_solib_resolver, but then
we'd lose the main advantage which is the overview.  In the end, I
realized this can fit nicely as internals manual material.

This could possibly be a subsection of a new "run control", or "source
stepping" or "stepping" or some such a bit more general section, but
we can do that when we have more related content...  Even the "single
stepping" section is presently empty...

gdb/doc/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* gdbint.texinfo (Algorithms) <Stepping over runtime loader
	dynamic symbol resolution code>: New section, based on infrun.c
	comment.

gdb/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* infrun.c: Remove comment describing the 'stepping over runtime
	loader dynamic symbol resolution code' mechanism; moved to
	gdbint.texinfo.
2013-06-27 19:17:27 +00:00
Pedro Alves 97f8dd0980 Fix catch_command_errors's prototype.
gdb/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* exceptions.c (catch_command_errors): Remove spurious space.
	* exceptions.h (catch_command_errors): Second parameter is "arg",
	not "command".
2013-06-27 17:53:40 +00:00
Yao Qi 02b1871e58 gdb/
* common/create-version.sh: Update comments.  Handle the case
	that TARGET_ALIAS is empty.
2013-06-27 00:12:13 +00:00
Pedro Alves bb1b1cf1c7 Garbage collect SOLIB_IN_DYNAMIC_LINKER.
This hasn't been used for years.

gdb/
2013-06-26  Pedro Alves  <palves@redhat.com>

	* infrun.c (SOLIB_IN_DYNAMIC_LINKER): Delete macro and describing
	comment.
2013-06-26 21:38:23 +00:00
Pedro Alves 7b624e7136 Update comments on stepping over resolver code.
This updates the comments on the step-over-resolver mechanism a bit,
adjusting it to refer to the gdbarch hooks instead of the old macros;
to mention the in_dynsym_resolve_code hook of the target_so_ops
vector; and to American English spelling (signalling->signaling).

gdb/
2013-06-26  Pedro Alves  <palves@redhat.com>

	* infrun.c: Update comments on stepping over runtime loader
	dynamic symbol resolution code.
2013-06-26 21:37:53 +00:00
Sergio Durigan Junior 74e5a34656 I found this issue when I was debugging something else on IA-64. Both
ax-gdb.h and parser-defs.h could be made more self-contained by forward
declaring types or including the necessary header files.  This commit does
this.

2013-06-26  Sergio Durigan Junior  <sergiodj@redhat.com>

	* ax-gdb.h (union exp_element): Forward declare.
	* parser-defs.h: Include expression.h.
2013-06-26 17:22:52 +00:00
Maciej W. Rozycki a2fb2cee96 * mips-tdep.c (fetch_mips_16): Use unmake_compact_addr. 2013-06-26 15:37:49 +00:00
Dmitry Kozlov cdba14e0bf Extend tsave to save starttime, stoptime. 2013-06-26 15:17:59 +00:00
Dmitry Kozlov f30aa5affe Fix trace-status to output proper start-time and stop-time. 2013-06-26 15:14:39 +00:00
Maciej W. Rozycki 1aee363c16 * mips-tdep.c (mips_next_pc): Fix a typo. 2013-06-26 15:10:33 +00:00
Maciej W. Rozycki 3356937a9d * mips-tdep.c (micromips_scan_prologue): Fix a typo. 2013-06-26 15:00:10 +00:00
Yao Qi dc673c81ae gdb/
2013-06-26  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* gdb.texinfo (GDB/MI Tracepoint Commands): Document
	-trace-frame-collected.
gdb:

2013-06-26  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* mi/mi-cmds.c (mi_cmds): Register -trace-frame-collected.
	* mi/mi-cmds.h (mi_cmd_trace_frame_collected): Declare.
	* mi/mi-main.c (print_variable_or_computed): New function.
	(mi_cmd_trace_frame_collected): New function.
	* tracepoint.c (find_trace_state_variable_by_number): New.
	(struct traceframe_info): Move to tracepoint.h
	(struct collection_list): Likewise.
	(do_collect_symbol): Include locals and arguments in the wholly
	collected variables list.
	(clear_collection_list): Clear wholly collected variables list
	and computed variables list.
	(append_exp): New function.
	(encode_actions_1): Include variables in the wholly
	collected variables list.  Include memory ranges and
	full-fledged expressions in the computed expressions list.
	(encode_actions): Move some code to ...
	Return the cleanup chain.
	(encode_actions_rsp): ... here.  New function.
	(get_traceframe_location, get_traceframe_info): Remove static.
	* tracepoint.h (struct memrange): Moved	from tracepoint.c.
	(struct collection_list): Moved from tracepoint.c.  Add two
	new fields 'wholly_collected' and 'computed'.
	(find_trace_state_variable_by_number): Declare.
	(encode_actions): Adjust declaration.
	(encode_actions_rsp): Declare.
	(get_traceframe_info, get_traceframe_location): Declare.

	* NEWS: Mention new MI command -trace-frame-collected.
2013-06-26 08:17:27 +00:00
Yao Qi 28a9351183 gdb/
2013-06-26  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* ctf.c (ctf_traceframe_info): Push trace state variables
	present in the trace data into the traceframe info object.
	* breakpoint.c (DEF_VEC_I): Remove.
	* common/filestuff.c (DEF_VEC_I): Likewise.
	* dwarf2loc.c (DEF_VEC_I): Likewise.
	* mi/mi-main.c (DEF_VEC_I): Likewise.
	* common/gdb_vecs.h (DEF_VEC_I): Define vector for int.
	* features/traceframe-info.dtd: Add tvar element and its
	attributes.
	* tracepoint.c (free_traceframe_info): Free vector 'tvars'.
	(build_traceframe_info): Push trace state variables present in the
	trace data into the traceframe info object.
	(traceframe_info_start_tvar): New function.
	(tvar_attributes): New.
	(traceframe_info_children): Add "tvar" element.
	* tracepoint.h (struct traceframe_info) <tvars>: New field.

	* NEWS: Mention the change in GDB and GDBserver.

gdb/doc:

2013-06-26  Pedro Alves  <pedro@codesourcery.com>

	* gdb.texinfo (Traceframe Info Format): Document tvar element and
	its attributes.

gdb/gdbserver:

2013-06-26  Pedro Alves  <pedro@codesourcery.com>

	* tracepoint.c (build_traceframe_info_xml): Output trace state
	variables present in the trace buffer.
2013-06-26 08:01:57 +00:00
Yao Qi ddacd3c8e9 gdb/
2013-06-26  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (trace_dump_command): Move code to ...
	(get_traceframe_location): ... here.  New.
2013-06-26 05:35:45 +00:00
Yao Qi 05796b355f gdb/
2013-06-26  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (trace_dump_command): GDB emits an error
	 instead of a warning when a traceframe is not selected.
2013-06-26 05:28:01 +00:00
Yao Qi cbfa3b6104 gdb/
2013-06-26  Pedro Alves  <pedro@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (tracepoint_list, stepping_list): Remove.
	(clear_collection_list): Free fields 'aexpre_list' and 'list'
	in collection_list.
	(do_clear_collection_list, init_collection_list): New.
	(encode_actions): Add local variables 'tracepoint_list' and
	'stepping_list'.  Call init_collection_list and make cleanup
	which calls do_clear_collection_list.  Don't call
	clear_collection_list.
	(_initialize_tracepoint): Delete references to
	'tracepoint_list' and 'stepping_list'.
2013-06-26 05:25:28 +00:00
Tom Tromey 6e2048d3e3 * common/create-version.sh (date): Use "$", not "$$" in sed
expression.
2013-06-25 16:04:54 +00:00
Kevin Buettner 42059f0ed0 * NEWS (New targets): Add entry for TI MSP430. 2013-06-25 15:55:12 +00:00
Yao Qi a0743c90c7 Upload tsv earlier in remote_start_remote
In extended-remote, when GDB connects the target, but target is not
running, the TSVs are not uploaded.  When GDB attaches to a process,
the TSVs are not uploaded either.  However, GDBserver has some
builtin or predefined TSV to upload, such as $trace_timestamp.  This
bug causes $trace_timestamp is never uploaded.

gdb/

2013-06-25  Yao Qi  <yao@codesourcery.com>

        * remote.c (remote_start_remote): Move code to upload tsv
        earlier.

gdb/testsuite/

2013-06-25  Yao Qi  <yao@codesourcery.com>

	* boards/native-extended-gdbserver.exp: Set board_info
	'gdb,predefined_tsv'.
	* boards/native-gdbserver.exp: Likewise.
	* boards/native-stdio-gdbserver.exp: Likewise.
	* gdb.server/ext-attach.exp: Load trace-support.exp.  Check
	uploaded TSVs if target supports tracing.
	* gdb.trace/tsv.exp: Check uploaded TSVs if target supports
	tracing and target has predefined tsv.

gdb/doc/

2013-06-25  Yao Qi  <yao@codesourcery.com>

	* gdbint.texinfo (Testsuite): Document 'gdb,predefined_tsv'.
2013-06-25 13:01:28 +00:00
Hui Zhu 9d6e6e84f7 2013-06-25 Yao Qi <yao@codesourcery.com>
Hui Zhu  <hui@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	PR breakpoints/15075
	PR breakpoints/15434
	* breakpoint.c (bpstat_stop_status): Call
	b->ops->after_condition_true.
	(update_dprintf_command_list): Don't append "continue" command
	to the command list of dprintf breakpoint.
	(base_breakpoint_after_condition_true): New function.
	(base_breakpoint_ops): Add base_breakpoint_after_condition_true.
	(dprintf_after_condition_true): New function.
	(initialize_breakpoint_ops): Set dprintf_after_condition_true.
	* breakpoint.h (breakpoint_ops): Add after_condition_true.

2013-06-25  Yao Qi  <yao@codesourcery.com>
	    Hui Zhu  <hui@codesourcery.com>
	    Pedro Alves  <palves@redhat.com>

	PR breakpoints/15075
	PR breakpoints/15434
	* gdb.base/dprintf-next.c: New file.
	* gdb.base/dprintf-next.exp: New file.
	* gdb.base/dprintf-non-stop.c: New file.
	* gdb.base/dprintf-non-stop.exp: New file.
	* gdb.base/dprintf.exp: Don't check "continue" in the output
	of "info breakpoints".
	* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):
	Don't check "continue" in script field.
2013-06-25 11:37:48 +00:00
Kevin Buettner 586cf74920 * Makefile.in (ALL_TARGET_OBS): Add msp430-tdep.o.
(ALLDEPFILES): Add msp430-tdep.c.
	* configure.tgt (msp430*-*-elf): New target.
	* msp430-tdep.c: New file.
2013-06-25 01:16:31 +00:00
Maciej W. Rozycki 1bbce13264 bfd/
* elfxx-mips.h (_bfd_mips_elf_get_synthetic_symtab): New
	prototype.
	* elf32-mips.c (elf_backend_plt_sym_val): Remove macro.
	(bfd_elf32_get_synthetic_symtab): New macro.
	* elfxx-mips.c (plt_entry): New structure.
	(mips_elf_link_hash_entry): Add use_plt_entry member.
	(mips_elf_link_hash_table): Rename plt_entry_size member to
	plt_mips_entry_size.  Add plt_comp_entry_size, plt_mips_offset,
	plt_comp_offset, plt_got_index entries and plt_header_is_comp
	members.
	(STUB_LW_MICROMIPS, STUB_MOVE_MICROMIPS): New macros.
	(STUB_LUI_MICROMIPS, STUB_JALR_MICROMIPS): Likewise.
	(STUB_ORI_MICROMIPS, STUB_LI16U_MICROMIPS): Likewise.
	(STUB_LI16S_MICROMIPS): Likewise.
	(MICROMIPS_FUNCTION_STUB_NORMAL_SIZE): Likewise.
	(MICROMIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
	(micromips_o32_exec_plt0_entry): New variable.
	(mips16_o32_exec_plt_entry): Likewise.
	(micromips_o32_exec_plt_entry): Likewise.
	(mips_elf_link_hash_newfunc): Initialize use_plt_entry.
	(mips_elf_output_extsym): Update to use gotplt_union's plist
	member rather than offset.
	(mips_elf_gotplt_index): Likewise.  Remove the VxWorks
	restriction.  Use MIPS_ELF_GOT_SIZE to calculate GOT address.
	(mips_elf_count_got_symbols): Update to use gotplt_union's plist
	member rather than offset.
	(mips_elf_calculate_relocation): Handle MIPS16/microMIPS PLT
	entries.
	(_bfd_mips_elf_create_dynamic_sections): Don't set PLT sizes
	here.
	(mips_elf_make_plt_record): New function.
	(_bfd_mips_elf_check_relocs): Update comment.  Record occurences
	of JAL relocations that might need a PLT entry.
	(_bfd_mips_elf_adjust_dynamic_symbol): Update to use
	gotplt_union's plist member rather than offset.  Set individual
	PLT entry sizes here.  Handle MIPS16/microMIPS PLT entries.
	Don't set the symbol's value in the symbol table for PLT
	references here.  Don't set the PLT or PLT GOT section sizes
	here.
	(mips_elf_estimate_stub_size): Handle microMIPS stubs.
	(mips_elf_allocate_lazy_stub): Likewise.
	(mips_elf_lay_out_lazy_stubs): Likewise.  Define a _MIPS_STUBS_
	magic symbol.
	(mips_elf_set_plt_sym_value): New function.
	(_bfd_mips_elf_size_dynamic_sections): Set PLT header size and
	PLT and PLT GOT section sizes here.  Set the symbol values in
	the symbol table for PLT references here.  Handle microMIPS
	annotation of the _PROCEDURE_LINKAGE_TABLE_ magic symbol.
	(_bfd_mips_elf_finish_dynamic_symbol): Update to use
	gotplt_union's plist member rather than offset.  Handle
	MIPS16/microMIPS PLT entries.  Handle microMIPS stubs.
	(_bfd_mips_vxworks_finish_dynamic_symbol): Update to use
	gotplt_union's plist member rather than offset.  Use
	MIPS_ELF_GOT_SIZE to calculate GOT address.
	(mips_finish_exec_plt): Handle microMIPS PLT.  Return status.
	(_bfd_mips_elf_finish_dynamic_sections): Handle result from
	mips_finish_exec_plt.
	(_bfd_mips_elf_link_hash_table_create): Update to use
	gotplt_union's plist member rather than offset.
	(_bfd_mips_elf_get_synthetic_symtab): New function.

	include/elf/
	* mips.h (ELF_ST_IS_MIPS_PLT): Respect STO_MIPS16 setting.
	(ELF_ST_SET_MIPS_PLT): Likewise.

	gdb/
	* mips-tdep.c (mips_elf_make_msymbol_special): Handle MIPS16 and
	microMIPS synthetic symbols.

	ld/
	* emulparams/elf32btsmip.sh: Arrange for .got.plt to be placed
	as close to .plt as possible.
	* scripttempl/elf.sc: Handle $INITIAL_READWRITE_SECTIONS and
	$PLT_NEXT_DATA variables.

	ld/testsuite/
	* ld-mips-elf/jalx-2.dd: Update for microMIPS PLT support.
	* ld-mips-elf/pic-and-nonpic-3a.dd: Update for the _MIPS_STUBS_
	magic symbol.
	* ld-mips-elf/pic-and-nonpic-3b.dd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6-n32.dd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6-n64.dd: Likewise.
	* ld-mips-elf/pic-and-nonpic-6-o32.dd: Likewise.
	* ld-mips-elf/stub-dynsym-1-10000.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-2fe80.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-7fff.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-8000.d: Likewise.
	* ld-mips-elf/stub-dynsym-1-fff0.d: Likewise.
	* ld-mips-elf/tlslib-o32.d: Likewise.

	opcodes/
	* mips-dis.c (is_mips16_plt_tail): New function.
	(print_insn_mips16): Handle MIPS16 PLT entry's GOT slot address
	word.
	(is_compressed_mode_p): Handle MIPS16/microMIPS PLT entries.
2013-06-24 23:55:46 +00:00
Maciej W. Rozycki 3e5d3a5aaf * objfiles.h (pc_in_section): New prototype.
(in_plt_section): Remove name argument, replace prototype with
	static inline function.
	* mips-tdep.h: Include "objfiles.h".
	(in_mips_stubs_section): New function.
	* hppa-tdep.h (gdbarch_tdep): Remove name argument of
	in_solib_call_trampoline member.
	(hppa_in_solib_call_trampoline): Remove name argument.
	* objfiles.c (pc_in_section): New function.
	(in_plt_section): Remove function.
	* mips-linux-tdep.c: Include "objfiles.h".
	(mips_linux_in_dynsym_stub): Call in_mips_stubs_section.  Remove
	name argument.  Return 1 rather than the low 16-bit halfword of
	any instruction examined.
	(mips_linux_in_dynsym_resolve_code): Update
	mips_linux_in_dynsym_stub call accordingly.
	* mips-tdep.c (mips_stub_frame_sniffer): Use in_mips_stubs_section
	rather than an equivalent hand-coded sequence.
	* hppa-hpux-tdep.c (in_opd_section): Remove function.
	(hppa32_hpux_in_solib_call_trampoline): Remove name argument.
	(hppa64_hpux_in_solib_call_trampoline): Likewise.
	(hppa64_hpux_find_global_pointer): Use pc_in_section rather than
	in_opd_section.
	* hppa-tdep.c (hppa_stub_unwind_sniffer): Remove name argument
	on call to tdep->in_solib_call_trampoline.
	(hppa_in_solib_call_trampoline): Remove name argument, update
	according to in_plt_section change.
	(hppa_skip_trampoline_code): Update according to in_plt_section
	change.
	* aarch64-tdep.c (aarch64_stub_unwind_sniffer): Likewise.
	* arm-symbian-tdep.c (arm_symbian_skip_trampoline_code):
	Likewise.
	* arm-tdep.c (arm_stub_unwind_sniffer): Likewise.
	* hppa-linux-tdep.c (hppa_linux_find_global_pointer): Likewise.
	* hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise.
	* nios2-tdep.c (nios2_stub_frame_sniffer): Likewise.
	* nto-tdep.c (nto_relocate_section_addresses): Likewise.
	* s390-tdep.c (s390_stub_frame_sniffer): Likewise.
	* sh-tdep.c (sh_stub_unwind_sniffer): Likewise.
	* solib-dsbt.c (dsbt_in_dynsym_resolve_code): Likewise.
	* solib-frv.c (frv_in_dynsym_resolve_code): Likewise.
	* solib-svr4.c (svr4_in_dynsym_resolve_code): Likewise.
	* solib-target.c (solib_target_in_dynsym_resolve_code): Likewise.
	* sparc-tdep.c (sparc_analyze_prologue): Likewise.
	* tic6x-tdep.c (tic6x_stub_unwind_sniffer): Likewise.
2013-06-24 22:18:32 +00:00
Joel Brobecker b9b26a166a Fix host_name and target_name generation by common/create-version.sh.
This new script has one small snafoo, which prevented the $host_alias
and $target_alias from being expanded during the generation of the
version.c file.  As a result, the version info yields:

    This GDB was configured as "--host=$host_alias --target=$target_alias".
                                       ^^^^^^^^^^^          ^^^^^^^^^^^^^

This patch fixes this issue.

gdb/ChangeLog:

        * common/create-version.sh: Fix expansion of $host_alias
        and $target_alias in generation of HOST_NAME and TARGET_NAME
        (resp.).
2013-06-24 22:03:51 +00:00
Tom Tromey 0120846339 don't keep a gdb-specific date
Right now there are two nightly commits to update a file in the tree
with the current date.  One commit is for BFD, one is for gdb.

It seems unnecessary to me to do this twice.  We can make do with a
single such commit.

This patch changes gdb in a minimal way to reuse the BFD date -- it
extracts it from bfd/version.h and changes version.in to use the
placeholder string "DATE" for those times when a date is wanted.

I propose removing the cron job that updates the version on trunk, and
then check in this patch.

For release branches, we can keep the cron job, but just tell it to
rewrite bfd/version.h.  I believe this is a simple change in the
crontab -- the script will work just fine on this file.

This also moves version.in and version.h into common/, to reflect
their shared status; and updates gdbserver to use version.h besides.

	* common/create-version.sh: New file.
	* Makefile.in (version.c): Use bfd/version.h, common/version.in,
	create-version.sh.
	(HFILES_NO_SRCDIR): Use common/version.h.
	* version.in: Move to ...
	* common/version.in: ... here.  Replace date with "DATE".
	* version.h: Move to ...
	* common/version.h: ... here.
gdbserver:
	* Makefile.in (version.c): Use bfd/version.h, common/version.in,
	create-version.sh.
	(version.o): Remove.
	* gdbreplay.c: Include version.h.
	(version, host_name): Don't declare.
	* server.h: Include version.h.
	(version, host_name): Don't declare.
doc:
	* Makefile.in (POD2MAN1, POD2MAN5): Use version.subst.
	(GDBvn.texi): Use version.subst.
	(version.subst): New target.
	(mostlyclean): Remove version.subst.
2013-06-24 15:06:27 +00:00
Joel Brobecker bb6b9a5e78 Update dates in relevant gdb/gnulib/ copyright headers
This patch is the result of re-running the copyright.py script
in GDB, after we modified it to stop ignoring some files in
gdb/gnulib that should have been updated earlier this year.

gdb/ChangeLog:

        * gdb/gnulib/Makefile.in: Update date in copyright header.
        * gdb/gnulib/configure.ac: Ditto.
        * gdb/gnulib/update-gnulib.sh: Ditto.
2013-06-21 17:55:07 +00:00
Joel Brobecker c3b18ee7ba copyright.py: Handle files in gdb/gnulib owned by GDB.
The script was excluding all of gdb/gnulib but this is no longer
correct, ever since we moved the imported files to gdb/gnulib/import.
As a result, a number of files (Makefile, etc, including this script
itself) did not have their copyright header updated. This fixes
the problem.

gdb/ChangeLog:

        * copyright.py (EXCLUDE_LIST): Replace "gdb/gnulib" by
        "gdb/gnulib/import".
2013-06-21 17:54:58 +00:00