H.J. Lu [Tue, 19 Nov 2013 21:00:42 +0000 (13:00 -0800)]
Re-indent elf_x86_64_section_from_shdr
* elf64-x86-64.c (elf_x86_64_section_from_shdr): Re-indent.
Roland McGrath [Tue, 19 Nov 2013 18:54:00 +0000 (10:54 -0800)]
Fix references to __ehdr_start when it cannot be defined
ld/
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Don't use bfd_elf_record_link_assignment to mark __ehdr_start
hidden. Instead, just do it directly here, and only if it was
referenced but not defined.
ld/testsuite/
* ld-elf/ehdr_start-userdef.t: New file.
* ld-elf/ehdr_start-userdef.d: New file.
* ld-elf/ehdr_start-strongref.s: New file.
* ld-elf/ehdr_start-missing.t: New file.
* ld-elf/ehdr_start-missing.d: New file.
* ld-elf/ehdr_start-weak.d: New file.
* ld-mips-elf/ehdr_start-2.nd: Expect __ehdr_start to be global.
Nick Clifton [Tue, 19 Nov 2013 17:40:31 +0000 (17:40 +0000)]
* config/tc-aarch64.c (parse_sys_reg): Do not issue error messages
for deprecated system registers when parsing pstate fields.
Yao Qi [Wed, 13 Nov 2013 13:01:47 +0000 (21:01 +0800)]
Remove unnecessary '\'.
Hi,
In proc mi_child_regexp, \(,thread-id=\"\[0-9\]+\") is appended to
children_exp, while the first '\' is not necessary. This patch
is to remove it. With this patch applied, Emacs can find the right
left paren.
gdb/testsuite:
2013-11-19 Yao Qi <yao@codesourcery.com>
* lib/mi-support.exp (mi_child_regexp): Remove unnecessary '\'.
Yao Qi [Fri, 8 Nov 2013 13:33:26 +0000 (21:33 +0800)]
Fix format issues in lib/mi-support.exp
There are some format issues in lib/mi-support.exp, such as using
spaces instead of tab and trailing spaces. This patch is to fix them.
gdb/testsuite:
2013-11-19 Yao Qi <yao@codesourcery.com>
* lib/mi-support.exp: Fix format.
Catherine Moore [Tue, 19 Nov 2013 13:25:32 +0000 (05:25 -0800)]
2013-11-19 Catherine Moore <clm@codesourcery.com>
* micromips-opc.c (LM): Define.
(micromips_opcodes): Add LM to load instructions.
* mips-opc.c (prefe): Add LM attribute.
Catherine Moore [Tue, 19 Nov 2013 12:44:59 +0000 (04:44 -0800)]
2013-11-19 Catherine Moore <clm@codesourcery.com>
gas/
* config/tc-mips.c (mips_fix_pmc_rm7000): Declare.
(options): Add OPTION_FIX_PMC_RM7000 and OPTION_NO_FIX_PMC_RM7000.
(md_longopts): Add mfix-pmc-rm7000 and mno-fix-pmc-rm7000.
(INSN_DMULT): Define.
(INSN_DMULTU): Define.
(insns_between): Detect PMC RM7000 errata.
(md_parse_option): Supprt OPTION_FIX_PMC_RM7000 and
OPTION_NO_FIX_PMC_RM7000.
* doc/as.texinfo: Document new options.
* doc/c-mips.texi: Likewise.
gas/testsuite/
* gas/mips/fix-pmc-rm7000-1.d: New.
* gas/mips/fix-pmc-rm7000-1.s: New.
* gas/mips/fix-pmc-rm7000-2.d: New.
* gas/mips/fix-pmc-rm7000-2.s: New.
* gas/mips/micromips@fix-pmc-rm7000-1.d: New.
* gas/mips/micromips@fix-pmc-rm7000-2.d: New.
* gas/mips/mips.exp: Run new tests.
Alexey Makhalov [Tue, 19 Nov 2013 08:19:21 +0000 (08:19 +0000)]
PR gas/16109
* app.c (do_scrub_chars): Only insert a newline character if
end-of-file has been reached.
Yao Qi [Wed, 13 Nov 2013 12:57:40 +0000 (20:57 +0800)]
Remove 'whatever' in lib/mi-support.exp
Variable 'whatever' is not used at all. This patch is to remove it.
gdb/testsuite:
2013-11-19 Yao Qi <yao@codesourcery.com>
* lib/mi-support.exp (mi_child_regexp): Remove 'whatever'.
(mi_list_varobj_children_range): Likewise.
Yao Qi [Thu, 12 Sep 2013 13:21:16 +0000 (21:21 +0800)]
Fix typo
Hi,
"It's" should be "Its". This patch is to fix it. Committed as
obvious.
gdb:
2013-11-19 Yao Qi <yao@codesourcery.com>
* varobj.c (varobj_get_type): Fix typo.
Joel Brobecker [Mon, 18 Nov 2013 08:05:02 +0000 (12:05 +0400)]
Fix int() builtin with range type gdb.Value objects.
Consider the following variable:
type Small is range -128 .. 127;
SR : Small := 48;
Trying to get its value as an integer within Python code yields:
(gdb) python sr = gdb.parse_and_eval('sr')
(gdb) python print int(sr)
Traceback (most recent call last):
File "<string>", line 1, in <module>
gdb.error: Cannot convert value to int.
Error while executing Python code.
This is happening because our variable is a range type, and
py-value's is_intlike does not handle TYPE_CODE_RANGE. This
patch fixes this.
gdb/ChangeLog:
* python/py-value.c (is_intlike): Add TYPE_CODE_RANGE handling.
gdb/testsuite/ChangeLog:
* gdb.ada/py_range: New testcase.
Joel Brobecker [Tue, 19 Nov 2013 02:36:13 +0000 (06:36 +0400)]
gdb_ari.sh: Remove entries for dirent.h and stat.h.
The corresponding gdb_dirent.h and gdb_stat.h no longer exist.
We rely on gnulib for those, now.
gdb/ChangeLog:
* contrib/ari/gdb_ari.sh: Remove checks for "dirent.h" and
"stat.h".
Alan Modra [Mon, 18 Nov 2013 23:00:03 +0000 (09:30 +1030)]
daily update
H.J. Lu [Mon, 18 Nov 2013 22:37:23 +0000 (14:37 -0800)]
Update x86 gas tests for mingw
* gas/i386/avx512f-nondef.d: Updated for mingw.
* gas/i386/mpx-add-bnd-prefix.d: Likewise.
* gas/i386/x86-64-avx512f-nondef.d: Likewise.
* gas/i386/x86-64-mpx-add-bnd-prefix.d: Likewise.
* gas/i386/x86-64-mpx-addr32.d: Likewise.
* gas/i386/x86-64-opcode.d: Likewise.
* gas/i386/x86-64-sha.d: Likewise.
Tom Tromey [Wed, 6 Nov 2013 14:55:51 +0000 (07:55 -0700)]
remove gdb_stat.h
This patch is purely mechanical. It removes gdb_stat.h and changes
the code to use sys/stat.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_stat.h: Remove.
* ada-lang.c: Use sys/stat.h, not gdb_stat.h.
* common/filestuff.c: Use sys/stat.h, not gdb_stat.h.
* common/linux-osdata.c: Use sys/stat.h, not gdb_stat.h.
* corefile.c: Use sys/stat.h, not gdb_stat.h.
* ctf.c: Use sys/stat.h, not gdb_stat.h.
* darwin-nat.c: Use sys/stat.h, not gdb_stat.h.
* dbxread.c: Use sys/stat.h, not gdb_stat.h.
* dwarf2read.c: Use sys/stat.h, not gdb_stat.h.
* exec.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/linux-low.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/remote-utils.c: Use sys/stat.h, not gdb_stat.h.
* inf-child.c: Use sys/stat.h, not gdb_stat.h.
* jit.c: Use sys/stat.h, not gdb_stat.h.
* linux-nat.c: Use sys/stat.h, not gdb_stat.h.
* m68klinux-nat.c: Use sys/stat.h, not gdb_stat.h.
* main.c: Use sys/stat.h, not gdb_stat.h.
* mdebugread.c: Use sys/stat.h, not gdb_stat.h.
* mi/mi-cmd-env.c: Use sys/stat.h, not gdb_stat.h.
* nto-tdep.c: Use sys/stat.h, not gdb_stat.h.
* objfiles.c: Use sys/stat.h, not gdb_stat.h.
* procfs.c: Use sys/stat.h, not gdb_stat.h.
* remote-fileio.c: Use sys/stat.h, not gdb_stat.h.
* remote-mips.c: Use sys/stat.h, not gdb_stat.h.
* remote.c: Use sys/stat.h, not gdb_stat.h.
* rs6000-nat.c: Use sys/stat.h, not gdb_stat.h.
* sol-thread.c: Use sys/stat.h, not gdb_stat.h.
* solib-spu.c: Use sys/stat.h, not gdb_stat.h.
* source.c: Use sys/stat.h, not gdb_stat.h.
* symfile.c: Use sys/stat.h, not gdb_stat.h.
* symmisc.c: Use sys/stat.h, not gdb_stat.h.
* symtab.c: Use sys/stat.h, not gdb_stat.h.
* top.c: Use sys/stat.h, not gdb_stat.h.
* xcoffread.c: Use sys/stat.h, not gdb_stat.h.
Tom Tromey [Wed, 6 Nov 2013 14:49:44 +0000 (07:49 -0700)]
import gnulib sys/stat.h module
This imports the gnulib sys/stat.h module.
It doesn't make any other changes to gdb.
2013-11-18 Tom Tromey <tromey@redhat.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add
sys_stat.
* gnulib/aclocal.m4: Update.
* gnulib/config.in: Update.
* gnulib/configure: Update.
* gnulib/import/Makefile.am: Update.
* gnulib/import/Makefile.in: Update.
* gnulib/import/m4/gnulib-cache.m4: Update.
* gnulib/import/m4/gnulib-comp.m4: Update.
* gnulib/import/m4/sys_stat_h.m4: New.
* gnulib/import/m4/time_h.m4: New.
* gnulib/import/sys_stat.in.h: New.
* gnulib/import/time.in.h: New.
Tom Tromey [Wed, 6 Nov 2013 14:47:29 +0000 (07:47 -0700)]
sys/types.h cleanup
configure doesn't check for sys/types.h any more, but it still tries
to use the result of the check. This removes that use as well.
2013-11-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
* configure.ac: Remove check of HAVE_SYS_TYPES_H.
Tom Tromey [Wed, 6 Nov 2013 14:46:09 +0000 (07:46 -0700)]
don't check for unistd.h
We don't use the result of checking for unistd.h, so this removes the
check.
2013-11-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
* configure.ac: Don't check for unistd.h.
Tom Tromey [Wed, 6 Nov 2013 14:42:51 +0000 (07:42 -0700)]
stdlib.h is universal too
stdlib.h is universal as well, so there is no need to check for it.
2013-11-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
* configure.ac: Don't check for stdlib.h
* defs.h: Include stdlib.h unconditionally.
2013-11-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
* configure.ac: Don't check for stdlib.h.
* gdbreplay.c: Unconditionally include stdlib.h.
Tom Tromey [Wed, 6 Nov 2013 14:36:46 +0000 (07:36 -0700)]
don't check for stddef.h
gdb already unconditionally includes stddef.h in many places.
I think there is no reason to check for its existence.
Also, Zack Weinberg's header file survey agrees:
http://hacks.owlfolio.org/header-survey/
This patch removes the configure check and the inclusion guards.
It also removes a redundant inclusion that I noticed in defs.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* config.in: Rebuild.
* configure: Rebuild.
* configure.ac: Don't check for stddef.h.
* defs.h: Unconditionally include stddef.h. Remove duplicate
inclusion.
Tom Tromey [Wed, 6 Nov 2013 14:28:57 +0000 (07:28 -0700)]
remove gdb_dirent.h
This removes gdb_dirent.h and updates the code to use dirent.h
instead. It also removes the now-useless configure checks.
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/common.m4 (GDB_AC_COMMON): Don't use AC_HEADER_DIRENT.
* common/gdb_dirent.h: Remove.
* common/filestuff.c: Use dirent.h.
* common/linux-osdata.c: Use dirent.h.
(NAMELEN): Define.
* config.in: Rebuild.
* configure: Rebuild.
* configure.ac: Don't use AC_HEADER_DIRENT.
* linux-fork.c: Use dirent.h
* linux-nat.c: Use dirent.h.
* nto-procfs.c: Use dirent.h.
* procfs.c: Use dirent.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* config.in: Rebuild.
* configure: Rebuild.
* configure.ac: Don't use AC_HEADER_DIRENT.
Tom Tromey [Wed, 6 Nov 2013 14:20:41 +0000 (07:20 -0700)]
import gnulib dirent module
This imports the gnulib dirent module. It doesn't make any other
changes to gdb.
2013-11-18 Tom Tromey <tromey@redhat.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirent.
* gnulib/aclocal.m4: Update.
* gnulib/config.in: Update.
* gnulib/configure: Update.
* gnulib/import/Makefile.am: Update.
* gnulib/import/Makefile.in: Update.
* gnulib/import/dirent.in.h: New.
* gnulib/import/m4/dirent_h.m4: New.
* gnulib/import/m4/gnulib-cache.m4: Update.
* gnulib/import/m4/gnulib-comp.m4: Update.
Tom Tromey [Wed, 6 Nov 2013 14:17:47 +0000 (07:17 -0700)]
don't check for string.h or strings.h
Now that we are using the gnulib string.h module, we don't need to
check for string.h or strings.h. This removes the last few checks
from the source and from the configure scripts.
2013-11-18 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
* common/common.m4 (GDB_AC_COMMON): Don't check for string.h or
strings.h.
2013-11-18 Tom Tromey <tromey@redhat.com>
* server.h: Don't check HAVE_STRING_H.
* gdbreplay.c: Don't check HAVE_STRING_H.
* configure: Rebuild.
Tom Tromey [Wed, 6 Nov 2013 14:14:23 +0000 (07:14 -0700)]
remove gdb_string.h
This removes gdb_string.h. This patch is purely mechanical. I
created it by running the two commands:
git rm common/gdb_string.h
perl -pi -e's/"gdb_string.h"/<string.h>/;' *.[chyl] */*.[chyl]
2013-11-18 Tom Tromey <tromey@redhat.com>
* common/gdb_string.h: Remove.
* aarch64-tdep.c: Use string.h, not gdb_string.h.
* ada-exp.y: Use string.h, not gdb_string.h.
* ada-lang.c: Use string.h, not gdb_string.h.
* ada-lex.l: Use string.h, not gdb_string.h.
* ada-typeprint.c: Use string.h, not gdb_string.h.
* ada-valprint.c: Use string.h, not gdb_string.h.
* aix-thread.c: Use string.h, not gdb_string.h.
* alpha-linux-tdep.c: Use string.h, not gdb_string.h.
* alpha-mdebug-tdep.c: Use string.h, not gdb_string.h.
* alpha-nat.c: Use string.h, not gdb_string.h.
* alpha-osf1-tdep.c: Use string.h, not gdb_string.h.
* alpha-tdep.c: Use string.h, not gdb_string.h.
* alphanbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64-dicos-tdep.c: Use string.h, not gdb_string.h.
* amd64-linux-nat.c: Use string.h, not gdb_string.h.
* amd64-linux-tdep.c: Use string.h, not gdb_string.h.
* amd64-nat.c: Use string.h, not gdb_string.h.
* amd64-sol2-tdep.c: Use string.h, not gdb_string.h.
* amd64fbsd-tdep.c: Use string.h, not gdb_string.h.
* amd64obsd-tdep.c: Use string.h, not gdb_string.h.
* arch-utils.c: Use string.h, not gdb_string.h.
* arm-linux-nat.c: Use string.h, not gdb_string.h.
* arm-linux-tdep.c: Use string.h, not gdb_string.h.
* arm-tdep.c: Use string.h, not gdb_string.h.
* arm-wince-tdep.c: Use string.h, not gdb_string.h.
* armbsd-tdep.c: Use string.h, not gdb_string.h.
* armnbsd-nat.c: Use string.h, not gdb_string.h.
* armnbsd-tdep.c: Use string.h, not gdb_string.h.
* armobsd-tdep.c: Use string.h, not gdb_string.h.
* avr-tdep.c: Use string.h, not gdb_string.h.
* ax-gdb.c: Use string.h, not gdb_string.h.
* ax-general.c: Use string.h, not gdb_string.h.
* bcache.c: Use string.h, not gdb_string.h.
* bfin-tdep.c: Use string.h, not gdb_string.h.
* breakpoint.c: Use string.h, not gdb_string.h.
* build-id.c: Use string.h, not gdb_string.h.
* buildsym.c: Use string.h, not gdb_string.h.
* c-exp.y: Use string.h, not gdb_string.h.
* c-lang.c: Use string.h, not gdb_string.h.
* c-typeprint.c: Use string.h, not gdb_string.h.
* c-valprint.c: Use string.h, not gdb_string.h.
* charset.c: Use string.h, not gdb_string.h.
* cli-out.c: Use string.h, not gdb_string.h.
* cli/cli-cmds.c: Use string.h, not gdb_string.h.
* cli/cli-decode.c: Use string.h, not gdb_string.h.
* cli/cli-dump.c: Use string.h, not gdb_string.h.
* cli/cli-interp.c: Use string.h, not gdb_string.h.
* cli/cli-logging.c: Use string.h, not gdb_string.h.
* cli/cli-script.c: Use string.h, not gdb_string.h.
* cli/cli-setshow.c: Use string.h, not gdb_string.h.
* cli/cli-utils.c: Use string.h, not gdb_string.h.
* coffread.c: Use string.h, not gdb_string.h.
* common/common-utils.c: Use string.h, not gdb_string.h.
* common/filestuff.c: Use string.h, not gdb_string.h.
* common/linux-procfs.c: Use string.h, not gdb_string.h.
* common/linux-ptrace.c: Use string.h, not gdb_string.h.
* common/signals.c: Use string.h, not gdb_string.h.
* common/vec.h: Use string.h, not gdb_string.h.
* core-regset.c: Use string.h, not gdb_string.h.
* corefile.c: Use string.h, not gdb_string.h.
* corelow.c: Use string.h, not gdb_string.h.
* cp-abi.c: Use string.h, not gdb_string.h.
* cp-support.c: Use string.h, not gdb_string.h.
* cp-valprint.c: Use string.h, not gdb_string.h.
* cris-tdep.c: Use string.h, not gdb_string.h.
* d-lang.c: Use string.h, not gdb_string.h.
* dbxread.c: Use string.h, not gdb_string.h.
* dcache.c: Use string.h, not gdb_string.h.
* demangle.c: Use string.h, not gdb_string.h.
* dicos-tdep.c: Use string.h, not gdb_string.h.
* disasm.c: Use string.h, not gdb_string.h.
* doublest.c: Use string.h, not gdb_string.h.
* dsrec.c: Use string.h, not gdb_string.h.
* dummy-frame.c: Use string.h, not gdb_string.h.
* dwarf2-frame.c: Use string.h, not gdb_string.h.
* dwarf2loc.c: Use string.h, not gdb_string.h.
* dwarf2read.c: Use string.h, not gdb_string.h.
* elfread.c: Use string.h, not gdb_string.h.
* environ.c: Use string.h, not gdb_string.h.
* eval.c: Use string.h, not gdb_string.h.
* event-loop.c: Use string.h, not gdb_string.h.
* exceptions.c: Use string.h, not gdb_string.h.
* exec.c: Use string.h, not gdb_string.h.
* expprint.c: Use string.h, not gdb_string.h.
* f-exp.y: Use string.h, not gdb_string.h.
* f-lang.c: Use string.h, not gdb_string.h.
* f-typeprint.c: Use string.h, not gdb_string.h.
* f-valprint.c: Use string.h, not gdb_string.h.
* fbsd-nat.c: Use string.h, not gdb_string.h.
* findcmd.c: Use string.h, not gdb_string.h.
* findvar.c: Use string.h, not gdb_string.h.
* fork-child.c: Use string.h, not gdb_string.h.
* frame.c: Use string.h, not gdb_string.h.
* frv-linux-tdep.c: Use string.h, not gdb_string.h.
* frv-tdep.c: Use string.h, not gdb_string.h.
* gdb.c: Use string.h, not gdb_string.h.
* gdb_bfd.c: Use string.h, not gdb_string.h.
* gdbarch.c: Use string.h, not gdb_string.h.
* gdbtypes.c: Use string.h, not gdb_string.h.
* gnu-nat.c: Use string.h, not gdb_string.h.
* gnu-v2-abi.c: Use string.h, not gdb_string.h.
* gnu-v3-abi.c: Use string.h, not gdb_string.h.
* go-exp.y: Use string.h, not gdb_string.h.
* go-lang.c: Use string.h, not gdb_string.h.
* go32-nat.c: Use string.h, not gdb_string.h.
* hppa-hpux-tdep.c: Use string.h, not gdb_string.h.
* hppa-linux-nat.c: Use string.h, not gdb_string.h.
* hppanbsd-tdep.c: Use string.h, not gdb_string.h.
* hppaobsd-tdep.c: Use string.h, not gdb_string.h.
* i386-cygwin-tdep.c: Use string.h, not gdb_string.h.
* i386-dicos-tdep.c: Use string.h, not gdb_string.h.
* i386-linux-nat.c: Use string.h, not gdb_string.h.
* i386-linux-tdep.c: Use string.h, not gdb_string.h.
* i386-nto-tdep.c: Use string.h, not gdb_string.h.
* i386-sol2-tdep.c: Use string.h, not gdb_string.h.
* i386-tdep.c: Use string.h, not gdb_string.h.
* i386bsd-tdep.c: Use string.h, not gdb_string.h.
* i386gnu-nat.c: Use string.h, not gdb_string.h.
* i386nbsd-tdep.c: Use string.h, not gdb_string.h.
* i386obsd-tdep.c: Use string.h, not gdb_string.h.
* i387-tdep.c: Use string.h, not gdb_string.h.
* ia64-libunwind-tdep.c: Use string.h, not gdb_string.h.
* ia64-linux-nat.c: Use string.h, not gdb_string.h.
* inf-child.c: Use string.h, not gdb_string.h.
* inf-ptrace.c: Use string.h, not gdb_string.h.
* inf-ttrace.c: Use string.h, not gdb_string.h.
* infcall.c: Use string.h, not gdb_string.h.
* infcmd.c: Use string.h, not gdb_string.h.
* inflow.c: Use string.h, not gdb_string.h.
* infrun.c: Use string.h, not gdb_string.h.
* interps.c: Use string.h, not gdb_string.h.
* iq2000-tdep.c: Use string.h, not gdb_string.h.
* irix5-nat.c: Use string.h, not gdb_string.h.
* jv-exp.y: Use string.h, not gdb_string.h.
* jv-lang.c: Use string.h, not gdb_string.h.
* jv-typeprint.c: Use string.h, not gdb_string.h.
* jv-valprint.c: Use string.h, not gdb_string.h.
* language.c: Use string.h, not gdb_string.h.
* linux-fork.c: Use string.h, not gdb_string.h.
* linux-nat.c: Use string.h, not gdb_string.h.
* lm32-tdep.c: Use string.h, not gdb_string.h.
* m2-exp.y: Use string.h, not gdb_string.h.
* m2-typeprint.c: Use string.h, not gdb_string.h.
* m32c-tdep.c: Use string.h, not gdb_string.h.
* m32r-linux-nat.c: Use string.h, not gdb_string.h.
* m32r-linux-tdep.c: Use string.h, not gdb_string.h.
* m32r-rom.c: Use string.h, not gdb_string.h.
* m32r-tdep.c: Use string.h, not gdb_string.h.
* m68hc11-tdep.c: Use string.h, not gdb_string.h.
* m68k-tdep.c: Use string.h, not gdb_string.h.
* m68kbsd-tdep.c: Use string.h, not gdb_string.h.
* m68klinux-nat.c: Use string.h, not gdb_string.h.
* m68klinux-tdep.c: Use string.h, not gdb_string.h.
* m88k-tdep.c: Use string.h, not gdb_string.h.
* macrocmd.c: Use string.h, not gdb_string.h.
* main.c: Use string.h, not gdb_string.h.
* mdebugread.c: Use string.h, not gdb_string.h.
* mem-break.c: Use string.h, not gdb_string.h.
* memattr.c: Use string.h, not gdb_string.h.
* memory-map.c: Use string.h, not gdb_string.h.
* mep-tdep.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-break.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-disas.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-env.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-stack.c: Use string.h, not gdb_string.h.
* mi/mi-cmd-var.c: Use string.h, not gdb_string.h.
* mi/mi-cmds.c: Use string.h, not gdb_string.h.
* mi/mi-console.c: Use string.h, not gdb_string.h.
* mi/mi-getopt.c: Use string.h, not gdb_string.h.
* mi/mi-interp.c: Use string.h, not gdb_string.h.
* mi/mi-main.c: Use string.h, not gdb_string.h.
* mi/mi-parse.c: Use string.h, not gdb_string.h.
* microblaze-rom.c: Use string.h, not gdb_string.h.
* microblaze-tdep.c: Use string.h, not gdb_string.h.
* mingw-hdep.c: Use string.h, not gdb_string.h.
* minidebug.c: Use string.h, not gdb_string.h.
* minsyms.c: Use string.h, not gdb_string.h.
* mips-irix-tdep.c: Use string.h, not gdb_string.h.
* mips-linux-tdep.c: Use string.h, not gdb_string.h.
* mips-tdep.c: Use string.h, not gdb_string.h.
* mips64obsd-tdep.c: Use string.h, not gdb_string.h.
* mipsnbsd-tdep.c: Use string.h, not gdb_string.h.
* mipsread.c: Use string.h, not gdb_string.h.
* mn10300-linux-tdep.c: Use string.h, not gdb_string.h.
* mn10300-tdep.c: Use string.h, not gdb_string.h.
* monitor.c: Use string.h, not gdb_string.h.
* moxie-tdep.c: Use string.h, not gdb_string.h.
* mt-tdep.c: Use string.h, not gdb_string.h.
* nbsd-tdep.c: Use string.h, not gdb_string.h.
* nios2-linux-tdep.c: Use string.h, not gdb_string.h.
* nto-procfs.c: Use string.h, not gdb_string.h.
* nto-tdep.c: Use string.h, not gdb_string.h.
* objc-lang.c: Use string.h, not gdb_string.h.
* objfiles.c: Use string.h, not gdb_string.h.
* opencl-lang.c: Use string.h, not gdb_string.h.
* osabi.c: Use string.h, not gdb_string.h.
* osdata.c: Use string.h, not gdb_string.h.
* p-exp.y: Use string.h, not gdb_string.h.
* p-lang.c: Use string.h, not gdb_string.h.
* p-typeprint.c: Use string.h, not gdb_string.h.
* parse.c: Use string.h, not gdb_string.h.
* posix-hdep.c: Use string.h, not gdb_string.h.
* ppc-linux-nat.c: Use string.h, not gdb_string.h.
* ppc-sysv-tdep.c: Use string.h, not gdb_string.h.
* ppcfbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcnbsd-tdep.c: Use string.h, not gdb_string.h.
* ppcobsd-tdep.c: Use string.h, not gdb_string.h.
* printcmd.c: Use string.h, not gdb_string.h.
* procfs.c: Use string.h, not gdb_string.h.
* prologue-value.c: Use string.h, not gdb_string.h.
* python/py-auto-load.c: Use string.h, not gdb_string.h.
* python/py-gdb-readline.c: Use string.h, not gdb_string.h.
* ravenscar-thread.c: Use string.h, not gdb_string.h.
* regcache.c: Use string.h, not gdb_string.h.
* registry.c: Use string.h, not gdb_string.h.
* remote-fileio.c: Use string.h, not gdb_string.h.
* remote-m32r-sdi.c: Use string.h, not gdb_string.h.
* remote-mips.c: Use string.h, not gdb_string.h.
* remote-sim.c: Use string.h, not gdb_string.h.
* remote.c: Use string.h, not gdb_string.h.
* reverse.c: Use string.h, not gdb_string.h.
* rs6000-aix-tdep.c: Use string.h, not gdb_string.h.
* ser-base.c: Use string.h, not gdb_string.h.
* ser-go32.c: Use string.h, not gdb_string.h.
* ser-mingw.c: Use string.h, not gdb_string.h.
* ser-pipe.c: Use string.h, not gdb_string.h.
* ser-tcp.c: Use string.h, not gdb_string.h.
* ser-unix.c: Use string.h, not gdb_string.h.
* serial.c: Use string.h, not gdb_string.h.
* sh-tdep.c: Use string.h, not gdb_string.h.
* sh64-tdep.c: Use string.h, not gdb_string.h.
* shnbsd-tdep.c: Use string.h, not gdb_string.h.
* skip.c: Use string.h, not gdb_string.h.
* sol-thread.c: Use string.h, not gdb_string.h.
* solib-dsbt.c: Use string.h, not gdb_string.h.
* solib-frv.c: Use string.h, not gdb_string.h.
* solib-osf.c: Use string.h, not gdb_string.h.
* solib-spu.c: Use string.h, not gdb_string.h.
* solib-target.c: Use string.h, not gdb_string.h.
* solib.c: Use string.h, not gdb_string.h.
* somread.c: Use string.h, not gdb_string.h.
* source.c: Use string.h, not gdb_string.h.
* sparc-nat.c: Use string.h, not gdb_string.h.
* sparc-sol2-tdep.c: Use string.h, not gdb_string.h.
* sparc-tdep.c: Use string.h, not gdb_string.h.
* sparc64-tdep.c: Use string.h, not gdb_string.h.
* sparc64fbsd-tdep.c: Use string.h, not gdb_string.h.
* sparc64nbsd-tdep.c: Use string.h, not gdb_string.h.
* sparcnbsd-tdep.c: Use string.h, not gdb_string.h.
* spu-linux-nat.c: Use string.h, not gdb_string.h.
* spu-multiarch.c: Use string.h, not gdb_string.h.
* spu-tdep.c: Use string.h, not gdb_string.h.
* stabsread.c: Use string.h, not gdb_string.h.
* stack.c: Use string.h, not gdb_string.h.
* std-regs.c: Use string.h, not gdb_string.h.
* symfile.c: Use string.h, not gdb_string.h.
* symmisc.c: Use string.h, not gdb_string.h.
* symtab.c: Use string.h, not gdb_string.h.
* target.c: Use string.h, not gdb_string.h.
* thread.c: Use string.h, not gdb_string.h.
* tilegx-linux-nat.c: Use string.h, not gdb_string.h.
* tilegx-tdep.c: Use string.h, not gdb_string.h.
* top.c: Use string.h, not gdb_string.h.
* tracepoint.c: Use string.h, not gdb_string.h.
* tui/tui-command.c: Use string.h, not gdb_string.h.
* tui/tui-data.c: Use string.h, not gdb_string.h.
* tui/tui-disasm.c: Use string.h, not gdb_string.h.
* tui/tui-file.c: Use string.h, not gdb_string.h.
* tui/tui-layout.c: Use string.h, not gdb_string.h.
* tui/tui-out.c: Use string.h, not gdb_string.h.
* tui/tui-regs.c: Use string.h, not gdb_string.h.
* tui/tui-source.c: Use string.h, not gdb_string.h.
* tui/tui-stack.c: Use string.h, not gdb_string.h.
* tui/tui-win.c: Use string.h, not gdb_string.h.
* tui/tui-windata.c: Use string.h, not gdb_string.h.
* tui/tui-winsource.c: Use string.h, not gdb_string.h.
* typeprint.c: Use string.h, not gdb_string.h.
* ui-file.c: Use string.h, not gdb_string.h.
* ui-out.c: Use string.h, not gdb_string.h.
* user-regs.c: Use string.h, not gdb_string.h.
* utils.c: Use string.h, not gdb_string.h.
* v850-tdep.c: Use string.h, not gdb_string.h.
* valarith.c: Use string.h, not gdb_string.h.
* valops.c: Use string.h, not gdb_string.h.
* valprint.c: Use string.h, not gdb_string.h.
* value.c: Use string.h, not gdb_string.h.
* varobj.c: Use string.h, not gdb_string.h.
* vax-tdep.c: Use string.h, not gdb_string.h.
* vaxnbsd-tdep.c: Use string.h, not gdb_string.h.
* vaxobsd-tdep.c: Use string.h, not gdb_string.h.
* windows-nat.c: Use string.h, not gdb_string.h.
* xcoffread.c: Use string.h, not gdb_string.h.
* xml-support.c: Use string.h, not gdb_string.h.
* xstormy16-tdep.c: Use string.h, not gdb_string.h.
* xtensa-linux-nat.c: Use string.h, not gdb_string.h.
Tom Tromey [Tue, 5 Nov 2013 21:53:48 +0000 (14:53 -0700)]
import strstr and strerror modules
This imports the gnulib strstr and strerror modules. It doesn't make
any other changes to gdb; I found it simpler to work with the branch
if I made the changes more indepdendent than I had previously.
2013-11-18 Tom Tromey <tromey@redhat.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add strerror
and strstr.
* gnulib/aclocal.m4: Update.
* gnulib/config.in: Update.
* gnulib/configure: Update.
* gnulib/import/Makefile.am: Update.
* gnulib/import/Makefile.in: Update.
* gnulib/import/errno.in.h: New.
* gnulib/import/intprops.h: New.
* gnulib/import/m4/errno_h.m4: New.
* gnulib/import/m4/gnulib-cache.m4: Update.
* gnulib/import/m4/gnulib-comp.m4: Update.
* gnulib/import/m4/strerror.m4: New.
* gnulib/import/m4/strstr.m4: New.
* gnulib/import/m4/sys_socket_h.m4: New.
* gnulib/import/strerror-override.c: New.
* gnulib/import/strerror-override.h: New.
* gnulib/import/strerror.c: New.
* gnulib/import/strstr.c: New.
Tom Tromey [Tue, 5 Nov 2013 21:49:14 +0000 (14:49 -0700)]
change how list of modules is computed
While adding modules I found that the current approach of listing all
the modules on one line made it harder to experiment -- any conflicts
from git were a pain to resolve.
This patch splits the list of modules so that there is one module per
line.
2013-11-18 Tom Tromey <tromey@redhat.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Split into
multiple lines.
Tom Tromey [Wed, 6 Nov 2013 15:48:03 +0000 (08:48 -0700)]
link gdbreplay against gnulib
Later patches in this series will make changes to gdb and gdbserver
configury, necessitating the use of gnulib in gdbreplay. This patch
introduces the dependency early, so that subsequent patches don't
break the build.
2013-11-18 Tom Tromey <tromey@redhat.com>
* Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
LIBGNU.
H.J. Lu [Mon, 18 Nov 2013 20:16:16 +0000 (12:16 -0800)]
Add a dummy "int bnd_prefix" argument
* config/tc-i386.c (lex_got): Add a dummy "int bnd_prefix"
argument.
H.J. Lu [Sun, 17 Nov 2013 18:30:28 +0000 (10:30 -0800)]
Add R_X86_64_PC32_BND/R_X86_64_PLT32_BND suppor to gold
elfcpp/
* x86_64.h (R_X86_64_PC32_BND): New.
(R_X86_64_PLT32_BND): Likewise.
gold/
* x86_64.cc (Target_x86_64<size>::Scan::get_reference_flags):
Handle R_X86_64_PC32_BND and R_X86_64_PLT32_BND just like
R_X86_64_PC32 and R_X86_64_PLT32, respectively.
(Target_x86_64<size>::Scan::local): Likewise.
(Target_x86_64<size>::Scan::global): Likewise.
(Target_x86_64<size>::Relocate::relocate): Likewise.
(Target_x86_64<size>::Relocatable_size_for_reloc::get_size_for_reloc):
Likewise.
(Target_x86_64<size>::Scan::check_non_pic(): Handle
R_X86_64_PC32_BND.
* testsuite/Makefile.am (check_PROGRAMS): Add
exception_x86_64_bnd_test.
(exception_x86_64_bnd_test_SOURCES): New macro.
(exception_x86_64_bnd_test_DEPENDENCIES): Likewise.
(exception_x86_64_bnd_test_LDFLAGS): Likewise.
(exception_x86_64_bnd_test_LDADD): Likewise.
(exception_x86_64_bnd_1.o): New rule.
(exception_x86_64_bnd_2.o): Likewise.
* testsuite/Makefile.in: Regenerated.
Yufeng Zhang [Mon, 18 Nov 2013 17:23:33 +0000 (17:23 +0000)]
Add support for armv7ve to gas.
gas/
* config/tc-arm.c (arm_archs): New armv7ve architecture option.
(arm_cpus): Replace ARM_ARCH_V7A_IDIV_MP_SEC_VIRT with
ARM_ARCH_V7VE for cortex-a7, cortex-a12 and cortex-a15.
(cpu_arch_ver): Likewise.
* doc/c-arm.texi: Document armv7ve.
gas/testsuite/
* gas/arm/attr-march-armv7ve.d: New test case for armv7ve.
include/opcode/
* arm.h (ARM_AEXT_V7VE): New define.
(ARM_ARCH_V7VE): New define.
(ARM_ARCH_V7A_IDIV_MP_SEC_VIRT): Removed.
Chung-Lin Tang [Mon, 18 Nov 2013 14:57:28 +0000 (06:57 -0800)]
Separate emulations for nios2-elf and nios2-linux.
2013-11-18 Chung-Lin Tang <cltang@codesourcery.com>
* emulparams/nios2linux.sh: New emulation file.
* configure.tgt: Add nios2*-*-linux* emulation case.
* Makefile.am (enios2linux.c): New emulation entry.
* Makefile.in: Regenerate.
Jose E. Marchesi [Mon, 18 Nov 2013 12:37:05 +0000 (04:37 -0800)]
sparc: support single-stepping over longjmp calls.
2013-11-18 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc-tdep.c (sparc_is_annulled_branch_insn): New function.
* sparc-tdep.h: And its prototype.
* sparc64-linux-tdep.c (sparc64_linux_get_longjmp_target): New
function.
(sparc64_linux_init_abi): Register the get_longjmp_target hook.
Pedro Alves [Mon, 18 Nov 2013 12:05:11 +0000 (12:05 +0000)]
Simplify dwarf2-frame.c:read_addr_from_reg.
Since 'struct dwarf_expr_context_funcs::read_addr_from_reg' is now
only used for addresses, we can make it use unpack_pointer. And since
we now have 'struct dwarf_expr_context_funcs'::get_reg_value, there's
no need for speculation about using values here.
Tested on x86_64 Fedora 17.
gdb/
2013-11-18 Pedro Alves <palves@redhat.com>
* dwarf2-frame.c (read_addr_from_reg): Remove stale comment and
use unpack_pointer.
Joel Brobecker [Mon, 18 Nov 2013 11:56:54 +0000 (15:56 +0400)]
mi-language.exp: Check "langauge-option" in -list-features output.
gdb/testsuite/ChangeLog:
* mi-language.exp: Add "-list-features" test verifying that
its output contains "language-option".
Yufeng Zhang [Mon, 18 Nov 2013 11:34:43 +0000 (11:34 +0000)]
gas/
* config/tc-aarch64.c (parse_sys_reg): Support
S2_<op1>_<Cn>_<Cm>_<op2>.
gas/testsuite/
* gas/testsuite/sysreg.s: Add test.
* gas/testsuite/sysreg.d: Update.
Yufeng Zhang [Mon, 18 Nov 2013 11:21:35 +0000 (11:21 +0000)]
Revert "Add support for AArch64 trace unit registers."
This reverts commit
75468c93c14e9f14dd9020712538c5303a455876.
Joel Brobecker [Thu, 14 Nov 2013 10:57:01 +0000 (14:57 +0400)]
Add "language-option" to -list-features
Following the addition of the --language optiton to all GDB/MI
commands, I realized that there was no easy way for front-ends
to figure out whether this features is available or not. So I added
a "language-option" entry to -list-features.
gdb/ChangeLog:
* mi/mi-main.c (mi_cmd_list_features): Add "language-options"
to -list-features output.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Miscellaneous Commands): Document the new
"language-option" entry in the output of the "-list-features"
command.
Alan Modra [Sun, 17 Nov 2013 23:00:01 +0000 (09:30 +1030)]
daily update
H.J. Lu [Tue, 12 Nov 2013 23:46:55 +0000 (15:46 -0800)]
Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND
bfd/
* elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_PC32_BND
and R_X86_64_PLT32_BND.
(R_X86_64_standard): Replace R_X86_64_RELATIVE64 with
R_X86_64_PLT32_BND.
(IS_X86_64_PCREL_TYPE): Add R_X86_64_PLT32_BND.
(x86_64_reloc_map): Add BFD_RELOC_X86_64_PC32_BND and
BFD_RELOC_X86_64_PLT32_BND.
(elf_x86_64_check_relocs): Handle R_X86_64_PC32_BND and
R_X86_64_PLT32_BND.
(elf_x86_64_gc_sweep_hook): Likewise.
(elf_x86_64_relocate_section): Likewise.
* reloc.c (bfd_reloc_code_real): Add BFD_RELOC_X86_64_PC32_BND
and BFD_RELOC_X86_64_PLT32_BND.
* bfd-in2.h: Regenerated.
* libbfd.h: Likewise.
gas/
* config/tc-i386.c (reloc): Add an argument, bnd_prefix, to
indicate if instruction has the BND prefix. Return
BFD_RELOC_X86_64_PC32_BND instead of BFD_RELOC_32_PCREL if
bnd_prefix isn't zero.
(output_branch): Pass BFD_RELOC_X86_64_PC32_BND to frag_var
if needed.
(output_jump): Update reloc call.
(output_interseg_jump): Likewise.
(output_disp): Likewise.
(output_imm): Likewise.
(x86_cons_fix_new): Likewise.
(lex_got): Add an argument, bnd_prefix, to indicate if
instruction has the BND prefix. Use BFD_RELOC_X86_64_PLT32_BND
if needed.
(x86_cons): Update lex_got call.
(i386_immediate): Likewise.
(i386_displacement): Likewise.
(md_apply_fix): Handle BFD_RELOC_X86_64_PC32_BND and
BFD_RELOC_X86_64_PLT32_BND.
(tc_gen_reloc): Likewise.
* config/tc-i386-intel.c (i386_operator): Update lex_got call.
gas/testsuite/
* gas/i386/i386.exp: Run x86-64-mpx-branch-1 and
x86-64-mpx-branch-2 on 64-bit ELF targets.
* gas/i386/x86-64-mpx-branch-1.d: New file.
* gas/i386/x86-64-mpx-branch-1.s: Likewise.
* gas/i386/x86-64-mpx-branch-2.d: Likewise.
* gas/i386/x86-64-mpx-branch-2.s: Likewise.
include/elf/
* x86-64.h: Add R_X86_64_PC32_BND and R_X86_64_PLT32_BND.
ld/testsuite/
* ld-x86-64/mpx.exp: New file.
* ld-x86-64/mpx1.out: Likewise.
* ld-x86-64/mpx1a.c: Likewise.
* ld-x86-64/mpx1a.rd: Likewise.
* ld-x86-64/mpx1b.c: Likewise.
* ld-x86-64/mpx1c.c: Likewise.
* ld-x86-64/mpx1c.rd: Likewise.
Joel Brobecker [Sat, 16 Nov 2013 03:33:36 +0000 (07:33 +0400)]
Rename "read_reg" into "read_addr_from_reg" in struct dwarf_expr_context_funcs
This is to help make it slightly clearer how this method is expected
to extract data from the given register.
gdb/ChangeLog:
* dwarf2expr.h (struct dwarf_expr_context_funcs)
<read_addr_from_reg>: Renames "read_reg".
* dwarf2-frame.c (read_addr_from_reg): Renames "read_reg".
Adjust comment.
(dwarf2_frame_ctx_funcs, execute_stack_op, dwarf2_frame_cache):
Use read_addr_from_reg in place of read_reg.
* dwarf2expr.c (execute_stack_op): Use read_addr_from_reg
in place of read_reg.
* dwarf2loc.c (dwarf_expr_read_addr_from_reg): Renames
dwarf_expr_read_reg.
(dwarf_expr_ctx_funcs): Replace dwarf_expr_read_reg
with dwarf_expr_read_addr_from_reg.
(needs_frame_read_addr_from_reg): Renames needs_frame_read_reg.
(needs_frame_ctx_funcs): Replace needs_frame_read_reg with
needs_frame_read_addr_from_reg.
Alan Modra [Sat, 16 Nov 2013 23:00:03 +0000 (09:30 +1030)]
daily update
Joel Brobecker [Fri, 15 Nov 2013 17:46:34 +0000 (21:46 +0400)]
gdb.ada/info_exc.exp,mi_exc_info.exp: Use more unique exception name.
In the case where the GNAT runtime was built with full debugging info,
several of the exceptions defined there might have a name contain
the word "global". To make this less likely, this patch renames
the exception name, replacing "Global" by "Global_GDB". It still
keeps the exeption name relatively short, while it is unlikely that
the GNAT runtime has an exception whose name explicitly mentions GDB,
and even less likely that it contains "Global_GDB".
gdb/testsuite/ChangeLog:
* info_exc/const.ads (Aint_Global_GDB_E): Renames Aint_Global_E.
* info_exc/foo.adb: Adjust to new exception name.
* info_exc.exp: Adjust after exception renaming in const.ads.
Update "info exception global" test to test "info exceptions
global_gdb" instead.
* mi_exc_info/const.ads (Aint_Global_GDB_E): Renames Aint_Global_E.
* mi_exc_info/foo.adb (Adjust to new exception name.
* mi_exc_info.exp: Adjust after exception renaming in const.ads.
Update "-info-ada-exceptions global" test to test
"-info-ada-exceptions global_gdb" instead.
Yufeng Zhang [Fri, 15 Nov 2013 23:40:34 +0000 (23:40 +0000)]
gas/
* config/tc-aarch64.c (set_other_error): New function.
(parse_sys_reg): Add new parameter 'sys_reg' and if non-NULL set
the variable to which it points with 'o'.
(parse_operands): Update; check for write to read-only system
registers or read from write-only ones.
gas/testsuite/
* gas/aarch64/diagnostic.s: Add tests.
* gas/aarch64/diagnostic.l: Update.
* gas/aarch64/tracereg-illegal.d: New file.
* gas/aarch64/tracereg-illegal.l: Ditto.
* gas/aarch64/tracereg-illegal.s: Ditto.
* gas/aarch64/tracereg.d: Ditto.
* gas/aarch64/tracereg.s: Ditto.
include/opcode
* aarch64.h (aarch64_sys_reg_readonly_p): New declaration.
(aarch64_sys_reg_writeonly_p): Ditto.
opcodes/
* aarch64-opc.c (CPENT): New define.
(F_READONLY, F_WRITEONLY): Likewise.
(aarch64_sys_regs): Add trace unit registers.
(aarch64_sys_reg_readonly_p): New function.
(aarch64_sys_reg_writeonly_p): Ditto.
Alan Modra [Fri, 15 Nov 2013 23:00:01 +0000 (09:30 +1030)]
daily update
Maciej W. Rozycki [Fri, 15 Nov 2013 21:57:11 +0000 (21:57 +0000)]
MIPS/opcodes: Add MFCR and MTCR data dependencies
* mips-opc.c (mips_builtin_opcodes): Add RD_2 to "mfcr" and
"mtcr".
Luis Machado [Fri, 15 Nov 2013 21:41:07 +0000 (19:41 -0200)]
* lib/mi-support.exp (mi_gdb_test): Expect different formats
of inferior output for remote and native sessions.
* gdb.mi/mi-console.exp: Remove obsolete comment.
Check for semihosted inferior output pattern.
(semihosted_string): New function.
Jan Kratochvil [Fri, 15 Nov 2013 18:19:57 +0000 (19:19 +0100)]
gdb/NEWS: Fix typo
gdb/
2013-11-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (Changes in GDB 7.5) (New commands) (explore): Fix typo.
H.J. Lu [Fri, 15 Nov 2013 17:31:09 +0000 (09:31 -0800)]
Make room for PLT0 directly
* elf32-i386.c (elf_i386_allocate_dynrelocs): Make room for
PLT0 directly.
* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
uros [Tue, 12 Nov 2013 20:02:21 +0000 (20:02 +0000)]
* cp-demangle.c (d_copy_templates): Cast result of malloc to (struct d_print_template *). (d_print_comp): Cast result of realloc to (struct d_saved scope *).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204713
138bc75d-0d04-0410-961f-
82ee72b054a4
Joel Brobecker [Fri, 15 Nov 2013 16:34:09 +0000 (20:34 +0400)]
gdb.ada/info_exc.exp,mi_exc_info.exp: handle runtimes with full debug info.
If the runtime has full debug info, then the non-standard exceptions
declared in the GNAT runtime will appear in the list of exceptions
printed by GDB ("info exceptions" or "-info-ada-exceptions").
This is valid output, so this patch allows for it.
gdb/testsuite/ChangeLog:
* gdb.ada/info_exc.exp: Allow other global exceptions to be
listed in the output of "info exceptions".
* gdb.ada/mi_exc_info.exp: Allow other global exceptions to be
listed in the output of "-info-ada-exceptions".
Andreas Arnez [Wed, 13 Nov 2013 13:00:44 +0000 (14:00 +0100)]
Fix GDB crash with upstream GCC due to memcpy(NULL, ...)
Similar to qsort(), the glibc version of memcpy() also declares its
arguments with __attribute__(__nonnull__(...)). If NULL is passed
anyway, upstream GCC's new pass '-fisolate-erroneous-paths' typically
causes a trap in such cases. I've encountered this with GDB in
chain_candidate() when trying to execute the break.exp test case.
gdb/
2013-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
* dwarf2loc.c (chain_candidate): Prevent invoking memcpy with
NULL.
Joel Brobecker [Fri, 15 Nov 2013 06:30:00 +0000 (10:30 +0400)]
Start inferior before running test listing Ada exceptions.
This patch fixes some spurious failures when the inferior is linked
against the shared version of libgnat by default, as appears to be
the case on many GNU/Linux distributions. When that happens, we have
to start the program in order to ensure that the GNAT runtime is
mapped to memory, in order for us to find the standard exceptions
(defined within the runtime). Otherwise, they will not be shown,
as expected, by the debugger.
gdb/testsuite/ChangeLog:
* gdb.ada/info_exc.exp: Start inferior before starting
the "info exceptions" tests.
* gdb.ada/mi_exc_info.exp: Start inferior before starting
the "-info-ada-exceptions" tests.
Tom Tromey [Mon, 4 Nov 2013 19:38:10 +0000 (12:38 -0700)]
fix PR c++/16117
This patch fixes PR c++/16117.
gdb has an extension so that users can use expressions like FILE::NAME
to choose a variable of the given name from the given file. The bug
is that this extension takes precedence over ordinary C++ expressions
of the same form. You might think this is merely hypothetical, but
now that C++ headers commonly do not use an extension, it is more
common.
This patch fixes the bug by making two related changes. First, it
changes gdb to prefer the ordinary C++ meaning of a symbol over the
extended meaning. Second, it arranges for single-quoting of the
symbol to indicate a preference for the extension.
Built and regtested on x86-64 Fedora 18.
New test case included.
2013-11-15 Tom Tromey <tromey@redhat.com>
PR c++/16117:
* c-exp.y (lex_one_token): Add "is_quoted_name" argument.
(classify_name): Likewise. Prefer a field of "this" over a
filename.
(classify_inner_name, yylex): Update.
2013-11-15 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (Variables): Note gdb rules for ambiguous cases.
Add example.
2013-11-15 Tom Tromey <tromey@redhat.com>
* gdb.cp/includefile: New file.
* gdb.cp/filename.exp: New file.
* gdb.cp/filename.cc: New file.
Michael Zolotukhin [Fri, 15 Nov 2013 13:22:32 +0000 (05:22 -0800)]
Reorder invalid default mask check
gas/
2013-11-15 Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
* config/tc-i386.c (check_VecOperands): Reorder checks.
gas/testsuite/
2013-11-15 Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
* gas/i386/inval-avx512f.s: Add invalid test for gather instruction
with default mask.
* gas/i386/inval-avx512f.l: Update correspondingly.
Doug Evans [Fri, 15 Nov 2013 07:07:55 +0000 (23:07 -0800)]
* gdb.python/py-breakpoint.exp: Make tests have unique names.
Doug Evans [Fri, 15 Nov 2013 06:36:19 +0000 (22:36 -0800)]
* gdb.python/py-breakpoint.exp: Reformat for 80 columns.
Doug Evans [Fri, 15 Nov 2013 06:23:16 +0000 (22:23 -0800)]
* gdb.python/py-breakpoint.exp: Split up into several functions,
each with their own test prefix.
Alan Modra [Fri, 15 Nov 2013 05:54:29 +0000 (16:24 +1030)]
Joel Brobecker [Thu, 31 Oct 2013 05:36:21 +0000 (01:36 -0400)]
Fix DW_OP_GNU_regval_type with FP registers
Consider the following code, compiled at -O2 on ppc-linux:
procedure Increment (Val : in out Float; Msg : String);
The implementation does not really matter in this case). In our example,
this function is being called from a function with Param_1 set to 99.0.
Trying to break inside that function, and running until reaching that
breakpoint yields:
(gdb) b increment
Breakpoint 1 at 0x100014b4: file callee.adb, line 6.
(gdb) run
Starting program: /[...]/foo
Breakpoint 1, callee.increment (val=99.0, val@entry=0.0, msg=...)
at callee.adb:6
6 if Val > 200.0 then
The @entry value for parameter "val" is incorrect, it should be 99.0.
The associated call-site parameter DIE looks like this:
.uleb128 0xc # (DIE (0x115) DW_TAG_GNU_call_site_parameter)
.byte 0x2 # DW_AT_location
.byte 0x90 # DW_OP_regx
.uleb128 0x21
.byte 0x3 # DW_AT_GNU_call_site_value
.byte 0xf5 # DW_OP_GNU_regval_type
.uleb128 0x3f
.uleb128 0x25
The DW_AT_GNU_call_site_value uses a DW_OP_GNU_regval_type
operation, referencing register 0x3f=63, which is $f31,
an 8-byte floating register. In that register, the value is
stored using the usual 8-byte float format:
(gdb) info float
f31 99.0 (raw 0x4058c00000000000)
The current code evaluating DW_OP_GNU_regval_type operations
currently is (dwarf2expr.c:execute_stack_op):
result = (ctx->funcs->read_reg) (ctx->baton, reg);
result_val = value_from_ulongest (address_type, result);
result_val = value_from_contents (type,
value_contents_all (result_val));
What the ctx->funcs->read_reg function does is read the contents
of the register as if it contained an address. The rest of the code
continues that assumption, thinking it's OK to then use that to
create an address/ulongest struct value, which we then re-type
to the type specified by DW_OP_GNU_regval_type.
We're getting 0.0 above because the read_reg implementations
end up treating the contents of the FP register as an integral,
reading only 4 out of the 8 bytes. Being a big-endian target,
we read the high-order ones, which gives us zero.
This patch fixes the problem by introducing a new callback to
read the contents of a register as a given type, and then adjust
the handling of DW_OP_GNU_regval_type to use that new callback.
gdb/ChangeLog:
* dwarf2expr.h (struct dwarf_expr_context_funcs) <read_reg>:
Extend the documentation a bit.
<get_reg_value>: New field.
* dwarf2loc.c (dwarf_expr_get_reg_value)
(needs_frame_get_reg_value): New functions.
(dwarf_expr_ctx_funcs, needs_frame_ctx_funcs): Add "get_reg_value"
callback.
* dwarf2-frame.c (get_reg_value): New function.
(dwarf2_frame_ctx_funcs): Add "get_reg_value" callback.
* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_regval_type>:
Use new callback to compute result_val.
gdb/testsuite/ChangeLog:
* gdb.ada/O2_float_param: New testcase.
Alan Modra [Fri, 15 Nov 2013 00:06:34 +0000 (10:36 +1030)]
Fixes to powerpc64 gold ELFv2 support
* powerpc.cc (Target_powerpc::glink_section): Provide non-const
accessor.
(Target_powerpc::Branch_info::make_stub): Make global entry stubs.
Only call ppc64_local_entry_offset for 64-bit. Restrict
symval_for_branch lookup to ELFv1.
(Stub_table::add_plt_call_entry): Use unsigned int off.
(Output_data_glink::Address, invalid_address): New.
(Output_data_glink::add_eh_frame): Move out of line. Add
support for ELFv2.
(Output_data_glink::add_global_entry, find_global_entry,
global_entry_address): New functions.
(Output_data_glink::global_entry_stubs_, end_branch_table_,
ge_size): New variables.
(Output_data_glink::set_final_data_size): Add global entry
stub sizing.
(Output_data_glink::do_write): Write global entry stubs.
(Target_powerpc::Scan::reloc_needs_plt_for_ifunc): Add target
parameter. Return true for ELFv2. Adjust callers.
(Target_powerpc::Scan::local, global): Restrict opd lookup to
ELFv1. Similarly for ifunc and dynamic relocation processing
specific to ELFv1. Recognize that symbols are defined on
their plt entries for ELFv2.
(Target_powerpc::symval_for_branch): Assert if called for
ELFv2 or ppc32.
(Target_powerpc::Relocate::relocate): Use global entry plt
stub for symbol value if such exists on ELFv2.
(Target_powerpc::Relocate::relocate): Don't call
symval_for_branch when ELFv2. Do adjust for local entry
offset when ELFv2.
(Target_powerpc::do_dynsym_value): Set symbols to global entry
plt stub for ELFv2.
(Target_powerpc::do_plt_address_for_global): Similarly.
Alan Modra [Mon, 11 Nov 2013 03:44:40 +0000 (14:14 +1030)]
PowerPC64 ELFv2 trampoline match
ELFv2 needs different plt call stubs to ELFv1, register usage differs
too. When I added these to ld I changed register usage in the ELFv1
stubs as well, simplifying the linker code and (perhaps) future
maintenance. All well and good, but this means gdb needs to cope with
more stub variants. This patch also handles skipping over addis/addi
setting up r2 in ELFv2 global entry code. We want breakpoints to be
set past this point to catch calls via the local entry point.
* ppc64-tdep.c (ppc64_plt_entry_point): Renamed from..
(ppc64_desc_entry_point): ..this. Update comments here and at
call points.
(ppc64_standard_linkage1, ppc64_standard_linkage2,
ppc64_standard_linkage3): Update comments.
(ppc64_standard_linkage4, ppc64_standard_linkage5,
(ppc64_standard_linkage6, ppc64_standard_linkage7): New insn
patterns.
(ppc64_standard_linkage4_target): New function.
(ppc64_skip_trampoline_code): Skip ELFv2 patterns too.
* rs6000-tdep.c (skip_prologue): Skip ELFv2 r2 setup. Correct
nop match. Fix comment wrap.
Alan Modra [Thu, 14 Nov 2013 23:00:01 +0000 (09:30 +1030)]
daily update
Tom Tromey [Wed, 6 Nov 2013 19:24:21 +0000 (12:24 -0700)]
print summary from "make check"
Pedro pointed out that it is handy for "make check" to print a summary
of the results. This happens in the check-single case and also if you
invoke runtest by hand.
This patch implements the same thing for check-parallel.
2013-11-14 Tom Tromey <tromey@redhat.com>
* Makefile.in (check-parallel): Print summary from gdb.sum.
Cary Coutant [Thu, 14 Nov 2013 21:15:06 +0000 (13:15 -0800)]
Revert "Fix race condition while building EH frame header."
This reverts commit
7cdd7d57e6fa3932eb63aa785ae0e3fa837aab20.
Tom Tromey [Thu, 14 Nov 2013 21:03:06 +0000 (14:03 -0700)]
fix grammar oddity in the manual
This patch fixes a buglet in the manual.
It's wrong to say that a method is defined "as" a subclass.
Instead it should say that a method is defined "in" a subclass.
I'm checking this in under the obvious rule.
2013-11-14 Tom Tromey <tromey@redhat.com>
* gdb.texinfo (Breakpoints In Python): Replace "as" with "in".
Pedro Alves [Thu, 14 Nov 2013 19:43:27 +0000 (19:43 +0000)]
infrun.c:handle_signal_stop: Move initial connection/attachment handling code earlier.
Before all this stop_soon handling, we have code that can end in
keep_going. Particularly, the thread_hop_needed code looked
suspicious considering breakpoint always-inserted mode, though on
closer inspection, it'd take connecting to multiple remote targets
that shared the same address space to trigger that.
Still, I think it's clearer if all this remote connection setup /
attach code is placed early, before any keep_going path could be
reached.
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (handle_signal_stop): Move STOP_QUIETLY,
STOP_QUIETLY_REMOTE and 'stop_after_trap' handling earlier.
Pedro Alves [Thu, 14 Nov 2013 19:43:27 +0000 (19:43 +0000)]
infrun.c: Split handle_inferior_event further.
After the previous patches, we only ever reach the code after the
initial 'switch (ecs->ws.kind)' switch for TARGET_WAITKIND_STOPPED.
We can now factor out all that to its own function.
Unfortunately, stepped_after_stopped_by_watchpoint needed to move to
the ecs. I think that indicates a state machine bug -- no event other
than TARGET_WAITKIND_STOPPED indicates a single-step actually
finished. TARGET_WAITKIND_SYSCALL_XXX, TARGET_WAITKIND_FORK, etc. are
all events that are triggered from the kernel, _within_ a syscall,
IOW, from userspace's perspective, halfway through an instruction
being executed. This might actually matter for the syscall events, as
syscalls can change memory (and thus trigger watchpoints).
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (struct execution_control_state)
<stepped_after_stopped_by_watchpoint>: New field.
(get_inferior_stop_soon): New function.
(handle_inferior_event): 'stepped_after_stopped_by_watchpoint' was
moved to struct execution_control_state -- adjust. Use
get_inferior_stop_soon. Split TARGET_WAITKIND_STOPPED handling to
new function.
(handle_signal_stop): New function, factored out from
handle_inferior_event.
Pedro Alves [Thu, 14 Nov 2013 19:43:27 +0000 (19:43 +0000)]
Eliminate enum bpstat_signal_value, simplify random signal checks further.
After the previous patch, there's actually no breakpoint type that
returns BPSTAT_SIGNAL_HIDE, so we can go back to having
bpstat_explains_signal return a boolean. The signal hiding actually
disappears.
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* break-catch-sig.c (signal_catchpoint_explains_signal): Adjust to
return a boolean.
* breakpoint.c (bpstat_explains_signal): Adjust to return a
boolean.
(explains_signal_watchpoint, base_breakpoint_explains_signal):
Adjust to return a boolean.
* breakpoint.h (enum bpstat_signal_value): Delete.
(struct breakpoint_ops) <explains_signal>: New returns a boolean.
(bpstat_explains_signal): Likewise.
* infrun.c (handle_inferior_event) <random signal checks>:
bpstat_explains_signal now returns a boolean - adjust. No longer
consider hiding signals.
Pedro Alves [Thu, 14 Nov 2013 19:43:26 +0000 (19:43 +0000)]
infrun.c:handle_inferior_event: Rework random signal checks.
Looking at the current random signal checks:
if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
random_signal
= !((bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
GDB_SIGNAL_TRAP)
!= BPSTAT_SIGNAL_NO)
|| stopped_by_watchpoint
|| ecs->event_thread->control.trap_expected
|| (ecs->event_thread->control.step_range_end
&& (ecs->event_thread->control.step_resume_breakpoint
== NULL)));
else
{
enum bpstat_signal_value sval;
sval = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
ecs->event_thread->suspend.stop_signal);
random_signal = (sval == BPSTAT_SIGNAL_NO);
if (sval == BPSTAT_SIGNAL_HIDE)
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
}
We can observe:
- the stepping checks bit:
...
|| ecs->event_thread->control.trap_expected
|| (ecs->event_thread->control.step_range_end
&& (ecs->event_thread->control.step_resume_breakpoint
== NULL)));
...
is just like currently_stepping:
static int
currently_stepping (struct thread_info *tp)
{
return ((tp->control.step_range_end
&& tp->control.step_resume_breakpoint == NULL)
|| tp->control.trap_expected
|| bpstat_should_step ());
}
except it misses the bpstat_should_step check (***).
It's not really necessary to check bpstat_should_step in the
random signal tests, because software watchpoints always end up in
the bpstat list anyway, which means bpstat_explains_signal with
GDB_SIGNAL_TRAP always returns at least BPSSTAT_SIGNAL_HIDE, but I
think the code is clearer if we reuse currently_stepping.
*** - bpstat_should_step checks to see if there's any software
watchpoint in the breakpoint list, because we need to force the
target to single-step all the way, to evaluate the watchpoint's
value at each step.
- we never hide GDB_SIGNAL_TRAP, even if the bpstat returns
BPSTAT_SIGNAL_HIDE, which is actually the default for all
breakpoints. If we make the default be BPSTAT_SIGNAL_PASS, then
we can merge the two bpstat_explains_signal paths.
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* breakpoint.c (bpstat_explains_signal) <Moribund locations>:
Return BPSTAT_SIGNAL_PASS instead of BPSTAT_SIGNAL_HIDE.
(explains_signal_watchpoint): Return BPSTAT_SIGNAL_PASS instead of
BPSTAT_SIGNAL_HIDE.
(base_breakpoint_explains_signal): Return BPSTAT_SIGNAL_PASS
instead of BPSTAT_SIGNAL_HIDE.
* infrun.c (handle_inferior_event): Rework random signal checks.
Pedro Alves [Thu, 14 Nov 2013 19:43:26 +0000 (19:43 +0000)]
infrun.c: Don't set ecs->random_signal for "catchpoint" events (eliminate ecs->random_signal).
This goes a step forward in making only TARGET_WAITKIND_STOPPED talk
about signals.
There's no reason for the "catchpoint" TARGET_WAITKIND_XXXs to consult
bpstat about signals -- unlike breakpoints, all these events are
continuable, so we don't need to do a remove-break/step/reinsert-break
-like dance. That means we don't actually need to run them through
process_event_stop_test (for the bpstat_what checks), and can just use
bpstat_causes_stop instead. Note we were already using it in the
TARGET_WAITKIND_(V)FORKED cases.
Then, these "catchpoint" waitkinds don't need to set
ecs->random_signal for anything, because they check it immediately
afterwards (and the value they set is never used again).
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (struct execution_control_state): Remove
'random_signal' field.
(handle_syscall_event): Use bpstat_causes_stop instead of
bpstat_explains_signal. Don't set ecs->random_signal.
(handle_inferior_event): New 'random_signal' local.
<TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED,
TARGET_WAITKIND_EXECD>: Use bpstat_causes_stop instead of
bpstat_explains_signal. Don't set ecs->random_signal.
<TARGET_WAITKIND_STOPPED>: Adjust to use local instead of
ecs->random_signal.
Pedro Alves [Thu, 14 Nov 2013 19:43:25 +0000 (19:43 +0000)]
infrun.c:handle_inferior_event: Move comment.
This comment applies to the whole handle_inferior_event flow, top to
bottom. Best move it to the function's intro.
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event): Move comment from the
function's body to the function's description, adjusted.
Pedro Alves [Thu, 14 Nov 2013 19:43:25 +0000 (19:43 +0000)]
infrun.c:handle_inferior_event: Don't fall through in TARGET_WAITKIND_LOADED handling.
Of all the TARGET_WAITKIND_XXXs event kinds other than
TARGET_WAITKIND_STOPPED, TARGET_WAITKIND_LOADED is the only kind that
doesn't end in a return, instead falling through to all the
signal/breakpoint/stepping handling code. But it only falls through
in the STOP_QUIETLY_NO_SIGSTOP and STOP_QUIETLY_REMOTE cases, which
means the
/* This is originated from start_remote(), start_inferior() and
shared libraries hook functions. */
if (stop_soon == STOP_QUIETLY || stop_soon == STOP_QUIETLY_REMOTE)
{
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: quietly stopped\n");
stop_stepping (ecs);
return;
}
bit is eventually reached. All tests before that is reached will
always fail. It's simpler to inline the stop_soon checks close to the
TARGET_WAITKIND_LOADED code, which allows removing the fall through.
Tested on x86_64 Fedora 17, but that doesn't exercise this
TARGET_WAITKIND_LOADED.
Also ran gdb.base/solib-disc.exp on Cygwin/gdbserver, which exercises
reconnection while the inferior is stopped at an solib event, but then
again, gdbserver always replies a regular trap on initial connection,
instead of the last event the program had seen:
Sending packet: $?#3f...Packet received: T0505:
4ca72800;04:
f8a62800;08:
62fcc877;thread:d28;
Sending packet: $Hc-1#09...Packet received: E01
Sending packet: $qAttached#8f...Packet received: 0
Packet qAttached (query-attached) is supported
infrun: clear_proceed_status_thread (Thread 3368)
Sending packet: $qOffsets#4b...Packet received:
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 42000 [Thread 3368],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x77c8fc62
infrun: quietly stopped
infrun: stop_stepping
So the only way to exercise this would be to hack gdbserver. I didn't
go that far though. I'm reasonably confident this is correct.
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>:
Handle STOP_QUIETLY_NO_SIGSTOP and STOP_QUIETLY_REMOTE here.
Assert we never fall through out of the TARGET_WAITKIND_LOADED
case.
Cary Coutant [Tue, 14 May 2013 21:19:08 +0000 (14:19 -0700)]
Add --verify-only option to DWP.
gold/
* dwp.cc (Dwo_file_entry): New type.
(File_list): Use Dwo_file_entry.
(Dwo_file::verify): New function.
(Dwo_file::verify_dwo_list): New function.
(Dwo_file::sized_verify_dwo_list): New function.
(Dwo_name_info_reader::visit_compilation_unit): Add dwo_id to file
list.
(Dwp_options): New enum type.
(dwp_options): Add --verify-only.
(usage): Likewise.
(main): Likewise.
* dwp.h (gold_info): Add declaration.
Cary Coutant [Fri, 11 Oct 2013 21:12:16 +0000 (14:12 -0700)]
Fix race condition while building EH frame header.
gold/
PR gold/14860
* ehframe.cc (Eh_frame_hdr::Eh_frame_hdr): Initialize lock_.
(Ehframe_hdr::set_final_data_size): Allocate a Lock.
* ehframe.h (Eh_frame_hdr::record_fde): Hold the lock while
updating fde_offsets_.
(Eh_frame_hdr::lock_): New data member.
Tom Tromey [Thu, 14 Nov 2013 18:09:14 +0000 (11:09 -0700)]
off-by-one fix for py-linetable.c
While digging into a different memory corruption error, I happened to
notice one coming from the linetable code. In a couple of spots, the
wrong termination condition was used in a loop, leading gdb to read
one element past the end of the linetable.
Built and regtested on x86-64 Fedora 18. Also verified using
valgrind. I'm checking this in.
2013-11-14 Tom Tromey <tromey@redhat.com>
* python/py-linetable.c (ltpy_has_line)
(ltpy_get_all_source_lines): Fix loop termination condition.
Nick Clifton [Thu, 14 Nov 2013 15:39:51 +0000 (15:39 +0000)]
PR ld/16017
* elf32-arm.c (elf32_arm_populate_plt_entry): Return a boolean
value, TRUE for success, FALSE for failure.
Fail if attempting to create a PLT entry for a thumb only target.
(elf32_arm_final_link_relocate): Check result of calling
elf32_arm_populate_plt_entry.
(elf32_arm_finish_dynamic_symbol): Likewise.
Omair Javaid [Thu, 14 Nov 2013 15:16:20 +0000 (15:16 +0000)]
testsuite/gdb.dwarf2: dw2-case-insensitive.exp: p fuNC_lang fails on arm
dw2-case-insensitive.exp: p fuNC_lang fails on arm. The problem occurs
when thumb mode code is generated. On ARM last bit of function pointer
value indicates whether the target function is an ARM (if 0) or Thumb
(if 1) routine. The PC address should refer to actual address in
either case. This patch adds new compile unit and function labels to
code which act as address ranges of compile unit and functions in
debug information. Therefore address ranges will have correct
addresses and not the ones with an incremented least significant bit.
This patch has been tested on x86_64 and arm machines.
gdb/testsuite/ChangeLog:
2013-11-14 Omair Javaid <Omair.Javaid@linaro.org>
* gdb.dwarf2/dw2-case-insensitive-debug.S: Updated compile unit
and function label names.
* gdb.dwarf2/dw2-case-insensitive.c: Created function and
compile unit labels.
Nick Clifton [Thu, 14 Nov 2013 14:24:34 +0000 (14:24 +0000)]
PR ld/16082
* elf32-hppa.c (elf32_hppa_hide_symbol): Remove old version
information when forcing a symbol to be local.
Joel Brobecker [Mon, 11 Nov 2013 05:21:44 +0000 (09:21 +0400)]
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.
Joel Brobecker [Mon, 11 Nov 2013 05:19:32 +0000 (09:19 +0400)]
New function cli-utils.c:extract_arg_const
This function provides the exact same functionality as extract_arg,
except that it takes a "const char**" instead of a "char **".
It allows us also to re-implement extract_arg almost as a simple
wrapper around the new function.
gdb/ChangeLog:
Pedro Alves <palves@redhat.com>
Joel Brobecker <brobecker@adacore.com>
* cli/cli-utils.h (extract_arg_const): Add declaration.
* cli/cli-utils.c (extract_arg_const): New function.
(extract_arg): Reimplement using extract_arg_const.
Joel Brobecker [Mon, 11 Nov 2013 05:13:57 +0000 (09:13 +0400)]
language.h: Add "symtab.h" #include
In addition to the fact that language.h depends on a number of struct
types declared in symtab.h, language.h also depends on an enumerated
type (domain_enum). So language.h should #include "symtab.h".
gdb/ChangeLog:
* language.h: Add "symtab.h" #include.
Will Newton [Tue, 12 Nov 2013 11:44:18 +0000 (11:44 +0000)]
ld/ARM: Fix script-type testsuite failure.
Commit
34a79995c4cc34f6f41e2a4b2df477db31b31f0c changed how STT_FILE
symbols were emitted but this testcase got missed in the cleanup.
ld/testsuite/ChangeLog:
2013-11-14 Will Newton <will.newton@linaro.org>
* ld-arm/script-type.sym: Remove redundant STT_FILE symbol.
Doug Evans [Thu, 14 Nov 2013 07:35:18 +0000 (23:35 -0800)]
* breakpoint.c (bpstat_check_breakpoint_conditions): For thread
specific breakpoints, don't evaluate breakpoint condition if
different thread.
Alan Modra [Wed, 13 Nov 2013 23:00:02 +0000 (09:30 +1030)]
daily update
Keith Seitz [Wed, 13 Nov 2013 22:19:10 +0000 (14:19 -0800)]
Fix PR # dyslexia in ChangeLog for previous commit. It should have
been for c++/7935 (not 7539).
Keith Seitz [Wed, 13 Nov 2013 20:33:34 +0000 (12:33 -0800)]
PR c++/7539
PR c++/10541
This patch fixes some namespace alias bugs reported in the above bugs.
Links to all mailing list discussion:
https://sourceware.org/ml/gdb-patches/2013-07/msg00649.html
https://sourceware.org/ml/gdb-patches/2013-09/msg00557.html
https://sourceware.org/ml/gdb-patches/2013-11/msg00156.html
Keith Seitz [Wed, 13 Nov 2013 19:29:22 +0000 (11:29 -0800)]
Fix regressions caused by const-ify linespec patch:
https://sourceware.org/ml/gdb-patches/2013-10/msg00478.html
Tom Tromey [Wed, 13 Nov 2013 17:01:25 +0000 (10:01 -0700)]
fix multi-arch-exec for parallel mode
I noticed today that multi-arch-exec.exp was failing in parallel mode.
The bug is that multi-arch-exec.c assumes the non-parallel directory
layout.
This patch fixes the problem using the same "BASEDIR" approach used in
other tests.
Tested both ways on x86-64 Fedora 18.
I'm checking this in.
2013-11-13 Tom Tromey <tromey@redhat.com>
* gdb.multi/multi-arch-exec.exp: Define BASEDIR when compiling.
* gdb.multi/multi-arch-exec.c (main): Use BASEDIR.
Yufeng Zhang [Wed, 13 Nov 2013 14:47:04 +0000 (14:47 +0000)]
bfd/
* elfnn-aarch64.c (elfNN_aarch64_howto_table): Use
R_AARCH64_TLS_DTPMOD64 instead of R_AARCH64_TLS_DTPMOD;
likewise for R_AARCH64_TLS_DTPREL and R_AARCH64_TLS_TPREL.
include/elf/
* aarch64.h: Define R_AARCH64_TLS_DTPMOD64,
R_AARCH64_TLS_DTPREL64 and R_AARCH64_TLS_TPREL64; guard
R_AARCH64_TLS_DTPMOD, R_AARCH64_TLS_DTPREL and
R_AARCH64_TLS_TPREL with RELOC_MACROS_GEN_FUNC.
Nick Clifton [Wed, 13 Nov 2013 12:54:29 +0000 (12:54 +0000)]
* rescoff.c (write_coff_file): Use 64-bit alignment for resource
data.
(coff_res_to_bin): Likewise.
Doug Evans [Wed, 13 Nov 2013 05:40:41 +0000 (21:40 -0800)]
* breakpoint.c (breakpoint_cond_eval): Fix and enhance comment.
Doug Evans [Wed, 13 Nov 2013 05:39:00 +0000 (21:39 -0800)]
fix email address in earlier commit
Joel Brobecker [Tue, 12 Nov 2013 09:43:44 +0000 (13:43 +0400)]
Replace "info-ada-exceptions" by "ada-exceptions" in -list-features
Rather than having -list-features report support for the GDB/MI
commands providing access to Ada exception catchpoints with one entry,
and the GDB/MI command providing the list of Ada exceptions with
a second entry, this patch merges it all within one single entry.
This is OK, because all these commands were added within a short
amount of time, and within the same release cycle; and it reduces
a bit the size of the output.
gdb/ChangeLog:
* mi/mi-main.c (mi_cmd_list_features): Replace "info-ada-exceptions"
entry with "ada-exceptions".
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Miscellaneous Commands): Delete
the documentation of "info-ada-exceptions" in the output
of the "-list-features" command. Add the documentation
of the "ada-exception" entry instead.
Joel Brobecker [Tue, 5 Nov 2013 12:01:45 +0000 (07:01 -0500)]
crash while re-reading symbols from objfile on ppc-aix.
This patch aims at fixing the following problem, where the user:
. debugs its program
. makes a modification and rebuilds it *without exiting the debugger*
. returns to its debugging session and restarts the inferior
In that situation, the debugger notices that the underlying executable
has changed and that re-reading its symbols is needed. Shortly after
displaying a message informing the user of the situation, GDB crashes:
(gdb) run
[...]
`/[...]/dest' has changed; re-reading symbols.
zsh:
13434922 segmentation fault (core dumped)
The crash occurs while trying to allocate some memory on the bfd_bfd
obstack. But, at some point in time, the whole obstack data gets
corrupted, nullified. So the memory allocation fails trying to call
a function at a NULL address. (side note: when debugging GDB in GDB,
top-gdb reports a SIGILL, while the shell makes it look like it was
a SIGSEGV - the discrepancy is not critical to the investigation
and therefore was not explored)
The corruption occurred because the region where the per_bfd data
got free'ed nearly after it got allocated! This is what happens,
in chronological order (see reread_symbols):
1. GDB notices that the executable has changed, decides to
re-read its symbols.
2. Opens a new bfd, unrefs the old one
3. Calls set_objfile_per_bfd (objfile);
4. Re-initializes the objfile's obstack:
obstack_init (&objfile->objfile_obstack);
I think that the normal behavior for set_objfile_per_bfd would
be to search for already-allocated shared per_bfd data, and
allocate new one if not found. The critical difference between
a platform such as x86_64-linuxe where it works, and ppc-aix,
where it doesn't lies in the fact that bfd-data sharing is not
activated on ppc-aix, and as a result, the per-bfd data gets
allocated on the objfile's obstack instead of in the bfd objalloc:
/* If the object requires gdb to do relocations, we simply fall
back to not sharing data across users. These cases are rare
enough that this seems reasonable. */
if (abfd != NULL && !gdb_bfd_requires_relocations (abfd))
{
storage = bfd_zalloc (abfd, sizeof (struct objfile_per_bfd_storage));
set_bfd_data (abfd, objfiles_bfd_data, storage);
}
else
storage = OBSTACK_ZALLOC (&objfile->objfile_obstack,
struct objfile_per_bfd_storage);
Allocating that per_bfd storage is of course nearly useless since
we end up free-ing right after in step (4) above. Eventually,
the memory region ends up being re-used, hence the corruption
leading to the crash.
This fix was simply to move the call to set_objfile_per_bfd after
the objfile's obstack re-initialization.
gdb/ChangeLog:
* symfile.c (reread_symbols): Move call to set_objfile_per_bfd
after re-initialization of OBJFILE's obstack.
Doug Evans [Wed, 13 Nov 2013 02:23:12 +0000 (18:23 -0800)]
* breakpoint.c (bpstat_check_breakpoint_conditions): Assert
bs->stop != 0 on entry. Update function comment. Simplify early
exit for frame mismatch. Reindent rest of function.
Alan Modra [Tue, 12 Nov 2013 23:00:07 +0000 (09:30 +1030)]
daily update
Doug Evans [Tue, 12 Nov 2013 22:27:04 +0000 (14:27 -0800)]
* gdb.base/fileio.exp: Make $dir2 writable after the test is done
so that "rm -rf $builddir" Just Works.
Andreas Arnez [Tue, 12 Nov 2013 17:03:54 +0000 (18:03 +0100)]
Fix GDB crash with upstream GCC due to qsort(NULL, ...)
Upstream GCC's new pass '-fisolate-erroneous-paths' may introduce
traps at places where GCC has determined undefined behavior, e.g. when
passing a NULL pointer to a function that defines this argument as
__attribute__(__nonnull__(...)). In particular this applies to
uniquify_strings(), because it invokes qsort() with NULL when the
'strings' vector is empty. I hit this problem on s390x when trying to
execute "break main" on a C program.
gdb/
2013-11-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
* objc-lang.c (uniquify_strings): Prevent invoking qsort with
NULL.
Doug Evans [Tue, 12 Nov 2013 17:43:17 +0000 (09:43 -0800)]
Work around gold/15646.
* dwarf2read.c (read_index_from_section): Update comment.
(struct dw2_symtab_iterator): New member global_seen.
(dw2_symtab_iter_init): Initialize it.
(dw2_symtab_iter_next): Skip duplicate global symbols.
(dw2_expand_symtabs_matching): Ditto.
Joel Brobecker [Tue, 12 Nov 2013 03:31:04 +0000 (07:31 +0400)]
Small fix (first word of sentence to start with capital letter)
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Miscellaneous Commands): Fix the first
word of a couple of sentences to start with a capital letter.