Package uk.co.cwspencer.gdb.gdbmi

Examples of uk.co.cwspencer.gdb.gdbmi.GdbMiParser2


  @Test
  @Ignore("not ready yet")
  public void testConnectedEvent() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "^connected,addr=\"0xfe00a300\",func=\"??\",args=[]\r\n" +
      "(gdb)\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
    Object object = GdbMiMessageConverter.processRecord(record);
    Assert.assertNotNull(object);
View Full Code Here


   */
  @Test
  public void testErrorEvent() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "^error,msg=\"mi_cmd_exec_interrupt: Inferior not executing.\"\r\n" +
      "(gdb)\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
    Object object = GdbMiMessageConverter.processRecord(record);
    Assert.assertNotNull(object);
View Full Code Here

   */
  @Test
  public void testExitEvent() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "^exit\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
    Object object = GdbMiMessageConverter.processRecord(record);
    Assert.assertNotNull(object);
View Full Code Here

  @Test
  @Ignore("not ready yet")
  public void testStoppedEvent() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "*stopped," +
      "reason=\"breakpoint-hit\"," +
      "disp=\"keep\"," +
      "bkptno=\"1\"," +
      "thread-id=\"0\"," +
      "stopped-threads=\"all\"," +
      "frame={" +
        "addr=\"0x08048564\"," +
        "func=\"main\"," +
        "args=[{" +
          "name=\"argc\"," +
          "value=\"1\"}," +
          "{name=\"argv\"," +
          "value=\"0xbfc4d4d4\"}]," +
        "file=\"myprog.c\"," +
        "fullname=\"/home/nickrob/myprog.c\"," +
        "line=\"68\"}\r\n" +
      "*stopped,stopped-threads=[\"1\",\"2\"]\r\n" +
      "(gdb)\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    {
      GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
      Object object = GdbMiMessageConverter.processRecord(record);
View Full Code Here

   */
  @Test
  public void testRunningEvent() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "*running,thread-id=\"2\"\r\n" +
      "*running,thread-id=\"all\"\r\n" +
      "(gdb)\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    {
      GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
      Object object = GdbMiMessageConverter.processRecord(record);
View Full Code Here

   */
  @Test
  public void testStackTrace() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "^done," +
      "stack=[" +
        "frame={" +
          "level=\"0\"," +
          "addr=\"0x00010734\"," +
          "func=\"callee4\"," +
          "file=\"../../../devo/gdb/testsuite/gdb.mi/basics.c\"," +
          "fullname=\"/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c\"," +
          "line=\"8\"}," +
        "frame={" +
          "level=\"1\"," +
          "addr=\"0x0001076c\"," +
          "func=\"callee3\"," +
          "file=\"../../../devo/gdb/testsuite/gdb.mi/basics.c\"," +
          "fullname=\"/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c\"," +
          "line=\"17\"}]\r\n" +
      "(gdb)\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
    Object object = GdbMiMessageConverter.processRecord(record, "-stack-list-frames");
    Assert.assertNotNull(object);
View Full Code Here

  @Test
  @Ignore("not ready yet")
  public void testBreakpoint() throws UnsupportedEncodingException
  {
    // Parse the message
    GdbMiParser2 parser = new GdbMiParser2(null);
    String messageStr =
      "^done," +
      "bkpt={" +
        "number=\"1\"," +
        "type=\"breakpoint\"," +
        "disp=\"keep\"," +
        "enabled=\"y\"," +
        "addr=\"0x000100d0\"," +
        "func=\"main\"," +
        "file=\"hello.c\"," +
        "fullname=\"/home/foo/hello.c\"," +
        "line=\"5\"," +
        "thread-groups=[\"i1\"]," +
        "times=\"0\"}\r\n" +
      "(gdb)\r\n";
    parser.process(messageStr.getBytes("US-ASCII"));
    List<GdbMiRecord> records = parser.getRecords();

    // Convert the message
    GdbMiResultRecord record = (GdbMiResultRecord) records.get(0);
    Object object = GdbMiMessageConverter.processRecord(record, "-break-insert");
    Assert.assertNotNull(object);
View Full Code Here

TOP

Related Classes of uk.co.cwspencer.gdb.gdbmi.GdbMiParser2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.