aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-09-13Aarch64 SVE: Support changing vector lengths in gdbserverusers/ahayward/variable_sveAlan Hayward6-9/+97
There are two parts to this patch - gdbserver and GDB. In gdbserver, there needs to be an equivalent of the thread_architecture method used in GDB. In regcache, validate the tdesc with the use target_validate_tdesc target function. If this fails then re-obtain the target descriptor via general setup. The aarch64 validation step simply checks the value of the VG register to see if it matches the current kernel value. In GDB, we have a similar check when receiving a stop reply. Validate the tdesc using gdbarch_target_description_changed_p. If this fails re-obtain the target descriptor via general setup - which is done by setting up an tdep info structure containing the vector length. The aarch64 validation step checks the value of VG (which is marked as an expediated register, so is in the stop reply). 2018-08-03 Alan Hayward <alan.hayward@arm.com> gdb/ * aarch64-tdep.c (aarch64_target_description_changed_p): Check vector length. (aarch64_target_get_tdep_info): Store vector length. * remote.c (remote_target::process_stop_reply): Validate tdesc. * target-descriptions.c (target_find_description): Pass through info. * target-descriptions.h (target_find_description): Add arg. gdbserver/ * linux-aarch64-low.c (aarch64_validate_tdesc): Check vector length. * regcache.c (get_thread_regcache): Validate tdesc.
2018-09-13Add gdbserver target methods target_validate_tdesc and arch_setupAlan Hayward4-0/+42
target_validate_tdesc () is added as a new target function. This function checks current target description is still valid for the current inferior, returning false if not. On SVE, we need to check if the vector length has changed - if it has then the current target descriptor will need to be switched to a valid one. The existing arch_setup () is extended to be a target function. This will later allow it to be called from get_thread_regcache () in gdbserver/regcache.c. This call is required to generate a new target descriptor if we have decided the current one is no longer valid. 2018-09-13 Alan Hayward <alan.hayward@arm.com> gdbserver/ * linux-aarch64-low.c (int aarch64_validate_tdesc): New function. (struct linux_target_ops): Add aarch64_validate_tdesc. * linux-low.c (linux_validate_tdesc): New function. (linux_target_ops): Add linux_arch_setup and linux_validate_tdesc. * linux-low.h (linux_target_ops): Add validate_tdesc. * target.h (struct target_ops): Likewise. (target_arch_setup) New macro. (target_validate_tdesc) New macro.
2018-09-13Add target_description_changed_p and target_get_tdep_info methodsAlan Hayward8-2/+124
target_description_changed_p () is added as a new gdbarch function. Given a list of register values received from the inferior, it will check if the current target descriptor is no longer valid for the inferior. This is required because on SVE the register sizes can change whilst the inferior is running. target_get_tdep_info () is added as a new gdbarch function. Given a list of registers, it will return a tdep info which then can be used when creating/finding a valid target descriptor for that inferior. Include stubbed aarch64 versions. 2018-09-13 Alan Hayward <alan.hayward@arm.com> gdb/ * aarch64-tdep.c (aarch64_target_description_changed_p): New function. (aarch64_target_get_tdep_info): New function. (aarch64_gdbarch_init): Add in the new functions * arch-utils.c (default_target_description_changed_p): New function. (default_target_get_tdep_info): New function. * arch-utils.h: (default_target_description_changed_p): New declaration. (default_target_get_tdep_info): New declaration. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh: (target_description_changed_p): New function. (target_get_tdep_info): New function.
2018-09-13Name and seperate the union in gdbarch_infoAlan Hayward18-54/+62
Add gdbarch_target_info as a new union. This will allow it to be used directly as a parameter to functions in later patches. 2018-09-13 Alan Hayward <alan.hayward@arm.com> * aarch64-linux-nat.c (aarch64_linux_nat_target::thread_architecture): Use target_info. * aarch64-tdep.c (aarch64_gdbarch_init): Likewise. * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise. (amd64_x32_linux_init_abi): Likewise. * amd64-tdep.c (amd64_init_abi): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * gdbarch.sh (gdbarch_target_info): Add union (gdbarch_info): Use gdbarch_target_info. * i386-linux-tdep.c (i386_linux_init_abi): Use target_info. * i386-tdep.c (i386_gdbarch_init): Likewise. * mips-linux-tdep.c (mips_linux_init_abi): Likewise. * mips-tdep.c (mips_gdbarch_init): Likewise. * nds32-tdep.c (nds32_gdbarch_init): Likewise. * ppc-linux-tdep.c (ppu2spu_sniffer): Likewise. (ppc_linux_init_abi): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * s390-tdep.c (s390_gdbarch_init): Likewise. * sparc-tdep.c (sparc32_gdbarch_init): Likewise. * spu-multiarch.c (spu_gdbarch): Likewise. * spu-tdep.c (spu_gdbarch_init): Likewise.
2018-09-13Aarch64 SVE: Support changing vector lengths in GDBAlan Hayward2-14/+45
Override the thread_architecture method to place the vector length in the tdep_info and then find using info. Do not set this as a pointer as this will cause issues in later patches. 2018-09-13 Alan Hayward <alan.hayward@arm.com> gdb/ * aarch64-linux-nat.c (aarch64_linux_nat_target::thread_architecture): Add override. * aarch64-tdep.c (aarch64_get_tdesc_vq): Check for nullptr. (aarch64_gdbarch_init): Ensure differemt tdesc for each VQ.
2018-09-13Aarch64 SVE: Support changing vector lengths for ptraceAlan Hayward3-56/+108
When writing registers to the kernel, check if regcache VG has been changed. If so then update the thread's vector length. If required, resize the registers in the kernel dump before writing it back. When reading registers from the kernel, ensure regcache VG register is updated. The regcache registers should already be of the correct length. 2018-09-13 Alan Hayward <alan.hayward@arm.com> gdb/ * aarch64-linux-nat.c (fetch_sveregs_from_thread): Pass regcache. (store_sveregs_to_thread): Likewise. * nat/aarch64-sve-linux-ptrace.c (aarch64_sve_get_sveregs): Check vector length. (aarch64_sve_regs_copy_to_reg_buf): Likewise. (aarch64_sve_regs_copy_from_reg_buf): Likewise. * nat/aarch64-sve-linux-ptrace.h (aarch64_sve_get_sveregs): Add reg_buf arg.
2018-09-13Fix a use-after-freed error introduced by previous attempt to fix a Coverity ↵Nick Clifton2-1/+8
scan result. PR 23633 * objcopy.c (add_specific_symbols): Do not free the buffer at the end of the function.
2018-09-13x86: Remove VexW=1 from WIG VEX movq and vmovqH.J. Lu2-8/+8
Put back changes lost in commit 41d1ab6a6d96937fd0db04e53746f93f53687807.
2018-09-13i386: Update VexW field for VEX instructionsH.J. Lu3-36/+44
1. Mark VEX.W0 VEX instructions with VexW=1. 2. Mark VEX.W1 VEX instructions with VexW=2. 3. Remove VexW=1 from WIG VEX instructions. * i386-opc.tbl: Add VexW=1 to VEX.W0 VEX movd, cvtsi2ss, cvtsi2sd, pextrd, pinsrd, vcvtsi2sd, vcvtsi2ss, vmovd, vpextrd and vpinsrd. Add VexW=2 to VEX.W1 VEX movd, movq, pextrq, pinsrq, vmod, vmovq, vpextrq and vpinsrq. Remove VexW=1 from WIG VEX movq and vmovq. * i386-tbl.h: Regenerated.
2018-09-13x86: Swap destination/source to encode VEX only if possibleH.J. Lu2-3/+9
When encoding VEX, we can swap destination and source only if there are more than 1 register operand. * config/tc-i386.c (build_vex_prefix): Swap destination and source only if there are more than 1 register operand.
2018-09-13x86: drop bogus IgnoreSize from a few further insnsJan Beulich3-52/+61
2018-09-13x86: drop bogus IgnoreSize from AVX512_4* insnsJan Beulich3-12/+18
2018-09-13x86: drop bogus IgnoreSize from AVX512DQ insnsJan Beulich3-96/+102
2018-09-13x86: drop bogus IgnoreSize from AVX512BW insnsJan Beulich3-78/+84
2018-09-13x86: drop bogus IgnoreSize from AVX512VL insnsJan Beulich3-26/+32
2018-09-13x86: drop bogus IgnoreSize from AVX512ER insnsJan Beulich3-32/+38
2018-09-13x86: drop bogus IgnoreSize from AVX512F insnsJan Beulich3-742/+748
2018-09-13x86: drop bogus IgnoreSize from SHA insnsJan Beulich3-16/+21
2018-09-13x86: drop bogus IgnoreSize from XOP and SSE4a insnsJan Beulich3-266/+271
2018-09-13x86: drop bogus IgnoreSize from AVX2 insnsJan Beulich3-238/+244
2018-09-13x86: drop bogus IgnoreSize from AVX insnsJan Beulich3-256/+262
2018-09-13x86: drop bogus IgnoreSize from GNFI insnsJan Beulich3-12/+17
2018-09-13x86: drop bogus IgnoreSize from PCLMUL/VPCLMUL insnsJan Beulich3-32/+37
2018-09-13x86: drop bogus IgnoreSize from AES/VAES insnsJan Beulich3-44/+49
2018-09-13x86: drop bogus IgnoreSize from SSE4.2 insnsJan Beulich3-20/+26
2018-09-13x86: drop bogus IgnoreSize from SSE4.1 insnsJan Beulich3-126/+132
2018-09-13x86: drop bogus IgnoreSize from SSSE3 insnsJan Beulich3-64/+70
2018-09-13x86: drop bogus IgnoreSize from SSE3 insnsJan Beulich3-36/+41
2018-09-13x86: drop bogus IgnoreSize from SSE2 insnsJan Beulich3-416/+421
2018-09-13x86: drop bogus IgnoreSize from SSE insnsJan Beulich3-118/+123
2018-09-13x86: drop unnecessary {,No}Rex64Jan Beulich3-10/+16
2018-09-13x86: also allow D on 3-operand insnsJan Beulich5-115/+47
For now this is just for VMOVS{D,S}.
2018-09-13x86: use D attribute also for SIMD templatesJan Beulich10-1286/+291
Various moves come in load and store forms, and just like on the GPR and FPU sides there would better be only one pattern. In some cases this is not feasible because the opcodes are too different, but quite a few cases follow a similar standard scheme. Introduce Opcode_SIMD_FloatD and Opcode_SIMD_IntD, generalize handling in operand_size_match() (reverse operand handling there simply needs to match "straight" operand one), and fix a long standing, but so far only latent bug with when to zap found_reverse_match. Also once again drop IgnoreSize where pointlessly applied to templates touched anyway as well as *word when redundant with Reg*.
2018-09-13x86: fold ILP32 output of "opts" testsJan Beulich5-1296/+12
The output is identical to that of the LP64 tests. No need to fully spell this out twice.
2018-09-13x86: improve operand reversalJan Beulich6-11/+970
In quite a few cases the .s suffix or {load} / {store} prefixes did not work as intended, or produced errors when they're supposed to be ignored when it is not possible to carry out the request. The change here re-purposes(?) the .s suffix to no longer mean "store" (if that's what 's' did stand for), since the forms used in the base templates are not consistently loads (and we unlikely want to change that). The pseudo prefixes will now fulfill what their names say, i.e. {load} now only ever produces a load form encoding (if available) while {store} only ever produces a store form one (again if available). This requires minimal test suite adjustments, while the majority of the changes there are simply additions.
2018-09-13x86: add code comment on deprecated status of pseudo-suffixesJan Beulich2-1/+7
2018-09-13x86-64: bndmk, bndldx, and bndstx don't allow RIP-relative addressingJan Beulich5-3/+35
2018-09-13Fix the use by the RL78 assembler of an uninitialised field in the expresion ↵Nick Clifton2-0/+22
structure. * dwarf2dbg.c (generic_dwarf2_emit_offset): Use memset to initialise expression structure. (set_or_check_view): Likewise. (out_set_addr): Likewise. (emit_fixed_inc_line_addr): Likewise. (relax_inc_line_addr): Likewise. (out_debug_line): Likewise. (out_debug_ranges): Likewise. (out_debug_aranges): Likewise. (out_debug_info): Likewise.
2018-09-13Automatic date update in version.inGDB Administrator1-1/+1
2018-09-12Remove unused "tmp" variable.John Baldwin2-1/+4
gdb/ChangeLog: * fbsd-nat.c (fbsd_nat_target::info_proc): Remove unused variable.
2018-09-12Fix a typo in a comment.John Baldwin2-1/+6
gdb/ChangeLog: * aarch64-fbsd-tdep.h (AARCH64_FBSD_SIZEOF_GREGSET): Fix comment typo.
2018-09-12python: Add tests for trying to use an invalid Inferior objectSimon Marchi2-0/+18
This patch adds tests for trying to use property or methods on a gdb.Inferior object that represents an inferior that does not exist anymore. We expect an exception to be thrown. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Test using an invalid gdb.Inferior object.
2018-09-12Move 'is_regular_file' from common-utils.c to filestuff.cSergio Durigan Junior5-37/+44
There is no reason for 'is_regular_file' to be in common-utils.c; it belongs to 'filestuff.c'. This commit moves the function definition and its prototype to the appropriate files. The motivation behind this move is a failure that happens on certain cross-compilation environments when compiling the IPA library, due to the way gnulib probes the need for a 'stat' call replacement. Because configure checks when cross-compiling are more limited, gnulib decides that it needs to substitute the 'stat' calls its own 'rpl_stat'; however, the IPA library doesn't link with gnulib, which leads to an error when compiling 'common-utils.c': ... /opt/x86-core2--musl--bleeding-edge-2018.09-1/bin/i686-buildroot-linux-musl-g++ -shared -fPIC -Wl,--soname=libinproctrace.so -Wl,--no-undefined -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -I. -I. -I./../common -I./../regformats -I./.. -I./../../include -I./../gnulib/import -Ibuild-gnulib-gdbserver/import -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized -DGDBSERVER \ -Wl,--dynamic-list=./proc-service.list -o libinproctrace.so ax-ipa.o common-utils-ipa.o errors-ipa.o format-ipa.o print-utils-ipa.o regcache-ipa.o remote-utils-ipa.o rsp-low-ipa.o tdesc-ipa.o tracepoint-ipa.o utils-ipa.o vec-ipa.o linux-i386-ipa.o linux-x86-tdesc-ipa.o arch/i386-ipa.o -ldl -pthread /opt/x86-core2--musl--bleeding-edge-2018.09-1/lib/gcc/i686-buildroot-linux-musl/8.2.0/../../../../i686-buildroot-linux-musl/bin/ld: common-utils-ipa.o: in function `is_regular_file(char const*, int*)': common-utils.c:(.text+0x695): undefined reference to `rpl_stat' collect2: error: ld returned 1 exit status Makefile:413: recipe for target 'libinproctrace.so' failed make[1]: *** [libinproctrace.so] Error 1 ... More details can also be found at: https://sourceware.org/ml/gdb-patches/2018-09/msg00304.html The most simple fix for this problem is to move 'is_regular_file' to 'filestuff.c', which is not used by IPA. This ends up making the files more logically organized as well, since 'is_regular_file' is a file operation. No regressions found. gdb/ChangeLog: 2018-09-12 Sergio Durigan Junior <sergiodj@redhat.com> * common/common-utils.c: Don't include '<sys/stat.h>'. (is_regular_file): Move to... * common/filestuff.c (is_regular_file): ... here. * common/common-utils.h (is_regular_file): Move to... * common/filestuff.h (is_regular_file): ... here.
2018-09-12Add debug output about skipping files and functionsSimon Marchi5-25/+103
While trying to create skips for libstdc++, I found myself debugging GDB quite a bit, mostly to find out what the exact function name to match is. I thought it would make sense to have this information as debug output. This patch adds "set debug skip on|off". gdb/ChangeLog: * skip.c (debug_skip): New variable. (skiplist_entry::do_skip_file_p): Add debug output. (skiplist_entry::do_skip_gfile_p): Likewise. (skiplist_entry::skip_function_p): Likewise. (_initialize_step_skip): Create debug command. * NEWS: Mention set/show debug skip. gdb/doc/ChangeLog: * gdb.texinfo (Skipping Over Functions and Files): Document set/show debug skip.
2018-09-12Testsuite: Add gdb_can_simple_compileAlan Hayward2-132/+64
Simplfy gdb.exp by adding a function that will attempt to compile a piece of code, then clean up. gdb/testsuite * lib/gdb.exp (gdb_can_simple_compile): Add proc. (support_complex_tests): Use gdb_can_simple_compile. (is_ilp32_target): Likewise. (is_lp64_target): Likewise. (is_64_target): Likewise. (is_amd64_regs_target): Likewise. (is_aarch32_target): Likewise. (gdb_int128_helper): Likewise.
2018-09-12Automatic date update in version.inGDB Administrator1-1/+1
2018-09-11Darwin: set startup-with-shell to off on Sierra and later.Xavier Roirand2-0/+34
On Mac OS X Sierra and later, the shell is not allowed to be debug so add a check and disable startup with shell in that case. This disabling is done temporary before forking inferior and restored after the fork. gdb/ChangeLog: * darwin-nat.c (should_disable_startup_with_shell): New function. (darwin_nat_target::create_inferior): Add call. Change-Id: Ie4d9090f65fdf2e83ecf7a0f9d0647fb1c27cdcc
2018-09-11Darwin: fix SIGTRAP when debuggingXavier Roirand2-6/+14
Debugging a program under Darwin does not work: (gdb) start Temporary breakpoint 1 at 0x100000fb4: file /tmp/helloworld.c, line 1. Starting program: /private/tmp/helloworld [New Thread 0x2903 of process 60326] During startup program terminated with signal SIGTRAP, Trace/breakpoint trap. Field signaled from darwin_thread_info is not initialized thus signal sent to the debuggee is considered as not sent by GDB whereas it should. This patch fixes this problem and also updates (change type and/or initialize) other fields in the same structure at the same time. gdb/ChangeLog: * darwin-nat.h (struct darwin_thread_info) <gdb_port, inf_port, msg_state>: Initialize. (struct darwin_thread_info) <signaled, single_step>: Change type and initialize. (struct darwin_thread_info) <event>: Initialize. Change-Id: I0fe2a6985df9d0dfcc8a2a258a3ef70cfa19b403
2018-09-11[testsuite] Fix dg-extract-results.sh pathJan Kratochvil2-1/+5
There was a typo in patch: commit 5a6996172e6294ea37054b1a9caa3a923a8fe399 Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Date: Mon Aug 6 16:05:16 2018 +0200 Update dg-extract-results.* from gcc gdb/testsuite/ChangeLog 2018-09-11 Jan Kratochvil <jan.kratochvil@redhat.com> * Makefile.in (check-parallel-racy): Fix dg-extract-results.sh path.
2018-09-11Automatic date update in version.inGDB Administrator1-1/+1