aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-04-12Add support for .extCondCode, .extCoreRegister and .extAuxRegister.Claudiu Zissulescu23-477/+1115
gas/ 2016-04-05 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/textauxregister.d: New file. * testsuite/gas/arc/textauxregister.s: Likewise. * testsuite/gas/arc/textcondcode.d: Likewise. * testsuite/gas/arc/textcondcode.s: Likewise. * testsuite/gas/arc/textcoreregister.d: Likewise. * testsuite/gas/arc/textcoreregister.s: Likewise. * testsuite/gas/arc/textpseudoop.d: Likewise. * testsuite/gas/arc/textpseudoop.s: Likewise. * testsuite/gas/arc/ld2.d: Update test. * testsuite/gas/arc/st.d: Likewise. * testsuite/gas/arc/taux.d: Likewise. * doc/c-arc.texi (ARC Directives): Add .extCondCode, .extCoreRegister and .extAuxRegister documentation. * config/tc-arc.c (arc_extcorereg): New function. (md_pseudo_table): Add .extCondCode, .extCoreRegister and .extAuxRegister pseudo-ops. (extRegister_t): New type. (ext_condcode, arc_aux_hash): New global variable. (find_opcode_match): Check for extensions. (preprocess_operands): Likewise. (md_begin): Add aux registers in a hash. (assemble_insn): Update use arc_flags member. (tokenize_extregister): New function. (create_extcore_section): Likewise. * config/tc-arc.h (MAX_FLAG_NAME_LENGHT): Increase to 10. (arc_flags): Delete code, add flgp. include/ 2016-04-05 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (flag_class_t): Update. (ARC_OPCODE_NONE): Define. (ARC_OPCODE_ARCALL): Likewise. (ARC_OPCODE_ARCFPX): Likewise. (ARC_REGISTER_READONLY): Likewise. (ARC_REGISTER_WRITEONLY): Likewise. (ARC_REGISTER_NOSHORT_CUT): Likewise. (arc_aux_reg): Add cpu. opcodes/ 2016-04-05 Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (find_format): Check for extension flags. (print_flags): New function. (print_insn_arc): Update for .extCondCode, .extCoreRegister and .extAuxRegister. * arc-ext.c (arcExtMap_coreRegName): Use LAST_EXTENSION_CORE_REGISTER. (arcExtMap_coreReadWrite): Likewise. (dump_ARC_extmap): Update printing. * arc-opc.c (arc_flag_classes): Add F_CLASS_EXTEND flag. (arc_aux_regs): Add cpu field. * arc-regs.h: Add cpu field, lower case name aux registers. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12Update ARC instruction data-base.Claudiu Zissulescu7-0/+80
gas/ 2016-04-05 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/noargs_a7.d: New file. * testsuite/gas/arc/noargs_a7.s: Likewise. * testsuite/gas/arc/noargs_hs.d: Likewise. * testsuite/gas/arc/noargs_hs.s: Likewise. opcode/ 2016-04-05 Claudiu Zissulescu <claziss@synopsys.com> * arc-tbl.h: Add rtsc, sleep with no arguments. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12Add support for .extInstruction pseudo-op.Claudiu Zissulescu19-202/+1343
gas/ 2016-04-04 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/textinsn-errors.d: New File. * testsuite/gas/arc/textinsn-errors.err: Likewise. * testsuite/gas/arc/textinsn-errors.s: Likewise. * testsuite/gas/arc/textinsn2op.d: Likewise. * testsuite/gas/arc/textinsn2op.s: Likewise. * testsuite/gas/arc/textinsn2op01.d: Likewise. * testsuite/gas/arc/textinsn2op01.s: Likewise. * testsuite/gas/arc/textinsn3op.d: Likewise. * testsuite/gas/arc/textinsn3op.s: Likewise. * doc/c-arc.texi (ARC Directives): Add .extInstruction documentation. * config/tc-arc.c (arcext_section): New variable. (arc_extinsn): New function. (md_pseudo_table): Add .extInstruction pseudo op. (attributes_t): New type. (suffixclass, syntaxclass, syntaxclassmod): New constant structures. (find_opcode_match): Remove arc_num_opcodes. (md_begin): Likewise. (tokenize_extinsn): New function. (arc_set_ext_seg): Likewise. (create_extinst_section): Likewise. include/ 2016-04-04 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (arc_num_opcodes): Remove. (ARC_SYNTAX_3OP, ARC_SYNTAX_2OP, ARC_OP1_MUST_BE_IMM) (ARC_OP1_IMM_IMPLIED, ARC_SUFFIX_NONE, ARC_SUFFIX_COND) (ARC_SUFFIX_FLAG): Define. (flags_none, flags_f, flags_cc, flags_ccf): Declare. (arg_none, arg_32bit_rarbrc, arg_32bit_zarbrc, arg_32bit_rbrbrc) (arg_32bit_rarbu6, arg_32bit_zarbu6, arg_32bit_rbrbu6) (arg_32bit_rbrbs12, arg_32bit_ralimmrc, arg_32bit_rarblimm) (arg_32bit_zalimmrc, arg_32bit_zarblimm, arg_32bit_rbrblimm) (arg_32bit_ralimmu6, arg_32bit_zalimmu6, arg_32bit_zalimms12) (arg_32bit_ralimmlimm, arg_32bit_zalimmlimm, arg_32bit_rbrc) (arg_32bit_zarc, arg_32bit_rbu6, arg_32bit_zau6, arg_32bit_rblimm) (arg_32bit_zalimm, arg_32bit_limmrc, arg_32bit_limmu6) (arg_32bit_limms12, arg_32bit_limmlimm): Likewise. opcodes/ 2016-04-04 Claudiu Zissulescu <claziss@synopsys.com> * arc-opc.c (flags_none, flags_f, flags_cc, flags_ccf): Initialize. (arg_none, arg_32bit_rarbrc, arg_32bit_zarbrc, arg_32bit_rbrbrc) (arg_32bit_rarbu6, arg_32bit_zarbu6, arg_32bit_rbrbu6) (arg_32bit_rbrbs12, arg_32bit_ralimmrc, arg_32bit_rarblimm) (arg_32bit_zalimmrc, arg_32bit_zarblimm, arg_32bit_rbrblimm) (arg_32bit_ralimmu6, arg_32bit_zalimmu6, arg_32bit_zalimms12) (arg_32bit_ralimmlimm, arg_32bit_zalimmlimm, arg_32bit_rbrc) (arg_32bit_zarc, arg_32bit_rbu6, arg_32bit_zau6, arg_32bit_rblimm) (arg_32bit_zalimm, arg_32bit_limmrc, arg_32bit_limmu6) (arg_32bit_limms12, arg_32bit_limmlimm): Likewise. (arc_opcode arc_opcodes): Null terminate the array. (arc_num_opcodes): Remove. * arc-ext.h (INSERT_XOP): Define. (extInstruction_t): Likewise. (arcExtMap_instName): Delete. (arcExtMap_insn): New function. (arcExtMap_genOpcode): Likewise. * arc-ext.c (ExtInstruction): Remove. (create_map): Zero initialize instruction fields. (arcExtMap_instName): Remove. (arcExtMap_insn): New function. (dump_ARC_extmap): More info while debuging. (arcExtMap_genOpcode): New function. * arc-dis.c (find_format): New function. (print_insn_arc): Use find_format. (arc_get_disassembler): Enable dump_ARC_extmap only when debugging. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-12Remove unneeded AUX register symbols.Claudiu Zissulescu5-0/+414
gas/ 2016-03-31 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (preprocess_operands): Mark AUX symbol. (arc_adjust_symtab): New function. * config/tc-arc.h (ARC_FLAG_AUX): Define. (obj_adjust_symtab): Likewise. * testsuite/gas/arc/taux.d: New file. * testsuite/gas/arc/taux.s: Likewise. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
2016-04-11Properly handle dynamic reloc against normal symbolH.J. Lu15-6/+110
We shouldn't issue an error for read-only segment with dynamic IFUNC relocations when dynamic relocations are against normal symbols. bfd/ PR ld/19939 * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): Add a pointer to bfd_boolean. * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated. Set *readonly_dynrelocs_against_ifunc_p to TRUE if dynamic reloc applies to read-only section. * elf32-i386.c (elf_i386_link_hash_table): Add readonly_dynrelocs_against_ifunc. (elf_i386_allocate_dynrelocs): Updated. (elf_i386_size_dynamic_sections): Issue an error for read-only segment with dynamic IFUNC relocations only if readonly_dynrelocs_against_ifunc is TRUE. * elf64-x86-64.c (elf_x86_64_link_hash_table): Add readonly_dynrelocs_against_ifunc. (elf_x86_64_allocate_dynrelocs): Updated. (elf_x86_64_size_dynamic_sections): Issue an error for read-only segment with dynamic IFUNC relocations only if readonly_dynrelocs_against_ifunc is TRUE. * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs): Updated. ld/ PR ld/19939 * testsuite/ld-i386/i386.exp: Run PR ld/19939 tests. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr19939.s: New file. * testsuite/ld-i386/pr19939a.d: Likewise. * testsuite/ld-i386/pr19939b.d: Likewise. * testsuite/ld-x86-64/pr19939.s: Likewise. * testsuite/ld-x86-64/pr19939a.d: Likewise. * testsuite/ld-x86-64/pr19939b.d: Likewise.
2016-04-12Automatic date update in version.inGDB Administrator1-1/+1
2016-04-11MIPS/opcodes: Fix undecoded MIPS16 extended instruction bit disassemblyMaciej W. Rozycki6-2/+383
Correct the disassembly of hardware don't cares in MIPS16 extended instructions. Rather than e.g.: 0: f008 0231 addiu v0,sp,16433 4: f520 3260 sll v0,v1,-12 print: 0: f008 0231 addiu v0,sp,16401 4: f520 3260 sll v0,v1,20 respectively instead. opcodes/ * mips-dis.c (print_mips16_insn_arg): Mask unused extended instruction bits out. binutils/ * testsuite/binutils-all/mips/mips16-undecoded.d: New test. * testsuite/binutils-all/mips/mips16-undecoded.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new test.
2016-04-11Automatic date update in version.inGDB Administrator1-1/+1
2016-04-10Fix primary reason why the SH simulation hasn't been working on 64 bit hosts.Oleg Endo3-37/+21
sim/sh/ * interp.c (dmul): Split into dmul_s and dmul_u. Use explicit integer width types and simplify implementation. * gencode.c (dmuls.l, dmulu.l): Use new functions dmul_s and dmul_u.
2016-04-10Move ChangeLog entries from sim/ChangeLog to sim/sh/ChangeLog.Oleg Endo2-5/+5
2016-04-10Automatic date update in version.inGDB Administrator1-1/+1
2016-04-09MIPS/GAS: Sanitize `.option picX' pseudo-opMaciej W. Rozycki7-1/+56
gas/ * config/tc-mips.c (s_option): Sanitize `.option picX' pseudo-op. * testsuite/gas/mips/option-pic-1.d: New test. * testsuite/gas/mips/option-pic-2.l: New list test. * testsuite/gas/mips/option-pic-1.s: New test source. * testsuite/gas/mips/option-pic-2.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2016-04-09MIPS/GAS: Disallow `.option picX' with VxWorks PICMaciej W. Rozycki7-3/+35
gas/ * config/tc-mips.c (s_option): Reject `.option picX' if VxWorks PIC. * testsuite/gas/mips/option-pic-vxworks-1.l: New list test. * testsuite/gas/mips/option-pic-vxworks-2.l: New list test. * testsuite/gas/mips/option-pic-vxworks-1.s: New test source. * testsuite/gas/mips/option-pic-vxworks-2.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2016-04-09gdb.python/py-mi-events-gdb.py: Add parentheses to printSimon Marchi2-2/+8
Required for Python 3 gdb/testsuite/ChangeLog: * gdb.python/py-mi-events-gdb.py (signal_stop_handler): Add parentheses to print. (continue_handler): Likewise.
2016-04-09MIPS/GAS: Correct call formatting in `can_swap_branch_p'Maciej W. Rozycki2-5/+9
gas/ * config/tc-mips.c (can_swap_branch_p): Correct call formatting.
2016-04-09GAS: Fix a typo in `as_bad' descriptionMaciej W. Rozycki2-1/+5
gas/ * messages.c (as_bad): Fix a typo in description.
2016-04-09MIPS/GAS: Unify messages in `mips_check_options'Maciej W. Rozycki2-2/+6
gas/ * config/tc-mips.c (mips_check_options): Unify messages.
2016-04-09MIPS/GAS: Use `opts->isa' consistently in `mips_check_options'Maciej W. Rozycki2-3/+8
gas/ * config/tc-mips.c (mips_check_options): Use `opts->isa' consistently.
2016-04-09Adjust default memory size and stack base address for SH simulator.Oleg Endo4-5/+14
ld/ChangeLog: * sh/interp.c (sim_memory_size): Default init to 30. (parse_and_set_memory_size): Adjust upper bound to 31. sim/ChangeLog: * sh/interp.c (sim_memory_size): Default init to 30. (parse_and_set_memory_size): Adjust upper bound to 31.
2016-04-09Automatic date update in version.inGDB Administrator1-1/+1
2016-04-08Make gdb.server/solib-list.exp work for remote targetsSimon Marchi2-13/+19
There are a few small changes needed to make it work with a real remote target. - Remove the [is_remote target] check. - Remove soname setting when building the lib, it's done by default now anyway. - In the compilation of the executable, pass the shared lib using the shlib option, so that RPATH is set. - Download the program to the target using gdb_remote_download, and record the remote path. Remove loading of the program using gdb_load_shlibs, which was not really appropriate anyway. - Run the remote path through readlink (see comment in the code). - Start gdbserver with the remote path. Also, don't set executable and objfile variables, as they are unused. Tested with native, native-gdbserver, native-extended-gdbserver, and a remote gdbserver. gdb/testsuite/ChangeLog: * gdb.server/solib-list.exp: Remove is_remote check. Pass shlib= to gdb_compile. Don't link shared library with -soname. Call gdb_remote_download instead of gdb_load_shlibs. Run binary filename through "readlink -f" on the target.
2016-04-08Fix gdb.server/solib-list.exp regressionPedro Alves3-3/+17
Commit 7817ea46148d (Improve gdb_remote_download, remove gdb_download) caused: FAIL: gdb.server/solib-list.exp: non-stop 0: target extended-remote (timeout) FAIL: gdb.server/solib-list.exp: non-stop 0: continue (the program is no longer running) FAIL: gdb.server/solib-list.exp: non-stop 0: p libvar FAIL: gdb.server/solib-list.exp: non-stop 1: target extended-remote (timeout) FAIL: gdb.server/solib-list.exp: non-stop 1: continue (the program is no longer running) FAIL: gdb.server/solib-list.exp: non-stop 1: p libvar gdb.log shows: system interpreter is: /lib64/ld-linux-x86-64.so.2 ... spawn ../gdbserver/gdbserver --once :2347 /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/ld-linux-x86-64.so.2 /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/solib-list Process /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/ld-linux-x86-64.so.2 created; pid = 18637 Cannot exec /home/pedro/brno/pedro/gdb/mygit/build/gdb/testsuite/outputs/gdb.server/solib-list/ld-linux-x86-64.so.2: No such file or directory. ... The test copied the interpreter to the outputs directory, however ld-linux-x86-64.so.2 is a relative symlink that when copied points nowhere: $ ls -l testsuite/outputs/gdb.server/solib-list/ total 52 -rwxrwxr-x. 1 pedro pedro 13450 Apr 7 10:52 gdb.log -rw-rw-r--. 1 pedro pedro 1512 Apr 7 10:52 gdb.sum lrwxrwxrwx. 1 pedro pedro 10 Apr 7 11:39 ld-linux-x86-64.so.2 -> ld-2.22.so -rwxrwxr-x. 1 pedro pedro 9464 Apr 7 11:39 solib-list -rw-rw-r--. 1 pedro pedro 3472 Apr 7 11:39 solib-list-lib.c.o -rw-rw-r--. 1 pedro pedro 2760 Apr 7 11:39 solib-list.o -rwxrwxr-x. 1 pedro pedro 9232 Apr 7 11:39 solib-list.so The copying comes from gdbserver_spawn -> gdbserver_download_current_prog -> gdb_remote_download. There's actually no need to download the interpreter to the target - it's part of the target system/environment. So fix this by making the test just not use gdb_load (and gdb_file_cmd as consequence) at all, and instead pass the interpreter filename to gdbserver as an argument. gdb/testsuite/ChangeLog: 2016-04-08 Pedro Alves <palves@redhat.com> * gdb.server/solib-list.exp: Don't use gdb_load. Instead pass the interpreter filename as argument to gdbserver_spawn. * lib/gdbserver-support.exp (gdbserver_download_current_prog): Return empty if $last_loaded_file does not exist.
2016-04-08value: Make accessor methods' parameters const-correctMartin Galvan3-30/+61
I did a quick pass over value.c and value.h and made some of the accessor methods' pass-by-reference parameters const-correct. Besides the obvious benefits, this is required if we want to use them on values that are already declared as const (such as the parameters to lval_funcs). There's probably a lot more stuff that can be made const, here and elsewhere. gdb/ChangeLog: 2016-04-08 Martin Galvan <martin.galvan@tallertechnologies.com> * value.c (value_next): Make pass-by-reference parameters const-correct. (value_parent): Likewise. (value_enclosing_type): Likewise. (value_lazy): Likewise. (value_stack): Likewise. (value_embedded_offset): Likewise. (value_pointed_to_offset): Likewise. (value_raw_address): Likewise. (deprecated_value_modifiable): Likewise. (value_free_to_mark): Likewise. (value_release_to_mark): Likewise. (internalvar_name): Likewise. (readjust_indirect_value_type): Likewise. (value_initialized): Likewise. * value.h (value_next): Likewise. (value_parent): Likewise. (value_enclosing_type): Likewise. (value_lazy): Likewise. (value_stack): Likewise. (value_embedded_offset): Likewise. (value_pointed_to_offset): Likewise. (value_raw_address): Likewise. (deprecated_value_modifiable): Likewise. (value_free_to_mark): Likewise. (value_release_to_mark): Likewise. (internalvar_name): Likewise. (readjust_indirect_value_type): Likewise. (value_initialized): Likewise.
2016-04-08PR18452, ld allows overlapping sectionsAlan Modra2-19/+34
PR 18452 * ldlang.c (maybe_overlays): Delete. (lang_size_sections_1): Remove code setting maybe_overlays. (lang_check_section_addresses): Instead detect overlays by exact match of section VMAs here. Fix memory leak.
2016-04-08testsuite: Fix for gcc-4.8: gdb.base/jit.exp gdb.base/jit-so.expJan Kratochvil2-76/+81
on CentOS-7.2 I get Running /home/jkratoch/redhat/gdb-test-reg/gdb/testsuite/gdb.base/jit.exp ... FAIL: gdb.base/jit.exp: one_jit_test-1: continue to breakpoint: break here 2 (the program exited) FAIL: gdb.base/jit.exp: one_jit_test-2: continue to breakpoint: break here 2 (the program exited) FAIL: gdb.base/jit.exp: attach: one_jit_test-2: continue to breakpoint: break here 2 (the program exited) FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: set var wait_for_gdb = 1 FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: detach (the program is no longer running) FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: attach FAIL: gdb.base/jit.exp: attach: one_jit_test-2: break here 2: set var wait_for_gdb = 0 FAIL: gdb.base/jit.exp: PIE: one_jit_test-1: continue to breakpoint: break here 2 (the program exited) Running /home/jkratoch/redhat/gdb-test-reg/gdb/testsuite/gdb.base/jit-so.exp ... FAIL: gdb.base/jit-so.exp: one_jit_test-1: continue to breakpoint: break here 2 (the program exited) FAIL: gdb.base/jit-so.exp: one_jit_test-2: continue to breakpoint: break here 2 (the program exited) since: 85af34ee0211eedf8d30a5c44dfc59dddf8b512a is the first bad commit commit 85af34ee0211eedf8d30a5c44dfc59dddf8b512a Author: Pedro Alves <palves@redhat.com> Date: Thu Mar 31 19:28:47 2016 +0100 Add regression test for PR gdb/19858 (JIT code registration on attach) The compiled code's .debug_line is wrong (for the simplistic approach of GDB to put a breakpoint on the first address belonging to that source line) and so GDB misses the breakpoint at the last line: WAIT_FOR_GDB; return 0; /* gdb break here 2 */ Most of the patch is just about reindentation, no changes there. gdb/testsuite/ChangeLog 2016-04-08 Jan Kratochvil <jan.kratochvil@redhat.com> Fix compatibility with gcc-4.8.5-4.el7.x86_64. * gdb.base/jit-main.c: Use exit after usage.
2016-04-08Fix regexps in PR19910 test to cope with COFF and AOUT sparc targets.Nick Clifton2-3/+10
PR target/19910 * testsuite/gas/sparc/pr19910-1.d: Adjust regexps to work with COFF and AOUT sparc targets.
2016-04-08Show sizes in linker map in target machine address unitsDan Gisselquist2-4/+15
* ldlang.c (print_output_section_statement): Show minfo size in target machine address units. (print_reloc_statement): Likewise. (print_padding_statement): Likewise. (print_data_statement): Likewise. Ensure minimum print_dot increment of one address unit.
2016-04-08Automatic date update in version.inGDB Administrator1-1/+1
2016-04-07testsuite: Fix false FAILs with .bashrc GDBHISTFILE=...Jan Kratochvil3-6/+20
$ GDBHISTFILE=/tmp/gdbhistfile runtest gdb.base/gdbhistsize-history.exp gdb.base/gdbinit-history.exp Running ./gdb.base/gdbinit-history.exp ... FAIL: gdb.base/gdbinit-history.exp: home=gdbinit-history/unlimited gdbhistsize=1000: show commands FAIL: gdb.base/gdbinit-history.exp: home=gdbinit-history/unlimited gdbhistsize=foo: show commands Running ./gdb.base/gdbhistsize-history.exp ... FAIL: gdb.base/gdbhistsize-history.exp: histsize=: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=20: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize= 20 : show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=-5: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=not_an_integer: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=10zab: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=-5ab: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=99999999999999999999999999999999999: show commands FAIL: gdb.base/gdbhistsize-history.exp: histsize=50: show commands This happens for my setup due to my: $ grep GDB ~/.bashrc export GDBHISTFILE="$HOME/.gdb_history" gdb/testsuite/ChangeLog 2016-04-07 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/gdbhistsize-history.exp: Save and unset GDBHISTFILE and GDBHISTSIZE prior to the tests. * gdb.base/gdbinit-history.exp: Likewise.
2016-04-07Fix gdb.compile/compile.exp shlib regressionPedro Alves2-3/+12
Commit 6e774b13c3b8 (Make ftrace tests work with remote targets) made a few gdb.compile/compile.exp tests disappear: -PASS: gdb.compile/compile.exp: call shared library function -PASS: gdb.compile/compile.exp: expect 1 -PASS: gdb.compile/compile.exp: modify shared library variable -PASS: gdb.compile/compile.exp: expect 15 This is because the test uses ldflags instead of using the shlib option, so it misses linking with -rpath, resulting in: (gdb) run Starting program: .../compile/compile-shlib .../compile/compile-shlib: error while loading shared libraries: compile-shlib.so: cannot open shared object file: No such file or directory [Inferior 1 (process 18014) exited with code 0177] We were missing a gdb_load_shlibs call, which is needed for remote testing. gdb/testsuite/ChangeLog: 2015-04-07 Pedro Alves <palves@redhat.com> * gdb.compile/compile.exp: Use gdb_compile with "shlib=" option instead of build_executable. Use gdb_load_shlibs.
2016-04-07arc/nps400: Add new instructionsAndrew Burgess7-1/+114
Add some new control instructions to the opcodes library, and a new test for these new instructions to the assembler. The new instructions use an instruction flag longer than any seen before (on arc), and so the max flag length is extended to accommodate this. gas/ChangeLog: * config/tc-arc.h (MAX_FLAG_NAME_LENGTH): Increase to 7. * testsuite/gas/arc/nps400-2.d: New file. * testsuite/gas/arc/nps400-2.s: New file. opcodes/ChangeLog: * arc-nps400-tbl.h: Add schd, sync, and hwschd instructions. * arc-opc.c (arc_flag_operands): Add new flags. (arc_flag_classes): Add new classes.
2016-04-07gas/arc: Handle multiple arc_opcode chains for same mnemonicAndrew Burgess4-13/+104
This commit completes support for having multiple instructions with the same mnemonic in non-contiguous blocks within the arc_opcodes table. The commit adds an iterator mechanism for the arc_opcode_hash_entry structure, which is then used in find_opcode_match to consider all arc_opcode entries with the same mnemonic, even when these instructions are stored in non-contiguous blocks. I extend the comment on the arc_opcodes table to discuss how entries within the table are organised, and to mention how instructions can be split into multiple groups if needed, but that the table is still searched in table order. There should be no user visible changes after this commit. gas/ChangeLog: * config/tc-arc.c (struct arc_opcode_hash_entry_iterator): New structure. (arc_opcode_hash_entry_iterator_init): New function. (arc_opcode_hash_entry_iterator_next): New function. (find_opcode_match): Iterate over all arc_opcode entries referenced by the arc_opcode_hash_entry passed in as a parameter. opcodes/ChangeLog: * arc-opc.c (arc_opcodes): Extend comment to discus table layout.
2016-04-07gas/arc: Additional work to support multiple arc_opcode chainsAndrew Burgess2-35/+46
Building on earlier commits, this commit moves along support for having multiple arc_opcode entries in the arc_opcodes table that have the same mnemonic (name) field, but are not stored in a contiguous block in the table. In this commit we support looking up the arc_opcode_hash_entry from the hash table, and passing this along to the find_opcode_match function, which then finds the specific arc_opcode that we're assembling. We still don't actually support the multiple chains of arc_opcode entries in this commit, but the limitation is now isolated to the find_opcode_match function. There is no user visible change after this commit. gas/ChangeLog: * config/tc-arc.c (arc_find_opcode): Now returns arc_opcode_hash_entry pointer. (find_opcode_match): Update argument type, extract arc_opcode from incoming arc_opcode_hash_entry. (find_special_case_pseudo): Update return type. (find_special_case_flag): Update return type. (find_special_case): Update return type. (assemble_tokens): Lookup arc_opcode_hash_entry based on instruction mnemonic, then use find_opcode_match to identify specific arc_opcode.
2016-04-07gas/arc: Modify structure used to hold opcodesAndrew Burgess2-10/+65
The arc assembler builds a hash table to hold references to arc_opcode entries in the arc_opcodes table. This hash assumes that each mnemonic will always appear in a contiguous blocks within the arc_opcodes table; all ADD instruction will be together, all AND instructions will likewise be together and so on. The problem with this is that as different variations of arc are added, then it is often more convenient to split instructions apart, so all the base ADD instructions are together, but, variants of ADD specific to one variation of arc are grouped with other instructions specific to that arc variant. The current data structures don't support splitting the instructions in this way. This commit is a first step towards addressing this limitation. In this commit the hash table that currently holds arc_opcode pointers directly, instead holds a pointer to a new, intermediate, data structure. This new data structure holds the pointer to the arc_opcode. In this way, we can, in the future support having the intermediate structure hold multiple pointers to different arc_opcode groups. There should be no visible functional change after this commit. gas/ChangeLog: * config/tc-arc.c (struct arc_opcode_hash_entry): New structure. (arc_find_opcode): New function. (find_special_case_pseudo): Use arc_find_opcode. (find_special_case_flag): Likewise. (assemble_tokens): Likewise. (md_begin): Build hash using struct arc_opcode_hash_entry.
2016-04-07Fix gdb.reverse/finish-reverse-bkpt.expYao Qi2-2/+12
I see the following fail on aarch64-linux break void_func Breakpoint 2 at 0x4007a0: file gdb/testsuite/gdb.reverse/finish-reverse.c, line 44. (gdb) PASS: gdb.reverse/finish-reverse-bkpt.exp: set breakpoint on void_func continue Continuing. Breakpoint 2, void_func () at gdb/testsuite/gdb.reverse/finish-reverse.c:44^M 44 void_test = 1; /* VOID FUNC */^M (gdb) PASS: gdb.reverse/finish-reverse-bkpt.exp: continue to breakpoint: void_func break *void_func^M Note: breakpoint 2 also set at pc 0x4007a0.^M Breakpoint 3 at 0x4007a0: file gdb/testsuite/gdb.reverse/finish-reverse.c, line 44. (gdb) PASS: gdb.reverse/finish-reverse-bkpt.exp: set breakpoint at void_func's entry reverse-finish^M Run back to call of #0 void_func () at gdb/testsuite/gdb.reverse/finish-reverse.c:44 main (argc=1, argv=0x7ffffffb78) at gdb/testsuite/gdb.reverse/finish-reverse.c:98 98 void_func (); /* call to void_func */^M (gdb) FAIL: gdb.reverse/finish-reverse-bkpt.exp: reverse-finish from void_func trips breakpoint at entry The test assumes that brekapoints on "void_func" and "*void_func" are set on different places because of function prologue. However, on aarch64-linux, there is no prologue in void_func, so two breakpoints are set at the same place (0x4007a0). (gdb) disassemble void_func Dump of assembler code for function void_func: 0x00000000004007a0 <+0>: adrp x0, 0x410000 0x00000000004007a4 <+4>: add x0, x0, #0xc14 0x00000000004007a8 <+8>: mov w1, #0x1 0x00000000004007ac <+12>: str w1, [x0] 0x00000000004007b0 <+16>: ret The fix to this problem is to single step forward before setting breakpoint on *void_func. gdb/testsuite: 2016-04-07 Yao Qi <yao.qi@linaro.org> * gdb.reverse/finish-reverse-bkpt.exp: Use temporary breakpoint. Execute "si" command.
2016-04-07Fix gdb.reverse/next-reverse-bkpt-over-sr.expYao Qi2-1/+7
I see the fail on aarch64-linux, (gdb) reverse-next Breakpoint 2, callee () at /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.reverse/step-reverse.c:26^M 26 myglob++; return 0; /* ARRIVED IN CALLEE */ (gdb) FAIL: gdb.reverse/next-reverse-bkpt-over-sr.exp: reverse-next over call trips user breakpoint at function entry The test expects program stops at line 25, but program stops at line 26. (gdb) maintenance info line-table objfile: /scratch/yao/gdb/build-git/aarch64-linux-gnu/gdb/testsuite/outputs/gdb.reverse/next-reverse-bkpt-over-sr/next-reverse-bkpt-over-sr ((struct objfile *) 0x613000002880) compunit_symtab: ((struct compunit_symtab *) 0x621000121760) symtab: /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.reverse/step-reverse.c ((struct symtab *) 0x6210001217e0) linetable: ((struct linetable *) 0x6210001520d0): INDEX LINE ADDRESS 0 25 0x0000000000400890 1 26 0x0000000000400890 2 27 0x00000000004008b0 (gdb) disassemble callee Dump of assembler code for function callee: 0x0000000000400890 <+0>: adrp x0, 0x410000 0x0000000000400894 <+4>: add x0, x0, #0xcac the line-table show that the first instruction of function callee is mapped line 25 and 26. I am not sure the line-table is correct, but it is not the point of this test. The goal of this test is to test program hits the breakpoint on the first instruction of function after 'reverse-next', so I change this test to expect the breakpoint number the program hits. gdb/testsuite: 2016-04-07 Yao Qi <yao.qi@linaro.org> * gdb.reverse/next-reverse-bkpt-over-sr.exp: Match the breakpoint number instead of the comments on some line.
2016-04-07Make breakpoint handling in record-full idempotentYao Qi2-0/+23
Some test fails in gdb.reverse/break-reverse.exp on arm-linux lead me seeing the following error message, continue^M Continuing.^M Cannot remove breakpoints because program is no longer writable.^M ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Further execution is probably impossible.^M ^M Breakpoint 3, bar () at /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.reverse/break-reverse.c:22^M 22 xyz = 2; /* break in bar */^M (gdb) PASS: gdb.reverse/break-reverse.exp: continue to breakpoint: bar backward this is caused by two entries in record_full_breakpoints, and their addr is the same, but in_target_beneath is different. during the record, we do continue, Continuing. infrun: clear_proceed_status_thread (Thread 13772.13772) infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT) infrun: step-over queue now empty infrun: resuming [Thread 13772.13772] for step-over infrun: skipping breakpoint: stepping past insn at: 0x8620 Sending packet: $Z0,85f4,4#1d...Packet received: OK <---- ..... Sending packet: $vCont;c#a8...infrun: target_wait (-1.0.0, status) = infrun: -1.0.0 [process -1], infrun: status->kind = ignore infrun: TARGET_WAITKIND_IGNORE infrun: prepare_to_wait infrun: target_wait (-1.0.0, status) = infrun: -1.0.0 [process -1], infrun: status->kind = ignore infrun: TARGET_WAITKIND_IGNORE infrun: prepare_to_wait Packet received: T05swbreak:;0b:9cf5ffbe;0d:9cf5ffbe;0f:f4850000;thread:p35cc.35cc;core:1; Sending packet: $Z0,85f4,4#1d...Packet received: OK <----- .... Sending packet: $z0,85f4,4#3d...Packet received: OK <----- we can see breakpoint on 0x85f4 are inserted *twice*, but only removed once. That is fine to remote target, because Z/z packets are idempotent, but there is a leftover in record_full_breakpoints in record-full target. The flow can be described as below, record_full_breakpoints remote target ----------------------------------------------------------------------- forward execution, continue, in_target_beneath 1 breakpoint inserted insert breakpoints on 0x85f4 in_target_beneath 1 twice program stops, remove breakpoint on 0x85f4 in_target_beneath 1 breakpoint removed reverse execution, continue, in_target_beneath 1 none is requested insert breakpoints on 0x85f4, in_target_beneath 0 program stops, remote breakpoint on 0x85f4, in_target_beneath 0 request to remove, but GDBserver doesn't know now, the question is why breakoint on 0x85f4 is inserted twice? One is the normal breakpoint, and the other is the single step breakpoint. GDB inserts single step breakpoint to do single step. When program stops at 0x85f4, both of them are set on 0x85f4, and GDB deletes single step breakpoint, so in update_global_location_list, this breakpoint location is no longer found, GDB call force_breakpoint_reinsertion to mark it condition_updated, and insert it again. The reason force_breakpoint_reinsertion is called to update the conditions in the target side, because the conditions may be changed. My original fix is to not call force_breakpoint_reinsertion if OLD_LOC->cond is NULL, but it is not correct if another location on the same address has condition, GDB doesn't produce condition for target side, but GDB should do. Then, I change my mind back to make record-full handling breakpoint idempotent, to align with remote target. Before insert a new entry into record_full_breakpoints, look for existing one on the same address first. I also add an assert on "bp->in_target_beneath == in_target_beneath", to be safer. gdb: 2016-04-07 Yao Qi <yao.qi@linaro.org> * record-full.c (record_full_insert_breakpoint): Return early if entry on the address is found in record_full_breakpoints.
2016-04-07Set bp_tgt->reqstd_address and bp_tgt->placed_size in ↵Yao Qi2-0/+15
record_full_insert_breakpoint I notice that bp_tgt won't be fully initialized if to_insert_breakpoint isn't called in record_full_insert_breakpoint, and bp_tgt->reqstd_address is zero, so an entry is added to record_full_breakpoints, but its address is zero, which is wrong. This patch is to call gdbarch_breakpoint_from_pc in the else branch to set bp_tgt->reqstd_address and bp_tgt->placed_size. gdb: 2016-04-07 Yao Qi <yao.qi@linaro.org> * record-full.c (record_full_insert_breakpoint): Set bp_tgt->reqstd_address and bp_tgt->placed_size.
2016-04-07ld/arc: Make little endian default choice for linker scriptsAndrew Burgess2-3/+8
When building with --enable-targets=all the target string is not set to something that matches the pattern arc*-*, and so the script used to decide if we should build big or little endian linker script currently exits with an error. This commit makes little endian linker script be the default, which will be used when building for all targets, this matches the behaviour from before I made the endianness switchable, when we only ever built little endian linker scripts anyway. ld/ChangeLog: * emulparams/arc-endianness.sh: Make little endian default choice.
2016-04-07Fix gas/ChangeLogAlan Modra1-42/+41
2016-04-07[ARC] Prepare strings for automatic translation.Claudiu Zissulescu2-5/+12
gas/ 2016-04-07 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (arc_option): Prepare string for automatic translation. (declare_register): Likewise.
2016-04-07Update AArch64 documentation regarding architecture extensions.James Greenhalgh2-8/+15
* doc/c-aarch64.texi (Architecture Extensions): Add entry for LSE. Correct entry for RDMA. Alpha sort entries.
2016-04-07gas/arc: Allow greater range of characters into flag namesAndrew Burgess2-1/+7
An upcoming commit will add a new arc instruction flag that uses characters that have never appeared in an arc instruction flag before. Currently the assembler is very conservative about which characters can or cannot appear in an instruction flag. This commit relaxes these constraints a little. After this commit all alpha-numeric characters are now allowed into instruction flags. This complete set is not required for the upcoming change, however, having this slightly larger set does not impact the assemblers ability to correctly parse input, but does make it easier to add new flag to the instruction table. gas/ChangeLog: * config/tc-arc.c (tokenize_flags): Allow greater range of characters into flag names.
2016-04-07gas/arc: Remove preprocess_operands functionAndrew Burgess2-46/+40
The preprocess_operands function changes the incoming list of assembler tokens based on the assumption that the first arc_operand found will be the same instruction class as all of the arc_operands for the same mnemonic. Though this assumption is probably fine, removing this assumption, and pushing the token change down into assemble_tokens makes the code no more complex, and might even be easier to follow. There should be no user visible changes after this commit. gas/ChangeLog: * config/tc-arc.c (find_opcode_match): Handle O_symbol case, add new de_fault label. (preprocess_operands): Delete. (assemble_tokens): Remove call to preprocess_operands.
2016-04-07Allow integer contants to have a U suffix. Improve error reporting for ↵Nick Clifton9-3/+67
missing closing parentheses. PR gas/19910 * config/tc-sparc.c (sparc_ip): Report an error if the expression inside a %-macro could not be fully parsed. * expr.c (integer_constant): Accept and ignore U suffixes to integers. (operand): When a missing closing parenthesis is encountered, report the character that was found instead. * testsuite/gas/mips/tls-ill.l: Update expected error message. * testsuite/gas/sparc/pr19910-1.d: New test driver. * testsuite/gas/sparc/pr19910-1.s: New test. * testsuite/gas/sparc/pr19910-2.l: Expected error output. * testsuite/gas/sparc/pr19910-2.s: New test. * testsuite/gas/sparc/sparc.exp: Run the new tests.
2016-04-07Fix typo in name of MSP430 attribute section.Nick Clifton3-2/+8
2016-04-07Automatic date update in version.inGDB Administrator1-1/+1
2016-04-06Eliminate -var-create error for optzd ptr to structDon Breazeal2-2/+20
This patch eliminates an error thrown when accessing the value of a pointer to a structure where the pointer has been optimized out and 'set print object' is 'on'. The error shows up as the rather ugly value of the pointer variable in Eclipse. If 'set print object' is 'on', GDB tries to determine the actual (derived) type of the object rather than the declared type, which requires dereferencing the pointer, which in this cases throws an error because the pointer has been optimized out. The fix is to simply ignore the 'print object on' setting for pointers or references to structures when they have been optimized out. This means we just get the declared type instead of the actual type, because in this case that's the best that we can do. To implement the fix, value_optimized_out was modified so that it no longer throws an error when it fails to fetch the specified value. Instead, it just checks value->optimized_out. If we can't definitively say that the value is optimized out, then we assume it is not. gdb/ChangeLog: 2016-04-06 Don Breazeal <donb@codesourcery.com> * value.c (value_actual_type): Don't try to get rtti type of the value if it has been optimized out. (value_optimized_out): If a memory access error occurs, just check vaue->optimized_out.
2016-04-06Optimized-out pointer: New test for error handlingDon Breazeal3-0/+296
This patch implements a test that ensures that with "set print object on", -var-create returns "<optimized out>" for an optimized out pointer to structure, rather than throwing an error, while also ensuring that any attempt to dereference the pointer *will* throw an error. It uses the dwarf assembler to construct the appropriate debug info to represent a pointer-to-struct in the program as optimized out, and then accesses that pointer in various ways. The test uses both the console interpreter and the MI interpreter. gdb/testsuite/ChangeLog: 2016-04-06 Don Breazeal <donb@codesourcery.com> * gdb.dwarf2/dw2-opt-structptr.c: New test program. * gdb.dwarf2/dw2-opt-structptr.exp: New test script.
2016-04-06Fix gdb.threads/dlopen-libpthread.exp crashSimon Marchi2-2/+6
Following, commit 6e774b13c3b81ac2599812adf058796948ce7e95 Make ftrace tests work with remote targets the test gdb.threads/dlopen-libpthread.exp started to fail with: ERROR: error copying "/home/emaisin/build/binutils-gdb/gdb/testsuite/gdb.threads/dlopen-libpthread.so": no such file or directory This is because the library path is not computed using standard_output_file, so we try to gdb_load_shlibs an unexisting file. gdb/testsuite/ChangeLog: * gdb.threads/dlopen-libpthread.exp: Set binfile_lib using standard_output_file. Remove unused binfile variable.