- Dec 11, 2019
-
-
Alan Modra authored
cpu/ * epiphany.cpu (f-sdisp11): Don't sign extend with shifts. * lm32.cpu (f-branch, f-vall): Likewise. * m32.cpu (f-lab-8-16): Likewise. opcodes/ * arc-dis.c (BITS): Don't truncate high bits with shifts. * nios2-dis.c (nios2_print_insn_arg): Don't sign extend with shifts. * tic54x-dis.c (print_instruction): Likewise. * tilegx-opc.c (parse_insn_tilegx): Likewise. * tilepro-opc.c (parse_insn_tilepro): Likewise. * visium-dis.c (disassem_class0): Likewise. * pdp11-dis.c (sign_extend): Likewise. (SIGN_BITS): Delete. * epiphany-ibld.c: Regenerate. * lm32-ibld.c: Regenerate. * m32c-ibld.c: Regenerate.
-
Alan Modra authored
Aimed at quietening ubsan. include/ * opcode/mmix.h (PUSHGO_INSN_BYTE): Make unsigned. (GO_INSN_BYTE, SETL_INSN_BYTE, INCML_INSN_BYTE, INCMH_INSN_BYTE), (INCH_INSN_BYTE, SWYM_INSN_BYTE, JMP_INSN_BYTE): Likewise. bfd/ * elf32-rx.c (elf32_rx_relax_section): Avoid signed overflow. * libaout.h (N_SET_INFO, N_SET_FLAGS): Likewise. * netbsd.h (write_object_contents): Likewise. * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Likewise. * libhppa.h (HPPA_R_CONSTANT): Don't signed extend with shifts. (stm32l4xx_create_replacing_stub_vldm): Don't truncate high bits with shifts. * elf32-nds32.h (R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG): Define using 1u shifted left. Ditto for other macros. * mmo.c (LOP): Make unsigned.
-
Alan Modra authored
And similarly for bfd_get_signed_8. bfd/ * libbfd.c (bfd_get_8): Return a bfd_vma. (bfd_get_signed_8): Return a bfd_signed_vma. * bfd-in2.h: Regenerate. binutils/ * od-xcoff.c (dump_dumpx_core): Adjust for bfd_h_get_8 change.
-
Jan Beulich authored
In ("x86: extend SSE check to PCLMULQDQ, AES, and GFNI insns") I went both a little too far and not quite far enough: - GFNI insns also have AVX512 variants, which also shouldn't get diagnosed, - SSE4a insns should get diagnosed just like SSE4.x ones, - SHA insns should get diagnosed just like PCLMULQDQ or AES ones.
-
Philippe Waroquiers authored
The option framework documentation was speaking about a 'print -raw' option, but this option does not exist. This patch implements -raw-values option that tells to ignore the active pretty printers when printing a value. As we already have -raw-frame-arguments, I thought -raw-values was more clear, in particular to differentiate set print raw-values and set print raw-frame-arguments. gdb/doc/ChangeLog 2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.texinfo (Command Options): Use -p and -pretty in the example, as -r is ambiguous. Update the print - TAB TAB completion result. (Data): Document new option -raw-values. Use -p and -pretty in the example, as -r is ambiguous. (Print Settings): Document set print raw values. (Pretty-Printer Commands): Document interaction between enabled pretty printers and -raw-values/-raw-frame-arguments. gdb/ChangeLog 2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be> * NEWS: Document -raw-values option and the related setting commands. * printcmd.c (print_command_parse_format): Do not set opts->raw off, only set it on when /r is given. * valprint.c (value_print_option_defs): New element raw-values. * Makefile.in: Add the new file. gdb/testsuite/ChangeLog 2019-12-11 Philippe Waroquiers <philippe.waroquiers@skynet.be> * gdb.base/options.exp: Add -raw-values in the print completion list. * gdb.python/py-prettyprint.exp: Add tests for -raw-values.
-
Alan Modra authored
* ns32k-dis.c (sign_extend): Correct last patch.
-
Alan Modra authored
* vax-dis.c (NEXTLONG): Avoid signed overflow.
-
Alan Modra authored
* v850-dis.c (get_operand_value): Use unsigned arithmetic. Don't sign extend using shifts.
-
Alan Modra authored
* tic6x-dis.c (tic6x_extract_32): Avoid signed overflow.
-
Alan Modra authored
* tic4x-dis.c (tic4x_print_register): Formatting. Don't segfault on NULL registertable entry. (tic4x_hash_opcode): Use unsigned arithmetic.
-
Alan Modra authored
* s12z-opc.c (z_decode_signed_value): Avoid signed overflow.
-
Alan Modra authored
* ns32k-dis.c (bit_extract): Use unsigned arithmetic. (bit_extract_simple, sign_extend): Likewise.
-
Alan Modra authored
* nios2-dis.c (nios2_print_insn_arg): Use 1u << 31.
-
Alan Modra authored
* moxie-dis.c (INST2OFFSET): Don't sign extend using shifts.
-
Alan Modra authored
* m68k-dis.c (COERCE32): Cast value first. (NEXTLONG, NEXTULONG): Avoid signed overflow.
-
Alan Modra authored
This is *cst = (data[0] << 24) + (data[1] << 16) + (data[2] << 8) + data[3]; data is unsigned char which promotes to int. * h8300-dis.c (extract_immediate): Avoid signed overflow. (bfd_h8_disassemble): Likewise.
-
Alan Modra authored
* d30v-dis.c (print_insn): Make opind unsigned. Don't access past end of operands array.
-
Alan Modra authored
In the following buf is an unsigned char array, so elements are promoted to int before arithmetic operations. if (dis_info.info->endian == BFD_ENDIAN_BIG) while (n--) val |= buf[n] << (n*8); else for (i = 0; i < n; i++) val |= buf[i] << (i*8); * csky-dis.c (csky_chars_to_number): Rewrite. Avoid signed overflow when collecting bytes of a number.
-
Alan Modra authored
This was the following in print_with_operands case 4: number = buffer[2] + buffer[3] * 256 + buffer[4] * 65536 + buffer[5] * 0x1000000; and buffer[5] * 0x1000000 can indeed overflow. So to fix this we need to use unsigned arithmetic where overflow semantics are specified. But number is a long, and the expression is int which will be sign extended to long. If we make the expression unsigned it will be zero extended. So make number an int32_t and rearrange a little for some of the places that need fixing. * cris-dis.c (print_with_operands): Avoid signed integer overflow when collecting bytes of a 32-bit integer.
-
Alan Modra authored
This was: unsigned long mask = SBM (instruction->match_bits); with #define SBM(offs) ((((1 << (32 - offs)) -1) << (offs))) Well, there are a couple of problems. Firstly, the expression uses int values (1 rather than 1u or 1ul) resulting in the ubsan error, and secondly, a zero offs will result in a 32-bit shift which is undefined if ints are only 32 bits. * cr16-dis.c (EXTRACT, SBM): Rewrite. (cr16_match_opcode): Delete duplicate bcond test.
-
Alan Modra authored
This was the following in fmtconst_val, x is unsigned int. x = SIGNEXTEND (x, constant_formats[cf].nbits); Problem is, the SIGNEXTEND macro assumed its arg was a long and sign extended by shifting left then shifting right, and didn't cast the arg. So don't do the silly shift thing. It's not guaranteed to work anyway according to the C standard. ">>" might do a logical shift even if its args are signed. * bfin-dis.c (HOST_LONG_WORD_SIZE, XFIELD): Delete. (SIGNBIT): New. (MASKBITS, SIGNEXTEND): Rewrite. (fmtconst): Don't use ? expression now that SIGNEXTEND uses unsigned arithmetic, instead assign result of SIGNEXTEND back to x. (fmtconst_val): Use 1u in shift expression.
-
Alan Modra authored
When operand->bits is 32, the following results in UB. value = (insn >> operand->shift) & ((1 << operand->bits) - 1); * arc-dis.c (find_format_from_table): Use ull constant when shifting by up to 32.
-
Alan Modra authored
Assembling this to an object and trying to disassemble results in objdump -d looping forever. .inst 0x45205120 PR 25270 * aarch64-dis.c (aarch64_decode_variant_using_iclass): Return false when field is zero for sve_size_tsz_bhs.
-
Alan Modra authored
* dis-asm.h (INSN_HAS_RELOC, DISASSEMBLE_DATA), (USER_SPECIFIED_MACHINE_TYPE, WIDE_OUTPUT): Make unsigned. * opcode/tic80.h (TIC80_OPERAND_*): Likewise.
-
Alan Modra authored
In Operand_soffsetx4_decode: soffsetx4_0 = 0x4 + ((((int) offset_0 << 14) >> 14) << 2); and other places. Don't sign extend with shifts! This file also has many occurrences of truncation via shifts, which aren't a problem due to using uint32, but I dislike on principle enough to fix. * xtensa-modules.c (Field_* functions): Don't mask using shifts. (Operand_soffsetx4_decode, Operand_simm4_decode), (Operand_simm8_decode, Operand_simm8x256_decode), (Operand_simm12b_decode, Operand_label8_decode), (Operand_label12_decode, Operand_soffset_decode), (Operand_xt_wbr15_label_decode, Operand_xt_wbr18_label_decode): Don't sign extend using shifts. (Operand_immrx4_decode, Operand_uimm16x4_decode): Avoid UB in constant.
-
Alan Modra authored
Two places in epiphany_cgen_extract_operand, "value" is a long. value = ((((value) << (1))) + (pc)); cpu/ * epiphany.cpu (f-simm8, f-simm24): Use multiply rather than shift left to avoid UB on left shift of negative values. opcodes/ * epiphany-ibld.c: Regenerate.
-
Alan Modra authored
Here, since val is signed: *valuep = (val << scale); * cpu-ia64-opc.c (ext_imms_scaled): Avoid undefined left shift of negative values by using unsigned vars.
-
GDB Administrator authored
-
- Dec 10, 2019
-
-
Tom Tromey authored
I noticed that an example in the gdb.prompt documentation used the wrong kind of quotes -- because it is code, it should use a plain ASCII quotation mark. I also slightly shortened the sample text here, so it would more clearly fit on a single line. gdb/doc/ChangeLog 2019-12-10 Tom Tromey <tom@tromey.com> * python.texi (gdb.prompt): Use correct quotes in example. Shorten sample text. Change-Id: I4153928c0d88001244ad410f3943c952a6ebfeb1
-
Kevin Buettner authored
Add tests which check for accessibility of variables from within various OpenMP parallel regions. Tested on Fedora 27, 28, 29, 30, and 31. I also tested with my OpenMP work on Fedora 30. The test has been annotated with setup_xfail and setup_kfail statements so that there are no unexpected failures on any of these platforms when using gcc. Better still, for my own testing anyway, is that there are also no XPASSes or KPASSes either. So, regardless of platform, when using gcc, and regardless of whether my (not yet public) OpenMP work is used, seeing a FAIL indicates a real problem. Fedora 27 results: # of expected passes 85 # of expected failures 65 (Note: I have not retested F27 since v1 of the patch; it's possible that the numbers will be slightly different for v2.) Fedora 28, 29, 30 results: # of expected passes 131 # of expected failures 4 # of known failures 16 Fedora 30, 31 results w/ my OpenMP work: # of expected passes 151 The above results all use gcc, either the system gcc or a development gcc (when testing against my OpenMP work in GDB). I've also tested with clang 9.0.0 and icc 19.0.5.281 20190815 on Fedora 31. Fedora 31, clang: FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print s1 FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print s3 FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i1 FAIL: gdb.threads/omp-par-scope.exp: single_scope: first thread: print i3 FAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print s1 FAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print s3 FAIL: gdb.threads/omp-par-scope.exp: single_scope: second thread: print i1 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i02 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i11 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i12 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i22 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i11 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: multi_scope: after parallel: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print num FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print l FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print k FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 2nd stop: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 2nd stop: print num FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print num FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print l FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print k FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print num FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print file_scope_var FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print i FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print j Fedora 31, icc: FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i12 FAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i22 FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print s1 FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print i FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 1st thread: print j FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print s1 FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print i FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print j FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print k FAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print z FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print s1 FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print i FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 1st thread: print j FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print s1 FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print i FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print j FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print k FAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print z FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print l FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print k FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print l FAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 3rd stop: print k For both clang and icc, it turns out that there are some problems with the DWARF that these compilers generate. Of the two, icc does at least nest the subprogram of the outlined function representing the parallel region within the function that it's defined, but does not handle inner scopes if they exist. clang places the subprogram for the outlined function at the same level as the containing function, so variables declared within the function aren't visible at all. I could call setup_xfail to avoid FAILs for clang and icc also, but I don't want to further complicate the test. gdb/testsuite/ChangeLog: * gdb.threads/omp-par-scope.c: New file. * gdb/threads/omp-par-scope.exp: New file. Change-Id: Icb9c991730d84ca7509380af817dfcc778e764ea
-
Kevin Buettner authored
This commit adds the gdb_caching_proc, support_nested_function_tests, to lib/gdb.exp. It tests to see whether or not the C compiler has support for nested function calls. gdb/testsuite/ChangeLog: * lib/gdb.exp (support_nested_function_tests): New proc. Change-Id: Ic2c93bc4cc200e07e104a2398f89a9c0514bdc75
-
Kevin Buettner authored
gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_compile_openmp): New proc. (build_executable_from_specs): Add an "openmp" option. (gdb_compile_pthreads): Add non-executable case. Change-Id: I94048b8b0940c707ce0529a6bcfa6e4eace49101
-
Christian Biesinger authored
We only ever use one of the two overloads, so to avoid breaking -Werror builds, supress the warning. gdb/ChangeLog: 2019-12-10 Christian Biesinger <cbiesinger@google.com> * gdbsupport/safe-strerror.c: Supress the unused function warning for select_strerror_r. Change-Id: I344869a382bb36fe181b5b2a31838d1d20f58169
-
Christian Biesinger authored
To do that, this patch makes IPA compile safe-strerror as well. Because it doesn't use Gnulib, it calls the Glibc version of strerror_r directly. Consequently this patch also removes the configure checks for strerror. gdb/ChangeLog: 2019-12-10 Christian Biesinger <cbiesinger@google.com> * config.in: Regenerate. * configure: Regenerate. * gdbsupport/agent.c (gdb_connect_sync_socket): Call safe_strerror instead of strerror. * gdbsupport/common.m4: Don't check for strerror. * gdbsupport/safe-strerror.c: Support both the glibc version of strerror_r and the XSI version. gdb/gdbserver/ChangeLog: 2019-12-10 Christian Biesinger <cbiesinger@google.com> * Makefile.in: Add safe-strerror.c to gdbreplay and IPA, and change UNDO_GNULIB_CFLAGS to undo strerror_r instead of strerror. * config.in: Regenerate. * configure: Regenerate. * configure.ac: Don't check for strerror. * linux-i386-ipa.c (initialize_fast_tracepoint_trampoline_buffer): Call safe_strerror instead of strerror. * server.h (strerror): Remove this now-unnecessary declaration. * tracepoint.c (init_named_socket): Call safe_strerror instead of strerror. (gdb_agent_helper_thread): Likewise. * utils.c (perror_with_name): Likewise. Change-Id: I74848f072dcde75cb55c435ef9398dc8f958cd73
-
Andre Vieira authored
This patch fixes .arch_extension behaviour. Currently, context table for '.arch_extension' is only set while "-march" processing, but it is not set while .arch processing, so following code is rejected .syntax unified .thumb .arch armv8.1-m.main .arch_extension mve.fp unless -march=armv8.1-m.main is given. Committing on behalf of Vladimir Murzin gas/ChangeLog: 2019-12-10 Vladimir Murzin <vladimir.murzin@arm.com> * config/tc-arm.c (s_arm_arch): Set selected_ctx_ext_table. * testsuite/gas/arm/mve-arch-ext.s: New. * testsuite/gas/arm/mve-arch-ext.d: New.
-
Tom Tromey authored
Sometimes -- notably with unchecked unions -- the Ada "ptype" code will print a "?" or "??" to indicate something unknown. The choice of what was printed was somewhat arbitrary, and in one case, Ada would print an empty string rather than "?". This patch normalizes the Ada code to use "?" rather than an empty string or "??". My reasoning here is that a single question mark is enough to convey unknown-ness. gdb/ChangeLog 2019-12-10 Tom Tromey <tromey@adacore.com> * ada-typeprint.c (print_choices): Use a single "?". (print_variant_part): Print "?" if the discriminant name is not known. gdb/testsuite/ChangeLog 2019-12-10 Tom Tromey <tromey@adacore.com> * gdb.ada/unchecked_union.exp: New file. * gdb.ada/unchecked_union/pck.adb: New file. * gdb.ada/unchecked_union/pck.ads: New file. * gdb.ada/unchecked_union/unchecked_union.adb: New file. * gdb-utils.exp (string_to_regexp): Also quote "?". Change-Id: I3403040780a155ffa2c44c8e6a04ba86bc810e29
-
GDB Administrator authored
-
- Dec 09, 2019
-
-
Alan Modra authored
PR 24960 include/ * dis-asm.h (disassemble_free_target): Declare. opcodes/ * disassemble.c (disassemble_free_target): New function. binutils/ * objdump.c (disassemble_data): Call disassemble_free_target.
-
Alan Modra authored
No cgen target uses private_data. This patch removes a disassemble_info field that is only used by cgen, and instead uses private_data. It also removes a macro that is no longer used. include/ * dis-asm.h (struct disassemble_info): Delete insn_sets. (INIT_DISASSEMBLE_INFO_NO_ARCH): Don't define. opcodes/ * cgen-dis.in (print_insn_@arch@): Replace insn_sets with private_data. * disassemble.c (disassemble_init_for_target): Likewise. * bpf-dis.c: Regenerate. * epiphany-dis.c: Regenerate. * fr30-dis.c: Regenerate. * frv-dis.c: Regenerate. * ip2k-dis.c: Regenerate. * iq2000-dis.c: Regenerate. * lm32-dis.c: Regenerate. * m32c-dis.c: Regenerate. * m32r-dis.c: Regenerate. * mep-dis.c: Regenerate. * mt-dis.c: Regenerate. * or1k-dis.c: Regenerate. * xc16x-dis.c: Regenerate. * xstormy16-dis.c: Regenerate.
-
Alan Modra authored
ppc-dis.c used a global struct whenever malloc failed to provide the eight bytes of memory necessary for struct dis_private. Which is quite ridiculous. If that malloc failed there is zero chance some other malloc won't fail too. * ppc-dis.c (private): Delete variable. (get_powerpc_dialect): Don't segfault on NULL info->private_data. (powerpc_init_dialect): Don't use global private.
-