Commit Graph

75261 Commits

Author SHA1 Message Date
Nick Clifton 11e7fd744a PR ld/14776
* ld.texinfo: Fix spelling mistakes.
2012-11-27 17:04:30 +00:00
Joel Brobecker b8293cc8fb Fix sparc-solaris build failure (sparc-sol2-nat.c)
Hello,

The recent patch for %fsr handling had a couple of tiny mistakes
that cause the build to fail on sparc-solaris.  Fixed thusly.

gdb/ChangeLog:

        * sparc-sol2-nat.c (supply_gregset): Fix first parameter in
        call to sparc_supply_fpregset.
        (fill_fpregset): Fix first parameter in call to
        sparc_collect_fpregset.

Tested on sparc-solaris by rebuilding GDB.  Will check it in.

Thanks,
--
Joel
2012-11-27 14:09:13 +00:00
Yao Qi 8c2b9656fa gdb/
2012-11-27  Daniel Jacobowitz  <dan@codesourcery.com>
	    Kazu Hirata  <kazu@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* objfiles.c (init_entry_point_info): Call
	gdbarch_convert_from_func_ptr_addr and
	gdbarch_addr_bits_remove here ...
	(entry_point_address_query): ... instead of here.
	* solib-svr4.c (exec_entry_point): Call
	gdbarch_addr_bits_remove.
	* symfile.c (generic_load): Call gdbarch_addr_bits_remove on
	the entry address.
2012-11-27 08:11:59 +00:00
Yao Qi 5edf51feea gdb/
2012-11-27  Daniel Jacobowitz  <dan@codesourcery.com>
	    Yao Qi  <yao@codesourcery.com>

	* eval.c (evaluate_subexp_standard): Add handling of
	TYPE_CODE_MEMBERPTR when calling functions.  Correct the
	result of ptype for calling a TYPE_CODE_METHODPTR.

gdb/testsuite/
2012-11-27  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.cp/member-ptr.cc (class Diamond): Add func_ptr.
	(func): New function.
	(main): Initialize diamond.func_ptr and add diamond_pfunc_ptr.
	* gdb.cp/member-ptr.exp: Add new tests for ptype and for
	pointers to members with pointer-to-function type.
2012-11-27 07:59:12 +00:00
Yao Qi ca242aadec gdb/
2012-11-27  Yao Qi  <yao@codesourcery.com>

	* symtab.c (symtab_symbol_info): Fix a -Wformat-extra-args
	warning.
	Add i18n markup.
2012-11-27 07:41:43 +00:00
gdbadmin d8dd7f930d *** empty log message *** 2012-11-27 00:00:33 +00:00
Roland McGrath e2caaa1f59 ld/
* emultempl/aarch64elf.em (gld${EMULATION_NAME}_before_parse):
	Copy last elf32.em here too.
	* emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
	* emultempl/mmixelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
	* emultempl/scoreelf.em (gld${EMULATION_NAME}_before_parse): Likewise.
2012-11-26 23:26:35 +00:00
Alan Modra b80f948aeb daily update 2012-11-26 23:00:10 +00:00
Tom Tromey b181bbd0d6 2012-11-26 Alexander Larsson <alexl@redhat.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* NEWS: Mention mini debuginfo feature.
	* minidebug.c: New file.
	* configure.ac: Check for lzma.
	* configure, config.in: Rebuild.
	* Makefile.in (LIBLZMA): New variable.
	(CLIBS): Include LIBLZMA.
	(SFILES): Mention minidebug.c.
	(COMMON_OBS): Mention minidebug.o.
	* symfile.c (read_symbols): New function.
	(syms_from_objfile, reread_symbols): Call it.
	* symfile.h (find_separate_debug_file_in_section): Declare.
doc
	* gdb.texinfo (MiniDebugInfo): New node.
	(GDB Files): Update.
testsuite
	* gdb.base/gnu-debugdata.exp: New file.
	* gdb.base/gnu-debugdata.c: New file.
	* lib/gdb.exp (gdb_file_cmd): Handle LZMA warning.
	(gdb_unload): Return 0 on success.
2012-11-26 22:31:29 +00:00
Tom Tromey 608e2dbbfe 2012-11-26 Alexander Larsson <alexl@redhat.com>
Jan Kratochvil  <jan.kratochvil@redhat.com>
	    Tom Tromey  <tromey@redhat.com>

	* NEWS: Mention mini debuginfo feature.
	* minidebug.c: New file.
	* configure.ac: Check for lzma.
	* configure, config.in: Rebuild.
	* Makefile.in (LIBLZMA): New variable.
	(CLIBS): Include LIBLZMA.
	(SFILES): Mention minidebug.c.
	(COMMON_OBS): Mention minidebug.o.
	* symfile.c (read_symbols): New function.
	(syms_from_objfile, reread_symbols): Call it.
	* symfile.h (find_separate_debug_file_in_section): Declare.
doc
	* gdb.texinfo (MiniDebugInfo): New node.
	(GDB Files): Update.
testsuite
	* gdb.base/gnu-debugdata.exp: New file.
	* gdb.base/gnu-debugdata.c: New file.
	* lib/gdb.exp (gdb_file_cmd): Handle LZMA warning.
	(gdb_unload): Return 0 on success.
2012-11-26 19:23:56 +00:00
Jan Kratochvil 4648e5880e gdb/testsuite/
* gdb.base/enumval.exp (print e, print f, print K): XFAIL on GCC <= 4.6.
2012-11-26 18:13:24 +00:00
Roland McGrath aa6407c6ed bfd/
* elf-nacl.c (nacl_modify_segment_map): Don't crash when INFO is null.
2012-11-26 17:49:11 +00:00
Joel Brobecker 17d6efc44b Do not crash when calling GDB with empty executable name.
% gdb -q ''

... or ...

        % gdb -q
        (gdb) file ''

... both cause GDB to crash with an invalid free. This is because
exec_file_attach is attempting to free a string that has not been
allocated. The string is only allocated if openp is successful.
But in the case of this obviously invalid filename, openp fails,
and leaves scratch_pathname uninitialized, thus causing the xfree
to fail.

The fix is to enable the associated cleanup after we have verified
that openp was successful.

gdb/ChangeLog (By Keith Seitz  <keiths@redhat.com>):

        * exec.c (exec_file_attach): Move cleanup after verifying that
        memory has in fact been allocated.

gdb/testsuite/ChangeLog:

        * gdb.base/empty_exe.exp: New testcase.
2012-11-26 17:41:44 +00:00
Tom Tromey 210bbc17ac * ada-lang.c (user_select_syms): Use SYMBOL_SYMTAB.
* dwarf2read.c (dw2_find_symbol_file, fixup_go_packaging): Use
	SYMBOL_SYMTAB.
	* skip.c (skip_info): Use SYMBOL_SYMTAB.
2012-11-26 15:54:29 +00:00
Pedro Alves 0270a750ba gdb/
2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
	    Pedro Alves  <palves@redhat.com>

	* common/linux-osdata.c (linux_xfer_osdata_fds): Decrease buffer
	size parameter passed to readlink by one byte.
	* fbsd-nat.c (fbsd_pid_to_exec_file): Ditto.
	* linux-nat.c (linux_child_pid_to_exec_file): Ditto.
	* nbsd-nat.c (nbsd_pid_to_exec_file): Ditto.
	* inf-child.c (inf_child_fileio_readlink): Decrease local buffer's
	size by one byte.

gdb/gdbserver/
2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>

	* hostio.c (handle_readlink): Decrease buffer size
	parameter passed to readlink by one byte.
2012-11-26 14:19:33 +00:00
Yao Qi 8c29b58e98 gdb/gdbserver/
2012-11-26  Yao Qi  <yao@codesourcery.com>

	* configure.ac (build_warnings): Append '-Wempty-body'.
	* configure: Regenerated.
	* linux-low.c (linux_create_inferior): Use braces for empty 'if'
	body.
2012-11-26 13:30:07 +00:00
Yao Qi 9c16be9afa gdb/
2012-11-26  Yao Qi  <yao@codesourcery.com>

	* f-valprint.c (f77_create_arrayprint_offset_tbl): Remove
	extraneous parentheses.
2012-11-26 13:26:57 +00:00
Yao Qi e6f3fa5256 gdb/
2012-11-26  Yao Qi  <yao@codesourcery.com>

	* remote.c (remote_start_remote): Typo fix.
2012-11-26 13:19:18 +00:00
gdbadmin 3e72e21267 *** empty log message *** 2012-11-26 00:00:37 +00:00
Alan Modra e898b29382 daily update 2012-11-25 23:00:05 +00:00
gdbadmin 80aeba6664 *** empty log message *** 2012-11-25 00:00:03 +00:00
Alan Modra 6ee8970bb5 daily update 2012-11-24 23:00:04 +00:00
gdbadmin 7ed552d815 *** empty log message *** 2012-11-24 00:00:33 +00:00
Alan Modra ea98391bd5 daily update 2012-11-23 23:00:05 +00:00
David S. Miller db75c71770 Fix Sparc %fsr regset offset for BSD and Linux.
gdb/

	* sparc-tdep.h (struct sparc_fpregset): New data structure.
	(sparc32_sunos4_fpregset, sparc32_bsd_fpregset,
	sparc32_sol2_fpregset): Declare new globals.
	(sparc32_supply_fpregset, sparc32_collect_fpregset): Add new
	'fpregset' argument.
	* sparc64-tdep.h (sparc64_supply_fpregset,
	sparc64_collect_fpregset): Likewise.
	(sparc64_sol2_fpregset, sparc64_bsd_fpregset): Declare new
	globals.
	* sparc-nat.h (struct sparc_fpregset): Add forward declaration.
	(sparc_fpregset): Declare new global.
	(sparc_supply_fpregset, sparc_collect_fpregset): Add new
	'fpregset' argument.
	* sparc-linux-nat.c (supply_fpregset): Pass sparc_fpregset down
	into handler.
	(fill_fpregset): Likewise.
	(_initialize_sparc_linux_nat): Set sparc_fpregset to
	sparc32_bsd_fpregset.
	* sparc-linux-tdep.c (sparc32_linux_supply_core_fpregset): Pass
	sparc32_bsd_fpregset down into handler.
	(sparc32_linux_collect_core_fpregset): Likewise.
	* sparc-nat.c (sparc_fpregset): Define.
	(sparc_supply_fpregset): Add 'fpregset' argument.
	(sparc_collect_fpregset): Likewise.
	(sparc_fetch_inferior_registers): Pass sparc_fpregset down
	into fpregset handler.
	(sparc_store_inferior_registers): Likewise.
	(_initialize_sparc_nat): Set sparc_fpregset to
	sparc32_sunos4_fpregset if NULL.
	* sparc-sol2-nat.c (supply_gregset): Pass sparc_sol2_fpregset
	down into handler.
	(fill_fpregset): Likewise.
	* sparc-sol2-tdep.c (sparc32_sol2_fpregset): Define.
	* sparc-tdep.c (sparc32_supply_fpregset): Add fpregset arg and
	use it to compute offsets.
	(sparc32_collect_fpregset): Likewise.
	(sparc32_sunos4_fpregset, sparc32_bsd_fpregset): Define.
	* sparc64-linux-nat.c (supply_fpregset): Pass sparc64_bsd_fpregset
	down into handler.
	(fill_fpregset): Likewise.
	* sparc64-linux-tdep.c (sparc64_linux_supply_core_fpregset):
	Likewise.
	(sparc64_linux_collect_core_fpregset): Likewise.
	* sparc64-sol2-tdep.c (sparc64_sol2_fpregset): Define.
	* sparc64-tdep.c (sparc64_supply_fpregset): Add fpregset arg and
	use it to compute offsets.
	(sparc64_collect_fpregset): Likewise.
	(sparc64_bsd_fpregset): Define.
	* sparc64fbsd-tdep.c (sparc64fbsd_supply_fpregset): Padd
	sparc64_bsd_fpregset down into handler.
	(sparc64fbsd_collect_fpregset): Likewise.
	* sparc64nbsd-nat.c (sparc64nbsd_supply_fpregset): Add fpregset arg
	and pass sparc{32,64}_bsd_fpregset down into handler.
	(sparc64nbsd_collect_fpregset): Likewise.
	* sparc64nbsd-tdep.c (sparc64nbsd_supply_fpregset): Pass
	sparc64_bsd_fpregset down into handler.
	* sparc64obsd-tdep.c (sparc64obsd_supply_gregset): Likewise.
	* sparcnbsd-nat.c (_initialize_sparcnbsd_nat): Set sparc_fpregset
	to sparc32_bsd_fpregset.
	* sparcnbsd-tdep.c (sparc32nbsd_supply_gregset): Pass
	sparc32_bsd_fpregset down into sparc32_supply_fpregset.
	(sparc32nbsd_supply_fpregset): Likewise.
2012-11-23 20:30:23 +00:00
Alan Modra 776fc41826 include/opcode/
* ppc.h (ppc_parse_cpu): Update prototype.
opcodes/
	* ppc-dis.c (ppc_parse_cpu): Add "sticky" param.  Track bits
	set from ppc_opts.sticky in it.  Delete "retain_mask".
	(powerpc_init_dialect): Choose default dialect from info->mach
	before parsing -M options.  Handle more bfd_mach_ppc variants.
	Update common default to power7.
gas/
	* config/tc-ppc.c (sticky): New var.
	(md_parse_option, ppc_machine): Update ppc_parse_cpu calls.
gas/testsuite/
	* gas/ppc/astest2.d: Pass -Mppc to objdump.
ld/testsuite/
	* ld-powerpc/plt1.d: Update for default "at" branch hints.
	* ld-powerpc/tlsexe.d: Likewise.
	* ld-powerpc/tlsexetoc.d: Likewise.
	* ld-powerpc/tlsopt1.d: Likewise.
	* ld-powerpc/tlsopt1_32.d: Likewise.
	* ld-powerpc/tlsopt2.d: Likewise.
	* ld-powerpc/tlsopt2_32.d: Likewise.
	* ld-powerpc/tlsopt4.d: Likewise.
	* ld-powerpc/tlsopt4_32.d: Likewise.
	* ld-powerpc/tlsso.d: Likewise.
	* ld-powerpc/tlstocso.d: Likewise.
2012-11-23 03:28:13 +00:00
gdbadmin 798e46b917 *** empty log message *** 2012-11-23 00:00:33 +00:00
Alan Modra 686f4cdfc5 daily update 2012-11-22 23:00:04 +00:00
gdbadmin 2e18b96534 *** empty log message *** 2012-11-22 00:00:33 +00:00
Alan Modra 0f60f328f0 daily update 2012-11-21 23:00:04 +00:00
H.J. Lu f1d8578513 Set output maxpagesize when rewriting program header
bfd/

	PR binutils/14493
	* elf.c (copy_elf_program_header): When rewriting program
	header, set the output maxpagesize to the maximum alignment
	of input PT_LOAD segments.

2012-11-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/14493
	* ld-elf/maxpage5.d: New file.
	* ld-elf/maxpage5.s: Likewise.
	* ld-elf/maxpage5.t: Likewise.
2012-11-21 21:31:18 +00:00
Roland McGrath a3f548ed85 bfd/
* elf-nacl.c (segment_nonexecutable_and_has_contents): Renamed to ...
	(segment_eligible_for_headers): ... this.  Take new arguments
	MAXPAGESIZE and SIZEOF_HEADERS.  Return false if the first section's
	start address doesn't leave space for the headers.
	(nacl_modify_segment_map): Update caller.
2012-11-21 20:13:04 +00:00
Roland McGrath 4724d37ec2 ld/
* ld.h (ld_config_type): New flag member separate_code.
	* emultempl/elf32.em
	(gld${EMULATION_NAME}_before_parse): Set it based on $SEPARATE_CODE.
	* ldlang.c (ldlang_override_segment_assignment): If it's set, then
	always return TRUE when SEC_CODE differs between the sections.
2012-11-21 19:56:38 +00:00
Roland McGrath e0799d78b1 * ld-elf/comm-data.exp: Add XFAIL for arm*-*-* targets, referring
to PR ld/13802.
2012-11-21 19:31:24 +00:00
Tom Tromey cfcad218b1 * gdbtypes.h (struct cplus_struct_type) <localtype_ptr>: Remove
field.
	(TYPE_LOCALTYPE_PTR, TYPE_LOCALTYPE_FILE, TYPE_LOCALTYPE_LINE):
	Remove.
	* c-typeprint.c (c_type_print_base): Update.
2012-11-21 18:07:17 +00:00
Michael Eager abe9f67d45 Add swap byte (swapb) and swap halfword (swaph) opcodes.
binutils/opcodes
          * microblaze-opc.h (op_code_struct): Add swapb, swaph Increase MAX_OPCODES.
          * microblaze-opcm.h (microblaze_instr): Likewise
binutils/gas/testsuite
          * gas/microblaze/allinsn.s: Add swapb, swaph
          * gas/microblaze/allinsn.d: Likewise
2012-11-21 17:54:11 +00:00
Michael Eager 0db4b3260c Add stack high register and stack low register for MicroBlaze
hardware assisted stack protection, stores stack low / stack high limits
for detecting stack overflow / underflow

binutils/opcodes
          * microblaze-opcm.h: Add REG_SLR_MASK, REG_SHR_MASK, REG_SHR and REG_SLR
          * microblaze-dis.c (get_field_special): Handle REG_SLR_MASK and REG_SHR_MASK
binutils/gas
          * config/tc-microblaze.c (parse_reg): Parse REG_SLR, REG_SHR
binutils/gas
          * gas/microblaze/allinsn.s: Test use of SHR, SLR
          * gas/microblaze/allinsn.d: Likewise
2012-11-21 17:34:14 +00:00
Pedro Alves e0f33b1fbf Revert previous change to i386-tdep.c. 2012-11-21 14:09:10 +00:00
H.J. Lu 2ddda9905b Run more tests on x86_64-*-linux-gnu*/i?86-*-linux-gnu
* ld-elf/discard1.d: Run on x86_64-*-linux-gnu*.
	* ld-elf/discard2.d: Likewise.
	* ld-elf/discard3.d: Likewise.
	* ld-elf/eh6.d: Likewise.
	* ld-elf/maxpage3c.d: Run on i?86-*-linux-gnu.
	* ld-elf/maxpage4.d: Likewise.
2012-11-21 13:53:23 +00:00
Karthik Bhat f1d27f1c6c Added forgotton ChangeLog for previous fix i.e. breakpoint not set properly in case of clang compiled binary commit 2012-11-21 08:02:13 +00:00
Karthik Bhat 4e879fc2fd Fix for incorrect breakpoint set in case of clang compiled binary 2012-11-21 07:39:02 +00:00
Yao Qi 85ddcc7021 gdb/
2012-11-21  Yao Qi  <yao@codesourcery.com>

	PR tdep/7438
	* gdbarch.sh (smash_text_address): Remove.
	* gdbarch.c, gdbarch.h: Regenerate.
	* arm-tdep.c (arm_smash_text_address): Remove.
	(arm_gdbarch_init): Don't call set_gdbarch_smash_text_address.
	* hppa-tdep.c (hppa_smash_text_address): Remove.
	(hppa_addr_bits_remove): Rename from hppa_smash_text_address.
	(hppa_gdbarch_init): Don't call set_gdbarch_smash_text_address.
	Caller update.
	* coffread.c (coff_symtab_read): Caller update.
	* dbxread.c (process_one_symbol): Likewise.
	* elfread.c (record_minimal_symbol): Likewise.
	* somread.c (som_symtab_read): Likewise.
2012-11-21 00:29:55 +00:00
gdbadmin 367d69d1bc *** empty log message *** 2012-11-21 00:00:36 +00:00
Pierre Muller 1152206989 Add forgotten ChangeLog for previous ARI fixes commit 2012-11-20 23:02:29 +00:00
Alan Modra 579994610c daily update 2012-11-20 23:00:03 +00:00
Pierre Muller 8c042590f9 ARI fixes: sprintf rule.
Replace sprintf function calls for char arrays by
	calls to xsnprintf calls.
	* arm-tdep.c (arm_push_dummy_call): Replace sprintf by xsnprintf.
	(arm_dwarf_reg_to_regnum, arm_return_value): Ditto.
	(arm_neon_quad_read, arm_pseudo_read): Ditto.
	(arm_neon_quad_write, arm_pseudo_write): Ditto.
	* breakpoint.c (condition_completer): Ditto.
	(create_tracepoint_from_upload): Ditto.
	* dwarf2read.c (file_full_name): Ditto.
	* gcore.c (gcore_command): Ditto.
	* gnu-nat.c (proc_string, gnu_pid_to_str): Ditto.
	* go32-nat.c (go32_sysinfo): Ditto.
	* interps.c (interp_set): Ditto.
	* m32c-tdep.c (make_types): Ditto.
	* ppc-linux-nat.c (fetch_register, store_register): Ditto.
	* remote-m32r-sdi.c (m32r_open): Ditto.
	* sol-thread.c (td_err_string): Ditto.
	(td_state_string, solaris_pid_to_str): Ditto.
	* symtab.c (gdb_mangle_name): Ditto.
	* cli/cli-script.c (execute_control_command): Ditto.
	(define_command, document_command): Ditto.
	* tui/tui-io.c (tui_rl_display_match_list): Ditto.
	* tui/tui-stack.c (tui_make_status_line): Ditto.
	* tui/tui-win.c (tui_update_gdb_sizes): Ditto.
2012-11-20 22:51:05 +00:00
H.J. Lu dda8ddc56f Remove ref_dynamic_nonweak added by accident
bfd/

2012-11-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/14862
	* elf-bfd.h (elf_link_hash_entry): Remove ref_dynamic_nonweak
	added by accident.
	(elf_link_add_object_symbols): Don't set nor check
	ref_dynamic_nonweak.

ld/testsuite/

2012-11-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/14862
	* ld-elf/shared.exp (build_tests): Build libpr14862-1.o and
	libpr14862.so.
	(run_tests): Test pr14862.

	* ld-elf/pr14862-1.c: New file.
	* ld-elf/pr14862-2.c: Likewise.
	* ld-elf/pr14862.map: Likewise.
	* ld-elf/pr14862.out: Likewise.
2012-11-20 22:17:27 +00:00
H.J. Lu b039ef0457 Implement ELF linker -z global option
ld/

	* ld.texinfo: Document "-z global".

	* emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Support
	"-z global".
	(gld${EMULATION_NAME}_list_options): Likewise.

ld/testsuite/

	* ld-elf/global1.d: New file.
2012-11-20 22:16:05 +00:00
Mike Frysinger ace2195744 gdb: include help aliases in help command completion
There are a bunch of aliases that get used with help, but the current
command completion logic does not include those when doing completions.

Since the framework is already mostly in place, extend complete_on_cmdlist
slightly to pass down the ignore_help_classes flag like is done with the
existing lookup command logic.

Now you can do:
	(gdb) help use<tab>
and get back:
	(gdb) help user-defined

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-20 21:02:36 +00:00
Tom Tromey ec6632d76b * completer.c (count_struct_fields): Remove.
(expression_completer): Don't call count_struct_fields.
2012-11-20 18:18:39 +00:00