aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-01-19PowerPC64 DT_RELR local PLTAlan Modra1-1/+2
Similarly to the local GOT case. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate space for PLT relocs against local syms when enable_dt_relr.
2022-01-19PowerPC64 DT_RELR local GOTAlan Modra1-4/+6
Fixes another case where we end up with superfluous R_PPC64_NONE. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate space for GOT relocs against non-TLS local syms when enable_dt_relr. (ppc64_elf_layout_multitoc): Likewise.
2022-01-19Automatic date update in version.inGDB Administrator1-1/+1
2022-01-19Re: PowerPC64 DT_RELRAlan Modra1-5/+3
HJ: "There are 238 R_PPC64_NONEs in libc.so.6 alone." Indeed, let's make them go away. I had the SYMBOL_REFERENCES_LOCAL test in the wrong place. check_relocs is too early to know whether a symbol is dynamic in a shared library. Lots of glibc symbols are made local by version script, but that doesn't happen until size_dynamic_sections. * elf64-ppc.c (ppc64_elf_check_relocs): Don't count relative relocs here depending on SYMBOL_REFERENCES_LOCAL. (dec_dynrel_count): Likewise. (allocate_dynrelocs): Do so here instead.
2022-01-18Fix the remote-sim.c buildTom Tromey1-0/+1
My earlier patch to move gdb_argv broke the remote-sim.c build. This patch fixes the bug. I'm checking it in.
2022-01-18gdbserver: introduce remote_debug_printfSimon Marchi5-97/+48
Add remote_debug_printf, and use it for all debug messages controlled by remote_debug. Change remote_debug to be a bool, which is trivial in this case. Change-Id: I90de13cb892faec3830047b571661822b126d6e8
2022-01-18gdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXITSimon Marchi13-798/+483
Add the threads_debug_printf and THREADS_SCOPED_DEBUG_ENTER_EXIT, which use the logging infrastructure from gdbsupport/common-debug.h. Replace all debug_print uses that are predicated by debug_threads with threads_dethreads_debug_printf. Replace uses of the debug_enter and debug_exit macros with THREADS_SCOPED_DEBUG_ENTER_EXIT, which serves essentially the same purpose, but allows showing what comes between the enter and the exit in an indented form. Note that "threads" debug is currently used for a bit of everything in GDBserver, not only threads related stuff. It should ideally be cleaned up and separated logically as is done in GDB, but that's out of the scope of this patch. Change-Id: I2d4546464462cb4c16f7f1168c5cec5a89f2289a
2022-01-18gdbserver: turn debug_threads into a booleanSimon Marchi5-17/+11
debug_threads is always used as a boolean. Except in ax.cc and tracepoint.cc. These files have their own macros that use debug_threads, and have a concept of verbosity level. But they both have a single level, so it's just a boolean in the end. Remove this concept of level. If we ever want to re-introduce it, I think it will be better implemented in a more common location. Change debug_threads to bool and adjust some users that were treating it as an int. Change-Id: I137f596eaf763a08c977dd74417969cedfee9ecf
2022-01-18Simplify Ada catchpointsTom Tromey1-65/+3
All the Ada catchpoints use the same breakpoint_ops contents, because the catchpoint itself records its kind. This patch simplifies the code by removing the redundant ops structures.
2022-01-18Move "catch exec" to a new fileTom Tromey3-191/+237
The "catch exec" code is reasonably self-contained, and so this patch moves it out of breakpoint.c (the second largest source file in gdb) and into a new file, break-catch-exec.c.
2022-01-18Move "catch fork" to a new fileTom Tromey3-243/+287
The "catch fork" code is reasonably self-contained, and so this patch moves it out of breakpoint.c (the second largest source file in gdb) and into a new file, break-catch-fork.c.
2022-01-18Unify "catch fork" and "catch vfork"Tom Tromey1-142/+41
I noticed that "catch fork" and "catch vfork" are nearly identical. This patch simplifies the code by unifying these two cases.
2022-01-18Move gdb_regex to gdbsupportTom Tromey29-34/+36
This moves the gdb_regex convenience class to gdbsupport.
2022-01-18Introduce gdb-hashtab module in gdbsupportTom Tromey10-59/+110
gdb has some extensions and helpers for working with the libiberty hash table. This patch consolidates these and moves them to gdbsupport.
2022-01-18Move gdb obstack code to gdbsupportTom Tromey63-69/+72
This moves the gdb-specific obstack code -- both extensions like obconcat and obstack_strdup, and things like auto_obstack -- to gdbsupport.
2022-01-18Move gdb_argv to gdbsupportTom Tromey18-185/+220
This moves the gdb_argv class to a new header in gdbsupport.
2022-01-18Simplify event_location_probeTom Tromey3-23/+16
event_location_probe currently stores two strings, but really only needs one. This patch simplifies it and removes some unnecessary copies as well.
2022-01-18Use std::string in event_locationTom Tromey2-39/+34
This changes event_location to use std::string, removing some manual memory management, and an unnecessary string copy.
2022-01-18Split event_location into subclassesTom Tromey1-239/+281
event_location uses the old C-style discriminated union approach. However, it's better to use subclassing, as this makes the code clearer and removes some chances for error. This also enables future cleanups to avoid manual memory management and copies.
2022-01-18Remove EL_* macros from location.cTom Tromey1-93/+90
This patch removes the old-style EL_* macros from location.c. This cleans up the code by itself, IMO, but also enables further cleanups in subsequent patches.
2022-01-18Boolify explicit_to_string_internalTom Tromey1-8/+8
This changes explicit_to_string_internal to use 'bool' rather than 'int'.
2022-01-18Remove a use of xfree in location.cTom Tromey3-23/+13
This small cleanup removes a use of xfree from location.c, by switching to unique_xmalloc_ptr. One function is only used in location.c, so it is made static. And, another function is changed to avoid a copy.
2022-01-18gdb: use ptid_t::to_string instead of target_pid_to_str in debug statementsSimon Marchi8-71/+71
Same idea as 0fab79556484 ("gdb: use ptid_t::to_string in infrun debug messages"), but throughout GDB. Change-Id: I62ba36eaef29935316d7187b9b13d7b88491acc1
2022-01-18gdb: preserve `|` in connection details stringAndrew Burgess3-6/+87
Consider this GDB session: $ gdb -q (gdb) target remote | gdbserver - ~/tmp/hello.x Remote debugging using | gdbserver - ~/tmp/hello.x ... snip ... (gdb) info connections Num What Description * 1 remote gdbserver - ~/tmp/hello.x Remote target using gdb-specific protocol (gdb) python conn = gdb.selected_inferior().connection (gdb) python print(conn.details) gdbserver - ~/tmp/hello.x (gdb) I think there are two things wrong here, first in the "What" column of the 'info connections' output, I think the text should be: remote | gdbserver - ~/tmp/hello.x to correctly show the user how the connection was established. And in a similar fashion, I think that the `details` string of the gdb.TargetConnection object should be: | gdbserver - ~/tmp/hello.x This commit makes this change. Currently the '|' is detected and removed in gdb/serial.c. The string passed to the pipe_ops structure (from gdb/ser-pipe.c), doesn't then, contain the `|`, this is instead implied by the fact that it is a pipes based implementation of the serial_ops interface. After this commit we still detect the `|` in gdb/serial.c, but we now store the full string (including the `|`) in the serial::name member variable. For pipe based serial connections, this name is only used for displaying the two fields I mention above, and in pipe_open (from gdb/ser-pipe.c), and in pipe_open, we now know to skip over the `|`. The benefit I see from this change is that GDB's output now more accurately reflects the commands used to start a target, thus making it easier for a user to understand what is going on.
2022-01-18gdb: testsuite: print explicit test result for gdb.base/dfp-test.expTiezhu Yang1-0/+1
In the current code, if decimal floating point is not supported for this target, there is no binary file dfp-test, and also there is no test result after execute the following commands: $ make check-gdb TESTS="gdb.base/dfp-test.exp" $ grep error gdb/testsuite/gdb.log /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.c:39:1: error: decimal floating point not supported for this target [...] $ cat gdb/testsuite/gdb.sum [...] Running target unix Running /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.exp ... === gdb Summary === [...] With this patch: $ make check-gdb TESTS="gdb.base/dfp-test.exp" $ cat gdb/testsuite/gdb.sum [...] Running target unix Running /home/loongson/gdb.git/gdb/testsuite/gdb.base/dfp-test.exp ... UNSUPPORTED: gdb.base/dfp-test.exp: decimal floating point not supported for this target. === gdb Summary === # of unsupported tests 1 [...] Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
2022-01-17bfd/elf64-ppc.c: fix clang -Wbitwise-instead-of-logical warning in ↵Simon Marchi1-2/+4
ppc64_elf_check_init_fini I see this error with clang-14: CC elf64-ppc.lo /home/smarchi/src/binutils-gdb/bfd/elf64-ppc.c:13131:11: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical] return (check_pasted_section (info, ".init") ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix by replacing & with &&. But given that the check_pasted_section function has side-effects and we want to make sure both calls are made, assign to temporary variables before evaluating the `&&`. Change-Id: I849e1b2401bea5f4d8ef3ab9af99ba9e3ef42490
2022-01-18PR28029, debuginfod testsAlan Modra1-50/+62
binutils/NEWS says of the change in --process-links semantics: If other debug section display options are also enabled (eg --debug-dump=info) then the contents of matching sections in both the main file and the separate debuginfo file *will* be displayed. This is because in most cases the debug section will only be present in one of the files. Implying that debug info is dumped without --process-links. Indeed that appears to be the case for readelf. This does the same for objdump. PR 28029 * objdump.c (dump_bfd): Do not exit early when !is_mainfile && !processlinks, instead just exclude non-debug output. (dump_dwarf): Add is_mainfile parameter and pass to dump_dwarf_section. (dump_dwarf_section): Only display debug sections when !is_mainfile and !process_links.
2022-01-18Check thin archive element file size against archive headerAlan Modra1-1/+11
Makes it a little less likely for someone to break their thin archives. * archive.c (_bfd_get_elt_at_filepos): Check thin archive element file size.
2022-01-18lang_size_relro_segment tidyAlan Modra1-16/+4
This function has seen too many minimal change style edits. No functional changes in this patch. * ldlang.c (lang_size_relro_segment): Tidy.
2022-01-18PowerPC64 DT_RELRAlan Modra7-87/+518
PowerPC64 takes a more traditional approach to DT_RELR than x86. Count relative relocs in check_relocs, allocate space for them and output in the usual places but not doing so when enable_dt_relr. DT_RELR is sized in the existing ppc stub relaxation machinery, run via the linker's ldemul_after_allocation hook. DT_RELR is output in the same function that writes ppc stubs, run via ldemul_finish. This support should be considered experimental. bfd/ * elf64-ppc.c (struct ppc_local_dyn_relocs): Renamed from ppc_dyn_relocs. Add rel_count field. Update uses. (struct ppc_dyn_relocs): New. Replace all uses of elf_dyn_relocs. (struct ppc_link_hash_table): Add relr_alloc, relr_count and relr_addr. (ppc64_elf_copy_indirect_symbol): Merge rel_count. (ppc64_elf_check_relocs): Init rel_count for global and local syms. (dec_dynrel_count): Change r_info param to reloc pointer. Update all callers. Handle decrementing rel_count. (allocate_got): Don't allocate space for relative relocs when enable_dt_relr. (allocate_dynrelocs): Likewise. (ppc64_elf_size_dynamic_sections): Likewise. Handle srelrdyn. (ppc_build_one_stub): Don't emit relative relocs on .branch_lt. (compare_relr_address, append_relr_off): New functions. (got_and_plt_relr_for_local_syms, got_and_plt_relr): Likewise. (ppc64_elf_size_stubs): Size .relr.syn. (ppc64_elf_build_stubs): Emit .relr.dyn. (build_global_entry_stubs_and_plt): Don't output relative relocs when enable_dt_relr. (write_plt_relocs_for_local_syms): Likewise. (ppc64_elf_relocate_section): Likewise. binutils/ * testsuite/lib/binutils-common.exp (supports_dt_relr): Add powerpc64. ld/ * emulparams/elf64ppc.sh: Source dt-relr.sh. * testsuite/ld-elf/dt-relr-2b.d: Adjust for powerpc. * testsuite/ld-elf/dt-relr-2c.d: Likewise. * testsuite/ld-elf/dt-relr-2d.d: Likewise. * testsuite/ld-elf/dt-relr-2e.d: Likewise.
2022-01-18tweak __ehdr_start visibility and flags for check_relocsAlan Modra3-11/+42
bfd/ * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Test linker_def. ld/ * ldelf.c (ldelf_before_allocation): Don't force __ehdr_start local and hidden here.. * ldlang.c (lang_symbol_tweaks): ..do so here instead and set def_regular and linker_def for check_relocs. New function extracted from lang_process.
2022-01-18Automatic date update in version.inGDB Administrator1-1/+1
2022-01-17Update the config.guess and config.sub files from the master repository and ↵Nick Clifton21-5371/+6375
regenerate files.
2022-01-17Fix Z80 assembly failure.Sergey Belyashov2-0/+7
PR 28762 * app.c (do_scrub_chars): Correct handling when the symbol is not 'af'.
2022-01-17gdb/infrun: rename variable and move to more specific scopeSimon Marchi1-4/+2
Move the "started" variable to the scope it's needed, and rename it to "step_over_started". Change-Id: I56f3384dbd328f55198063bb855edda10f1492a3
2022-01-17x86: adjust struct instr_info field typesJan Beulich1-36/+39
Now that this lives on the stack, let's have it be a little less wasteful in terms of space. Switch boolean fields to "bool" (also when this doesn't change their size) and also limit the widths of "rex", "rex_used", "op_ad", and "op_index". Do a little bit of re-ordering as well to limit the number of padding holes.
2022-01-17x86: drop index16 fieldJan Beulich1-5/+3
There's a single use on a generally infrequently taken code path. Put the necessary conditional there instead.
2022-01-17x86: drop most Intel syntax register name arraysJan Beulich1-230/+119
By making use of, in particular, oappend_maybe_intel() there's no need for this redundant set of static data.
2022-01-17x86: fold variables in memory operand index handlingJan Beulich1-19/+15
There's no real need for the pseudo-boolean "haveindex" or for separate 32-bit / 64-bit index pointers. Fold them into a single "indexes" and set that uniformly to AT&T names, compensating by emitting the register name via oappend_maybe_intel().
2022-01-17x86: constify disassembler static dataJan Beulich1-58/+58
Now that the code is intended to be largely thread-safe, we'd better not have any writable static objects.
2022-01-17Automatic date update in version.inGDB Administrator1-1/+1
2022-01-16gdb/copyright.py: Do not update gdbsupport/Makefile.inJoel Brobecker1-0/+1
This file is generated, so we should not modify it (any modification we make is going to be undone at the next re-generation anyway).
2022-01-16Automatic date update in version.inGDB Administrator1-1/+1
2022-01-15Automatic date update in version.inGDB Administrator1-1/+1
2022-01-14gdb.dlang/demangle.exp: update expected output for _D8demangle4testFnZvSimon Marchi1-1/+1
Since commit ce2d3708bc8b ("Synchronize binutils libiberty sources with gcc version."), I see this failure: demangle _D8demangle4testFnZv^M demangle.test(typeof(null))^M (gdb) FAIL: gdb.dlang/demangle.exp: _D8demangle4testFnZv The commit imported the commit 0e32a5aa8bc9 ("libiberty: Add support for D `typeof(*null)' types") from the gcc repository. That commit includes an update to libiberty/testsuite/d-demangle-expected, which updates a test for the exact same mangled name: _D8demangle4testFnZv -demangle.test(none) +demangle.test(typeof(null)) I don't know anything about D, but give that the change was made by Iain Buclaw, the D language maintainer, I trust him on that. Fix our test by updating the expected output in the same way. Note: it's not really useful to have all these D demangling tests in the GDB testsuite, since there are demangling tests in libiberty. We should consider removing them, but we first need to make sure that everything that is covered in gdb/testsuite/gdb.dlang/demangle.exp is also covered in libiberty/testsuite/d-demangle-expected. Change-Id: If2b290ea8367b8e1e0b90b20d4a6e0bee517952d
2022-01-14gdb/testsuite: enable __INTEL_LLVM_COMPILER preprocessor in get_compiler_infoNils-Christian Kempke3-1/+20
Intel Next Gen compiler defines preprocessor __INTEL_LLVM_COMPILER and provides version info in __clang_version__ e.g. value: 12.0.0 (icx 2020.10.0.1113). gdb/testsuite/ChangeLog: 2020-12-07 Abdul Basit Ijaz <abdul.b.ijaz@intel.com> * lib/compiler.c: Add Intel next gen compiler pre-processor check. * lib/compiler.cc: Ditto. * lib/fortran.exp (fortran_main): Check Intel next gen compiler in test_compiler_info.
2022-01-14PR28751 mbind2a / mbind2b regressions on powerpc*-linuxAlan Modra4-4/+15
include/ * bfdlink.h (struct bfd_link_info): Add commonpagesize_is_set. ld/ PR 28751 * emultempl/elf.em (handle_option): Set commonpagesize_is_set. * ldelf.c (ldelf_after_parse): Don't error when only one of -z max-page-size or -z common-page-size is given, correct the other value to make it sane. * testsuite/ld-elf/elf.exp (mbind2a, mbind2b): Do not pass -z max-page-size.
2022-01-14x86: drop ymmxmm_modeJan Beulich1-16/+0
This enumerator is not used by any table entry.
2022-01-14x86: share yet more VEX table entries with EVEX decodingJan Beulich4-209/+69
On top of prior similar work more opportunities have appeared in the meantime. Note that this also happens to address the prior lack of decoding of EVEX.L'L for VMOV{L,H}P{S,D} and VMOV{LH,HL}PS.
2022-01-14x86: consistently use scalar_mode for AVX512-FP16 scalar insnsJan Beulich2-31/+31
For some reason the original AVFX512F insns were not taken as a basis here, causing unnecessary divergence. While not an active issue, it is still relevant to note that OP_XMM() has special treatment of e.g. scalar_mode (marking broadcast as invalid). Such would better be consistent for all sufficiently similar insns.