summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Automatic date update in version.inGDB Administrator2022-11-011-1/+1
|
* Add missing TYPE_CODE_* constants to PythonTom Tromey2022-10-316-170/+173
| | | | | | | | A user noticed that TYPE_CODE_FIXED_POINT was not exported by the gdb Python layer. This patch fixes the bug, and prevents future occurences of this type of bug.
* Remove REPARSE condition to force hardware resource checking when updating ↵Carl Love2022-10-311-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | watchpoints Currently the resource checking is done if REPARSE is true. The hardware watchpoint resource checking in update_watchpoint needs to be redone on each call to function update_watchpoints as the value chain may have changed. The number of hardware registers needed for a watchpoint can change if the variable being watched changes. This situation occurs in this test when watching variable **global_ptr_ptr. Initially when the watch command is issued, only two addresses need to be watched as **global_ptr_ptr has not yet been initialized. Once the value of **global_ptr_ptr is initialized the locations to be tracked increase to three addresses. However, update_watchpoints is not called again with REPARSE set to 1 to force the resource checking to be redone. When the test is run on Power 10, an internal gdb error occurs when the PowerPC routine tries to setup the three hardware watchpoint address since the hw only has two hardware watchpoint registers. The error occurs because the resource checking was not redone in update_watchpoints after **global_ptr_ptr changed. The following descibes the situation in detail that occurs on Power 10 with gdb running on the binary for gdb.base/watchpoint.c. 1 break func4 2 run 3 watch *global_ptr 4 next execute source code: buf[0] = 3; 5 next execute source code: global_ptr = buf; 6 next execute source code: buf[0] = 7; 7 delete 2 (delete watch *global_ptr) 8 watch **global_ptr_ptr 9 next execute source code: buf[1] = 5; 10 next global_ptr_ptr = &global_ptr; 11 next buf[0] = 9; In step 8, the the watch **global_ptr_prt command calls update_watchpoint in breakpoint.c with REPARSE set to 1. The function update_watchpoint calls can_use_hardware_watchpoint to see if there are enough resources available to add the watchpoint since REPARSE is set to 1. At this point, **global_ptr_ptr has not been initialized so only two addresses are watched. The val_chain contains the address for **global_ptr_ptr and 0 since **global_ptr_ptr has not been initialized. The update_watchpoint updates the breakpoint list as follows: breakpoint 0 loc 0: b->address = 0x100009c0 breakpoint 1 loc 1: b->address = 0x7ffff7f838a0 breakpoint 2 loc 2: b->address = 0x7ffff7b7fc54 breakpoint 3 loc 3: b->address = 0x7ffff7a5788c breakpoint 4 loc 4: b->address = 0x0 <-- location pointed to by global_ptr_ptr loc 5: b->address = 0x100200b8 <-- global_ptr_ptr watchpoint breakpoint 5 loc 6: b->address = 0x7ffff7b7fc54 In step 10, the next command executes the source code global_ptr_ptr = &global_ptr. This changes the set of locations to be watched for the watchpoint **global_ptr_prt. The list of addresses for the breakpoint consist of the address for global_ptr_prt, global_ptr and buf. The breakpoint list gets updated by update_watchpoint as follows: breakpoint 0 loc 0: b->address = 0x100009c0 breakpoint 1 loc 1: b->address = 0x7ffff7f838a0 breakpoint 2 loc 2: b->address = 0x7ffff7b7fc54 breakpoint 3 loc 3: b->address = 0x7ffff7a5788c breakpoint 4 loc 4: b->address = 0x10020050 buf loc 5: b->address = 0x100200b0 watch *global_ptr loc 6: b->address = 0x100200b8 watch **global_ptr_ptr breakpoint 5 loc 7: b->address = 0x7ffff7b7fc54 breakpoint 6 However, the hardware resource checking was not redone because update_breakpoint was called with REPARSE equal to 0. Step 11, execute the third next command. The function ppc_linux_nat_target::low_prepare_to_resume() attempts a ptrace call to setup each of the three address for breakpoint 4. The slot value returned for the third ptrace call is -1 indicating an error because there are only two hardware watchpoint registers available on Power 10. This patch removes just the statement "if (reparse)" in function update_watchpoint to force the resources to be rechecked on every call to the function. This ensures that any changes to the val_chain resulting in needing more resources then available will be caught. The patch has been tested on Power 8, Power 10 and X86-64. Note the patch has no effect on Power 9 since hardware watchpoint support is disabled on that processor.
* PowerPC, add support for recording pipe2 system call.Carl Love2022-10-311-0/+2
| | | | | | | | | | | | | | | Test gdb.reverse/pipe-reverse.exp fails on Power 10 running the fedora 36 distro. The gdb record error message is: Process record and replay target doesn't support syscall number 317. System call 317 on PowerPC maps to the pipe2 system call. This patch adds support for the missing pipe2 system call for PowerPC. Patch fixes the test failure in gdb.reverse/pipe-reverse.exp. The patch has been tested on Power 10 with no regression failures.
* x86: minor improvements to optimize_imm() (part III)Jan Beulich2022-10-313-15/+8
| | | | | | | | | Earlier tidying still missed an opportunity: There's no need for the "anyimm" static variable. Instead of using it in the loop to mask "allowed" (which is necessary to satisfy operand_type_or()'s assertions) simply use "mask", requiring it to be calculated first. That way the post-loop masking by "mask" ahead of the operand_type_all_zero() can be dropped.
* sim: reg: constify store helperMike Frysinger2022-10-3138-46/+48
| | | | These functions only read from memory, so mark the pointer as const.
* sim: constify various integer readersMike Frysinger2022-10-3116-24/+24
| | | | These functions only read from memory, so mark the pointer as const.
* sim: cgen: constify GETT helpersMike Frysinger2022-10-311-2/+2
| | | | These functions only read from memory, so mark the pointer as const.
* sim: common: change sim_read & sim_write to use void* buffersMike Frysinger2022-10-3121-88/+97
| | | | | | | When reading/writing arbitrary data to the system's memory, the unsigned char pointer type doesn't make that much sense. Switch it to void so we align a bit with standard C library read/write functions, and to avoid having to sprinkle casts everywhere.
* x86: Silence GCC 12 warning on tc-i386.cH.J. Lu2022-10-312-5/+5
| | | | | | | | | | | | Silence GCC 12 warning on tc-i386.c: gas/config/tc-i386.c: In function ‘md_assemble’: gas/config/tc-i386.c:5039:16: error: too many arguments for format [-Werror=format-extra-args] 5039 | as_warn (_("only support RIP-relative address"), i.tm.name); * config/tc-i386.c (md_assemble): Print mnemonic in RIP-relative warning. * estsuite/gas/i386/x86-64-prefetchi-warn.l: Updated.
* Use enum for gdbarch's call_dummy_locationTom Tromey2022-10-315-9/+13
| | | | | | | This changes gdbarch to use an enum for call_dummy_location, providing a little more type safety.
* Inline initialization of gdbarch membersTom Tromey2022-10-313-206/+111
| | | | | | | | | This changes gdbarch to use the "predefault" to initialize its members inline. This required changing a couple of the Value instantiations to avoid a use of "gdbarch" during initialization, but on the whole I think this is better -- it removes a hidden ordering dependency.
* Fix regression in pointer-to-member printingTom Tromey2022-10-313-1/+13
| | | | | | | | | | | | | | | PR c++/29243 points out that "info func" on a certain C++ executable will cause an infinite loop in gdb. I tracked this down to a bug introduced by commit 6b5a7bc76 ("Handle member pointers directly in generic_value_print"). Before this commit, the C++ code to print a member pointer would wind up calling value_print_scalar_formatted; but afterward it simply calls generic_value_print and gets into a loop. This patch restores the previous behavior and adds a regression test.
* Updated Romainain translation for the binutils sub-directory and Swedish ↵Nick Clifton2022-10-313-5630/+6636
| | | | translations for the ld and opcodes sub-directories.
* Support Intel PREFETCHICui, Lili2022-10-3119-4144/+4366
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gas/ChangeLog: * NEWS: Add support for Intel PREFETCHI instruction. * config/tc-i386.c (load_insn_p): Use prefetch* to fold all prefetches. (md_assemble): Add warning for illegal input of PREFETCHI. * doc/c-i386.texi: Document .prefetchi. * testsuite/gas/i386/i386.exp: Run PREFETCHI tests. * testsuite/gas/i386/x86-64-lfence-load.d: Add PREFETCHI. * testsuite/gas/i386/x86-64-lfence-load.s: Likewise. * testsuite/gas/i386/x86-64-prefetch.d: New test. * testsuite/gas/i386/x86-64-prefetchi-intel.d: Likewise. * testsuite/gas/i386/x86-64-prefetchi-inval-register.d: Likewise.. * testsuite/gas/i386/x86-64-prefetchi-inval-register.s: Likewise. * testsuite/gas/i386/x86-64-prefetchi-warn.l: Likewise. * testsuite/gas/i386/x86-64-prefetchi-warn.s: Likewise. * testsuite/gas/i386/x86-64-prefetchi.d: Likewise. * testsuite/gas/i386/x86-64-prefetchi.s: Likewise. opcodes/ChangeLog: * i386-dis.c (reg_table): Add MOD_0F18_REG_6 and MOD_0F18_REG_7 (x86_64_table): Add X86_64_0F18_REG_6_MOD_0 and X86_64_0F18_REG_7_MOD_0. (mod_table): Add MOD_0F18_REG_6 and MOD_0F18_REG_7. (prefix_table): Add PREFIX_0F18_REG_6_MOD_0_X86_64 and PREFIX_0F18_REG_7_MOD_0_X86_64. (PREFETCHI_Fixup): New. * i386-gen.c (cpu_flag_init): Add CPU_PREFETCHI_FLAGS. (cpu_flags): Add CpuPREFETCHI. * i386-opc.h (CpuPREFETCHI): New. (i386_cpu_flags): Add cpuprefetchi. * i386-opc.tbl: Add Intel PREFETCHI instructions. * i386-init.h: Regenerated. * i386-tbl.h: Likewise.
* gdb/testsuite: fix gdb.cp/converts.exp to run with clangBruno Larsen2022-10-311-1/+1
| | | | | | | | | | Clang attempts to minimize the size of the debug-info by not adding complete information about types that aren't constructed in a given file. Specifically, this meant that there was minimal information about class B in the test gdb.cp/converts.exp. To fix this, we just need to construct any object of type B in that file. Approved-By: Andrew Burgess <aburgess@redhat.com>
* gdb/testsuite: add XFAIL to gdb.cp/ptype-flags.exp when using clangBruno Larsen2022-10-311-0/+12
| | | | | | | | | When running gdb.cp/ptype-flags.exp using Clang, we get an unexpected failure when printing the type of a class with an internal typedef. This happens because Clang doesn't add accessibility information for typedefs inside classes (see https://github.com/llvm/llvm-project/issues/57608 for more info). To help with Clang testing, an XFAIL was added to this test.
* RX assembler: switch arguments of thw MVTACGU insn.Yoshinori Sato2022-10-315-12/+21
|
* objdump: Add configure time option to enable colored disassembly output by ↵Nick Clifton2022-10-317-20/+106
| | | | | | | | | | | | default. PR 29457 * configure.ac: Add --enable-colored-disassembly. * objdump.c: Add --disassembler-color=terminal. * doc/binutils.texi (objdump): Document the new option. * NEWS: Mention new feature. * config.in: Regenerate in. * configure: Regenerate.
* ld: Add publics stream to PDB filesMark Harmstone2022-10-316-8/+559
|
* ld: Add section header stream to PDB filesMark Harmstone2022-10-312-3/+189
|
* ld: Use %E in einfo in pdb.cMark Harmstone2022-10-311-10/+9
| | | | | Resubmission, taking into account https://sourceware.org/pipermail/binutils/2022-October/123948.html.
* Automatic date update in version.inGDB Administrator2022-10-311-1/+1
|
* Pool section entries for DWP version 1Alan Modra2022-10-301-49/+41
| | | | | | | | | | | | | | | | | Ref: https://gcc.gnu.org/wiki/DebugFissionDWP?action=recall&rev=3 Fuzzers have found a weakness in the code stashing pool section entries. With random nonsensical values in the index entries (rather than each index pointing to its own set distinct from other sets), it's possible to overflow the space allocated, losing the NULL terminator. Without a terminator, find_section_in_set can run off the end of the shndx_pool buffer. Fix this by scanning the pool directly. binutils/ * dwarf.c (add_shndx_to_cu_tu_entry): Delete range check. (end_cu_tu_entry): Likewise. (process_cu_tu_index): Fill shndx_pool by directly scanning pool, rather than indirectly from index entries.
* Automatic date update in version.inGDB Administrator2022-10-301-1/+1
|
* gdb/testsuite: Wrap `param_integer_error' in gdb.guile/scm-parameter.expMaciej W. Rozycki2022-10-291-1/+3
| | | | | Wrap an overlong line in the definition of `param_integer_error' in gdb.guile/scm-parameter.exp. No functional change.
* sim/sh: Remove redundant function declarationTsukasa OI2022-10-291-2/+0
| | | | | | | | | | | Clang generates a warning if there is a function declaration/definition with zero arguments. Such declarations/definitions without a prototype (an argument list) are deprecated forms of indefinite arguments ("-Wdeprecated-non-prototype"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). But there is another issue. This function declaration in sim/sh/interp.c is completely redundant. This commit just removes that declaration.
* sim/m32r: Initialize "list" variableTsukasa OI2022-10-291-1/+1
| | | | | | | | The variable "list" is only initialized when arg1 > 0 and when arg1 == 0, an uninitialized value is passed to translate_endian_h2t function. Although this behavior is harmless, this commit adds initialization to avoid a GCC warning ("-Wmaybe-uninitialized").
* sim/erc32: Use int32_t as IRQ callback argumentTsukasa OI2022-10-293-6/+6
| | | | | | | | | | | | | | | Clang generates a warning if an argument is passed to a function without prototype (zero arguments, even without (void)). Such calls are deprecated forms of indefinite arguments passing ("-Wdeprecated-non-prototype"). On the default configuration, it (somehow) doesn't cause a build failure but a warning is generated. But because the cause is the same as the issue the author fixed in "sim/erc32: Use int32_t as event callback argument", it would be better to fix it now to prevent problems in the future. To fix the issue, this commit makes struct irqcall to use int32_t as a callback (callback) argument of an IRQ.
* sim/erc32: Use int32_t as event callback argumentTsukasa OI2022-10-294-23/+23
| | | | | | | | | | | | Clang generates a warning if an argument is passed to a function without prototype (zero arguments, even without (void)). Such calls are deprecated forms of indefinite arguments passing ("-Wdeprecated-non-prototype"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). To fix that, this commit makes struct evcell to use int32_t as a callback (cfunc) argument of an event. int32_t is chosen because "event" function accepts "int32_t arg".
* sim/erc32: Insert void parameterTsukasa OI2022-10-291-3/+3
| | | | | | | | | | Clang generates a warning if there is a function declaration/definition with zero arguments. Such declarations/definitions without a prototype (an argument list) are deprecated forms of indefinite arguments ("-Wdeprecated-non-prototype"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). This commit replaces () with (void) to avoid this warning.
* [gdb/testsuite] Use ssh -t in remote-*.expTom de Vries2022-10-292-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | When running test-case gdb.server/multi-ui-errors.exp on target board remote-gdbserver-on-localhost.exp, I run into: ... (gdb) PASS: gdb.server/multi-ui-errors.exp: connect to gdbserver continue^M Continuing.^M PASS: gdb.server/multi-ui-errors.exp: continue - extra UI Remote debugging from host ::1, port 35466^M FAIL: gdb.server/multi-ui-errors.exp: ensure inferior is running ... The problem is that the target board uses ssh -T, which fails to guarantee that output from the inferior will be available. Fix this by copying proc ${board}_spawn from local-remote-host.exp, which ensures using ssh -t. [ It would be nice to define an ssh base board to get rid of the copies, but I'm not addressing that in this commit. ] Likewise for target board remote-stdio-gdbserver.exp. Tested on x86_64-linux.
* [gdb/testsuite] Fix gdb.server/multi-ui-errors.exp with local-remote-host-nottyTom de Vries2022-10-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With test-case gdb.server/multi-ui-errors.exp and host board local-remote-host-notty, I run into: ... (gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI Executing on target: kill -9 29666 (timeout = 300) builtin_spawn -ignore SIGHUP kill -9 29666^M echo^M Remote connection closed^M (gdb) (gdb) FAIL: gdb.server/multi-ui-errors.exp: \ main UI, prompt after gdbserver dies (timeout) ... In contrast, with local-remote-host (so, everything the same but editing off): ... (gdb) PASS: gdb.server/multi-ui-errors.exp: interact with GDB's main UI Executing on target: kill -9 31245 (timeout = 300) builtin_spawn -ignore SIGHUP kill -9 31245^M Remote connection closed^M (gdb) echo^M (gdb) PASS: gdb.server/multi-ui-errors.exp: main UI, prompt after gdbserver dies ... The test-case issues a kill, which results in a "Remote connection closed" message and a prompt. The problem is that the prompt is not consumed, so the subsequent echo may be issued before that prompt, which causes a mismatch when matching the result of the echo. Fix this by consuming the "Remote connection closed" message and prompt. Tested on x86_64-linux.
* [gdb/testsuite] Consume output asap in gdb.server/multi-ui-errors.expTom de Vries2022-10-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | With test-case gdb.server/multi-ui-errors.exp we see: ... (gdb) PASS: multi-ui-errors.exp: main UI, prompt after gdbserver dies continue^M Continuing.^M echo^M (gdb) PASS: multi-ui-errors.exp: extra UI, prompt after gdbserver dies ... The continue is issued earlier in the test-case, but the output has not been consumed, which makes it show up much later. Consume the continue output asap, to make it clear when the continue is issued: ... (gdb) PASS: gdb.server/multi-ui-errors.exp: connect to gdbserver continue^M Continuing.^M PASS: gdb.server/multi-ui-errors.exp: continue - extra UI ... Tested on x86_64-linux.
* [gdb/testsuite] Remove REMOTE_PORTNUM in remote-stdio-gdbserver.expTom de Vries2022-10-291-12/+3
| | | | | | | | | | | | | | | | | | | | | | | The usage for board remote-stdio-gdbserver.exp is advertised as: ... # bash$ make check RUNTESTFLAGS="--target_board=remote-stdio-gdbserver \ # REMOTE_USERNAME=... REMOTE_HOSTNAME=... REMOTE_PORTNUM=... \ # [REMOTE_TMPDIR=${remote_dir}] [GDBSERVER=${remote_gdbserver}]" ... but when adding REMOTE_PORTNUM=22, I run into: ... Running stop-reply-no-thread-multi.exp ... ERROR: tcl error sourcing stop-reply-no-thread-multi.exp. ERROR: couldn't execute "/usr/bin/ssh -p22": no such file or directory while executing "builtin_spawn {/usr/bin/ssh -p22} -l vries localhost {/usr/bin/gdbserver \ --once localhost:2346 \ /home/vries/gdb_versions/devel/build/gdb/testsuite/outp..." ... Fix this by simply removing REMOTE_PORTNUM. Tested on x86_64-linux.
* sim, sim/{m32c,ppc,rl78}: Use getopt_longTsukasa OI2022-10-295-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | Because of a Libiberty hack, getopt on GNU libc (2.25 or earlier) is currently unusable on sim, causing a regression on CentOS 7. This is caused as follows: 1. If HAVE_DECL_GETOPT is defined (getopt declaration with known prototype is detected while configuration), a declaration of getopt in "include/getopt.h" is suppressed. The author started to define HAVE_DECL_GETOPT in sim with the commit 340aa4f6872c ("sim: Check known getopt definition existence"). 2. GNU libc (2.25 or earlier)'s <unistd.h> includes <getopt.h> with a special purpose macro defined to declare only getopt function but due to include path (not tested while configuration), it causes <unistd.h> to include Libiberty's "include/getopt.h". 3. If both 1. and 2. are satisfied, despite that <unistd.h> tries to declare getopt by including <getopt.h>, "include/getopt.h" does not do so, causing getopt function undeclared. Getting rid of "include/getopt.h" (e.g. renaming this header file) is the best solution to avoid hacking but as a short-term solution, this commit replaces getopt with getopt_long under sim/.
* pef: sanity check before mallocAlan Modra2022-10-291-5/+7
| | | | | | | | And do the sanity check in a way that can't overflow. * pef.c (bfd_pef_parse_function_stubs): Sanity check header imported_library_count and total_imported_symbol_count before allocating memory.
* Fix small objcopy memory leakAlan Modra2022-10-291-0/+1
| | | | * objcopy.c (copy_archive): Free l->name.
* NULL dereference read in som_write_object_contentsAlan Modra2022-10-291-2/+3
| | | | | | | | | objcopy copy_object may omit the call to bfd_copy_private_bfd_data for various conditions deemed non-fatal, in which case obj_som_exec_data will be NULL for the output file. * som.c (som_finish_writing): Don't dereference NULL obj_som_exec_data.
* RISC-V: Always generate mapping symbols at the start of the sections.Nelson Chu2022-10-293-41/+0
| | | | | | | | | | | | Before figuring out the suppress rule of mapping symbol with architecture (changed back to $x), always generate them at the start of the sections. gas/ * config/tc-riscv.c (need_arch_map_symbol): Removed. (riscv_mapping_state): Updated. (riscv_check_mapping_symbols): Updated. * testsuite/gas/riscv/mapping-non-arch.d: Removed. * testsuite/gas/riscv/mapping-non-arch.s: Likewise.
* Automatic date update in version.inGDB Administrator2022-10-291-1/+1
|
* gas: NEWS: Note support for RISC-V ZawrsPalmer Dabbelt2022-10-281-0/+2
| | | | | This has been supported since eb668e50036 ("RISC-V: Add Zawrs ISA extension support").
* gas: NEWS: Add a missing newlinePalmer Dabbelt2022-10-281-0/+1
|
* Convert compunit_language to a methodTom Tromey2022-10-286-17/+16
| | | | | | This changes compunit_language to be a method on compunit_symtab. Approved-By: Simon Marchi <simon.marchi@efficios.com>
* RISC-V: Improve "bits undefined" diagnosticsTsukasa OI2022-10-281-2/+2
| | | | | | | | | | | | This commit improves internal error message "internal: bad RISC-V opcode (bits 0x%lx undefined): %s %s" to display actual unused bits (excluding non-instruction bits). gas/ChangeLog: * config/tc-riscv.c (validate_riscv_insn): Exclude non- instruction bits from displaying internal diagnostics. Change error message slightly.
* RISC-V: Fallback for instructions longer than 64bTsukasa OI2022-10-281-5/+8
| | | | | | | | | | | | | We don't support instructions longer than 64-bits yet. Still, we can modify validate_riscv_insn function to prevent unexpected behavior by limiting the "length" of an instruction to 64-bit (or less). gas/ChangeLog: * config/tc-riscv.c (validate_riscv_insn): Fix function description comment based on current spec. Limit instruction length up to 64-bit for now. Make sure that required_bits does not corrupt even if unsigned long long is longer than 64-bit.
* RISC-V/gas: fix build with certain gcc versionsJan Beulich2022-10-281-7/+7
| | | | | | | Some versions of gcc warn by default about shadowed outer-scope declarations. This affects frag_align_code, which is declared in frags.h. Rename the offending function parameter. While there also switch to using true/false at the function call sites.
* RISC-V: Fix build failure for -Werror=maybe-uninitializedTsukasa OI2022-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 40f1a1a4564b ("RISC-V: Output mapping symbols with ISA string.") caused a build failure on GCC 12 as follows: make[3]: Entering directory '$(builddir)/gas' CC config/tc-riscv.o In file included from $(srcdir)/gas/config/tc-riscv.c:23: $(srcdir)/gas/as.h: In function ‘make_mapping_symbol’: $(srcdir)/gas/as.h:123:15: error: ‘buff’ may be used uninitialized [-Werror=maybe-uninitialized] 123 | #define xfree free | ^~~~ $(srcdir)/gas/config/tc-riscv.c:487:9: note: ‘buff’ was declared here 487 | char *buff; | ^~~~ cc1: all warnings being treated as errors make[3]: *** [Makefile:1425: config/tc-riscv.o] Error 1 This is caused by a false positive of "maybe uninitialized" variable detection (-Wmaybe-uninitialized). To avoid this error, this commit initializes the local variable buff to NULL first in all cases. gas/ChangeLog: * config/tc-riscv.c (make_mapping_symbol): Initialize variable buff with NULL to avoid build failure caused by a GCC's false positive of maybe uninitialized variable detection.
* gdb, btrace: fix family and model computationMarkus Metzger2022-10-281-2/+4
| | | | | | | | In gdb/nat/linux-btrace.c:btrace_this_cpu() we initialize the cpu structure given to the libipt btrace decoder. We only consider the extended model field for family 0x6 and forget about family 0xf and we don't consider the extended family field. Fix it.
* include: Define macro to ignore -Wdeprecated-declarations on GCCTsukasa OI2022-10-281-0/+3
| | | | | | | | | | | | | | | | | | "-Wdeprecated-declarations" warning option can be helpful to track deprecated function delarations but sometimes we need to disable this warning for a good reason. DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS is an existing macro but only defined on Clang. Since "-Wdeprecated-declarations" is also available on GCC (>= 3.4.0), this commit adds equivalent definition as Clang. __GNUC__ and __GNUC_MINOR__ are not checked because this header file seems to assume GCC >= 4.6 (with "GCC diagnostic push/pop"). include/ChangeLog: * diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS): Define also on GCC.