Search in sources :

Example 1 with GdbInfoLine

use of org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine in project che by eclipse.

the class GdbDebugger method stepOut.

@Override
public void stepOut(StepOutAction action) throws DebuggerException {
    try {
        GdbInfoLine gdbInfoLine = gdb.finish();
        if (gdbInfoLine == null) {
            disconnect();
            return;
        }
        currentLocation = gdbInfoLine.getLocation();
        debuggerCallback.onEvent(new SuspendEventImpl(gdbInfoLine.getLocation()));
    } catch (GdbTerminatedException e) {
        disconnect();
        throw e;
    } catch (IOException | GdbParseException | InterruptedException e) {
        throw new DebuggerException("Step out error. " + e.getMessage(), e);
    }
}
Also used : SuspendEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl) GdbInfoLine(org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) GdbTerminatedException(org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException) IOException(java.io.IOException) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 2 with GdbInfoLine

use of org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine in project che by eclipse.

the class GdbDebugger method stepInto.

@Override
public void stepInto(StepIntoAction action) throws DebuggerException {
    try {
        GdbInfoLine gdbInfoLine = gdb.step();
        if (gdbInfoLine == null) {
            disconnect();
            return;
        }
        currentLocation = gdbInfoLine.getLocation();
        debuggerCallback.onEvent(new SuspendEventImpl(gdbInfoLine.getLocation()));
    } catch (GdbTerminatedException e) {
        disconnect();
        throw e;
    } catch (IOException | GdbParseException | InterruptedException e) {
        throw new DebuggerException("Step into error. " + e.getMessage(), e);
    }
}
Also used : SuspendEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl) GdbInfoLine(org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) GdbTerminatedException(org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException) IOException(java.io.IOException) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 3 with GdbInfoLine

use of org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine in project che by eclipse.

the class GdbTest method testStep.

@Test
public void testStep() throws Exception {
    gdb.file(file);
    gdb.breakpoint(7);
    gdb.run();
    GdbInfoLine gdbInfoLine = gdb.step();
    assertNotNull(gdbInfoLine.getLocation());
    gdbInfoLine = gdb.step();
    assertNotNull(gdbInfoLine.getLocation());
}
Also used : GdbInfoLine(org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine) Test(org.testng.annotations.Test)

Example 4 with GdbInfoLine

use of org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine in project che by eclipse.

the class GdbDebugger method stepOver.

@Override
public void stepOver(StepOverAction action) throws DebuggerException {
    try {
        GdbInfoLine gdbInfoLine = gdb.next();
        if (gdbInfoLine == null) {
            disconnect();
            return;
        }
        currentLocation = gdbInfoLine.getLocation();
        debuggerCallback.onEvent(new SuspendEventImpl(gdbInfoLine.getLocation()));
    } catch (GdbTerminatedException e) {
        disconnect();
        throw e;
    } catch (IOException | GdbParseException | InterruptedException e) {
        throw new DebuggerException("Step into error. " + e.getMessage(), e);
    }
}
Also used : SuspendEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl) GdbInfoLine(org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) GdbTerminatedException(org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException) IOException(java.io.IOException) GdbParseException(org.eclipse.che.plugin.gdb.server.exception.GdbParseException)

Example 5 with GdbInfoLine

use of org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine in project che by eclipse.

the class GdbTest method testNext.

@Test
public void testNext() throws Exception {
    gdb.file(file);
    gdb.breakpoint(7);
    gdb.run();
    GdbInfoLine gdbInfoLine = gdb.next();
    assertNotNull(gdbInfoLine.getLocation());
    assertEquals(gdbInfoLine.getLocation().getLineNumber(), 5);
    assertEquals(gdbInfoLine.getLocation().getTarget(), "h.cpp");
    gdbInfoLine = gdb.next();
    assertNotNull(gdbInfoLine.getLocation());
    assertEquals(gdbInfoLine.getLocation().getLineNumber(), 6);
    assertEquals(gdbInfoLine.getLocation().getTarget(), "h.cpp");
}
Also used : GdbInfoLine(org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine) Test(org.testng.annotations.Test)

Aggregations

GdbInfoLine (org.eclipse.che.plugin.gdb.server.parser.GdbInfoLine)6 IOException (java.io.IOException)3 SuspendEventImpl (org.eclipse.che.api.debug.shared.model.impl.event.SuspendEventImpl)3 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)3 GdbParseException (org.eclipse.che.plugin.gdb.server.exception.GdbParseException)3 GdbTerminatedException (org.eclipse.che.plugin.gdb.server.exception.GdbTerminatedException)3 Test (org.testng.annotations.Test)3