2013-05-10  Phil Muldoon  <pmuldoon@redhat.com>

	* stack.c (backtrace_command_1): Add "no-filters", and Python frame
	filter logic.
	(backtrace_command): Add "no-filters" option parsing.
	(_initialize_stack): Alter help to reflect "no-filters" option.
	* Makefile.in (SUBDIR_PYTHON_OBS): Add py-framefilter.o
	(SUBDIR_PYTHON_SRCS): Add py-framefilter.c
	(py-frame.o): Add target
	* data-directory/Makefile.in (PYTHON_DIR): Add Python frame
	filter files.
	* python/python.h: Add new frame filter constants, and flag enum.
	(apply_frame_filter): Add definition.
	* python/python.c (apply_frame_filter): New non-Python
	enabled function.
	* python/py-utils.c (py_xdecref): New function.
	(make_cleanup_py_xdecref): Ditto.
	* python/py-objfile.c: Declare frame_filters dictionary.
	(objfpy_dealloc): Add frame_filters dealloc.
	(objfpy_new): Initialize frame_filters attribute.
	(objfile_to_objfile_object): Ditto.
	(objfpy_get_frame_filters): New function.
	(objfpy_set_frame_filters): New function.
	* python/py-progspace.c: Declare frame_filters dictionary.
	(pspy_dealloc): Add frame_filters dealloc.
	(pspy_new): Initialize frame_filters attribute.
	(pspacee_to_pspace_object): Ditto.
	(pspy_get_frame_filters): New function.
	(pspy_set_frame_filters): New function.
	* python/py-framefilter.c: New file.
	* python/lib/gdb/command/frame_filters.py: New file.
	* python/lib/gdb/frames.py: New file.
	* python/lib/gdb/__init__.py: Initialize global frame_filters
	dictionary
	* python/lib/gdb/FrameDecorator.py: New file.
	* python/lib/gdb/FrameIterator.py: New file.
	* mi/mi-cmds.c (mi_cmds): Add frame filters command.
	* mi/mi-cmds.h: Declare.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Add
	--no-frame-filter logic, and Python frame filter logic.
	(stack_enable_frame_filters): New function.
	(parse_no_frame_option): Ditto.
	(mi_cmd_stack_list_frames): Add --no-frame-filter and Python frame
	filter logic.
	(mi_cmd_stack_list_locals): Ditto.
	(mi_cmd_stack_list_args): Ditto.
	(mi_cmd_stack_list_variables): Ditto.
	* NEWS: Add frame filter note.

2013-05-10  Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.python/py-framefilter.py: New File.
	* gdb.python/py-framefilter-mi.exp: Ditto.
	* gdb.python/py-framefilter.c: Ditto.
	* gdb.python/py-framefilter-mi.exp: Ditto.
	* gdb.python/py-framefilter-mi.c: Ditto,
	* gdb.python/py-framefilter-gdb.py.in: Ditto.

2013-05-10 Phil Muldoon  <pmuldoon@redhat.com>

	* gdb.texinfo (Backtrace): Add "no-filter" argument.
	(Python API): Add Frame	Filters API, Frame Wrapper API,
	Writing a Frame Filter/Wrapper,	Managing Management of Frame
	Filters chapter entries.
	(Frame Filters API): New Node.
	(Frame Wrapper API): New Node.
	(Writing a Frame Filter): New Node.
	(Managing Frame Filters): New Node.
	(Progspaces In Python): Add note about frame_filters attribute.
	(Objfiles in Python): Ditto.
	(GDB/MI Stack Manipulation): Add -enable-frame-filters command,
	@anchors and --no-frame-filters option to -stack-list-variables,
	-stack-list-frames, -stack-list-locals and -stack-list-arguments
	commands.
move sparc-sol-thread.c back into sol-thread.c.

The routines in sparc-sol-thread used to be SPARC-specific (and
documented as such in the ptrace man page), and therefore hosting them
in a sparc-specific file made sense.  However, newer versions of
Solaris now use those callbacks (Solaris 10 Update 10, apparently),
and thus the note about these callbacks being specific to SPARC
was removed.

So this patch deletes sparc-sol-thread.c and moves the code back
inside sol-thread.c.

gdb/ChangeLog:

        PR tdep/15420:
        * sol-thread.c (ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs):
        New functions, directly copied from sparc-sol-thread.c.
        * sparc-sol-thread.c: Delete.
        * configure.ac: Remove code handling sparc-solaris-thread.c.
        * configure: Regenerate.
AIX: wrong address for shared object's .bss section

gdb/ChangeLog:

        * solib-aix.c (solib_aix_relocate_section_addresses):
        For the .bss section action, apply the same offset as
        the .data section.
XCOFF/AIX: Remove SEC_ALLOC flags for unmapped sections.

The .except, .loader and .typchk are not mapped to memory,
so do not set their SEC_ALLOC flag.

bfd/ChangeLog:

        * coffcode.h (styp_to_sec_flags) [RS6000COFF_C]: Add handling
        of STYP_EXCEPT, STYP_LOADER and STYP_TYPCHK sections.

ld/testsuite/ChangeLog:

        * ld-powerpc/aix-core-sec-1.hd, ld-powerpc/aix-core-sec-2.hd,
        ld-powerpc/aix-core-sec-3.hd: Adjust expected section flags
        for section .loader.
Remove FIXME in solib-aix.c:solib_aix_relocate_section_addresses

This issue should now be fixed thanks to a change in bfd removing
the SEC_ALLOC flag from all sections that do not get mapped to
memory.

gdb/ChangeLog:

        * solib-aix.c (solib_aix_relocate_section_addresses):
        Remove FIXME comment.
PR remote/15455 - QTro remote packet broken

In the function remote_trace_set_readonly_regions in gdb/remote.c, the
local variable 'offset' does not account for "QTro" at the start of
the packet with the result that if there are any read-only regions,
the packet is sent -- but without the "QTro" -- causing the remote
stub to report that the packet is unsupported:

  Sending packet: $:0000000000400200,(...),00000000004560a4#ab...Packet received:

vs the expected:

  Sending packet: $QTro:0000000000400200,(...),00000000004560a4#31...Packet received: OK

We don't see the problem when testing with GDBserver, as that supports
qXfer:trace-frame-info:read, meaning GDBserver never needs to read
from the read-only sections directly itself.  This commit adds a test
that explicitly disables qXfer:trace-frame-info:read.

gdb/
2013-05-10  David Taylor  <dtaylor@emc.com>

	PR remote/15455

	* remote.c (remote_trace_set_readonly_regions): Do not overwrite
	"QTro" at start of packet.

gdb/testsuite/
2013-05-10  Pedro Alves  <palves@redhat.com>

	PR remote/15455

	* gdb.trace/qtro.c: New file.
	* gdb.trace/qtro.exp: New file.