1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

debug tests: Disable some reverse tests for gdb 7.0 and 7.1

The following tests fail with gdb 7.0 and 7.1:

  - testStopAtMainWithReverse(Restart)?
  - testStopAtOtherWithReverse(Restart)?

The reason is that execution crosses getenv() while recording is
enabled. gdb has some trouble with that, and outputs an error such as:

	warning: Process record ignores the memory change of instruction at address 0x7ffff7de951f because it can't get the value of the segment register.
	warning: Process record ignores the memory change of instruction at address 0x7ffff7de9576 because it can't get the value of the segment register.
	Process record doesn't support instruction 0xfef at address 0x7ffff7a9e5e2.
	Process record: failed to record execution log.

	[process 6993] #1 stopped.
	0x00007ffff7a9e5e0 in strlen () from /lib/x86_64-linux-gnu/libc.so.6

We could either make the test "easier" to make it pass on those gdb
versions, or disable it for those gdb versions. By "easier", I mean just
execute some simple arithmetic instead of some calls to libc.

I think it is counter-productive to reduce the span of the tests just to
make some old gdb versions happy, so I chose to disable it for those.
Actually, the best would be to write a new test which covers less but
passes for all versions.

Change-Id: I98499fbb5c099232bc39dad3906d7348912b89af
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38735
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Hudson CI
This commit is contained in:
Simon Marchi 2014-12-23 14:57:43 -05:00 committed by Marc Khouzam
parent 65e13b7344
commit 6edff928a1
2 changed files with 53 additions and 2 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Ericsson and others.
* Copyright (c) 2011, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson - Initial Implementation
* Simon Marchi (Ericsson) - Disable some reverse tests for gdb 7.0 and 7.1.
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
@ -109,8 +110,13 @@ public class LaunchConfigurationAndRestartTest_7_0 extends LaunchConfigurationAn
* This test will tell the launch to "stop on main" at method main() with reverse
* debugging enabled. We will verify that the launch stops at main() and that
* reverse debugging is enabled.
*
* In this test, the execution crosses getenv() while recording is enabled. gdb 7.0
* and 7.1 have trouble with that. We disable the test for those, and enable it for
* 7.2 and upwards.
*/
@Test
@Ignore
public void testStopAtMainWithReverse() throws Throwable {
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, "main");
@ -175,6 +181,7 @@ public class LaunchConfigurationAndRestartTest_7_0 extends LaunchConfigurationAn
* Repeat the test testStopAtMainWithReverse, but after a restart.
*/
@Test
@Ignore
public void testStopAtMainWithReverseRestart() throws Throwable {
fRestart = true;
testStopAtMainWithReverse();
@ -185,8 +192,13 @@ public class LaunchConfigurationAndRestartTest_7_0 extends LaunchConfigurationAn
* with reverse debugging enabled. We will then verify that the launch is properly
* stopped at stopAtOther() and that it can go backwards until main() (this will
* confirm that reverse debugging was enabled at the very start).
*
* In this test, the execution crosses getenv() while recording is enabled. gdb 7.0
* and 7.1 have trouble with that. We disable the test for those, and enable it for
* 7.2 and upwards.
*/
@Test
@Ignore
public void testStopAtOtherWithReverse() throws Throwable {
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, "stopAtOther");
@ -252,6 +264,7 @@ public class LaunchConfigurationAndRestartTest_7_0 extends LaunchConfigurationAn
* Repeat the test testStopAtOtherWithReverse, but after a restart.
*/
@Test
@Ignore
public void testStopAtOtherWithReverseRestart() throws Throwable {
fRestart = true;
testStopAtOtherWithReverse();

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2011 Ericsson and others.
* Copyright (c) 2011, 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -7,12 +7,14 @@
*
* Contributors:
* Ericsson - Initial Implementation
* Simon Marchi (Ericsson) - Disable some reverse tests for gdb 7.0 and 7.1.
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1.LaunchConfigurationAndRestartTest_7_1;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
@ -21,4 +23,40 @@ public class LaunchConfigurationAndRestartTest_7_2 extends LaunchConfigurationAn
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_2);
}
/**
* Enable the test for gdb 7.2 and upwards.
*/
@Test
@Override
public void testStopAtMainWithReverse() throws Throwable {
super.testStopAtMainWithReverse();
}
/**
* Enable the test for gdb 7.2 and upwards.
*/
@Test
@Override
public void testStopAtMainWithReverseRestart() throws Throwable {
super.testStopAtMainWithReverseRestart();
}
/**
* Enable the test for gdb 7.2 and upwards.
*/
@Test
@Override
public void testStopAtOtherWithReverse() throws Throwable {
super.testStopAtOtherWithReverse();
}
/**
* Enable the test for gdb 7.2 and upwards.
*/
@Test
@Override
public void testStopAtOtherWithReverseRestart() throws Throwable {
super.testStopAtOtherWithReverseRestart();
}
}