1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +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.
*/
public class BreakpointManager extends SessionObject implements ICDIBreakpointManager {
public class BreakpointManager extends Manager implements ICDIBreakpointManager {
List breakList;
List deferredList;
boolean allowInterrupt;
boolean autoupdate;
public BreakpointManager(Session session) {
super(session);
super(session, false);
breakList = Collections.synchronizedList(new ArrayList());
deferredList = Collections.synchronizedList(new ArrayList());
allowInterrupt = true;
autoupdate = false;
}
public MIBreakpoint[] getMIBreakpoints() throws CDIException {
@ -70,7 +68,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
s.getMISession().postCommand(breakpointList);
MIBreakListInfo info = breakpointList.getMIBreakListInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
return info.getMIBreakpoints();
} catch (MIException e) {
@ -141,7 +139,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
&& breakList.contains(breakpoint)) {
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
} 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());
Session session = (Session)getSession();
@ -151,7 +149,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakEnable);
MIInfo info = breakEnable.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -171,7 +169,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
&& breakList.contains(breakpoint)) {
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
} 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();
@ -183,7 +181,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakDisable);
MIInfo info = breakDisable.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -202,7 +200,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
&& breakList.contains(breakpoint)) {
number = ((Breakpoint) breakpoint).getMIBreakpoint().getNumber();
} 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();
@ -212,7 +210,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
// reset the values to sane states.
String exprCond = condition.getExpression();
if (exprCond == null) {
exprCond = "";
exprCond = ""; //$NON-NLS-1$
}
int ignoreCount = condition.getIgnoreCount();
if (ignoreCount < 0) {
@ -225,14 +223,14 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakCondition);
MIInfo info = breakCondition.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIBreakAfter breakAfter =
factory.createMIBreakAfter(number, ignoreCount);
session.getMISession().postCommand(breakAfter);
info = breakAfter.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -332,7 +330,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
numbers[i] =
((Breakpoint) breakpoints[i]).getMIBreakpoint().getNumber();
} 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();
@ -343,7 +341,7 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
session.getMISession().postCommand(breakDelete);
MIInfo info = breakDelete.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException 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,
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);
MIBreakInsertInfo info = breakInsert.getMIBreakInsertInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
points = info.getMIBreakpoints();
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) {
throw new MI2CDIException(e);
@ -503,10 +501,10 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
MIBreakWatchInfo info = breakWatch.getMIBreakWatchInfo();
points = info.getMIBreakpoints();
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) {
throw new CDIException("Parsing Error");
throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -543,18 +541,4 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
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() {
String os = null;
try {
os = System.getProperty("os.name", "");
os = System.getProperty("os.name", ""); //$NON-NLS-1$ //$NON-NLS-2$
} catch (SecurityException e) {
}
Process gdb = miSession.getGDBProcess();
@ -130,7 +130,7 @@ public class Configuration implements ICDIConfiguration {
// If we have a pty, sending a control-c will work
// except for solaris.
if (os.equals("SunOS")) {
if (os.equals("SunOS")) { //$NON-NLS-1$
MIInferior inferior = miSession.getMIInferior();
if (inferior.getPTY() != null) {
// 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 boolean autoupdate;
MIVarChange[] noChanges = new MIVarChange[0];
public ExpressionManager(Session session) {
super(session);
super(session, true);
expList = Collections.synchronizedList(new ArrayList());
autoupdate = true;
}
/**
@ -91,7 +89,7 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
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);
expression = new Expression(varObj, info.getMIVar());
@ -119,7 +117,7 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
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();
VariableObject varObj = new VariableObject(tgt, name, frame, 0, 0);
@ -189,7 +187,7 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
mi.postCommand(update);
MIVarUpdateInfo info = update.getMIVarUpdateInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
changes = info.getMIVarChanges();
} catch (MIException e) {
@ -211,18 +209,4 @@ public class ExpressionManager extends SessionObject implements ICDIExpressionMa
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 {
long addr;
String file = "";
String function = "";
String file = ""; //$NON-NLS-1$
String function = ""; //$NON-NLS-1$
int line;
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;
boolean autoupdate;
public MemoryManager(Session session) {
super(session);
super(session, true);
blockList = new ArrayList();
autoupdate = true;
}
/**
@ -136,7 +134,7 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
mi.postCommand(mem);
MIDataReadMemoryInfo info = mem.getMIDataReadMemoryInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
return info;
} catch (MIException e) {
@ -149,7 +147,7 @@ public class MemoryManager extends SessionObject implements ICDIMemoryManager {
*/
public ICDIMemoryBlock createMemoryBlock(long address, int length)
throws CDIException {
String addr = "0x" + Long.toHexString(address);
String addr = "0x" + Long.toHexString(address); //$NON-NLS-1$
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 boolean autoupdate;
MIVarChange[] noChanges = new MIVarChange[0];
public RegisterManager(Session session) {
super(session);
super(session, true);
regList = Collections.synchronizedList(new ArrayList());
autoupdate = true;
}
/**
@ -59,7 +57,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
MIDataListRegisterNamesInfo info =
registers.getMIDataListRegisterNamesInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
String[] names = info.getRegisterNames();
List regsList = new ArrayList(names.length);
@ -86,7 +84,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
Register reg = getRegister(regObject);
if (reg == null) {
try {
String name = "$" + regObj.getName();
String name = "$" + regObj.getName(); //$NON-NLS-1$
Session session = (Session)getSession();
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
@ -94,7 +92,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
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());
regList.add(reg);
@ -104,7 +102,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
}
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 {
@ -120,20 +118,6 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
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;
*/
@ -180,7 +164,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
MIDataListChangedRegistersInfo info =
changed.getMIDataListChangedRegistersInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
int[] regnos = info.getRegisterNumbers();
List eventList = new ArrayList(regnos.length);
@ -197,7 +181,7 @@ public class RegisterManager extends SessionObject implements ICDIRegisterManage
mi.postCommand(update);
MIVarUpdateInfo updateInfo = update.getMIVarUpdateInfo();
if (updateInfo == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
changes = updateInfo.getMIVarChanges();
} catch (MIException e) {

View file

@ -42,10 +42,10 @@ public class RuntimeOptions implements ICDIRuntimeOptions {
mi.postCommand(arguments);
MIInfo info = arguments.getMIInfo();
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) {
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);
MIInfo info = set.getMIInfo();
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) {
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);
MIInfo info = cd.getMIInfo();
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) {
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) {
ctarget = (Target)target;
} 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.
*/
public class SharedLibraryManager extends SessionObject implements ICDISharedLibraryManager {
public class SharedLibraryManager extends Manager implements ICDISharedLibraryManager {
List sharedList;
boolean autoupdate;
boolean isDeferred;
public SharedLibraryManager (Session session) {
super(session);
super(session, true);
sharedList = new ArrayList(1);
autoupdate = true;
}
MIShared[] getMIShareds() throws CDIException {
@ -59,7 +57,7 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
session.getMISession().postCommand(infoShared);
MIInfoSharedLibraryInfo info = infoShared.getMIInfoSharedLibraryInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
miLibs = info.getMIShared();
} catch (MIException e) {
@ -171,13 +169,13 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
Session session = (Session)getSession();
MISession mi = session.getMISession();
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 {
mi.postCommand(show);
MIGDBShowInfo info = show.getMIGDBShowInfo();
String value = info.getValue();
if (value != null) {
return value.equalsIgnoreCase("on");
return value.equalsIgnoreCase("on"); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -202,13 +200,13 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
Session session = (Session)getSession();
MISession mi = session.getMISession();
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 {
mi.postCommand(show);
MIGDBShowInfo info = show.getMIGDBShowInfo();
String value = info.getValue();
if (value != null) {
return value.equalsIgnoreCase("1");
return value.equalsIgnoreCase("1"); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -268,7 +266,7 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
mi.postCommand(sharedlibrary);
MIInfo info = sharedlibrary.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -292,7 +290,7 @@ public class SharedLibraryManager extends SessionObject implements ICDISharedLib
session.getMISession().postCommand(sharedlibrary);
MIInfo info = sharedlibrary.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException 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)
* @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];
List signalsList = null;
public SignalManager(Session session) {
super(session);
autoupdate = false;
super(session, false);
}
MISigHandle[] getMISignals() throws CDIException {
@ -46,7 +44,7 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
mi.postCommand(sigs);
MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
miSigs = info.getMISignals();
} catch (MIException e) {
@ -65,7 +63,7 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
mi.postCommand(sigs);
MIInfoSignalsInfo info = sigs.getMIInfoSignalsInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MISigHandle[] miSigs = info.getMISignals();
if (miSigs.length > 0) {
@ -127,17 +125,17 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
StringBuffer buffer = new StringBuffer(sig.getName());
buffer.append(" ");
buffer.append(" "); //$NON-NLS-1$
if (isIgnore) {
buffer.append("ignore");
buffer.append(CdiResources.getString("cdi.SignalManager.ignore")); //$NON-NLS-1$
} else {
buffer.append("noignore");
buffer.append(CdiResources.getString("cdi.SignalManager.noignore")); //$NON-NLS-1$
}
buffer.append(" ");
buffer.append(" "); //$NON-NLS-1$
if (isStop) {
buffer.append("stop");
buffer.append(CdiResources.getString("cdi.SignalManager.stop")); //$NON-NLS-1$
} else {
buffer.append("nostop");
buffer.append(CdiResources.getString("cdi.SignalManager.nostop")); //$NON-NLS-1$
}
MIHandle handle = factory.createMIHandle(buffer.toString());
try {
@ -160,20 +158,6 @@ public class SignalManager extends SessionObject implements ICDISignalManager {
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()
*/

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;
public SourceManager(Session session) {
super(session);
autoupdate = false;
super(session, false);
gdbTypeParser = new GDBTypeParser();
}
@ -131,7 +129,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
Session session = (Session)getSession();
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
String hex = "0x";
String hex = "0x"; //$NON-NLS-1$
String sa = hex + Long.toHexString(start);
String ea = hex + Long.toHexString(end);
MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false);
@ -185,7 +183,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
Session session = (Session)getSession();
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
String hex = "0x";
String hex = "0x"; //$NON-NLS-1$
String sa = hex + Long.toHexString(start);
String ea = hex + Long.toHexString(end);
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()
*/
@ -271,7 +255,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
if (headType != null) {
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 {
@ -282,37 +266,37 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
String typename = name.trim();
// Check the primitives.
if (typename.equals("char")) {
if (typename.equals("char")) { //$NON-NLS-1$
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);
} else if (typename.equals("short")) {
} else if (typename.equals("short")) { //$NON-NLS-1$
return new ShortType(target, typename);
} else if (typename.equals("int")) {
} else if (typename.equals("int")) { //$NON-NLS-1$
return new IntType(target, typename);
} else if (typename.equals("long")) {
} else if (typename.equals("long")) { //$NON-NLS-1$
return new LongType(target, typename);
} else if (typename.equals("unsigned")) {
} else if (typename.equals("unsigned")) { //$NON-NLS-1$
return new IntType(target, typename, true);
} else if (typename.equals("signed")) {
} else if (typename.equals("signed")) { //$NON-NLS-1$
return new IntType(target, typename);
} else if (typename.equals("bool")) {
} else if (typename.equals("bool")) { //$NON-NLS-1$
return new BoolType(target, typename);
} else if (typename.equals("_Bool")) {
} else if (typename.equals("_Bool")) { //$NON-NLS-1$
return new BoolType(target, typename);
} else if (typename.equals("float")) {
} else if (typename.equals("float")) { //$NON-NLS-1$
return new FloatType(target, typename);
} else if (typename.equals("double")) {
} else if (typename.equals("double")) { //$NON-NLS-1$
return new DoubleType(target, typename);
} else if (typename.equals("void")) {
} else if (typename.equals("void")) { //$NON-NLS-1$
return new VoidType(target, typename);
} else if (typename.equals("enum")) {
} else if (typename.equals("enum")) { //$NON-NLS-1$
return new EnumType(target, typename);
} else if (typename.equals("union")) {
} else if (typename.equals("union")) { //$NON-NLS-1$
return new StructType(target, typename);
} else if (typename.equals("struct")) {
} else if (typename.equals("struct")) { //$NON-NLS-1$
return new StructType(target, typename);
} else if (typename.equals("class")) {
} else if (typename.equals("class")) { //$NON-NLS-1$
return new StructType(target, typename);
}
@ -325,24 +309,24 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
// ISOC allows permutations:
// "signed int" and "int signed" are equivalent
boolean isUnsigned = (first.equals("unsigned") || second.equals("unsigned"));
boolean isSigned = (first.equals("signed") || second.equals("signed"));
boolean isChar = (first.equals("char") || second.equals("char"));
boolean isInt = (first.equals("int") || second.equals("int"));
boolean isLong = (first.equals("long") || second.equals("long"));
boolean isShort = (first.equals("short") || second.equals("short"));
boolean isLongLong = (first.equals("long") && second.equals("long"));
boolean isUnsigned = (first.equals("unsigned") || second.equals("unsigned")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isSigned = (first.equals("signed") || second.equals("signed")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isChar = (first.equals("char") || second.equals("char")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isInt = (first.equals("int") || second.equals("int")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isLong = (first.equals("long") || second.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isShort = (first.equals("short") || second.equals("short")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isLongLong = (first.equals("long") && second.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isDouble = (first.equals("double") || second.equals("double"));
boolean isFloat = (first.equals("float") || second.equals("float"));
boolean isComplex = (first.equals("complex") || second.equals("complex") ||
first.equals("_Complex") || second.equals("_Complex"));
boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary"));
boolean isDouble = (first.equals("double") || second.equals("double")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isFloat = (first.equals("float") || second.equals("float")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isComplex = (first.equals("complex") || second.equals("complex") || //$NON-NLS-1$ //$NON-NLS-2$
first.equals("_Complex") || second.equals("_Complex")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary")); //$NON-NLS-1$ //$NON-NLS-2$
boolean isStruct = first.equals("struct");
boolean isClass = first.equals("class");
boolean isUnion = first.equals("union");
boolean isEnum = first.equals("enum");
boolean isStruct = first.equals("struct"); //$NON-NLS-1$
boolean isClass = first.equals("class"); //$NON-NLS-1$
boolean isUnion = first.equals("union"); //$NON-NLS-1$
boolean isEnum = first.equals("enum"); //$NON-NLS-1$
if (isChar && (isSigned || isUnsigned)) {
return new CharType(target, typename, isUnsigned);
@ -379,17 +363,17 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
String second = st.nextToken();
String third = st.nextToken();
boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed"));
boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned"));
boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int"));
boolean isLong = (first.equals("long") || second.equals("long") || third.equals("long"));
boolean isShort = (first.equals("short") || second.equals("short") || third.equals("short"));
boolean isLongLong = (first.equals("long") && second.equals("long")) ||
(second.equals("long") && third.equals("long"));
boolean isDouble = (first.equals("double") || second.equals("double") || third.equals("double"));
boolean isComplex = (first.equals("complex") || second.equals("complex") || third.equals("complex") ||
first.equals("_Complex") || second.equals("_Complex") || third.equals("_Complex"));
boolean isImaginery = (first.equals("_Imaginary") || second.equals("_Imaginary") || third.equals("_Imaginary"));
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")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
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")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
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")) || //$NON-NLS-1$ //$NON-NLS-2$
(second.equals("long") && third.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
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") || //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
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")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (isShort && isInt && (isSigned || unSigned)) {
@ -411,18 +395,18 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
String third = st.nextToken();
String fourth = st.nextToken();
boolean unSigned = (first.equals("unsigned") || second.equals("unsigned") || third.equals("unsigned") || fourth.equals("unsigned"));
boolean isSigned = (first.equals("signed") || second.equals("signed") || third.equals("signed") || fourth.equals("signed"));
boolean isInt = (first.equals("int") || second.equals("int") || third.equals("int") || fourth.equals("int"));
boolean isLongLong = (first.equals("long") && second.equals("long"))
|| (second.equals("long") && third.equals("long"))
|| (third.equals("long") && fourth.equals("long"));
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")); //$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")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
boolean isLongLong = (first.equals("long") && second.equals("long")) //$NON-NLS-1$ //$NON-NLS-2$
|| (second.equals("long") && third.equals("long")) //$NON-NLS-1$ //$NON-NLS-2$
|| (third.equals("long") && fourth.equals("long")); //$NON-NLS-1$ //$NON-NLS-2$
if (isLongLong && isInt && (isSigned || 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 {
@ -434,7 +418,7 @@ public class SourceManager extends SessionObject implements ICDISourceManager {
mi.postCommand(ptype);
MIPTypeInfo info = ptype.getMIPtypeInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
return info.getType();
} 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
// go when doing update of the variables.
// If the number is to high, gdb will just hang.
int MAX_STACK_DEPTH = 200;
List variableList;
boolean autoupdate;
MIVarChange[] noChanges = new MIVarChange[0];
public VariableManager(Session session) {
super(session);
super(session, true);
variableList = Collections.synchronizedList(new ArrayList());
autoupdate = true;
}
/**
@ -132,13 +130,13 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(ptype);
MIPTypeInfo info = ptype.getMIPtypeInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
}
} 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);
MIVarCreateInfo info = var.getMIVarCreateInfo();
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());
variableList.add(argument);
@ -220,7 +218,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
}
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);
MIStackListArgumentsInfo info = listArgs.getMIStackListArgumentsInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIFrame[] miFrames = info.getMIFrames();
if (miFrames != null && miFrames.length == 1) {
@ -281,10 +279,10 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
}
StringBuffer buffer = new StringBuffer();
if (filename.length() > 0) {
buffer.append('\'').append(filename).append('\'').append("::");
buffer.append('\'').append(filename).append('\'').append("::"); //$NON-NLS-1$
}
if (function.length() > 0) {
buffer.append(function).append("::");
buffer.append(function).append("::"); //$NON-NLS-1$
}
buffer.append(name);
ICDITarget target = getSession().getCurrentTarget();
@ -313,7 +311,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
vo.setCastingArrayEnd(length);
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());
String casting = obj.getCastingType();
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);
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);
MIStackListLocalsInfo info = locals.getMIStackListLocalsInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
args = info.getLocals();
if (args != null) {
@ -423,7 +421,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
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());
variableList.add(variable);
@ -437,7 +435,7 @@ public class VariableManager extends SessionObject implements ICDIVariableManage
}
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"
* 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);
MIVarUpdateInfo info = update.getMIVarUpdateInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
changes = info.getMIVarChanges();
} 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.MIFormat;
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.MemoryManager;
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 {
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();
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
for (int i = 0; i < bytes.length; i++) {
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,
expression, MIFormat.HEXADECIMAL, 1, value);
try {
mi.postCommand(mw);
MIInfo info = mw.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException 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.mi.core.MIException;
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.RegisterManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -36,7 +37,7 @@ public class Register extends Variable implements ICDIRegister {
mi.postCommand(var);
MIVarListChildrenInfo info = var.getMIVarListChildrenInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIVar[] vars = info.getMIVars();
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(),
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.MIInfoThreadsInfo;
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) {
setCurrentThread(cthread, true);
} 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) {
setCurrentThread((Thread)cthread, doUpdate);
} 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);
MIThreadSelectInfo info = select.getMIThreadSelectInfo();
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();
} catch (MIException e) {
@ -148,7 +149,7 @@ public class Target implements ICDITarget {
// thread is gone. Generate a Thread destroyed.
MISession mi = session.getMISession();
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);
MIInfo info = run.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -331,7 +332,7 @@ public class Target implements ICDITarget {
public void resume() throws CDIException {
MISession mi = session.getMISession();
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()) {
CommandFactory factory = mi.getCommandFactory();
MIExecContinue cont = factory.createMIExecContinue();
@ -340,7 +341,7 @@ public class Target implements ICDITarget {
mi.postCommand(cont);
MIInfo info = cont.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -364,7 +365,7 @@ public class Target implements ICDITarget {
mi.postCommand(step);
MIInfo info = step.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -383,7 +384,7 @@ public class Target implements ICDITarget {
mi.postCommand(stepi);
MIInfo info = stepi.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -402,7 +403,7 @@ public class Target implements ICDITarget {
mi.postCommand(next);
MIInfo info = next.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -421,7 +422,7 @@ public class Target implements ICDITarget {
mi.postCommand(nexti);
MIInfo info = nexti.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -457,7 +458,7 @@ public class Target implements ICDITarget {
mi.postCommand(finish);
MIInfo info = finish.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -475,7 +476,7 @@ public class Target implements ICDITarget {
mi.postCommand(ret);
MIInfo info = ret.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -505,7 +506,7 @@ public class Target implements ICDITarget {
mi.postCommand(detach);
MIInfo info = detach.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -523,13 +524,13 @@ public class Target implements ICDITarget {
public void runUntil(ICDILocation location) throws CDIException {
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
String loc = "";
String loc = ""; //$NON-NLS-1$
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) {
loc = location.getFunction();
} else if (location.getAddress() != 0) {
loc = "*" + location.getAddress();
loc = "*" + location.getAddress(); //$NON-NLS-1$
}
MIExecUntil until = factory.createMIExecUntil(loc);
lastExecutionCommand = until;
@ -537,7 +538,7 @@ public class Target implements ICDITarget {
mi.postCommand(until);
MIInfo info = until.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -551,13 +552,13 @@ public class Target implements ICDITarget {
public void jump(ICDILocation location) throws CDIException {
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
String loc = "";
String loc = ""; //$NON-NLS-1$
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) {
loc = location.getFunction();
} else if (location.getAddress() != 0) {
loc = "*" + location.getAddress();
loc = "*" + location.getAddress(); //$NON-NLS-1$
}
MIJump jump = factory.createMIJump(loc);
lastExecutionCommand = jump;
@ -565,7 +566,7 @@ public class Target implements ICDITarget {
mi.postCommand(jump);
MIInfo info = jump.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -586,7 +587,7 @@ public class Target implements ICDITarget {
MIDataEvaluateExpressionInfo info =
evaluate.getMIDataEvaluateExpressionInfo();
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();
} catch (MIException e) {
@ -644,12 +645,12 @@ public class Target implements ICDITarget {
Session session = (Session)getSession();
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
MISignal signal = factory.createMISignal("0");
MISignal signal = factory.createMISignal("0"); //$NON-NLS-1$
try {
mi.postCommand(signal);
MIInfo info = signal.getMIInfo();
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) {
throw new MI2CDIException(e);
@ -668,7 +669,7 @@ public class Target implements ICDITarget {
mi.postCommand(sig);
MIInfo info = sig.getMIInfo();
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) {
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.mi.core.MIException;
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.RegisterManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -99,7 +100,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(frames);
MIStackListFramesInfo info = frames.getMIStackListFramesInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIFrame[] miFrames = info.getMIFrames();
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.
info = depth.getMIStackInfoDepthInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
stackdepth = info.getDepth();
} catch (MIException e) {
@ -155,7 +156,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(depth);
info = depth.getMIStackInfoDepthInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
stackdepth = info.getDepth();
if (stackdepth > 0) {
@ -199,7 +200,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(frames);
MIStackListFramesInfo info = frames.getMIStackListFramesInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIFrame[] miFrames = info.getMIFrames();
for (int i = 0; i < miFrames.length; i++) {
@ -264,7 +265,7 @@ public class Thread extends CObject implements ICDIThread {
mi.postCommand(frame);
MIInfo info = frame.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
currentFrame = stackframe;
// 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.mi.core.MIException;
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.command.CommandFactory;
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()
*/
public String getValueString() throws CDIException {
String result = "";
String result = ""; //$NON-NLS-1$
MISession mi = ((Session)(getTarget().getSession())).getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarEvaluateExpression var =
@ -46,7 +47,7 @@ public class Value extends CObject implements ICDIValue {
mi.postCommand(var);
MIVarEvaluateExpressionInfo info = var.getMIVarEvaluateExpressionInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
result = info.getValue();
} 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.mi.core.MIException;
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.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
@ -113,18 +114,18 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var);
MIVarInfoExpressionInfo info = var.getMIVarInfoExpressionInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
language = info.getLanguage();
} catch (MIException e) {
throw new MI2CDIException(e);
}
}
return (language == null) ? "" : language;
return (language == null) ? "" : language; //$NON-NLS-1$
}
boolean isCPPLanguage() throws CDIException {
return getLanguage().equalsIgnoreCase("C++");
return getLanguage().equalsIgnoreCase("C++"); //$NON-NLS-1$
}
void setIsFake(boolean f) {
@ -157,7 +158,7 @@ public class Variable extends VariableObject implements ICDIVariable {
}
MIVarListChildrenInfo info = var.getMIVarListChildrenInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIVar[] vars = info.getMIVars();
children = new Variable[vars.length];
@ -168,12 +169,12 @@ public class Variable extends VariableObject implements ICDIVariable {
boolean childFake = false;
ICDIType t = getType();
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.
int index = castingIndex + i;
childName = getName() + "[" + index + "]";
childName = getName() + "[" + index + "]"; //$NON-NLS-1$ //$NON-NLS-2$
} else if (t instanceof ICDIPointerType) {
fn = "*(" + fn + ")";
fn = "*(" + fn + ")"; //$NON-NLS-1$ //$NON-NLS-2$
} else if (t instanceof ICDIStructType) {
if (isCPPLanguage()) {
// 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
// but carry over to those "fake" variables the typename and the qualified name
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;
childTypename = getTypeName();
} else {
fn = "(" + fn + ")." + vars[i].getExp();
fn = "(" + fn + ")." + vars[i].getExp(); //$NON-NLS-1$ //$NON-NLS-2$
}
} 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]);
@ -297,7 +298,7 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var);
MIInfo info = var.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
throw new MI2CDIException(e);
@ -348,14 +349,14 @@ public class Variable extends VariableObject implements ICDIVariable {
mi.postCommand(var);
MIVarShowAttributesInfo info = var.getMIVarShowAttributesInfo();
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());
} catch (MIException 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);
MIInfo info = var.getMIInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
} catch (MIException 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.output.MIDataEvaluateExpressionInfo;
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();
if (castingLength > 0 || castingIndex > 0) {
StringBuffer buffer = new StringBuffer();
buffer.append("*(");
buffer.append("*("); //$NON-NLS-1$
buffer.append('(').append(fn).append(')');
if (castingIndex != 0) {
buffer.append('+').append(castingIndex);
@ -129,7 +130,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
fn = buffer.toString();
} else if (castingType != null && castingType.length() > 0) {
StringBuffer buffer = new StringBuffer();
buffer.append("((").append(castingType).append(')');
buffer.append("((").append(castingType).append(')'); //$NON-NLS-1$
buffer.append(fn).append(')');
fn = buffer.toString();
}
@ -185,13 +186,13 @@ public class VariableObject extends CObject implements ICDIVariableObject {
Session session = (Session) (target.getSession());
MISession mi = session.getMISession();
CommandFactory factory = mi.getCommandFactory();
String exp = "sizeof(" + getTypeName() + ")";
String exp = "sizeof(" + getTypeName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
MIDataEvaluateExpression evaluate = factory.createMIDataEvaluateExpression(exp);
try {
mi.postCommand(evaluate);
MIDataEvaluateExpressionInfo info = evaluate.getMIDataEvaluateExpressionInfo();
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();
} catch (MIException e) {
@ -244,7 +245,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
mi.postCommand(whatis);
MIWhatisInfo info = whatis.getMIWhatisInfo();
if (info == null) {
throw new CDIException("No answer");
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
typename = info.getType();
} catch (MIException e) {

View file

@ -19,7 +19,7 @@ public class Watchpoint extends Breakpoint implements ICDIWatchpoint {
String what;
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;
what = expression;
}

View file

@ -64,14 +64,14 @@ public abstract class FloatingPointValue extends Value implements ICDIFloatingPo
}
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) {
return (valueString != null) ? valueString.indexOf("-inf") != -1 : false;
return (valueString != null) ? valueString.indexOf("-inf") != -1 : false; //$NON-NLS-1$
}
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 {
String params = "";
String params = ""; //$NON-NLS-1$
public FunctionType(ICDITarget target, String typename) {
super(target, typename);

View file

@ -30,9 +30,9 @@ public class ReferenceValue extends DerivedValue implements ICDIReferenceValue {
public long referenceValue() throws CDIException {
long value = 0;
String valueString = getValueString().trim();
if ( valueString.startsWith("@") )
if ( valueString.startsWith("@") ) //$NON-NLS-1$
valueString = valueString.substring( 1 );
int space = valueString.indexOf(":");
int space = valueString.indexOf(":"); //$NON-NLS-1$
if (space != -1) {
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()
*/
public boolean isClass() {
return getDetailTypeName().startsWith("class");
return getDetailTypeName().startsWith("class"); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#isStruct()
*/
public boolean isStruct() {
return getDetailTypeName().startsWith("struct");
return getDetailTypeName().startsWith("struct"); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType#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 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 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);
// Overload the parameter
String[] newPaths = new String[paths.length + 1];
newPaths[0] = "environment";
newPaths[0] = "environment"; //$NON-NLS-1$
System.arraycopy(paths, 0, newPaths, 1, paths.length);
setParameters(newPaths);
}

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIOutput;
*/
public class MIGDBShowDirectories extends MIGDBShow {
public MIGDBShowDirectories() {
super(new String[] { "directories" });
super(new String[] { "directories" }); //$NON-NLS-1$
}
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 MIGDBShowSolibSearchPath() {
super(new String[] { "solib-search-path" });
super(new String[] { "solib-search-path" }); //$NON-NLS-1$
}
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 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 MIInfoProgram() {
super("info program");
super("info program"); //$NON-NLS-1$
}
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 MIInfoSharedLibrary() {
super("info sharedlibrary");
super("info sharedlibrary"); //$NON-NLS-1$
}
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 MIInfoSignals() {
super("info signals");
super("info signals"); //$NON-NLS-1$
}
public MIInfoSignals(String name) {
super("info signal " + name);
super("info signal " + name); //$NON-NLS-1$
}
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 MIInfoThreads() {
super("info threads");
super("info threads"); //$NON-NLS-1$
}
public MIInfoThreadsInfo getMIInfoThreadsInfo() throws MIException {

View file

@ -20,7 +20,7 @@ public class MIJump extends CLICommand {
MIOutput out;
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;
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 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 MIVarDelete(String name) {
super("-var-delete", new String[]{name});
super("-var-delete", new String[]{name}); //$NON-NLS-1$
}
public MIVarDeleteInfo getMIVarDeleteInfo() throws MIException {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -30,7 +30,7 @@ public class MILocationReachedEvent extends MIStoppedEvent {
public String toString() {
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();
if (f != null) {
buffer.append(f.toString());

View file

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

View file

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

View file

@ -31,7 +31,7 @@ public class MISteppingRangeEvent extends MIStoppedEvent {
public String toString() {
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();
if (f != null) {
buffer.append(getFrame().toString());

View file

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

View file

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

View file

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

View file

@ -80,7 +80,7 @@ public class MIConst extends MIValue {
} else if (c == 'f') {
s = "\f"; //$NON-NLS-1$
} 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') {
s = "\r"; //$NON-NLS-1$
} else if (c == 't') {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -25,12 +25,12 @@ public abstract class MIStreamRecord extends MIOOBRecord {
public String toString() {
if (this instanceof MIConsoleStreamOutput) {
return "~\"" + cstring + "\"\n"; //$NON-NLS-1$
return "~\"" + cstring + "\"\n"; //$NON-NLS-1$ //$NON-NLS-2$
} 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) {
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();
if (value instanceof MIConst) {
String str = ((MIConst)value).getString();
if ("binary".equals(str)) {
if ("binary".equals(str)) { //$NON-NLS-1$
format = MIFormat.BINARY;
} else if ("decimal".equals(str)) {
} else if ("decimal".equals(str)) { //$NON-NLS-1$
format = MIFormat.DECIMAL;
} else if ("hexadecimal".equals(str)) {
} else if ("hexadecimal".equals(str)) { //$NON-NLS-1$
format = MIFormat.HEXADECIMAL;
} else if ("octal".equals(str)) {
} else if ("octal".equals(str)) { //$NON-NLS-1$
format = MIFormat.OCTAL;
} else if ("natural".equals(str)) {
} else if ("natural".equals(str)) { //$NON-NLS-1$
format = MIFormat.NATURAL;
}
}

View file

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

View file

@ -55,7 +55,7 @@ public class CLIProcessor {
session.fireEvent(new MIBreakpointChangedEvent(0));
} else if (isSettingSignal(operation)) {
// 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)) {
// if it was a "detach" command change the state.
session.getMIInferior().setDisconnected();
@ -68,27 +68,27 @@ public class CLIProcessor {
int type = -1;
/* execution commands: n, next, s, step, si, stepi, u, until, finish,
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;
} 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;
} 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;
} 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;
} else if (operation.equals("u") ||
(operation.startsWith("unt") && "until".indexOf(operation) != -1)) {
} else if (operation.equals("u") || //$NON-NLS-1$
(operation.startsWith("unt") && "until".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
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;
} else if (operation.equals("c") || operation.equals("fg") ||
(operation.startsWith("cont") && "continue".indexOf(operation) != -1)) {
} else if (operation.equals("c") || operation.equals("fg") || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("cont") && "continue".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
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;
} 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;
} 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;
}
return type;
@ -98,11 +98,11 @@ public class CLIProcessor {
boolean isbreak = false;
/* breakpoints: b, break, hbreak, tbreak, rbreak, thbreak */
/* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */
if ((operation.startsWith("b") && "break".indexOf(operation) != -1) ||
(operation.startsWith("tb") && "tbreak".indexOf(operation) != -1) ||
(operation.startsWith("hb") && "hbreak".indexOf(operation) != -1) ||
(operation.startsWith("thb") && "thbreak".indexOf(operation) != -1) ||
(operation.startsWith("rb") && "rbreak".indexOf(operation) != -1)) {
if ((operation.startsWith("b") && "break".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("tb") && "tbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("hb") && "hbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("thb") && "thbreak".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("rb") && "rbreak".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
isbreak = true;
}
return isbreak;
@ -111,9 +111,9 @@ public class CLIProcessor {
boolean isSettingWatchpoint(String operation) {
boolean isWatch = false;
/* watchpoints: watch, rwatch, awatch, tbreak, rbreak, thbreak */
if ((operation.startsWith("wa") && "watch".indexOf(operation) != -1) ||
(operation.startsWith("rw") && "rwatch".indexOf(operation) != -1) ||
(operation.startsWith("aw") && "awatch".indexOf(operation) != -1)) {
if ((operation.startsWith("wa") && "watch".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("rw") && "rwatch".indexOf(operation) != -1) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("aw") && "awatch".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
isWatch = true;
}
return isWatch;
@ -122,8 +122,8 @@ public class CLIProcessor {
boolean isDeletingBreakpoint(String operation) {
boolean isDelete = false;
/* deleting breaks: clear, delete */
if ((operation.startsWith("cl") && "clear".indexOf(operation) != -1) ||
(operation.equals("d") || (operation.startsWith("del") && "delete".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))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
isDelete = true;
}
return isDelete;
@ -132,11 +132,11 @@ public class CLIProcessor {
boolean isChangeBreakpoint(String operation) {
boolean isChange = false;
/* changing breaks: enable, disable */
if ((operation.equals("dis") || operation.equals("disa") ||
(operation.startsWith("disa") && "disable".indexOf(operation) != -1)) ||
(operation.equals("en") || (operation.startsWith("en") && "enable".indexOf(operation) != -1)) ||
(operation.startsWith("ig") && "ignore".indexOf(operation) != -1) ||
(operation.startsWith("cond") && "condition".indexOf(operation) != -1)) {
if ((operation.equals("dis") || operation.equals("disa") || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("disa") && "disable".indexOf(operation) != -1)) || //$NON-NLS-1$ //$NON-NLS-2$
(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) || //$NON-NLS-1$ //$NON-NLS-2$
(operation.startsWith("cond") && "condition".indexOf(operation) != -1)) { //$NON-NLS-1$ //$NON-NLS-2$
isChange = true;
}
return isChange;
@ -145,7 +145,7 @@ public class CLIProcessor {
boolean isSettingSignal(String operation) {
boolean isChange = false;
/* 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;
}
return isChange;
@ -156,7 +156,7 @@ public class CLIProcessor {
* @return
*/
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);
}
} 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();
try {
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);
MIInfo info = set.getMIInfo();
if (info == null) {
throw new MIException("No answer");
throw new MIException(MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$
}
} catch (MIException e) {
// We ignore this exception, for example

View file

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

View file

@ -56,7 +56,7 @@ public class GDBDebugger implements ICDebugger {
manager.setSharedLibraryPaths(paths);
}
} 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;
boolean failed = false;
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();
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);
initializeLibraries(config, session);
return session;
} catch (IOException e) {
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) {
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) {
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 {
if (failed) {
if (session != null) {
@ -96,21 +96,21 @@ public class GDBDebugger implements ICDebugger {
Session session = null;
boolean failed = false;
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();
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);
initializeLibraries(config, session);
return session;
} catch (IOException e) {
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) {
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) {
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 {
if (failed) {
if (session != null) {
@ -128,21 +128,21 @@ public class GDBDebugger implements ICDebugger {
Session session = null;
boolean failed = false;
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();
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);
initializeLibraries(config, session);
return session;
} catch (IOException e) {
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) {
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) {
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 {
if (failed) {
if (session != null) {

View file

@ -51,7 +51,7 @@ public class GDBServerDebugger implements ICDebugger {
mgr.setSharedLibraryPaths(paths);
}
} 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;
boolean failed = false;
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();
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)) {
String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_HOST, "invalid");
remote += ":";
remote += ":"; //$NON-NLS-1$
remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid");
String[] args = new String[] {"remote", remote};
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);
MISession miSession = session.getMISession();
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
miSession.postCommand(setRemoteBaud, launchTimeout);
MIInfo info = setRemoteBaud.getMIInfo();
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});
miSession.postCommand(select, launchTimeout);
select.getMIInfo();
if (info == null) {
throw new MIException ("No answer");
throw new MIException (MIPlugin.getResourceString("src.common.No_answer")); //$NON-NLS-1$
}
}
initializeLibraries(config, session);
return session;
} catch (IOException e) {
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) {
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) {
failed = true;
throw new CDIException("Error initializing: " + e.getMessage());
throw new CDIException(MIPlugin.getResourceString("src.GDBServerDebugger.Error_initializing") + e.getMessage()); //$NON-NLS-1$
} finally {
if (failed) {
if (session != null) {
@ -117,10 +117,10 @@ public class GDBServerDebugger implements ICDebugger {
}
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 {
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.
line = s;
index = 0;
token = "";
dataType = "";
name = "";
token = ""; //$NON-NLS-1$
dataType = ""; //$NON-NLS-1$
name = ""; //$NON-NLS-1$
gdbDerivedType = null;
// Fetch the datatype.
while (getToken() == NAME) {
dataType += " " + token;
dataType += " " + token; //$NON-NLS-1$
}
// Hack for GDB, the typename can be something like
@ -97,7 +97,7 @@ public class GDBTypeParser {
}
public GDBType(int t) {
this("", t);
this("", t); //$NON-NLS-1$
}
GDBType(String n, int t) {
@ -151,23 +151,23 @@ public class GDBTypeParser {
public String toString() {
StringBuffer sb = new StringBuffer();
String childTypeName = (hasChild() ? child.toString() : "");
String childTypeName = (hasChild() ? child.toString() : ""); //$NON-NLS-1$
sb.append(childTypeName);
switch (getType()) {
case FUNCTION :
sb.append("()");
sb.append("()"); //$NON-NLS-1$
//sb.append(" function returning " + (hasChild() ? child.toString() : ""));
break;
case ARRAY :
sb.append("[" + dimension + "]");
sb.append("[" + dimension + "]"); //$NON-NLS-1$ //$NON-NLS-2$
//sb.append(" array[" + dimension + "]" + " of " + (hasChild() ? child.toString() : ""));
break;
case REFERENCE :
sb.append("&");
sb.append("&"); //$NON-NLS-1$
//sb.append(" reference to " + (hasChild() ? child.toString() : ""));
break;
case POINTER :
sb.append("*");
sb.append("*"); //$NON-NLS-1$
//sb.append(" pointer to " + (hasChild() ? child.toString() : ""));
break;
}
@ -178,16 +178,16 @@ public class GDBTypeParser {
StringBuffer sb = new StringBuffer();
switch (getType()) {
case FUNCTION :
sb.append(" function returning " + (hasChild() ? child.verbose() : ""));
sb.append(" function returning " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$
break;
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;
case REFERENCE :
sb.append(" reference to " + (hasChild() ? child.verbose() : ""));
sb.append(" reference to " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$
break;
case POINTER :
sb.append(" pointer to " + (hasChild() ? child.verbose() : ""));
sb.append(" pointer to " + (hasChild() ? child.verbose() : "")); //$NON-NLS-2$
break;
}
return sb.toString();
@ -247,7 +247,7 @@ public class GDBTypeParser {
// method returns the next token
int getToken() {
token = "";
token = ""; //$NON-NLS-1$
int c = getch();
@ -260,7 +260,7 @@ public class GDBTypeParser {
if (c == '(') {
if ((c = getch()) == ')') {
token = "()";
token = "()"; //$NON-NLS-1$
tokenType = PARENS;
} else {
ungetch();
@ -272,7 +272,7 @@ public class GDBTypeParser {
}
tokenType = BRACKETS;
} else if (isCIdentifierStart(c)) {
token = "" + (char) c;
token = "" + (char) c; //$NON-NLS-1$
while (isCIdentifierPart((c = getch())) && c != EOF) {
token += (char) c;
}
@ -336,7 +336,7 @@ public class GDBTypeParser {
}
} else if (tokenType == NAME) {
// Useless we do not need the name of the variable
name = " " + token;
name = " " + token; //$NON-NLS-1$
} else if (tokenType == PARENS) {
prependChild(GDBType.FUNCTION);
} else if (tokenType == BRACKETS) {
@ -376,40 +376,40 @@ public class GDBTypeParser {
GDBTypeParser parser = new GDBTypeParser();
System.out.println("struct link { int i; int j; struct link * next} *");
parser.parse("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} *"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("char **argv");
parser.parse("unsigned long long int **argv");
System.out.println("char **argv"); //$NON-NLS-1$
parser.parse("unsigned long long int **argv"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("int (*daytab)[13]");
parser.parse("int (*daytab)[13]");
System.out.println("int (*daytab)[13]"); //$NON-NLS-1$
parser.parse("int (*daytab)[13]"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("int *daytab[13]");
parser.parse("int *daytab[13]");
System.out.println("int *daytab[13]"); //$NON-NLS-1$
parser.parse("int *daytab[13]"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("void *comp()");
parser.parse("void *comp()");
System.out.println("void *comp()"); //$NON-NLS-1$
parser.parse("void *comp()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("void (*comp)()");
parser.parse("void (*comp)()");
System.out.println("void (*comp)()"); //$NON-NLS-1$
parser.parse("void (*comp)()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("int (*func[15])()");
parser.parse("int (*func[15])()");
System.out.println("int (*func[15])()"); //$NON-NLS-1$
parser.parse("int (*func[15])()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("char (*(*x())[])()");
parser.parse("char (*(*x())[])()");
System.out.println("char (*(*x())[])()"); //$NON-NLS-1$
parser.parse("char (*(*x())[])()"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
System.out.println("char (*(*x[3])())[5]");
parser.parse("char (*(*x[3])())[5]");
System.out.println("char (*(*x[3])())[5]"); //$NON-NLS-1$
parser.parse("char (*(*x[3])())[5]"); //$NON-NLS-1$
System.out.println(parser.getGDBType().verbose());
}
}

View file

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

View file

@ -66,11 +66,11 @@ public class MIInferior extends Process {
StringBuffer buf = new StringBuffer();
public void write(int b) throws IOException {
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();
if (channel == null) {
throw new IOException("No MI Session");
throw new IOException(MIPlugin.getResourceString("src.MIInferior.No_session")); //$NON-NLS-1$
}
channel.write(b);
}
@ -214,7 +214,7 @@ public class MIInferior extends Process {
// If we've failed throw an exception up.
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.Reader;
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.mi.core.cdi.Session;
@ -42,11 +44,19 @@ public class MIPlugin extends Plugin {
private static MIPlugin plugin;
// GDB init command file
private static final String GDBINIT = ".gdbinit";
private static final String GDBINIT = ".gdbinit"; //$NON-NLS-1$
// 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
* @see org.eclipse.core.runtime.Plugin#Plugin(IPluginDescriptor)
@ -153,15 +163,15 @@ public class MIPlugin extends Plugin {
String[] args;
if (pty != 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 {
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 {
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 {
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"
// and set the state to be suspended.
try {
CLICommand cmd = new CLICommand("info remote-process");
CLICommand cmd = new CLICommand("info remote-process"); //$NON-NLS-1$
session.postCommand(cmd);
MIInfo info = cmd.getMIInfo();
if (info == null) {
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
session.getMIInferior().setSuspended();
@ -212,9 +222,9 @@ public class MIPlugin extends Plugin {
String[] args;
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 {
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);
MISession session;
@ -245,9 +255,9 @@ public class MIPlugin extends Plugin {
String[] args;
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 {
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);
MISession session;
@ -264,7 +274,7 @@ public class MIPlugin extends Plugin {
session.postCommand(target);
MIInfo info = target.getMIInfo();
if (info == null) {
throw new MIException("No answer");
throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
}
}
if (pid > 0) {
@ -272,7 +282,7 @@ public class MIPlugin extends Plugin {
session.postCommand(attach);
MIInfo info = attach.getMIInfo();
if (info == null) {
throw new MIException("No answer");
throw new MIException(getResourceString("src.common.No_answer")); //$NON-NLS-1$
}
session.getMIInferior().setInferiorPID(pid);
}
@ -302,7 +312,7 @@ public class MIPlugin extends Plugin {
public void debugLog(String message) {
if (getDefault().isDebugging()) {
// 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.
// getDefault().getLog().log(StatusUtil.newStatus(Status.ERROR, message, null));
// ALERT:FIXME: For example for big buffers say 4k length,
@ -312,16 +322,24 @@ public class MIPlugin extends Plugin {
while (message.length() > 100) {
String partial = message.substring(0, 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);
} else {
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
* for whatever reasons.
@ -341,7 +359,7 @@ public class MIPlugin extends Plugin {
getDefault().debugLog( sb.toString() );
}
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() {
try {
String line;
@ -351,7 +369,7 @@ public class MIPlugin extends Plugin {
while ((line = reader.readLine()) != null) {
line = line.trim();
//System.out.println("GDB " + line);
if (line.endsWith("(gdb)")) {
if (line.endsWith("(gdb)")) { //$NON-NLS-1$
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.
}
if (line == null) {
line = "Process Terminated";
line = MIPlugin.getResourceString("src.MISession.Process_Terminated"); //$NON-NLS-1$
}
throw new MIException(line);
} catch (IllegalThreadStateException e) {
@ -138,15 +138,15 @@ public class MISession extends Observable {
// Like confirmation and screen size.
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);
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);
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);
confirm.getMIInfo();
@ -291,7 +291,7 @@ public class MISession extends Observable {
// Test if we are in a sane state.
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?
@ -299,12 +299,12 @@ public class MISession extends Observable {
// REMINDER: if we support -exec-interrupt
// Let it throught:
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()) {
throw new MIException("Session terminated");
throw new MIException(MIPlugin.getResourceString("src.MISession.Session_terminated")); //$NON-NLS-1$
}
// TRACING: print the command;
@ -320,7 +320,7 @@ public class MISession extends Observable {
try {
cmd.wait(timeout);
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) {
}

View file

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

View file

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