1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Major patch from Tanya to extenalize strings

This commit is contained in:
Alain Magloire 2004-03-16 20:03:56 +00:00
parent a46dca30a1
commit f3a9fae638
82 changed files with 2801 additions and 2708 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -47,19 +47,17 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo;
/** /**
* Breakpoint Manager for the CDI interface. * Breakpoint Manager for the CDI interface.
*/ */
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager { public class BreakpointManager extends Manager implements ICDIBreakpointManager {
List breakList; List breakList;
List deferredList; List deferredList;
boolean allowInterrupt; boolean allowInterrupt;
boolean autoupdate;
public BreakpointManager(Session session) { public BreakpointManager(Session session) {
super(session); super(session, false);
breakList = Collections.synchronizedList(new ArrayList()); breakList = Collections.synchronizedList(new ArrayList());
deferredList = Collections.synchronizedList(new ArrayList()); deferredList = Collections.synchronizedList(new ArrayList());
allowInterrupt = true; allowInterrupt = true;
autoupdate = false;
} }
public MIBreakpoint[] getMIBreakpoints() throws CDIException { public MIBreakpoint[] getMIBreakpoints() throws CDIException {
@ -70,7 +68,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
s.getMISession().postCommand(breakpointList); s.getMISession().postCommand(breakpointList);
MIBreakListInfo info = breakpointList.getMIBreakListInfo(); MIBreakListInfo info = breakpointList.getMIBreakListInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
return info.getMIBreakpoints(); return info.getMIBreakpoints();
} catch (MIException e) { } catch (MIException e) {
@ -141,7 +139,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
&& breakList.contains(breakpoint)) { && breakList.contains(breakpoint)) {
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber(); number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
} else { } else {
throw new CDIException("Not a CDT breakpoint"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
} }
boolean state = suspendInferior(breakpoint.getTarget()); boolean state = suspendInferior(breakpoint.getTarget());
Session session = (Session)getSession(); Session session = (Session)getSession();
@ -151,7 +149,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakEnable); session.getMISession().postCommand(breakEnable);
MIInfo info = breakEnable.getMIInfo(); MIInfo info = breakEnable.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -171,7 +169,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
&& breakList.contains(breakpoint)) { && breakList.contains(breakpoint)) {
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber(); number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
} else { } else {
throw new CDIException("Not a CDT breakpoint"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
} }
Session session = (Session)getSession(); Session session = (Session)getSession();
@ -183,7 +181,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakDisable); session.getMISession().postCommand(breakDisable);
MIInfo info = breakDisable.getMIInfo(); MIInfo info = breakDisable.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -202,7 +200,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
&& breakList.contains(breakpoint)) { && breakList.contains(breakpoint)) {
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber(); number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
} else { } else {
throw new CDIException("Not a CDT breakpoint"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
} }
Session session = (Session)getSession(); Session session = (Session)getSession();
@ -212,7 +210,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
// reset the values to sane states. // reset the values to sane states.
String exprCond = condition.getExpression(); String exprCond = condition.getExpression();
if (exprCond == null) { if (exprCond == null) {
exprCond = ""; exprCond = ""; //$NON-NLS-1$
} }
int ignoreCount = condition.getIgnoreCount(); int ignoreCount = condition.getIgnoreCount();
if (ignoreCount < 0) { if (ignoreCount < 0) {
@ -225,14 +223,14 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakCondition); session.getMISession().postCommand(breakCondition);
MIInfo info = breakCondition.getMIInfo(); MIInfo info = breakCondition.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MIBreakAfter breakAfter = MIBreakAfter breakAfter =
factory.createMIBreakAfter(number, ignoreCount); factory.createMIBreakAfter(number, ignoreCount);
session.getMISession().postCommand(breakAfter); session.getMISession().postCommand(breakAfter);
info = breakAfter.getMIInfo(); info = breakAfter.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -332,7 +330,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
numbers[i] = numbers[i] =
((Breakpoint) breakpoints[i]).getMIBreakpoint().getNumber(); ((Breakpoint) breakpoints[i]).getMIBreakpoint().getNumber();
} else { } else {
throw new CDIException("Not a CDT breakpoint"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$
} }
} }
Session session = (Session)getSession(); Session session = (Session)getSession();
@ -343,7 +341,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakDelete); session.getMISession().postCommand(breakDelete);
MIInfo info = breakDelete.getMIInfo(); MIInfo info = breakDelete.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -376,7 +374,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
*/ */
public ICDICatchpoint setCatchpoint( int type, ICDICatchEvent event, String expression, public ICDICatchpoint setCatchpoint( int type, ICDICatchEvent event, String expression,
ICDICondition condition) throws CDIException { ICDICondition condition) throws CDIException {
throw new CDIException("Not Supported"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_Supported")); //$NON-NLS-1$
} }
/** /**
@ -467,11 +465,11 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakInsert); session.getMISession().postCommand(breakInsert);
MIBreakInsertInfo info = breakInsert.getMIBreakInsertInfo(); MIBreakInsertInfo info = breakInsert.getMIBreakInsertInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
points = info.getMIBreakpoints(); points = info.getMIBreakpoints();
if (points == null || points.length == 0) { if (points == null || points.length == 0) {
throw new CDIException("Error parsing"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -503,10 +501,10 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
MIBreakWatchInfo info = breakWatch.getMIBreakWatchInfo(); MIBreakWatchInfo info = breakWatch.getMIBreakWatchInfo();
points = info.getMIBreakpoints(); points = info.getMIBreakpoints();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
if (points == null || points.length == 0) { if (points == null || points.length == 0) {
throw new CDIException("Parsing Error"); throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -543,18 +541,4 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
return new Location(address); return new Location(address);
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
} }

View file

@ -0,0 +1,38 @@
/*
* Created on Mar 12, 2004
*
* To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
package org.eclipse.cdt.debug.mi.core.cdi;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* @author twolff
*
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class CdiResources {
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.core.cdi.CdiResources";//$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME);
/**
*
*/
private CdiResources() {
// TODO Auto-generated constructor stub
}
/**
* @param key
* @return
*/
public static String getString(String key) {
// TODO Auto-generated method stub
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}

View file

@ -0,0 +1,33 @@
cdi.Common.No_answer=No answer
cdi.SourceManager.Unknown_type=Unknown type
cdi.RegisterManager.Wrong_register_type=Wrong register type
cdi.BreakpointManager.Not_a_CDT_breakpoint=Not a CDT breakpoint
cdi.BreakpointManager.Not_Supported=Not Supported
cdi.BreakpointManager.Parsing_Error=Parsing Error
cdi.RuntimeOptions.Unable_to_set_args_target_not_responding=Unable to set arguments: target is not responding
cdi.RuntimeOptions.Unable_to_set_args=Unable to set arguments:
cdi.RuntimeOptions.Unable_to_set_args=Unable to set environment:
cdi.RuntimeOptions.Unable_to_set_working_dir=Unable to set working directory:
cdi.Session.Unknown_target=Unkown target
cdi.VariableManager.Unknown_type=Unknown type
cdi.VariableManager.Wrong_variable_type=Wrong variable type
cdi.VariableManager.Unknown_variable_ogject=Unknown variable object
cdi.SignalManager.ignore=aaignore
cdi.SignalManager.noignore=noignoreqq
cdi.SignalManager.stop=aastop
cdi.SignalManager.nostop=nostopqq
cdi.model.VariableObject.Target_not_responding=Target is not responding
cdi.model.Target.Unknown_thread=Unknown thread
cdi.model.Target.Target_not_responding=Target is not responding
cdi.model.Target.Cannot_switch_to_thread=Can not switch to thread
cdi.model.Target.Inferior_already_running=Inferior is already running
cdi.model.MemoryBlock.Bad_Offset=Bad Offset
src.MISession.Process_Terminated=Process Terminated
src.MISession.Thread_Terminated={R,T}xThread terminated
src.MISession.Target_not_suspended=Target is not suspended
src.MISession.Session_terminated=Session terminated
src.MISession.Target_not_responding=Target is not responding (timed out)
src.CygwinGDBDebugger.Error_init_shared_lib_options=Error initializing shared library options:
src.MIInferior.target_is_suspended=target is suspended
src.MIInferior.No_session=No MI Session
src.MIInferior.Failed_to_interrupt=Failed to interrupt

View file

@ -117,7 +117,7 @@ public class Configuration implements ICDIConfiguration {
public boolean supportsSuspend() { public boolean supportsSuspend() {
String os = null; String os = null;
try { try {
os = System.getProperty("os.name", ""); os = System.getProperty("os.name", ""); //$NON-NLS-1$ //$NON-NLS-2$
} catch (SecurityException e) { } catch (SecurityException e) {
} }
Process gdb = miSession.getGDBProcess(); Process gdb = miSession.getGDBProcess();
@ -130,7 +130,7 @@ public class Configuration implements ICDIConfiguration {
// If we have a pty, sending a control-c will work // If we have a pty, sending a control-c will work
// except for solaris. // except for solaris.
if (os.equals("SunOS")) { if (os.equals("SunOS")) { //$NON-NLS-1$
MIInferior inferior = miSession.getMIInferior(); MIInferior inferior = miSession.getMIInferior();
if (inferior.getPTY() != null) { if (inferior.getPTY() != null) {
// FIXME: bug in Solaris gdb when using -tty, sending a control-c // FIXME: bug in Solaris gdb when using -tty, sending a control-c

View file

@ -34,16 +34,14 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo;
/** /**
*/ */
public class ExpressionManager extends SessionObject implements ICDIExpressionManager{ public class ExpressionManager extends Manager implements ICDIExpressionManager{
private List expList; private List expList;
private boolean autoupdate;
MIVarChange[] noChanges = new MIVarChange[0]; MIVarChange[] noChanges = new MIVarChange[0];
public ExpressionManager(Session session) { public ExpressionManager(Session session) {
super(session); super(session, true);
expList = Collections.synchronizedList(new ArrayList()); expList = Collections.synchronizedList(new ArrayList());
autoupdate = true;
} }
/** /**
@ -91,7 +89,7 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.postCommand(var); mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo(); MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
VariableObject varObj = new VariableObject(currentTarget, name, null, 0, 0); VariableObject varObj = new VariableObject(currentTarget, name, null, 0, 0);
expression = new Expression(varObj, info.getMIVar()); expression = new Expression(varObj, info.getMIVar());
@ -119,7 +117,7 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.postCommand(var); mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo(); MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
ICDITarget tgt = frame.getThread().getTarget(); ICDITarget tgt = frame.getThread().getTarget();
VariableObject varObj = new VariableObject(tgt, name, frame, 0, 0); VariableObject varObj = new VariableObject(tgt, name, frame, 0, 0);
@ -189,7 +187,7 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.postCommand(update); mi.postCommand(update);
MIVarUpdateInfo info = update.getMIVarUpdateInfo(); MIVarUpdateInfo info = update.getMIVarUpdateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
changes = info.getMIVarChanges(); changes = info.getMIVarChanges();
} catch (MIException e) { } catch (MIException e) {
@ -211,18 +209,4 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.fireEvents(events); mi.fireEvents(events);
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIExpressionManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
} }

View file

@ -12,8 +12,8 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
public class Location implements ICDILocation { public class Location implements ICDILocation {
long addr; long addr;
String file = ""; String file = ""; //$NON-NLS-1$
String function = ""; String function = ""; //$NON-NLS-1$
int line; int line;
public Location(String f, String fnct, int l) { public Location(String f, String fnct, int l) {

View file

@ -0,0 +1,64 @@
/**********************************************************************
* Copyright (c) 2002,2003 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
/**
* Manager
*
*/
public abstract class Manager extends SessionObject implements ICDIManager {
boolean autoUpdate;
public Manager(Session session, boolean update) {
super(session);
autoUpdate = update;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.ICDIUpdateManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoUpdate = update;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.ICDIUpdateManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoUpdate;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.impl.Manager#update()
*/
public abstract void update() throws CDIException;
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent[])
*/
public void handleDebugEvent(ICDIEvent[] events) {
for (int i = 0; i < events.length; i++) {
handleDebugEvent(events[i]);
}
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(org.eclipse.cdt.debug.core.cdi.event.ICDIEvent)
*/
public void handleDebugEvent(ICDIEvent event) {
}
}

View file

@ -24,15 +24,13 @@ import org.eclipse.cdt.debug.mi.core.output.MIDataReadMemoryInfo;
/** /**
*/ */
public class MemoryManager extends SessionObject implements ICDIMemoryManager { public class MemoryManager extends Manager implements ICDIMemoryManager {
List blockList; List blockList;
boolean autoupdate;
public MemoryManager(Session session) { public MemoryManager(Session session) {
super(session); super(session, true);
blockList = new ArrayList(); blockList = new ArrayList();
autoupdate = true;
} }
/** /**
@ -136,7 +134,7 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
mi.postCommand(mem); mi.postCommand(mem);
MIDataReadMemoryInfo info = mem.getMIDataReadMemoryInfo(); MIDataReadMemoryInfo info = mem.getMIDataReadMemoryInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
return info; return info;
} catch (MIException e) { } catch (MIException e) {
@ -149,7 +147,7 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
*/ */
public ICDIMemoryBlock createMemoryBlock(long address, int length) public ICDIMemoryBlock createMemoryBlock(long address, int length)
throws CDIException { throws CDIException {
String addr = "0x" + Long.toHexString(address); String addr = "0x" + Long.toHexString(address); //$NON-NLS-1$
return createMemoryBlock(addr, length); return createMemoryBlock(addr, length);
} }
@ -197,18 +195,4 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
} }
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
} }

View file

@ -34,16 +34,14 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo;
/** /**
*/ */
public class RegisterManager extends SessionObject implements ICDIRegisterManager { public class RegisterManager extends Manager implements ICDIRegisterManager {
private List regList; private List regList;
private boolean autoupdate;
MIVarChange[] noChanges = new MIVarChange[0]; MIVarChange[] noChanges = new MIVarChange[0];
public RegisterManager(Session session) { public RegisterManager(Session session) {
super(session); super(session, true);
regList = Collections.synchronizedList(new ArrayList()); regList = Collections.synchronizedList(new ArrayList());
autoupdate = true;
} }
/** /**
@ -59,7 +57,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
MIDataListRegisterNamesInfo info = MIDataListRegisterNamesInfo info =
registers.getMIDataListRegisterNamesInfo(); registers.getMIDataListRegisterNamesInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
String[] names = info.getRegisterNames(); String[] names = info.getRegisterNames();
List regsList = new ArrayList(names.length); List regsList = new ArrayList(names.length);
@ -86,7 +84,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
Register reg = getRegister(regObject); Register reg = getRegister(regObject);
if (reg == null) { if (reg == null) {
try { try {
String name = "$" + regObj.getName(); String name = "$" + regObj.getName(); //$NON-NLS-1$
Session session = (Session)getSession(); Session session = (Session)getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
@ -94,7 +92,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
mi.postCommand(var); mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo(); MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
reg = new Register(regObj, info.getMIVar()); reg = new Register(regObj, info.getMIVar());
regList.add(reg); regList.add(reg);
@ -104,7 +102,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
} }
return reg; return reg;
} }
throw new CDIException("Wrong register type"); throw new CDIException(CdiResources.getString("cdi.RegisterManager.Wrong_register_type")); //$NON-NLS-1$
} }
public Register createRegister(RegisterObject v, MIVar mivar) throws CDIException { public Register createRegister(RegisterObject v, MIVar mivar) throws CDIException {
@ -120,20 +118,6 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
regList.remove(reg); regList.remove(reg);
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/** /**
* Use by the eventManager to find the Register; * Use by the eventManager to find the Register;
*/ */
@ -180,7 +164,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
MIDataListChangedRegistersInfo info = MIDataListChangedRegistersInfo info =
changed.getMIDataListChangedRegistersInfo(); changed.getMIDataListChangedRegistersInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
int[] regnos = info.getRegisterNumbers(); int[] regnos = info.getRegisterNumbers();
List eventList = new ArrayList(regnos.length); List eventList = new ArrayList(regnos.length);
@ -197,7 +181,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
mi.postCommand(update); mi.postCommand(update);
MIVarUpdateInfo updateInfo = update.getMIVarUpdateInfo(); MIVarUpdateInfo updateInfo = update.getMIVarUpdateInfo();
if (updateInfo == null) { if (updateInfo == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
changes = updateInfo.getMIVarChanges(); changes = updateInfo.getMIVarChanges();
} catch (MIException e) { } catch (MIException e) {

View file

@ -42,10 +42,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(arguments); mi.postCommand(arguments);
MIInfo info = arguments.getMIInfo(); MIInfo info = arguments.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Unable to set arguments: target is not responding"); throw new CDIException(CdiResources.getString("cdi.RuntimeOptions.Unable_to_set_args_target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new CDIException("Unable to set arguments: " + e.getMessage()); throw new CDIException(CdiResources.getString("cdi.RuntimeOptions.Unable_to_set_args") + e.getMessage()); //$NON-NLS-1$
} }
} }
@ -73,10 +73,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(set); mi.postCommand(set);
MIInfo info = set.getMIInfo(); MIInfo info = set.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Unable to set environment: target is not responding"); throw new CDIException(CdiResources.getString("cdi.RuntimeOptions.Unable_to_set_args_target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new CDIException("Unable to set environment: " + e.getMessage()); throw new CDIException(CdiResources.getString("cdi.RuntimeOptions.Unable_to_set_environment") + e.getMessage()); //$NON-NLS-1$
} }
} }
} }
@ -95,10 +95,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(cd); mi.postCommand(cd);
MIInfo info = cd.getMIInfo(); MIInfo info = cd.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Unable to set working directory: target is not responding"); throw new CDIException(CdiResources.getString("cdi.RuntimeOptions.Unable_to_set_args_target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new CDIException("Unable to set working directory: " + e.getMessage()); throw new CDIException(CdiResources.getString("cdi.RuntimeOptions.Unable_to_set_working_dir") + e.getMessage()); //$NON-NLS-1$
} }
} }

View file

@ -172,7 +172,7 @@ public class Session implements ICDISession, ICDISessionObject {
if (target instanceof Target) { if (target instanceof Target) {
ctarget = (Target)target; ctarget = (Target)target;
} else { } else {
throw new CDIException("Unkown target"); throw new CDIException(CdiResources.getString("cdi.Session.Unknown_target")); //$NON-NLS-1$
} }
} }

View file

@ -38,16 +38,14 @@ import org.eclipse.cdt.debug.mi.core.output.MIShared;
/** /**
* Manager of the CDI shared libraries. * Manager of the CDI shared libraries.
*/ */
public class SharedLibraryManager extends SessionObject implements ICDISharedLibraryManager { public class SharedLibraryManager extends Manager implements ICDISharedLibraryManager {
List sharedList; List sharedList;
boolean autoupdate;
boolean isDeferred; boolean isDeferred;
public SharedLibraryManager (Session session) { public SharedLibraryManager (Session session) {
super(session); super(session, true);
sharedList = new ArrayList(1); sharedList = new ArrayList(1);
autoupdate = true;
} }
MIShared[] getMIShareds() throws CDIException { MIShared[] getMIShareds() throws CDIException {
@ -59,7 +57,7 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
session.getMISession().postCommand(infoShared); session.getMISession().postCommand(infoShared);
MIInfoSharedLibraryInfo info = infoShared.getMIInfoSharedLibraryInfo(); MIInfoSharedLibraryInfo info = infoShared.getMIInfoSharedLibraryInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
miLibs = info.getMIShared(); miLibs = info.getMIShared();
} catch (MIException e) { } catch (MIException e) {
@ -171,13 +169,13 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
Session session = (Session)getSession(); Session session = (Session)getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIGDBShow show = factory.createMIGDBShow(new String[]{"auto-solib-add"}); MIGDBShow show = factory.createMIGDBShow(new String[]{"auto-solib-add"}); //$NON-NLS-1$
try { try {
mi.postCommand(show); mi.postCommand(show);
MIGDBShowInfo info = show.getMIGDBShowInfo(); MIGDBShowInfo info = show.getMIGDBShowInfo();
String value = info.getValue(); String value = info.getValue();
if (value != null) { if (value != null) {
return value.equalsIgnoreCase("on"); return value.equalsIgnoreCase("on"); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -202,13 +200,13 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
Session session = (Session)getSession(); Session session = (Session)getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIGDBShow show = factory.createMIGDBShow(new String[]{"stop-on-solib-events"}); MIGDBShow show = factory.createMIGDBShow(new String[]{"stop-on-solib-events"}); //$NON-NLS-1$
try { try {
mi.postCommand(show); mi.postCommand(show);
MIGDBShowInfo info = show.getMIGDBShowInfo(); MIGDBShowInfo info = show.getMIGDBShowInfo();
String value = info.getValue(); String value = info.getValue();
if (value != null) { if (value != null) {
return value.equalsIgnoreCase("1"); return value.equalsIgnoreCase("1"); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -268,7 +266,7 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
mi.postCommand(sharedlibrary); mi.postCommand(sharedlibrary);
MIInfo info = sharedlibrary.getMIInfo(); MIInfo info = sharedlibrary.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -292,7 +290,7 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
session.getMISession().postCommand(sharedlibrary); session.getMISession().postCommand(sharedlibrary);
MIInfo info = sharedlibrary.getMIInfo(); MIInfo info = sharedlibrary.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -302,20 +300,6 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
} }
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#supportsAutoLoadSymbols() * @see org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager#supportsAutoLoadSymbols()
*/ */

View file

@ -25,15 +25,13 @@ import org.eclipse.cdt.debug.mi.core.output.MISigHandle;
/** /**
*/ */
public class SignalManager extends SessionObject implements ICDISignalManager { public class SignalManager extends Manager implements ICDISignalManager {
boolean autoupdate;
MISigHandle[] noSigs = new MISigHandle[0]; MISigHandle[] noSigs = new MISigHandle[0];
List signalsList = null; List signalsList = null;
public SignalManager(Session session) { public SignalManager(Session session) {
super(session); super(session, false);
autoupdate = false;
} }
MISigHandle[] getMISignals() throws CDIException { MISigHandle[] getMISignals() throws CDIException {
@ -46,7 +44,7 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
mi.postCommand(sigs); mi.postCommand(sigs);
MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo(); MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
miSigs = info.getMISignals(); miSigs = info.getMISignals();
} catch (MIException e) { } catch (MIException e) {
@ -65,7 +63,7 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
mi.postCommand(sigs); mi.postCommand(sigs);
MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo(); MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MISigHandle[] miSigs = info.getMISignals(); MISigHandle[] miSigs = info.getMISignals();
if (miSigs.length > 0) { if (miSigs.length > 0) {
@ -127,17 +125,17 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
StringBuffer buffer = new StringBuffer(sig.getName()); StringBuffer buffer = new StringBuffer(sig.getName());
buffer.append(" "); buffer.append(" "); //$NON-NLS-1$
if (isIgnore) { if (isIgnore) {
buffer.append("ignore"); buffer.append(CdiResources.getString("cdi.SignalManager.ignore")); //$NON-NLS-1$
} else { } else {
buffer.append("noignore"); buffer.append(CdiResources.getString("cdi.SignalManager.noignore")); //$NON-NLS-1$
} }
buffer.append(" "); buffer.append(" "); //$NON-NLS-1$
if (isStop) { if (isStop) {
buffer.append("stop"); buffer.append(CdiResources.getString("cdi.SignalManager.stop")); //$NON-NLS-1$
} else { } else {
buffer.append("nostop"); buffer.append(CdiResources.getString("cdi.SignalManager.nostop")); //$NON-NLS-1$
} }
MIHandle handle = factory.createMIHandle(buffer.toString()); MIHandle handle = factory.createMIHandle(buffer.toString());
try { try {
@ -160,20 +158,6 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
return (ICDISignal[])signalsList.toArray(new ICDISignal[0]); return (ICDISignal[])signalsList.toArray(new ICDISignal[0]);
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#update() * @see org.eclipse.cdt.debug.core.cdi.ICDISignalManager#update()
*/ */

View file

@ -51,14 +51,12 @@ import org.eclipse.cdt.debug.mi.core.output.MISrcAsm;
/** /**
*/ */
public class SourceManager extends SessionObject implements ICDISourceManager { public class SourceManager extends Manager implements ICDISourceManager {
boolean autoupdate;
GDBTypeParser gdbTypeParser; GDBTypeParser gdbTypeParser;
public SourceManager(Session session) { public SourceManager(Session session) {
super(session); super(session, false);
autoupdate = false;
gdbTypeParser = new GDBTypeParser(); gdbTypeParser = new GDBTypeParser();
} }
@ -131,7 +129,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
Session session = (Session)getSession(); Session session = (Session)getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
String hex = "0x"; String hex = "0x"; //$NON-NLS-1$
String sa = hex + Long.toHexString(start); String sa = hex + Long.toHexString(start);
String ea = hex + Long.toHexString(end); String ea = hex + Long.toHexString(end);
MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false); MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false);
@ -185,7 +183,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
Session session = (Session)getSession(); Session session = (Session)getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
String hex = "0x"; String hex = "0x"; //$NON-NLS-1$
String sa = hex + Long.toHexString(start); String sa = hex + Long.toHexString(start);
String ea = hex + Long.toHexString(end); String ea = hex + Long.toHexString(end);
MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true); MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true);
@ -203,20 +201,6 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
} }
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#update() * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#update()
*/ */
@ -271,7 +255,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
if (headType != null) { if (headType != null) {
return headType; return headType;
} }
throw new CDIException("Unknown type"); throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$
} }
Type toCDIType(ICDITarget target, String name) throws CDIException { Type toCDIType(ICDITarget target, String name) throws CDIException {
@ -282,37 +266,37 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
String typename = name.trim(); String typename = name.trim();
// Check the primitives. // Check the primitives.
if (typename.equals("char")) { if (typename.equals("char")) { //$NON-NLS-1$
return new CharType(target, typename); return new CharType(target, typename);
} else if (typename.equals("wchar_t")) { } else if (typename.equals("wchar_t")) { //$NON-NLS-1$
return new WCharType(target, typename); return new WCharType(target, typename);
} else if (typename.equals("short")) { } else if (typename.equals("short")) { //$NON-NLS-1$
return new ShortType(target, typename); return new ShortType(target, typename);
} else if (typename.equals("int")) { } else if (typename.equals("int")) { //$NON-NLS-1$
return new IntType(target, typename); return new IntType(target, typename);
} else if (typename.equals("long")) { } else if (typename.equals("long")) { //$NON-NLS-1$
return new LongType(target, typename); return new LongType(target, typename);
} else if (typename.equals("unsigned")) { } else if (typename.equals("unsigned")) { //$NON-NLS-1$
return new IntType(target, typename, true); return new IntType(target, typename, true);
} else if (typename.equals("signed")) { } else if (typename.equals("signed")) { //$NON-NLS-1$
return new IntType(target, typename); return new IntType(target, typename);
} else if (typename.equals("bool")) { } else if (typename.equals("bool")) { //$NON-NLS-1$
return new BoolType(target, typename); return new BoolType(target, typename);
} else if (typename.equals("_Bool")) { } else if (typename.equals("_Bool")) { //$NON-NLS-1$
return new BoolType(target, typename); return new BoolType(target, typename);
} else if (typename.equals("float")) { } else if (typename.equals("float")) { //$NON-NLS-1$
return new FloatType(target, typename); return new FloatType(target, typename);
} else if (typename.equals("double")) { } else if (typename.equals("double")) { //$NON-NLS-1$
return new DoubleType(target, typename); return new DoubleType(target, typename);
} else if (typename.equals("void")) { } else if (typename.equals("void")) { //$NON-NLS-1$
return new VoidType(target, typename); return new VoidType(target, typename);
} else if (typename.equals("enum")) { } else if (typename.equals("enum")) { //$NON-NLS-1$
return new EnumType(target, typename); return new EnumType(target, typename);
} else if (typename.equals("union")) { } else if (typename.equals("union")) { //$NON-NLS-1$
return new StructType(target, typename); return new StructType(target, typename);
} else if (typename.equals("struct")) { } else if (typename.equals("struct")) { //$NON-NLS-1$
return new StructType(target, typename); return new StructType(target, typename);
} else if (typename.equals("class")) { } else if (typename.equals("class")) { //$NON-NLS-1$
return new StructType(target, typename); return new StructType(target, typename);
} }
@ -325,24 +309,24 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
// ISOC allows permutations: // ISOC allows permutations:
// "signed int" and "int signed" are equivalent // "signed int" and "int signed" are equivalent
boolean isUnsigned = (first.equals("unsigned") || second.equals("unsigned")); boolean isUnsigned = (first.equals("unsigned") || second.equals("unsigned")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isSigned = (first.equals("signed") || second.equals("signed")); boolean isSigned = (first.equals("signed") || second.equals("signed")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isChar = (first.equals("char") || second.equals("char")); boolean isChar = (first.equals("char") || second.equals("char")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isInt = (first.equals("int") || second.equals("int")); boolean isInt = (first.equals("int") || second.equals("int")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isLong = (first.equals("long") || second.equals("long")); boolean isLong = (first.equals("long") || second.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isShort = (first.equals("short") || second.equals("short")); boolean isShort = (first.equals("short") || second.equals("short")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isLongLong = (first.equals("long") && second.equals("long")); boolean isLongLong = (first.equals("long") && second.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isDouble = (first.equals("double") || second.equals("double")); boolean isDouble = (first.equals("double") || second.equals("double")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isFloat = (first.equals("float") || second.equals("float")); boolean isFloat = (first.equals("float") || second.equals("float")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isComplex = (first.equals("complex") || second.equals("complex") || boolean isComplex = (first.equals("complex") || second.equals("complex") || //$NON-NLS-1$ //$NON-NLS-2$
first.equals("_Complex") || second.equals("_Complex")); first.equals("_Complex") || second.equals("_Complex")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary")); boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isStruct = first.equals("struct"); boolean isStruct = first.equals("struct"); //$NON-NLS-1$
boolean isClass = first.equals("class"); boolean isClass = first.equals("class"); //$NON-NLS-1$
boolean isUnion = first.equals("union"); boolean isUnion = first.equals("union"); //$NON-NLS-1$
boolean isEnum = first.equals("enum"); boolean isEnum = first.equals("enum"); //$NON-NLS-1$
if (isChar && (isSigned || isUnsigned)) { if (isChar && (isSigned || isUnsigned)) {
return new CharType(target, typename, isUnsigned); return new CharType(target, typename, isUnsigned);
@ -379,17 +363,17 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
String second = st.nextToken(); String second = st.nextToken();
String third = st.nextToken(); String third = st.nextToken();
boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed")); boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned")); boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int")); boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean isLong = (first.equals("long") || second.equals("long") || third.equals("long")); boolean isLong = (first.equals("long") || second.equals("long") || third.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean isShort = (first.equals("short") || second.equals("short") || third.equals("short")); boolean isShort = (first.equals("short") || second.equals("short") || third.equals("short")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean isLongLong = (first.equals("long") && second.equals("long")) || boolean isLongLong = (first.equals("long") && second.equals("long")) || //$NON-NLS-1$ //$NON-NLS-2$
(second.equals("long") && third.equals("long")); (second.equals("long") && third.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isDouble = (first.equals("double") || second.equals("double") || third.equals("double")); boolean isDouble = (first.equals("double") || second.equals("double") || third.equals("double")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean isComplex = (first.equals("complex") || second.equals("complex") || third.equals("complex") || boolean isComplex = (first.equals("complex") || second.equals("complex") || third.equals("complex") || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
first.equals("_Complex") || second.equals("_Complex") || third.equals("_Complex")); first.equals("_Complex") || second.equals("_Complex") || third.equals("_Complex")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary") || third.equals("_Imaginary")); boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary") || third.equals("_Imaginary")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (isShort && isInt && (isSigned || unSigned)) { if (isShort && isInt && (isSigned || unSigned)) {
@ -411,18 +395,18 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
String third = st.nextToken(); String third = st.nextToken();
String fourth = st.nextToken(); String fourth = st.nextToken();
boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned") || fourth.equals("unsigned")); boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned") || fourth.equals("unsigned")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed") || fourth.equals("signed")); boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed") || fourth.equals("signed")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int") || fourth.equals("int")); boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int") || fourth.equals("int")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
boolean isLongLong = (first.equals("long") && second.equals("long")) boolean isLongLong = (first.equals("long") && second.equals("long")) //$NON-NLS-1$ //$NON-NLS-2$
|| (second.equals("long") && third.equals("long")) || (second.equals("long") && third.equals("long")) //$NON-NLS-1$ //$NON-NLS-2$
|| (third.equals("long") && fourth.equals("long")); || (third.equals("long") && fourth.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
if (isLongLong && isInt && (isSigned || unSigned)) { if (isLongLong && isInt && (isSigned || unSigned)) {
return new LongLongType(target, typename, unSigned); return new LongLongType(target, typename, unSigned);
} }
} }
throw new CDIException("Unknown type"); throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$
} }
public String getDetailTypeName(String typename) throws CDIException { public String getDetailTypeName(String typename) throws CDIException {
@ -434,7 +418,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
mi.postCommand(ptype); mi.postCommand(ptype);
MIPTypeInfo info = ptype.getMIPtypeInfo(); MIPTypeInfo info = ptype.getMIPtypeInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
return info.getType(); return info.getType();
} catch (MIException e) { } catch (MIException e) {

View file

@ -0,0 +1,34 @@
/*
*(c) Copyright QNX Software Systems Ltd. 2002.
* All Rights Reserved.
*
*/
package org.eclipse.cdt.debug.mi.core.cdi;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
/**
*/
public class ThreadManager extends Manager { //implements ICDIThreadManager {
public ThreadManager(Session session) {
super(session, true);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIThreadManager#getThreads()
*/
public ICDIThread[] getThreads() throws CDIException {
return new ICDIThread[] {};
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIThreadManager#update()
*/
public void update() throws CDIException {
}
}

View file

@ -46,20 +46,18 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo;
/** /**
*/ */
public class VariableManager extends SessionObject implements ICDIVariableManager { public class VariableManager extends Manager implements ICDIVariableManager {
// We put a restriction on how deep we want to // We put a restriction on how deep we want to
// go when doing update of the variables. // go when doing update of the variables.
// If the number is to high, gdb will just hang. // If the number is to high, gdb will just hang.
int MAX_STACK_DEPTH = 200; int MAX_STACK_DEPTH = 200;
List variableList; List variableList;
boolean autoupdate;
MIVarChange[] noChanges = new MIVarChange[0]; MIVarChange[] noChanges = new MIVarChange[0];
public VariableManager(Session session) { public VariableManager(Session session) {
super(session); super(session, true);
variableList = Collections.synchronizedList(new ArrayList()); variableList = Collections.synchronizedList(new ArrayList());
autoupdate = true;
} }
/** /**
@ -132,13 +130,13 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(ptype); mi.postCommand(ptype);
MIPTypeInfo info = ptype.getMIPtypeInfo(); MIPTypeInfo info = ptype.getMIPtypeInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} }
} else { } else {
throw new CDIException("Unknown type"); throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_type")); //$NON-NLS-1$
} }
} }
@ -206,7 +204,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(var); mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo(); MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
argument = new Argument(argObj, info.getMIVar()); argument = new Argument(argObj, info.getMIVar());
variableList.add(argument); variableList.add(argument);
@ -220,7 +218,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
} }
return argument; return argument;
} }
throw new CDIException("Wrong variable type"); throw new CDIException(CdiResources.getString("cdi.VariableManager.Wrong_variable_type")); //$NON-NLS-1$
} }
/** /**
@ -245,7 +243,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(listArgs); mi.postCommand(listArgs);
MIStackListArgumentsInfo info = listArgs.getMIStackListArgumentsInfo(); MIStackListArgumentsInfo info = listArgs.getMIStackListArgumentsInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MIFrame[] miFrames = info.getMIFrames(); MIFrame[] miFrames = info.getMIFrames();
if (miFrames != null && miFrames.length == 1) { if (miFrames != null && miFrames.length == 1) {
@ -281,10 +279,10 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
} }
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
if (filename.length() > 0) { if (filename.length() > 0) {
buffer.append('\'').append(filename).append('\'').append("::"); buffer.append('\'').append(filename).append('\'').append("::"); //$NON-NLS-1$
} }
if (function.length() > 0) { if (function.length() > 0) {
buffer.append(function).append("::"); buffer.append(function).append("::"); //$NON-NLS-1$
} }
buffer.append(name); buffer.append(name);
ICDITarget target = getSession().getCurrentTarget(); ICDITarget target = getSession().getCurrentTarget();
@ -313,7 +311,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
vo.setCastingArrayEnd(length); vo.setCastingArrayEnd(length);
return vo; return vo;
} }
throw new CDIException("Unknown variable object"); throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
} }
/** /**
@ -337,12 +335,12 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
obj.getStackDepth()); obj.getStackDepth());
String casting = obj.getCastingType(); String casting = obj.getCastingType();
if (casting != null && casting.length() > 0) { if (casting != null && casting.length() > 0) {
type = "(" + type + ")" + "(" + casting + " )"; type = "(" + type + ")" + "(" + casting + " )"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
} }
vo.setCastingType(type); vo.setCastingType(type);
return vo; return vo;
} }
throw new CDIException("Unknown variable object"); throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
} }
/** /**
@ -364,7 +362,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(locals); mi.postCommand(locals);
MIStackListLocalsInfo info = locals.getMIStackListLocalsInfo(); MIStackListLocalsInfo info = locals.getMIStackListLocalsInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
args = info.getLocals(); args = info.getLocals();
if (args != null) { if (args != null) {
@ -423,7 +421,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(var); mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo(); MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
variable = new Variable(varObj, info.getMIVar()); variable = new Variable(varObj, info.getMIVar());
variableList.add(variable); variableList.add(variable);
@ -437,7 +435,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
} }
return variable; return variable;
} }
throw new CDIException("Wrong variable type"); throw new CDIException(CdiResources.getString("cdi.VariableManager.Wrong_variable_type")); //$NON-NLS-1$
} }
/** /**
@ -454,20 +452,6 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
} }
} }
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#isAutoUpdate()
*/
public boolean isAutoUpdate() {
return autoupdate;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#setAutoUpdate(boolean)
*/
public void setAutoUpdate(boolean update) {
autoupdate = update;
}
/** /**
* Update the elements in the cache, from the response of the "-var-update" * Update the elements in the cache, from the response of the "-var-update"
* mi/command. Althought tempting we do not use the "-var-update *" command, since * mi/command. Althought tempting we do not use the "-var-update *" command, since
@ -517,7 +501,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(update); mi.postCommand(update);
MIVarUpdateInfo info = update.getMIVarUpdateInfo(); MIVarUpdateInfo info = update.getMIVarUpdateInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
changes = info.getMIVarChanges(); changes = info.getMIVarChanges();
} catch (MIException e) { } catch (MIException e) {

View file

@ -9,6 +9,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIFormat; import org.eclipse.cdt.debug.mi.core.MIFormat;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager; import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -165,21 +166,21 @@ public class MemoryBlock extends CObject implements ICDIMemoryBlock {
*/ */
public void setValue(long offset, byte[] bytes) throws CDIException { public void setValue(long offset, byte[] bytes) throws CDIException {
if (offset >= getLength() || offset + bytes.length > getLength()) { if (offset >= getLength() || offset + bytes.length > getLength()) {
throw new CDIException("Bad Offset"); throw new CDIException(CdiResources.getString("cdi.model.MemoryBlock.Bad_Offset")); //$NON-NLS-1$
} }
Session session = (Session)getTarget().getSession(); Session session = (Session)getTarget().getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
for (int i = 0; i < bytes.length; i++) { for (int i = 0; i < bytes.length; i++) {
long l = new Byte(bytes[i]).longValue() & 0xff; long l = new Byte(bytes[i]).longValue() & 0xff;
String value = "0x" + Long.toHexString(l); String value = "0x" + Long.toHexString(l); //$NON-NLS-1$
MIDataWriteMemory mw = factory.createMIDataWriteMemory(offset + i, MIDataWriteMemory mw = factory.createMIDataWriteMemory(offset + i,
expression, MIFormat.HEXADECIMAL, 1, value); expression, MIFormat.HEXADECIMAL, 1, value);
try { try {
mi.postCommand(mw); mi.postCommand(mw);
MIInfo info = mw.getMIInfo(); MIInfo info = mw.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);

View file

@ -9,6 +9,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -36,7 +37,7 @@ public class Register extends Variable implements ICDIRegister {
mi.postCommand(var); mi.postCommand(var);
MIVarListChildrenInfo info = var.getMIVarListChildrenInfo(); MIVarListChildrenInfo info = var.getMIVarListChildrenInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MIVar[] vars = info.getMIVars(); MIVar[] vars = info.getMIVars();
children = new Register[vars.length]; children = new Register[vars.length];

View file

@ -119,7 +119,7 @@ public class StackFrame extends CObject implements ICDIStackFrame {
return new Location(frame.getFile(), frame.getFunction(), return new Location(frame.getFile(), frame.getFunction(),
frame.getLine(), frame.getAddress()); frame.getLine(), frame.getAddress());
} }
return new Location("", "", 0, 0); return new Location("", "", 0, 0); //$NON-NLS-1$ //$NON-NLS-2$
} }
/** /**

View file

@ -44,6 +44,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfo; import org.eclipse.cdt.debug.mi.core.output.MIInfo;
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo; import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo; import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
/** /**
*/ */
@ -89,7 +90,7 @@ public class Target implements ICDITarget {
if (cthread instanceof Thread) { if (cthread instanceof Thread) {
setCurrentThread(cthread, true); setCurrentThread(cthread, true);
} else { } else {
throw new CDIException("Unknown thread"); throw new CDIException(CdiResources.getString("cdi.model.Target.Unknown_thread")); //$NON-NLS-1$
} }
} }
@ -97,7 +98,7 @@ public class Target implements ICDITarget {
if (cthread instanceof Thread) { if (cthread instanceof Thread) {
setCurrentThread((Thread)cthread, doUpdate); setCurrentThread((Thread)cthread, doUpdate);
} else { } else {
throw new CDIException("Unknown thread"); throw new CDIException(CdiResources.getString("cdi.model.Target.Unknown_thread")); //$NON-NLS-1$
} }
} }
@ -121,7 +122,7 @@ public class Target implements ICDITarget {
mi.postCommand(select); mi.postCommand(select);
MIThreadSelectInfo info = select.getMIThreadSelectInfo(); MIThreadSelectInfo info = select.getMIThreadSelectInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
currentThreadId = info.getNewThreadId(); currentThreadId = info.getNewThreadId();
} catch (MIException e) { } catch (MIException e) {
@ -148,7 +149,7 @@ public class Target implements ICDITarget {
// thread is gone. Generate a Thread destroyed. // thread is gone. Generate a Thread destroyed.
MISession mi = session.getMISession(); MISession mi = session.getMISession();
mi.fireEvent(new MIThreadExitEvent(id)); mi.fireEvent(new MIThreadExitEvent(id));
throw new CDIException("Can not swith to thread " + id); throw new CDIException(CdiResources.getString("cdi.model.Target.Cannot_switch_to_thread") + id); //$NON-NLS-1$
} }
} }
@ -318,7 +319,7 @@ public class Target implements ICDITarget {
mi.postCommand(run); mi.postCommand(run);
MIInfo info = run.getMIInfo(); MIInfo info = run.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -331,7 +332,7 @@ public class Target implements ICDITarget {
public void resume() throws CDIException { public void resume() throws CDIException {
MISession mi = session.getMISession(); MISession mi = session.getMISession();
if (mi.getMIInferior().isRunning()) { if (mi.getMIInferior().isRunning()) {
throw new CDIException("Inferior is already running"); throw new CDIException(CdiResources.getString("cdi.model.Target.Inferior_already_running")); //$NON-NLS-1$
} else if (mi.getMIInferior().isSuspended()) { } else if (mi.getMIInferior().isSuspended()) {
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIExecContinue cont = factory.createMIExecContinue(); MIExecContinue cont = factory.createMIExecContinue();
@ -340,7 +341,7 @@ public class Target implements ICDITarget {
mi.postCommand(cont); mi.postCommand(cont);
MIInfo info = cont.getMIInfo(); MIInfo info = cont.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -364,7 +365,7 @@ public class Target implements ICDITarget {
mi.postCommand(step); mi.postCommand(step);
MIInfo info = step.getMIInfo(); MIInfo info = step.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -383,7 +384,7 @@ public class Target implements ICDITarget {
mi.postCommand(stepi); mi.postCommand(stepi);
MIInfo info = stepi.getMIInfo(); MIInfo info = stepi.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -402,7 +403,7 @@ public class Target implements ICDITarget {
mi.postCommand(next); mi.postCommand(next);
MIInfo info = next.getMIInfo(); MIInfo info = next.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -421,7 +422,7 @@ public class Target implements ICDITarget {
mi.postCommand(nexti); mi.postCommand(nexti);
MIInfo info = nexti.getMIInfo(); MIInfo info = nexti.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -457,7 +458,7 @@ public class Target implements ICDITarget {
mi.postCommand(finish); mi.postCommand(finish);
MIInfo info = finish.getMIInfo(); MIInfo info = finish.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -475,7 +476,7 @@ public class Target implements ICDITarget {
mi.postCommand(ret); mi.postCommand(ret);
MIInfo info = ret.getMIInfo(); MIInfo info = ret.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -505,7 +506,7 @@ public class Target implements ICDITarget {
mi.postCommand(detach); mi.postCommand(detach);
MIInfo info = detach.getMIInfo(); MIInfo info = detach.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -523,13 +524,13 @@ public class Target implements ICDITarget {
public void runUntil(ICDILocation location) throws CDIException { public void runUntil(ICDILocation location) throws CDIException {
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
String loc = ""; String loc = ""; //$NON-NLS-1$
if (location.getFile() != null && location.getFile().length() > 0) { if (location.getFile() != null && location.getFile().length() > 0) {
loc = location.getFile() + ":" + location.getLineNumber(); loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
} else if (location.getFunction() != null && location.getFunction().length() > 0) { } else if (location.getFunction() != null && location.getFunction().length() > 0) {
loc = location.getFunction(); loc = location.getFunction();
} else if (location.getAddress() != 0) { } else if (location.getAddress() != 0) {
loc = "*" + location.getAddress(); loc = "*" + location.getAddress(); //$NON-NLS-1$
} }
MIExecUntil until = factory.createMIExecUntil(loc); MIExecUntil until = factory.createMIExecUntil(loc);
lastExecutionCommand = until; lastExecutionCommand = until;
@ -537,7 +538,7 @@ public class Target implements ICDITarget {
mi.postCommand(until); mi.postCommand(until);
MIInfo info = until.getMIInfo(); MIInfo info = until.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -551,13 +552,13 @@ public class Target implements ICDITarget {
public void jump(ICDILocation location) throws CDIException { public void jump(ICDILocation location) throws CDIException {
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
String loc = ""; String loc = ""; //$NON-NLS-1$
if (location.getFile() != null && location.getFile().length() > 0) { if (location.getFile() != null && location.getFile().length() > 0) {
loc = location.getFile() + ":" + location.getLineNumber(); loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
} else if (location.getFunction() != null && location.getFunction().length() > 0) { } else if (location.getFunction() != null && location.getFunction().length() > 0) {
loc = location.getFunction(); loc = location.getFunction();
} else if (location.getAddress() != 0) { } else if (location.getAddress() != 0) {
loc = "*" + location.getAddress(); loc = "*" + location.getAddress(); //$NON-NLS-1$
} }
MIJump jump = factory.createMIJump(loc); MIJump jump = factory.createMIJump(loc);
lastExecutionCommand = jump; lastExecutionCommand = jump;
@ -565,7 +566,7 @@ public class Target implements ICDITarget {
mi.postCommand(jump); mi.postCommand(jump);
MIInfo info = jump.getMIInfo(); MIInfo info = jump.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -586,7 +587,7 @@ public class Target implements ICDITarget {
MIDataEvaluateExpressionInfo info = MIDataEvaluateExpressionInfo info =
evaluate.getMIDataEvaluateExpressionInfo(); evaluate.getMIDataEvaluateExpressionInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
return info.getExpression(); return info.getExpression();
} catch (MIException e) { } catch (MIException e) {
@ -644,12 +645,12 @@ public class Target implements ICDITarget {
Session session = (Session)getSession(); Session session = (Session)getSession();
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MISignal signal = factory.createMISignal("0"); MISignal signal = factory.createMISignal("0"); //$NON-NLS-1$
try { try {
mi.postCommand(signal); mi.postCommand(signal);
MIInfo info = signal.getMIInfo(); MIInfo info = signal.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -668,7 +669,7 @@ public class Target implements ICDITarget {
mi.postCommand(sig); mi.postCommand(sig);
MIInfo info = sig.getMIInfo(); MIInfo info = sig.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.Target.Target_not_responding")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);

View file

@ -16,6 +16,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager; import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -99,7 +100,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(frames); mi.postCommand(frames);
MIStackListFramesInfo info = frames.getMIStackListFramesInfo(); MIStackListFramesInfo info = frames.getMIStackListFramesInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MIFrame[] miFrames = info.getMIFrames(); MIFrame[] miFrames = info.getMIFrames();
for (int i = 0; i < miFrames.length; i++) { for (int i = 0; i < miFrames.length; i++) {
@ -146,7 +147,7 @@ public class Thread extends CObject implements ICDIThread {
// Catch the first exception gdb can recover the second time. // Catch the first exception gdb can recover the second time.
info = depth.getMIStackInfoDepthInfo(); info = depth.getMIStackInfoDepthInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
stackdepth = info.getDepth(); stackdepth = info.getDepth();
} catch (MIException e) { } catch (MIException e) {
@ -155,7 +156,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(depth); mi.postCommand(depth);
info = depth.getMIStackInfoDepthInfo(); info = depth.getMIStackInfoDepthInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
stackdepth = info.getDepth(); stackdepth = info.getDepth();
if (stackdepth > 0) { if (stackdepth > 0) {
@ -199,7 +200,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(frames); mi.postCommand(frames);
MIStackListFramesInfo info = frames.getMIStackListFramesInfo(); MIStackListFramesInfo info = frames.getMIStackListFramesInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MIFrame[] miFrames = info.getMIFrames(); MIFrame[] miFrames = info.getMIFrames();
for (int i = 0; i < miFrames.length; i++) { for (int i = 0; i < miFrames.length; i++) {
@ -264,7 +265,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(frame); mi.postCommand(frame);
MIInfo info = frame.getMIInfo(); MIInfo info = frame.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
currentFrame = stackframe; currentFrame = stackframe;
// Resetting stackframe may change the value of // Resetting stackframe may change the value of

View file

@ -10,6 +10,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIVarEvaluateExpression; import org.eclipse.cdt.debug.mi.core.command.MIVarEvaluateExpression;
@ -37,7 +38,7 @@ public class Value extends CObject implements ICDIValue {
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getValueString() * @see org.eclipse.cdt.debug.core.cdi.model.ICDIValue#getValueString()
*/ */
public String getValueString() throws CDIException { public String getValueString() throws CDIException {
String result = ""; String result = ""; //$NON-NLS-1$
MISession mi = ((Session)(getTarget().getSession())).getMISession(); MISession mi = ((Session)(getTarget().getSession())).getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIVarEvaluateExpression var = MIVarEvaluateExpression var =
@ -46,7 +47,7 @@ public class Value extends CObject implements ICDIValue {
mi.postCommand(var); mi.postCommand(var);
MIVarEvaluateExpressionInfo info = var.getMIVarEvaluateExpressionInfo(); MIVarEvaluateExpressionInfo info = var.getMIVarEvaluateExpressionInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
result = info.getValue(); result = info.getValue();
} catch (MIException e) { } catch (MIException e) {

View file

@ -31,6 +31,7 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession; import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.Format; import org.eclipse.cdt.debug.mi.core.cdi.Format;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException; import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -113,18 +114,18 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var); mi.postCommand(var);
MIVarInfoExpressionInfo info = var.getMIVarInfoExpressionInfo(); MIVarInfoExpressionInfo info = var.getMIVarInfoExpressionInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
language = info.getLanguage(); language = info.getLanguage();
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} }
} }
return (language == null) ? "" : language; return (language == null) ? "" : language; //$NON-NLS-1$
} }
boolean isCPPLanguage() throws CDIException { boolean isCPPLanguage() throws CDIException {
return getLanguage().equalsIgnoreCase("C++"); return getLanguage().equalsIgnoreCase("C++"); //$NON-NLS-1$
} }
void setIsFake(boolean f) { void setIsFake(boolean f) {
@ -157,7 +158,7 @@ public class Variable extends VariableObject implements ICDIVariable {
} }
MIVarListChildrenInfo info = var.getMIVarListChildrenInfo(); MIVarListChildrenInfo info = var.getMIVarListChildrenInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
MIVar[] vars = info.getMIVars(); MIVar[] vars = info.getMIVars();
children = new Variable[vars.length]; children = new Variable[vars.length];
@ -168,12 +169,12 @@ public class Variable extends VariableObject implements ICDIVariable {
boolean childFake = false; boolean childFake = false;
ICDIType t = getType(); ICDIType t = getType();
if (t instanceof ICDIArrayType) { if (t instanceof ICDIArrayType) {
fn = "(" + fn + ")[" + i + "]"; fn = "(" + fn + ")[" + i + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// For Array gdb varobj only return the index, override here. // For Array gdb varobj only return the index, override here.
int index = castingIndex + i; int index = castingIndex + i;
childName = getName() + "[" + index + "]"; childName = getName() + "[" + index + "]"; //$NON-NLS-1$ //$NON-NLS-2$
} else if (t instanceof ICDIPointerType) { } else if (t instanceof ICDIPointerType) {
fn = "*(" + fn + ")"; fn = "*(" + fn + ")"; //$NON-NLS-1$ //$NON-NLS-2$
} else if (t instanceof ICDIStructType) { } else if (t instanceof ICDIStructType) {
if (isCPPLanguage()) { if (isCPPLanguage()) {
// For C++ in GDB the children of the // For C++ in GDB the children of the
@ -193,14 +194,14 @@ public class Variable extends VariableObject implements ICDIVariable {
// So we choose to ignore the first set of children // So we choose to ignore the first set of children
// but carry over to those "fake" variables the typename and the qualified name // but carry over to those "fake" variables the typename and the qualified name
if (!isFake() if (!isFake()
|| (isFake() && !(name.equals("private") || name.equals("public") || name.equals("protected")))) { || (isFake() && !(name.equals("private") || name.equals("public") || name.equals("protected")))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
childFake = true; childFake = true;
childTypename = getTypeName(); childTypename = getTypeName();
} else { } else {
fn = "(" + fn + ")." + vars[i].getExp(); fn = "(" + fn + ")." + vars[i].getExp(); //$NON-NLS-1$ //$NON-NLS-2$
} }
} else { // If not C++ language } else { // If not C++ language
fn = "(" + fn + ")." + vars[i].getExp(); fn = "(" + fn + ")." + vars[i].getExp(); //$NON-NLS-1$ //$NON-NLS-2$
} }
} }
Variable v = new Variable(getTarget(), childName, fn, getStackFrame(), getPosition(), getStackDepth(), vars[i]); Variable v = new Variable(getTarget(), childName, fn, getStackFrame(), getPosition(), getStackDepth(), vars[i]);
@ -297,7 +298,7 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var); mi.postCommand(var);
MIInfo info = var.getMIInfo(); MIInfo info = var.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
@ -348,14 +349,14 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var); mi.postCommand(var);
MIVarShowAttributesInfo info = var.getMIVarShowAttributesInfo(); MIVarShowAttributesInfo info = var.getMIVarShowAttributesInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
editable = String.valueOf(info.isEditable()); editable = String.valueOf(info.isEditable());
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);
} }
} }
return (editable == null) ? false : editable.equalsIgnoreCase("true"); return (editable == null) ? false : editable.equalsIgnoreCase("true"); //$NON-NLS-1$
} }
/** /**
@ -370,7 +371,7 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var); mi.postCommand(var);
MIInfo info = var.getMIInfo(); MIInfo info = var.getMIInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
throw new MI2CDIException(e); throw new MI2CDIException(e);

View file

@ -28,6 +28,7 @@ import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression;
import org.eclipse.cdt.debug.mi.core.command.MIWhatis; import org.eclipse.cdt.debug.mi.core.command.MIWhatis;
import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo; import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo;
import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo; import org.eclipse.cdt.debug.mi.core.output.MIWhatisInfo;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
/** /**
*/ */
@ -119,7 +120,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
String fn = getFullName(); String fn = getFullName();
if (castingLength > 0 || castingIndex > 0) { if (castingLength > 0 || castingIndex > 0) {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("*("); buffer.append("*("); //$NON-NLS-1$
buffer.append('(').append(fn).append(')'); buffer.append('(').append(fn).append(')');
if (castingIndex != 0) { if (castingIndex != 0) {
buffer.append('+').append(castingIndex); buffer.append('+').append(castingIndex);
@ -129,7 +130,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
fn = buffer.toString(); fn = buffer.toString();
} else if (castingType != null && castingType.length() > 0) { } else if (castingType != null && castingType.length() > 0) {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("((").append(castingType).append(')'); buffer.append("((").append(castingType).append(')'); //$NON-NLS-1$
buffer.append(fn).append(')'); buffer.append(fn).append(')');
fn = buffer.toString(); fn = buffer.toString();
} }
@ -185,13 +186,13 @@ public class VariableObject extends CObject implements ICDIVariableObject {
Session session = (Session) (target.getSession()); Session session = (Session) (target.getSession());
MISession mi = session.getMISession(); MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
String exp = "sizeof(" + getTypeName() + ")"; String exp = "sizeof(" + getTypeName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
MIDataEvaluateExpression evaluate = factory.createMIDataEvaluateExpression(exp); MIDataEvaluateExpression evaluate = factory.createMIDataEvaluateExpression(exp);
try { try {
mi.postCommand(evaluate); mi.postCommand(evaluate);
MIDataEvaluateExpressionInfo info = evaluate.getMIDataEvaluateExpressionInfo(); MIDataEvaluateExpressionInfo info = evaluate.getMIDataEvaluateExpressionInfo();
if (info == null) { if (info == null) {
throw new CDIException("Target is not responding"); throw new CDIException(CdiResources.getString("cdi.model.VariableObject.Target_not_responding")); //$NON-NLS-1$
} }
sizeof = info.getExpression(); sizeof = info.getExpression();
} catch (MIException e) { } catch (MIException e) {
@ -244,7 +245,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
mi.postCommand(whatis); mi.postCommand(whatis);
MIWhatisInfo info = whatis.getMIWhatisInfo(); MIWhatisInfo info = whatis.getMIWhatisInfo();
if (info == null) { if (info == null) {
throw new CDIException("No answer"); throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
} }
typename = info.getType(); typename = info.getType();
} catch (MIException e) { } catch (MIException e) {

View file

@ -19,7 +19,7 @@ public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
String what; String what;
public Watchpoint(BreakpointManager m, String expression, int type, int wType, ICDICondition cond) { public Watchpoint(BreakpointManager m, String expression, int type, int wType, ICDICondition cond) {
super(m, type, null, cond, ""); super(m, type, null, cond, ""); //$NON-NLS-1$
watchType = wType; watchType = wType;
what = expression; what = expression;
} }

View file

@ -64,14 +64,14 @@ public abstract class FloatingPointValue extends Value implements ICDIFloatingPo
} }
private boolean isPositiveInfinity(String valueString) { private boolean isPositiveInfinity(String valueString) {
return (valueString != null) ? valueString.indexOf("inf") != -1 : false; return (valueString != null) ? valueString.indexOf("inf") != -1 : false; //$NON-NLS-1$
} }
private boolean isNegativeInfinity(String valueString) { private boolean isNegativeInfinity(String valueString) {
return (valueString != null) ? valueString.indexOf("-inf") != -1 : false; return (valueString != null) ? valueString.indexOf("-inf") != -1 : false; //$NON-NLS-1$
} }
private boolean isNaN(String valueString) { private boolean isNaN(String valueString) {
return (valueString != null) ? valueString.indexOf("nan") != -1 : false; return (valueString != null) ? valueString.indexOf("nan") != -1 : false; //$NON-NLS-1$
} }
} }

View file

@ -13,7 +13,7 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
*/ */
public class FunctionType extends DerivedType implements ICDIFunctionType { public class FunctionType extends DerivedType implements ICDIFunctionType {
String params = ""; String params = ""; //$NON-NLS-1$
public FunctionType(ICDITarget target, String typename) { public FunctionType(ICDITarget target, String typename) {
super(target, typename); super(target, typename);

View file

@ -30,9 +30,9 @@ public class ReferenceValue extends DerivedValue implements ICDIReferenceValue {
public long referenceValue() throws CDIException { public long referenceValue() throws CDIException {
long value = 0; long value = 0;
String valueString = getValueString().trim(); String valueString = getValueString().trim();
if ( valueString.startsWith("@") ) if ( valueString.startsWith("@") ) //$NON-NLS-1$
valueString = valueString.substring( 1 ); valueString = valueString.substring( 1 );
int space = valueString.indexOf(":"); int space = valueString.indexOf(":"); //$NON-NLS-1$
if (space != -1) { if (space != -1) {
valueString = valueString.substring(0, space).trim(); valueString = valueString.substring(0, space).trim();
} }

View file

@ -25,21 +25,21 @@ public class StructType extends AggregateType implements ICDIStructType {
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isClass() * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isClass()
*/ */
public boolean isClass() { public boolean isClass() {
return getDetailTypeName().startsWith("class"); return getDetailTypeName().startsWith("class"); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isStruct() * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isStruct()
*/ */
public boolean isStruct() { public boolean isStruct() {
return getDetailTypeName().startsWith("struct"); return getDetailTypeName().startsWith("struct"); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isUnion() * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isUnion()
*/ */
public boolean isUnion() { public boolean isUnion() {
return getDetailTypeName().startsWith("union"); return getDetailTypeName().startsWith("union"); //$NON-NLS-1$
} }
} }

View file

@ -16,7 +16,7 @@ package org.eclipse.cdt.debug.mi.core.command;
public class MIEnvironmentDirectory extends MICommand public class MIEnvironmentDirectory extends MICommand
{ {
public MIEnvironmentDirectory(String[] paths) { public MIEnvironmentDirectory(String[] paths) {
super("-environment-directory", paths); super("-environment-directory", paths); //$NON-NLS-1$
} }
} }

View file

@ -17,6 +17,6 @@ package org.eclipse.cdt.debug.mi.core.command;
public class MIExecArguments extends MICommand public class MIExecArguments extends MICommand
{ {
public MIExecArguments(String[] args) { public MIExecArguments(String[] args) {
super("-exec-arguments", args); super("-exec-arguments", args); //$NON-NLS-1$
} }
} }

View file

@ -19,7 +19,7 @@ public class MIGDBSetEnvironment extends MIGDBSet {
super(paths); super(paths);
// Overload the parameter // Overload the parameter
String[] newPaths = new String[paths.length + 1]; String[] newPaths = new String[paths.length + 1];
newPaths[0] = "environment"; newPaths[0] = "environment"; //$NON-NLS-1$
System.arraycopy(paths, 0, newPaths, 1, paths.length); System.arraycopy(paths, 0, newPaths, 1, paths.length);
setParameters(newPaths); setParameters(newPaths);
} }

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/ */
public class MIGDBShowDirectories extends MIGDBShow { public class MIGDBShowDirectories extends MIGDBShow {
public MIGDBShowDirectories() { public MIGDBShowDirectories() {
super(new String[] { "directories" }); super(new String[] { "directories" }); //$NON-NLS-1$
} }
public MIGDBShowDirectoriesInfo getMIGDBShowDirectoriesInfo() throws MIException { public MIGDBShowDirectoriesInfo getMIGDBShowDirectoriesInfo() throws MIException {

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/ */
public class MIGDBShowSolibSearchPath extends MIGDBShow { public class MIGDBShowSolibSearchPath extends MIGDBShow {
public MIGDBShowSolibSearchPath() { public MIGDBShowSolibSearchPath() {
super(new String[] { "solib-search-path" }); super(new String[] { "solib-search-path" }); //$NON-NLS-1$
} }
public MIGDBShowSolibSearchPathInfo getMIGDBShowSolibSearchPathInfo() throws MIException { public MIGDBShowSolibSearchPathInfo getMIGDBShowSolibSearchPathInfo() throws MIException {

View file

@ -16,7 +16,7 @@ package org.eclipse.cdt.debug.mi.core.command;
public class MIHandle extends CLICommand { public class MIHandle extends CLICommand {
public MIHandle(String arg) { public MIHandle(String arg) {
super("handle " + arg); super("handle " + arg); //$NON-NLS-1$
} }
} }

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
public class MIInfoProgram extends CLICommand public class MIInfoProgram extends CLICommand
{ {
public MIInfoProgram() { public MIInfoProgram() {
super("info program"); super("info program"); //$NON-NLS-1$
} }
public MIInfoProgramInfo getMIInfoProgramInfo() throws MIException { public MIInfoProgramInfo getMIInfoProgramInfo() throws MIException {

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
public class MIInfoSharedLibrary extends CLICommand public class MIInfoSharedLibrary extends CLICommand
{ {
public MIInfoSharedLibrary() { public MIInfoSharedLibrary() {
super("info sharedlibrary"); super("info sharedlibrary"); //$NON-NLS-1$
} }
public MIInfoSharedLibraryInfo getMIInfoSharedLibraryInfo() throws MIException { public MIInfoSharedLibraryInfo getMIInfoSharedLibraryInfo() throws MIException {

View file

@ -19,11 +19,11 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
public class MIInfoSignals extends CLICommand public class MIInfoSignals extends CLICommand
{ {
public MIInfoSignals() { public MIInfoSignals() {
super("info signals"); super("info signals"); //$NON-NLS-1$
} }
public MIInfoSignals(String name) { public MIInfoSignals(String name) {
super("info signal " + name); super("info signal " + name); //$NON-NLS-1$
} }
public MIInfoSignalsInfo getMIInfoSignalsInfo() throws MIException { public MIInfoSignalsInfo getMIInfoSignalsInfo() throws MIException {

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
public class MIInfoThreads extends CLICommand public class MIInfoThreads extends CLICommand
{ {
public MIInfoThreads() { public MIInfoThreads() {
super("info threads"); super("info threads"); //$NON-NLS-1$
} }
public MIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException { public MIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException {

View file

@ -20,7 +20,7 @@ public class MIJump extends CLICommand {
MIOutput out; MIOutput out;
public MIJump(String loc) { public MIJump(String loc) {
super("jump " + loc); super("jump " + loc); //$NON-NLS-1$
} }
/** /**

View file

@ -21,7 +21,7 @@ public class MISignal extends CLICommand {
MIOutput out; MIOutput out;
public MISignal(String arg) { public MISignal(String arg) {
super("signal " + arg); super("signal " + arg); //$NON-NLS-1$
} }
/** /**

View file

@ -29,6 +29,6 @@ package org.eclipse.cdt.debug.mi.core.command;
public class MITargetSelect extends MICommand public class MITargetSelect extends MICommand
{ {
public MITargetSelect(String[] params) { public MITargetSelect(String[] params) {
super("-target-select", params); super("-target-select", params); //$NON-NLS-1$
} }
} }

View file

@ -23,7 +23,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarDeleteInfo;
public class MIVarDelete extends MICommand public class MIVarDelete extends MICommand
{ {
public MIVarDelete(String name) { public MIVarDelete(String name) {
super("-var-delete", new String[]{name}); super("-var-delete", new String[]{name}); //$NON-NLS-1$
} }
public MIVarDeleteInfo getMIVarDeleteInfo() throws MIException { public MIVarDeleteInfo getMIVarDeleteInfo() throws MIException {

View file

@ -25,19 +25,19 @@ public class MIVarSetFormat extends MICommand
{ {
public MIVarSetFormat(String name, int fmt) { public MIVarSetFormat(String name, int fmt) {
super("-var-set-format"); //$NON-NLS-1$ super("-var-set-format"); //$NON-NLS-1$
String format = "hexadecimal"; String format = "hexadecimal"; //$NON-NLS-1$
switch (fmt) { switch (fmt) {
case MIFormat.NATURAL: case MIFormat.NATURAL:
format = "natural"; format = "natural"; //$NON-NLS-1$
break; break;
case MIFormat.DECIMAL: case MIFormat.DECIMAL:
format = "decimal"; format = "decimal"; //$NON-NLS-1$
break; break;
case MIFormat.BINARY: case MIFormat.BINARY:
format = "binary"; format = "binary"; //$NON-NLS-1$
break; break;
case MIFormat.OCTAL: case MIFormat.OCTAL:
format = "octal"; format = "octal"; //$NON-NLS-1$
break; break;
/* /*
case MIFormat.HEXADECIMAL: case MIFormat.HEXADECIMAL:

View file

@ -27,7 +27,7 @@ public class MIVarUpdate extends MICommand {
} }
public MIVarUpdate(String name) { public MIVarUpdate(String name) {
super("-var-update", new String[] { name }); super("-var-update", new String[] { name }); //$NON-NLS-1$
} }
public MIVarUpdateInfo getMIVarUpdateInfo() throws MIException { public MIVarUpdateInfo getMIVarUpdateInfo() throws MIException {

View file

@ -42,8 +42,8 @@ public class MIBreakpointHitEvent extends MIStoppedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("number=").append(bkptno).append('\n'); buffer.append("number=").append(bkptno).append('\n'); //$NON-NLS-1$
buffer.append("thread-id=").append(getThreadId()).append('\n'); buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$
buffer.append(frame.toString()); buffer.append(frame.toString());
return buffer.toString(); return buffer.toString();
} }

View file

@ -18,6 +18,6 @@ public class MIDetachedEvent extends MIDestroyedEvent {
} }
public String toString() { public String toString() {
return "Detached"; return "Detached"; //$NON-NLS-1$
} }
} }

View file

@ -41,9 +41,9 @@ public class MIFunctionFinishedEvent extends MIStoppedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("gdb-result-var=" + gdbResult + "\n"); //$NON-NLS-2$ buffer.append("gdb-result-var=" + gdbResult + "\n"); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("return-value=" + returnValue + "\n"); //$NON-NLS-2$ buffer.append("return-value=" + returnValue + "\n"); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("thread-id=").append(getThreadId()).append('\n'); buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$
MIFrame f = getFrame(); MIFrame f = getFrame();
if (f != null) { if (f != null) {
buffer.append(f.toString()); buffer.append(f.toString());

View file

@ -47,8 +47,8 @@ public class MIInferiorSignalExitEvent extends MIDestroyedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("signal-name=" + sigName + "\n"); //$NON-NLS-2$ buffer.append("signal-name=" + sigName + "\n"); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("signal-meaning=" + sigMeaning + "\n"); //$NON-NLS-2$ buffer.append("signal-meaning=" + sigMeaning + "\n"); //$NON-NLS-1$//$NON-NLS-2$
return buffer.toString(); return buffer.toString();
} }

View file

@ -30,7 +30,7 @@ public class MILocationReachedEvent extends MIStoppedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("thread-id=").append(getThreadId()).append('\n'); buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$
MIFrame f = getFrame(); MIFrame f = getFrame();
if (f != null) { if (f != null) {
buffer.append(f.toString()); buffer.append(f.toString());

View file

@ -34,6 +34,6 @@ public class MIRunningEvent extends MIEvent {
} }
public String toString() { public String toString() {
return "Running"; return "Running"; //$NON-NLS-1$
} }
} }

View file

@ -42,9 +42,9 @@ public class MISignalEvent extends MIStoppedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("signal-name=" + sigName + "\n"); buffer.append("signal-name=" + sigName + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append("signal-meaning=" + sigMeaning + "\n"); buffer.append("signal-meaning=" + sigMeaning + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append("thread-id=").append(getThreadId()).append('\n'); buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$
MIFrame f = getFrame(); MIFrame f = getFrame();
if (f != null) { if (f != null) {
buffer.append(f.toString()); buffer.append(f.toString());

View file

@ -31,7 +31,7 @@ public class MISteppingRangeEvent extends MIStoppedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("thread-id=").append(getThreadId()).append('\n'); buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$
MIFrame f = getFrame(); MIFrame f = getFrame();
if (f != null) { if (f != null) {
buffer.append(getFrame().toString()); buffer.append(getFrame().toString());

View file

@ -53,11 +53,11 @@ public class MIWatchpointTriggerEvent extends MIStoppedEvent {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("number=").append(number).append('\n'); buffer.append("number=").append(number).append('\n'); //$NON-NLS-1$
buffer.append("expression=" + exp + "\n"); //$NON-NLS-2$ buffer.append("expression=" + exp + "\n"); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("old=" + oldValue + "\n"); //$NON-NLS-2$ buffer.append("old=" + oldValue + "\n"); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("new=" + newValue + "\n"); //$NON-NLS-2$ buffer.append("new=" + newValue + "\n"); //$NON-NLS-1$//$NON-NLS-2$
buffer.append("thread-id=").append(getThreadId()).append('\n'); buffer.append("thread-id=").append(getThreadId()).append('\n'); //$NON-NLS-1$
MIFrame f = getFrame(); MIFrame f = getFrame();
if (f != null) { if (f != null) {
buffer.append(f.toString()); buffer.append(f.toString());

View file

@ -38,10 +38,10 @@ public class MIAsm {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append('{'); buffer.append('{');
buffer.append("address=\"" + Long.toHexString(address) +"\""); //$NON-NLS-2$ buffer.append("address=\"" + Long.toHexString(address) +"\""); //$NON-NLS-1$//$NON-NLS-2$
buffer.append(",func-name=\"" + function + "\""); //$NON-NLS-2$ buffer.append(",func-name=\"" + function + "\""); //$NON-NLS-1$//$NON-NLS-2$
buffer.append(",offset=\"").append(offset).append('"'); buffer.append(",offset=\"").append(offset).append('"'); //$NON-NLS-1$
buffer.append(",inst=\"" + getInstruction() + "\""); //$NON-NLS-2$ buffer.append(",inst=\"" + getInstruction() + "\""); //$NON-NLS-1$//$NON-NLS-2$
buffer.append('}'); buffer.append('}');
return buffer.toString(); return buffer.toString();
} }
@ -57,19 +57,19 @@ public class MIAsm {
str = ((MIConst)value).getCString(); str = ((MIConst)value).getCString();
} }
if (var.equals("address")) { if (var.equals("address")) { //$NON-NLS-1$
try { try {
address = Long.decode(str.trim()).longValue(); address = Long.decode(str.trim()).longValue();
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
} }
} else if (var.equals("func-name")) { } else if (var.equals("func-name")) { //$NON-NLS-1$
function = str; function = str;
} else if (var.equals("offset")) { } else if (var.equals("offset")) { //$NON-NLS-1$
try { try {
offset = Long.decode(str.trim()).longValue(); offset = Long.decode(str.trim()).longValue();
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
} }
} else if (var.equals("inst")) { } else if (var.equals("inst")) { //$NON-NLS-1$
/* for the instruction, we do not want the C string but the /* for the instruction, we do not want the C string but the
translated string since the only thing we are doing is translated string since the only thing we are doing is
displaying it. */ displaying it. */

View file

@ -81,7 +81,7 @@ public class MIBreakpoint {
} }
public boolean isTemporary() { public boolean isTemporary() {
return getDisposition().equals("del"); return getDisposition().equals("del"); //$NON-NLS-1$
} }
public boolean isWatchpoint() { public boolean isWatchpoint() {
@ -219,7 +219,7 @@ public class MIBreakpoint {
} else if (var.equals("disp")) { //$NON-NLS-1$ } else if (var.equals("disp")) { //$NON-NLS-1$
disp = str; disp = str;
} else if (var.equals("enabled")) { //$NON-NLS-1$ } else if (var.equals("enabled")) { //$NON-NLS-1$
enabled = str.equals("y"); enabled = str.equals("y"); //$NON-NLS-1$
} else if (var.equals("addr")) { //$NON-NLS-1$ } else if (var.equals("addr")) { //$NON-NLS-1$
try { try {
address = Long.decode(str.trim()).longValue(); address = Long.decode(str.trim()).longValue();

View file

@ -80,7 +80,7 @@ public class MIConst extends MIValue {
} else if (c == 'f') { } else if (c == 'f') {
s = "\f"; //$NON-NLS-1$ s = "\f"; //$NON-NLS-1$
} else if (c == 'n') { } else if (c == 'n') {
s = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ $NON-NLS-2$ s = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$
} else if (c == 'r') { } else if (c == 'r') {
s = "\r"; //$NON-NLS-1$ s = "\r"; //$NON-NLS-1$
} else if (c == 't') { } else if (c == 't') {

View file

@ -37,7 +37,7 @@ public class MIDataDisassembleInfo extends MIInfo {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("asm_insns=["); buffer.append("asm_insns=["); //$NON-NLS-1$
if (isMixed()) { if (isMixed()) {
MISrcAsm[] array = getMISrcAsms(); MISrcAsm[] array = getMISrcAsms();

View file

@ -32,8 +32,8 @@ public class MIEnvironmentPWDInfo extends MIInfo {
if (oobs[i] instanceof MIConsoleStreamOutput) { if (oobs[i] instanceof MIConsoleStreamOutput) {
MIStreamRecord cons = (MIStreamRecord)oobs[i]; MIStreamRecord cons = (MIStreamRecord)oobs[i];
String str = cons.getString(); String str = cons.getString();
if (str.startsWith("Working directory")) { if (str.startsWith("Working directory")) { //$NON-NLS-1$
int len = "Working directory".length(); int len = "Working directory".length(); //$NON-NLS-1$
str = str.substring(len).trim(); str = str.substring(len).trim();
len = str.indexOf('.'); len = str.indexOf('.');
if (len != -1) { if (len != -1) {

View file

@ -35,7 +35,7 @@ public class MIGDBShowDirectoriesInfo extends MIInfo {
if (oobs[i] instanceof MIConsoleStreamOutput) { if (oobs[i] instanceof MIConsoleStreamOutput) {
MIStreamRecord cons = (MIStreamRecord)oobs[i]; MIStreamRecord cons = (MIStreamRecord)oobs[i];
String str = cons.getString(); String str = cons.getString();
if (str.startsWith("Source directories searched:")) { if (str.startsWith("Source directories searched:")) { //$NON-NLS-1$
int j = str.indexOf(':'); int j = str.indexOf(':');
if (j != -1) { if (j != -1) {
String sub = str.substring(j + 1).trim(); String sub = str.substring(j + 1).trim();

View file

@ -91,7 +91,7 @@ public class MIInfoSharedLibraryInfo extends MIInfo {
name = sub; name = sub;
break; break;
case 1 : case 1 :
if (sub.equalsIgnoreCase("Yes")) { if (sub.equalsIgnoreCase("Yes")) { //$NON-NLS-1$
syms = true; syms = true;
} }
break; break;

View file

@ -60,7 +60,7 @@ public class MIInfoSignalsInfo extends MIInfo {
// Pass the header and th tailer. // Pass the header and th tailer.
// ~"Signal Stop\tPrint\tPass to program\tDescription\n" // ~"Signal Stop\tPrint\tPass to program\tDescription\n"
// ~"Use the \"handle\" command to change these tables.\n" // ~"Use the \"handle\" command to change these tables.\n"
if (!str.startsWith("Signal ") && !str.startsWith("Use ")) { if (!str.startsWith("Signal ") && !str.startsWith("Use ")) { //$NON-NLS-1$ //$NON-NLS-2$
String signal = ""; //$NON-NLS-1$ String signal = ""; //$NON-NLS-1$
boolean stop = false; boolean stop = false;
boolean print = false; boolean print = false;
@ -71,7 +71,7 @@ public class MIInfoSignalsInfo extends MIInfo {
for (int i = 0; tokenizer.hasMoreTokens(); i++) { for (int i = 0; tokenizer.hasMoreTokens(); i++) {
String sub = null; String sub = null;
if (i == 4) { if (i == 4) {
sub = tokenizer.nextToken("\n"); sub = tokenizer.nextToken("\n"); //$NON-NLS-1$
} else { } else {
sub = tokenizer.nextToken(); sub = tokenizer.nextToken();
} }
@ -100,7 +100,7 @@ public class MIInfoSignalsInfo extends MIInfo {
} }
static boolean getBoolean(String value) { static boolean getBoolean(String value) {
if (value != null && value.equalsIgnoreCase("Yes")) { if (value != null && value.equalsIgnoreCase("Yes")) { //$NON-NLS-1$
return true; return true;
} }
return false; return false;

View file

@ -32,7 +32,7 @@ public class MIPTypeInfo extends MIInfo {
// We are interested in the shared info // We are interested in the shared info
if (str != null) { if (str != null) {
str = str.trim(); str = str.trim();
if (str.startsWith ("type")) { if (str.startsWith ("type")) { //$NON-NLS-1$
int equal = str.indexOf('='); int equal = str.indexOf('=');
if (equal > 0) { if (equal > 0) {
str = str.substring(equal + 1); str = str.substring(equal + 1);

View file

@ -31,8 +31,8 @@ public class MIRegisterValue {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("number=\"").append(number).append('"'); buffer.append("number=\"").append(number).append('"'); //$NON-NLS-1$
buffer.append(',').append("value=\"" + value + "\""); buffer.append(',').append("value=\"" + value + "\""); //$NON-NLS-1$ //$NON-NLS-2$
return buffer.toString(); return buffer.toString();
} }

View file

@ -25,12 +25,12 @@ public abstract class MIStreamRecord extends MIOOBRecord {
public String toString() { public String toString() {
if (this instanceof MIConsoleStreamOutput) { if (this instanceof MIConsoleStreamOutput) {
return "~\"" + cstring + "\"\n"; //$NON-NLS-1$ return "~\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$
} else if (this instanceof MITargetStreamOutput) { } else if (this instanceof MITargetStreamOutput) {
return "@\"" + cstring + "\"\n"; //$NON-NLS-1$ return "@\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$
} else if (this instanceof MILogStreamOutput) { } else if (this instanceof MILogStreamOutput) {
return "&\"" + cstring + "\"\n"; //$NON-NLS-1$ return "&\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$
} }
return "\"" + cstring + "\"\n"; //$NON-NLS-1$ return "\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$
} }
} }

View file

@ -34,15 +34,15 @@ public class MIVarShowFormatInfo extends MIInfo {
MIValue value = results[i].getMIValue(); MIValue value = results[i].getMIValue();
if (value instanceof MIConst) { if (value instanceof MIConst) {
String str = ((MIConst)value).getString(); String str = ((MIConst)value).getString();
if ("binary".equals(str)) { if ("binary".equals(str)) { //$NON-NLS-1$
format = MIFormat.BINARY; format = MIFormat.BINARY;
} else if ("decimal".equals(str)) { } else if ("decimal".equals(str)) { //$NON-NLS-1$
format = MIFormat.DECIMAL; format = MIFormat.DECIMAL;
} else if ("hexadecimal".equals(str)) { } else if ("hexadecimal".equals(str)) { //$NON-NLS-1$
format = MIFormat.HEXADECIMAL; format = MIFormat.HEXADECIMAL;
} else if ("octal".equals(str)) { } else if ("octal".equals(str)) { //$NON-NLS-1$
format = MIFormat.OCTAL; format = MIFormat.OCTAL;
} else if ("natural".equals(str)) { } else if ("natural".equals(str)) { //$NON-NLS-1$
format = MIFormat.NATURAL; format = MIFormat.NATURAL;
} }
} }

View file

@ -32,7 +32,7 @@ public class MIWhatisInfo extends MIInfo {
// We are interested in the shared info // We are interested in the shared info
if (str != null) { if (str != null) {
str = str.trim(); str = str.trim();
if (str.startsWith ("type")) { if (str.startsWith ("type")) { //$NON-NLS-1$
int equal = str.indexOf('='); int equal = str.indexOf('=');
if (equal > 0) { if (equal > 0) {
str = str.substring(equal + 1); str = str.substring(equal + 1);

View file

@ -55,7 +55,7 @@ public class CLIProcessor {
session.fireEvent(new MIBreakpointChangedEvent(0)); session.fireEvent(new MIBreakpointChangedEvent(0));
} else if (isSettingSignal(operation)) { } else if (isSettingSignal(operation)) {
// We do no know which signal let the upper layer find it. // We do no know which signal let the upper layer find it.
session.fireEvent(new MISignalChangedEvent("")); session.fireEvent(new MISignalChangedEvent("")); //$NON-NLS-1$
} else if (isDetach(operation)) { } else if (isDetach(operation)) {
// if it was a "detach" command change the state. // if it was a "detach" command change the state.
session.getMIInferior().setDisconnected(); session.getMIInferior().setDisconnected();
@ -68,27 +68,27 @@ public class CLIProcessor {
int type = -1; int type = -1;
/* execution commands: n, next, s, step, si, stepi, u, until, finish, /* execution commands: n, next, s, step, si, stepi, u, until, finish,
c, continue, fg */ c, continue, fg */
if (operation.equals("n") || operation.equals("next")) { if (operation.equals("n") || operation.equals("next")) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.NEXT; type = MIRunningEvent.NEXT;
} else if (operation.equals("ni") || operation.equals("nexti")) { } else if (operation.equals("ni") || operation.equals("nexti")) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.NEXTI; type = MIRunningEvent.NEXTI;
} else if (operation.equals("s") || operation.equals("step")) { } else if (operation.equals("s") || operation.equals("step")) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.STEP; type = MIRunningEvent.STEP;
} else if (operation.equals("si") || operation.equals("stepi")) { } else if (operation.equals("si") || operation.equals("stepi")) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.STEPI; type = MIRunningEvent.STEPI;
} else if (operation.equals("u") || } else if (operation.equals("u") || //$NON-NLS-1$
(operation.startsWith("unt") && "until".indexOf(operation) != -1)) { (operation.startsWith("unt") && "until".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.UNTIL; type = MIRunningEvent.UNTIL;
} else if (operation.startsWith("fin") && "finish".indexOf(operation) != -1) { } else if (operation.startsWith("fin") && "finish".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.FINISH; type = MIRunningEvent.FINISH;
} else if (operation.equals("c") || operation.equals("fg") || } else if (operation.equals("c") || operation.equals("fg") || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("cont") && "continue".indexOf(operation) != -1)) { (operation.startsWith("cont") && "continue".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.CONTINUE; type = MIRunningEvent.CONTINUE;
} else if (operation.startsWith("sig") && "signal".indexOf(operation) != -1) { } else if (operation.startsWith("sig") && "signal".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.CONTINUE; type = MIRunningEvent.CONTINUE;
} else if (operation.startsWith("j") && "jump".indexOf(operation) != -1) { } else if (operation.startsWith("j") && "jump".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.CONTINUE; type = MIRunningEvent.CONTINUE;
} else if (operation.equals("r") || operation.equals("run")) { } else if (operation.equals("r") || operation.equals("run")) { //$NON-NLS-1$ //$NON-NLS-2$
type = MIRunningEvent.CONTINUE; type = MIRunningEvent.CONTINUE;
} }
return type; return type;
@ -98,11 +98,11 @@ public class CLIProcessor {
boolean isbreak = false; boolean isbreak = false;
/* breakpoints: b, break, hbreak, tbreak, rbreak, thbreak */ /* breakpoints: b, break, hbreak, tbreak, rbreak, thbreak */
/* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */ /* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */
if ((operation.startsWith("b") && "break".indexOf(operation) != -1) || if ((operation.startsWith("b") && "break".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("tb") && "tbreak".indexOf(operation) != -1) || (operation.startsWith("tb") && "tbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("hb") && "hbreak".indexOf(operation) != -1) || (operation.startsWith("hb") && "hbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("thb") && "thbreak".indexOf(operation) != -1) || (operation.startsWith("thb") && "thbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("rb") && "rbreak".indexOf(operation) != -1)) { (operation.startsWith("rb") && "rbreak".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
isbreak = true; isbreak = true;
} }
return isbreak; return isbreak;
@ -111,9 +111,9 @@ public class CLIProcessor {
boolean isSettingWatchpoint(String operation) { boolean isSettingWatchpoint(String operation) {
boolean isWatch = false; boolean isWatch = false;
/* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */ /* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */
if ((operation.startsWith("wa") && "watch".indexOf(operation) != -1) || if ((operation.startsWith("wa") && "watch".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("rw") && "rwatch".indexOf(operation) != -1) || (operation.startsWith("rw") && "rwatch".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("aw") && "awatch".indexOf(operation) != -1)) { (operation.startsWith("aw") && "awatch".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
isWatch = true; isWatch = true;
} }
return isWatch; return isWatch;
@ -122,8 +122,8 @@ public class CLIProcessor {
boolean isDeletingBreakpoint(String operation) { boolean isDeletingBreakpoint(String operation) {
boolean isDelete = false; boolean isDelete = false;
/* deleting breaks: clear, delete */ /* deleting breaks: clear, delete */
if ((operation.startsWith("cl") && "clear".indexOf(operation) != -1) || if ((operation.startsWith("cl") && "clear".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.equals("d") || (operation.startsWith("del") && "delete".indexOf(operation) != -1))) { (operation.equals("d") || (operation.startsWith("del") && "delete".indexOf(operation) != -1))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
isDelete = true; isDelete = true;
} }
return isDelete; return isDelete;
@ -132,11 +132,11 @@ public class CLIProcessor {
boolean isChangeBreakpoint(String operation) { boolean isChangeBreakpoint(String operation) {
boolean isChange = false; boolean isChange = false;
/* changing breaks: enable, disable */ /* changing breaks: enable, disable */
if ((operation.equals("dis") || operation.equals("disa") || if ((operation.equals("dis") || operation.equals("disa") || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("disa") && "disable".indexOf(operation) != -1)) || (operation.startsWith("disa") && "disable".indexOf(operation) != -1)) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.equals("en") || (operation.startsWith("en") && "enable".indexOf(operation) != -1)) || (operation.equals("en") || (operation.startsWith("en") && "enable".indexOf(operation) != -1)) || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
(operation.startsWith("ig") && "ignore".indexOf(operation) != -1) || (operation.startsWith("ig") && "ignore".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("cond") && "condition".indexOf(operation) != -1)) { (operation.startsWith("cond") && "condition".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
isChange = true; isChange = true;
} }
return isChange; return isChange;
@ -145,7 +145,7 @@ public class CLIProcessor {
boolean isSettingSignal(String operation) { boolean isSettingSignal(String operation) {
boolean isChange = false; boolean isChange = false;
/* changing signal: handle, signal */ /* changing signal: handle, signal */
if (operation.startsWith("ha") && "handle".indexOf(operation) != -1) { if (operation.startsWith("ha") && "handle".indexOf(operation) != -1) { //$NON-NLS-1$ //$NON-NLS-2$
isChange = true; isChange = true;
} }
return isChange; return isChange;
@ -156,7 +156,7 @@ public class CLIProcessor {
* @return * @return
*/ */
boolean isDetach(String operation) { boolean isDetach(String operation) {
return (operation.startsWith("det") && "detach".indexOf(operation) != -1); return (operation.startsWith("det") && "detach".indexOf(operation) != -1); //$NON-NLS-1$ //$NON-NLS-2$
} }

View file

@ -61,7 +61,7 @@ public class CygwinGDBDebugger extends GDBDebugger {
manager.setSharedLibraryPaths(paths); manager.setSharedLibraryPaths(paths);
} }
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing shared library options: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.CygwinGDBDebugger.Error_init_shared_lib_options") + e.getMessage()); //$NON-NLS-1$
} }
} }
@ -76,11 +76,11 @@ public class CygwinGDBDebugger extends GDBDebugger {
MISession mi = session.getMISession(); MISession mi = session.getMISession();
try { try {
CommandFactory factory = mi.getCommandFactory(); CommandFactory factory = mi.getCommandFactory();
MIGDBSet set = factory.createMIGDBSet(new String[] { "new-console" }); MIGDBSet set = factory.createMIGDBSet(new String[] { "new-console" }); //$NON-NLS-1$
mi.postCommand(set); mi.postCommand(set);
MIInfo info = set.getMIInfo(); MIInfo info = set.getMIInfo();
if (info == null) { if (info == null) {
throw new MIException("No answer"); throw new MIException(MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$
} }
} catch (MIException e) { } catch (MIException e) {
// We ignore this exception, for example // We ignore this exception, for example

View file

@ -17,7 +17,7 @@ public class EventThread extends Thread {
MISession session; MISession session;
public EventThread(MISession s) { public EventThread(MISession s) {
super("MI Event Thread"); super("MI Event Thread"); //$NON-NLS-1$
session = s; session = s;
} }

View file

@ -56,7 +56,7 @@ public class GDBDebugger implements ICDebugger {
manager.setSharedLibraryPaths(paths); manager.setSharedLibraryPaths(paths);
} }
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing shared library options: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_initializing_shared_lib_options") + e.getMessage()); //$NON-NLS-1$
} }
} }
@ -64,21 +64,21 @@ public class GDBDebugger implements ICDebugger {
Session session = null; Session session = null;
boolean failed = false; boolean failed = false;
try { try {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile(); File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit); session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit);
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} catch (MIException e) { } catch (MIException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} catch (CoreException e) { } catch (CoreException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} finally { } finally {
if (failed) { if (failed) {
if (session != null) { if (session != null) {
@ -96,21 +96,21 @@ public class GDBDebugger implements ICDebugger {
Session session = null; Session session = null;
boolean failed = false; boolean failed = false;
try { try {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile(); File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit); session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit);
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} catch (MIException e) { } catch (MIException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} catch (CoreException e) { } catch (CoreException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} finally { } finally {
if (failed) { if (failed) {
if (session != null) { if (session != null) {
@ -128,21 +128,21 @@ public class GDBDebugger implements ICDebugger {
Session session = null; Session session = null;
boolean failed = false; boolean failed = false;
try { try {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile(); File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit); session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit);
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} catch (MIException e) { } catch (MIException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} catch (CoreException e) { } catch (CoreException e) {
failed = true; failed = true;
throw new CDIException("Error creating session: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBDebugger.Error_creating_session") + e.getMessage()); //$NON-NLS-1$
} finally { } finally {
if (failed) { if (failed) {
if (session != null) { if (session != null) {

View file

@ -51,7 +51,7 @@ public class GDBServerDebugger implements ICDebugger {
mgr.setSharedLibraryPaths(paths); mgr.setSharedLibraryPaths(paths);
} }
} catch (CoreException e) { } catch (CoreException e) {
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.Error_initializing") + e.getMessage()); //$NON-NLS-1$
} }
} }
@ -59,12 +59,12 @@ public class GDBServerDebugger implements ICDebugger {
Session session = null; Session session = null;
boolean failed = false; boolean failed = false;
try { try {
String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
File cwd = exe.getProject().getLocation().toFile(); File cwd = exe.getProject().getLocation().toFile();
String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
if (config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, false)) { if (config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, false)) {
String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_HOST, "invalid"); String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_HOST, "invalid");
remote += ":"; remote += ":"; //$NON-NLS-1$
remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid");
String[] args = new String[] {"remote", remote}; String[] args = new String[] {"remote", remote};
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit); session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit);
@ -78,31 +78,31 @@ public class GDBServerDebugger implements ICDebugger {
session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit); session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit);
MISession miSession = session.getMISession(); MISession miSession = session.getMISession();
CommandFactory factory = miSession.getCommandFactory(); CommandFactory factory = miSession.getCommandFactory();
MIGDBSet setRemoteBaud = factory.createMIGDBSet(new String[]{"remotebaud", remoteBaud}); MIGDBSet setRemoteBaud = factory.createMIGDBSet(new String[]{"remotebaud", remoteBaud}); //$NON-NLS-1$
// Set serial line parameters // Set serial line parameters
miSession.postCommand(setRemoteBaud, launchTimeout); miSession.postCommand(setRemoteBaud, launchTimeout);
MIInfo info = setRemoteBaud.getMIInfo(); MIInfo info = setRemoteBaud.getMIInfo();
if (info == null) { if (info == null) {
throw new MIException ("Can not set Baud"); throw new MIException (MIPlugin.getResourceString("src.GDBServerDebugger.Can_not_set_Baud")); //$NON-NLS-1$
} }
MITargetSelect select = factory.createMITargetSelect(new String[] {"remote", remote}); MITargetSelect select = factory.createMITargetSelect(new String[] {"remote", remote});
miSession.postCommand(select, launchTimeout); miSession.postCommand(select, launchTimeout);
select.getMIInfo(); select.getMIInfo();
if (info == null) { if (info == null) {
throw new MIException ("No answer"); throw new MIException (MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$
} }
} }
initializeLibraries(config, session); initializeLibraries(config, session);
return session; return session;
} catch (IOException e) { } catch (IOException e) {
failed = true; failed = true;
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.Error_initializing") + e.getMessage()); //$NON-NLS-1$
} catch (MIException e) { } catch (MIException e) {
failed = true; failed = true;
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.Error_initializing") + e.getMessage()); //$NON-NLS-1$
} catch (CoreException e) { } catch (CoreException e) {
failed = true; failed = true;
throw new CDIException("Error initializing: " + e.getMessage()); throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.Error_initializing") + e.getMessage()); //$NON-NLS-1$
} finally { } finally {
if (failed) { if (failed) {
if (session != null) { if (session != null) {
@ -117,10 +117,10 @@ public class GDBServerDebugger implements ICDebugger {
} }
public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException { public ICDISession createAttachSession(ILaunchConfiguration config, IFile exe, int pid) throws CDIException {
throw new CDIException("GDBServer does not support attaching"); throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.GDBServer_attaching_unsupported")); //$NON-NLS-1$
} }
public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException { public ICDISession createCoreSession(ILaunchConfiguration config, IFile exe, IPath corefile) throws CDIException {
throw new CDIException("GDBServer does not support core files"); throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.GDBServer_corefiles_unsupported")); //$NON-NLS-1$
} }
} }

View file

@ -58,14 +58,14 @@ public class GDBTypeParser {
// Initialize. // Initialize.
line = s; line = s;
index = 0; index = 0;
token = ""; token = ""; //$NON-NLS-1$
dataType = ""; dataType = ""; //$NON-NLS-1$
name = ""; name = ""; //$NON-NLS-1$
gdbDerivedType = null; gdbDerivedType = null;
// Fetch the datatype. // Fetch the datatype.
while (getToken() == NAME) { while (getToken() == NAME) {
dataType += " " + token; dataType += " " + token; //$NON-NLS-1$
} }
// Hack for GDB, the typename can be something like // Hack for GDB, the typename can be something like
@ -97,7 +97,7 @@ public class GDBTypeParser {
} }
public GDBType(int t) { public GDBType(int t) {
this("", t); this("", t); //$NON-NLS-1$
} }
GDBType(String n, int t) { GDBType(String n, int t) {
@ -151,23 +151,23 @@ public class GDBTypeParser {
public String toString() { public String toString() {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
String childTypeName = (hasChild() ? child.toString() : ""); String childTypeName = (hasChild() ? child.toString() : ""); //$NON-NLS-1$
sb.append(childTypeName); sb.append(childTypeName);
switch (getType()) { switch (getType()) {
case FUNCTION : case FUNCTION :
sb.append("()"); sb.append("()"); //$NON-NLS-1$
//sb.append(" function returning " + (hasChild() ? child.toString() : "")); //sb.append(" function returning " + (hasChild() ? child.toString() : ""));
break; break;
case ARRAY : case ARRAY :
sb.append("[" + dimension + "]"); sb.append("[" + dimension + "]"); //$NON-NLS-1$ //$NON-NLS-2$
//sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.toString() : "")); //sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.toString() : ""));
break; break;
case REFERENCE : case REFERENCE :
sb.append("&"); sb.append("&"); //$NON-NLS-1$
//sb.append(" reference to " + (hasChild() ? child.toString() : "")); //sb.append(" reference to " + (hasChild() ? child.toString() : ""));
break; break;
case POINTER : case POINTER :
sb.append("*"); sb.append("*"); //$NON-NLS-1$
//sb.append(" pointer to " + (hasChild() ? child.toString() : "")); //sb.append(" pointer to " + (hasChild() ? child.toString() : ""));
break; break;
} }
@ -178,16 +178,16 @@ public class GDBTypeParser {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
switch (getType()) { switch (getType()) {
case FUNCTION : case FUNCTION :
sb.append(" function returning " + (hasChild() ? child.verbose() : "")); sb.append(" function returning " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$
break; break;
case ARRAY : case ARRAY :
sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.verbose() : "")); sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$ //$NON-NLS-4$
break; break;
case REFERENCE : case REFERENCE :
sb.append(" reference to " + (hasChild() ? child.verbose() : "")); sb.append(" reference to " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$
break; break;
case POINTER : case POINTER :
sb.append(" pointer to " + (hasChild() ? child.verbose() : "")); sb.append(" pointer to " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$
break; break;
} }
return sb.toString(); return sb.toString();
@ -247,7 +247,7 @@ public class GDBTypeParser {
// method returns the next token // method returns the next token
int getToken() { int getToken() {
token = ""; token = ""; //$NON-NLS-1$
int c = getch(); int c = getch();
@ -260,7 +260,7 @@ public class GDBTypeParser {
if (c == '(') { if (c == '(') {
if ((c = getch()) == ')') { if ((c = getch()) == ')') {
token = "()"; token = "()"; //$NON-NLS-1$
tokenType = PARENS; tokenType = PARENS;
} else { } else {
ungetch(); ungetch();
@ -272,7 +272,7 @@ public class GDBTypeParser {
} }
tokenType = BRACKETS; tokenType = BRACKETS;
} else if (isCIdentifierStart(c)) { } else if (isCIdentifierStart(c)) {
token = "" + (char) c; token = "" + (char) c; //$NON-NLS-1$
while (isCIdentifierPart((c = getch())) && c != EOF) { while (isCIdentifierPart((c = getch())) && c != EOF) {
token += (char) c; token += (char) c;
} }
@ -336,7 +336,7 @@ public class GDBTypeParser {
} }
} else if (tokenType == NAME) { } else if (tokenType == NAME) {
// Useless we do not need the name of the variable // Useless we do not need the name of the variable
name = " " + token; name = " " + token; //$NON-NLS-1$
} else if (tokenType == PARENS) { } else if (tokenType == PARENS) {
prependChild(GDBType.FUNCTION); prependChild(GDBType.FUNCTION);
} else if (tokenType == BRACKETS) { } else if (tokenType == BRACKETS) {
@ -376,40 +376,40 @@ public class GDBTypeParser {
GDBTypeParser parser = new GDBTypeParser(); GDBTypeParser parser = new GDBTypeParser();
System.out.println("struct link { int i; int j; struct link * next} *"); System.out.println("struct link { int i; int j; struct link * next} *"); //$NON-NLS-1$
parser.parse("struct link { int i; int j; struct link * next} *"); parser.parse("struct link { int i; int j; struct link * next} *"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("char **argv"); System.out.println("char **argv"); //$NON-NLS-1$
parser.parse("unsigned long long int **argv"); parser.parse("unsigned long long int **argv"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("int (*daytab)[13]"); System.out.println("int (*daytab)[13]"); //$NON-NLS-1$
parser.parse("int (*daytab)[13]"); parser.parse("int (*daytab)[13]"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("int *daytab[13]"); System.out.println("int *daytab[13]"); //$NON-NLS-1$
parser.parse("int *daytab[13]"); parser.parse("int *daytab[13]"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("void *comp()"); System.out.println("void *comp()"); //$NON-NLS-1$
parser.parse("void *comp()"); parser.parse("void *comp()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("void (*comp)()"); System.out.println("void (*comp)()"); //$NON-NLS-1$
parser.parse("void (*comp)()"); parser.parse("void (*comp)()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("int (*func[15])()"); System.out.println("int (*func[15])()"); //$NON-NLS-1$
parser.parse("int (*func[15])()"); parser.parse("int (*func[15])()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("char (*(*x())[])()"); System.out.println("char (*(*x())[])()"); //$NON-NLS-1$
parser.parse("char (*(*x())[])()"); parser.parse("char (*(*x())[])()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
System.out.println("char (*(*x[3])())[5]"); System.out.println("char (*(*x[3])())[5]"); //$NON-NLS-1$
parser.parse("char (*(*x[3])())[5]"); parser.parse("char (*(*x[3])())[5]"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose()); System.out.println(parser.getGDBType().verbose());
} }
} }

View file

@ -12,7 +12,7 @@ package org.eclipse.cdt.debug.mi.core;
* *
*/ */
public class MIException extends Exception { public class MIException extends Exception {
String log = ""; String log = ""; //$NON-NLS-1$
public MIException(String s) { public MIException(String s) {
super(s); super(s);

View file

@ -66,11 +66,11 @@ public class MIInferior extends Process {
StringBuffer buf = new StringBuffer(); StringBuffer buf = new StringBuffer();
public void write(int b) throws IOException { public void write(int b) throws IOException {
if (!isRunning()) { if (!isRunning()) {
throw new IOException("target is suspended"); throw new IOException(MIPlugin.getResourceString("src.MIInferior.target_is_suspended")); //$NON-NLS-1$
} }
OutputStream channel = session.getChannelOutputStream(); OutputStream channel = session.getChannelOutputStream();
if (channel == null) { if (channel == null) {
throw new IOException("No MI Session"); throw new IOException(MIPlugin.getResourceString("src.MIInferior.No_session")); //$NON-NLS-1$
} }
channel.write(b); channel.write(b);
} }
@ -214,7 +214,7 @@ public class MIInferior extends Process {
// If we've failed throw an exception up. // If we've failed throw an exception up.
if (state == RUNNING) { if (state == RUNNING) {
throw new MIException("Failed to interrupt"); throw new MIException(MIPlugin.getResourceString("src.MIInferior.Failed_to_interrupt")); //$NON-NLS-1$
} }
} }

View file

@ -12,6 +12,8 @@ import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.Reader; import java.io.Reader;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -42,11 +44,19 @@ public class MIPlugin extends Plugin {
private static MIPlugin plugin; private static MIPlugin plugin;
// GDB init command file // GDB init command file
private static final String GDBINIT = ".gdbinit"; private static final String GDBINIT = ".gdbinit"; //$NON-NLS-1$
// GDB command // GDB command
private static final String GDB = "gdb"; private static final String GDB = "gdb"; //$NON-NLS-1$
private static ResourceBundle fgResourceBundle;
static {
try {
fgResourceBundle = ResourceBundle.getBundle("org.eclipse.cdt.debug.mi.core.MIPluginResources"); //$NON-NLS-1$
} catch (MissingResourceException x) {
fgResourceBundle = null;
}
}
/** /**
* The constructor * The constructor
* @see org.eclipse.core.runtime.Plugin#Plugin(IPluginDescriptor) * @see org.eclipse.core.runtime.Plugin#Plugin(IPluginDescriptor)
@ -153,15 +163,15 @@ public class MIPlugin extends Plugin {
String[] args; String[] args;
if (pty != null) { if (pty != null) {
if (program == null) { if (program == null) {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1"}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
} else { } else {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program.getAbsolutePath()}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
} }
} else { } else {
if (program == null) { if (program == null) {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1"}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
} else { } else {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1", program.getAbsolutePath()}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1", program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
} }
} }
@ -177,12 +187,12 @@ public class MIPlugin extends Plugin {
// Try to detect if we have been attach via "target remote localhost:port" // Try to detect if we have been attach via "target remote localhost:port"
// and set the state to be suspended. // and set the state to be suspended.
try { try {
CLICommand cmd = new CLICommand("info remote-process"); CLICommand cmd = new CLICommand("info remote-process"); //$NON-NLS-1$
session.postCommand(cmd); session.postCommand(cmd);
MIInfo info = cmd.getMIInfo(); MIInfo info = cmd.getMIInfo();
if (info == null) { if (info == null) {
pgdb.destroy(); pgdb.destroy();
throw new MIException("No answer"); throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
} }
//@@@ We have to manually set the suspended state when we attach //@@@ We have to manually set the suspended state when we attach
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
@ -212,9 +222,9 @@ public class MIPlugin extends Plugin {
String[] args; String[] args;
if (program == null) { if (program == null) {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath()}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
} else { } else {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath(), program.getAbsolutePath()}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath(), program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
} }
Process pgdb = getGDBProcess(args); Process pgdb = getGDBProcess(args);
MISession session; MISession session;
@ -245,9 +255,9 @@ public class MIPlugin extends Plugin {
String[] args; String[] args;
if (program == null) { if (program == null) {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1"}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
} else { } else {
args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", program.getAbsolutePath()}; args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
} }
Process pgdb = getGDBProcess(args); Process pgdb = getGDBProcess(args);
MISession session; MISession session;
@ -264,7 +274,7 @@ public class MIPlugin extends Plugin {
session.postCommand(target); session.postCommand(target);
MIInfo info = target.getMIInfo(); MIInfo info = target.getMIInfo();
if (info == null) { if (info == null) {
throw new MIException("No answer"); throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
} }
} }
if (pid > 0) { if (pid > 0) {
@ -272,7 +282,7 @@ public class MIPlugin extends Plugin {
session.postCommand(attach); session.postCommand(attach);
MIInfo info = attach.getMIInfo(); MIInfo info = attach.getMIInfo();
if (info == null) { if (info == null) {
throw new MIException("No answer"); throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
} }
session.getMIInferior().setInferiorPID(pid); session.getMIInferior().setInferiorPID(pid);
} }
@ -302,7 +312,7 @@ public class MIPlugin extends Plugin {
public void debugLog(String message) { public void debugLog(String message) {
if (getDefault().isDebugging()) { if (getDefault().isDebugging()) {
// Time stamp // Time stamp
message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } ); message = MessageFormat.format( "[{0}] {1}", new Object[] { new Long( System.currentTimeMillis() ), message } ); //$NON-NLS-1$
// This is to verbose for a log file, better use the console. // This is to verbose for a log file, better use the console.
// getDefault().getLog().log(StatusUtil.newStatus(Status.ERROR, message, null)); // getDefault().getLog().log(StatusUtil.newStatus(Status.ERROR, message, null));
// ALERT:FIXME: For example for big buffers say 4k length, // ALERT:FIXME: For example for big buffers say 4k length,
@ -312,16 +322,24 @@ public class MIPlugin extends Plugin {
while (message.length() > 100) { while (message.length() > 100) {
String partial = message.substring(0, 100); String partial = message.substring(0, 100);
message = message.substring(100); message = message.substring(100);
System.err.println(partial + "\\"); System.err.println(partial + "\\"); //$NON-NLS-1$
} }
if (message.endsWith("\n")) { if (message.endsWith("\n")) { //$NON-NLS-1$
System.err.print(message); System.err.print(message);
} else { } else {
System.err.println(message); System.err.println(message);
} }
} }
} }
public static String getResourceString(String key) {
try {
return fgResourceBundle.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
} catch (NullPointerException e) {
return '#' + key + '#';
}
}
/** /**
* Do some basic synchronisation, gdb may take some time to load * Do some basic synchronisation, gdb may take some time to load
* for whatever reasons. * for whatever reasons.
@ -341,7 +359,7 @@ public class MIPlugin extends Plugin {
getDefault().debugLog( sb.toString() ); getDefault().debugLog( sb.toString() );
} }
final Process pgdb = ProcessFactory.getFactory().exec(args); final Process pgdb = ProcessFactory.getFactory().exec(args);
Thread syncStartup = new Thread("GDB Start") { Thread syncStartup = new Thread("GDB Start") { //$NON-NLS-1$
public void run() { public void run() {
try { try {
String line; String line;
@ -351,7 +369,7 @@ public class MIPlugin extends Plugin {
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
line = line.trim(); line = line.trim();
//System.out.println("GDB " + line); //System.out.println("GDB " + line);
if (line.endsWith("(gdb)")) { if (line.endsWith("(gdb)")) { //$NON-NLS-1$
break; break;
} }
} }

View file

@ -0,0 +1,7 @@
src.common.No_answer=No answer
src.GDBServerDebugger.Error_initializing=Error initializing:
src.GDBServerDebugger.Can_not_set_Baud=Can not set Baud
src.GDBServerDebugger.GDBServer_attaching_unsupported=GDBServer does not support attaching
src.GDBServerDebugger.GDBServer_corefiles_unsupported=GDBServer does not support core files
src.GDBDebugger.Error_initializing_shared_lib_options=Error initializing shared library options:
src.GDBDebugger.Error_creating_session=Error creating session:

View file

@ -119,7 +119,7 @@ public class MISession extends Observable {
// the reader may throw a NPE. // the reader may throw a NPE.
} }
if (line == null) { if (line == null) {
line = "Process Terminated"; line = MIPlugin.getResourceString("src.MISession.Process_Terminated"); //$NON-NLS-1$
} }
throw new MIException(line); throw new MIException(line);
} catch (IllegalThreadStateException e) { } catch (IllegalThreadStateException e) {
@ -138,15 +138,15 @@ public class MISession extends Observable {
// Like confirmation and screen size. // Like confirmation and screen size.
try { try {
MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"}); MIGDBSet confirm = new MIGDBSet(new String[]{"confirm", "off"}); //$NON-NLS-1$ //$NON-NLS-2$
postCommand(confirm, launchTimeout); postCommand(confirm, launchTimeout);
confirm.getMIInfo(); confirm.getMIInfo();
MIGDBSet width = new MIGDBSet(new String[]{"width", "0"}); MIGDBSet width = new MIGDBSet(new String[]{"width", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
postCommand(width, launchTimeout); postCommand(width, launchTimeout);
confirm.getMIInfo(); confirm.getMIInfo();
MIGDBSet height = new MIGDBSet(new String[]{"height", "0"}); MIGDBSet height = new MIGDBSet(new String[]{"height", "0"}); //$NON-NLS-1$ //$NON-NLS-2$
postCommand(height, launchTimeout); postCommand(height, launchTimeout);
confirm.getMIInfo(); confirm.getMIInfo();
@ -291,7 +291,7 @@ public class MISession extends Observable {
// Test if we are in a sane state. // Test if we are in a sane state.
if (!txThread.isAlive() || !rxThread.isAlive()) { if (!txThread.isAlive() || !rxThread.isAlive()) {
throw new MIException("{R,T}xThread terminated"); throw new MIException(MIPlugin.getResourceString("src.MISession.Thread_Terminated")); //$NON-NLS-1$
} }
// Test if we are in the right state? // Test if we are in the right state?
@ -299,12 +299,12 @@ public class MISession extends Observable {
// REMINDER: if we support -exec-interrupt // REMINDER: if we support -exec-interrupt
// Let it throught: // Let it throught:
if (!(cmd instanceof MIExecInterrupt)) { if (!(cmd instanceof MIExecInterrupt)) {
throw new MIException("Target is not suspended"); throw new MIException(MIPlugin.getResourceString("src.MISession.Target_not_suspended")); //$NON-NLS-1$
} }
} }
if (isTerminated()) { if (isTerminated()) {
throw new MIException("Session terminated"); throw new MIException(MIPlugin.getResourceString("src.MISession.Session_terminated")); //$NON-NLS-1$
} }
// TRACING: print the command; // TRACING: print the command;
@ -320,7 +320,7 @@ public class MISession extends Observable {
try { try {
cmd.wait(timeout); cmd.wait(timeout);
if (cmd.getMIOutput() == null) { if (cmd.getMIOutput() == null) {
throw new MIException("Target is not responding (timed out)"); throw new MIException(MIPlugin.getResourceString("src.MISession.Target_not_responding")); //$NON-NLS-1$
} }
} catch (InterruptedException e) { } catch (InterruptedException e) {
} }

View file

@ -58,7 +58,7 @@ public class RxThread extends Thread {
List oobList; List oobList;
public RxThread(MISession s) { public RxThread(MISession s) {
super("MI RX Thread"); super("MI RX Thread"); //$NON-NLS-1$
session = s; session = s;
oobList = new ArrayList(); oobList = new ArrayList();
} }
@ -74,7 +74,7 @@ public class RxThread extends Thread {
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
// TRACING: print the output. // TRACING: print the output.
MIPlugin.getDefault().debugLog(line); MIPlugin.getDefault().debugLog(line);
processMIOutput(line + "\n"); processMIOutput(line + "\n"); //$NON-NLS-1$
} }
} catch (IOException e) { } catch (IOException e) {
//e.printStackTrace(); //e.printStackTrace();
@ -91,7 +91,7 @@ public class RxThread extends Thread {
session.terminate(); session.terminate();
} }
}; };
Thread clean = new Thread(cleanup, "GDB Died"); Thread clean = new Thread(cleanup, "GDB Died"); //$NON-NLS-1$
clean.setDaemon(true); clean.setDaemon(true);
clean.start(); clean.start();
} }
@ -132,7 +132,7 @@ public class RxThread extends Thread {
// Check if the state changed. // Check if the state changed.
String state = rr.getResultClass(); String state = rr.getResultClass();
if ("running".equals(state)) { if ("running".equals(state)) { //$NON-NLS-1$
int type = 0; int type = 0;
// Check the type of command // Check the type of command
// if it was a step instruction set state stepping // if it was a step instruction set state stepping
@ -158,12 +158,12 @@ public class RxThread extends Thread {
session.getMIInferior().setRunning(); session.getMIInferior().setRunning();
MIEvent event = new MIRunningEvent(id, type); MIEvent event = new MIRunningEvent(id, type);
session.fireEvent(event); session.fireEvent(event);
} else if ("exit".equals(state)) { } else if ("exit".equals(state)) { //$NON-NLS-1$
// No need to do anything, terminate() will. // No need to do anything, terminate() will.
session.getMIInferior().setTerminated(); session.getMIInferior().setTerminated();
} else if ("connected".equals(state)) { } else if ("connected".equals(state)) { //$NON-NLS-1$
session.getMIInferior().setConnected(); session.getMIInferior().setConnected();
} else if ("error".equals(state)) { } else if ("error".equals(state)) { //$NON-NLS-1$
if (session.getMIInferior().isRunning()) { if (session.getMIInferior().isRunning()) {
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
MIEvent event = new MIErrorEvent(rr, oobRecords); MIEvent event = new MIErrorEvent(rr, oobRecords);
@ -216,13 +216,13 @@ public class RxThread extends Thread {
MIExecAsyncOutput exec = (MIExecAsyncOutput) async; MIExecAsyncOutput exec = (MIExecAsyncOutput) async;
// Change of state. // Change of state.
String state = exec.getAsyncClass(); String state = exec.getAsyncClass();
if ("stopped".equals(state)) { if ("stopped".equals(state)) { //$NON-NLS-1$
MIEvent e = null; MIEvent e = null;
MIResult[] results = exec.getMIResults(); MIResult[] results = exec.getMIResults();
for (int i = 0; i < results.length; i++) { for (int i = 0; i < results.length; i++) {
String var = results[i].getVariable(); String var = results[i].getVariable();
MIValue val = results[i].getMIValue(); MIValue val = results[i].getMIValue();
if (var.equals("reason")) { if (var.equals("reason")) { //$NON-NLS-1$
if (val instanceof MIConst) { if (val instanceof MIConst) {
String reason = ((MIConst) val).getString(); String reason = ((MIConst) val).getString();
e = createEvent(reason, exec); e = createEvent(reason, exec);
@ -323,7 +323,7 @@ public class RxThread extends Thread {
MIResult[] results = rr.getMIResults(); MIResult[] results = rr.getMIResults();
for (int i = 0; i < results.length; i++) { for (int i = 0; i < results.length; i++) {
String var = results[i].getVariable(); String var = results[i].getVariable();
if (var.equals("reason")) { if (var.equals("reason")) { //$NON-NLS-1$
MIValue value = results[i].getMIValue(); MIValue value = results[i].getMIValue();
if (value instanceof MIConst) { if (value instanceof MIConst) {
String reason = ((MIConst) value).getString(); String reason = ((MIConst) value).getString();
@ -346,7 +346,7 @@ public class RxThread extends Thread {
MIEvent createEvent(String reason, MIResultRecord rr, MIExecAsyncOutput exec) { MIEvent createEvent(String reason, MIResultRecord rr, MIExecAsyncOutput exec) {
MIEvent event = null; MIEvent event = null;
if ("breakpoint-hit".equals(reason)) { if ("breakpoint-hit".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MIBreakpointHitEvent(exec); event = new MIBreakpointHitEvent(exec);
} else if (rr != null) { } else if (rr != null) {
@ -354,58 +354,58 @@ public class RxThread extends Thread {
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ( } else if (
"watchpoint-trigger".equals(reason) "watchpoint-trigger".equals(reason) //$NON-NLS-1$
|| "read-watchpoint-trigger".equals(reason) || "read-watchpoint-trigger".equals(reason) //$NON-NLS-1$
|| "access-watchpoint-trigger".equals(reason)) { || "access-watchpoint-trigger".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MIWatchpointTriggerEvent(exec); event = new MIWatchpointTriggerEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MIWatchpointTriggerEvent(rr); event = new MIWatchpointTriggerEvent(rr);
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ("watchpoint-scope".equals(reason)) { } else if ("watchpoint-scope".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MIWatchpointScopeEvent(exec); event = new MIWatchpointScopeEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MIWatchpointScopeEvent(rr); event = new MIWatchpointScopeEvent(rr);
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ("end-stepping-range".equals(reason)) { } else if ("end-stepping-range".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MISteppingRangeEvent(exec); event = new MISteppingRangeEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MISteppingRangeEvent(rr); event = new MISteppingRangeEvent(rr);
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ("signal-received".equals(reason)) { } else if ("signal-received".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MISignalEvent(exec); event = new MISignalEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MISignalEvent(rr); event = new MISignalEvent(rr);
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ("location-reached".equals(reason)) { } else if ("location-reached".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MILocationReachedEvent(exec); event = new MILocationReachedEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MILocationReachedEvent(rr); event = new MILocationReachedEvent(rr);
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ("function-finished".equals(reason)) { } else if ("function-finished".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MIFunctionFinishedEvent(exec); event = new MIFunctionFinishedEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MIFunctionFinishedEvent(rr); event = new MIFunctionFinishedEvent(rr);
} }
session.getMIInferior().setSuspended(); session.getMIInferior().setSuspended();
} else if ("exited-normally".equals(reason) || "exited".equals(reason)) { } else if ("exited-normally".equals(reason) || "exited".equals(reason)) { //$NON-NLS-1$ //$NON-NLS-2$
if (exec != null) { if (exec != null) {
event = new MIInferiorExitEvent(exec); event = new MIInferiorExitEvent(exec);
} else if (rr != null) { } else if (rr != null) {
event = new MIInferiorExitEvent(rr); event = new MIInferiorExitEvent(rr);
} }
session.getMIInferior().setTerminated(); session.getMIInferior().setTerminated();
} else if ("exited-signalled".equals(reason)) { } else if ("exited-signalled".equals(reason)) { //$NON-NLS-1$
if (exec != null) { if (exec != null) {
event = new MIInferiorSignalExitEvent(exec); event = new MIInferiorSignalExitEvent(exec);
} else if (rr != null) { } else if (rr != null) {

View file

@ -21,7 +21,7 @@ public class TxThread extends Thread {
CLIProcessor cli; CLIProcessor cli;
public TxThread(MISession s) { public TxThread(MISession s) {
super("MI TX Thread"); super("MI TX Thread"); //$NON-NLS-1$
session = s; session = s;
cli = new CLIProcessor(session); cli = new CLIProcessor(session);
} }