1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 03:53:21 +02:00

Add printouts to debug unit tests

Currently, the debug unit tests only print which GDB version is
requested
and only if tracing is enabled; we have run into bugs where we would
have greatly benefited in easily seeing what version of GDB was
actually launched.

This change makes each test print what version of GDB is requested
and which one is actually run.  It also makes the test print this
information
all the time, one line per test, instead of only when tracing is
enabled.

Change-Id: Id19d625170b4f956d6205929062c280ac3ecc3b8
This commit is contained in:
Marc Khouzam 2017-02-09 14:29:09 -05:00
parent 74d67c7b38
commit 123508549d

View file

@ -413,9 +413,17 @@ public class BaseTestCase {
if (GdbDebugOptions.DEBUG) {
GdbDebugOptions.trace("===============================================================================================\n");
GdbDebugOptions.trace(String.format("%s \"%s\" launching %s %s\n",
GdbPlugin.getDebugTime(), testName.getMethodName(), launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME), remote ? "with gdbserver" : ""));
GdbDebugOptions.trace("===============================================================================================\n");
}
// Always print this output to help easily troubleshoot tests on Hudson
// Don't end with a new line as we may add another printout in doInnerLaunch()
// Also don't split the line to make it all nicely aligned
GdbDebugOptions.trace(String.format("%s \"%s\" requesting %s%s",
GdbPlugin.getDebugTime(), testName.getMethodName(), launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME), remote ? " with gdbserver." : ".")
, -1);
if (GdbDebugOptions.DEBUG) {
GdbDebugOptions.trace("\n===============================================================================================\n");
}
launchGdbServer();
@ -476,6 +484,12 @@ public class BaseTestCase {
// problem launching and no session is created).
DsfSession.addSessionStartedListener(sessionStartedListener);
GdbLaunch launch = (GdbLaunch)fLaunchConfiguration.launch(ILaunchManager.DEBUG_MODE, new NullProgressMonitor());
if (!GdbDebugOptions.DEBUG) {
// Now that we have started the launch we can print the real GDB version
// but not if DEBUG is on since we get the version anyway in that case.
GdbDebugOptions.trace(String.format(" Launched gdb %s.\n", launch.getGDBVersion()));
}
DsfSession.removeSessionStartedListener(sessionStartedListener);
try {