aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-10-31sim: mips/v850: remove redundant variable setupMike Frysinger2-7/+0
The common/Make-common.in fragment already provides these variables.
2021-10-30sim: fix compilation on mingw64 [PR sim/28476]Orgad Shaneh4-10/+16
...by reordering includes. 1. sim-utils.c sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h which has UserMode as a member. So if sim-main.h is included before winnt.h, compilation fails. 2. ppc registers.h defines CR, which is used as a member in winnt.h. winsock2.h is included by sys/time.h, so sys/time.h has to be included before registers.h. Bug: https://sourceware.org/PR28476
2021-10-31Don't include coff/pe.h in coff-x86_64.cAlan Modra2-5/+5
This (and other) code from coffcode.h is broken for x86_64_coff_vec, and has been ever since support was added in 2006 commit 99ad839030c1 Here, bfd_coff_aoutsz must match coff_swap_aouthdr_out otherwise we end up writing garbage. /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)). */ char * buff; bfd_size_type amount = bfd_coff_aoutsz (abfd); buff = (char *) bfd_malloc (amount); if (buff == NULL) return false; coff_swap_aouthdr_out (abfd, & internal_a, buff); amount = bfd_bwrite (buff, amount, abfd); We have removed support for --target=x86_64-coff, likely because it never worked properly, but still produce coff-x86_64.o with --enable-targets=all. This means objcopy can recognize x86_64 COFF files but will write garbage to the output file, a fact found by fuzzers. I suspect x86_64 COFF is still broken after this fix, and mention of coff-x86_64.* should be removed from bfd/Makefile.am. * coff-x86_64.c: Don't include coff/pe.h. (COFF_WITH_pex64): Don't define here. * pe-x86_64.c: Include coff/pe.h and other headers. (PEI_HEADERS): Define.
2021-10-31Re: PR28420, ecoff fuzzing failuresAlan Modra1-4/+1
sym_ptr_ptr NULL results in segfaults. PR 28420 * ecoff.c (ecoff_slurp_reloc_table): Don't leave sym_ptr_ptr NULL.
2021-10-31ubsan: alpha-vms: undefined shiftAlan Modra1-1/+1
* vms-alpha.c (evax_bfd_print_image): Shift left 1u.
2021-10-31PR28518: signed integer overflow & free on unmalloced addressAlan Modra1-10/+10
PR 28518 * vms-alpha.c (build_module_list): Don't lose malloc buffer address. Use unsigned variables.
2021-10-31Automatic date update in version.inGDB Administrator1-1/+1
2021-10-29gdb: fix gdb.gdb/unittest.exp with C++17 compilerSimon Marchi1-6/+6
On a machine with gcc 11, I get: FAIL: gdb.gdb/unittest.exp: test_completion: tab complete "maintenance selftest string_v" (second tab) (timeout) FAIL: gdb.gdb/unittest.exp: test_completion: tab complete "maintenance selftest string_vie" (timeout) That's because when compiling with C++ >= 17, we use the standard version of string_view, and don't have a selftest for it. So the list of selftests shown by the tab completion when completing "string_v" differs. Change the test to use the copy_* tests instead. Change-Id: I85f6aa44ee5fc9652b9bd4451e0506b89773526b
2021-10-29gdb.texinfo: Expand documentation for debuginfodAaron Merey1-7/+90
Add section describing GDB's usage of debuginfod. Refer to this new section in the description of the '--with-debuginfod' configure option. Mention debuginfod in the 'Separate Debug Files' section.
2021-10-29gdb: add set/show commands for managing debuginfodAaron Merey2-11/+290
Add 'set debuginfod' command. Accepts 'on', 'off' or 'ask' as an argument. 'on' enables debuginfod for the current session. 'off' disables debuginfod for the current session. 'ask' will prompt the user to either enable or disable debuginfod when the next query is about to be performed: This GDB supports auto-downloading debuginfo from the following URLs: <URL1> <URL2> ... Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod on' to .gdbinit. For interactive sessions, 'ask' is the default. For non-interactive sessions, 'off' is the default. Add 'show debuginfod status' command. Displays whether debuginfod is set to 'on', 'off' or 'ask'. Add 'set/show debuginfod urls' commands. Accepts a string of space-separated debuginfod server URLs to be queried. The default value is copied from the DEBUGINFOD_URLS environment variable. Finally add 'set/show debuginfod verbose' commands to control whether debuginfod-related output is displayed. Verbose output is enabled by default. (gdb) run Starting program: /bin/sleep 5 Download failed: No route to host. Continuing without debug info for /lib64/libc.so.6. If GDB is not built with debuginfod then these commands will just display Support for debuginfod is not compiled into GDB.
2021-10-30Automatic date update in version.inGDB Administrator1-1/+1
2021-10-29gdb: remove TYPE_FIELD_DWARF_BLOCKSimon Marchi3-4/+3
Remove TYPE_FIELD_DWARF_BLOCK, replace with type::field + field::loc_dwarf_block. Change-Id: I10af9410bb5f46d342b8358a7956998c7e804b64
2021-10-29gdb: remove TYPE_FIELD_STATIC_PHYSADDRSimon Marchi5-5/+4
Remove TYPE_FIELD_STATIC_PHYSADDR replace with type::field + field::loc_physaddr. Change-Id: Ica9bc4a48f34750ec82ec86c298d3ecece81bcbd
2021-10-29gdb: remove TYPE_FIELD_STATIC_PHYSNAMESimon Marchi5-5/+4
Remove TYPE_FIELD_STATIC_PHYSNAME, replace with type::field + field::loc_physname. Change-Id: Ie35d446b67dd1d02f39998b406001bdb7e6d5abb
2021-10-29gdb: remove TYPE_FIELD_ENUMVALSimon Marchi15-39/+38
Remove TYPE_FIELD_ENUMVAL, replace with type::field + field::loc_enumval. Change-Id: I2ada73e4635aad3363ce2eb22c1dc52698ee2072
2021-10-29gdb: remove TYPE_FIELD_BITPOSSimon Marchi30-93/+87
Remove TYPE_FIELD_BITPOS, replace its uses with type::field + field::loc_bitpos. Change-Id: Iccd8d5a77e5352843a837babaa6bd284162e0320
2021-10-29gdb: remove TYPE_FIELD_LOC_KINDSimon Marchi10-18/+18
Remove TYPE_FIELD_LOC_KIND, replace its uses with type::field + field::loc_kind. Change-Id: Ib124a26365df82ac1d23df7962d954192913bd90
2021-10-29gdb: remove FIELD_DWARF_BLOCK macroSimon Marchi3-5/+4
Remove FIELD_DWARF_BLOCK, replace its uses with field::loc_dwarf_block. Change-Id: I66b7d6a960cb5e341e61e21bd3cc9a6ac26de6a8
2021-10-29gdb: remove FIELD_STATIC_PHYSADDR macroSimon Marchi3-5/+3
Remove FIELD_LOC_KIND_PHYSADDR, replace its uses with field::loc_physaddr. Change-Id: Ifd8b2bdaad75f42bfb1404ef8c396ffe7e10ac55
2021-10-29gdb: remove FIELD_STATIC_PHYSNAME macroSimon Marchi3-5/+4
Remove FIELD_STATIC_PHYSNAME, replace its uses with field::loc_physname. Change-Id: Iaa8952410403b4eb5bbd68411feea27e2405d657
2021-10-29gdb: remove FIELD_ENUMVAL macroSimon Marchi3-4/+3
Remove FIELD_ENUMVAL, replace its uses with field::loc_enumval. Change-Id: Id4861cee91a8bb583a9836f1aa5da0a320fbf4d9
2021-10-29gdb: remove FIELD_BITPOS macroSimon Marchi6-18/+15
Remove FIELD_BITPOD, replace its uses with field::loc_bitpos. Change-Id: Idb99297e0170661254276c206383a7e9bf1a935a
2021-10-29gdb: remove FIELD_LOC_KIND macroSimon Marchi3-8/+7
Remove FIELD_LOC_KIND, replace its uses with field::loc_kind or call_site_target::loc_kind. Change-Id: I0368d8c3ea269d491bb215aa70e32edbdf55f389
2021-10-29Add gdb.Architecture.integer_type Python functionTom Tromey4-0/+89
This adds a new Python function, gdb.Architecture.integer_type, which can be used to look up an integer type of a given size and signed-ness. This is useful to avoid dependency on debuginfo when a particular integer type would be useful. v2 moves this to be a method on gdb.Architecture and addresses other review comments.
2021-10-29Remove ada_value_print_innerTom Tromey1-24/+5
I noticed that the only caller of ada_value_print_inner is valprint.c:do_val_print (via ada_language::value_print_inner), meaning that the try/catch logic in this function is redundant. This patch removes the wrapper function. Regression tested on x86-64 Fedora 34.
2021-10-29Document resolve_dynamic_type oddityTom Tromey1-2/+11
Today I re-learned that resolve_dynamic_type can return a type for which is_dynamic_type returns true. This can happen for an array whose elements have dynamic type -- the array is reported as dynamic, but resolving the elements would be incorrect, because each element might have a different type after resolution. You can see the special case in resolve_dynamic_array_or_string: if (ary_dim != NULL && ary_dim->code () == TYPE_CODE_ARRAY) ... else ... I looked into having the TYPE_CODE_ARRAY case in is_dynamic_type_internal follow this same logic, but that breaks down on the gdb.fortran/dynamic-ptype-whatis.exp test case. In particular this code in fortran_undetermined::evaluate: value *callee = std::get<0> (m_storage)->evaluate (nullptr, exp, noside); if (noside == EVAL_AVOID_SIDE_EFFECTS && is_dynamic_type (value_type (callee))) callee = std::get<0> (m_storage)->evaluate (nullptr, exp, EVAL_NORMAL); ... relies on is_dynamic_type returning true for such an array. I wasn't really sure of the best way to fix this, so in the meantime I wrote this patch, which documents the oddity so that I might have a chance of remembering this in the future.
2021-10-29Avoid self-test failures on x86-linuxTom Tromey1-0/+21
The disassembly tests in "maint selftest" will fail on x86-linux. This happens because opcodes rejects an attempt to disassemble for an arch with a 64-bit address size when bfd_vma is 32-bit. This patch avoids this problem by avoiding the test in this case. I chose to do it this way because this seems to be the only situation where opcodes checks the size of bfd_vma. For v2 of this patch, I've also updated memory_error_test to do the same thing. This is needed due to the "improve error reporting from the disassembler" patch.
2021-10-29[gdb/build] Fix build with --disable-unit-testsTom de Vries2-4/+19
A build with --disable-unit-tests currently run into: ... ld: maint.o: in function \ `maintenance_selftest_completer(cmd_list_element*, completion_tracker&, char const*, char const*)': src/gdb/maint.c:1183: undefined reference to \ `selftests::for_each_selftest( gdb::function_view< void (std::__cxx11::basic_string<char,std::char_traits<char>, std::allocator<char> > const&)>)' ... Fix this by guarding the call to selftests::for_each_selftest in maintenance_selftest_completer with GDB_SELF_TEST, such that the "-verbose" completion still works. Rebuild on x86_64-linux and ran gdb.gdb/unittest.exp.
2021-10-29Document "memory-tag-violations".Enze Li2-4/+13
* gdb/doc/gdb.texinfo: (Data): Document '-memory-tag-violations'. (Command Options): Update the example.
2021-10-29Support for a new pacbti unwind opcode.Tejas Belagod1-0/+2
This patch adds readelf support for decoding the exception table opcode for restoring the RA_AUTH_CODE pseudo register defined by the EHABI (https://github.com/ARM-software/abi-aa/releases/download/2021Q1/ehabi32.pdf Section 10.3). * readelf.c (decode_arm_unwind_bytecode): Add support to decode restoring RA_AUTH_CODE pseudo register.
2021-10-29Re: arm: add unwinder encoding support for PACBTIAlan Modra3-0/+0
Move the gas testsuite files to where they belong.
2021-10-29ELF core file size checksAlan Modra2-25/+19
Catch fuzzed segments where p_offset + p_filesz wraps, and limit error output. * elfcore.h (elf_core_file_p): Rewrite segment checks using bfd_get_file_size. Set read_only on file size errors. * elfcode.h (elf_swap_shdr_in): Don't repeat error message.
2021-10-29obcopy vs. files with silly section alignmentAlan Modra1-2/+7
We already ignore stupid segment alignment when rewriting headers, ignore section alignment too. * elf.c (rewrite_elf_program_header): Ignore section alignment power greater than 62.
2021-10-29Automatic date update in version.inGDB Administrator1-1/+1
2021-10-29gdb: Add OpenRISC gdbserver and native config newsStafford Horne1-0/+8
The previous patches added gdbserver and native debugging support for OpenRISC targets. This patch documents that in the news.
2021-10-29gdb: or1k: add single step for linux native debuggingStafford Horne3-19/+54
Needed for single stepping in Linux, this adds the or1k implementation of or1k_software_single_step. Most of the implementation is borrowed from the bare metal single step code from or1k_single_step_through_delay which has been extracted and shared in helper function or1k_delay_slot_p.
2021-10-29gdb: or1k: add native linux supportStafford Horne6-0/+249
This patch adds support for running gdb natively on OpenRISC linux. Debugging support is provided via the linux PTRACE interface which is mostly handled by GDB genric code. This patch provides the logic of how to read and write the ptrace registers between linux and GDB. Single stepping is privided in a separate patch.
2021-10-29gdb: or1k: add generated linux descriptor fileStafford Horne1-0/+78
2021-10-29gdb: or1k: fixup linux regcache commentStafford Horne1-3/+4
The old comment was not properly updated from the RISC-V example used. Update it to match OpenRISC.
2021-10-29gdb: or1k: implement gdb serverStafford Horne6-0/+329
This patch adds gdbserver support for OpenRISC. This has been used for debugging the glibc port that in being worked on here: https://github.com/openrisc/or1k-glibc/tree/or1k-port-2 Hence the comment about registers definitions being inline with glibc.
2021-10-28[sim] Include defs.h in ppc/hw_memory.cChristian Biesinger1-0/+3
To fix this error (seen on cygwin): /../../sim/ppc/../common ../../../sim/ppc/hw_memory.c In file included from ../../gnulib/import/stdlib.h:100, from ../../../sim/ppc/hw_memory.c:28: ../../gnulib/import/unistd.h:663:3: error: #error "Please include config.h first." 663 | #error "Please include config.h first." | ^~~~~ ../../gnulib/import/unistd.h:665:24: error: expected ';' before 'extern' 665 | _GL_INLINE_HEADER_BEGIN | ^ | ; ../../gnulib/import/unistd.h:2806:22: error: expected ';' before 'extern' 2806 | _GL_INLINE_HEADER_END | ^ | ;
2021-10-28ARM assembler: Allow up to 32 single precision registers in the VPUSH and ↵Markus Klein4-17/+41
VPOP instructions. PR 28436 * config/tc-arm.c (do_vfp_nsyn_push_pop_check): New function. (do_vfp_nsyn_pop): Use the new function. (do_vfp_nsyn_push): Use the new function. * testsuite/gas/arm/v8_1m-mve.s: Add new instructions. * testsuite/gas/arm/v8_1m-mve.d: Updated expected disassembly.
2021-10-28gdb: use ptid_t::to_string in infrun debug messagesSimon Marchi1-59/+57
In debug messages, I think it would be more helpful to print ptid using the simple "pid.lwp.tid" notation in infrun debug messages. I am currently debugging some fork issues, and find the pid_to_str output not so useful, as it doesn't tell which process a thread belongs to. It currently shows up like this: [infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=0, current thread [Thread 0x7ffff7d95740 (LWP 892942)] at 0x55555555521f With the patch, it shows up like this: [infrun] resume_1: step=1, signal=GDB_SIGNAL_0, trap_expected=1, current thread [894072.894077.0] at 0x5555555551d9 Change-Id: I130796d7dfb0d8e763b8358d8a6002701d80c4ea
2021-10-28gdb: add selftest name completionSimon Marchi3-3/+27
After the previous commit, it is easy to add completion for selftest names. Again, this is not particularly high value, but I rarely touched completion, so it served as a simple example to get some practice. Change the for_each_selftest_ftype parameter to gdb::function_view, so that we can pass a lambda that captures things. Change-Id: I87cac299ddca9ca7eb0ffab78342e850a98d954c
2021-10-28arm: add unwinder encoding support for PACBTITejas Belagod4-5/+116
This patch adds support for encoding the Return Address Authentication pseudo register - '.save {ra_auth_code}' as defined by the DWARF ABI - in the exception tables where the opcode is defined by the EHABI gas/Changelog: * config/tc-arm.c (arm_reg_type): Add new type REG_TYPE_PSEUDO. (reg_expected_msgs): Add message for pseudo reg type. (reg_list_els): Add new reg list type REGLIST_PSEUDO. (parse_reg_list): Handle new REGLIST_PSEUDO type. (s_arm_unwind_save_pseudo): Encode pseudo reg list save in exception tables. (s_arm_unwind_save): Handle new REG_TYPE_PSEUDO. (reg_names): Add ra_auth_code pseudo register. * testsuite/gas/arm/unwind-pacbti-m.s: New test. * testsuite/gas/arm/unwind-pacbti-m.d: New test. * testsuite/gas/arm/unwind-pacbti-m-readelf.d: New test.
2021-10-28gdb: add "maint set/show selftest verbose" commands and use process_optionsSimon Marchi2-5/+76
I saw the new -verbose switch to "maint selftests" and thought it would be nice for it to use the option framework. For example, that makes having completion easy. It's not that high value, given this is a maintenance command, but I had never used the framework myself, so it was a good way to practice. This patch also adds the "maint set/show selftest verbose" setting. It would be possible to use option framework without adding the setting, but using the framework makes adding the option almost trivial, so I thought why not. Change-Id: I6687faa0713ff3da60b398253211777100094144
2021-10-28[gdb/testsuite] Update some test-cases to GPLv3Tom de Vries10-10/+10
I noticed some files in the test-suite have GPLv2 notices. Update these to GPLv3.
2021-10-28gdb: add add_setshow_prefix_cmdSimon Marchi34-329/+280
There's a common pattern to call add_basic_prefix_cmd and add_show_prefix_cmd to add matching set and show commands. Add the add_setshow_prefix_cmd function to factor that out and use it at a few places. Change-Id: I6e9e90a30e9efb7b255bf839cac27b85d7069cfd
2021-10-28[gdb/testsuite] Require python in gdb.server/server-kill-python.expTom de Vries1-0/+8
I came across this when running test-case gdb.server/server-kill-python.exp with a gdb configured without python: ... builtin_spawn gdb -nw -nx -data-directory data-directory -iex set height 0 \ -iex set width 0 -quiet -iex set height 0 -iex set width 0 \ -ex source outputs/gdb.server/server-kill-python/file1.py^M FAIL: gdb.server/server-kill-python.exp: ensure inferior is running Executing on target: kill -9 28535 (timeout = 300) builtin_spawn -ignore SIGHUP kill -9 28535^M file1.py:1: Error in sourced command file:^M Undefined command: "import". Try "help".^M ... Fix this by testing for python support in the test-case. Tested on aarch64-linux (with python support disabled) and x86_64-linux (with python support enabled).
2021-10-28[gdb/testsuite] Fix assembly comments in gdb.dwarf2/clang-debug-names.exp.tclTom de Vries1-38/+38
On openSUSE Leap 15.2 aarch64 I ran into: ... clang-debug-names-debug.S:72: \ Error: junk at end of line, first unrecognized character is `#' ... due to: ... 71 .Ldebug_names_start: 72 .short 5 # Header: version ... Fix this by using the /* ... */ comment style instead: ... $ sed -i 's% #\([^"]*\)%/*\1 */%' clang-debug-names.exp.tcl ... Tested on aarch64-linux and x86_64-linux.