Skip to content
Snippets Groups Projects
  1. Mar 13, 2023
    • Andrew Burgess's avatar
      gdbarch: improve generation of validation in gdbarch getters · c317ea57
      Andrew Burgess authored
      
      We currently generate some validation code within the gdbarch getter
      methods.
      
      This commit adjusts the algorithm used to generate this validation
      slightly to make the gdbarch.py code (I think) clearer; there's no
      significant changes to what is generated.
      
      The validation algorithm for gdbarch values is now:
      
        - If the Value has an 'invalid' field that is a string, use that for
          validation,
      
        - If the Value has its 'predicate' field set to true, then check the
          predicate returns true, this ensures the predicate has been
          called,
      
        - If the Value has its 'invalid' field set to True, or the Value has
          'postdefault' field, then check the fields has changed from its
          initial value,
      
        - Otherwise no validation is performed.
      
      The only changes after this commit are:
      
        - Some comments change slightly, and
      
        - For 'gcore_bfd_target' and 'max_insn_length' we now validate by
          calling the predicate rather than checking the field value
          directly, the underlying check being performed is unchanged
          though.
      
      There should be no user visible changes after this commit.
      
      Approved-By: default avatarSimon Marchi <simon.marchi@efficios.com>
      c317ea57
    • Andrew Burgess's avatar
      gdbarch: use predefault for more value components within gdbarch · 35079684
      Andrew Burgess authored
      
      For some reason the following value components of gdbarch:
      
        bfloat16_format
        half_format
        float_format
        double_format
        long_double_format
        so_ops
      
      All use a postdefault but no predefault to set the default value for
      the component.
      
      As the postdefault values for these components are all constant
      pointers that don't depend on other fields within the gdbarch, then I
      don't see any reason why we couldn't use a predefault instead.
      
      So lets do that.
      
      Approved-By: default avatarSimon Marchi <simon.marchi@efficios.com>
      35079684
    • Andrew Burgess's avatar
      gdb/gdbarch: remove the 'invalid=None' state from gdbarch_components.py · 6e2d282d
      Andrew Burgess authored
      
      This commit ensures that the 'invalid' property of all components is
      either True, False, or a string.
      
      Additionally, this commit allows a component to have both a predicate
      and for the 'invalid' property to be a string.
      
      Removing the option for 'invalid' to be None allows us to simplify the
      algorithms in gdbarch.py a little.
      
      Allowing a component to have both a predicate and an 'invalid' string
      means that we can validate the value that a tdep sets into a field,
      but also allow a predicate to ensure that the field has changed from
      the default.
      
      This functionality isn't going to be used in this series, but I have
      tested it locally and believe that it would work, and this might make
      it easier for others to add new components in the future.
      
      In gdbarch_types.py, I've updated the type annotations to show that
      the 'invalid' field should not be None, and I've changed the default
      for this field from None to False.
      
      The change to using False as the default is temporary.  Later in this
      series I'm going to change the default to True, but we need more fixes
      before that can be done.
      
      Additionally, in gdbarch_types.py I've removed an assert from
      Component.get_predicate.  This assert ensured that we didn't have the
      predicate field set to True and the invalid field set to a string.
      However, no component currently uses this configuration, and after
      this commit, that combination is now supported, so the assert can be
      removed.
      
      As a consequence of the gdbarch_types.py changes we see some
      additional comments generated in gdbarch.c about verification being
      skipped due to the invalid field being False.  This comment is inline
      with plenty of other getters that also have a similar comment.  Plenty
      of the getters do have validation, so I think it is reasonable to have
      a comment noting that the validation has been skipped for a specific
      reason, rather than due to some bug.
      
      In gdbarch_components.py I've had to add 'invalid=True' for two
      components: gcore_bfd_target and max_insn_length, without this the
      validation in the gdbarch getter would disappear.
      
      And in gdbarch.py I've reworked the logic for generating the
      verify_gdbarch function, and for generating the getter functions.
      
      The logic for generating the getter functions is still not ideal,  I
      ended up having to add this additional logic block:
      
        elif c.postdefault is not None and c.predefault is not None:
            print("  /* Check variable changed from pre-default.  */", file=f)
            print(f"  gdb_assert (gdbarch->{c.name} != {c.predefault});", file=f)
      
      which was needed to ensure we continued to generate the same code as
      before, without this the fact that invalid is now False when it would
      previously have been None, meant that we dropped the gdb_assert in
      favour of a comment like:
      
        print(f"  /* Skip verify of {c.name}, invalid_p == 0 */", file=f)
      
      which is clearly not a good change.  We could potentially look at
      improving this in a later commit, but I don't plan to do that in this
      series.
      
      Approved-By: default avatarSimon Marchi <simon.marchi@efficios.com>
      6e2d282d
    • Andrew Burgess's avatar
      gdb/gdbarch: split postdefault setup from invalid check in gdbarch.py · 74b1406e
      Andrew Burgess authored
      
      Restructure how gdbarch.py generates the verify_gdbarch function.
      Previously the postdefault handling was bundled together with the
      validation.  This means that a field can't have both a postdefault,
      and set its invalid attribute to a string.
      
      This doesn't seem reasonable to me, I see no reason why a field can't
      have both a postdefault (used when the tdep doesn't set the field),
      and an invalid expression, which can be used to validate the value
      that a tdep might set.
      
      In this commit I restructure the verify_gdbarch generation code to
      allow the above, there is no change in the actual generated code in
      this commit, that will come in later commit.
      
      Approved-By: default avatarSimon Marchi <simon.marchi@efficios.com>
      74b1406e
    • Andrew Burgess's avatar
      gdb/gdbarch: remove yet more 'invalid=True' from gdbarch_components.py · 0605df70
      Andrew Burgess authored
      
      Following on from the previous commit, this commit removes yet more
      'invalid=True' lines from gdbarch_components.py where the invalid
      setting has no effect.
      
      Due to the algorithm used in gdbarch.py for generated verify_gdbarch,
      if a component has a postdefault value then no invalid check will ever
      be generated for the component, as such setting 'invalid=True' on the
      component is pointless.  This commit removes the setting of invalid.
      
      There is no change in the generated code after this commit.
      
      Approved-By: default avatarSimon Marchi <simon.marchi@efficios.com>
      0605df70
    • Andrew Burgess's avatar
      gdb/gdbarch: remove unused 'invalid=True' from gdbarch_components.py · 021c14f6
      Andrew Burgess authored
      
      Due to the algorithm used to generate verify_gdbarch in gdbarch.py, if
      a component has a predicate, then a validation check will never be
      generated.
      
      There are a bunch of components that are declared with both a
      predicate AND have 'invalid=True' set.  The 'invalid=True' has no
      effect.
      
      In this commit I clean things up by removing all these additional
      'invalid=True' lines.  There's no change in any of the generated files
      after this commit.
      
      Approved-By: default avatarSimon Marchi <simon.marchi@efficios.com>
      021c14f6
    • Tom Tromey's avatar
      Fix crash in inside_main_func · 5f056fcb
      Tom Tromey authored
      gdb 13.1 crashes while running the rust compiler's debugger tests.
      The crash has a number of causes.
      
      First, the rust compiler still uses the C++-like _Z mangling, but with
      its own twist -- some hex digits added to the end of a symbol.  So,
      while gdb finds the correct name of "main":
      
      (top-gdb) p name
      $13 = 0x292e0c0 "rustc_gdb_1031745::main"
      
      It isn't found in the minsyms, because C++ demangling yields:
      
      [99] t 0x90c0 _ZN17rustc_gdb_10317454main17h5b5be7fe16a97225E section .text  rustc_gdb_1031745::main::h5b5be7fe16a97225  zko06yobckx336v
      
      This could perhaps be fixed.  I also filed a new PR to suggest
      preferring the linkage name of the main program.
      
      Next, the rust compiler emits both a DW_TAG_subprogram and a
      DW_TAG_namespace for "main".  This happens because the file is named
      "main.rs" -- i.e., the bug is specific to the source file name.  The
      crash also seems to require the nested function inside of 'main', at
      least for me.  The namespace always is generated, but perhaps this
      changes the ordering in the DWARF.
      
      When inside_main_func looks up the main symbol, it finds the namespace
      symbol rather than the function.  (I filed a bug about fixing gdb's
      symbol tables -- long overdue.)
      
      Meanwhile, as I think it's important to fix this crash sooner rather
      than later, this patch changes inside_main_func to check that the
      symbol that is found is LOC_BLOCK.  This perhaps should have been done
      in the first place, anyway.
      
      Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30158
      
      5f056fcb
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.python/tui-window-factory.exp for remote host · 7fee66ab
      Tom de Vries authored
      When running gdb.python/tui-window.exp with host board
      local-remote-host-notty and target board native-gdbserver, I get:
      ...
      FAIL: gdb.python/tui-window-factory.exp: msg_2: \
        check test_window box (box check: ul corner is l, not +)
      ...
      
      The problem is that the result of Term::prepare_for_tui is not checked.
      
      Fix this by adding the missing check.
      
      Tested on x86_64-linux.
      7fee66ab
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.python/tui-window.exp for remote host · 1cdf05cd
      Tom de Vries authored
      When running gdb.python/tui-window.exp with host board
      local-remote-host-notty and target board native-gdbserver, I get:
      ...
      UNSUPPORTED: gdb.python/tui-window.exp: TUI not supported
      FAIL: gdb.python/tui-window.exp: test title
      ...
      
      Fix this by adding the missing return after the unsupported.
      
      Tested on x86_64-linux.
      1cdf05cd
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.tui/completion.exp for local-remote-host-notty · 0020d62f
      Tom de Vries authored
      When running test-case gdb.tui/completion.exp with host board
      local-remote-host-notty and target board native-gdbserver, I get:
      ...
      FAIL: gdb.tui/completion.exp: completion of layout names: \
        tab completion (timeout)
      ...
      
      The test-case contains a few tests that do tab completion, which requires
      readline, which is unavailable with host board local-remote-host-notty.
      
      Fix this by adding the missing check for readline_is_used.
      
      Tested on x86_64-linux.
      0020d62f
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.tui/tui-layout.exp for remote host · e1b8f529
      Tom de Vries authored
      When running test-case gdb.tui/tui-layout.exp with host board
      local-remote-host-notty and target board native-gdbserver, I get:
      ...
      FAIL: gdb.tui/tui-layout.exp: terminal=dumb: execution=false: layout=asm: \
        layout asm (timeout)
      ...
      
      The problem is that the test-case expects that the default "setenv TERM dumb"
      has effect, which is not the case for remote host.
      
      Fix this by skipping the test for remote host.
      
      Tested on x86_64-linux.
      e1b8f529
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.tui/tui-nl-filtered-output.exp for remote host · b91f1604
      Tom de Vries authored
      When running test-case gdb.tui/tui-nl-filtered-output.exp with host board
      local-remote-host-notty and target board native-gdbserver, I get:
      ...
      FAIL: gdb.tui/tui-nl-filtered-output.exp: check printf output
      ...
      
      The problem is that Term::enter_tui is returning 0, but the test-case doesn't
      check for this, and consequently runs unsupported tests.
      
      Fix this by adding the missing check.
      
      Tested on x86_64-linux.
      b91f1604
    • Tom de Vries's avatar
      [gdb/testsuite] Require ![is_remote host] for TUI · 72f160d0
      Tom de Vries authored
      When running test-case gdb.tui/corefile-run.exp with both host and target board
      local-remote-host-native.exp, we run into:
      ...
      FAIL: gdb.tui/corefile-run.exp: load corefile
      ...
      while this passes with USE_TUI=0.
      
      The problem is that the TUI setup code uses "setenv TERM ansi", which has no
      effect on remote host.
      
      I can confirm this analysis by working around this problem in
      local-remote-host-native.exp like this:
      ...
      -    spawn $RSH -t -l $username $remote $cmd
      +    spawn $RSH -t -l $username $remote "export TERM=ansi; $cmd"
      ...
      
      For now, simply make TUI unsupported for remote host, by returning 0 in
      prepare_for_tui.
      
      Tested on x86_64-linux.
      72f160d0
    • Tom de Vries's avatar
      [gdb/testsuite] Handle USE_TUI in gdb.tui/corefile-run.exp · 6b81ded4
      Tom de Vries authored
      Once in a while I find myself rewriting a TUI test-case into a non-TUI
      test-case, to better understand whether the problem I'm looking at is
      related to the TUI or not.
      
      I've got the impression that I've done this sufficiently often that it's worth
      committing the non-TUI version, so having just written a non-TUI version of
      gdb.tui/corefile-run.exp, let's commit it.
      
      The non-TUI version can be enabled by doing:
      ...
      $ make check "RUNTESTFLAGS=gdb.tui/corefile-run.exp USE_TUI=0"
      ...
      
      Also remove hard-coding of a source line number.
      
      Tested on x86_64-linux.
      6b81ded4
    • Tom de Vries's avatar
      [gdb/testsuite] Fix untested message in gdb.tui/corefile-run.exp · ed7d5797
      Tom de Vries authored
      In test-case gdb.tui/corefile-run.exp, we have this bit:
      ...
      require !use_gdb_stub
      if { [target_info gdb_protocol] == "extended-remote" } {
          untested "not supported"
          return
      }
      ...
      
      So with target board native-gdbserver we get:
      ...
      UNSUPPORTED: gdb.tui/corefile-run.exp: require failed: !use_gdb_stub
      ...
      and with target board native-extended-gdbserver instead:
      ...
      UNTESTED: gdb.tui/corefile-run.exp: not supported
      ...
      
      Fix this by:
      - adding an optional argument target_description to proc
        target_can_use_run_cmd
      - handling the target_description == core &&
        [target_info gdb_protocol] == "extended-remote" case in the proc
      - using require {target_can_use_run_cmd core}
      such that now in both cases we have:
      ...
      UNSUPPORTED: gdb.tui/corefile-run.exp: require failed: \
        target_can_use_run_cmd core
      ...
      
      Tested on x86_64-linux.
      ed7d5797
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.threads/step-bg-decr-pc-switch-thread.exp for native-gdbserver · 275589d9
      Tom de Vries authored
      With test-case gdb.threads/step-bg-decr-pc-switch-thread.exp and target board
      native-gdbserver, I run into:
      ...
      (gdb) UNSUPPORTED: gdb.threads/step-bg-decr-pc-switch-thread.exp: \
        switch to main thread
      Remote debugging from host ::1, port 43914^M
      monitor exit^M
      Cannot execute this command while the target is running.^M
      Use the "interrupt" command to stop the target^M
      and then try again.^M
      (gdb) WARNING: Timed out waiting for EOF in server after monitor exit
      ...
      
      Fix this by following the advice and issuing an interrupt command, allowing
      the following monitor exit command to succeed.
      
      Tested on x86_64-linux.
      275589d9
    • Bruno Larsen's avatar
      [gdb/obvious]: fix python formatting for test gdb.python/py-typeprint.py · 1878b6b5
      Bruno Larsen authored
      python black formatter was complaining about the formatting of
      gdb.python/py-typeprint.py, so this commit corrects it.
      1878b6b5
    • Bruno Larsen's avatar
      gdb/testsuite: add regression test for per-objfile typeprinters · 83b75511
      Bruno Larsen authored
      
      PR python/17136 reported an unhandled exception when using typeprinters
      only valid on some objfiles, rather than being a global typeprinter. The
      fix was accepted without a regression test, and we've been carrying one
      out-of-tree for a while but I think it's worth upstreaming. The code
      itself was developed by Jan Kratochvil.
      
      Co-Authored-By: default avatarJan Kratochvil <jkratochvil@azul.com>
      Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=17136
      
      
      Reviewed-By: default avatarAndrew Burgess <aburgess@redhat.com>
      Approved-By: default avatarTom Tromey <tom@tromey.com>
      83b75511
    • Tom Tromey's avatar
      Remove dead code from scalar_binop · 349a125d
      Tom Tromey authored
      
      scalar_binop has code for "&&" and "||", but I think this code can't
      currently be run -- and, furthermore, it doesn't make sense to have
      this code here, as the point of these operators is to short-circuit
      evaluation.
      
      This patch removes the dead code.
      
      Regression tested on x86-64 Fedora 36.
      
      Approved-by: default avatarKevin Buettner <kevinb@redhat.com>
      349a125d
    • Luis Machado's avatar
      aarch64: Expand documentation of XML features · d7001b29
      Luis Machado authored
      Similar to the arm target documentation situation, the documentation of the
      XML features for AArch64 targets is rather brief.  I have received the same
      feedback that what gdb carries in the documentation is quite unclear from the
      perspective of what debugging servers should define in the XML features, how and
      what the outcome is in gdb.
      
      This patch attempts to clarify a bit more what all the possible features are.
      d7001b29
    • Luis Machado's avatar
      arm: Expand documentation of XML features · e0994165
      Luis Machado authored
      The documentation of the XML features for Arm targets is very brief.  I have
      received feedback saying it is quite unclear from the perspective of the
      debugging servers what should be defined in the XML features, how and
      what the outcome is in gdb.
      
      This patch attempts to clarify a bit more what all the possible features are.
      e0994165
    • GDB Administrator's avatar
      Automatic date update in version.in · c15e75c4
      GDB Administrator authored
      c15e75c4
  2. Mar 12, 2023
  3. Mar 11, 2023
  4. Mar 10, 2023
    • Vladimir Mezentsev's avatar
      gprofng: PR30195 [display text] Source code location can not be found · f4bcff7c
      Vladimir Mezentsev authored
      gprofng/ChangeLog
      2023-03-10  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>
      
      	PR gprofng/30195
      	gprofng/src/DwarfLib.cc (DwrLineRegs::reset): Set 'file = 1;'.
      f4bcff7c
    • John Baldwin's avatar
      PR gdb/30214: Prefer local include paths to system include paths · a2fbb690
      John Baldwin authored
      Some systems may install binutils headers into a system location
      (e.g. /usr/local/include on FreeBSD) which may also include headers
      for other external packages used by GDB such as zlib or zstd.  If a
      system include path such as /usr/local/include is added before local
      include paths to directories within a clone or release tarball, then
      headers from the external binutils package are used which can result
      in build failures if the external binutils package is out of sync with
      the version of GDB being built.
      
      To fix, sort the include paths in INTERNAL_CFLAGS_BASE to add CFLAGS
      for "local" componenets before external components.
      
      Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30214
      
      
      Reviewed-By: default avatarTom Tromey <tom@tromey.com>
      a2fbb690
    • Fangrui Song's avatar
      ld: Allow R_386_GOT32 for call *__tls_get_addr@GOT(%reg) · 2cef4842
      Fangrui Song authored
      Similar to d58854b6 for x86_64.
      
      _Thread_local int a;
      int main() { return a; }
      
      % gcc -m32 -fno-plt -fpic a.c -fuse-ld=bfd -Wa,-mrelax-relocations=no
      /usr/bin/ld.bfd: /tmp/ccR8Yexy.o: TLS transition from R_386_TLS_GD to R_386_TLS_IE_32 against `a' at 0x15 in section `.text' failed
      /usr/bin/ld.bfd: failed to set dynamic section sizes: bad value
      collect2: error: ld returned 1 exit status
      
      This commit fixes the issue.
      
      There is an argument that the -fno-plt TLS sequence was added after
      R_386_GOT32X was required for call *func@GOT(%ebx), so R_386_GOT32 was
      intended to be unsupported.
      
      Unfortunately this standpoint has caused interop difficulty: some
      projects specify -mrelax-relocations=no to build relocatable object
      files compatible with older linkers (e.g.
      https://github.com/IHaskell/IHaskell/issues/636) or do so by accident
      (e.g. https://github.com/rust-lang/rust/pull/106511 not addressed as of
      today).  Many uses have not been cleaned up in practice, and compiling
      with -fno-plt will lead to the `TLS transition from R_386_TLS_GD ...`
      error which is hard to reason about.
      
      It seems easier to apply this simple change to prevent the footgun.
      
          PR ld/24784
          * bfd/elf32-i386.c (elf_i386_check_tls_transition): Allow R_386_GOT32.
      2cef4842
    • Fangrui Song's avatar
      ld: Allow R_X86_64_GOTPCREL for call *__tls_get_addr@GOTPCREL(%rip) · d58854b6
      Fangrui Song authored
      _Thread_local int a;
      int main() { return a; }
      
      % gcc -fno-plt -fpic a.c -fuse-ld=bfd -Wa,-mrelax-relocations=no
      /usr/bin/ld.bfd: /tmp/ccSSBgrg.o: TLS transition from R_X86_64_TLSGD to R_X86_64_GOTTPOFF against `a' at 0xd in section `.text' failed
      /usr/bin/ld.bfd: failed to set dynamic section sizes: bad value
      collect2: error: ld returned 1 exit status
      
      This commit fixes the issue.
      
      There is an argument that the -fno-plt TLS sequence was added after
      R_X86_64_GOTPCRELX was required for call, so R_X86_64_GOTPCREL was
      intended to be unsupported.
      
      Unfortunately this standpoint has caused interop difficulty: some
      projects specify -mrelax-relocations=no to build relocatable object
      files compatible with older linkers (e.g.
      https://github.com/IHaskell/IHaskell/issues/636) or do so by accident
      (e.g. https://github.com/rust-lang/rust/pull/106511 not addressed as of
      today).  Many uses have not been cleaned up in practice, and compiling
      with -fno-plt will lead to the `TLS transition from R_X86_64_TLSGD ...`
      error which is hard to reason about.
      
      There is another argument which may be weaker but relevant to the
      necessity of -mrelax-relocations=no: HWAddressSanitizer x86-64 will
      likely need some assembler support to disable relaxation.  Without the
      support and if the compiler needs to support many gas version, the
      simplest solution would be to use -Wa,-mrelax-relocations=no.
      
          PR ld/24784
          * bfd/elf64-x86-64.c (elf_x86_64_check_tls_transition): Allow
            R_X86_64_GOTPCREL.
      d58854b6
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.python/py-completion.exp · 7f3294a9
      Tom de Vries authored
      With test-case gdb.python/py-completion.exp and target board
      native-extended-gdbserver I get this warning:
      ...
      (gdb) PASS: gdb.python/py-completion.exp: discard #2
      completefilecommandcond $outputs/gdb.python/py-completion/py-completion-t^G\
        PASS: gdb.python/py-completion.exp: completefilecommandcond completion
      Remote debugging from host ::1, port 53346^M
      monitor exit^M
      not implemented^M
      (gdb) WARNING: Timed out waiting for EOF in server after monitor exit
      ...
      
      Fix this by adding the missing "discard #3", such that we have instead:
      ...
      (gdb) PASS: gdb.python/py-completion.exp: discard #2
      completefilecommandcond $outputs/gdb.python/py-completion/py-completion-t^G\
        PASS: gdb.python/py-completion.exp: completefilecommandcond completion
       ^M
      not implemented^M
      (gdb) PASS: gdb.python/py-completion.exp: discard #3
      Remote debugging from host ::1, port 36278^M
      monitor exit^M
      (gdb)
      ...
      
      Tested on x86_64-linux.
      7f3294a9
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.python/py-cmd.exp · 254de262
      Tom de Vries authored
      [ Using $pp as shorthand for the pagination prompt
      "--Type <RET> for more, q to quit, c to continue without paging--". ]
      
      The test-case gdb.python/py-cmd.exp passes, but the handling of the
      test_multiline command output looks a bit odd:
      ...
      (gdb) test_multiline
      test_multiline output
        ...
      test_multiline output
      $ppPASS: gdb.python/py-cmd.exp: verify pagination from test_multiline
      q
      test_multiline
      Quit
      (gdb) test_multiline
      test_multiline output
        ...
      test_multiline output
      $ppPASS: gdb.python/py-cmd.exp: verify pagination from test_multiline: q
      ...
      
      What happens is:
      - a test_multiline command is issued
      - some output is printed, followed by a pagination prompt
      - the test-case concludes that pagination occurred, and produces a PASS
      - "q\n" is replied to the pagination prompt
      - without waiting for response to the "q\n", another test_multiline command is
        issued
      - in response to the "q\n" we get "Quit\n(gdb) "
      - some output is printed, followed by a pagination prompt
      - the test-case concludes that there's a valid response to the "q\n", and
        produces a PASS, consuming the second pagination prompt, but without a reply.
      
      My conclusion is that the second test_multiline command is unintentional, so fix
      this by removing it.
      
      Without it, we have the more straightforward:
      ...
      (gdb) test_multiline
      test_multiline output
        ...
      test_multiline output
      $ppPASS: gdb.python/py-cmd.exp: verify pagination from test_multiline
      q
      Quit
      (gdb) PASS: gdb.python/py-cmd.exp: verify pagination from test_multiline: q
      ...
      
      This also fixes the following warning with target board native-gdbserver:
      ...
      WARNING: Timed out waiting for EOF in server after monitor exit
      ...
      
      Tested on x86_64-linux.
      254de262
    • Tom de Vries's avatar
      [gdb/testsuite] Fix py-autoloaded-pretty-printers-in-newobjfile-event.exp for remote target · ddc003b7
      Tom de Vries authored
      With test-case gdb.python/py-autoloaded-pretty-printers-in-newobjfile-event.exp
      and target board remote-gdbserver-on-localhost, I run into:
      ...
      FAIL: $exp: runto: run to main
      ...
      
      I can easily fix this using "gdb_load_shlib $binfile_lib", but then run into:
      ...
      (gdb) print all_good^M
      $1 = false^M
      (gdb) FAIL: $exp: print all_good
      info pretty-printer^M
      ...
      
      Sysroot is set to "target:", so gdb downloads the shared library from the target
      (Using $so as shorthand for
      libpy-autoloaded-pretty-printers-in-newobjfile-event.so):
      ...
      Reading /home/remote-target/$so from remote target...^M
      ...
      and internally refers to it as "target:/home/remote-target/$so".
      
      In load_auto_scripts_for_objfile, gdb gives up trying to auto-load scripts
      for $so once it checks for is_target_filename.
      
      Fix this by declaring auto-load unsupported if sysroot starts with "target:".
      
      Tested on x86_64-linux.
      ddc003b7
    • Tom de Vries's avatar
      [gdb/testsuite] Fix gdb.python/py-event-load.exp for remote target · 69b956fb
      Tom de Vries authored
      Fix test-case gdb.python/py-event-load.exp for target board
      remote-gdbserver-on-localhost using gdb_download_shlib.
      
      Tested on x86_64-linux.
      69b956fb
    • Tom Tromey's avatar
      Use require with test_compiler_info · 6349d27e
      Tom Tromey authored
      One spot that checks test_compiler_info can be switched to use
      'require'.
      
      
      6349d27e
    • Tom Tromey's avatar
      More uses of require with istarget · 24d59b55
      Tom Tromey authored
      I found a few more spots that check istarget that can be switched to
      use 'require'.
      
      
      24d59b55
Loading