aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-12-22Automatic date update in version.inGDB Administrator1-1/+1
2022-12-22PR29925, Memory leak in find_abstract_instanceAlan Modra1-12/+19
The testcase in the PR had a variable with both DW_AT_decl_file and DW_AT_specification, where the DW_AT_specification also specified DW_AT_decl_file. This leads to a memory leak as the file name is malloced and duplicates are not expected. I've also changed find_abstract_instance to not use a temp for "name", because that can result in a change in behaviour from the usual last of duplicate attributes wins. PR 29925 * dwarf2.c (find_abstract_instance): Delete "name" variable. Free *filename_ptr before assigning new file name. (scan_unit_for_symbols): Similarly free func->file and var->file before assigning.
2022-12-21Fix compiling of top.cAndrew Pinski1-1/+0
When I moved my last patch forward, somehow I missed removing the #endif for the HAVE_LIBMPFR case. Committed as obvious after a quick build. gdb/ChangeLog: * top.c: Remove the extra #endif which was missed.
2022-12-21Use toplevel configure for GMP and MPFR for gdbAndrew Pinski12-1094/+142
This patch uses the toplevel configure parts for GMP/MPFR for gdb. The only thing is that gdb now requires MPFR for building. Before it was a recommended but not required library. Also this allows building of GMP and MPFR with the toplevel directory just like how it is done for GCC. We now error out in the toplevel configure of the version of GMP and MPFR that is wrong. OK after GDB 13 branches? Build gdb 3 ways: with GMP and MPFR in the toplevel (static library used at that point for both) With only MPFR in the toplevel (GMP distro library used and MPFR built from source) With neither GMP and MPFR in the toplevel (distro libraries used) Changes from v1: * Updated gdb/README and gdb/doc/gdb.texinfo. * Regenerated using unmodified autoconf-2.69 Thanks, Andrew Pinski ChangeLog: * Makefile.def: Add configure-gdb dependencies on all-gmp and all-mpfr. * configure.ac: Split out MPC checking from MPFR. Require GMP and MPFR if the gdb directory exist. * Makefile.in: Regenerate. * configure: Regenerate. gdb/ChangeLog: PR bug/28500 * configure.ac: Remove AC_LIB_HAVE_LINKFLAGS for gmp and mpfr. Use GMPLIBS and GMPINC which is provided by the toplevel configure. * Makefile.in (LIBGMP, LIBMPFR): Remove. (GMPLIBS, GMPINC): Add definition. (INTERNAL_CFLAGS_BASE): Add GMPINC. (CLIBS): Exchange LIBMPFR and LIBGMP for GMPLIBS. * target-float.c: Make the code conditional on HAVE_LIBMPFR unconditional. * top.c: Remove code checking HAVE_LIBMPFR. * configure: Regenerate. * config.in: Regenerate. * README: Update GMP/MPFR section of the config options. * doc/gdb.texinfo: Likewise. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28500
2022-12-21gdb/c++: validate 'using' directives based on the current lineBruno Larsen6-9/+95
When asking GDB to print a variable from an imported namespace, we only want to see variables imported in lines that the inferior has already gone through, as is being tested last in gdb.cp/nsusing.exp. However with the proposed change to gdb.cp/nsusing.exp, we get the following failures: (gdb) PASS: gdb.cp/nsusing.exp: continue to breakpoint: marker10 stop print x $9 = 911 (gdb) FAIL: gdb.cp/nsusing.exp: print x, before using statement next 15 y += x; (gdb) PASS: gdb.cp/nsusing.exp: using namespace M print x $10 = 911 (gdb) PASS: gdb.cp/nsusing.exp: print x, only using M Showing that the feature wasn't functioning properly, it just so happened that gcc ordered the namespaces in a convenient way. This happens because GDB doesn't take into account the line where the "using namespace" directive is written. So long as it shows up in the current scope, we assume it is valid. To fix this, add a new member to struct using_direct, that stores the line where the directive was written, and a new function that informs if the using directive is valid already. Unfortunately, due to a GCC bug, the failure still shows up. Compilers that set the declaration line of the using directive correctly (such as Clang) do not show such a bug, so the test includes an XFAIL for gcc code. Finally, because the final test of gdb.cp/nsusing.exp has turned into multiple that all would need XFAILs for older GCCs (<= 4.3), and that GCC is very old, if it is detected, the test just exits early. Approved-by: Tom Tromey <tom@tromey.com>
2022-12-21Updated Romanian translation for the BFD sub-directory.Nick Clifton2-1970/+2073
2022-12-21Fix an attempt to allocate an unreasonably large amount of memory when ↵Nick Clifton2-1/+9
parsing a corrupt ELF file. PR 29924 * objdump.c (load_specific_debug_section): Check for excessively large sections.
2022-12-21Keep the .drectve section when performing a relocateable link.Nick Clifton3-2/+9
PR 29900 * scripttempl/pe.sc: Keep the .drectve section when performing a relocateable link. * scripttempl/pep.sc: Likewise.
2022-12-21x86: rename CheckRegSize to CheckOperandSizeJan Beulich4-513/+513
While originally indeed used for register size checking only, the attribute has been used for memory operand size checking as well already for quite a while, with more such uses recently having been added.
2022-12-21gprofng/testsuite: restrict testing to native configurationsJan Beulich1-0/+7
The binaries involved in testing gprofng are native ones, and hence a cross build of binutils won't really test intended functionality. Since this testing takes quite a bit of time (typically more than running all of binutils, gas, and ld testsuites together), restrict the testing to native configurations only.
2022-12-21enable-non-contiguous-regions warningsAlan Modra18-66/+59
The warning about discarded sections in elf_link_input_bfd doesn't belong there since the code is dealing with symbols. Multiple symbols in a discarded section will result in multiple identical warnings about the section. Move the warning to a new function in ldlang.c. The patch also tidies the warning quoting of section and file names, consistently using `%pA' and `%pB'. I'm no stickler for one style of section and file name quoting, but they ought to be consistent within a warning, eg. see the first one fixed in ldlang.c, and when a warning is emitted for multiple targets they all ought to use exactly the same format string to reduce translation work. elf64-ppc.c loses the build_one_stub errors since we won't get there before hitting the fatal errors in size_one_stub. bfd/ * elflink.c (elf_link_input_bfd): Don't warn here about discarded sections. * elf32-arm.c (arm_build_one_stub): Use consistent style in --enable-non-contiguous-regions error. * elf32-csky.c (csky_build_one_stub): Likewise. * elf32-hppa.c (hppa_build_one_stub): Likewise. * elf32-m68hc11.c (m68hc11_elf_build_one_stub): Likewise. * elf32-m68hc12.c (m68hc12_elf_build_one_stub): Likewise. * elf32-metag.c (metag_build_one_stub): Likewise. * elf32-nios2.c (nios2_build_one_stub): Likewise. * elfnn-aarch64.c (aarch64_build_one_stub): Likewise. * xcofflink.c (xcoff_build_one_stub): Likewise. * elf64-ppc.c (ppc_size_one_stub): Likewise. (ppc_build_one_stub): Delete dead code. ld/ * ldlang.c (lang_add_section): Use consistent style in --enable-non-contiguous-regions warnings. (size_input_section): Likewise. (warn_non_contiguous_discards): New function. (lang_process): Call it. * testsuite/ld-arm/non-contiguous-arm.d: Update. * testsuite/ld-arm/non-contiguous-arm4.d: Update. * testsuite/ld-arm/non-contiguous-arm7.d: Add --enable-non-contiguous-regions-warnings. * testsuite/ld-arm/non-contiguous-arm7.err: New. * testsuite/ld-powerpc/non-contiguous-powerpc.d: Update. * testsuite/ld-powerpc/non-contiguous-powerpc64.d: Update.
2022-12-21PR29922, SHT_NOBITS section avoids section size sanity checkAlan Modra1-3/+9
PR 29922 * dwarf2.c (find_debug_info): Ignore sections without SEC_HAS_CONTENTS.
2022-12-21sim: fully merge sim_cpu_base into sim_cpuMike Frysinger1-26/+19
Now that all ports have migrated to the new framework, drop support for the old sim_cpu_base layout. There's a lot of noise here, so it's been split into a dedicated commit.
2022-12-21sim: enable common sim_cpu usage everywhereMike Frysinger29-66/+1
All ports should be migrated now. Drop the SIM_HAVE_COMMON_SIM_CPU knob and require it be used everywhere now.
2022-12-21sim: or1k: invert sim_cpu storageMike Frysinger5-30/+43
The cpu.h change is in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: m32r: invert sim_cpu storageMike Frysinger5-14/+10
The cpu*.h changes are in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: lm32: invert sim_cpu storageMike Frysinger3-12/+7
The cpu.h change is in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: iq2000: invert sim_cpu storageMike Frysinger3-11/+7
The cpu.h change is in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: frv: invert sim_cpu storageMike Frysinger3-23/+18
The cpu.h change is in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: cris: invert sim_cpu storageMike Frysinger6-239/+244
The cpu*.h changes are in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: bpf: invert sim_cpu storageMike Frysinger3-7/+13
The cpu.h change is in generated cgen code, but that has been sent upstream too, so the next regen should include it automatically.
2022-12-21sim: cgen: prep for inverting sim_cpu storageMike Frysinger2-0/+15
Some common cgen code changes to allow cgen ports to invert their sim_cpu storage one-by-one.
2022-12-21sim: riscv: invert sim_cpu storageMike Frysinger3-191/+258
2022-12-21sim: pru: invert sim_cpu storageMike Frysinger3-8/+31
2022-12-21sim: example-synacor: invert sim_cpu storageMike Frysinger3-37/+47
2022-12-21sim: h8300: invert sim_cpu storageMike Frysinger2-34/+36
2022-12-21sim: m68hc11: invert sim_cpu storageMike Frysinger10-354/+446
2022-12-21sim: mips: invert sim_cpu storageMike Frysinger2-73/+90
2022-12-21sim: v850: invert sim_cpu storageMike Frysinger3-20/+23
2022-12-21sim: mcore: invert sim_cpu storageMike Frysinger2-27/+41
2022-12-21sim: aarch64: invert sim_cpu storageMike Frysinger5-108/+152
2022-12-21sim: microblaze: invert sim_cpu storageMike Frysinger3-8/+8
2022-12-21sim: avr: invert sim_cpu storageMike Frysinger2-99/+108
2022-12-21sim: moxie: invert sim_cpu storageMike Frysinger2-14/+13
2022-12-21sim: msp430: invert sim_cpu storageMike Frysinger3-120/+106
2022-12-21sim: ft32: invert sim_cpu storageMike Frysinger3-95/+99
2022-12-21sim: bfin: invert sim_cpu storageMike Frysinger2-10/+5
2022-12-20sim: sim_cpu: invert sim_cpu storageMike Frysinger7-39/+45
Currently all ports have to declare sim_cpu themselves in their sim-main.h and then embed the common sim_cpu_base in it. This dynamic makes it impossible to share common object code among multiple ports because the core data structure is always different. Let's invert this relationship: common code declares sim_cpu, and the port uses the new arch_data field for its per-cpu state. This is the first in a series of changes: it adds a define to select between the old & new layouts, then converts all the ports that don't need custom state over to the new layout. This includes mn10300 that, while it defines custom fields in its cpu struct, never uses them.
2022-12-20sim: move register headers into sim/ namespace [PR sim/29869]Mike Frysinger39-24/+24
These headers define the register numbers for each port to implement the sim_fetch_register & sim_store_register interfaces. While gdb uses these, the APIs are part of the sim, not gdb. Move the headers out of the gdb/ include namespace and into sim/ instead.
2022-12-20sim: ppc: drop old dgen.c generatorMike Frysinger3-363/+6
The spreg.[ch] files live in the source tree now and are created with the dgen.py script, so we don't need this old tool anymore.
2022-12-20sim: ppc: move spreg.[ch] files to the source treeMike Frysinger5-0/+1608
Simplify the build by moving the generation of these files from build-time (via dgen.c that we have to compile & execute on the build system) to maintainer/release mode (via spreg-gen.py that we only ever execute when the spreg table actually changes). It speeds up the build process and makes it easier for us to reason about & review changes to the code generator. The tool is renamed from "dgen" because it's hardcoded to only generated spreg files. It isn't a generalized tool for creating lookup tables.
2022-12-21Automatic date update in version.inGDB Administrator1-1/+1
2022-12-20Fix install-strip targetHannes Domani1-2/+2
The libtool patch broke install-strip of gdb: /bin/sh ../../gdb/../mkinstalldirs /src/gdb/inst/share/gdb/python/gdb transformed_name=`t='s,y,y,'; \ echo gdb | sed -e "$t"` ; \ if test "x$transformed_name" = x; then \ transformed_name=gdb ; \ else \ true ; \ fi ; \ /bin/sh ../../gdb/../mkinstalldirs /src/gdb/inst/bin ; \ /bin/sh ./libtool --mode=install STRIPPROG='strip' /bin/sh /src/gdb/gdb.git/install-sh -c -s \ gdb \ /src/gdb/inst/bin/$transformed_name ; \ /bin/sh ../../gdb/../mkinstalldirs /src/gdb/inst/include/gdb ; \ /usr/bin/install -c -m 644 jit-reader.h /src/gdb/inst/include/gdb/jit-reader.h libtool: install: `/src/gdb/inst/bin/gdb' is not a directory libtool: install: Try `libtool --help --mode=install' for more information. Since INSTALL_PROGRAM_ENV is no longer at the beginning of the command, the gdb executable is not installed with install-strip.
2022-12-20bfd: Discard symbol regardless of warning flagTorbjörn SVENSSON5-5/+58
The discard of symbols should be performed whether the warning for the discard is enabled or not. Without this patch, ld would segfault in bfd_section_removed_from_list, called in the if-statement right after this block, as the argument isec->output_section can be NULL. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
2022-12-20PR29915, bfdio.c does not compile with mingw.org's MinGWAlan Modra4-6/+22
PR 29915 * configure.ac: Add AC_CHECK_DECLS test ___lc_codepage_func. * configure: Regenerate. * config.in: Regenerate. * bfdio.c (___lc_codepage_func): Move declaration to.. (_bfd_real_fopen): ..here, and use !HAVE_DECL____LC_CODEPAGE_FUNC.
2022-12-20Re: x86: remove i386-opc.cAlan Modra1-1/+0
Regen opcodes/po/POTFILES.in
2022-12-19sim: ppc: change spreg switch table generation to compile-timeMike Frysinger4-15/+16
Simplify the generator by always outputting the switch tables, and leave the choice of whether to use them to the compiler via a -D flag.
2022-12-19sim: dv-core: add hw_detach_address method [PR sim/25211]Mike Frysinger2-13/+18
The core device has an attach address method as the root of the tree which calls out to the sim API. But it doesn't have a corresponding detach method which means we just crash if anything tries to detach itself from the core. In practice, the m68hc11 is the only model that actually tries to detach itself on the fly, so no one noticed earlier. With this in place, we can delete the existing detach code from the m68hc11 model since it defaults to "passthru" callback which will in turn call the dv-core detach, and they have the same behavior -- call the sim core API to detach from the address space. Bug: https://sourceware.org/PR25211
2022-12-19gprofng: PR29646 Various warningsVladimir Mezentsev10-13/+22
gprofng/ChangeLog 2022-12-19 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29646 * common/core_pcbe.c: Fix missingReturn warning. * libcollector/iolib.c: Fix -Waddress warnings. * src/Settings.cc: Likewise. * src/checks.cc: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/iotrace.c: Fix va_end_missing error. * libcollector/libcol_util.c: Fix uninitvar warning. * src/Command.cc: Fix arrayIndexOutOfBounds error. * src/Function.cc: Fix uninitStructMember warning. * src/ipc.cc: Fix -Wwrite-strings warnings.
2022-12-20Automatic date update in version.inGDB Administrator1-1/+1