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);
Assert.assertTrue(object instanceof GdbStoppedEvent);
GdbStoppedEvent stoppedEvent = (GdbStoppedEvent) object;
Assert.assertEquals(GdbStoppedEvent.Reason.BreakpointHit, stoppedEvent.reason);
Assert.assertEquals(GdbBreakpoint.BreakpointDisposition.Keep,
stoppedEvent.breakpointDisposition);
Assert.assertEquals(new Integer(1), stoppedEvent.breakpointNumber);
Assert.assertEquals(new Integer(0), stoppedEvent.threadId);
Assert.assertEquals(true, stoppedEvent.allStopped);
Assert.assertNull(stoppedEvent.stoppedThreads);
Assert.assertEquals(new Long(0x08048564), stoppedEvent.frame.address);
Assert.assertEquals("main", stoppedEvent.frame.function);
Assert.assertEquals("myprog.c", stoppedEvent.frame.fileRelative);
Assert.assertEquals("/home/nickrob/myprog.c", stoppedEvent.frame.fileAbsolute);
Assert.assertEquals(new Integer(68), stoppedEvent.frame.line);
Assert.assertEquals(2, stoppedEvent.frame.arguments.size());
Assert.assertEquals("1", stoppedEvent.frame.arguments.get("argc"));
Assert.assertEquals("0xbfc4d4d4", stoppedEvent.frame.arguments.get("argv"));
}
{
GdbMiResultRecord record = (GdbMiResultRecord) records.get(1);
Object object = GdbMiMessageConverter.processRecord(record);
Assert.assertNotNull(object);
Assert.assertTrue(object instanceof GdbStoppedEvent);
GdbStoppedEvent stoppedEvent = (GdbStoppedEvent) object;