daily update
Fix for PR gdb/17235: possible bug extracting systemtap probe operand

This patch is a fix to PR gdb/17235.  The bug is about an unused
variable that got declared and set during one of the parsing phases of
an SDT probe's argument.  I took the opportunity to rewrite some of the
code to improve the parsing.  The bug was actually a thinko, because
what I wanted to do in the code was to discard the number on the string
being parsed.

During this portion, the code identifies that it is dealing with an
expression that begins with a sign ('+', '-' or '~').  This means that
the expression could be:

- a numeric literal (e.g., '+5')
- a register displacement (e.g., '-4(%rsp)')
- a subexpression (e.g., '-(2*3)')

So, after saving the sign and moving forward 1 char, now the code needs
to know if there is a digit followed by a register displacement prefix
operand (e.g., '(' on x86_64).  If yes, then it is a register
operation.  If not, then it will be handled recursively, and the code
will later apply the requested operation on the result (either a '+', a
'-' or a '~').

With the bug, the code was correctly discarding the digit (though using
strtol unnecessarily), but it wasn't properly dealing with
subexpressions when the register indirection prefix was '(', like on
x86_64.  This patch also fixes this bug, and includes a testcase.  It
passes on x86_64 Fedora 20.
Regenerate top-level configure.

Our top-level configure somehow got out of sync the current
configure.ac, so this patch regenerates it.

ChangeLog:

	* configure: Regenerate.
daily update
infcmd.c (program_info): Fix typo.

gdb/ChangeLog:

	* infcmd.c (program_info): Fix typo.
PR 15276: Add $_caller_is, $_caller_matches, $_any_caller_is, $_any_caller_matches

gdb/ChangeLog:

	PR 15276
	* NEWS: Mention $_caller_is, $_caller_matches, $_any_caller_is,
	$_any_caller_matches.
	* data-directory/Makefile.in (PYTHON_FILE_LIST): Add caller_is.py.
	* python/lib/gdb/function/caller_is.py: New file.

gdb/testsuite/ChangeLog:

	PR 15276
	* gdb.python/py-caller-is.c: New file.
	* gdb.python/py-caller-is.exp: New file.

gdb/doc/ChangeLog:

	PR 15276
	* gdb.texinfo (Convenience Funs): Document $_caller_is,
	$_caller_matches, $_any_caller_is, $_any_caller_matches.
Add missing author to previous entry (PR 15276).
MIPS testsuite cleanup - part 1

binutils/testsuite/

	* binutils-all/readelf.ss-mips: Account for new sections.

gas/testsuite/

	* gas/elf/type.e: Account for new sections.
	* gas/mips/mips16-e.d: Likewise.
	* gas/mips/mips16-f.d: Likewise.
	* gas/mips/mipsel16-e.d: Likewise.
	* gas/mips/mipsel16-f.d: Likewise.
	* gas/mips/tmips16-e.d: Appropriately escape dots.
	* gas/mips/tmips16-f.d: Likewise.
	* gas/mips/tmipsel16-e.d: Likewise.
	* gas/mips/tmipsel16-f.d: Likewise.
MIPS testsuite cleanup - part 2

gas/testsuite/

	* gas/mips/module-defer-warn2.l: Ignore differences in output from
	64-bit vs 32-bit targets using O32.
MIPS testsuite cleanup - part 3

gas/testsuite/

	* gas/mips/attr-gnu-abi-fp-1.d: Relax expected output.
	* gas/mips/elf_ase_micromips-2.d: Likewise.
	* gas/mips/elf_ase_micromips.d: Likewise.
	* gas/mips/elf_ase_mips16-2.d: Likewise.
	* gas/mips/elf_ase_mips16.d: Likewise.
	* gas/mips/module-mfp32.d: Likewise.
	* gas/mips/module-msingle-float.d: Likewise.
	* gas/mips/module-msoft-float.d: Likewise.
MIPS testsuite cleanup - part 4

ld/testsuite/

	* ld-mips-elf/abiflags-strip1-ph.d: Ignore big/little endian
	differences. Ignore program headers other than PT_MIPS_ABIFLAGS.
	Do not force -32, -EB and ld emulation but instead rely on the
	test driver to build for some form of O32.
	* ld-mips-elf/abiflags-strip2-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip3-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip4-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip5-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip6-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip7-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip8-ph.d: Likewise.
	* ld-mips-elf/abiflags-strip9-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-0-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-05.d: Likewise.
	* ld-mips-elf/attr-gnu-4-06.d: Likewise.
	* ld-mips-elf/attr-gnu-4-07.d: Likewise.
	* ld-mips-elf/attr-gnu-4-1-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-10.d: Likewise.
	* ld-mips-elf/attr-gnu-4-15.d: Likewise.
	* ld-mips-elf/attr-gnu-4-16.d: Likewise.
	* ld-mips-elf/attr-gnu-4-17.d: Likewise.
	* ld-mips-elf/attr-gnu-4-2-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-25.d: Likewise.
	* ld-mips-elf/attr-gnu-4-26.d: Likewise.
	* ld-mips-elf/attr-gnu-4-27.d: Likewise.
	* ld-mips-elf/attr-gnu-4-3-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-35.d: Likewise.
	* ld-mips-elf/attr-gnu-4-36.d: Likewise.
	* ld-mips-elf/attr-gnu-4-37.d: Likewise.
	* ld-mips-elf/attr-gnu-4-4-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-45.d: Likewise.
	* ld-mips-elf/attr-gnu-4-46.d: Likewise.
	* ld-mips-elf/attr-gnu-4-47.d: Likewise.
	* ld-mips-elf/attr-gnu-4-5-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-50.d: Likewise.
	* ld-mips-elf/attr-gnu-4-51.d: Likewise.
	* ld-mips-elf/attr-gnu-4-52.d: Likewise.
	* ld-mips-elf/attr-gnu-4-53.d: Likewise.
	* ld-mips-elf/attr-gnu-4-54.d: Likewise.
	* ld-mips-elf/attr-gnu-4-55.d: Likewise.
	* ld-mips-elf/attr-gnu-4-56.d: Likewise.
	* ld-mips-elf/attr-gnu-4-57.d: Likewise.
	* ld-mips-elf/attr-gnu-4-58.d: Likewise.
	* ld-mips-elf/attr-gnu-4-6-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-60.d: Likewise.
	* ld-mips-elf/attr-gnu-4-61.d: Likewise.
	* ld-mips-elf/attr-gnu-4-62.d: Likewise.
	* ld-mips-elf/attr-gnu-4-63.d: Likewise.
	* ld-mips-elf/attr-gnu-4-64.d: Likewise.
	* ld-mips-elf/attr-gnu-4-65.d: Likewise.
	* ld-mips-elf/attr-gnu-4-66.d: Likewise.
	* ld-mips-elf/attr-gnu-4-67.d: Likewise.
	* ld-mips-elf/attr-gnu-4-68.d: Likewise.
	* ld-mips-elf/attr-gnu-4-7-ph.d: Likewise.
	* ld-mips-elf/attr-gnu-4-70.d: Likewise.
	* ld-mips-elf/attr-gnu-4-71.d: Likewise.
	* ld-mips-elf/attr-gnu-4-72.d: Likewise.
	* ld-mips-elf/attr-gnu-4-73.d: Likewise.
	* ld-mips-elf/attr-gnu-4-74.d: Likewise.
	* ld-mips-elf/attr-gnu-4-75.d: Likewise.
	* ld-mips-elf/attr-gnu-4-76.d: Likewise.
	* ld-mips-elf/attr-gnu-4-77.d: Likewise.
	* ld-mips-elf/attr-gnu-4-78.d: Likewise.
	* ld-mips-elf/mips-elf.exp: Update default abi_asflags(o32) to explicitly
	pass -32 for the 'no abi' configurations.  Modify the way attr-gnu* tests
	are run to use O32 flags appropriate for the current target.
daily update
Fix crash on Python frame filters with unreadable arg

https://bugzilla.redhat.com/show_bug.cgi?id=1126177

ERROR: AddressSanitizer: SEGV on unknown address 0x000000000050 (pc 0x000000992bef sp 0x7ffff9039530 bp 0x7ffff9039540
T0)
    #0 0x992bee in value_type .../gdb/value.c:925
    #1 0x87c951 in py_print_single_arg python/py-framefilter.c:445
    #2 0x87cfae in enumerate_args python/py-framefilter.c:596
    #3 0x87e0b0 in py_print_args python/py-framefilter.c:968

It crashes because frame_arg::val is documented it may contain NULL
(frame_arg::error is then non-NULL) but the code does not handle it.

Another bug is that py_print_single_arg() calls goto out of its TRY_CATCH
which messes up GDB cleanup chain crashing GDB later.

It is probably 7.7 regression (I have not verified it) due to the introduction
of Python frame filters.

gdb/ChangeLog

	PR python/17355
	* python/py-framefilter.c (py_print_single_arg): Handle NULL FA->VAL.
	Fix goto out of TRY_CATCH.

gdb/testsuite/ChangeLog

	PR python/17355
	* gdb.python/amd64-py-framefilter-invalidarg.S: New file.
	* gdb.python/py-framefilter-invalidarg-gdb.py.in: New file.
	* gdb.python/py-framefilter-invalidarg.exp: New file.
	* gdb.python/py-framefilter-invalidarg.py: New file.
Fix PR gdb/17035: "show user" doesn't list user-defined commands that
have empty bodies.

User-defined commands that have empty bodies weren't being shown because
the print function returned too soon.  Now, it prints the command's name
before checking if it has any body at all.  This also fixes the same
problem on "show user <myemptycommand>", which wasn't being printed due
to a similar reason.

gdb/Changelog:

	* cli/cli-cmds.c (show_user): Use cli_user_command_p to
	decide whether we display the command on "show user".
	* cli/cli-script.c (show_user_1): Only verify cmdlines after
	printing command name.
	* cli/cli-decode.h (cli_user_command_p): Declare new function.
	* cli/cli-decode.c (cli_user_command_p): Create helper function
	to verify whether cmd_list_element is a user-defined command.

gdb/testsuite/Changelog:

	* gdb.base/commands.exp: Add tests to verify user-defined
	commands with empty bodies.
	* gdb.python/py-cmd.exp: Test that we don't show user-defined
	python commands in `show user command`.
	* gdb.python/scm-cmd.exp: Test that we don't show user-defined
	scheme commands in `show user command`.
daily update
Fix ppc_collect/supply_ptrace_register() routines

This patch fixes the routines to collect and supply ptrace registers on ppc64le
gdbserver. Originally written for big endian arch, they were causing several
issues on little endian. With this fix, the number of unexpected failures in
the testsuite dropped from 263 to 72 on ppc64le.

gdb/gdbserver/ChangeLog

	* linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
	endianness into account.
	(ppc_supply_ptrace_register): Likewise.
Change pe/coff build-id section name to '.buildid'

The section name used to store the build-id on pe/coff is arbitrary, as it's
contents should be located using the pe/coff header's DataDirectory debug data
entry, not by using the section name.

But '.build-id' is not a good choice for that section name, as it is 9
characters long, and hence truncated to 8 characters when
--disable-long-section-names is used (which is the default, when producing an
executable with no dwarf debug sections, e.g. using ld --strip-all --build-id)

This truncation then breaks 'objcopy --only-keep-debug', which does use the
section name, due to concerns that keeping an arbitrary section which contains
the debug directory is not sensible.

binutils/ChangeLog

2014-09-01  Jon TURNEY  <jon.turney@dronecode.org.uk>

	* objcopy.c (is_nondebug_keep_contents_section): Change pe/coff
	build-id section name from '.build-id' to '.buildid'.

ld/ChangeLog

2014-09-01  Jon TURNEY  <jon.turney@dronecode.org.uk>

	* emultempl/pe.em (write_build_id, setup_build_id): Change pe/coff
	build-id section name from '.build-id' to '.buildid'.
	* emultempl/pep.em (write_build_id, setup_build_id): Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
daily update
Set print symbol off in mi-var-display.exp

Hi,
I see the following fail on arm-none-eabi target,

-var-evaluate-expression -f nat foo^M
^done,value="0x3 <_ftext+2>"^M
(gdb) ^M
FAIL: gdb.mi/mi-var-display.exp: eval variable -f nat foo

the "<_ftext+2>" isn't expected in the test, so "set print symbol off"
can prevent printing it.  It is obvious and I'll commit it in three
days if no comments.

gdb/testsuite:

2014-09-09  Yao Qi  <yao@codesourcery.com>

	* gdb.mi/mi-var-display.exp: Set print symbol off.
Replace use of magic number with named constant.

gdb/ChangeLog:

	* guile/scm-cmd.c (gdbscm_parse_command_name): Replace magic number
	with named constant.  Fix style of pointer comparison.
	* python/py-cmd.c (gdbpy_parse_command_name): Ditto.