1. Nov 14, 2020
    • Joseph Myers's avatar
      Fix Windows-target testing in gdb_file_cmd · 5643c500
      Joseph Myers authored
      GCC for Windows target produces executables called foo.exe when given
      "-o foo".  (More specifically, it's done that for native compilers for
      a long time, and for cross compilers to Windows target since GCC
      commit 5bc86b599054f494ec0a45e49b82749320eaa9c4, in GCC 8 and later.)
      This causes problems for many GDB tests expecting a program to have
      the exact file name passed to -o.
      
      Fix this by checking for the case where only the .exe exists in
      gdb_file_cmd and adjusting the name passed to the file command
      accordingly.  There may well be other places with this issue in the
      GDB testsuite, but this fix allows many tests to succeed that
      previously fell over.
      
      2020-11-12  Joseph Myers  <joseph@codesourcery.com>
      
      	* lib/gdb.exp (gdb_file_cmd): Check for case where $arg.exe exists
      	but $arg does not.
      5643c500
    • Nick Clifton's avatar
      Fix readelf's and objdump's dislplay of DWO links when multiple links are present. · 50ea0877
      Nick Clifton authored
       PR 26829
       * dwarf.c (struct dwo_info): Add cu_offset field.
       (add_dwo_info): Add cu_offset parameter.  Record in new dwo_info
       struct.
       (add_dwo_name): Add cu_offset field.
       (add_dwo_dir): Add cu_offset field.
       (add_dwo_id): Add cu_offset field.
       (read_and_display_attr_value): Pass cu_offset to dwo recording
       functions.
       (load_separate_debug_files): Accumulate name, dir and id values
       and display once for each CU.
       * testsuite/binutils-all/dwo.sL Use a separate CU for the second
       dwo link.
       * testsuite/binutils-all/readelf.k2: Update expected output.
      50ea0877
  2. Nov 13, 2020
    • Andrew Burgess's avatar
      gdb: delete a couple of declarations from f-lang.h · 5a7cf527
      Andrew Burgess authored
      One declaration in f-lang.h is for a function that doesn't even exist,
      another is for a function that is only used within f-lang.c.
      
      One declaration is deleted, the other function I make static in
      f-lang.c.
      
      gdb/ChangeLog:
      
      	* f-lang.c (fortran_argument_convert): Add declaration.  Add
      	header comment, taken from f-lang.h.  Make static.
      	* f-lang.h (f77_get_dynamic_array_length): Delete declaration.
      	(fortran_argument_convert): Delete declaration.
      5a7cf527
    • Andre Vieira's avatar
      gas, arm: PR26858 Fix availability of single precision vmul/vmla in arm mode · 48f4d8ce
      Andre Vieira authored
      This patch fixes a mistake when enabling MVE instructions that disabled support
      for single precision vmla and vmul for arm mode.
      
      gas/ChangeLog:
      2020-11-12  Andre Vieira  <andre.simoesdiasvieira@arm.com>
      
      	PR 26858
      	*  config/tc-arm.c (asm_opcode insns): Fix vmul and vmla's ARM_VARIANT.
      	* testsuite/gas/arm/pr26858.s: New test.
      	* testsuite/gas/arm/pr26858.d: New test.
      48f4d8ce
    • GDB Administrator's avatar
      Automatic date update in version.in · a4ae48cc
      GDB Administrator authored
      a4ae48cc
    • Andrew Burgess's avatar
      gdb: rewrite how per language primitive types are managed · 7bea47f0
      Andrew Burgess authored
      Consider the following GDB session:
      
        $ gdb
        (gdb) set language c
        (gdb) ptype void
        type = void
        (gdb) set language fortran
        (gdb) ptype void
        No symbol table is loaded.  Use the "file" command.
        (gdb)
      
      With no symbol file loaded GDB and the language set to C GDB knows
      about the type void, while when the language is set to Fortran GDB
      doesn't know about the void, why is that?
      
      In f-lang.c, f_language::language_arch_info, we do have this line:
      
        lai->primitive_type_vector [f_primitive_type_void]
          = builtin->builtin_void;
      
      where we add the void type to the list of primitive types that GDB
      should always know about, so what's going wrong?
      
      It turns out that the primitive types are stored in a C style array,
      indexed by an enum, so Fortran uses `enum f_primitive_types'.  The
      array is allocated and populated in each languages language_arch_info
      member function.  The array is allocated with an extra entry at the
      end which is left as a NULL value, and this indicates the end of the
      array of types.
      
      Unfortunately for Fortran, a type is not assigned for each element in
      the enum.  As a result the final populated array has gaps in it, gaps
      which are initialised to NULL, and so every time we iterate over the
      list (for Fortran) we stop early, and never reach the void type.
      
      This has been the case since 2007 when this functionality was added to
      GDB in commit cad351d1.
      
      Obviously I could just fix Fortran by ensuring that either the enum is
      trimmed, or we create types for the missing types.  However, I think a
      better approach would be to move to C++ data structures and removed
      the fixed enum indexing into the array approach.
      
      After this commit the primitive types are pushed into a vector, and
      GDB just iterates over the vector in the obvious way when it needs to
      hunt for a type.  After this commit all the currently defined
      primitive types can be found when the language is set to Fortran, for
      example:
      
        $ gdb
        (gdb) set language fortran
        (gdb) ptype void
        type = void
        (gdb)
      
      A new test checks this functionality.
      
      I didn't see any other languages with similar issues, but I could have
      missed something.
      
      gdb/ChangeLog:
      
      	* ada-exp.y (find_primitive_type): Make parameter const.
      	* ada-lang.c (enum ada_primitive_types): Delete.
      	(ada_language::language_arch_info): Update.
      	* c-lang.c (enum c_primitive_types): Delete.
      	(c_language_arch_info): Update.
      	(enum cplus_primitive_types): Delete.
      	(cplus_language::language_arch_info): Update.
      	* d-lang.c (enum d_primitive_types): Delete.
      	(d_language::language_arch_info): Update.
      	* f-lang.c (enum f_primitive_types): Delete.
      	(f_language::language_arch_info): Update.
      	* go-lang.c (enum go_primitive_types): Delete.
      	(go_language::language_arch_info): Update.
      	* language.c (auto_or_unknown_language::language_arch_info):
      	Update.
      	(language_gdbarch_post_init): Use obstack_new, use array indexing.
      	(language_string_char_type): Add header comment, call function in
      	language_arch_info.
      	(language_bool_type): Likewise
      	(language_arch_info::bool_type): Define.
      	(language_lookup_primitive_type_1): Delete.
      	(language_lookup_primitive_type): Rewrite as a templated function
      	to call function in language_arch_info, then instantiate twice.
      	(language_arch_info::type_and_symbol::alloc_type_symbol): Define.
      	(language_arch_info::lookup_primitive_type_and_symbol): Define.
      	(language_arch_info::lookup_primitive_type): Define twice with
      	different signatures.
      	(language_arch_info::lookup_primitive_type_as_symbol): Define.
      	(language_lookup_primitive_type_as_symbol): Rewrite to call a
      	member function in language_arch_info.
      	* language.h (language_arch_info): Complete rewrite.
      	(language_lookup_primitive_type): Make templated.
      	* m2-lang.c (enum m2_primitive_types): Delete.
      	(m2_language::language_arch_info): Update.
      	* opencl-lang.c (OCL_P_TYPE): Delete.
      	(enum opencl_primitive_types): Delete.
      	(opencl_type_data): Delete.
      	(builtin_opencl_type): Delete.
      	(lookup_opencl_vector_type): Update.
      	(opencl_language::language_arch_info): Update, lots of content
      	moved from...
      	(build_opencl_types): ...here.  This function is now deleted.
      	(_initialize_opencl_language): Delete.
      	* p-lang.c (enum pascal_primitive_types): Delete.
      	(pascal_language::language_arch_info): Update.
      	* rust-lang.c (enum rust_primitive_types): Delete.
      	(rust_language::language_arch_info): Update.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.fortran/types.exp: Add more tests.
      7bea47f0
    • Simon Marchi's avatar
      gdb/dwarf: fix call to dwarf2_queue_guard in dw2_do_instantiate_symtab · bf6e5d01
      Simon Marchi authored
      It took me a while to understand why that would even compile: it looks
      like we pass a type name as a pointer, that makes no sense.  By looking
      at the DWARF, I understood that the compiler actually interprets it as a
      function declaration.  So the statement was doing nothing, no
      dwarf2_queue_guard was instantiated.  Fix it by passing the right
      variable name.
      
      gdb/ChangeLog:
      
      	* dwarf2/read.c (dw2_do_instantiate_symtab): Fix call to
      	dwarf2_queue_guard.
      
      Change-Id: I3a7bdead9e8c39f8342a471f10181b85b8f0d801
      bf6e5d01
    • Dimitar Dimitrov's avatar
      sim: pru: Add support for LMBD instruction · e57cf1f2
      Dimitar Dimitrov authored
      Binutils support for LMBD instruction was merged [1]. So add it also
      to simulator.
      
      LMBD instruction does left-most-bit-detection. It returns 32 if
      the given bit value is not found in the provided word value.
      
      [1] https://sourceware.org/pipermail/binutils/2020-October/113901.html
      
      sim/pru/ChangeLog:
      
      	* pru.h (RS1SEL): New macro.
      	(RS1_WIDTH): New macro.
      	* pru.isa: Describe the LMBD instruction.
      
      sim/testsuite/sim/pru/ChangeLog:
      
      	* lmbd.s: New test.
      e57cf1f2
    • Simon Marchi's avatar
      gdb/dwarf: fix typo in dwarf2/read.c · 1350c3b4
      Simon Marchi authored
      gdb/ChangeLog:
      
      	* dwarf2/read.c (dw2_do_instantiate_symtab): Fix typo in
      	comment.
      
      Change-Id: I6cb98768c04a537cf3d427648bddc57c631518e5
      1350c3b4
    • Simon Marchi's avatar
      gdb: convert "set debug dwarf-read" to new style · 6f738b01
      Simon Marchi authored
      Add dwarf_read_debug_printf and dwarf_read_debug_printf_v macros and use
      them throughout dwarf2/read.c.  The second one is used for "verbose"
      prints, when the value of "set debug dwarf-read" is >= 2.
      
      gdb/ChangeLog:
      
      	* dwarf2/read.c (dwarf_read_debug_printf,
      	dwarf_read_debug_printf_v): New macros, use throughout the file.
      
      Change-Id: I694da69da2e1f2caa4c27a421a975790636411e2
      6f738b01
    • Jozef Lawrynowicz's avatar
      MSP430: gas: Ignore -md option required for GCC backward compatibility · 1de037a0
      Jozef Lawrynowicz authored
      The redundant -md option was removed in e4ae357f, but it is required
      for backwards compatibility with GCC 10, which passes it to the
      assembler implicitly in certain situations.
      
      It is now silently ignored.
      
      gas/ChangeLog:
      
      	* config/tc-msp430.c (OPTION_MOVE_DATA): Define.
      	(md_parse_option): Ignore OPTION_MOVE_DATA.
      	(md_longopts): Handle -md option.
      	* testsuite/gas/msp430/msp430.exp: Run new test.
      	* testsuite/gas/msp430/empty.s: New test.
      	* testsuite/gas/msp430/ignore-md.d: New test.
      1de037a0
    • Shahab Vahedi's avatar
      arc: Write correct "eret" value during register collection · 10c19fad
      Shahab Vahedi authored
      In collect_register() function of arc-linux-tdep.c, the "eret"
      (exception return) register value was not being reported correctly.
      This patch fixes that.
      
      Background:
      When asked for the "pc" value, we have to update the "eret" register
      with GDB's STOP_PC.  The "eret" instructs the kernel code where to
      jump back when an instruction has stopped due to a breakpoint.  This
      is how collect_register() was doing so:
      
      --------------8<--------------
        if (regnum == gdbarch_pc_regnum (gdbarch))
          regnum = ARC_ERET_REGNUM;
        regcache->raw_collect (regnum, buf + arc_linux_core_reg_offsets[regnum]);
      -------------->8--------------
      
      Root cause:
      Although this is using the correct offset (ERET register's), it is also
      changing the REGNUM itself.  Therefore, raw_collect (regnum, ...) is
      not reading from "pc" anymore.
      
      v2:
      - Fix a copy/paste issue as rightfully addressed by Tom [1].
      
      [1]
      https://sourceware.org/pipermail/gdb-patches/2020-November/173208.html
      
      gdb/ChangeLog:
      
      	* arc-linux-tdep.c (collect_register): Populate "eret" by
      	"pc" value from the regcache when asked for "pc" value.
      10c19fad
  3. Nov 12, 2020
    • Tom Tromey's avatar
      Fix Rust regression with -readnow · 1f2624a3
      Tom Tromey authored
      PR rust/26799 points out that a certain test case fails with -readnow.
      This happens because, with -readnow, there are no partial symtabs; but
      find_symbol_at_address requires these.
      
      This patch fixes this problem by searching all of an objfile's
      compunit symtabs if it does not have partial symbols.
      
      Note that this test will still fail with .gdb_index.  I don't think
      that is readily fixable.
      
      gdb/ChangeLog
      2020-11-12  Tom Tromey  <tom@tromey.com>
      
      	PR rust/26799:
      	* symtab.c (find_symbol_at_address): Search symtabs if no psymtabs
      	exist.
      
      gdb/testsuite/ChangeLog
      2020-11-12  Tom Tromey  <tom@tromey.com>
      
      	PR rust/26799:
      	* gdb.rust/traits.exp: Remove kfails.
      1f2624a3
    • Gary Benson's avatar
      Fix gdb.threads/tls-so_extern.exp with Clang · 9e74f0ae
      Gary Benson authored
      Clang fails to compile gdb.threads/tls-so_extern_main.c, giving the
      following error:
      
        /gdbtest/src/gdb/testsuite/gdb.threads/tls-so_extern_main.c:28:1:
          warning: non-void function does not return a value [-Wreturn-type]
      
      This commit adds a return statement to the offending function.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.threads/tls-so_extern_main.c (tls_ptr): Add missing return
      	statement.
      9e74f0ae
    • Nick Clifton's avatar
      Fix up changelog entry of previous delta · a3183ad6
      Nick Clifton authored
      a3183ad6
    • Nick Clifton's avatar
      m32r sim: Add prototypes for functions that pass/return DI values · 94cde56a
      Nick Clifton authored
      	* m32r-sim.h (m32rbf_h_accum_get_handler): Always provide a
      	prototype for this function.
      	(m32rbf_h_accum_set_handler): Likewise.
      	(m32r2f_h_accums_get_handler): Prototype.
      	(m32r2f_h_accums_set_handler): Prototype.
      94cde56a
    • Nick Clifton's avatar
      Stop Gas from generating line info or address ranges for sections that do not... · bcb78b47
      Nick Clifton authored
      Stop Gas from generating line info or address ranges for sections that do not contain code or are not loaded.
      
      	PR 26850
      	* dwarf2dbg.c (dwarf2_gen_line_info_1): Do not record lines in
      	sections that are not executable or not loadable.
      	(out_debug_line): Move warning message into dwarf2_gen_line_info_1.
      	* testsuite/gas/elf/dwarf2-20.s: New test.
      	* testsuite/gas/elf/dwarf2-20.d: New test driver.
      	* testsuite/gas/elf/elf.exp: Run the new test.
      	* testsuite/gas/elf/warn-2.s: Use the .nop directive.
      bcb78b47
    • Andrew Burgess's avatar
      gdb: add an option flag to 'maint print c-tdesc' · ab33b152
      Andrew Burgess authored
      GDB has two approaches to generating the target descriptions found in
      gdb/features/, the whole description approach, where the XML file
      contains a complete target description which is then used to generate
      a single C file that builds that target description.  Or, the split
      feature approach, where the XML files contain a single target feature,
      each feature results in a single C file to create that one feature,
      and then a manually written C file is used to build a complete target
      description from individual features.
      
      There's a Makefile, gdb/features/Makefile, which is responsible for
      managing the regeneration of the C files from the XML files.
      
      However, some of the logic that selects between the whole description
      approach, or the split feature approach, is actually hard-coded into
      GDB, inside target-descriptions.c:maint_print_c_tdesc_cmd we check the
      path to the incoming XML file and use this to choose which type of C
      file we should generate.
      
      This commit removes this hard coding from GDB, and makes the Makefile
      entirely responsible for choosing the approach.  This makes sense as
      the Makefile already has the XML files partitioned based on which
      approach they should use.
      
      In order to allow this change the 'maint print c-tdesc' command is
      given a new command option '-single-feature', which tells GDB which
      type of C file should be created.  The makefile now supplies this flag
      to GDB.
      
      This did reveal a bug in features/Makefile, the rx.xml file was in the
      wrong list, this didn't matter previously as the actual choice of
      which approach to use was done in GDB.  Now the Makefile decides, so
      placing each XML file in the correct list is critical.
      
      Tested this by doing 'make GDB=/path/to/gdb clean-cfiles cfiles' to
      regenerate all the C files from their XML source.  There are no
      changes after this commit.
      
      gdb/ChangeLog:
      
      	* features/Makefile (XMLTOC): Add rx.xml.
      	(FEATURE_XMLFILES): Remove rx.xml.
      	(FEATURE_CFILES rule): Pass '-single-feature' flag.
      	* features/rx.c: Regenerate.
      	* features/rx.xml: Wrap in `target` tags, and reindent.
      	* target-descriptions.c (struct maint_print_c_tdesc_options): New
      	structure.
      	(maint_print_c_tdesc_opt_def): New typedef.
      	(maint_print_c_tdesc_opt_defs): New static global.
      	(make_maint_print_c_tdesc_options_def_group): New function.
      	(maint_print_c_tdesc_cmd): Make use of command line flags, only
      	print single feature C file for target descriptions containing a
      	single feature.
      	(maint_print_c_tdesc_cmd_completer): New function.
      	(_initialize_target_descriptions): Update call to register command
      	completer, and include command line flag in help text.
      
      gdb/doc/ChangeLog:
      
      	* gdb.texinfo (Maintenance Commands): Update description of 'maint
      	print c-tdesc'.
      ab33b152
    • GDB Administrator's avatar
      Automatic date update in version.in · b8b0c108
      GDB Administrator authored
      b8b0c108
    • Simon Marchi's avatar
      gdb/testsuite: add "breakpoint always-inserted" axis in... · acb994fa
      Simon Marchi authored
      gdb/testsuite: add "breakpoint always-inserted" axis in gdb.base/continue-after-aborted-step-over.exp
      
      The test gdb.base/continue-after-aborted-step-over.exp fails on ROCm GDB
      [1] when using the unix board (when debugging a standard x86-64/Linux
      program), with:
      
          (gdb) b *0^M
          Breakpoint 2 at 0x0^M
          Warning:^M
          Cannot insert breakpoint 2.^M
          Cannot access memory at address 0x0^M
          ^M
          (gdb) FAIL: gdb.base/continue-after-aborted-step-over.exp: displaced-stepping=off: b *0
      
      This happens because that build of GDB defaults to "set breakpoint
      always-inserted on", for reasons that are unrelevant to explain here.
      As soon as the breakpoint is created, GDB tries to insert it and
      (expectedly) fails.  This causes more text to be output than what the
      pattern expects.
      
      It is actually be relevant to run the test with both "set breakpoint
      always-inserted" on and off.  With it on, it mimics what happens when
      running in non-stop mode, with other threads running.  This is relevant
      for upstream even outside of the ROCm port, so here's a patch for it.
      
      Add this other axis and adjust the "b *0" test to handle the extra
      output when it is on.
      
      [1] https://github.com/ROCm-Developer-Tools/ROCgdb
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.base/continue-after-aborted-step-over.exp: Add "breakpoint
      	always-inserted" axis.
      	(do_test): Add breakpoint_always_inserted parameter.
      
      Change-Id: I95126cae563a0b9a72f4a99627809fc34340cd5e
      acb994fa
  4. Nov 11, 2020
    • Przemyslaw Wirkus's avatar
      aarch64: Allow LS64 feature with Armv8.6 · f27c0b44
      Przemyslaw Wirkus authored
      Allow users to use LS64 extension with Armv8.6 architecture.
      f27c0b44
    • Bernd Edlinger's avatar
      readelf: Fix output of rnglists section · 4d932715
      Bernd Edlinger authored
      	* dwarf.c (display_debug_rnglists_list): Only bias the
      	DW_RLS_offset_pair with the base address.
      4d932715
    • Tom Tromey's avatar
      Fix Windows-x-PPC build · 0dd7428d
      Tom Tromey authored
      A recent BFD change caused a build failure for a Windows->PPC cross:
      
      ld.exe: ../bfd/libbfd.a(coff-rs6000.o):coff-rs6000.c:(.text+0x4571): undefined reference to `getuid'
      ld.exe: ../bfd/libbfd.a(coff-rs6000.o):coff-rs6000.c:(.text+0x457e): undefined reference to `getgid'
      
      This patch fixes the problem by moving the replacement definitions of
      getuid and getgid to system.h.
      
      bfd/ChangeLog
      2020-11-11  Tom Tromey  <tromey@adacore.com>
      
      	* archive.c (getuid, getgid): Move...
      	* sysdep.h (getuid, getgid): ...here.
      0dd7428d
    • Andrew Burgess's avatar
      gdb/riscv: add ability to decode dwarf CSR numbers · 550820e1
      Andrew Burgess authored
      Extends riscv_dwarf_reg_to_regnum to add the ability to convert the
      DWARF register numbers for CSRs into GDB's internal numbers.
      
      gdb/ChangeLog:
      
      	* riscv-tdep.c (riscv_dwarf_reg_to_regnum): Decode DWARF CSR
      	numbers.
      	* riscv-tdep.h (RISCV_DWARF_FIRST_CSR, RISCV_DWARF_LAST_CSR): New
      	enum values.
      550820e1
    • Andrew Burgess's avatar
      gdbserver: add missing --disable-packet options to help text · 81fdd7ac
      Andrew Burgess authored
      The help text for the --disable-packet option was missing one of the
      possible values.
      
      As this option is for maintainers only it is explicitly not documented
      in gdb/doc/gdb.texinfo, so no update is needed there.
      
      gdbserver/ChangeLog:
      
      	* server.cc (gdbserver_usage): Add missing option to usage text.
      	(gdbserver_show_disableable): Likewise.
      81fdd7ac
    • GDB Administrator's avatar
      Automatic date update in version.in · 424171c6
      GDB Administrator authored
      424171c6
    • Tom Tromey's avatar
      Make internalvar_name return a const char * · baf20f76
      Tom Tromey authored
      This changes internalvar_name to return a const char *.
      
      gdb/ChangeLog
      2020-11-10  Tom Tromey  <tom@tromey.com>
      
      	* value.h (internalvar_name): Update.
      	* value.c (internalvar_name): Make return type const.
      baf20f76
    • Tom Tromey's avatar
      Use "const" more in ax-gdb.c · caaece0e
      Tom Tromey authored
      This changes a few spots in ax-gdb.c to use a "const char *" rather
      than a non-const one.
      
      gdb/ChangeLog
      2020-11-10  Tom Tromey  <tom@tromey.com>
      
      	* ax-gdb.c (gen_struct_elt_for_reference, gen_namespace_elt)
      	(gen_maybe_namespace_elt, gen_aggregate_elt_ref, gen_expr): Use
      	const.
      caaece0e
    • Tom Tromey's avatar
      Constify value_nsstring · 8e20b4be
      Tom Tromey authored
      This changes the "ptr" parameter to value_nsstring to be const.
      
      gdb/ChangeLog
      2020-11-10  Tom Tromey  <tom@tromey.com>
      
      	* objc-lang.h (value_nsstring): Update.
      	* objc-lang.c (value_nsstring): Make "ptr" const.
      8e20b4be
    • Tom Tromey's avatar
      Move include block to pathstuff.h · 6c51cf51
      Tom Tromey authored
      A recent commit caused pathstuff.cc to fail to compile on mingw, like:
      
      ../../binutils-gdb/gdbsupport/pathstuff.cc:324:1: error: no previous declaration for 'std::string find_gdb_home_config_file(const char*, _stati64*)' [-Werror=missing-declarations]
      
      Some newly-added #includes were changing which "stat" was being seen
      by the compiler.  This patch moves the includes to the header, so that
      the declaration and definition now agree.
      
      2020-11-10  Tom Tromey  <tromey@adacore.com>
      
      	PR build/26848:
      	* pathstuff.h: Move include block here...
      	* pathstuff.cc: ... from here.
      6c51cf51
    • Nick Clifton's avatar
    • Tom Tromey's avatar
      Fix bug in gdb.ada/bias.exp · 95016fd2
      Tom Tromey authored
      While working on a different bug in the Ada support, I found that the
      gdb.ada/bias.exp test is slightly incorrect.  In particular, it is
      using a range type, which it then overflows during an operation.
      
      This patch changes the test so that the computed values remain in
      range.
      
      gdb/testsuite/ChangeLog
      2020-11-10  Tom Tromey  <tromey@adacore.com>
      
      	* gdb.ada/bias.exp: Update.
      	* gdb.ada/bias/bias.adb (X): Change value.
      95016fd2
    • Gary Benson's avatar
      Prevent false passes in gdb.base/vla-optimized-out.exp · 83100a74
      Gary Benson authored
      The "vla_optimized_out" procedure in gdb.base/vla-optimized-out.exp
      accepts a "sizeof_result" argument which is substituted into the
      regular expression used to check the result of printing the sizeof
      a VLA.  The -O3 test variants, however, pass a regular expression
      fragment as that argument, which expands into a regular expression
      that matches any result with a "6" in it.  This commit wraps the
      substitution with parentheses to prevent these false matches.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.base/vla-optimized-out.exp (p sizeof (a)): Wrap supplied
      	regexp fragment in parentheses to prevent false matching.
      83100a74
    • Gary Benson's avatar
      Prevent inlining in gdb.base/vla-optimized-out.c · 6ff174a7
      Gary Benson authored
      The function f1 in gdb.base/vla-optimized-out.c sets various
      attributes to prevent its being inlined, but Clang inlines it
      anyway, causing the test that uses it to fail.  This commit
      adds the "weak" attribute to cause Clang to keep the function
      fully out of line so the test can operate as it should.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.base/vla-optimized-out.c (f1): Add __attribute__ ((weak)).
      6ff174a7
    • Gary Benson's avatar
      Fix gdb.cp/step-and-next-inline.exp with Clang · eb24648c
      Gary Benson authored
      Clang fails to compile gdb.cp/step-and-next-inline.cc, with the
      following error:
      
        clang-12: error: unknown argument: '-gstatement-frontiers'
        compiler exited with status 1
      
      This commit fixes the testcase by only passing -gstatement-frontiers
      when building with GCC.  This commit also alters two checks marked as
      known failures, to mark them as known failures only when built using
      GCC.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.cp/step-and-next-inline.exp: Only require
      	-gstatement-frontiers when building with GCC.
      	Only setup KFAIL's for GCC issues when using
      	a GCC-built executable.
      eb24648c
  5. Nov 10, 2020
  6. Nov 09, 2020