aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-09-13Make infpy_thread_from_thread_handle staticTom Tromey2-1/+6
I noticed that infpy_thread_from_thread_handle is not static, but should be. This patch changes it. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> * python/py-inferior.c (infpy_thread_from_thread_handle): Now static.
2018-09-13Remove cleanup from try_open_exec_fileTom Tromey2-6/+9
This removes a cleanup from try_open_exec_file, using std::string to manage the storage instead. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> * exec.c (try_open_exec_file): Use std::string.
2018-09-13Return std::string from gdb_bfd_errmsgTom Tromey5-23/+18
This changes gdb_bfd_errmsg to return a std::string, removing a cleanup. This approach may be slightly less efficient than the previous code, but I don't believe this is very important in this situation. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> * utils.h (gdb_bfd_errmsg): Return std::string. * exec.c (exec_file_attach): Update. * compile/compile-object-load.c (compile_object_load): Update. * utils.c (gdb_bfd_errmsg): Return std::string.
2018-09-13Remove cleanup from procfs.cTom Tromey2-10/+19
This removes the last remaining cleanup from procfs.c, replacing it with a unique_ptr specialization. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> * procfs.c (struct procinfo_deleter): New. (procinfo_up): New typedef. (do_destroy_procinfo_cleanup): Remove. (procfs_target::info_proc): Use procinfo_up. Remove cleanups.
2018-09-13Remove cleanup from add_pathTom Tromey2-9/+11
This removes a cleanup from add_path, replacing it with a use of gdb::unique_xmalloc_ptr. Note that this declaration had to be hoisted somewhat, to avoid inteference from the "goto"s in this function. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> * source.c (add_path): Use gdb::unique_xmalloc_ptr.
2018-09-13python: Fix erroneous doc about gdb.objfiles()Simon Marchi2-4/+8
The code implementing gdb.objfiles() returns a list of objfiles for the current program space (the program space of the selected inferior). The documentation for the gdb.objfiles() Python method, however, states: Return a sequence of all the objfiles current known to GDB. That sounds wrong to me. I tried to phrase to be more precise. gdb/doc/ChangeLog: * python.texi (Objfiles In Python): Update gdb.objfiles() doc.
2018-09-13python: Add Progspace.objfiles methodSimon Marchi9-14/+122
This patch adds an objfiles method to the Progspace object, which returns a sequence of the objfiles associated to that program space. I chose a method rather than a property for symmetry with gdb.objfiles(). gdb/ChangeLog: * python/py-progspace.c (PSPY_REQUIRE_VALID): New macro. (pspy_get_objfiles): New function. (progspace_object_methods): New. (pspace_object_type): Add tp_methods callback. * python/python-internal.h (build_objfiles_list): New declaration. * python/python.c (build_objfiles_list): New function. (gdbpy_objfiles): Implement using build_objfiles_list. * NEWS: Mention the Progspace.objfiles method. gdb/doc/ChangeLog: * python.texi (Program Spaces In Python): Document the Progspace.objfiles method. (Objfiles In Python): Mention that gdb.objfiles() is identical to gdb.selected_inferior().progspace.objfiles(). gdb/testsuite/ChangeLog: * gdb.python/py-progspace.exp: Test the Progspace.objfiles method.
2018-09-13python: Add Inferior.progspace propertySimon Marchi7-1/+56
This patch adds a progspace property to the gdb.Inferior type, which allows getting the gdb.Progspace object associated to that inferior. In conjunction with the following patch, this will allow scripts iterate on objfiles associated with a particular inferior. gdb/ChangeLog: * python/py-inferior.c (infpy_get_progspace): New function. (inferior_object_getset): Add progspace property. * NEWS: Mention the new property. gdb/doc/ChangeLog: * python.texi (Inferiors In Python): Document Inferior.progspace. (Program Spaces In Python): Document that gdb.current_progspace() is the same as gdb.selected_inferior().progspace. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Add tests for Inferior.progspace and a few other Inferior properties when the Inferior is no longer valid.
2018-09-13Make Rust error message mention the field nameTom Tromey4-2/+14
I noticed a spot in rust-lang.c where the placeholder "foo" was used instead of the actual field name. This patch fixes the bug. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> PR rust/23650: * rust-lang.c (rust_evaluate_subexp): Use field name, not "foo". gdb/testsuite/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> PR rust/23650: * gdb.rust/simple.exp: Add test for enum field access error.
2018-09-13Fix crash with empty Rust enumTom Tromey5-1/+72
While testing my Rust compiler patch to fix the DWARF representation of Rust enums (https://github.com/rust-lang/rust/pull/54004), I found a gdb crash coming from one of the Rust test cases. The bug here is that the new variant support in gdb does not handle the case where there are no variants in the enum. This patch fixes the problem in a straightforward way. Note that the new tests are somewhat lax because I did not want to try to fully fix this corner case for older compilers. If you think that's unacceptable, let meknow. Tested on x86-64 Fedora 28 using several versions of the Rust compiler. I intend to push this to the 8.2 branch as well. gdb/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> PR rust/23626: * rust-lang.c (rust_enum_variant): Now static. (rust_empty_enum_p): New function. (rust_print_enum, rust_evaluate_subexp, rust_print_struct_def): Handle empty enum. gdb/testsuite/ChangeLog 2018-09-13 Tom Tromey <tom@tromey.com> PR rust/23626: * gdb.rust/simple.rs (EmptyEnum): New type. (main): Use it. * gdb.rust/simple.exp (test_one_slice): Add empty enum test.
2018-09-13Add "contrib" to the list of GDB support dirs (on src-release.sh)Sergio Durigan Junior2-1/+5
On commit: 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 dg-extract-results.sh was moved from the "gdb/contrib/" directory to the toplevel "contrib/" directory. However, src-release.sh was not updated in order to include "contrib/" in the tarball release of GDB. This makes it very inconvenient to run and analyze the GDB testsuite results. This commit adds "contrib/" to the list of support directories that are included in each GDB release. ChangeLog: 2018-09-12 Sergio Durigan Junior <sergiodj@redhat.com> * src-release.sh (GDB_SUPPORT_DIRS): Add "contrib".
2018-09-13Add a testcase for PR binutils/23633H.J. Lu5-0/+2439
PR binutils/23633 * testsuite/binutils-all/objcopy.exp: Run pr23633. * testsuite/binutils-all/pr23633.d: New file. * testsuite/binutils-all/pr23633.list: Likewise. * testsuite/binutils-all/pr23633.s: Likewise.
2018-09-13python: Provide textual representation for Inferior and ObjfileSimon Marchi9-4/+81
Printing a GDB Python object is notoriously not helpful: >>> print(gdb.selected_inferior()) <gdb.Inferior object at 0x7fea59aed198> >>> print(gdb.objfiles()) [<gdb.Objfile object at 0x7fea59b57c90>] This makes printing debug traces more difficult than it should be. This patch provides some repr() implementation for these two types (more to come if people agree with the idea, but I want to test the water first). Here's the same example as above, but with this patch: >>> print(gdb.selected_inferior()) <gdb.Inferior num=1> >>> print(gdb.objfiles()) [<gdb.Objfile filename=/home/emaisin/build/binutils-gdb-gcc-git/gdb/test>] I implemented repr rather than str, because when printing a list (or another container I suppose), Python calls the repr method of the elements. This is useful when printing a list of inferiors or objfiles. The print(gdb.objfiles()) above would not have worked if I had implemented str. I found this post useful to understand the difference between repr and str: https://stackoverflow.com/questions/1436703/difference-between-str-and-repr gdb/ChangeLog: * python/py-inferior.c (infpy_repr): New. (inferior_object_type): Register infpy_repr. * python/py-objfile.c (objfpy_repr): New. (objfile_object_type): Register objfpy_repr. gdb/testsuite/ChangeLog: * gdb.python/py-inferior.exp: Test repr() of gdb.Inferior. * gdb.python/py-objfile.exp: Test repr() of gdb.Objfile. * gdb.python/py-symtab.exp: Update test printing an objfile. gdb/doc/ChangeLog: * python.texi (Basic Python): Mention the string representation of GDB Python objects.
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.