Fix test failures (timeout)
authorLaurent Morichetti <laurent.morichetti@amd.com>
Sun, 22 Dec 2019 05:07:31 +0000 (21:07 -0800)
committerLaurent Morichetti <laurent.morichetti@amd.com>
Sun, 22 Dec 2019 05:07:31 +0000 (21:07 -0800)
commit86e751f51e687b88e0c39333c34fed59da893d15
tree18f5d1492ec57c196503dcdd29e191889f3b5e2a
parent2541cd93f3288c2c291c28c5c5fa57901fb763ad
Fix test failures (timeout)

The following tests:

  - gdb.base/catch-fork-kill.exp
  - gdb.base/coredump-filter.exp
  - gdb.base/corefile.exp
  - gdb.base/multi-forks.exp
  - gdb.multi/watchpoint-multi-exit.exp
  - gdb.threads/fork-plus-threads.exp
  - gdb.threads/gcore-thread.exp
  - gdb.threads/process-dies-while-detaching.exp

timeout after a target, for which amd_dbgapi_process_attach failed,
terminates. When amd_dbgapi_process_attach fails, the notifier file
desriptor is left uninitialized, and rocm_target_inferior_exit ends
up closing stdin. Without stdin, gdb no longer receives any input
and hangs.

amd_dbapi_notifier should have a default value of -1 (not a valid
file descriptor), and rocm_target_inferior_exit should test the
notifier file descriptor before closing it.

gdb/ChangeLog:

        * rocm-tdep.c (rocm_inferior_info::process_id): Initialize.
        (rocm_inferior_info::notifier): Initialize.
        (rocm_target_inferior_exit): Test notifier before closing.

Change-Id: Ib7e2404440cb377a1e5235d24844aab70f801eb7
gdb/rocm-tdep.c
This page took 0.024085 seconds and 4 git commands to generate.