Commit Graph

72705 Commits

Author SHA1 Message Date
Jan Kratochvil cafe75b06b gdb/
Fix false compilation warning.
	* gnu-v3-abi.c (print_one_vtable): Initialize ADDR.
2012-03-16 08:18:09 +00:00
Alan Modra 58af5af403 * ld-gc/pr13683.d: Accept powerpc64 function descriptor syms. 2012-03-16 00:20:58 +00:00
gdbadmin ef6a40d627 *** empty log message *** 2012-03-16 00:00:33 +00:00
Alan Modra de4a15510f daily update 2012-03-15 23:00:05 +00:00
Jonathan Larmour 25f8c69270 * arm-tdep.c: Include "remote.h" and "features/arm-with-m-fpa-layout.c".
(arm_register_g_packet_guesses): New function.
	(arm_gdbarch_init): Don't force a target description with
	registers when the executable is detected as M-profile.  Instead
	set gdbarch->tdep->is_m.  Register `g' packet guesses.
	(_initialize_arm_tdep): Initialize the new target description.
	* features/arm-with-m-fpa-layout.xml: New description.
	* features/arm-with-m-fpa-layout.c: New, generated.
2012-03-15 18:53:43 +00:00
Joel Brobecker 35c63cd8ce Problem after hitting breakpoint on Windows (with GDBserver)
When debugging on Windows with GDBserver, the debugger starts
failing after hitting a breakpoint.  For instance:

    (gdb) b foo
    Breakpoint 1 at 0x40177e: file foo.adb, line 5.
    (gdb) cont
    Continuing.

    Breakpoint 1, foo () at foo.adb:5
    5          Put_Line ("Hello World.");  -- STOP
    (gdb) n

    Program received signal SIGSEGV, Segmentation fault.
    0x00401782 in foo () at foo.adb:5
    5          Put_Line ("Hello World.");  -- STOP

There are two issues:

  1. While trying to re-insert a breakpoint that is still inserted
     in memory, insert_bp_location wipes out the breakpoint location's
     shadow_contents.  As a consequence, we cannot restore the proper
     instruction when removing the breakpoint anymore.  That's why
     the inferior's behavior changes when trying to resume after
     the breakpoint was hit.

  2. mem-break.c:default_memory_insert_breakpoint passes a breakpoint
     location's shadow_contents as the buffer for a memory read.
     This reveals a limitation of the various memory-read target
     functions.  This patch documents this limitation and adjust
     the two calls that seem to hit that limitation.

gdb/ChangeLog:

        * breakpoint.c (breakpoint_xfer_memory): Add assertion.
        Update function description.
        (insert_bp_location): Do not wipe bl->target_info out.
        * mem-break.c: #include "gdb_string.h".
        (default_memory_insert_breakpoint): Do not call target_read_memory
        with a pointer to the breakpoint's shadow_contents buffer.  Use
        a local buffer instead.
        * m32r-tdep.c (m32r_memory_insert_breakpoint): Ditto.
2012-03-15 18:33:45 +00:00
Doug Kwan 7b8957f8c3 2012-03-15 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::got_section): Make .got section read-only
	if -z now is given.
2012-03-15 18:24:06 +00:00
Roland McGrath a4456d242d * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Use
elf_x86_64_backend_data parameters for plt_eh_frame.

Change-Id: I4e1a7c2787ed1276765e269f50fc8ba89bab41d5
2012-03-15 18:20:22 +00:00
Roland McGrath eed180f84c * elf64-x86-64.c (struct elf_x86_64_backend_data): New type.
(get_elf_x86_64_backend_data, GET_PLT_ENTRY_SIZE): New macros.
	(elf_x86_64_arch_bed): New variable.
	(elf_backend_arch_data): New macro.
	(elf_x86_64_adjust_dynamic_symbol): Use GET_PLT_ENTRY_SIZE.
	(elf_x86_64_allocate_dynrelocs): Likewise.
	(elf_x86_64_relocate_section): Likewise.
	(elf_x86_64_plt_sym_val): Likewise.
	(elf_x86_64_finish_dynamic_symbol): Use elf_x86_64_backend_data
	parameters for PLT details.
	(elf_x86_64_finish_dynamic_sections): Likewise.
2012-03-15 16:37:25 +00:00
Ian Lance Taylor 14dc9ef7d1 PR gold/13850
* layout.cc (Layout::make_output_section): Correctly mark
	SHT_INIT_ARRAY, et. al., as relro.
2012-03-15 16:32:22 +00:00
Tom Tromey 57651221de * NEWS: Mention "info vtbl", not "info vtable".
* cp-support.c (info_vtbl_command): Fix comment.
	(_initialize_cp_support): Fix text.
2012-03-15 16:32:16 +00:00
Tom Tromey 410528f093 * cp-valprint.c (cp_print_value_fields): Use
print_function_pointer_address for vtable slot.
gdb/testsuite
	* gdb.cp/virtfunc2.exp: Update expected output.
	* gdb.cp/pr9631.exp: Update expected output.
	* gdb.cp/member-ptr.exp: Update expected output.
	* gdb.cp/inherit.exp (test_print_mvi_classes): Update expected
	output.
	* gdb.cp/casts.exp: Update expected output.
2012-03-15 15:49:42 +00:00
Tom Tromey c4aeac856a * gnu-v3-abi.c (struct value_and_voffset): New.
(hash_value_and_voffset, eq_value_and_voffset)
	(compare_value_and_voffset, compute_vtable_size)
	(print_one_vtable, gnuv3_print_vtable): New functions.
	(init_gnuv3_ops): Initialize 'print_vtable' field.
	* cp-support.c (info_vtbl_command): New function.
	(_initialize_cp_support): Add "info vtbl".
	* cp-abi.h (cplus_print_vtable): Declare.
	(struct cp_abi_ops) <print_vtable>: New field.
	* cp-abi.c (cplus_print_vtable): New function.
	* NEWS: Update.
gdb/testsuite
	* gdb.cp/virtfunc.exp (make_one_vtable_result): New proc.
	(test_info_vtbl): Likewise.
	(do_tests): Call test_info_vtbl.
	* gdb.cp/virtfunc.cc (va): New global.
gdb/doc
	* gdb.texinfo (Debugging C Plus Plus): Document "info vtbl".
2012-03-15 15:43:18 +00:00
Rainer Orth 2479f722a4 * configure.ac (enable_libgomp): Remove *-*-irix6*.
(unsupported_languages): Remove mips-sgi-irix6.*.
	(noconfigdirs): Don't add ${libgcj} for mips*-*-irix6*.
	(with_stabs): Remove.
	* configure: Regenerate.
2012-03-15 14:13:32 +00:00
Rainer Orth 4e97d92b5c * configure.ac (enable_libgomp): Remove *-*-osf*.
(with_stabs): Remove alpha*-*-osf*.
	* configure: Regenerate.
2012-03-15 14:11:38 +00:00
Tom Tromey 95cbceff99 * d-lang.c (d_language_defn) <la_iterate_over_symbols>: Set to
iterate_over_symbols.
2012-03-15 14:06:20 +00:00
Alan Modra b240011aba include/
* dis-asm.h (disassemble_init_powerpc): Declare.
opcodes/
	* disassemble.c (disassemble_init_for_target): Handle ppc init.
	* ppc-dis.c (private): New var.
	(powerpc_init_dialect): Don't return calloc failure, instead use
	private.
	(PPC_OPCD_SEGS, PPC_OP_TO_SEG): Define.
	(powerpc_opcd_indices): New array.
	(disassemble_init_powerpc): New function.
	(print_insn_big_powerpc): Don't init dialect here.
	(print_insn_little_powerpc): Likewise.
	(print_insn_powerpc): Start search using powerpc_opcd_indices.
2012-03-15 12:58:48 +00:00
Yao Qi fc3e51758a gdb/gdbserver/
* tracepoint.c (install_tracepoint): Move duplicated tracepoint
	handling to ...
	(cmd_qtdp): ... here.
2012-03-15 12:57:13 +00:00
Thomas Schwinge 27dcf5c00e gas/
* doc/as.texinfo (Bundle directives): Fix typo.
2012-03-15 11:19:13 +00:00
Yao Qi 8d0d92cd22 gdb/gdbserver/
* tracepoint.c (struct tracepoint_action_ops): New.
	(struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
	(m_tracepoint_action_download): New.
	(r_tracepoint_action_download): New.
	(x_tracepoint_action_download): New.
	(l_tracepoint_action_download): New.
	(add_tracepoint_action): Install `action->ops' according type.
	(download_tracepoint_1): Move code `download' function pointer
	of various tracepoint_action_ops.
2012-03-15 10:42:38 +00:00
Thomas Schwinge 856d06f972 gdb/testsuite/
* gdb.dwarf2/dw2-ada-ffffffff.S: Use .4byte instead of .long for
	describing DWARF data structures.
	* gdb.dwarf2/dw2-bad-parameter-type.S: Likewise.
	* gdb.dwarf2/dw2-double-set-die-type.S: Likewise.
	* gdb.dwarf2/dw2-empty-pc-range.S: Likewise.
	* gdb.dwarf2/dw2-entry-value.S: Likewise.
	* gdb.dwarf2/dw2-modula2-self-type.S: Likewise.
	* gdb.dwarf2/dw2-param-error.S: Likewise.
	* gdb.dwarf2/dw2-skip-prologue.S: Likewise.
	* gdb.dwarf2/dw2-stack-boundary.S: Likewise.
	* gdb.dwarf2/dw4-sig-type-unused.S: Likewise.
	* gdb.dwarf2/implptr-optimized-out.S: Likewise.
	* gdb.dwarf2/member-ptr-forwardref.S: Likewise.
	* gdb.dwarf2/pr11465.S: Likewise.
2012-03-15 09:08:10 +00:00
Doug Evans 589b4a3225 * dwarf2read.c (dwarf_stack_op_name): Add DW_OP_GNU_encoded_addr,
DW_OP_GNU_parameter_ref.
2012-03-15 02:34:49 +00:00
Alan Modra 5cb49709c9 * config/default.exp: Update copyright date.
* ld-elf/shared.exp: Pass --no-as-needed to various tests linking
	shared libs.
	* ld-elfvers/vers.exp: Likewise.
2012-03-15 01:57:57 +00:00
Alan Modra 57b99c84f9 * gas/i386/bundle-lock.d: Ignore trailing nops.
* gas/i386/bundle.d: Likewise.
	* gas/i386/x86-64-bundle.d: Likewise.
2012-03-15 01:36:29 +00:00
gdbadmin 0a8af9c64c *** empty log message *** 2012-03-15 00:00:32 +00:00
Doug Kwan fa40b62ad4 2012-03-14 Doug Kwan <dougkwan@google.com>
* gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
	dynamic relocations for protected symbols in shared objects.
2012-03-14 23:07:07 +00:00
Alan Modra 9eca3be1dd daily update 2012-03-14 23:00:05 +00:00
Roland McGrath caa0075c38 * elf32-i386.c (elf_i386_nacl_pic_plt0_entry): Initialize up
to the full size, padding out with nop instructions.
2012-03-14 19:32:11 +00:00
Kai Tietz aeb1f0e80e 2012-03-14 Kai Tietz <ktietz@redhat.com>
Pascal Obry  <pascal@obry.net>

	* pe-dll.c (found_sym): New static variable.
	(undef_count): Likewise.
	(key_value): New structure.
	(undef_sort_cmp): Compare routine for qsort/bsearch.
	(pe_find_cdecl_alias_match): Add new argument.
	(pe_undef_alias_cdecl_match): Removed.
	(pe_undef_count): New helper routine.
	(pe_create_undef_table): Likewise.
	(pe_process_import_defs): Use pe_create_undef_table and
	new pe_undef_alias_cdecl_match function.
2012-03-14 19:00:03 +00:00
H.J. Lu ec82c18e8a Replace @defn with @dfn
2012-03-14  Ryan Mansfield  <rmansfield@qnx.com>

	* doc/as.texinfo (Bundle directives): Replace @defn with @dfn.
2012-03-14 17:51:16 +00:00
H.J. Lu 3d3e6bc3f4 Add a testcase for PR ld/13839
2012-03-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/13839
	* ld-elf/pr13839.d: New.
	* ld-elf/pr13839.s: Likewise.
	* ld-elf/pr13839.t: Likewise.
2012-03-14 15:56:13 +00:00
Jan Kratochvil e837f12a8d gdb/
Fix double prompt of 'interpreter-exec mi'.
	* mi/mi-interp.c (mi_execute_command_input_handler): New prototype.
	(mi_interpreter_resume): use it.
	(mi_execute_command_input_handler): New function.
	* mi/mi-main.c (mi_execute_command): Move prompt printing to
	mi_execute_command_input_handler.

gdb/testsuite/
	* gdb.mi/mi2-prompt.exp: New file.
2012-03-14 07:58:06 +00:00
Alan Modra ec8460b5ba PR ld/13839
* ldexp.c (fold_name): Ignore undefined symbols when assigning to
	dot in mark phase.
	(exp_fold_tree_1): Evaluate assignment to dot expressions even when
	discarding result, for side effects.  Fix typo in error message.
2012-03-14 05:24:02 +00:00
Mike Frysinger 51e40b125f sim: ppc: fix compilation on AIX 7.1 due to st_pad name collisions
AIX 7.1 defines st_pad[123] to st_[amc]tim.tv_pad, respectively,
breaking declaration of st_pad[123] members in struct solaris_stat.
Undefine them as this is no less terrible than other solutions (like
renaming the fields and losing the binding to Solaris' names).

From: Michael Haubenwallner <haubi@s01en24.gentoo.org>
2012-03-14 05:04:18 +00:00
Joel Brobecker ff1e452654 Mark latest entry in ChangeLog as "tiny change". 2012-03-14 01:47:45 +00:00
Joel Brobecker c381a3f69a Fix -Wmissing-prototypes build warnings on Darwin.
gdb/
2012-03-13  Josh Matthews  <josh@joshmatthews.net>

	* darwin-nat-info.c (_initialize_darwin_info_commands): Add
	prototype.
	(darwin_debug_port_info): Make static.
	* darwin-nat.c (_initialize_darwin_inferior): Add prototype.
	* machoread.c (_initialize_machoread): Add prototype.
	* i386-darwin-nat.c (i386_darwin_dr_set, i386_darwin_dr_get)
	(i386_darwin_set_control, i386_darwin_get_control)
	i386_darwin_dr_set_addr, i386_darwin_get_addr)
	i386_darwin_get_status, i386_darwin_get_control):
	Comment out with HW_WATCHPOINT_NOT_YET_ENABLED macro.
2012-03-14 01:46:59 +00:00
Joel Brobecker ccbb4f28f0 Testcase for: "ax-gdb: Do not treat enums and bools as integers".
gdb/testsuite/ChangeLog:

        * gdb.base/enum_cond.c, gdb.base/enum_cond.exp: New testcase.
2012-03-14 01:39:12 +00:00
Joel Brobecker d8a5d6ee2f 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-14 01:38:58 +00:00
Joel Brobecker 32039130c8 testcase for "gdb-ax.c: Add handling of TYPE_CODE_RANGE types"
gdb/testsuite/ChangeLog:

        * gdb.ada/bp_range_type: New testcase.
2012-03-14 01:38:51 +00:00
Joel Brobecker af381b8cf9 ax-gdb.c: Add handling of TYPE_CODE_RANGE types.
This patch fixes an error that occurs with GDB + GDBserver when
trying to insert a breakpoint with a condition that involves
a range type. For instance:

    type INT_T  is range 0 .. 1000;
    INT_VAR : INT_T := 12;

And then trying to insert the breakpoint:

    (gdb) break foo.adb:18 if int_var > 15
    Breakpoint 1 at 0x4021eb: file foo.adb, line 18.
    (gdb) cont
    Continuing.
    /[...]/ax-gdb.c:560: internal-error: gen_fetch: bad type code
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

This patch fixes the problem by adding handling for range types
in gen_fetch.

gdb/ChangeLog:

        * ax-gdb.c (gen_fetch): Add handling for TYPE_CODE_RANGE types.
2012-03-14 01:38:30 +00:00
gdbadmin a776f595bf *** empty log message *** 2012-03-14 00:00:32 +00:00
Alan Modra 5bed0268de daily update 2012-03-13 23:00:05 +00:00
Joel Brobecker 786c562f1a Minor cleanup in aix-thread.c:supply_fprs.
This is a minor cleanup that makes supply_fprs more consistent with
how fill_fprs was written.

gdb/ChangeLog:

        * aix-thread.c (supply_fprs): Make more consistent with fill_fprs.
2012-03-13 22:29:45 +00:00
Joel Brobecker e3ebf1bb41 Fix buffer overflow in aix-thread.c:fill_fprs
gdb/
2012-03-08  Chris January  <chris.january@allinea.com>

	* aix-thread.c (fill_sprs): Store the floating point registers
	at the correct offsets into vals.
2012-03-13 22:27:12 +00:00
Doug Evans 168997566e * NEWS: Mention symbol-reloading has been deleted.
* symfile.c (symbol_reloading): Delete.
	(show_symbol_reloading): Delete.
	(_initialize_symfile): Delete set/show symbol-reloading.

	doc/
	* gdb.texinfo (Help): Change apropos example to use "alias" instead
	of "reload".
	(Symbols): Delete docs for set/show symbol-reloading.
	* gdbint.texinfo (Defining Other Architecture Features): Delete
	SYMBOL_RELOADING_DEFAULT.
	* refcard.tex: Delete reference to symbol-reloading.

	testsuite/
	* gdb.base/default.exp: Delete tests for symbol-reloading.
	* gdb.base/help.exp: Ditto.
	* gdb.base/setshow.exp: Ditto.
	* gdb.base/gdb_history: Delete references to symbol-reloading.
2012-03-13 21:02:40 +00:00
Doug Evans c5b7e1cbc5 * dwarf2read.c (load_partial_comp_unit): Defer adding cu to
read_in_chain until we have successfully read it in.
	(load_full_comp_unit): Ditto.
	(read_signatured_type): Add comment.
2012-03-13 17:16:18 +00:00
Roland McGrath 8d3eaee676 Fix up last commit. 2012-03-13 17:01:34 +00:00
Roland McGrath fa94de6b5c gas/
2012-03-12  Roland McGrath  <mcgrathr@google.com>

	* config/tc-arm.c (arm_frag_max_var): New function.
	* config/tc-arm.h: Declare it.
	(md_frag_max_var): New macro.

	* config/tc-i386.c (i386_frag_max_var): New function.
	* config/tc-i386.h: Declare it.
	(md_frag_max_var): New macro.

	* doc/as.texinfo (Bundle directives): New node.
	(Pseudo Ops): Add it to the menu.
	* NEWS: Mention new feature.
	* read.c [md_frag_max_var] (HANDLE_BUNDLE): New macro.
	[HANDLE_BUNDLE] (bundle_align_p2): New variable.
	[HANDLE_BUNDLE] (bundle_lock_frchain, bundle_lock_frag): New variables.
	[HANDLE_BUNDLE] (start_bundle, pending_bundle_size, finish_bundle):
	New functions.
	(assemble_one): New function if [HANDLE_BUNDLE], #define directly
	to md_assembly if not.
	(read_a_source_file): Call assemble_one in place of md_assemble.
	(read_a_source_file) [HANDLE_BUNDLE]: Check for unterminated
	.bundle_lock at end of processing.
	[HANDLE_BUNDLE] (s_bundle_align_mode, s_bundle_lock, s_bundle_unlock):
	New functions.
	[HANDLE_BUNDLE] (potable): Add their entries.
	* read.h: Declare new functions.

gas/testsuite/
2012-03-12  Roland McGrath  <mcgrathr@google.com>

	* gas/i386/bundle-bad.s: New file.
	* gas/i386/bundle-bad.d: New file.
	* gas/i386/bundle-bad.l: New file.
	* gas/i386/i386.exp: Run it.

	* gas/arm/bundle.s: New file.
	* gas/arm/bundle.d: New file.
	* gas/arm/bundle-lock.s: New file.
	* gas/arm/bundle-lock.d: New file.

	* gas/i386/bundle.s: New file.
	* gas/i386/bundle.d: New file.
	* gas/i386/x86-64-bundle.s: New file.
	* gas/i386/x86-64-bundle.d: New file.
	* gas/i386/bundle-lock.s: New file.
	* gas/i386/bundle-lock.d: New file.
	* gas/i386/i386.exp: Run them.
2012-03-13 16:59:57 +00:00
Joel Brobecker 46cb6474c3 [stabs] The address of Fortran common blocks may be > INT_MAX.
gdb/
2012-03-08  Chris January  <chris.january@allinea.com>

        * stabsread.c (fix_common_block): Change type of valu argument
        to CORE_ADDR.
2012-03-13 16:29:16 +00:00
Joel Brobecker 76219d77db [ppc/prologue] Support the "oril r29, r1, 0x0" insn.
gdb/
2012-03-13  Chris January  <chris.january@allinea.com>

	* rs6000-tdep.c (skip_prologue): Support the oril r29, r1, 0x0
	instruction.
2012-03-13 16:15:35 +00:00