summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Automatic date update in version.inGDB Administrator2019-08-311-1/+1
|
* RISC-V: Force linker error exit after unresolvable reloc.Jim Wilson2019-08-302-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was noticed while trying to test the compiler -msave-restore support. Putting non-pic code in a shared library gives a linker error, but doesn't stop the build. rohan:2030$ cat libtmp.c extern int sub2 (int); int sub (int i) { return sub2 (i + 10); } rohan:2031$ cat libtmp2.c extern int sub (int); int sub2 (int i) { return sub (i + 10); } rohan:2032$ riscv64-unknown-linux-gnu-gcc --shared -o libtmp.so libtmp.c rohan:2033$ riscv64-unknown-linux-gnu-gcc --shared -o libtmp2.so libtmp2.c libtmp.so /home/jimw/FOSS/install-riscv64/lib/gcc/riscv64-unknown-linux-gnu/8.3.0/../../../../riscv64-unknown-linux-gnu/bin/ld: /tmp/cctrsIBe.o(.text+0x18): unresolvable R_RISCV_CALL relocation against symbol `sub' rohan:2034$ echo $? 0 rohan:2035$ ls -lt libtmp2.so -rwxr-xr-x 1 jimw jimw 6912 Aug 30 14:32 libtmp2.so rohan:2036$ The patch fixes this by forcing a linker error. I now get this. ohan:2059$ sh tmp.script /home/jimw/FOSS/BINUTILS/X-riscv64-linux/ld/ld-new: libtmp2.o(.text+0x18): unresolvable R_RISCV_CALL relocation against symbol `sub' /home/jimw/FOSS/BINUTILS/X-riscv64-linux/ld/ld-new: final link failed: bad value rohan:2060$ echo $? 1 rohan:2061$ ls -lt libtmp2.so ls: cannot access 'libtmp2.so': No such file or directory bfd/ * elfnn-riscv.c (riscv_elf_relocate_section): For unresolvable reloc error, call bfd_set_error, set ret to FALSE, and goto out label.
* Remove "\nError: " suffix from nat/fork-inferior.c:trace_start_error warning ↵Sergio Durigan Junior2019-08-302-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | message Rationale: https://sourceware.org/ml/gdb-patches/2019-08/msg00651.html This very simple patch removes the "\nError: " suffix from the warning message printed by nat/fork-inferior.c:trace_start_error. This proved to just pollute the screen, causing things like: Starting program: /usr/bin/true warning: Could not trace the inferior process. Error: warning: ptrace: Permission denied This "Error: " string is not useful at all, and can confuse things, therefore let's just remove it and simplify the resulting messages: Starting program: /usr/bin/true warning: Could not trace the inferior process. warning: ptrace: Permission denied gdb/ChangeLog: 2019-08-30 Sergio Durigan Junior <sergiodj@redhat.com> * nat/fork-inferior.c (trace_start_error): Remove "\nError: " suffix from warning message.
* Remove tui_win_info::refresh_allTom Tromey2019-08-307-49/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TUI has two duplicate "re-render this window" methods, "rerender" and "refresh_all". They differ only slightly in semantics, so I wanted to see if they could be unified. After looking into this, I decided that refresh_all was not needed. There are 4 calls to tui_refresh_all_win (the only caller of this method): 1. tui_enable. This sets the layout, which renders the windows. 2. tui_cont_sig. Here, I think it's sufficient to simply redraw the current window contents from the curses backing store, because gdb state didn't change while it was suspended 3. tui_dispatch_ctrl_char. This is the C-l handler, and here it's explicitly enough to just refresh the screen (as above). 4. tui_refresh_all_command. This is the command equivalent of C-l. So, this patch removes this method entirely and simplifies tui_refresh_all_win. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <refresh_all>: Don't declare. * tui/tui-winsource.c (tui_source_window_base::refresh_all): Remove. * tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or tui_show_locator_content. * tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't declare. * tui/tui-regs.c (tui_data_window::refresh_all): Remove. * tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't declare.
* Don't call wrefresh from tui_cont_sigTom Tromey2019-08-302-2/+4
| | | | | | | | | | tui_cont_sig does not need to call wrefresh, because this is already done by tui_refresh_all_win. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-io.c (tui_cont_sig): Don't call wrefresh.
* Minor rearrangement of tui-stack.cTom Tromey2019-08-302-13/+12
| | | | | | | | | | | This move _initialize_tui_stack to the end of tui-stack.c, per the gdb style; and then removes two unnecessary forward declarations. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (_initialize_tui_stack): Move later. Remove unnecessary forward declarations.
* Make tui_locator_window::set_locator_fullname re-renderTom Tromey2019-08-302-3/+8
| | | | | | | | | | | | | This changes tui_locator_window::set_locator_fullname to re-render the locator window, so that the callers don't need to do this. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Call rerender. (tui_update_locator_fullname, tui_show_frame_info): Don't call tui_show_locator_content.
* Swap tui_show_locator_content and tui_locator_window::rerenderTom Tromey2019-08-302-21/+23
| | | | | | | | | | | | | This swaps the bodies ot tui_show_locator_content and tui_locator_window::rerender, so that the latter does the work, and the former is now just an exported convenience wrapper. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_show_locator_content): Move lower. Rewrite. (tui_locator_window::rerender): Rewrite using body of previous tui_show_locator_content.
* Turn two locator functions into methodsTom Tromey2019-08-303-47/+59
| | | | | | | | | | | | | | | | | This changes tui_set_locator_fullname and tui_set_locator_info to be methods on tui_locator_window. This enables some subsequent cleannups. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (struct tui_locator_window) <set_locator_info, set_locator_fullname>: New methods. * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Rename from tui_set_locator_fullname. (tui_locator_window::set_locator_info): Rename from tui_set_locator_info. Return bool. (tui_update_locator_fullname, tui_show_frame_info): Update.
* Don't call tui_refresh_all from show_layoutTom Tromey2019-08-302-1/+4
| | | | | | | | | | | show_layout calls tui_refresh_all in one case. However, it doesn't need to any more, because the resize method on each window will also update the contents. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_layout): Don't call tui_refresh_all.
* Don't call touchwin in tui_gen_win_info::refresh_windowTom Tromey2019-08-302-4/+6
| | | | | | | | | | | | | The call to touchwin in tui_gen_win_info::refresh_window was an artifact of some earlier refactorings. Testing shows it isn't needed any more -- I believe it was only ever needed for the data item window display problem; but that's been solved more locally. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window): Don't call touchwin.
* Remove NULL checks from box_winTom Tromey2019-08-302-19/+21
| | | | | | | | | | | box_win can't be called with a NULL window, or with an invisible window. So, the NULL checks in that function can be removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Assume win_info and win_info->handle cannot be NULL.
* Simplify register displayTom Tromey2019-08-304-58/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch starts with the observation that the code in tui_data_window::display_registers_from can all be replaced with a call to resize. To make this work propertly, it also changes tui_display_register to be the "rerender" method on tui_data_item_window. The refresh_window method is needed due to the use of nested windows here. The ncurses man page makes it sound like this is not very well supported; and experience bears this out: negelecting the touchwin call in this path will cause the register window to blank when switching focus. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_item_window) <rerender, refresh_window>: Declare. * tui/tui-regs.c (tui_data_window::display_registers_from): Call resize. (tui_data_item_window::rerender): Rename from tui_display_register. (tui_data_item_window::refresh_window): New method. * tui/tui-layout.c (tui_gen_win_info::resize): Do nothing on no-op.
* Private data members in tui_data_windowTom Tromey2019-08-304-7/+20
| | | | | | | | | | | | | | This changes tui_data_window so that the data members are private. This required the addition of a simple accessor method in one case. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <regs_content, regs_column_count, current_group>: Move later. Now private. <get_current_group>: New method. * tui/tui-regs.c (tui_reg_command): Update. * tui/tui-layout.c (tui_set_layout): Update.
* Remove some calls in tui_data_windowTom Tromey2019-08-302-7/+9
| | | | | | | | | | | | | | | This patch removes a call to erase_data_content in refresh_all and then removes some other calls that are more clearly unnecessary once one follows calls from that point. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::display_registers_from_line) (tui_data_window::rerender): Don't call check_and_display_highlight_if_needed. (tui_data_window::refresh_all): Remove call to erase_data_content.
* Remove some checks of .empty()Tom Tromey2019-08-302-111/+104
| | | | | | | | | | | | | | A few methods in tui_data_window check whether the contents are empty; but all the callers already check this, so these calls can be removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::last_regs_line_no) (tui_data_window::display_registers_from) (tui_data_window::display_reg_element_at_line) (tui_data_window::display_registers_from_line): Remove checks of "empty".
* Remove tui_data_window::display_all_dataTom Tromey2019-08-303-20/+11
| | | | | | | | | | | | | | | | | tui_data_window::rerender clears the data item windows, and then calls display_all_data. However, that method only does anything if the contents are not empty. So, display_all_data can be renamed and the wrapper removed. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <display_all_data>: Don't declare. * tui/tui-regs.c (tui_data_window::show_registers): Call rerender. (tui_data_window::rerender): Rename from display_all_data. (tui_data_window::rerender): Remove old implementation.
* Remove NO_DATA_STRINGTom Tromey2019-08-303-2/+7
| | | | | | | | | | | | | | | NO_DATA_STRING shouldn't be used. It's referenced in a single spot, in tui_data_window::display_all_data. This patch removes the use and replaces it with the more correct text. A later patch (though not in this series) will remove this call entirely, when it's more obviously correct to do so. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::display_all_data): Change text. * tui/tui-data.h (NO_DATA_STRING): Remove define.
* Copy BFD_COMPRESS/BFD_DECOMPRESS/BFD_COMPRESS_GABI for thin archiveH.J. Lu2019-08-302-0/+13
| | | | | | | | | We need to copy BFD_COMPRESS, BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive. PR ld/24951 * archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS, BFD_DECOMPRESS and BFD_COMPRESS_GABI flags for thin archive.
* [PATCH][ARM][GAS]: Assembler support to interpret MVE VMOV instruction ↵Srinath Parvathaneni2019-08-303-1/+86
| | | | | | | | | | | | | | | | | correctly. This patch make changes to the assembler to encode MVE VMOV instruction "a" same as "b". a: VMOV<c><q> <Dd>, <Dm> b: VMOV<c><q>.F64 <Dd>, <Dm> gas/ChangeLog: 2019-08-30 Srinath Parvathaneni <srinath.parvathaneni@arm.com> * config/tc-arm.c (do_neon_mov): Modify "if" statement. * testsuite/gas/arm/mve-vmov-bad-3.d: New test. * testsuite/gas/arm/mve-vmov-bad-3.l: Likewise. * testsuite/gas/arm/mve-vmov-bad-3.s: Likewise.
* [ARC] [COMMITTED] Fix FASTMATH field.Claudiu Zissulescu2019-08-302-1/+6
| | | | | | | | | Move FASTMATH to the right enum. 2019-08-30 Claudiu Zissulescu <claziss@gmail.com> * opcode/arc.h (FASTMATH): Move it from insn_class_t to insn_subclass_t enum.
* Automatic date update in version.inGDB Administrator2019-08-301-1/+1
|
* Run argv0-symlink.exp only on native target and local host.Sandra Loosemore2019-08-292-0/+22
| | | | | | | | | | | | | This testcase was originally for PR gdb/15415, a problem with the "run" command expanding symlinks in the name of the program being run. It does not correctly distinguish between files on build, host, and target, and it is not clear if it would be testing anything useful in configurations where "run" is not being used. 2019-08-29 Sandra Loosemore <sandra@codesourcery.com> * gdb.base/argv0-symlink.exp: Run only on native target and local host.
* Fix PR win32/24284: tcp_auto_retry doesn't work in MinGWBernhard Wodok2019-08-292-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was reported by Bernhard Wodok, along with a patch to fix the issue. I adjusted the patch a bit, and I'm submitting the patch on his behalf. According to Bernhard, the issue can be reproduced by doing: 1. start gdb 2. enter 'target remote :2345' 3. observe that it throws a "connection refused" error immediately instead of waiting and throwing a timeout error I.e., I believe it can be reproduced by our current tests, which is why I'm not proposing any extra tests here (well, I don't use nor have any Windows system to test this, so...). The problem happens because, on ser-tcp:wait_for_connect, we call 'gdb_select' passing 0 as its first argument, which, when using MinGW, ends up using the 'gdb_select' version from mingw-hdep.c, and when the first argument is 0 this means that WaitForMultipleObjects will be called with 0 as its first argument as well. According to the MS API docs, this is forbidden: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects The proposed fix is simple: we just call Sleep when N == 0 (and when TIMEOUT is non-NULL), and return 0. It makes sense to me. Both Bernhard and Paul Carroll confirmed that the fix works. I'm Cc'ing Bernhard in case you have any questions about the patch. OK? gdb/ChangeLog: 2019-08-29 Bernhard Wodok <barto@gmx.net> Sergio Durigan Junior <sergiodj@redhat.com> PR win32/24284 * mingw-hdep.c (gdb_select): Handle case when 'n' is zero.
* [gdb/testsuite] Fix gdb.fortran/info-types.exp regexpTom de Vries2019-08-293-4/+25
| | | | | | | | | | | | | | | The gdb.fortran/info-types.exp test-case passes with gcc 7 (though not on openSUSE, due to the extra debug info) and fails with gcc 4.8 and gcc 8. Fix the gdb_test regexp to fix all those cases. gdb/testsuite/ChangeLog: 2019-08-29 Tom de Vries <tdevries@suse.de> * gdb.fortran/info-types.exp: Fix gdb_test regexp to allow more diverse debug info. * lib/fortran.exp (fortran_int8): New proc, based on fortran_int4.
* PR24697, R_PPC_EMB_SDA21 cannot be used when making a shared objectAlan Modra2019-08-292-17/+10
| | | | | | | | | | | | | This removes a restriction on various R_PPC_EMB relocations that has been present for ppc32 since 1996-04-26 git commit e25a798839. As far as I know, only those relocs that would require addressing via r2 for .sdata2/.sbss2 access are disallowed in shared libraries. PR 24697 * elf32-ppc.c (ppc_elf_check_relocs): Call bad_shared_reloc when !bfd_link_executable for R_PPC_EMB_SDA2I16 and R_PPC_EMB_SDA2REL. Don't call bad_shared_reloc for any other reloc.
* PowerPC64 xlate_pcrel_optAlan Modra2019-08-292-19/+29
| | | | | | | | | | | | | | | We can easily support an offset on the second instruction of a sequence marked with R_PPC64_PCREL_OPT. For example, pla ra,symbol@pcrel ld rt,off(ra) can be optimised to pld rt,symbol+off@pcrel nop * elf64-ppc.c (xlate_pcrel_opt): Add poff parameter. Allow offset on second insn, return it in poff. (ppc64_elf_relocate_section): Add offset to paddi addend for PCREL_OPT.
* RISC-V: Fix a gp relaxation reloc overflow error.Jim Wilson2019-08-282-7/+16
| | | | | | | | | | | | | | | | This was broken when I changed how we compute the value for the gp register. It used to be computed inside the sdata section. Now it is computed at the end which makes it an abs section symbol. There is code that tries to use the alignment of the section that the gp value is in, but this does not work if it is in the abs section, as the abs section has alignment of 1 byte. There are people using alternative linker scripts that still define it in the sdata section, so the code is still useful. Thus adding a check to disable this when gp is in the abs section. bfd/ * elfnn-riscv.c (_bfd_riscv_relax_lui): Add check to exclude abs section when setting max_alignment. Update comment. (_bfd_riscv_relax_pc): Likewise.
* Automatic date update in version.inGDB Administrator2019-08-291-1/+1
|
* Tidy check_uvalueAlan Modra2019-08-292-8/+5
| | | | | | | | | | I don't see a need to calculate "ptr = start + uvalue" then compare "ptr" with "start" and "end". Given "start <= end" on entry, the "uvalue" comparison with "max_uvalue" ought to be sufficient to ensure "start + uvalue" is bounded by "start" and "end" regardless of the size of pointers and the unsigned dwarf_vma integer type. * dwarf.c (check_uvalue): Remove unnecessary pointer checks.
* PR24891, objdump memory leaks when parsing malformed archiveAlan Modra2019-08-294-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | BFD was leaking memory in bfd_check_format_matches. As part of deciding the proper format of an archive, BFD looks at the format of the first file stored. That file's bfd was left open for reasons given in a comment removed in git commit 0e71e4955cd1 that said: /* We ought to close `first' here, but we can't, because we have no way to remove it from the archive cache. It's close to impossible to figure out when we can release bfd_ardata. FIXME. */ Well, things have changed since that comment was true and we now can remove files from the archive cache. Closing the first file is good and cures some of the leaks. Other leaks are caused by bfd_check_format_matches throwing away bfd tdata before trying a new match. That lost the element cache set up when format checking the first element in the archive. The easiest and cleanest fix is to simply disable the caching when checking the first element. PR 24891 * bfd.c (struct bfd): Add no_element_cache. * archive.c (_bfd_get_elt_at_filepos): Don't add element to archive cache when no_element_cache. (bfd_generic_archive_p): Set no_element_cache when opening first element to check format. Close first element too. (do_slurp_bsd_armap): Don't zero ardata->cache here. * bfd-in2.h: Regenerate.
* [gdb/testsuite] Fix info-var.exp for debug info from other filesTom de Vries2019-08-282-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | On openSUSE Leap 15.1, I get: ... FAIL: gdb.base/info-var.exp: info variables FAIL: gdb.base/info-var.exp: info variables -n ... because the info variables command prints info also for init.c: ... File init.c:^M 24: const int _IO_stdin_used;^M ... while the regexps in the test-case only expect info for info-var-f1.c and info-var-f2.c. Fix this by extending the regexps. Tested on x86_64-linux, both openSUSE Leap 15.1 and Fedora 30. gdb/testsuite/ChangeLog: 2019-08-28 Tom de Vries <tdevries@suse.de> * gdb.base/info-var.exp: Allow info variables to print info for files other than info-var-f1.c and info-var-f2.c.
* Segfault in ld building SPEC CPU2017 527.cam4_r with -fltoAlan Modra2019-08-292-1/+7
| | | | | | | | | Caused by the PR24406 fix. unwrap_hash_lookup shouldn't be called with link_info.wrap_hash NULL. PR ld/24406 * plugin.c (get_symbols): Test link_info.wrap_hash before calling unwrap_hash_lookup.
* Fix Gnulib glob.c resource leaks found by CoverityGary Benson2019-08-284-23/+347
| | | | | | | | | | | Coverity discovered a number of resource leaks in Gnulib's glob.c. This commit backports the Gnulib commits that fix the leaks. gnulib/ChangeLog: * patches/0003-Fix-glob-c-Coverity-issues.patch: New file. * update-gnulib.sh: List the above. * import/glob.c: Rebuild.
* gdb/fortran: Don't include module symbols when searching for typesAndrew Burgess2019-08-285-2/+26
| | | | | | | | | | | | | | | | | | | | | | | Currently the 'info types' command will return symbols that correspond to Fortran modules. This is because the symbols are created with domain MODULE_DOMAIN and address_class LOC_TYPEDEF. The address_class LOC_TYPEDEF is the same address_class used for type symbols which is why the modules show up when listing types. This commit explicitly prevents symbols in the MODULE_DOMAIN from appearing when we search for symbols in the TYPES_DOMAIN, this prevents the Fortran module symbols from appearing in the output of 'info types'. gdb/ChangeLog: * symtab.c (search_symbols): Don't include MODULE_DOMAIN symbols when searching for types. gdb/testsuite/ChangeLog: * gdb.fortran/info-types.exp: Add module. * gdb.fortran/info-types.f90: Update expected results.
* gdb/fortran: Implement la_print_typedef for FortranAndrew Burgess2019-08-288-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | | Implement an la_print_typedef method for Fortran, this allows 'info types' to work for Fortran. The implementation is just copied from ada_print_typedef (with the appropriate changes). To support the testing of this patch I added a new proc, fortran_character1, to lib/fortran.exp which returns a regexp to match a 1-byte character type. The regexp returned is correct for current versions of gFortran. All of the other regexp are guesses based on all of the other support procs in lib/fortran.exp, I haven't tested them myself. gdb/ChangeLog: * f-lang.c (f_language_defn): Use f_print_typedef. * f-lang.h (f_print_typedef): Declare. * f-typeprint.c (f_print_typedef): Define. gdb/testsuite/ChangeLog: * gdb.fortran/info-types.exp: New file. * gdb.fortran/info-types.f90: New file. * lib/fortran.exp (fortran_character1): New proc.
* Add an option to objcopy to change the alignment of sections.Niklas G?rtler2019-08-284-6/+72
| | | | | | | | | | | | | | PR 24942 * objcopy.c (SECTION_CONTEXT_SET_ALIGNMENT): New constant. (struct section_list): Add alignment field. (command_line_switch): Add OPTION_SET_SECTION_ALIGNMENT. (copy_options): Add --set-section-alignment. (copy_usage): Describe --set-section-alignment. (find_section_list): Initialise the alignment field. (setup_section): Handle the alignment field. (copy_main): Handle OPTION_SET_SECTION_ALIGNMENT. * doc/binutils.texi: Document the new feature. * NEWS: Mention the new feature.
* Add a --source-comment=<text> option to objdump which provides a prefix to ↵Nick Clifton2019-08-285-1/+83
| | | | | | | | | | | | | | | | dipslayed source code lines. PR 24931 * objdump.c (source_comment): New static variable. (option_values): Add OPTION_SOURCE_COMMENT. (long_opions): Add --source-comment. (print_line): If source comment is set, use it as a prefix to the source code line. (main): Handle OPTION_SOURCE_COMMENT. * doc/binutils.texi: Document the new option. * NEWS: Mention the new feature. * testsuite/binutils-all/objdump.exp (test_objdump_S): Add tests of the -S and --source-comment options.
* Automatic date update in version.inGDB Administrator2019-08-281-1/+1
|
* Fix compiler warning in linux-namespaces.cChristian Biesinger2019-08-272-1/+5
| | | | | | | | | | | | | | | | | | ../../gdb/nat/linux-namespaces.c: In function ‘void mnsh_main(int)’: ../../gdb/nat/linux-namespaces.c:604:8: warning: ‘fd’ may be used uninitialized in this function [-Wmaybe-uninitialized] close (fd); ~~~~~~^~~~ And the warning is correct -- mnsh_recv_message can return -1 and leave fd uninitialized, and mnsh_main will still call close (fd) if that happens. Initialize fd to -1 to avoid that. gdb/ChangeLog: 2019-08-27 Christian Biesinger <cbiesinger@google.com> * nat/linux-namespaces.c (mnsh_main): Initialize fd (to -1).
* Improve the DWARF decoder's ability to describe the DW_AT_discr_list attribute.Nick Clifton2019-08-274-74/+443
| | | | | | | | | | | | | | | | | | | | | | | PR 24510 * dwarf.c (MAX_CU_NESTING): New constant. (level_type_signed): New static array. (skip_attr_bytes): New function. (get_type_signedness): New function. (read_and_print_leb128): New function. (display_discr_list): New function. (read_and_display_attr_value): Add start parameter. Use new functions when handling DW_AT_type and DW_AT_discr_list. (read_and_display_attr): Add start parameter. Pass to read_and_display_attr_value. (process_debug_info): Update call to read_and_display_attr. (display_formatted_table): Likewise. (display_debug_lines_decoded): Likewise. Also add start parameter. (display_debug_lines): Likewise. * testsuite/binutils-all/dwarf-attributes.S: Update discrimination lists. * testsuite/binutils-all/dwarf-attributes.W: Update expected output.
* gdb: Add new -n flag to some info commandsAndrew Burgess2019-08-2716-164/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'info variables', its alias 'whereis', and 'info functions' all include non-debug symbols in the output by default. The list of non-debug symbols can sometimes be quite long, resulting in the debug symbol based results being scrolled off the screen. This commit adds a '-n' flag to all of the commands listed above that excludes the non-debug symbols from the results, leaving just the debug symbol based results. gdb/ChangeLog: * cli/cli-utils.c (info_print_options_defs): Delete. (make_info_print_options_def_group): Delete. (extract_info_print_options): Delete. (info_print_command_completer): Delete. (info_print_args_help): Add extra parameter, and optionally include text about -n flag. * cli/cli-utils.h (struct info_print_options): Delete. (extract_info_print_options): Delete declaration. (info_print_command_completer): Delete declaration. (info_print_args_help): Add extra parameter, extend header comment. * python/python.c (gdbpy_rbreak): Pass additional parameter to search_symbols. * stack.c (struct info_print_options): New type. (info_print_options_defs): New file scoped variable. (make_info_print_options_def_group): New static function. (info_print_command_completer): New static function. (info_locals_command): Update to use new local functions. (info_args_command): Likewise. (_initialize_stack): Add extra parameter to calls to info_print_args_help. * symtab.c (search_symbols): Add extra parameter, use this to possibly excluse non-debug symbols. (symtab_symbol_info): Add extra parameter, which is passed on to search_symbols. (struct info_print_options): New type. (info_print_options_defs): New file scoped variable. (make_info_print_options_def_group): New static function. (info_print_command_completer): New static function. (info_variables_command): Update to use local functions, and pass extra parameter through to symtab_symbol_info. (info_functions_command): Likewise. (info_types_command): Pass additional argument through to symtab_symbol_info. (rbreak_command): Pass extra argument to search_symbols. (_initialize_symtab): Add extra arguments for calls to info_print_args_help, and update help text for 'info variables', 'whereis', and 'info functions' commands. * symtab.h (search_symbols): Add extra argument to declaration. * NEWS: Mention new flags. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Add information about the -n flag to "info variables" and "info functions". gdb/testsuite/ChangeLog: * gdb.base/info-fun.exp: Extend to test the -n flag for 'info functions'. Reindent as needed. * gdb.base/info-var-f1.c: New file. * gdb.base/info-var-f2.c: New file. * gdb.base/info-var.exp: New file. * gdb.base/info-var.h: New file.
* Add support for the MVE VMOV instruction to the ARM assembler. This ↵Srinath Parvathaneni2019-08-277-202/+272
| | | | | | | | | | | | | | instruction copies the value of one vector register to another vector register. The patch also modifies the decoding of VORR instruction which is effecting decoding of VMOV instruction. gas * config/tc-arm.c (parse_neon_mov): Add check to accept vector register to both the arguments in VMOV instruction. * testsuite/gas/arm/mve-vmov-1.d: Modify. * testsuite/gas/arm/mve-vmov-1.s: Likewise. * testsuite/gas/arm/mve-vorr.d: Likewise. opcodes * arm-dis.c (mve_opcodes): Add entry for MVE_VMOV_VEC_TO_VEC. (is_mve_undefined): Add case for MVE_VMOV_VEC_TO_VEC. (print_insn_mve): Add condition to check Qm==Qn of VORR instruction.
* Automatic date update in version.inGDB Administrator2019-08-271-1/+1
|
* Factor out the common code in lookup_{static,global}_symbolChristian Biesinger2019-08-262-57/+57
| | | | | | | | | | | | | | | | | | | The two functions are extremely similar; this factors out their code into a shared _internal function. gdb/ChangeLog: 2019-08-26 Christian Biesinger <cbiesinger@google.com> * symtab.c (lookup_static_symbol): Call the new function (and move it down to be next to lookup_global_symbol). (struct global_sym_lookup_data): Add block_enum member and rename to... (struct global_or_static_sym_lookup_data): ...this. (lookup_symbol_global_iterator_cb): Pass block_index instead of GLOBAL_BLOCK to lookup_symbol_in_objfile and rename to... (lookup_symbol_global_or_static_iterator_cb): ...this. (lookup_global_or_static_symbol): New function. (lookup_global_symbol): Call new function.
* [gdb, c++] Improve error message when using libstdcxx without SDT probesTom de Vries2019-08-264-2/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using catch catch/rethrow/catch, a libstdcxx with SDT probes is required for both the regexp argument, and the convenience variable $_exception ( https://sourceware.org/gdb/current/onlinedocs/gdb/Set-Catchpoints.html ). Currently, when using these features with a libstdcxx without SDT probes, we get the cryptic error message: ... not stopped at a C++ exception catchpoint ... Improve this by instead emitting the more helpful: ... did not find exception probe (does libstdcxx have SDT probes?) ... Tested on x86_64-linux. gdb/ChangeLog: 2019-08-26 Tom de Vries <tdevries@suse.de> PR c++/24852 * break-catch-throw.c (fetch_probe_arguments): Improve error mesage when pc_probe.prob == NULL. gdb/testsuite/ChangeLog: 2019-08-26 Tom de Vries <tdevries@suse.de> PR c++/24852 * gdb.cp/no-libstdcxx-probe.exp: New test.
* [gdb/testsuite] Make skip_libstdcxx_probe_tests return 1 if trueTom de Vries2019-08-264-6/+15
| | | | | | | | | | | | | | | | | | | | | The tcl proc skip_libstdcxx_probe_tests currently returns 0 if the probe tests need to be skipped, while tcl interprets 0 as false rather than true, which is confusing. Fix this by making skip_libstdcxx_probe_tests return 1 if the probe tests need to be skipped. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-08-26 Tom de Vries <tdevries@suse.de> * lib/gdb.exp (skip_libstdcxx_probe_tests_prompt): Return 1 if probe * tests need to be skipped. * gdb.cp/exceptprint.exp: Update call to skip_libstdcxx_probe_tests. * gdb.mi/mi-catch-cpp-exceptions.exp: Update call to mi_skip_libstdcxx_probe_tests.
* Use raw strings on gdb.python/py-xmethods.exp (and fix Python 3.8's ↵Sergio Durigan Junior2019-08-262-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "SyntaxWarning: invalid escape sequence") The way unrecognized escape sequences are handled has changed in Python 3.8: users now see a SyntaxWarning message, which will eventually become a SyntaxError in future versions of Python: (gdb) source /blabla/gdb.python/py-xmethods/py-xmethods.py /blabla/gdb.python/py-xmethods/py-xmethods.py:204: SyntaxWarning: invalid escape seque nce \+ 'operator\+', /blabla/gdb.python/py-xmethods/py-xmethods.py:211: SyntaxWarning: invalid escape seque nce \+ 'operator\+\+', One of our testcases, gdb.python/py-xmethods.exp, contains strings in the form of "operator\+". This is not recognized by Python, but is still needed by the testsuite to work properly. The solution is simple: we just have to make sure these strings are marked as raw (i.e, r""). This is what this patch does. I took the opportunity to also convert other strings to raw, which, in two cases, allowed the removal of an extra backslash. I tested this using Python 3.7 and Python 3.8, and everything works fine. I think I could push this as obvious, but decided to send it to gdb-patches just in case. gdb/testsuite/ChangeLog: 2019-08-26 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.python/py-xmethods.exp: Use raw strings when passing arguments to SimpleXMethodMatcher.
* PR24938, Null Pointer Dereference in debug.c:debug_write_typeAlan Modra2019-08-262-2/+9
| | | | | | PR 24938 * debug.c (debug_write_type): Call empty_type for NULL type here.. (debug_write_type): ..rather than in just one case here.
* RISC-V: Improve li expansion for better code density.Kito Cheng2019-08-255-5/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | li is a pseudo instruction in RISC-V, it might expand to more than one instructions if the immediate value can't fit addi or lui, but the assembler will always using 4-byte instructions during expansion. For example: li a0, 0x12345001 will expand into 12345537 lui a0,0x12345 00150513 addi a0,a0,1 but addi could be compress into 0505 addi a0,a0,1 It because load_const use macro_build to emit instructions, and macro_build call append_insn, and expect it will compress it if possible, but the fact is append_insn never compress anything, So this patch redirect the li expansion flow to normal instruction emission flow via md_assemble, added md_assemblef as an wrapper for that for easier emit instruction with printf-style argument to build instruction. gas/ChangeLog: * tc-riscv.c (md_assemblef): New. (load_const) Use md_assemblef instead of macro_build to emit instructions. * testsuite/gas/riscv/li32.d: New. * testsuite/gas/riscv/li32.s: Ditto. * testsuite/gas/riscv/li64.d: Ditto. * testsuite/gas/riscv/li64.s: Ditto.