* m68klinux-nat.c: Include "gdb_proc_service.h".
(PTRACE_GET_THREAD_AREA): Define.
(ps_get_thread_area): New function.
* m68klinux-tdep.c (m68k_linux_init_abi): Register
linux_get_siginfo_type.
2012-03-08  Tristan Gingold  <gingold@adacore.com>

	* lbr.h (struct vms_lhd): Add comments.
2012-03-08  Tristan Gingold  <gingold@adacore.com>

	* vms-lib.c (_bfd_vms_lib_write_archive_contents): Set maximum
	keylen according to archive kind.  Set nextvbn and nextrfa lhd
	fields.  Add comments.
gdb/
2012-03-08  Tristan Gingold  <gingold@adacore.com>

	* sparc-stub.c: Move to stubs/
	* sh-stub.c: Likewise.
	* m68k-stub.c: Likewise.
	* m32r-stub.c: Likewise.
	* i386-stub.c: Likewise.

gdb/stubs/
2012-03-08  Tristan Gingold  <gingold@adacore.com>

	* sparc-stub.c: Move from ..
	* sh-stub.c: Likewise.
	* m68k-stub.c: Likewise.
	* m32r-stub.c: Likewise.
	* i386-stub.c: Likewise.
Fix thinko in help of "set breakpoint condition-evaluation".

The 3 valid values for this setting are "auto", "host" and "target".
The help was advertising one of them to be "gdb" instead of "host".

gdb/ChangeLog:

        * breakpoint.c (_initialize_breakpoint): Fix error in help of
        "set breakpoint condition-evaluation" command.
2012-03-08  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* s390-opc.txt: Set instruction type of pku to SS_L2RDRD.

2012-03-08  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gas/s390/esa-g5.d: Move length field to the second operand.
	* gas/s390/esa-g5.s: Likewise.
gdb/
	* libunwind-frame.h (struct frame_unwind): New declaration.
gdb/
	* libunwind-frame.c: Rename to ...
	* ia64-libunwind-tdep.c: ... here.
	* libunwind-frame.h: Rename to ...
	* ia64-libunwind-tdep.h: ... here.
	* Makefile.in (HFILES_NO_SRCDIR): Rename libunwind-frame.h to
	ia64-libunwind-tdep.h.
	(ALLDEPFILES): Rename libunwind-frame.c to ia64-libunwind-tdep.c.
	* README (--with-libunwind): Rename to ...
	(--with-libunwind-ia64): ... here, note it is ia64 specific now.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: New option --with-libunwind-ia64, make the
	AS_HELP_STRING ia64 specific.  Deprecate option --with-libunwind.
	Remove AC_DEFINE for HAVE_LIBUNWIND.
	* ia64-libunwind-tdep.c: Make the file top comment ia64 specific.
	Rename libunwind-frame.h #include to ia64-libunwind-tdep.h.
	Rename libunwind-frame in the general comment.
	* ia64-libunwind-tdep.h: Make the file top comment ia64 specific.
	Rename symbol LIBUNWIND_FRAME_H to IA64_TDEP_LIBUNWIND_FRAME_H.
	Move forward declarations inside #ifndef.  Rename libunwind-frame in
	the general comment.
	* ia64-tdep.c: Rename libunwind-frame.h #include to
	ia64-libunwind-tdep.h.
	(ia64_gdb2uw_regnum, ia64_uw2gdb_regnum, ia64_is_fpreg)
	(ia64_libunwind_descr): Rename libunwind-frame to
	ia64-libunwind-tdep in these function comments.
	* ia64-tdep.h: Rename libunwind-frame.h #include to
	ia64-libunwind-tdep.h.
	* ia64-vms-tdep.c (ia64_vms_libunwind_descr): Rename libunwind-frame to
	ia64-libunwind-tdep in that data comment.
gdb/
	Fix CU relative vs. absolute DIE offsets.
	* dwarf2loc.h (dwarf2_fetch_die_location_block): Rename parameter
	offset to offset_in_cu.
	* dwarf2read.c (process_enumeration_scope): Add CU offset to
	TYPE_OFFSET.
	(dwarf2_fetch_die_location_block): Rename parameter offset to
	offset_in_cu.  New variable offset, add CU offset to OFFSET_IN_CU.

gdb/testsuite/
	Fix CU relative vs. absolute DIE offsets.
	* gdb.dwarf2/dw2-op-call.S: New compilation unit preceding the existing
	one.
ax-gdb: Do not treat enums and bools as integers.

This patch fixes a problem when using gdb + gdbserver, and trying
to break on a function when one of the (enum) parameters is equal
to a certain value, and the size of that enum is 1 byte.

    (gdb) break mixed.adb:15 if light = green
    Breakpoint 2 at 0x402d5a: file mixed.adb, line 15.
    (gdb) cont
    Continuing.
    [Inferior 1 (process 9742) exited normally]

The debugger should have stopped once when our function was call
with light set to green.

Here is what happens: Because we're using a recent GDBserver,
GDB hands off the evaluation of the condition to GDBserver, by
providing it in the Z0 packet. This is what GDB sends:

    $Z0,402d5a,1;X13,26000622100223ff1c16100219162022011327#cf

I decoded the condition as follow:

    260006    reg 6 -> push
    2210      const8 0x10 -> push
    02        add (stack now has 1 element equal to reg6 + 16)
    23ff1c    const16 0xff1c
    1610      ext 16 (sign extend 16 bits)
    02        add (stack now has 1 element equal to reg6 + 16 - 228)
    19        ref32: Pop as addr, push 32bit value at addr.
    1620      ext 32 (sign extend 32 bits)
    2201      const8 0x01
    13        equal
    27        end

The beginning of the agent expression can be explained by the address
of symbol "light":

    (gdb) info addr light
    Symbol "light" is a variable at frame base reg $rbp offset 16+-228.

However, the mistake is the "ext 32" operation (extend 32 bits),
because our variable is *not* 32bits, only 8:

    (gdb) print light'size
    $5 = 8

But the reason why GDB decides to use a 32bit extension is because
it overrides the symbol's type with a plain integer type in
ax-gdb.c:gen_usual_unary...

      /* If the value is an enum or a bool, call it an integer.  */
    case TYPE_CODE_ENUM:
    case TYPE_CODE_BOOL:
      value->type = builtin_type (exp->gdbarch)->builtin_int;
      break;

... before calling require_rvalue. And of course, that causes the
generator to generate a sizeof(int) extension of the result.

One way to fix this would be to use an integer type of the correct
size, but I do not understand why this is necessary. The two routines
that use that information to generate the opcode down the line are
gen_fetch (for a memory value), or gen_extend (for a register value).
And they both have handling of enums and bools.

So the fix we elected to implement was simply to remove that code.

gdb/ChangeLog:

        * ax-gdb.c (gen_usual_unary): Remove special handling of
        enum and bool types.
2012-03-08  Luis Machado  <lgustavo@codesourcery.com>

	* ax-gdb.c (gen_fetch): Fail gracefully and use error instead
	of internal error for unknown/unsupported types.
2012-03-08  Luis Machado  <lgustavo@codesourcery.com>

	Revert:

	2012-03-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Implement testsuite workaround for PR breakpoints/13781.
	* gdb.cp/mb-templates.exp: New loop with variable $workaround.
	(set breakpoint condition-evaluation host): New conditional command.
Revert "ax-gdb: Do not treat enums and bools as integers."

This patch was checked hasn't been reviewed and has been checked in
by mistake (wrong patch applied).
	* gdb.ada/array_bounds.exp: Get breakpoint for line
	with "START", not "STOP".
	* gdb.python/py-infthread.exp: Do not continue to
	line marked "Break here.", which is undefined.
Make breakpoint condition detection trace conditional on remote_debug.

gdb/gdbserver/ChangeLog:

        * server.c (process_point_options): If a conditional expression
        is found, only print a message if remote_debug is nonzero.
Revert "ax-gdb: Do not treat enums and bools as integers."

This patch was checked hasn't been reviewed and has been checked in
by mistake (wrong patch applied).
	* gdb.ada/array_bounds.exp: Get breakpoint for line
	with "START", not "STOP".
	* gdb.python/py-infthread.exp: Do not continue to
	line marked "Break here.", which is undefined.
Make breakpoint condition detection trace conditional on remote_debug.

gdb/gdbserver/ChangeLog:

        * server.c (process_point_options): If a conditional expression
        is found, only print a message if remote_debug is nonzero.
gdb/
	Fix -Wmissing-prototypes build.
	* arm-linux-nat.c (get_thread_id): Make it static.
	* xtensa-linux-nat.c (get_thread_id): Likewise.