[0/4] gdbserver/testsuite : Capture gdbserver debug output during testing

Message ID 20190416101729.16176-1-alan.hayward@arm.com
Headers show
Series
  • gdbserver/testsuite : Capture gdbserver debug output during testing
Related show

Message

Alan Hayward April 16, 2019, 10:17 a.m.
Trying to debug some of the racy failures when running native-gdbserver, I
found it would be very useful to enable the debug output from gdbserver.
However, doing this results in the output getting mixed with the standard
test output causing the testsuite to fall over horribly, with most tests
timing out.

This set of patches adds a flag to gdbserver to send all debug output to a
file, makes sure none of gdbserver writes to stderr directly, and adds a
board option to use the flags.  Using this board option, debug is safely 
sent to gdbserver.log in the directory for each test, without effecting the
test itself.

I've added two board files native-gdbserver-debug and
native-remote-gdbserver-debug that auto enable all the debug. When testing I
found no regressions when switching from the original non-debug versions.

Example results of a test after a testsuite run:
$ ls -lh outputs/gdb.base/arrayidx/
total 64K
-rwxrwxr-x 1 alahay01 alahay01  11K Apr 16 10:57 arrayidx
-rw-rw-r-- 1 alahay01 alahay01 6.4K Apr 16 10:57 gdb.log
-rw-rw-r-- 1 alahay01 alahay01  37K Apr 16 10:57 gdbserver.log
-rw-rw-r-- 1 alahay01 alahay01  901 Apr 16 10:57 gdb.sum

I don't think these options should be on in any of the exisiting boards as
they could effect the timings of the test.

The first patch is a cleanup which I'm happy to delete if people disagree.

Not sure if I should add a statement to the NEWS file (can add in a follow
on patch).


Alan Hayward (4):
  gdbserver: Move remote_debug to a single place
  gdbserver: Add debug-file option
  gdbserver: Ensure all debug output uses debug functions
  testsuite: Add option to capture gdbserver debug

 gdb/doc/gdb.texinfo                           | 16 +++++-
 gdb/gdbserver/ax.c                            |  4 ++
 gdb/gdbserver/debug.c                         | 55 ++++++++++++++++++-
 gdb/gdbserver/debug.h                         | 19 ++++---
 gdb/gdbserver/hostio.c                        |  2 -
 gdb/gdbserver/linux-low.c                     |  7 +--
 gdb/gdbserver/remote-utils.c                  |  3 -
 gdb/gdbserver/remote-utils.h                  |  2 -
 gdb/gdbserver/server.c                        |  8 ++-
 gdb/nat/linux-waitpid.c                       |  2 +-
 gdb/testsuite/README                          |  8 +++
 .../native-extended-gdbserver-debug.exp       | 26 +++++++++
 .../boards/native-gdbserver-debug.exp         | 25 +++++++++
 gdb/testsuite/gdb.trace/tspeed.exp            |  5 ++
 gdb/testsuite/lib/gdbserver-support.exp       | 16 +++++-
 15 files changed, 171 insertions(+), 27 deletions(-)
 create mode 100644 gdb/testsuite/boards/native-extended-gdbserver-debug.exp
 create mode 100644 gdb/testsuite/boards/native-gdbserver-debug.exp

-- 
2.20.1 (Apple Git-117)

Comments

Eli Zaretskii April 16, 2019, 2:43 p.m. | #1
> From: Alan Hayward <Alan.Hayward@arm.com>

> CC: nd <nd@arm.com>, Alan Hayward <Alan.Hayward@arm.com>

> Date: Tue, 16 Apr 2019 10:17:35 +0000

> 

> Not sure if I should add a statement to the NEWS file (can add in a follow

> on patch).


I think you should.