1. 26 Aug, 2020 6 commits
    • Alan Modra's avatar
      PR26412 UBSAN: objcopy.c:3026 null pointer fwrite · a68aba2d
      Alan Modra authored
      	PR 26412
      	* objcopy.c (copy_object): Don't fwrite NULL contents.
    • David Faust's avatar
      bpf: add xBPF ISA · 4449c81a
      David Faust authored
      This patch adds support for xBPF, another ISA targetting the BPF
      virtual architecture. For now, the primary difference between eBPF
      and xBPF is that xBPF supports indirect calls through the
      'call %reg' form of the call instruction.
      	* archures.c (bfd_mach_xbpf): Define.
      	* bfd-in2.h: Regenerate.
      	* cpu-bpf.c (bfd_xbpf_arch) New.
      	(bfd_bpf_arch) Update next in list field to point to xbpf arch.
      	* bpf.cpu (arch bpf): Add xbpf mach and isas.
      	(define-xbpf-isa) New pmacro.
      	(all-isas) Add xbpfle,xbpfbe.
      	(endian-isas): New pmacro.
      	(mach xbpf): New.
      	(model xbpf-def): Likewise.
      	(h-gpr): Add xbpf mach.
      	(f-dstle, f-srcle, dstle, srcle): Add xbpfle isa.
      	(f-dstbe, f-srcbe, dstbe, srcbe): Add xbpfbe isa.
      	(define-alu-insn-un): Use new endian-isas pmacro.
      	(define-alu-insn-bin, define-alu-insn-mov): Likewise.
      	(define-endian-insn, define-lddw): Likewise.
      	(dlind, dxli, dxsi, dsti): Likewise.
      	(define-cond-jump-insn, define-call-insn): Likewise.
      	(define-atomic-insns): Likewise.
      	* config/tc-bpf.c: Add option -mxbpf to select xbpf isa.
      	* testsuite/gas/bpf/indcall-1.d: New file.
      	* testsuite/gas/bpf/indcall-1.s: Likewise.
      	* testsuite/gas/bpf/indcall-bad-1.l: Likewise.
      	* testsuite/gas/bpf/indcall-bad-1.s: Likewise.
      	* testsuite/gas/bpf/bpf.exp: Run new tests.
      	* bpf-desc.c: Regenerate.
      	* bpf-desc.h: Likewise.
      	* bpf-opc.c: Likewise.
      	* bpf-opc.h: Likewise.
      	* disassemble.c (disassemble_init_for_target): Set bits for xBPF
      	ISA when appropriate.
    • Katayama Hirofumi's avatar
      windres: AUTOCHECKBOX default style must have WS_TABSTOP style · 37f628c3
      Katayama Hirofumi authored
      	PR 26340
      	* rcparse.y (AUTOCHECKBOX): Add WS_TABSTOP to the base style.
    • Shahab Vahedi's avatar
      gdb: Add ARC target and maintainer to MAINTAINERS · 4c6e63bf
      Shahab Vahedi authored
      This patch updates gdb/MAINTAINERS with ARC as a target and
      myself as the maintainer.  There is no mention of "-Werror"
      because that is enabled by default for gdb/ targets now.
      	* MAINTAINERS: Add ARC target and maintainer.
    • Alan Modra's avatar
      Re: CSKY: Add new arch CK860 · 13f8a246
      Alan Modra authored
      bfd-in2.h is a generated file.  Put the new machine where it belongs.
      	* archures.c (bfd_mach_ck860): Define.
    • GDB Administrator's avatar
      Automatic date update in version.in · 3c68b07e
      GDB Administrator authored
  2. 25 Aug, 2020 30 commits
    • Anton Kolesov's avatar
      arc: Add GNU/Linux support for ARC · 8d7f0635
      Anton Kolesov authored
      ARC Linux targets differences from baremetal:
      - No support for hardware single instruction stepping.
      - Different access rules to registers.
      - Use of another instruction for breakpoints.
      v2: Changes after Tom's remarks [1]
        - Use true/false instead of TRUE/FALSE.
        - arc_linux_sw_breakpoint_from_kind (): Break long lines into two.
        - arc_linux_sw_breakpoint_from_kind (): Remove starting blank line.
        - Use explicit number evaluation, e.g: if (a & b) -> if ((a & b) != 0)
        - Use explicit number evaluation, e.g: if (a & b) -> if ((a & b) != 0)
        - arc*-*-linux*): Remove "build_gdbserver=yes".
      v3: Changes after Simon's remarks [2]
        - Use "return trap_size" instead of cryptic "return 2".
        - Removed unnecessary curly braces.
        - Removed "void" from "_initialize_arc_linux_tdep (void)".
      v5: Changes after Simon's remarks [3]
      - Remove unnecessary empty lines.
      - Replace "breakpoint uses" with "breakpoints use" in a comment.
      - "return condition;" i.s.o. "if (condition) return true; else return false;"
      [1] Tom's remarks
      [2] Simon's remarks on v2
      [3] Simon's remarks on v4
      2020-08-25  Anton Kolesov  <anton.kolesov@synopsys.com>
      	* configure.tgt: ARC support for GNU/Linux.
      	* Makefile.in (ALL_TARGET_OBJS): Likewise.
      	* arc-linux-tdep.c: New file.
      	* arc-tdep.h (ARC_STATUS32_L_MASK, ARC_STATUS32_DE_MASK): Declare.
      	* arc-tdep.c (arc_write_pc): Use it.
    • Shahab Vahedi's avatar
      arc: Add hardware loop detection · fdd8731b
      Shahab Vahedi authored
      For ARC there are registers that are not part of a required set in XML
      target descriptions by default, but are almost always present on ARC
      targets and are universally exposed by the ptrace interface.  Hardware
      loop registers being one of them.
      LP_START and LP_END auxiliary registers are hardware loop start and end.
      Formally, they are optional, but it is hard to find an ARC configuration
      that doesn't have them.  They are always present in processors that can
      run GNU/Linux.  GDB needs to know about those registers to implement
      proper software single stepping, since they affect  what instruction
      will be next.
      This commit adds the code to check for the existance of "lp_start" and
      "lp_end" in XML target descriptions. If they exist, then the function
      reports that the target supports hardware loops.
      	* arc-tdep.c (arc_check_for_hardware_loop): New.
      	* arc-tdep.h (gdbarch_tdep): New field has_hw_loops.
      	* gdb.texinfo (Synopsys ARC): Document LP_START, LP_END and BTA.
    • Shahab Vahedi's avatar
      arc: Add inclusion of "gdbarch.h" in "arc-tdep.h" · 22459524
      Shahab Vahedi authored
      The "arc-tdep.h" makes use of definitions in "gdbarch.h", but it
      does not include it explicitly.  I have piggy backed this fix
      in another commit [1], but I was asked to do it separately [2].
      [1] arc: Add hardware loop detection
      [2] Simon's remarks to "arc: Add hardware loop detection"
      	* arc-tdep.h: Include "gdbarch.h".
    • Shahab Vahedi's avatar
      arc: Add ARCv2 XML target along with refactoring · 995d3a19
      Shahab Vahedi authored
      A few changes have been made to make the register support simpler,
      more flexible and extendible.  The trigger for most of these changes
      are the remarks [1] made earlier for v2 of this patch.  The noticeable
      improvements are:
      - The arc XML target features are placed under gdb/features/arc
      - There are two cores (based on ISA) and one auxiliary feature:
        v1-core: ARC600, ARC601, ARC700
        v2-core: ARC EM, ARC HS
        aux: common in both
      - The XML target features represent a minimalistic sane set of
        registers irrespective of application (baremetal or linux).
      - A concept of "feature" class has been introduced in the code.
        The "feature" object is constructed from BFD and GDBARCH data.
        It contains necessary information (ISA and register size) to
        determine which XML target feature to use.
      - A new structure (ARC_REGISTER_FEATURE) is added that allows
        providing index, names, and the necessity of registers. This
        simplifies the sanity checks and future extendibility.
      - Documnetation has been updated to reflect ARC features better.
      - Although the feature names has changed, there still exists
        backward compatibility with older names through
        find_obsolete_[core,aux]_names() functions.
      The last two points were inspired from RiscV port.
      	* arch/arc.h
      	  (arc_gdbarch_features): New class to stir the selection of target XML.
      	  (arc_create_target_description): Use FEATURES to choose XML target.
      	  (arc_lookup_target_description): Use arc_create_target_description
      	  to create _new_ target descriptions or return the already created
      	  ones if the FEATURES is the same.
      	* arch/arc.c: Implementation of prototypes described above.
      	* gdb/arc-tdep.h (arc_regnum enum): Add more registers.
      	  (arc_gdbarch_features_init): Initialize the FEATURES struct.
      	* arc-tdep.c (*_feature_name): Make feature names consistent.
      	  (arc_register_feature): A new struct to hold information about
      	  registers of a particular target/feature.
      	  (arc_check_tdesc_feature): Check if XML provides registers in
      	  compliance with ARC_REGISTER_FEATURE structs.
      	  (arc_update_acc_reg_names): Add aliases for r58 and r59.
      	  (determine_*_reg_feature_set): Which feature name to look for.
      	  (arc_gdbarch_features_init): Given MACH and ABFD, initialize FEATURES.
      	  (mach_type_to_arc_isa): Convert from a set of binutils machine types
      	  to expected ISA enums to be used in arc_gdbarch_features structs.
      	* features/Makefile (FEATURE_XMLFILES): Add new files.
      	* gdb/features/arc/v1-aux.c: New file.
      	* gdb/features/arc/v1-aux.xml: Likewise.
      	* gdb/features/arc/v1-core.c: Likewise.
      	* gdb/features/arc/v1-core.xml: Likewise.
      	* gdb/features/arc/v2-aux.c: Likewise.
      	* gdb/features/arc/v2-aux.xml: Likewise.
      	* gdb/features/arc/v2-core.c: Likewise.
      	* gdb/features/arc/v2-core.xml: Likewise.
      	* NEWS (Changes since GDB 9): Announce obsolence of old feature names.
      	* gdb.texinfo (Synopsys ARC): Update the documentation for ARC
      	* gdb.arch/arc-tdesc-cpu.xml: Use new feature names.
    • Simon Marchi's avatar
      gdb/testsuite: fix gdb.threads/stepi-random-signal.exp pattern (gdb/26532) · 8cac2b31
      Simon Marchi authored
      Commit 1eb8556f ("gdb: add infrun_debug_printf macro") changed the
      debug output format for `set debug infrun 1`.  The test
      gdb.threads/stepi-random-signal.exp uses that debug output, and was
      updated, but not correctly.  It results in this failure:
          FAIL: gdb.threads/stepi-random-signal.exp: stepi (no random signal)
      Fix it by adjusting the pattern in the test.
      	PR gdb/26532
      	* gdb.threads/stepi-random-signal.exp: Update pattern.
      Change-Id: If5fa525e9545e32a286effe6a6184358374bd37c
    • Simon Marchi's avatar
      gdb/testsuite: fix gdb.base/ui-redirect.exp pattern (gdb/26532) · 2bc19622
      Simon Marchi authored
      Commit 1eb8556f ("gdb: add infrun_debug_printf macro") changed the
      debug output format for `set debug infrun 1`.  It broke test
      gdb.base/ui-redirect.exp, which I missed:
          FAIL: gdb.base/ui-redirect.exp: debugging: continue
      Fix it by adjusting the pattern in the test to the new reality.
      	PR gdb/26532
      	* gdb.base/ui-redirect.exp: Update pattern.
      Change-Id: Ie8a8f6675e35a0cab55109b1534b44eb51baec9d
    • Gary Benson's avatar
      Fix ChangeLog entry for commit b04aa1fc · 8571e9c8
      Gary Benson authored
    • Mark Wielaard's avatar
      Fix the linker's handling of DWARF-5 line number tables. · c3757b58
      Mark Wielaard authored
      When building with gcc with -gdwarf-5 ld tests (including ld-elf/dwarf.exp)
      fail because they try to read the .debug_ranges section. But DWARF5
      introduces a new .debug_rnglists section that encodes the address ranges
      more efficiently. Implement reading the debug_rnglists in bfd/dwarf2.c.
      Which makes all tests pass again and fixes several gcc testsuite tests
      when defaulting to DWARF5.
      	*  dwarf2.c (struct dwarf2_debug_file): Add dwarf_rnglists_buffer
      	and dwarf_rnglists_size fields.
      	(dwarf_debug_sections): Add debug_rnglists.
      	(dwarf_debug_section_enum): Likewise.
      	(read_debug_rnglists): New function.
      	(read_rangelist): New function to call either read_ranges or
      	read_rnglists. Rename original function to...
      	(read_ranges): ...this.
      	(read_rnglists): New function.
    • Gary Benson's avatar
      Disable Clang's integrated assembler for two testcases · b04aa1fc
      Gary Benson authored
      gdb.dwarf2/dw2-dir-file-name.exp fails to build using Clang because
      the generated assembly language contains .ascii directives with more
      than one string literal.  gdb.dwarf2/dw2-restore.exp fails to build
      using Clang because it contains .func and .endfunc directives.
      This commit causes Clang to invoke the system assembler to assemble
      the relevant files.
      	* gdb.dwarf2/dw2-dir-file-name.exp: Use system assembler
      	when compiling with clang.
      	* gdb.dwarf2/dw2-restore.exp: Likewise
    • Gary Benson's avatar
      Enable gdb.cp/ambiguous.exp with GCC and clang · 9f68b453
      Gary Benson authored
      gdb.cp/ambiguous.exp failed to build using clang with the following
       gdb compile failed, /gdbtest/src/gdb/testsuite/gdb.cp/ambiguous.cc:70:36:
         warning: direct base 'A1' is inaccessible due to ambiguity:
           class JVA1 -> class KV -> class A1
           class JVA1 -> class A1 [-Winaccessible-base]
       class JVA1 : public KV, public LV, public A1 {
      This commit builds this testcase with -Wno-inaccessible-base when
      using clang, to avoid this failure.
      Furthermore, gdb.cp/ambiguous.exp has been disabled when using GCC
      since 1998.  This commit enables this testcase, building with
      -Wno-inaccessible-base when using GCC >= 10.1, and -w otherwise.
      	* gdb.cp/ambiguous.exp: Enable test when compiling with GCC.
      	Add additional_flags=-Wno-inaccessible-base when compiling
      	with GCC >= 10.1 or clang.  Add additional_flags=-w when
      	compiling with GCC < 10.
    • Alan Modra's avatar
      PR26505, ASAN: xstormy16_elf_relax_section elf32-xstormy16.c:595 · 1ab8d928
      Alan Modra authored
      	PR 26505
      	* elf32-xstormy16.c (xstormy16_elf_relax_section): Check
      	is_elf_hash_table before accessing elf fields.
    • Alan Modra's avatar
      PR26504, ASAN: parse_disassembler_options vax-dis.c:142 · 8640c87d
      Alan Modra authored
      	PR 26504
      	* vax-dis.c (parse_disassembler_options): Always add at least one
      	to entry_addr_total_slots.
    • Alan Modra's avatar
      PR26501, ASAN: tic54x_undefined_symbol tc-tic54x.c:5015 · 69ff2100
      Alan Modra authored
      	* gas/config/tc-tic54x.c (tic54x_undefined_symbol): Properly treat
      	misc_symbol_hash entries without values.
    • Alan Modra's avatar
      PR26500, ASAN: tic4x_inst_make tc-tic4x.c:1247 · 1de153a1
      Alan Modra authored
      	PR 26500
      	* tc-tic4x.c (tic4x_inst_make): Don't die on terminating insn
      	with name = "".
    • Alan Modra's avatar
      PR26482, ASAN: _bfd_xcoff_sizeof_headers coff-rs6000.c:2585 · a93ba4c0
      Alan Modra authored
      	PR 26482
      	* coff-rs6000.c (_bfd_xcoff_sizeof_headers): Ignore sections that
      	won't be output.
    • Alan Modra's avatar
      PR26463, ASAN: m32c_elf_relax_section elf32-m32c.c:1448 · 1438dd86
      Alan Modra authored
      	PR 26463
      	* elf32-m32c.c (m32c_elf_relax_section): Check is_elf_hash_table
      	before accessing elf fields.
    • Alan Modra's avatar
      PR26452, ASAN: som_compute_checksum som.c:4293 · 2186273a
      Alan Modra authored
      	PR 26452
      	* som.c (som_compute_checksum): XOR 32-bit words in header,
      	not unsigned long sized words.
    • Alan Modra's avatar
      PR26441, ASAN: get_b_cc tc-cr16.c:1521 · d3e0badd
      Alan Modra authored
      	PR 26441
      	* config/tc-cr16.c (get_b_cc): Return NULL early if op isn't
      	two or three chars, and don't bother copying.
    • Alan Modra's avatar
      PR26430, ASAN: nacl_modify_segment_map elf-nacl.c:164 · 0c1438eb
      Alan Modra authored
      	PR 26430
      	* elf-nacl.c (nacl_modify_segment_map): Correct alloc size and
      	amount copied for elf_segment_map defined with one element
      	sections array.
    • Alan Modra's avatar
      PR26426, ASAN: neon_quad tc-arm.c:15175 · 250dd99f
      Alan Modra authored
      	PR 26426
      	* config/tc-arm.c (do_neon_mvn, do_neon_swp): Bail out on
      	NS_NULL shape.
    • Alan Modra's avatar
      PR26422, ASAN: elf32_arm_final_link_relocate elf32-arm.c:10351 · d2327e47
      Alan Modra authored
      Always reading 32 bits in order to extract addends from instruction
      fields is wrong when the field size is smaller.  It also leads to
      reading past the end of the section.  This patch tidies that by
      reading the proper field size, which allows some later refetching of
      addends to disappear.
      	PR 26422
      	* elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
      	bfd_get_x size function to read addends out of fields.  Apply
      	rightshift adjustment too.  Don't apply the now unnecessary
      	howto->size shift to branch REL addends.  Don't refetch R_ARM_ABS8
      	and R_ARM_ABS16 addends.  Don't refetch thumb branch addends.
      	Correct R_ARM_THM_JUMP6 addend.
    • Alan Modra's avatar
      PR26419, ASAN: mn10300_elf_relax_section elf-m10300.c:3943 · b8ff233b
      Alan Modra authored
      	PR 26419
      	* elf-m10300.c (mn10300_elf_relax_section): Don't attempt access
      	before start of section.
    • Alan Modra's avatar
      PR26410, UBSAN: symbols.c:1818 · 30b940a0
      Alan Modra authored
      Don't memset(0,0,0).
      	PR 26410
      	* symbols.c (dollar_label_count, dollar_label_max): Make size_t.
      	(dollar_label_clear): Don't call memset with NULL pointer.
    • Alan Modra's avatar
      gas warning fixes · ca159256
      Alan Modra authored
      Some versions of gcc with -Werror=format-overflow complain about using
      a perfectly good 7 char buffer for "r%dr%d" when the int is between 0
      and 64, apparently not seeing the value range.
      note: __builtin___sprintf_chk output between 5 and 24 bytes into a destination of size 7
      	* config/tc-arc.c (declare_register_set): Avoid false positive
      	format-overflow warning.
      	* config/tc-epiphany.c (md_assemble): Likewise.
      	* config/tc-mips.c (md_begin): Likewise.
      	* config/tc-mmix.c (mmix_md_begin): Likewise.
      	* config/tc-nds32.c (nds32_elf_append_relax_relocs): Avoid false
      	positive "may be used uninitialized" warning.
    • Alan Modra's avatar
      tic54x ld testsuite · 8d303546
      Alan Modra authored
      	* testsuite/ld-libs/libs.exp: Don't run on sh-pe, tic30 or tic54x.
      	* testsuite/ld-scripts/data.d: xfail tic4x and tic54x.
      	* testsuite/ld-scripts/empty-address-2a.d: xfail tic54x.
      	* testsuite/ld-scripts/empty-address-2b.d: Likewise.
      	* testsuite/ld-scripts/include-1.d: xfail tic4x and tic54x.
      	* testsuite/ld-scripts/provide-1.d: xfail tic54x.
      	* testsuite/ld-scripts/provide-2.d: Likewise.
      	* testsuite/ld-scripts/provide-4.d: Likewise.
    • Gaius Mulley's avatar
      gdb/modula-2: parsing of multi-subscript arrays · 3945d2d7
      Gaius Mulley authored
      Fix bug PR m2/26372, GDB's inability to parse multi-dimensional
      modula-2 arrays.
      We previously had two rules for handling the parsing of array
      sub-scripts.  I have reproduced them here with the actual handler
      blocks removed to make the bug clearer:
        exp     :    exp '[' non_empty_arglist ']'
        exp     :    exp '[' exp ']'
                :       exp
                :       non_empty_arglist ',' exp
      This is ambiguous as the pattern "exp '[' exp" could match either of
      the 'exp' rules.  Currently it just so happens that the parser picks
      the second 'exp' rule which means we can only handle a single array
      As the handler code for the first 'exp' pattern will correctly handle
      and number of array indexes then lets just remove the second pattern.
      	PR m2/26372
              * m2-exp.y (exp): Improve comment for non_empty_arglist case, add
      	an assert.  Remove single element array indexing pattern as the
      	MULTI_SUBSCRIPT support will handle this case too.
      	PR m2/26372
              * gdb.modula2/multidim.c: New file.
              * gdb.modula2/multidim.exp: New file.
    • Andrew Burgess's avatar
    • Gaius Mulley's avatar
      Fix for Bug 26372 [Modula-2] Parsing of multi-subscript arrays · 07758bdf
      Gaius Mulley authored
      Here is a bugfix for Pr 26372 [Modula-2] Parsing of multi-subscript arrays.
      Also included is a dejagnu testcase.  No extra regressions are caused on
      Debian GNU/Linux Buster amd64.
      2020-08-25  Gaius Mulley  <gaiusmod2@gmail.com>
      	PR m2/26372
      	* m2-exp.y: Rewrite array subscript rules to support multidimension
      	array access.  (ArgumentList) replaces non_empty_arglist.
      2020-08-25  Gaius Mulley  <gaiusmod2@gmail.com>
      	PR m2/26372
      	* testsuite/gdb.modula2/multidim.exp: New file.
      	* testsuite/gdb.modula2/multidim.c: New file.
    • Simon Marchi's avatar
      gdb: move declaration of valprint_check_validity to valprint.h · 2677f2d3
      Simon Marchi authored
      The implementation is in valprint.c, so the declaration belongs in
      	* value.h (valprint_check_validity): Move declaration from
      	* valprint.h (valprint_check_validity): ... to here.
      Change-Id: Ibe577d3696720099e6d79888d4ee8e3c1bf05a26
    • GDB Administrator's avatar
      Automatic date update in version.in · 4cf3d79e
      GDB Administrator authored
  3. 24 Aug, 2020 4 commits
    • Simon Marchi's avatar
      gdb/testsuite: make runto always emit a FAIL on internal error · 60122dbe
      Simon Marchi authored
      I noticed that when a test uses `runto_main` and a GDB internal error
      happens while running to main, no error or fail is emitted.  This is
      because `runto_main` uses the `no-message` option of `runto`.
      As a result, if a test fails to run to main and exits, no sign that
      something went wrong is emitted.  For example, add this always-false
      assertion to compute_frame_id:
          --- a/gdb/frame.c
          +++ b/gdb/frame.c
          @@ -545,6 +545,7 @@ static void
           compute_frame_id (struct frame_info *fi)
             gdb_assert (!fi->this_id.p);
          +  gdb_assert (false);
             if (frame_debug)
               fprintf_unfiltered (gdb_stdlog, "{ compute_frame_id (fi=%d) ",
      ... and run gdb.dwarf2/dw2-align.exp.  No fail or sign that something
      went wrong is shown.  It just appears as if the test gets skipped.
      A developer introducing such a regression in this test today would
      likely notice it, because we are used to diff-ing test results.  So we
      would see some PASSes dispappear for no good reason and look into it.
      But I find it worrysome for two reasons:
      1. Scripts that analyze regressions (such as the one on the buildbot)
         may only look for new FAILs or new ERRORs.  It would probably miss
      2. Imagine that we one day have a testsuite that runs cleanly (some
         people might already run subsets of the testsuite and expect it to
         all pass), we would just run the testsuite and check that there are
         no fails.  It would be easy to miss something like this.
      In case of internal error, I suggest making `runto` emit a FAIL even if
      `no-message` was passed.  This is different from other failure modes
      that might be expected (whchi rightfully cause the test to simply be
      skipped).  An internal error is always bad, so if it happens it should
      noisily fail.
      	* lib/gdb.exp (runto): Always emit fail on internal error.
      Change-Id: I6e6faed4868ea821541a23042b2d01c30058b0d3
    • Simon Marchi's avatar
      gdb: add debug_prefixed_vprintf · c426fddb
      Simon Marchi authored
      To help ensure that all debug statements have the same format, introduce
      the debug_prefixed_vprintf helper.  Implement linux_nat_debug_printf_1
      and infrun_debug_printf_1 with it.
      I would eventually like to style the module and function name with some
      color, to help them stick out, but I don't really know how to do that
      yet, it can always be done later.
      	* debug.h: New file.
      	* debug.c (debug_prefixed_vprintf): New function.
      	* infrun.c (infrun_debug_printf_1): Use debug_prefixed_vprintf.
      	* linux-nat.c (linux_nat_debug_printf_1): Likewise.
      Change-Id: Iccc290a2dc6b5fffcbe1c2866ed8d804ad380764
    • Simon Marchi's avatar
      gdb: add infrun_debug_printf macro · 1eb8556f
      Simon Marchi authored
      Introduce this macro to print debug statements in the infrun.c file,
      same idea as what was done in 9327494e ("gdb: add
      linux_nat_debug_printf macro").
      Although in this case, there are places outside infrun.c that print
      debug statements if debug_infrun is set.  So the macro has to be
      declared in the header file, so that it can be used in these other
      Note one special case.  In stop_all_threads, I've used an explicit
          if (debug_infrun)
            infrun_debug_printf_1 ("stop_all_threads", "done");
      for the message in the SCOPE_EXIT.  Otherwise, the message appears like
        [infrun] operator(): done
      Until we find a better solution for extracting a meaningful function
      name for lambda functions, I think it's fine to handle these special
      cases manually, they are quite rare.
      Some tests need to be updated, because they rely on some infrun debug
      	* infrun.h (infrun_debug_printf_1): New function declaration.
      	(infrun_debug_printf): New macro.
      	* infrun.c (infrun_debug_printf_1): Use infrun_debug_printf
      	(infrun_debug_printf): New function.
      	* breakpoint.c (should_be_inserted): Use infrun_debug_printf.
      	(handle_jit_event): Likewise.
      	* gdb.base/gdb-sigterm.exp (do_test): Update expected regexp.
      	* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
      	* gdb.threads/stepi-random-signal.exp: Likewise.
      Change-Id: I66433c8a9caa64c8525ab57c593022b9d1956d5c
    • Alan Modra's avatar
      elf_hash_table_id access · 0f55320b
      Alan Modra authored
      	* elf-m10300.c (elf32_mn10300_hash_table): Test is_elf_hash_table
      	before accessing elf_hash_table_id.
      	* elf32-arc.c (elf_arc_hash_table): Likewise.
      	* elf32-arm.c (elf32_arm_hash_table): Likewise.
      	* elf32-avr.c (avr_link_hash_table): Likewise.
      	* elf32-bfin.c (bfinfdpic_hash_table): Likewise.
      	* elf32-cris.c (elf_cris_hash_table): Likewise.
      	* elf32-csky.c (csky_elf_hash_table): Likewise.
      	* elf32-frv.c (frvfdpic_hash_table): Likewise.
      	* elf32-hppa.c (hppa_link_hash_table): Likewise.
      	* elf32-lm32.c (lm32_elf_hash_table): Likewise.
      	* elf32-m32r.c (m32r_elf_hash_table): Likewise.
      	* elf32-m68hc1x.h (m68hc11_elf_hash_table): Likewise.
      	* elf32-m68k.c (elf_m68k_hash_table): Likewise.
      	* elf32-metag.c (metag_link_hash_table): Likewise.
      	* elf32-microblaze.c (elf32_mb_hash_table): Likewise.
      	* elf32-nds32.h (nds32_elf_hash_table): Likewise.
      	* elf32-or1k.c (or1k_elf_hash_table): Likewise.
      	* elf32-s390.c (elf_s390_hash_table): Likewise.
      	* elf32-sh.c (sh_elf_hash_table): Likewise.
      	* elf32-spu.c (spu_hash_table): Likewise.
      	* elf32-tilepro.c (tilepro_elf_hash_table): Likewise.
      	* elf32-xtensa.c (elf_xtensa_hash_table): Likewise.
      	* elf64-alpha.c (alpha_elf_hash_table): Likewise.
      	* elf64-hppa.c (hppa_link_hash_table): Likewise.
      	* elf64-ia64-vms.c (elf64_ia64_hash_table): Likewise.
      	* elf64-s390.c (elf_s390_hash_table): Likewise.
      	* elfnn-ia64.c (elfNN_ia64_hash_table): Likewise.
      	* elfnn-riscv.c (riscv_elf_hash_table): Likewise.
      	* elfxx-mips.c (mips_elf_hash_table): Likewise.
      	* elfxx-sparc.h (_bfd_sparc_elf_hash_table): Likewise.
      	* elfxx-tilegx.c (tilegx_elf_hash_table): Likewise.