From c95780a092788b031ce893c404588a12dabe71bd Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 14 Aug 2013 13:40:40 -0400 Subject: [PATCH] =?UTF-8?q?Bug=20415094=20=E2=80=93=20Update=20Step=20Into?= =?UTF-8?q?=20Selection=20JUnit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4e5a0afd8fc47444a3360f56650ebe966d837e04 Reviewed-on: https://git.eclipse.org/r/13840 Reviewed-by: Marc Khouzam IP-Clean: Marc Khouzam Tested-by: Marc Khouzam --- .../data/launch/bin/.cvsignore | 10 - .../data/launch/src/Artifact.cc | 49 -- .../data/launch/src/Composite.cc | 210 ------ .../data/launch/src/Leaf.cc | 38 - .../data/launch/src/StepIntoSelection.h | 7 + .../launch/src/StepIntoSelectionTestApp.cc | 105 +++ .../cdt/tests/dsf/gdb/framework/SyncUtil.java | 16 + .../cdt/tests/dsf/gdb/tests/AllSuites.java | 6 +- .../tests/dsf/gdb/tests/AllSuitesRemote.java | 6 +- .../cdt/tests/dsf/gdb/tests/AllTests.java | 47 -- .../tests/dsf/gdb/tests/AutomatedSuite.java | 6 +- .../dsf/gdb/tests/StepIntoSelectionTest.java | 662 ++++++++++-------- .../tests_6_6/StepIntoSelectionTest_6_6.java | 25 + .../dsf/gdb/tests/tests_6_6/Suite_6_6.java | 1 + .../gdb/tests/tests_6_6/Suite_Remote_6_6.java | 1 + .../tests_6_7/StepIntoSelectionTest_6_7.java | 25 + .../dsf/gdb/tests/tests_6_7/Suite_6_7.java | 1 + .../gdb/tests/tests_6_7/Suite_Remote_6_7.java | 3 +- .../tests_6_8/StepIntoSelectionTest_6_8.java | 12 +- .../gdb/tests/tests_6_8/Suite_Remote_6_8.java | 3 +- .../tests_7_0/StepIntoSelectionTest_7_0.java | 25 + .../StepIntoSelectionTest_7_0_NS.java | 11 +- .../dsf/gdb/tests/tests_7_0/Suite_7_0.java | 4 +- .../gdb/tests/tests_7_0/Suite_Remote_7_0.java | 4 +- .../tests_7_1/StepIntoSelectionTest_7_1.java | 25 + .../StepIntoSelectionTest_7_1_NS.java | 25 + .../dsf/gdb/tests/tests_7_1/Suite_7_1.java | 2 + .../gdb/tests/tests_7_1/Suite_Remote_7_1.java | 4 +- .../tests_7_2/StepIntoSelectionTest_7_2.java | 25 + .../StepIntoSelectionTest_7_2_NS.java | 25 + .../dsf/gdb/tests/tests_7_2/Suite_7_2.java | 4 +- .../gdb/tests/tests_7_2/Suite_Remote_7_2.java | 4 +- .../tests_7_3/StepIntoSelectionTest_7_3.java | 25 + .../StepIntoSelectionTest_7_3_NS.java | 25 + .../dsf/gdb/tests/tests_7_3/Suite_7_3.java | 2 + .../gdb/tests/tests_7_3/Suite_Remote_7_3.java | 4 +- .../tests_7_4/StepIntoSelectionTest_7_4.java | 25 + .../StepIntoSelectionTest_7_4_NS.java | 25 + .../dsf/gdb/tests/tests_7_4/Suite_7_4.java | 2 + .../gdb/tests/tests_7_4/Suite_Remote_7_4.java | 2 + .../tests_7_5/StepIntoSelectionTest_7_5.java | 25 + .../StepIntoSelectionTest_7_5_NS.java | 25 + .../dsf/gdb/tests/tests_7_5/Suite_7_5.java | 2 + .../gdb/tests/tests_7_5/Suite_Remote_7_5.java | 2 + .../tests_7_6/StepIntoSelectionTest_7_6.java | 25 + .../StepIntoSelectionTest_7_6_NS.java | 25 + .../dsf/gdb/tests/tests_7_6/Suite_7_6.java | 2 + .../gdb/tests/tests_7_6/Suite_Remote_7_6.java | 2 + 48 files changed, 946 insertions(+), 663 deletions(-) delete mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/bin/.cvsignore delete mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Artifact.cc delete mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Composite.cc delete mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Leaf.cc create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelection.h create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelectionTestApp.cc delete mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllTests.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/StepIntoSelectionTest_6_6.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/StepIntoSelectionTest_6_7.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1_NS.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2_NS.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3_NS.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4_NS.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5_NS.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6.java create mode 100644 dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6_NS.java diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/bin/.cvsignore b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/bin/.cvsignore deleted file mode 100644 index 8df4a122df9..00000000000 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/bin/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -BreakpointTestApp.exe -CatchpointTestApp.exe -ExpressionTestApp.exe -GDBMIGenericTestApp.exe -LaunchConfigurationAndRestartTestApp.exe -MemoryTestApp.exe -MultiThread.exe -SpecialTestApp.exe -TracepointTestApp.exe -core \ No newline at end of file diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Artifact.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Artifact.cc deleted file mode 100644 index 7e98cbf6be9..00000000000 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Artifact.cc +++ /dev/null @@ -1,49 +0,0 @@ - -using namespace std; - -#include -//#include<> - -//The 'Component' node -class Artifact { -public: - Artifact(string name) { - fName = name; - fParent = NULL; - } - - //Exercising Polymorphysm - virtual void print() = 0; - virtual string toString() = 0; - virtual void print(char& padc) = 0; - virtual string toString(char& padc) = 0; - - string getName() { - return fName; - } - - string getLocation() { - return fPath + "/" + fName; - } - - virtual void setParent(Artifact &parent) { - fPath = parent.getLocation(); - fParent = &parent; - } - - void deleteParent() { - fPath = ""; - fParent = NULL; - } - - virtual ~Artifact() { - } - -protected: - string fName; - string fPath; - Artifact* fParent; - -private: - Artifact(); -}; diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Composite.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Composite.cc deleted file mode 100644 index dae86028134..00000000000 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Composite.cc +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Composite Pattern - */ -#include -#include -#include -#include "Leaf.cc" - -using namespace std; - -//The 'Composite' node -class CompositeNode: public Artifact { -public: - CompositeNode(string name) : - Artifact(name) { - } - - void Add(Artifact* child) { - child->setParent(*this); - fChildren.push_back(child); - } - - void setParent(Artifact &parent) { - fPath = parent.getLocation(); - fParent = &parent; - - //Refresh the parent information path to all children - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - Artifact* child = *it; - child->setParent(*this); - ++it; - } - } - - void Remove(Artifact* child) { - child->deleteParent(); - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - if (*it == child) { - delete child; - fChildren.erase(it); - break; - } - ++it; - } - - } - - void print() { - cout << getLocation() << endl; - - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - (*it)->print(); - ++it; - } - } - - void print(char& cpad) { - string padding(fPath.length(), cpad); - cout << padding << "+ " << fName << endl; - - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - (*it)->print(cpad); - ++it; - } - } - - string toString() { - string strAccumulator(getLocation() + "\n"); - - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - strAccumulator.append((*it)->toString()); - ++it; - } - - return strAccumulator; - } - - string toString(char& cpad) { - string strAccumulation(fPath.length(), cpad); - strAccumulation.append("+ " + fName + "\n"); - - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - strAccumulation.append((*it)->toString(cpad)); - ++it; - } - - return strAccumulation; - } - - virtual int getArtifactsSize() { - return fChildren.size(); - } - - virtual Artifact* getArtifact(int index) { - if (index < fChildren.size()) { - return fChildren.at(index); - } - - else - return 0; - } - - virtual Artifact* getArtifact(string description) { - vector::iterator it = fChildren.begin(); - while (it != fChildren.end()) { - if ((*it)->getName().compare(description)) { - return *it; - } - ++it; - } - - return 0; - } - - virtual ~CompositeNode() { - while (!fChildren.empty()) { - vector::iterator it = fChildren.begin(); - delete *it; - fChildren.erase(it); - } - } - -private: - CompositeNode(); - vector fChildren; -}; - -//The Main method -int main() { - //Create a tree root - CompositeNode* root = new CompositeNode("Dogs"); - - //Create composite nodes - CompositeNode* comp = new CompositeNode("Companion"); - comp->Add(new LeafNode("Puddle")); - comp->Add(new LeafNode("Bichon")); - - CompositeNode* sport = new CompositeNode("Guardian"); - sport->Add(new LeafNode("Boxer")); - sport->Add(new LeafNode("Rottweiler")); - sport->Add(new LeafNode("Mastiff")); - - //Create a Branch - CompositeNode* gun = new CompositeNode("Gun"); - gun->Add(new LeafNode("Cocker")); - gun->Add(new LeafNode("Pointer")); - gun->Add(new LeafNode("Golden Retriever")); - - CompositeNode* herd = new CompositeNode("Herding"); - herd->Add(new LeafNode("Cattle dog")); - herd->Add(new LeafNode("Sheepdog")); - - CompositeNode* north = new CompositeNode("Northern"); - north->Add(new LeafNode("Akita")); - north->Add(new LeafNode("Chow Chow")); - - CompositeNode* hound = new CompositeNode("Hound"); - hound->Add(new LeafNode("Basset Hound")); - hound->Add(new LeafNode("Beagle")); - - CompositeNode* terrier = new CompositeNode("Terrier"); - terrier->Add(new LeafNode("Bull Terrier")); - terrier->Add(new LeafNode("Border Terrier")); - - //Create some leaf nodes - LeafNode* pe1 = new LeafNode("German Shepperd"); - LeafNode* pe2 = new LeafNode("Great Dane"); - - //Add nodes to start from the same root - root->Add(comp); - root->Add(sport); - root->Add(gun); - root->Add(herd); - root->Add(north); - root->Add(hound); - root->Add(terrier); - //Add leaf nodes to root - root->Add(pe1); - root->Add(pe2); - - char cpad = '-'; - char cpad2 = '_'; - //Test stub + toString variants - if (root->getArtifactsSize() > 0 - && (root->getArtifact(0) != 0 && (root->getArtifact("Bichon") != 0))) { - string sout = root->getArtifact(0)->toString() + "\n" + root->getArtifact(1)->toString(cpad2); - cout << sout << endl; - } - - //Test Remove primitive elements - root->Remove(pe1); - root->Remove(pe2); - - //Test Print variants - root->getArtifact(2)->print(); root->getArtifact(3)->print(cpad); - - //Test toString all - cout << "\n\nAll Tree\n" + root->toString(cpad); - - //delete the allocated memory - delete root; - - return 0; -} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Leaf.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Leaf.cc deleted file mode 100644 index bc53da4ef34..00000000000 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/Leaf.cc +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include "Artifact.cc" - - -//The 'Leaf' class -class LeafNode: public Artifact { -public: - LeafNode(string name) : - Artifact(name) { - } - - void print() { - cout << getLocation() << endl; - } - - void print(char& cpad) { - string padding(fPath.length(), cpad); - cout << padding << " " << fName << endl; - } - - - string toString() { - return getLocation() + "\n"; - } - - string toString(char& cpad) { - string padding(fPath.length(), cpad); - string rstr = padding + " " + fName + "\n"; - return rstr; - } - - virtual ~LeafNode() { - } - -private: - LeafNode(); -}; diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelection.h b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelection.h new file mode 100644 index 00000000000..96ca4a24cd6 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelection.h @@ -0,0 +1,7 @@ +// +//// +// +int value() { + int a = 1; // Must be at line 5 + return 1; +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelectionTestApp.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelectionTestApp.cc new file mode 100644 index 00000000000..5d0f2ff5bac --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/StepIntoSelectionTestApp.cc @@ -0,0 +1,105 @@ +#include "StepIntoSelection.h" +// +// +// +// +// +// +// +// The first line of the below method must be at line 10 +int foo() { + int i = 0; // The tests expect this to be at line 11 + return 1; +} +// +// +// +// +// +int bar(int i) { + int b = 0; // The tests expect this to be at line 20 + return i + b; +} +// +// +// +// +// +// +int add(int a) { + return a + 1; // The tests expect this to be at line 30 +} +// +// +int add() { + return 1; // The tests expect this to be at line 35 +} + +int recursiveTest(int a) { + if (a == 1) return a; + + return a + recursiveTest(--a); // The test expects this line to be exactly 2 lines below the first line of the method +} + +int sameLineTest() { + foo(); + return 0; +} + +int sameLineBreakpointTest() { + bar(foo()); + return 0; +} + +int doubleMethodTest() { + int a = 0; + bar(foo()); // The test expects this line to be one line below the star of the method + return 0; +} + +int laterLineTest() { + int i = 0; + i++; + i++; + foo(); // The test expects this line to be exactly 3 lines below the first line of the method + i++; + i++; + return 0; +} + +int laterLineNotHitTest() { + int i = 0; + if (i==100) { // Won't hit + foo(); // The test expects this line to be exactly 2 lines below the first line of the method + } + i++; + i++; + return 0; +} + +int laterLineDifferentFileTest() { + int b = 0; + value(); // Must be one line below start of the method + // value() is from .h header file +} + +int differentFileTest() { + + return 0; +} + +int methodWithDiffArgsNumberTest() { + return add() + add(2); +} + +int main() { + sameLineTest(); + laterLineTest(); + laterLineNotHitTest(); + doubleMethodTest(); + recursiveTest(8); + laterLineDifferentFileTest(); + differentFileTest(); + methodWithDiffArgsNumberTest(); + return 0; +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java index c6b5f0c0e84..3e66f55b983 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java @@ -401,7 +401,23 @@ public class SyncUtil { fSession.getExecutor().execute(query); return query.get(500, TimeUnit.MILLISECONDS); } + + public static Integer getStackDepth(final IExecutionDMContext execCtx) throws Throwable { + return getStackDepth(execCtx, 0); + } + public static Integer getStackDepth(final IExecutionDMContext execCtx, final int maxDepth) throws Throwable { + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + fStack.getStackDepth(execCtx, maxDepth, rm); + } + }; + + fSession.getExecutor().execute(query); + return query.get(500, TimeUnit.MILLISECONDS); + } + public static IFrameDMData getFrameData(final IExecutionDMContext execCtx, final int level) throws Throwable { Query query = new Query() { @Override diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java index 190c8121157..2f91a624c88 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 Ericsson and others. + * Copyright (c) 2009, 2013 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 @@ -18,6 +18,8 @@ import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1.Suite_7_1; import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2.Suite_7_2; import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3.Suite_7_3; import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4.Suite_7_4; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5.Suite_7_5; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6.Suite_7_6; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -32,6 +34,8 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ + Suite_7_6.class, + Suite_7_5.class, Suite_7_4.class, Suite_7_3.class, Suite_7_2.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuitesRemote.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuitesRemote.java index 9ed0cec870f..021dafdc8e1 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuitesRemote.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuitesRemote.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 Ericsson and others. + * Copyright (c) 2009, 2013 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 @@ -18,6 +18,8 @@ import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1.Suite_Remote_7_1; import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2.Suite_Remote_7_2; import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3.Suite_Remote_7_3; import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4.Suite_Remote_7_4; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5.Suite_Remote_7_5; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6.Suite_Remote_7_6; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -32,6 +34,8 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ + Suite_Remote_7_6.class, + Suite_Remote_7_5.class, Suite_Remote_7_4.class, Suite_Remote_7_3.class, Suite_Remote_7_2.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllTests.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllTests.java deleted file mode 100644 index 2497c8243a8..00000000000 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllTests.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2013 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Ericsson - Initial Implementation - *******************************************************************************/ -package org.eclipse.cdt.tests.dsf.gdb.tests; - -import org.eclipse.cdt.dsf.mi.service.command.commands.Suite_Sessionless_Tests; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -/** - * This class is meant to be empty. It enables us to define - * the annotations which list all the different JUnit suites we - * want to run. When creating a new suite class, it should be - * added to the list below. - * - * This suite runs the tests with the current version of GDB that is on the PATH - */ - -@RunWith(Suite.class) -@Suite.SuiteClasses({ - LaunchUtilsTest.class, - MIRegistersTest.class, - MIRunControlTest.class, - MIRunControlTargetAvailableTest.class, - MIExpressionsTest.class, - MIMemoryTest.class, - MIBreakpointsTest.class, - MICatchpointsTest.class, - MIDisassemblyTest.class, - GDBProcessesTest.class, - LaunchConfigurationAndRestartTest.class, - OperationsWhileTargetIsRunningTest.class, - PostMortemCoreTest.class, - CommandTimeoutTest.class, - Suite_Sessionless_Tests.class, - StepIntoSelectionTest.class, - /* Add your suite class here */ -}) - -public class AllTests {} \ No newline at end of file diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AutomatedSuite.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AutomatedSuite.java index 64f7246de54..bc6bb055d75 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AutomatedSuite.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AutomatedSuite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 Ericsson and others. + * Copyright (c) 2012, 2013 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 @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.tests.dsf.gdb.tests; -import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5.Suite_7_5; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6.Suite_7_6; import org.junit.runner.RunWith; import org.junit.runners.Suite; @@ -21,7 +21,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ - Suite_7_5.class, + Suite_7_6.class, // Can't run the Remote test just yet because they // have the same names on the local tests, which is // not handled by JUnit (https://bugs.eclipse.org/172256) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java index 92a5cf2a1df..07cab21c032 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java @@ -10,32 +10,27 @@ *******************************************************************************/ package org.eclipse.cdt.tests.dsf.gdb.tests; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import javax.naming.OperationNotSupportedException; +import java.util.concurrent.TimeUnit; import org.eclipse.cdt.core.model.IFunctionDeclaration; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; -import org.eclipse.cdt.dsf.concurrent.RequestMonitor; -import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext; -import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext; +import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; +import org.eclipse.cdt.dsf.concurrent.Query; import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; +import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent; +import org.eclipse.cdt.dsf.debug.service.IRunControl.StepType; import org.eclipse.cdt.dsf.debug.service.IRunControl3; -import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData; -import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; -import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; -import org.eclipse.cdt.dsf.mi.service.IMIProcesses; -import org.eclipse.cdt.dsf.mi.service.MIProcesses; -import org.eclipse.cdt.dsf.mi.service.command.events.MILocationReachedEvent; +import org.eclipse.cdt.dsf.mi.service.command.events.IMIDMEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent; import org.eclipse.cdt.dsf.mi.service.command.output.MIFrame; import org.eclipse.cdt.dsf.service.DsfServicesTracker; import org.eclipse.cdt.dsf.service.DsfSession; import org.eclipse.cdt.internal.core.model.FunctionDeclaration; -import org.eclipse.cdt.tests.dsf.gdb.framework.AsyncCompletionWaitor; import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.ServiceEventWaitor; @@ -53,58 +48,30 @@ import org.junit.runner.RunWith; public class StepIntoSelectionTest extends BaseTestCase { private DsfServicesTracker fServicesTracker; + private DsfSession fSession; - private IGDBControl fGDBCtrl; private IRunControl3 fRunCtrl; - private IContainerDMContext fContainerDmc; - private IExecutionDMContext fThreadExecDmc; - - /* - * Path to executable - */ - private static final String EXEC_PATH = "data/launch/bin/"; - - /* - * Name of the executable - */ - private static final String BIN_COMPOSITE = "Composite.exe"; - - // Composite Locations - private static final String SRC_COMPOSITE = "Composite.cc"; - private static final int COMPOSITE_GETARTIFACTSIZE_LINE_1 = 97; - private static final int COMPOSITE_GETARTIFACT_LINE_1 = 101; - private static final int COMPOSITE_MAIN_LINE_S5 = 89; - private static final int COMPOSITE_MAIN_LINE_M1 = 190; - private static final int COMPOSITE_MAIN_LINE_M2 = 191; - private static final int COMPOSITE_MAIN_LINE_L1 = 192; - private static final int COMPOSITE_MAIN_LINE_L2 = 197; - private static final int COMPOSITE_MAIN_LINE_L3 = 201; - private static final int COMPOSITE_MAIN_LINE_L4 = 204; - private static final int COMPOSITE_TOSTRING_LINE_1 = 72; - private static final int COMPOSITE_TOSTRING_C_LINE_1 = 84; - private static final String COMPOSITE_GETARTIFACTSIZE = "getArtifactsSize"; - private static final String COMPOSITE_GETARTIFACT = "getArtifact"; - private static final String COMPOSITE_TOSTRING = "toString"; - - // Artifact Locations - private static final String ARTIFACT_GETLOCATION = "getLocation"; - private static final int ARTIFACT_GETLOCATION_LINE_1 = 26; - - // Leaf Locations - private static final String SRC_LEAF = "Leaf.cc"; - private static final int LEAF_PRINT_LINE_1 = 14; + private static final String SRC_FILE = "StepIntoSelectionTestApp.cc"; + private static final String HDR_FILE = "StepIntoSelection.h"; + private static final int FOO_LINE = 11; + private static final int BAR_LINE = 20; + private static final int VALUE_LINE = 5; + private static final int ADD_WITH_ARG_LINE = 30; + private static final int ADD_NO_ARG_LINE = 35; //Target Functions - private final static FunctionDeclaration funcCompGetArtifactSize = new FunctionDeclaration(null, COMPOSITE_GETARTIFACTSIZE); - private final static FunctionDeclaration funcCompGetArtifact_i = new FunctionDeclaration(null, COMPOSITE_GETARTIFACT); - private final static FunctionDeclaration funcArtifactGetLocation = new FunctionDeclaration(null, ARTIFACT_GETLOCATION); - private final static FunctionDeclaration funcCompToString = new FunctionDeclaration(null, COMPOSITE_TOSTRING); - private final static FunctionDeclaration funcCompToString_c = new FunctionDeclaration(null, COMPOSITE_TOSTRING); + private final static FunctionDeclaration funcFoo = new FunctionDeclaration(null, "foo"); + private final static FunctionDeclaration funcBar = new FunctionDeclaration(null, "bar"); + private final static FunctionDeclaration funcRecursive = new FunctionDeclaration(null, "recursiveTest"); + private final static FunctionDeclaration funcValue = new FunctionDeclaration(null, "value"); + private final static FunctionDeclaration funcAddNoArg = new FunctionDeclaration(null, "add"); + private final static FunctionDeclaration funcAddWithArg = new FunctionDeclaration(null, "add"); static { - funcCompGetArtifact_i.setParameterTypes(new String[]{"int"}); - funcCompToString_c.setParameterTypes(new String[]{"Char&"}); + funcBar.setParameterTypes(new String[]{"int"}); + funcRecursive.setParameterTypes(new String[]{"int"}); + funcAddWithArg.setParameterTypes(new String[]{"int"}); } class ResultContext { @@ -129,23 +96,15 @@ public class StepIntoSelectionTest extends BaseTestCase { public void doBeforeTest() throws Exception { super.doBeforeTest(); - final DsfSession session = getGDBLaunch().getSession(); Runnable runnable = new Runnable() { @Override public void run() { - fServicesTracker = new DsfServicesTracker(TestsPlugin.getBundleContext(), session.getId()); - fGDBCtrl = fServicesTracker.getService(IGDBControl.class); - - IMIProcesses procService = fServicesTracker.getService(IMIProcesses.class); - IProcessDMContext procDmc = procService.createProcessContext(fGDBCtrl.getContext(), MIProcesses.UNIQUE_GROUP_ID); - fContainerDmc = procService.createContainerContext(procDmc, MIProcesses.UNIQUE_GROUP_ID); - IThreadDMContext threadDmc = procService.createThreadContext(procDmc, "1"); - fThreadExecDmc = procService.createExecutionContext(fContainerDmc, threadDmc, "1"); - + fServicesTracker = new DsfServicesTracker(TestsPlugin.getBundleContext(), fSession.getId()); fRunCtrl = fServicesTracker.getService(IRunControl3.class); } }; - session.getExecutor().submit(runnable).get(); + fSession = getGDBLaunch().getSession(); + fSession.getExecutor().submit(runnable).get(); } @Override @@ -158,238 +117,389 @@ public class StepIntoSelectionTest extends BaseTestCase { @Override protected void setLaunchAttributes() { super.setLaunchAttributes(); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + BIN_COMPOSITE); - setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/StepIntoSelectionTestApp.exe"); } - private IExecutionDMContext gdbRunToStartLine(String sourceName, int targetLine, ServiceEventWaitor waitor) throws Throwable { - // run gdb to the specified line an resolve the execution context where the MI signal events are being processed - SyncUtil.runToLine(fThreadExecDmc, sourceName, Integer.toString(targetLine), true); - MILocationReachedEvent locEvent = waitor.waitForEvent(MILocationReachedEvent.class, TestsPlugin.massageTimeout(500)); - return locEvent.getDMContext(); - } + private void validateLocation(ISuspendedDMEvent suspendedEvent, String expectedFunction, + String expectedFile, int expectedLine, int expectedDepth) throws Throwable { + assertNotNull(suspendedEvent); - private MIStoppedEvent getLastEvent(ServiceEventWaitor gdbStopListener) { - // Fetch the last stopped event as stepping into selection needs to step several times. - MIStoppedEvent event = null; - // Run until Timeout exception i.e. no more events in the queue - try { - while (true) { - // Wait or fetch the next stopped event in the queue - event = gdbStopListener.waitForEvent(MIStoppedEvent.class, TestsPlugin.massageTimeout(500)); - } - } catch (Exception e) { - assertTrue("Exception: " + e.getMessage(), e.getMessage().contains("Timed out")); - } + assertTrue("Expected suspended event to be IMIDMEvent, but it was not.", suspendedEvent instanceof IMIDMEvent); + Object miEvent = ((IMIDMEvent)suspendedEvent).getMIEvent(); + + assertTrue("Expected mi event to be MIStoppedEvent, but it was not.", miEvent instanceof MIStoppedEvent); + MIStoppedEvent stoppedEvent = (MIStoppedEvent)miEvent; + + // Validate that the last stopped frame received is at the specified location + MIFrame frame = stoppedEvent.getFrame(); + assertTrue("Not inside the expected function. Expected " + + expectedFunction + " but got " + + frame.getFunction(), + frame.getFunction().endsWith(expectedFunction)); + assertEquals(expectedLine, frame.getLine()); + + assertTrue("Not inside the expected file. Expected " + + expectedFile + " but got " + frame.getFile(), + frame.getFile().endsWith(expectedFile)); - return event; - } + int newDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + assertEquals(expectedDepth, newDepth); - private void validateLocation(IExecutionDMContext exeContext, MIFrame frame, String funcName) throws Throwable { - // Validate that the frame received is at the specified location - assertTrue(frame.getFunction().endsWith(funcName)); - - // Validate that GDB is in sync at the specified location - IFrameDMData gdbFrame = SyncUtil.getFrameData(exeContext, 0); - assertTrue(gdbFrame.getFunction().endsWith(funcName)); + checkGdbIsSuspended(); } private void checkGdbIsSuspended() throws Throwable { - final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); final IContainerDMContext containerDmc = SyncUtil.getContainerContext(); - - // Execution shall be suspended - fRunCtrl.getExecutor().submit(new Runnable() { + Query query = new Query() { @Override - public void run() { - wait.setReturnInfo(fRunCtrl.isSuspended(containerDmc)); - wait.waitFinished(); + protected void execute(DataRequestMonitor rm) { + rm.done(fRunCtrl.isSuspended(containerDmc)); } - }); - - wait.waitUntilDone(TestsPlugin.massageTimeout(5000)); - assertTrue("Target is running. It should have been suspended", (Boolean) wait.getReturnInfo()); - - wait.waitReset(); - } - - private void triggerRunToLine(final IExecutionDMContext exeContext, final String sourceName, final int targetLine) throws InterruptedException { - final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); + }; + fSession.getExecutor().execute(query); - fRunCtrl.getExecutor().submit(new Runnable() { - @Override - public void run() { - fRunCtrl.runToLine(exeContext, sourceName, targetLine, true, new RequestMonitor(fRunCtrl.getExecutor(), null) { - @Override - protected void handleCompleted() { - wait.waitFinished(getStatus()); - } - }); - } - }); - - wait.waitUntilDone(TestsPlugin.massageTimeout(10000)); - wait.waitReset(); - } - - private void triggerStepIntoSelection(final IExecutionDMContext exeContext, final String sourceName, final int targetLine, final IFunctionDeclaration function, final boolean skipBreakPoints) throws InterruptedException { - final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); - final OperationNotSupportedException[] exception = new OperationNotSupportedException[1]; - // Trigger Stepping into a specified 'function' on the current line - fRunCtrl.getExecutor().submit(new Runnable() { - @Override - public void run() { - fRunCtrl.stepIntoSelection(exeContext, sourceName, targetLine, skipBreakPoints, function, new RequestMonitor(fRunCtrl.getExecutor(), null) { - @Override - protected void handleCompleted() { - wait.waitFinished(getStatus()); - } - }); - } - }); - - wait.waitUntilDone(TestsPlugin.massageTimeout(10000)); - wait.waitReset(); - - if (exception[0] != null) { - fail("Step into selection failed: " + exception[0].getMessage()); - } - - } - - private ResultContext runToLine(IExecutionDMContext exeContext, String sourceName, int runToLine) throws Throwable { - DsfSession session = getGDBLaunch().getSession(); - - ServiceEventWaitor gdbStopListener = new ServiceEventWaitor(session, MIStoppedEvent.class); - - // Trigger Run to line - triggerRunToLine(exeContext, sourceName, runToLine); - - // Fetch the last stopped event as stepping into selection needs to step several times. - MIStoppedEvent event = gdbStopListener.waitForEvent(MIStoppedEvent.class, TestsPlugin.massageTimeout(500)); - - assertNotNull(event); - - // Validate that the last stopped frame received is at the specified location - MIFrame frame = event.getFrame(); - assertTrue(frame.getLine() == runToLine); - return new ResultContext(event, exeContext); - } - - private ResultContext stepIntoSelectionBase(String sourceName, int runToLine, IFunctionDeclaration targetFunction) throws Throwable { - return stepIntoSelectionBase(sourceName, runToLine, targetFunction, true, true, null); - } - - private ResultContext stepIntoSelectionBase(String sourceName, int runToLine, IFunctionDeclaration targetFunction, boolean validateLocation, boolean skipBreakPoints, IExecutionDMContext dmc) throws Throwable { - DsfSession session = getGDBLaunch().getSession(); - - ServiceEventWaitor gdbStopListener = new ServiceEventWaitor(session, MIStoppedEvent.class); - - final IExecutionDMContext exeContext; - if (dmc == null) { - exeContext = gdbRunToStartLine(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_M1, gdbStopListener); - } else { - exeContext = dmc; - } - - // Run to an initial line an resolve the execution context where the MI signal events are being processed - assertNotNull(exeContext); - - // Trigger Stepping into a specified 'function' and several lines below the current one - triggerStepIntoSelection(exeContext, sourceName, runToLine, targetFunction, skipBreakPoints); - - // Fetch the last stopped event as stepping into selection needs to step several times. - MIStoppedEvent event = getLastEvent(gdbStopListener); - assertNotNull(event); - - // Validate that the last stopped frame received is at the specified location - MIFrame frame = event.getFrame(); - - if (validateLocation) { - validateLocation(exeContext, frame, targetFunction.getElementName()); - } - - checkGdbIsSuspended(); - - return new ResultContext(event, exeContext); - } - - @Test - public void stepIntoSelection() throws Throwable { - ResultContext result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_M1, funcCompGetArtifactSize); - int currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == COMPOSITE_GETARTIFACTSIZE_LINE_1); - } - - @Test - public void stepIntoSelectionWithRunToLine() throws Throwable { - ResultContext result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_M2, funcCompGetArtifact_i); - int currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == COMPOSITE_GETARTIFACT_LINE_1); - } - - @Test - public void withSelectedLineOnDifferentFile() throws Throwable { - ResultContext result = stepIntoSelectionBase(SRC_LEAF, LEAF_PRINT_LINE_1, funcArtifactGetLocation); - int currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == ARTIFACT_GETLOCATION_LINE_1); + boolean suspended = query.get(TestsPlugin.massageTimeout(5000), TimeUnit.SECONDS); + assertTrue("Target is running. It should have been suspended", suspended); } /** - * A break point is found before reaching search line - * - * @throws Throwable + * Perform a stepIntoSelection operation and return the SuspendedEvent indicating the + * stepInto has been completed. + */ + private ISuspendedDMEvent triggerStepIntoSelection(final IExecutionDMContext exeContext, + final String sourceName, + final int targetLine, + final IFunctionDeclaration function, + final boolean skipBreakPoints) + throws Throwable { + ServiceEventWaitor eventWaitor = + new ServiceEventWaitor(fSession, ISuspendedDMEvent.class); + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.stepIntoSelection(exeContext, sourceName, targetLine, skipBreakPoints, function, rm); + } + }; + fSession.getExecutor().execute(query); + query.get(); + + return eventWaitor.waitForEvent(TestsPlugin.massageTimeout(10000)); + } + + /** + * Perform a stepIntoSelection operation and return the SuspendedEvent indicating the + * stepInto has been completed. + */ + private ISuspendedDMEvent triggerRunToLine(final IExecutionDMContext exeContext, + final String sourceName, + final int targetLine, + final boolean skipBreakPoints) + throws Throwable { + ServiceEventWaitor eventWaitor = + new ServiceEventWaitor(fSession, ISuspendedDMEvent.class); + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.runToLine(exeContext, sourceName, targetLine, skipBreakPoints, rm); + } + }; + fSession.getExecutor().execute(query); + query.get(); + + return eventWaitor.waitForEvent(TestsPlugin.massageTimeout(10000)); + } + + /** + * This test verifies that we can step into a selection on the same line as where we are currently. */ @Test - public void doNotSkipBreakPoints() throws Throwable { - // insert a break point before the run to line - SyncUtil.addBreakpoint(SRC_COMPOSITE + ":" + COMPOSITE_MAIN_LINE_L2); - //trigger step into selection skip break points is set to false - ResultContext result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_L4, funcCompToString_c, false, false, null); - MIStoppedEvent event = result.getEvent(); - int currentLine = event.getFrame().getLine(); - //validate location, it shall not reach the step to selection line but the break point line instead. - assertTrue(currentLine == COMPOSITE_MAIN_LINE_L2); - //Make sure the step to selection operation is no longer active by triggering a second run to line before the step into selection line - result = runToLine(result.getContext(), SRC_COMPOSITE, COMPOSITE_MAIN_LINE_L3); - event = result.getEvent(); - currentLine = event.getFrame().getLine(); - //validate location, did not reached the step to selection line but the break point - assertTrue(currentLine == COMPOSITE_MAIN_LINE_L3); + public void atSameLine() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("sameLineTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcFoo; + + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + stoppedEvent.getFrame().getLine(), targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); } + /** + * This test verifies that we can step into a selection from a later line than where we are currently. + */ + @Test + public void atLaterLine() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("laterLineTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcFoo; + int line = stoppedEvent.getFrame().getLine() + 3; // The method to stepInto is three lines below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + } + + /** + * This test verifies that we can step into a selection of a different file. + */ + @Test + public void atLaterLineOnDifferentFile() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("laterLineDifferentFileTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcValue; + int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), HDR_FILE, VALUE_LINE, originalDepth + 1); + } + + /** + * This test verifies that we can step into a selection than has two method calls. + * We try to step into the deepest call. + */ + @Test + public void atDoubleMethodDeepCall() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("doubleMethodTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcFoo; + int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + } + + /** + * This test verifies that we can step into a selection than has two method calls. + * We try to step into the most shallow call. + */ + @Test + public void atDoubleMethodShalowCall() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("doubleMethodTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcBar; + int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, BAR_LINE, originalDepth + 1); + } + + /** + * This test verifies that we can step into a recursive method. + */ + @Test + public void recursiveMethod() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("recursiveTest"); + int finalLine = stoppedEvent.getFrame().getLine(); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcRecursive; + + int line = stoppedEvent.getFrame().getLine() + 2; // The method to stepInto is two lines below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, finalLine, originalDepth + 1); + } + + /** + * This test verifies that if we try to step into a selection from an earlier line we will end up + * stopping at the first breakpoint that hits. + */ + @Test + public void atPreviousLine() throws Throwable { + String functionName = "laterLineTest"; + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation(functionName); + int originalLine = stoppedEvent.getFrame().getLine(); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + // Step past the function call + stoppedEvent = SyncUtil.step(4, StepType.STEP_OVER); + // Set a bp one line below. We will check that this breakpoint hits when a stepInto is done + int bpline = originalLine + 4 + 1; + SyncUtil.addBreakpoint(Integer.toString(bpline)); + + FunctionDeclaration targetFunction = funcFoo; + int line = originalLine + 3; // The method to stepInto is three lines below the start of the method + + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); + + validateLocation(suspendedEvent, functionName, SRC_FILE, bpline, originalDepth); + } + + /** + * This test verifies that if we try to step into a selection from a later line that we will not reach, we will end up + * stopping at the first breakpoint that hits. + */ + @Test + public void atLaterLineThatIsNotHit() throws Throwable { + String functionName = "laterLineNotHitTest"; + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation(functionName); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcFoo; + int line = stoppedEvent.getFrame().getLine() + 2; // The method to stepInto is two lines below the start of the method + // Except we'll never reach it + // Set a bp a couple of lines below. We will check that this breakpoint hits and the stepInto is cancelled + int bpline = line + 2; + SyncUtil.addBreakpoint(Integer.toString(bpline)); + + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); // Don't skip breakpoints + + validateLocation(suspendedEvent, functionName, SRC_FILE, bpline, originalDepth); + + // Make sure the step to selection operation is no longer active by triggering a run to line before the step into selection line + suspendedEvent = triggerRunToLine(stoppedEvent.getDMContext(), SRC_FILE, + bpline + 1, false); + + validateLocation(suspendedEvent, functionName, SRC_FILE, bpline + 1, originalDepth); + + } + + /** + * This test verifies that when specified, we stop at a breakpoint that is hit before the StepIntoSelection + * is completed. + */ + @Test + public void atLaterLineStopAtBreakpoint() throws Throwable { + String functionName = "laterLineTest"; + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation(functionName); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + int originalLine = stoppedEvent.getFrame().getLine(); + + // Set a breakpoint before the stepInto line + SyncUtil.addBreakpoint(Integer.toString(originalLine+1)); + + int line = originalLine + 3; // The method to stepInto is three lines below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, funcFoo, false); + + validateLocation(suspendedEvent, functionName, SRC_FILE, originalLine + 1, originalDepth); + + // Make sure the step to selection operation is no longer active by triggering a run to line before the step into selection line + suspendedEvent = triggerRunToLine(stoppedEvent.getDMContext(), SRC_FILE, + originalLine + 2, false); + + validateLocation(suspendedEvent, functionName, SRC_FILE, originalLine + 2, originalDepth); + } + + /** + * This test verifies that when specified, we ignore all breakpoints that are hit before the StepIntoSelection + * is completed. + */ + @Test + public void atLaterLineSkipBreakpoints() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("laterLineTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + int originalLine = stoppedEvent.getFrame().getLine(); + + // Set two breakpoints before the stepInto line + SyncUtil.addBreakpoint(Integer.toString(originalLine+1)); + SyncUtil.addBreakpoint(Integer.toString(originalLine+2)); + + int line = originalLine + 3; // The method to stepInto is three lines below the start of the method + + FunctionDeclaration targetFunction = funcFoo; + + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, true); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + } + + /** + * This test verifies that we will not stop at a breakpoint if it is in the middle + * of the step-in operations when the run-to-line skip breakpoint option is not selected. + */ + @Test + public void atDoubleMethodStopAtBreakpoint() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("doubleMethodTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + // Set a breakpoint inside foo, which will hit before our + // StepInto is finished + SyncUtil.addBreakpoint(Integer.toString(FOO_LINE)); + + FunctionDeclaration targetFunction = funcBar; + int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, false); // Set not to skip breakpoints, but it should have no effect + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, BAR_LINE, originalDepth + 1); + } + + /** + * This test verifies that we will not stop at a breakpoint if it is in the middle + * of the step-in operations even if the run-to-line skip breakpoint option is selected. + */ + @Test + public void atDoubleMethodSkipBreakpoint() throws Throwable { + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("doubleMethodTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + // Set a breakpoint inside foo, which will hit before our + // StepInto is finished + SyncUtil.addBreakpoint(Integer.toString(FOO_LINE)); + + FunctionDeclaration targetFunction = funcBar; + int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + line, targetFunction, true); // Set skip breakpoints, which should have non impact + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, BAR_LINE, originalDepth + 1); + } + + /** + * This test verifies that if we have two methods with the same name on the same line, + * we properly choose the method with the correct number of arguments based on the + * step into selection. + */ @Test public void diffMethodByArgsNumber() throws Throwable { - ResultContext result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_L1, funcCompToString_c); - int currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == COMPOSITE_TOSTRING_C_LINE_1); //first line of toString(char& c) + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("methodWithDiffArgsNumberTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcAddWithArg; + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + stoppedEvent.getFrame().getLine(), targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, ADD_WITH_ARG_LINE, originalDepth + 1); } @Test public void diffMethodByArgsNumber2() throws Throwable { - ResultContext result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_L1, funcCompToString); - int currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == COMPOSITE_TOSTRING_LINE_1); //first line of toString() - } - - @Test - public void stepIntoRecursiveMethod() throws Throwable { - //Step to the recursive method - ResultContext result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_L4, funcCompToString_c); - int currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == COMPOSITE_TOSTRING_C_LINE_1); - - //Move away from the first line of the method to validate a successful recursive return to this location - int offset = 3; - result = runToLine(result.getContext(), SRC_COMPOSITE, COMPOSITE_TOSTRING_C_LINE_1 + offset); - currentLine = result.getEvent().getFrame().getLine(); - assertTrue(currentLine == COMPOSITE_TOSTRING_C_LINE_1 + offset); - - //Step into selection to trigger the recursive call - result = stepIntoSelectionBase(SRC_COMPOSITE, COMPOSITE_MAIN_LINE_S5, funcCompToString_c, false, false, result.getContext()); - currentLine = result.getEvent().getFrame().getLine(); - - //Assert going back to the top of the same function - assertTrue(currentLine == COMPOSITE_TOSTRING_C_LINE_1); + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation("methodWithDiffArgsNumberTest"); + int originalDepth = SyncUtil.getStackDepth(stoppedEvent.getDMContext()); + + FunctionDeclaration targetFunction = funcAddNoArg; + // StepInto the method + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + stoppedEvent.getFrame().getLine(), targetFunction, false); + + validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, ADD_NO_ARG_LINE, originalDepth + 1); } } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/StepIntoSelectionTest_6_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/StepIntoSelectionTest_6_6.java new file mode 100644 index 00000000000..2e4199b2fac --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/StepIntoSelectionTest_6_6.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6; + +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.StepIntoSelectionTest; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_6_6 extends StepIntoSelectionTest { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_6); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java index 98f6f23a229..8406f9c8c5b 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java @@ -44,6 +44,7 @@ import org.junit.runners.Suite; PostMortemCoreTest_6_6.class, Suite_Sessionless_Tests.class, CommandTimeoutTest_6_6.class, + StepIntoSelectionTest_6_6.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java index e49d4e3c2df..56874456acf 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java @@ -43,6 +43,7 @@ import org.junit.runners.Suite; OperationsWhileTargetIsRunningTest_6_6.class, CommandTimeoutTest_6_6.class, Suite_Sessionless_Tests.class, + StepIntoSelectionTest_6_6.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/StepIntoSelectionTest_6_7.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/StepIntoSelectionTest_6_7.java new file mode 100644 index 00000000000..a8486e46ca4 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/StepIntoSelectionTest_6_7.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7; + +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_6_6.StepIntoSelectionTest_6_6; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_6_7 extends StepIntoSelectionTest_6_6 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_7); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java index faa5fb999f0..2c35a548598 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java @@ -44,6 +44,7 @@ import org.junit.runners.Suite; PostMortemCoreTest_6_7.class, CommandTimeoutTest_6_7.class, Suite_Sessionless_Tests.class, + StepIntoSelectionTest_6_7.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java index 91dd44f7c92..275ae32cb84 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java @@ -42,7 +42,8 @@ import org.junit.runners.Suite; GDBProcessesTest_6_7.class, OperationsWhileTargetIsRunningTest_6_7.class, CommandTimeoutTest_6_7.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_6_7.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/StepIntoSelectionTest_6_8.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/StepIntoSelectionTest_6_8.java index 5095ab20b99..664df7a8305 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/StepIntoSelectionTest_6_8.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/StepIntoSelectionTest_6_8.java @@ -10,23 +10,15 @@ *******************************************************************************/ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8; -import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; 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.StepIntoSelectionTest; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7.StepIntoSelectionTest_6_7; import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) -public class StepIntoSelectionTest_6_8 extends StepIntoSelectionTest { +public class StepIntoSelectionTest_6_8 extends StepIntoSelectionTest_6_7 { @Override protected void setGdbVersion() { setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_8); } - - @Override - protected void setLaunchAttributes() { - super.setLaunchAttributes(); - - setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, false); - } } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java index ca7e8503d7f..2f03505b502 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java @@ -42,7 +42,8 @@ import org.junit.runners.Suite; GDBProcessesTest_6_8.class, OperationsWhileTargetIsRunningTest_6_8.class, CommandTimeoutTest_6_8.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_6_8.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0.java new file mode 100644 index 00000000000..e4e9c228a3d --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0; + +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_6_8.StepIntoSelectionTest_6_8; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_0 extends StepIntoSelectionTest_6_8 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_0); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0_NS.java index 737a015726a..1e81ad974d0 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/StepIntoSelectionTest_7_0_NS.java @@ -12,21 +12,14 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0; import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; 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.StepIntoSelectionTest; import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) -public class StepIntoSelectionTest_7_0_NS extends StepIntoSelectionTest { +public class StepIntoSelectionTest_7_0_NS extends StepIntoSelectionTest_7_0 { @Override - protected void setGdbVersion() { - setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_0); - } - - @Override protected void setLaunchAttributes() { super.setLaunchAttributes(); - setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, false); + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); } } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java index 602c08b397c..a16875bdc0b 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java @@ -47,8 +47,8 @@ import org.junit.runners.Suite; CommandTimeoutTest_7_0.class, GDBMultiNonStopRunControlTest_7_0.class, Suite_Sessionless_Tests.class, - StepIntoSelectionTest_7_0_NS.class, - + StepIntoSelectionTest_7_0.class, + StepIntoSelectionTest_7_0_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java index 0d2c2685df0..691bda86869 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java @@ -46,7 +46,9 @@ import org.junit.runners.Suite; OperationsWhileTargetIsRunningNonStopTest_7_0.class, CommandTimeoutTest_7_0.class, GDBMultiNonStopRunControlTest_7_0.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_0.class, + StepIntoSelectionTest_7_0_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1.java new file mode 100644 index 00000000000..2449fed7090 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1; + +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_0.StepIntoSelectionTest_7_0; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_1 extends StepIntoSelectionTest_7_0 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_1); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1_NS.java new file mode 100644 index 00000000000..690caa13659 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/StepIntoSelectionTest_7_1_NS.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1; + +import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_1_NS extends StepIntoSelectionTest_7_1 { + @Override + protected void setLaunchAttributes() { + super.setLaunchAttributes(); + + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java index a32d08b620a..c2f9bd08a35 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java @@ -47,6 +47,8 @@ import org.junit.runners.Suite; CommandTimeoutTest_7_1.class, GDBMultiNonStopRunControlTest_7_1.class, Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_1.class, + StepIntoSelectionTest_7_1_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java index c1009e1ac81..ca9f1bf72c3 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java @@ -46,7 +46,9 @@ import org.junit.runners.Suite; OperationsWhileTargetIsRunningNonStopTest_7_1.class, CommandTimeoutTest_7_1.class, GDBMultiNonStopRunControlTest_7_1.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_1.class, + StepIntoSelectionTest_7_1_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2.java new file mode 100644 index 00000000000..debb63c0a6e --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +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.StepIntoSelectionTest_7_1; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_2 extends StepIntoSelectionTest_7_1 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_2); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2_NS.java new file mode 100644 index 00000000000..e8bfbd43cec --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/StepIntoSelectionTest_7_2_NS.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2; + +import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_2_NS extends StepIntoSelectionTest_7_2 { + @Override + protected void setLaunchAttributes() { + super.setLaunchAttributes(); + + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java index adc8589e8d7..0839aaaa569 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java @@ -46,7 +46,9 @@ import org.junit.runners.Suite; PostMortemCoreTest_7_2.class, CommandTimeoutTest_7_2.class, GDBMultiNonStopRunControlTest_7_2.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_2.class, + StepIntoSelectionTest_7_2_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java index c3e6be320ce..6e82153bc68 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java @@ -46,7 +46,9 @@ import org.junit.runners.Suite; OperationsWhileTargetIsRunningNonStopTest_7_2.class, CommandTimeoutTest_7_2.class, GDBMultiNonStopRunControlTest_7_2.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_2.class, + StepIntoSelectionTest_7_2_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3.java new file mode 100644 index 00000000000..cd2113dd859 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3; + +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_2.StepIntoSelectionTest_7_2; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_3 extends StepIntoSelectionTest_7_2 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_3); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3_NS.java new file mode 100644 index 00000000000..f67097b1c50 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/StepIntoSelectionTest_7_3_NS.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3; + +import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_3_NS extends StepIntoSelectionTest_7_3 { + @Override + protected void setLaunchAttributes() { + super.setLaunchAttributes(); + + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_7_3.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_7_3.java index 0e337aca913..e2a2dd0dc38 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_7_3.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_7_3.java @@ -47,6 +47,8 @@ import org.junit.runners.Suite; CommandTimeoutTest_7_3.class, GDBMultiNonStopRunControlTest_7_3.class, Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_3.class, + StepIntoSelectionTest_7_3_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_Remote_7_3.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_Remote_7_3.java index 2237dc03cdf..a25b1e8f8cf 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_Remote_7_3.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_3/Suite_Remote_7_3.java @@ -46,7 +46,9 @@ import org.junit.runners.Suite; OperationsWhileTargetIsRunningNonStopTest_7_3.class, CommandTimeoutTest_7_3.class, GDBMultiNonStopRunControlTest_7_3.class, - Suite_Sessionless_Tests.class, + Suite_Sessionless_Tests.class, + StepIntoSelectionTest_7_3.class, + StepIntoSelectionTest_7_3_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4.java new file mode 100644 index 00000000000..388c4688eed --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4; + +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_3.StepIntoSelectionTest_7_3; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_4 extends StepIntoSelectionTest_7_3 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_4); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4_NS.java new file mode 100644 index 00000000000..e6ec09cfa62 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/StepIntoSelectionTest_7_4_NS.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4; + +import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_4_NS extends StepIntoSelectionTest_7_4 { + @Override + protected void setLaunchAttributes() { + super.setLaunchAttributes(); + + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_7_4.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_7_4.java index e6b691e2560..ac1777dd890 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_7_4.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_7_4.java @@ -48,6 +48,8 @@ import org.junit.runners.Suite; GDBMultiNonStopRunControlTest_7_4.class, Suite_Sessionless_Tests.class, GDBConsoleBreakpointsTest_7_4.class, + StepIntoSelectionTest_7_4.class, + StepIntoSelectionTest_7_4_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_Remote_7_4.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_Remote_7_4.java index 890f5ed606f..c08d2b5f5c9 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_Remote_7_4.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/Suite_Remote_7_4.java @@ -49,6 +49,8 @@ import org.junit.runners.Suite; Suite_Sessionless_Tests.class, GDBConsoleBreakpointsTest_7_4.class, TraceFileTest_7_4.class, + StepIntoSelectionTest_7_4.class, + StepIntoSelectionTest_7_4_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5.java new file mode 100644 index 00000000000..ce8e826e032 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5; + +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_4.StepIntoSelectionTest_7_4; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_5 extends StepIntoSelectionTest_7_4 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_5); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5_NS.java new file mode 100644 index 00000000000..890cbb4569d --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/StepIntoSelectionTest_7_5_NS.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5; + +import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_5_NS extends StepIntoSelectionTest_7_5 { + @Override + protected void setLaunchAttributes() { + super.setLaunchAttributes(); + + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_7_5.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_7_5.java index ad053dda7f4..f0fb061c5f6 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_7_5.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_7_5.java @@ -48,6 +48,8 @@ import org.junit.runners.Suite; CommandTimeoutTest_7_5.class, Suite_Sessionless_Tests.class, GDBConsoleBreakpointsTest_7_5.class, + StepIntoSelectionTest_7_5.class, + StepIntoSelectionTest_7_5_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_Remote_7_5.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_Remote_7_5.java index 6e9f1b338a4..8e42753b483 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_Remote_7_5.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_5/Suite_Remote_7_5.java @@ -49,6 +49,8 @@ import org.junit.runners.Suite; Suite_Sessionless_Tests.class, GDBConsoleBreakpointsTest_7_5.class, TraceFileTest_7_5.class, + StepIntoSelectionTest_7_5.class, + StepIntoSelectionTest_7_5_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6.java new file mode 100644 index 00000000000..98dcf15efb2 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Marc Khouzam (Ericsson) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6; + +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_5.StepIntoSelectionTest_7_5; +import org.junit.runner.RunWith; + + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_6 extends StepIntoSelectionTest_7_5 { + @Override + protected void setGdbVersion() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_6); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6_NS.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6_NS.java new file mode 100644 index 00000000000..b77c88291d7 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/StepIntoSelectionTest_7_6_NS.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2013 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alvaro Sanchez-Leon (Ericsson AB) - Support for Step into selection (bug 244865) + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6; + +import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class StepIntoSelectionTest_7_6_NS extends StepIntoSelectionTest_7_6 { + @Override + protected void setLaunchAttributes() { + super.setLaunchAttributes(); + + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP, true); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_7_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_7_6.java index 0e364d79885..27fa726385e 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_7_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_7_6.java @@ -49,6 +49,8 @@ import org.junit.runners.Suite; Suite_Sessionless_Tests.class, GDBConsoleBreakpointsTest_7_6.class, GDBConsoleSynchronizingTest_7_6.class, + StepIntoSelectionTest_7_6.class, + StepIntoSelectionTest_7_6_NS.class, /* Add your test class here */ }) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_Remote_7_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_Remote_7_6.java index fc54dbfa84f..d058316883f 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_Remote_7_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/Suite_Remote_7_6.java @@ -50,6 +50,8 @@ import org.junit.runners.Suite; GDBConsoleBreakpointsTest_7_6.class, TraceFileTest_7_6.class, GDBConsoleSynchronizingTest_7_6.class, + StepIntoSelectionTest_7_6.class, + StepIntoSelectionTest_7_6_NS.class, /* Add your test class here */ })