mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
New file.
This commit is contained in:
parent
027029e132
commit
6bf026e2e4
2 changed files with 90 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
||||||
|
package org.eclipse.cdt.debug.mi.core.cdi;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.event.MIErrorEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public class ErrorInfo extends SessionObject implements ICDIErrorInfo {
|
||||||
|
|
||||||
|
MIErrorEvent event;
|
||||||
|
|
||||||
|
public ErrorInfo(CSession session, MIErrorEvent e) {
|
||||||
|
super(session);
|
||||||
|
event = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo#getMessage()
|
||||||
|
*/
|
||||||
|
public String getMessage() {
|
||||||
|
return event.getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
* (c) Copyright QNX Software Systems Ltd. 2002.
|
||||||
|
* All Rights Reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package org.eclipse.cdt.debug.mi.core.event;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.debug.mi.core.output.MIConst;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.output.MIExecAsyncOutput;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.output.MIResult;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.output.MIResultRecord;
|
||||||
|
import org.eclipse.cdt.debug.mi.core.output.MIValue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (gdb)
|
||||||
|
* &"warning: Cannot insert breakpoint 2:\n"
|
||||||
|
* &"Cannot access memory at address 0x8020a3\n"
|
||||||
|
* 30^error,msg=3D"Cannot access memory at address 0x8020a3"=20
|
||||||
|
*/
|
||||||
|
public class MIErrorEvent extends MIStoppedEvent {
|
||||||
|
|
||||||
|
String msg = "";
|
||||||
|
|
||||||
|
public MIErrorEvent(MIExecAsyncOutput async) {
|
||||||
|
super(async);
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MIErrorEvent(MIResultRecord record) {
|
||||||
|
super(record);
|
||||||
|
parse();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
void parse () {
|
||||||
|
MIResult[] results = null;
|
||||||
|
MIExecAsyncOutput exec = getMIExecAsyncOutput();
|
||||||
|
MIResultRecord rr = getMIResultRecord();
|
||||||
|
|
||||||
|
if (exec != null) {
|
||||||
|
results = exec.getMIResults();
|
||||||
|
} else if (rr != null) {
|
||||||
|
results = rr.getMIResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (results != null) {
|
||||||
|
for (int i = 0; i < results.length; i++) {
|
||||||
|
String var = results[i].getVariable();
|
||||||
|
MIValue value = results[i].getMIValue();
|
||||||
|
String str = "";
|
||||||
|
if (value instanceof MIConst) {
|
||||||
|
str = ((MIConst)value).getString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (var.equals("msg")) {
|
||||||
|
msg = str;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue