aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-02-25avr/objdump: Support dumping .avr.prop section.Andrew Burgess8-0/+611
Add support to objdump for dumping the .avr.prop section in a structured way. binutils/ChangeLog: * od-elf32_avr.c: Add elf32-avr.h include. (OPT_AVRPROP): Define. (options[]): Add 'avr-prop' entry. (elf32_avr_help): Add avr-prop help text. (elf32_avr_dump_avr_prop): New function. (elf32_avr_dump): Add check for avr-prop. bfd/ChangeLog: * elf32-avr.h (struct avr_property_header): New strucure. (avr_elf32_load_property_records): Declare. (avr_elf32_property_record_name): Declare. * elf32-avr.c: Add bfd_stdint.h include. (retrieve_local_syms): New function. (get_elf_r_symndx_section): New function. (get_elf_r_symndx_offset): New function. (internal_reloc_compare): New function. (struct avr_find_section_data): New structure. (avr_is_section_for_address): New function. (avr_find_section_for_address): New function. (avr_elf32_load_records_from_section): New function. (avr_elf32_load_property_records): New function. (avr_elf32_property_record_name): New function. gas/testsuite/ChangeLog: * gas/avr/avr-prop-1.d: New file. * gas/avr/avr-prop-1.s: New file.
2015-02-25avr/gas: Write out data to track .org/.align usage.Andrew Burgess5-0/+434
Adds support to the assembler to write out data for tracking the use of .org and .align directives. This data is collected within the assembler and written out to a section ".avr.prop" (if there's anything to write out). This patch does not add any tests. The next patch in this series will add a better mechanism for visualising the contents of .avr.prop which will make writing tests much easier. This patch also does not make any use of this collected data, that will also come along in a later patch; the intended consumer is the linker, during linker relaxation this information will be used to ensure that the .org and .align directives are honoured. bfd/ChangeLog: * elf32-avr.h (AVR_PROPERTY_RECORD_SECTION_NAME): Define. (AVR_PROPERTY_RECORDS_VERSION): Define. (AVR_PROPERTY_SECTION_HEADER_SIZE): Define. (struct avr_property_record): New structure. gas/ChangeLog: * config/tc-avr.c: Add elf32-avr.h include. (struct avr_property_record_link): New structure. (avr_output_property_section_header): New function. (avr_record_size): New function. (avr_output_property_record): New function. (avr_create_property_section): New function. (avr_handle_align): New function. (exclude_section_from_property_tables): New function. (create_record_for_frag): New function. (append_records_for_section): New function. (avr_create_and_fill_property_section): New function. (avr_post_relax_hook): New function. * config/tc-avr.h (md_post_relax_hook): Define. (avr_post_relax_hook): Declare. (HANDLE_ALIGN): Define. (avr_handle_align): Declare. (strut avr_frag_data): New structure. (TC_FRAG_TYPE): Define.
2015-02-25[SH] Fix clrs, sets, pref insn arch memberships.Oleg Endo48-663/+590
opcodes/ * sh-opc.h (clrs, sets): Mark as arch_sh3_nommu_up instead of arch_sh_up. (pref): Mark as arch_sh2a_nofpu_or_sh3_nommu_up instead of arch_sh2a_nofpu_or_sh4_nommu_nofpu_up. gas/testsuite/ * gas/sh/arch/arch.exp: Replace dead code to generate expected .s files with ... * gas/sh/arch/sh-opc-gen-as.pl: ... this new script. * gas/sh/arch/arch_expected.txt: Regenerate. * gas/sh/arch/sh-dsp.s: Likewise. * gas/sh/arch/sh-opc-gen-as.pl: Likewise. * gas/sh/arch/sh.s: Likewise. * gas/sh/arch/sh2.s: Likewise. * gas/sh/arch/sh2a-nofpu-or-sh3-nommu.s: Likewise. * gas/sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Likewise. * gas/sh/arch/sh2a-nofpu.s: Likewise. * gas/sh/arch/sh2a-or-sh3e.s: Likewise. * gas/sh/arch/sh2a-or-sh4.s: Likewise. * gas/sh/arch/sh2a.s: Likewise. * gas/sh/arch/sh2e.s: Likewise. * gas/sh/arch/sh3-dsp.s: Likewise. * gas/sh/arch/sh3-nommu.s: Likewise. * gas/sh/arch/sh3.s: Likewise. * gas/sh/arch/sh3e.s: Likewise. * gas/sh/arch/sh4-nofpu.s: Likewise. * gas/sh/arch/sh4-nommu-nofpu.s: Likewise. * gas/sh/arch/sh4.s: Likewise. * gas/sh/arch/sh4a-nofpu.s: Likewise. * gas/sh/arch/sh4a.s: Likewise. * gas/sh/arch/sh4al-dsp.s: Likewise. ld/testsuite/ * ld-sh/arch/arch_expected.txt: Regenerate. * ld-sh/arch/sh-dsp.s: Likewise. * ld-sh/arch/sh.s: Likewise. * ld-sh/arch/sh2.s: Likewise. * ld-sh/arch/sh2a-nofpu-or-sh3-nommu.s: Likewise. * ld-sh/arch/sh2a-nofpu-or-sh4-nommu-nofpu.s: Likewise. * ld-sh/arch/sh2a-nofpu.s: Likewise. * ld-sh/arch/sh2a-or-sh3e.s: Likewise. * ld-sh/arch/sh2a-or-sh4.s: Likewise. * ld-sh/arch/sh2a.s: Likewise. * ld-sh/arch/sh2e.s: Likewise. * ld-sh/arch/sh3-dsp.s: Likewise. * ld-sh/arch/sh3-nommu.s: Likewise. * ld-sh/arch/sh3.s: Likewise. * ld-sh/arch/sh3e.s: Likewise. * ld-sh/arch/sh4-nofpu.s: Likewise. * ld-sh/arch/sh4-nommu-nofpu.s: Likewise. * ld-sh/arch/sh4.s: Likewise. * ld-sh/arch/sh4a-nofpu.s: Likewise. * ld-sh/arch/sh4a.s: Likewise. * ld-sh/arch/sh4al-dsp.s: Likewise.
2015-02-25[gas][ARM] Document supported ARMv8 cores.Kyrylo Tkachov2-0/+8
2015-02-25 Matthew Wahab <matthew.wahab@arm.com> * doc/c-arm.texi (-mcpu=): Add cortex-a53, cortex-a57 and cortex-a72.
2015-02-25[aarch64] Fix one fail in gdb.xml/tdesc-regs.expYao Qi2-0/+8
Hi, I see the following fail in aarch64-linux-gnu testing... (gdb) set tdesc file /XXX/gdb/testsuite/gdb.xml/single-reg.xml^M warning: Architecture rejected target-supplied description^M (gdb) FAIL: gdb.xml/tdesc-regs.exp: set tdesc file single-reg.xml core-regs isn't set for aarch64 target, and looks it is an oversight when aarch64 port was added. gdb/testsuite: 2015-02-25 Yao Qi <yao.qi@linaro.org> * gdb.xml/tdesc-regs.exp: Set core-regs to aarch64-core.xml for aarch64*-*-* target.
2015-02-25Automatic date update in version.inGDB Administrator1-1/+1
2015-02-24Adds support for emulating V850 e3v5 instructions to the simulator.Nick Clifton2-22/+855
* v850.igen: Add more e3v5 support. (FMAF.S): New pattern. (FMSF.S): New pattern. (FNMAF.S): New pattern. (FNMSF.S): New pattern. (cnvq15q30): New pattern. (cnvq30q15): New pattern. (cnvq31q62): New pattern. (cnvq62q31): New pattern. (dup.h): New pattern. (dup.w): New pattern. (expq31): New pattern. (modadd): New pattern. (mov.dw): New pattern. (mov.h): New pattern. (mov.w): New pattern. (pki16i32): New pattern. (pki16ui8): New pattern. (pki32i16): New pattern. (pki64i32): New pattern. (pkq15q31): New pattern. (pkq30q31): New pattern. (pkq31q15): New pattern. (pkui8i16): New pattern. (vabs.h): New pattern. (vabs.w): New pattern. (vadd.dw): New placeholder pattern. (vadd.h): New placeholder pattern. (vadd.w): New placeholder pattern. (vadds.h): New placeholder pattern. (vadds.w): New placeholder pattern. (vaddsat.h): New placeholder pattern. (vaddsat.w): New placeholder pattern. (vand): New pattern. (vbiq.h): New placeholder pattern. (vbswap.dw): New placeholder pattern. (vbswap.h): New placeholder pattern. (vbswap.w): New placeholder pattern. (vcalc.h): New placeholder pattern. (vcalc.w): New placeholder pattern. (vcmov): New placeholder pattern.
2015-02-24Adds support for generating notes in V850 binaries.Nick Clifton27-49/+888
bfd * elf32-v850.c (v850_set_note): New function. Creates a Renesas style note entry. (v850_elf_make_note_section): New function. Creates a note section. (v850_elf_create_sections): New function. Create a note section if one is not already present. (v850_elf_set_note): New function. Adds a note to a bfd. (v850_elf_copy_private_bfd_data): New function. Copies V850 notes. (v850_elf_merge_notes): New function. Merges V850 notes. (print_v850_note): New function. Displays a V850 note. (v850_elf_print_notes): New function. Displays all notes attached to a bfd. (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes. (v850_elf_print_private_bfd_data): Call v850_elf_print_notes. (v850_elf_fake_sections): Set the type of the V850 note section. * bfd-in.h (v850_elf_create_sections): Add prototype. (v850_elf_set_note): Add prototype. * bfd-in2.h: Regenerate. binutils* readelf.c (get_machine_flags): Remove deprecated V850 machine flags. (get_v850_section_type_name): New function. Handles V850 special sections. (get_section_type_name): Add support for V850. (get_v850_elf_note_type): New function. Returns the name of a V850 note. (print_v850_note): New function. Prints a V850 note. (process_v850_notes): New function. Prints V850 notes. (process_note_sections): Add support for V850. binutils/testsute * binutils-all/objcopy.exp: Skip the strip-10 test for the V850. gas * config/tc-v850.c (soft_float): New variable. (v850_data_8): New variable. (md_show_usage): Add -msoft-float/-mhard-float. (md_parse_option): Likewise. (md_begin): Set the default value of soft_float. (v850_md_end): New function. Creates a note section. * config/tc-v850.h (md_end): Define. * doc/c-v850.texi: Document -msoft-float/-mhard-float. gas/testsuite * gas/elf/elf.exp: Add special version of the section2 test for the V850. * gas/elf/section2.e-v850: New file. include/elf * v850.h (EF_RH850_SIMD): Delete deprecated flag. (EF_RH850_CACHE): Likewise. (EF_RH850_MMU): Likewise. (EF_RH850_DATA_ALIGN8): Likewise. (SHT_RENESAS_IOP): Fix typo in name. (SHT_RENESAS_INFO): Define. (V850_NOTE_SECNAME): Define. (SIZEOF_V850_NOTE): Define. (V850_NOTE_NAME): Define. (enum v850_notes): New enum. (NUM_V850_NOTES): Define. ld/ChangeLog 2015-02-24 Nick Clifton <nickc@redhat.com> * Makefile.am (ev850.c): Add dependency upon $(srcdir)/emultempl/v850elf.em. (ev850_rh850.c): Likewise. * Makefile.in: Regenerate. * emultempl/v850elf.em: New file. * emulparams/v850.sh (EXTRA_EM_FILE): Define. * emulparams/v850_rh850.sh (EXTRA_EM_FILE): Define. * scripttempl/v850.sc: Add .note.renesas section. * scripttempl/v850_rh850.sc: Likewise. ld/testsuite * ld-elf/extract-symbol-1sec.d: Expect to fail on the V850.
2015-02-24Fixes compiling peXXigen under MAC OS/X where the wcsncasecmp function is ↵Nick Clifton5-6/+40
not available. * configure.ac (AC_CHECK_HEADERS): Add wctype.h. * configure: Regenerate. * config.in: Regenerate. * peXXigen.c: Include wctype.h if HAVE_WCTYPE_H is defined. (u16_mbtowc): Use wint_t types if HAVE_WCTYPE_H is defined. (rsrc_cmp): Use towlower instead of wcsncasecmp if HAVE_WCTYPE_H is defined.
2015-02-24readelf: handle corrupted chains betterMike Frysinger2-10/+20
The current chain walker tries to protect itself against loops, by only works with loops of length 1: a chain that points to itself. If you have a chain longer than that (3->4->3->4->...), readelf will still hang. Since we know the max length of the chain, simply abort when we've walked more times than that. The only way that could have happened is if there was a loop.
2015-02-25Add aligned string merge testAlan Modra3-0/+35
* ld-elf/merge3.s, * ld-elf/merge3.d: New test.
2015-02-24Speed up the display of unwind tables by using a binary chop search to ↵Dmitry Antipov2-86/+159
locate function symbols. * readelf.c (find_symbol_for_address): Use a binary search to speed up symbol location. Skip check for function symbol type. (*_unw_aux_info): Add funtab and nfuns fields contains a sorted list of function symbols. (dump_ia64_unwind): Initialise the funtab and nfuns fields and pass them to find_symbol_for_address. (dump_hppa_unwind): Likewise. (arm_print_vma_and_name): Pass funtab to find_symbol_for_address. (dump_arm_unwind): Initialise the funtab and nfuns fields.
2015-02-24This patch modifies the AVR linker script templates to use ↵Senthil Kumar Selvaraj6-11/+49
__<name>_REGION_LENGTH__ symbols, if provided, for setting memory region lengths, defaulting to the current constant values otherwise. ld * scripttempl/avr.sc: Add new user_signatures region. Define and Use symbols for all region lengths. * scripttempl/avrtiny.sc: Define and use symbols for all region lengths. testsuite * ld-avr/region_overflow.d: New test. * ld-avr/region_overflow.s: Likewise.
2015-02-24Improves the warning message produyced by objdump when it cannot load a section.Nick Clifton2-1/+7
* objdump.c (dump_section): Extend the warning message displayed when a section cannot be loaded.
2015-02-24Fix the detection of illegal memory accesses in the MSP430 simulator.Nick Clifton2-34/+67
* msp430-sim.c (sim_open): Allocate memory regions matching those declared in the libgloss/msp430 linker scripts. Allow sim_load_file to fail. (get_op): Test the correct address bit when checking for out of range addresses. Include the address in the error message when an illegal access to the hardware multiplier is detected. (put_op): Test the correct address bit when checking for out of range addresses.
2015-02-24Fix the gas test align2 for the PDP11 by ensuring that the .text and .data ↵Nick Clifton2-0/+13
sections are written to their aligned sizes. * pdp11.c (set_section_contents): Pad the .text and .data sections to their aligned sizes.
2015-02-24PowerPC64 GOLD: complain on misaligned _DS relocsAlan Modra2-3/+12
PR 18010 * powerpc.cc (Powerpc_relocate_functions::addr16_ds): Always complain if value is not a multiple of four. (Target_powerpc::Relocate::relocate): Correct handling of R_POWERPC_GOT_TPREL16 and R_POWERPC_GOT_TPREL16_LO for ppc64.
2015-02-24Automatic date update in version.inGDB Administrator1-1/+1
2015-02-23Fix typo in earlier entry.Doug Evans1-1/+1
2015-02-23PR gdb/18008: Fix typo in documentationSergio Durigan Junior2-1/+7
This obvious patch fixes a typo in our documentation (s/problam/problem). gdb/doc/ChangeLog: 2015-02-23 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/18008 * gdb.texinfo (maint internal-error, maint internal-warning, maint demangler-warning): Fix typo ("problam").
2015-02-23gdbserver: redo stepping over breakpoint that was on top of a permanent ↵Pedro Alves2-8/+45
breakpoint I'm going to add an alternate mechanism of breakpoint trap identification to 'check_stopped_by_breakpoint' that does not rely on checking the instruction at PC. The mechanism currently used to tell whether we're stepping over a permanent breakpoint doesn't fit in that new method. This patch redoes the whole logic in a different way that works with both old and new methods, in essence moving the "stepped permanent breakpoint" detection "one level up". It makes lower level check_stopped_by_breakpoint always the adjust the PC, and then has linux_wait_1 advance the PC past the breakpoint if necessary. This ends up being better also because this now handles non-decr_pc_after_break targets too. Before, such targets would get stuck forever reexecuting the breakpoint instruction. Tested on x86_64 Fedora 20. gdb/gdbserver/ChangeLog: 2015-02-23 Pedro Alves <palves@redhat.com> * linux-low.c (check_stopped_by_breakpoint): Don't check if the thread was doing a step-over; always adjust the PC if we stepped over a permanent breakpoint. (linux_wait_1): If we stepped over breakpoint that was on top of a permanent breakpoint, manually advance the PC past it.
2015-02-23delete_breakpoints: Rewrite using gdb_test_multiplePedro Alves2-14/+29
Because delete_breakpoints uses gdb_expect directly, an internal error results in slow timeouts instead of quickly bailing out. This patch rewrites the procedure to use gdb_test_multiple instead, while preserving the existing general logic ("delete breakpoints" + "info breakpoints"). gdb/testsuite/ 2015-02-23 Pedro Alves <palves@redhat.com> * lib/gdb.exp (delete_breakpoints): Rewrite using gdb_test_multiple.
2015-02-23Adds a space between the operands of the RL78's MOV instruction for ↵Vinay3-8/+14
consistency with the disassembling of other instructions. * rl78-decode.opc (MOV): Added space between two operands for 'mov' instruction in index addressing mode. * rl78-decode.c: Regenerate.
2015-02-23Add support for the h8300-linux target.Yoshinori Sato19-5/+266
ld * Makefile.am: (ALL_EMULATION_SOURCES): Add new emulations. * Makefile.in: Regenerate. * configure.tgt: Add h8300-*-linux * emulparams/h8300elf_linux.sh: Add new emulation. * emulparams/h8300helf_linux.sh: Likewise. * emulparams/h8300self_linux.sh: Likewise. * emulparams/h8300sxelf_linux.sh: Likewise. bfd * config.bfd: Add h8300-*-linux. * configure.ac: Add h8300_elf32_linux_vec. * configure: Regenerate. * elf32-h8300.c: Likewise. * targets.c(_bfd_target_vector): Likewise. gas * config/tc-h8300.c (line_separater_chars): Add a version for h8300-linux that includes a separator. (default_mach): New variable. (md_main): Use it. (md_longopts): Add '--march' option. (md_parse_option): Parse the new option. * config/tc-h8300.h (TARGET_FORMAT): Add elf32-h8300-linux. * configure.tgt: Add h8300-*-linux * doc/c-h8300.texi: Document --march.
2015-02-23remote.c: simplify parsing stop reasons in T stop repliesPedro Alves2-85/+89
We need to be careful with parsing optional stop reasons that start with an hex character ("awatch", "core"), as GDBs that aren't aware of them parse them as real numbers. That's silly of course, given that there should be a colon after those magic "numbers". So if strtol on "abbz:" doesn't return "first invalid char" pointing to the colon, we know that "abbz" isn't really a register number. It must be optional stop info we don't know about. This adjusts GDB to work that way, removing the need for the special casing done upfront: /* If this packet is an awatch packet, don't parse the 'a' as a register number. */ if (strncmp (p, "awatch", strlen("awatch")) != 0 && strncmp (p, "core", strlen ("core") != 0)) For as long as we care about compatibility with GDB 7.9, we'll need to continue to be careful about this, so I added a comment. Tested on x86_64 Fedora 20, native gdbserver. gdb/ChangeLog: 2015-02-23 Pedro Alves <palves@redhat.com> * remote.c (skip_to_semicolon): New function. (remote_parse_stop_reply) <T stop reply>: Use it. Don't special case the stop reasons that look like hex numbers upfront. Instead handle real register numbers after matching all the known stop reasons.
2015-02-23Fixes a problem where "ld -ixxx" would report an error of "ld: bad -rpath ↵Nick Clifton2-1/+6
option". * lexsup.c (parse_args): Produce a more reasonable error message when -ixxx or -rxxx is the last option on the linker command line.
2015-02-23Fixes the generation of dwarf line debug information for the msp430, even in ↵Nick Clifton5-8/+77
the presence of function sections and linker garbage collection. PR 17940 * dwarf2dbg.c (out_header): When generating dwarf sections use real symbols not temps for the start and end symbols. * config/tc-msp430.h (TC_FORCE_RELOCATION_SUB_SAME): Also prevent adjustments to relocations in debug sections. (TC_LINKRELAX_FIXUP): Likewise. * elf32-msp430.c (msp430_elf_relax_delete_bytes): Adjust debug symbols at end of sections. Adjust function sizes.
2015-02-23Fixes a typo in the license notice in include/elf/score.hNick Clifton2-2/+8
PR 17915 * score.h: Fix typo in license header.
2015-02-23gdb.base/info-os.c: Include stdlib.hPedro Alves2-0/+5
Fixes: > gdb compile failed, /gdb/testsuite/gdb.base/info-os.c: In function 'main': > /gdb/testsuite/gdb.base/info-os.c:65:3: warning: implicit declaration of function 'atexit' [-Wimplicit-function-declaration] > atexit (ipc_cleanup); > ^ > FAIL: gdb.base/info-os.exp: cannot compile test program with recent GCCs. gdb/testsuite/ChangeLog: 2015-02-23 Pedro Alves <palves@redhat.com> * gdb.base/info-os.c: Include stdlib.h.
2015-02-23Fixes a couple of typos in the license header of the cpu-w65.c file.Nick Clifton2-2/+7
PR 17914 * cpu-w65.c: Correct typos in license notice.
2015-02-23gdbserver: 64-bit kernel / 32-inferior, syscall restartingPedro Alves2-2/+12
$ make check RUNTESTFLAGS="--target_board=native-gdbserver/-m32 clone-thread_db.exp" gdb.log shows: Running target native-gdbserver/-m32 ... clone-thread_db: src/gdb/testsuite/gdb.threads/clone-thread_db.c:57: thread_fn: Assertion `res != -1' failed. ... (gdb) FAIL: gdb.threads/clone-thread_db.exp: continue to end That was waitpid returning -1 / EINTR. We don't see that when testing with unix/-m32 (native debugging). Turns out to be that when debugging a 32-bit inferior, a 64-bit GDBserver is reading/writing $orig_eax from/to the wrong ptrace register buffer offset. When gdbserver is 64-bit, the ptrace register buffer is in 64-bit layout, so the register is found at "ORIG_EAX * 8", not at "ORIG_EAX * 4". Fixes these with --target_board=native-gdbserver/-m32 on x86_64 Fedora 20: -FAIL: gdb.threads/clone-thread_db.exp: continue to end +PASS: gdb.threads/clone-thread_db.exp: continue to end -FAIL: gdb.threads/hand-call-in-threads.exp: all dummies popped +PASS: gdb.threads/hand-call-in-threads.exp: all dummies popped PASS: gdb.threads/hand-call-in-threads.exp: breakpoint on all_threads_running PASS: gdb.threads/hand-call-in-threads.exp: breakpoint on hand_call PASS: gdb.threads/hand-call-in-threads.exp: disable scheduler locking @@ -29339,15 +29331,15 @@ PASS: gdb.threads/hand-call-in-threads.e PASS: gdb.threads/hand-call-in-threads.exp: discard hand call, thread 4 PASS: gdb.threads/hand-call-in-threads.exp: discard hand call, thread 5 PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 1 -FAIL: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 2 -FAIL: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 3 -FAIL: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 4 +PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 2 +PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 3 +PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 4 PASS: gdb.threads/hand-call-in-threads.exp: dummy stack frame number, thread 5 PASS: gdb.threads/hand-call-in-threads.exp: enable scheduler locking PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 1 -FAIL: gdb.threads/hand-call-in-threads.exp: hand call, thread 2 -FAIL: gdb.threads/hand-call-in-threads.exp: hand call, thread 3 -FAIL: gdb.threads/hand-call-in-threads.exp: hand call, thread 4 +PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 2 +PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 3 +PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 4 PASS: gdb.threads/hand-call-in-threads.exp: hand call, thread 5 PASS: gdb.threads/hand-call-in-threads.exp: prepare to discard hand call, thread 1 PASS: gdb.threads/hand-call-in-threads.exp: prepare to discard hand call, thread 2 gdb/gdbserver/ChangeLog 2015-02-23 Pedro Alves <palves@redhat.com> * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit modes. (x86_fill_gregset, x86_store_gregset): Use it when handling $orig_eax.
2015-02-23Automatic date update in version.inGDB Administrator1-1/+1
2015-02-22sim/erc32: Use readline.h for readline types and functions.Jiri Gaisler3-12/+8
Use gdb's readline.h for readline types.
2015-02-22Set GOLD_DEFAULT_SIZE to 32 for x32H.J. Lu3-0/+7
* configure.ac (default_size): Set to 32 for x32. * configure: Regenerated.
2015-02-22testcase for PR symtab/17855Doug Evans4-2/+49
gdb/testsuite/ChangeLog: PR symtab/17855 * gdb.ada/exec_changed.exp: Add second test where symbol lookup cache is read after symbols have been re-read. * gdb.ada/exec_changed/first.adb (First): New procedure Break_Me. * gdb.ada/exec_changed/second.adb (Second): Ditto.
2015-02-21PR c++/17976, symtab/17821Doug Evans5-17/+63
This patch addresses two issues. The basic problem is that "(anonymous namespace)" doesn't get entered into the symbol table because when dwarf2read.c:new_symbol_full is called the DIE has no name (dwarf2_name returns NULL). PR 17976: ptype '(anonymous namespace)' should work like any namespace PR 17821: perf issue looking up (anonymous namespace) bash$ gdb monster-program (gdb) mt set per on (gdb) mt set symbol-cache-size 0 (gdb) break (anonymous namespace)::foo Before: Command execution time: 3.266289 (cpu), 6.169030 (wall) Space used: 811429888 (+12910592 for this command) After: Command execution time: 1.264076 (cpu), 4.057408 (wall) Space used: 798781440 (+0 for this command) gdb/ChangeLog: PR c++/17976, symtab/17821 * cp-namespace.c (cp_search_static_and_baseclasses): New parameter is_in_anonymous. All callers updated. (find_symbol_in_baseclass): Ditto. (cp_lookup_nested_symbol_1): Ditto. Don't search all static blocks for symbols in an anonymous namespace. * dwarf2read.c (namespace_name): Don't call dwarf2_name, fetch DW_AT_name directly. (dwarf2_name): Convert missing namespace name to CP_ANONYMOUS_NAMESPACE_STR. gdeb/testsuite/ChangeLog: * gdb.cp/anon-ns.exp: Add test for ptype '(anonymous namespace)'.
2015-02-21sim/erc32: File loading via command line did not workJiri Gaisler1-1/+4
* sis.c (main) load binary file from argv parameters
2015-02-21sim/erc32: Fix incorrect simulator performance reportJiri Gaisler5-17/+39
2015-02-21sim/erc32: Remove unused defines in Makefile and switch off statisticsJiri Gaisler2-1/+5
2015-02-21sim/erc32: Use fenv.h for host FPU accessJiri Gaisler2-161/+35
2015-02-21sim/erc32: Perform pseudo-init if binary linked to non-zero address.Jiri Gaisler4-0/+37
Binaries produced by most erc32 tool-chains do not include system initialization. sis will detect this and initialize necessary registers for memory and timer control.
2015-02-21sim/erc32: Corrected wrong CPU implementation and version ID in psrJiri Gaisler2-1/+5
2015-02-21sim/erc32: Disassembly in stand-alone mode did not work.Jiri Gaisler2-3/+19
The API to print_insn_sparc() has changed over the years ...
2015-02-22Automatic date update in version.inGDB Administrator1-1/+1
2015-02-21binutils: readelf: add missing newline to warning messageMike Frysinger2-1/+6
2015-02-21Testsuite patch for: i386: Fix internal error when prstatus in core file is ↵Jan Kratochvil3-0/+64
too big gdb/testsuite/ChangeLog 2015-02-21 Jan Kratochvil <jan.kratochvil@redhat.com> PR corefiles/17808 * gdb.arch/i386-biarch-core.core.bz2: New file. * gdb.arch/i386-biarch-core.exp: New file.
2015-02-21gdb.threads/multi-create-ns-info-thr.exp and native-extended-remote boardPedro Alves2-1/+8
The buildbot shows that the new gdb.threads/multi-create-ns-info-thr.exp test is timing out when tested with --target=native-extended-remote. The reason is: No breakpoints or watchpoints. (gdb) break main Breakpoint 1 at 0x10000b00: file ../../../binutils-gdb/gdb/testsuite/gdb.threads/multi-create.c, line 72. (gdb) run Starting program: /home/gdb-buildbot/fedora-21-ppc64be-1/fedora-ppc64be-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.threads/multi-create-ns-info-thr/multi-cre ate-ns-info-thr Process /home/gdb-buildbot/fedora-21-ppc64be-1/fedora-ppc64be-native-extended-gdbserver/build/gdb/testsuite/outputs/gdb.threads/multi-create-ns-info-thr/multi-create-ns-inf o-thr created; pid = 16266 Unexpected vCont reply in non-stop mode: T0501:00003fffffffd190;40:00000080560fe290;thread:p3f8a.3f8a;core:0; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (gdb) break multi-create.c:45 Breakpoint 2 at 0x10000994: file ../../../binutils-gdb/gdb/testsuite/gdb.threads/multi-create.c, line 45. (gdb) commands Type commands for breakpoint(s) 2, one per line. Non-stop tests don't really work with the --target_board=native-extended-remote board, because tests toggle non-stop on after GDB is already connected to gdbserver, while Currently, non-stop must be enabled before connecting. This adjusts the test to bail if running to main fails, like all other non-stop tests. Note non-stop tests do work with --target_board=native-gdbserver. gdb/testsuite/ChangeLog: 2015-02-21 Pedro Alves <palves@redhat.com> * gdb.threads/multi-create-ns-info-thr.exp: Return early if runto_main fails.
2015-02-21Automatic date update in version.inGDB Administrator1-1/+1
2015-02-20Fix gdb.base/solib-corrupted.exp after dtrace probes changesPedro Alves2-1/+6
Commit 6f9b8491 (Adapt `info probes' to support printing probes of different types.) added a new type column to "info probes". That caused a solib-corrupted.exp regression: ~~~~~~~~~~~~~~~~~~~~~ Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/solib-corrupted.exp ... FAIL: gdb.base/solib-corrupted.exp: corrupted list === gdb Summary === # of expected passes 2 # of unexpected failures 1 ~~~~~~~~~~~~~~~~~~~~~ Tested on x86_64 Fedora 20. gdb/testsuite/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * gdb.base/solib-corrupted.exp: Expect "stap" as first column of info probes.
2015-02-20GNU/Linux: Stop using libthread_db/td_ta_thr_iterPedro Alves10-172/+291
TL;DR - GDB can hang if something refreshes the thread list out of the target while the target is running. GDB hangs inside td_ta_thr_iter. The fix is to not use that libthread_db function anymore. Long version: Running the testsuite against my all-stop-on-top-of-non-stop series is still exposing latent non-stop bugs. I was originally seeing this with the multi-create.exp test, back when we were still using libthread_db thread event breakpoints. The all-stop-on-top-of-non-stop series forces a thread list refresh each time GDB needs to start stepping over a breakpoint (to pause all threads). That test hits the thread event breakpoint often, resulting in a bunch of step-over operations, thus a bunch of thread list refreshes while some threads in the target are running. The commit adds a real non-stop mode test that triggers the issue, based on multi-create.exp, that does an explicit "info threads" when a breakpoint is hit. IOW, it does the same things the as-ns series was doing when testing multi-create.exp. The bug is a race, so it unfortunately takes several runs for the test to trigger it. In fact, even when setting the test running in a loop, it sometimes takes several minutes for it to trigger for me. The race is related to libthread_db's td_ta_thr_iter. This is libthread_db's entry point for walking the thread list of the inferior. Sometimes, when GDB refreshes the thread list from the target, libthread_db's td_ta_thr_iter can somehow see glibc's thread list as a cycle, and get stuck in an infinite loop. The issue is that when a thread exits, its thread control structure in glibc is moved from a "used" list to a "cache" list. These lists are simply circular linked lists where the "next/prev" pointers are embedded in the thread control structure itself. The "next" pointer of the last element of the list points back to the list's sentinel "head". There's only one set of "next/prev" pointers for both lists; thus a thread can only be in one of the lists at a time, not in both simultaneously. So when thread C exits, simplifying, the following happens. A-C are threads. stack_used and stack_cache are the list's heads. Before: stack_used -> A -> B -> C -> (&stack_used) stack_cache -> (&stack_cache) After: stack_used -> A -> B -> (&stack_used) stack_cache -> C -> (&stack_cache) td_ta_thr_iter starts by iterating at the list's head's next, and iterates until it sees a thread whose next pointer points to the list's head again. Thus in the before case above, C's next points to stack_used, indicating end of list. In the same case, the stack_cache list is empty. For each thread being iterated, td_ta_thr_iter reads the whole thread object out of the inferior. This includes the thread's "next" pointer. In the scenario above, it may happen that td_ta_thr_iter is iterating thread B and has already read B's thread structure just before thread C exits and its control structure moves to the cached list. Now, recall that td_ta_thr_iter is running in the context of GDB, and there's no locking between GDB and the inferior. From it's local copy of B, td_ta_thr_iter believes that the next thread after B is thread C, so it happilly continues iterating to C, a thread that has already exited, and is now in the stack cache list. After iterating C, td_ta_thr_iter finds the stack_cache head, which because it is not stack_used, td_ta_thr_iter assumes it's just another thread. After this, unless the reverse race triggers, GDB gets stuck in td_ta_thr_iter forever walking the stack_cache list, as no thread in thatlist has a next pointer that points back to stack_used (the terminating condition). Before fully understanding the issue, I tried adding cycle detection to GDB's td_ta_thr_iter callback. However, td_ta_thr_iter skips calling the callback in some cases, which means that it's possible that the callback isn't called at all, making it impossible for GDB to break the loop. I did manage to get GDB stuck in that state more than once. Fortunately, we can avoid the issue altogether. We don't really need td_ta_thr_iter for live debugging nowadays, given PTRACE_EVENT_CLONE. We already know how to map and lwp id to a thread id without iterating (thread_from_lwp), so use that more. gdb/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * linux-nat.c (linux_handle_extended_wait): Call thread_db_notice_clone whenever a new clone LWP is detected. (linux_stop_and_wait_all_lwps, linux_unstop_all_lwps): New functions. * linux-nat.h (thread_db_attach_lwp): Delete declaration. (thread_db_notice_clone, linux_stop_and_wait_all_lwps) (linux_unstop_all_lwps): Declare. * linux-thread-db.c (struct thread_get_info_inout): Delete. (thread_get_info_callback): Delete. (thread_from_lwp): Use td_thr_get_info and record_thread. (thread_db_attach_lwp): Delete. (thread_db_notice_clone): New function. (try_thread_db_load_1): If /proc is mounted and shows the process'es task list, walk over all LWPs and call thread_from_lwp instead of relying on td_ta_thr_iter. (attach_thread): Don't call check_thread_signals here. Split the tail part of the function (which adds the thread to the core GDB thread list) to ... (record_thread): ... this function. Call check_thread_signals here. (thread_db_wait): Don't call thread_db_find_new_threads_1. Always call thread_from_lwp. (thread_db_update_thread_list): Rename to ... (thread_db_update_thread_list_org): ... this. (thread_db_update_thread_list): New function. (thread_db_find_thread_from_tid): Delete. (thread_db_get_ada_task_ptid): Simplify. * nat/linux-procfs.c: Include <sys/stat.h>. (linux_proc_task_list_dir_exists): New function. * nat/linux-procfs.h (linux_proc_task_list_dir_exists): Declare. gdb/gdbserver/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * thread-db.c: Include "nat/linux-procfs.h". (thread_db_init): Skip listing new threads if the kernel supports PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible. gdb/testsuite/ChangeLog: 2015-02-20 Pedro Alves <palves@redhat.com> * gdb.threads/multi-create-ns-info-thr.exp: New file.