Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 168092 Details for
Bug 237306
[multicore][multi-process] Support for Multi-Process debugging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Multi process Debug DSF
patch12052010.txt (text/plain), 24.74 KB, created by
Onur Akdemir
on 2010-05-12 04:01:05 EDT
(
hide
)
Description:
Multi process Debug DSF
Filename:
MIME Type:
Creator:
Onur Akdemir
Created:
2010-05-12 04:01:05 EDT
Size:
24.74 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java,v >retrieving revision 1.20 >diff -u -r1.20 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 29 Apr 2010 19:17:18 -0000 1.20 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 12 May 2010 07:54:42 -0000 >@@ -374,17 +374,17 @@ > /** > * A map of thread id to thread group id. We use this to find out to which threadGroup a thread belongs. > */ >- private Map<String, String> fThreadToGroupMap = new HashMap<String, String>(); >+ protected Map<String, String> fThreadToGroupMap = new HashMap<String, String>(); > >- private IGDBControl fCommandControl; >- private IGDBBackend fBackend; >- private CommandFactory fCommandFactory; >+ protected IGDBControl fCommandControl; >+ protected IGDBBackend fBackend; >+ protected CommandFactory fCommandFactory; > > // A cache for commands about the threadGroups >- private CommandCache fContainerCommandCache; >+ protected CommandCache fContainerCommandCache; > > //A cache for commands about the threads >- private CommandCache fThreadCommandCache; >+ protected CommandCache fThreadCommandCache; > > // A temporary cache to avoid using -list-thread-groups --available more than once at the same time. > // We cannot cache this command because it lists all available processes, which can >@@ -392,7 +392,7 @@ > // the same time. This cache will help us avoid that. The idea is that we cache the command, > // but as soon as it returns, we clear the cache. So the cache will only trigger for those > // overlapping situations. >- private CommandCache fListThreadGroupsAvailableCache; >+ protected CommandCache fListThreadGroupsAvailableCache; > > // A map of process id to process names. A name is fetched whenever we start > // debugging a process, and removed when we stop. >@@ -401,7 +401,7 @@ > // This map also serves as a list of processes we are currently debugging. > // This is important because we cannot always ask GDB for the list, since it may > // be running at the time. Bug 303503 >- private Map<String, String> fDebuggedProcessesAndNames = new HashMap<String, String>(); >+ protected Map<String, String> fDebuggedProcessesAndNames = new HashMap<String, String>(); > > private static final String FAKE_THREAD_ID = "0"; //$NON-NLS-1$ > >@@ -463,16 +463,20 @@ > fCommandControl.addEventListener(this); > > // Register this service. >+ registerProcService(); >+ >+ requestMonitor.done(); >+ } >+ >+ // Register this service. New procservices needs to override this method >+ protected void registerProcService(){ > register(new String[] { IProcesses.class.getName(), > IMIProcesses.class.getName(), > IGDBProcesses.class.getName(), > GDBProcesses_7_0.class.getName() }, > new Hashtable<String, String>()); >- >- requestMonitor.done(); > } > >- > /** > * This method shuts down this service. It unregisters the service, stops > * receiving service events, and calls the superclass shutdown() method to >@@ -573,9 +577,11 @@ > } else { > name = fDebuggedProcessesAndNames.get(id); > if (name == null) { >+ name = "New Inferior"; //$NON-NLS-1$ >+ id = "null"; > // We don't have the name in our map. Should not happen. >- name = "Unknown name"; //$NON-NLS-1$ >- assert false : "Don't have entry for process ID: " + id; //$NON-NLS-1$ >+ //name = "Unknown name"; //$NON-NLS-1$ >+ //assert false : "Don't have entry for process ID: " + id; //$NON-NLS-1$ > } else if (name.length() == 0) { > // Probably will not happen, but just in case...use the > // binary file name (absolute path) >@@ -761,7 +767,7 @@ > } > } > >- private IExecutionDMContext[] makeExecutionDMCs(IContainerDMContext containerDmc, MIThread[] threadInfos) { >+ protected IExecutionDMContext[] makeExecutionDMCs(IContainerDMContext containerDmc, MIThread[] threadInfos) { > final IProcessDMContext procDmc = DMContexts.getAncestorOfType(containerDmc, IProcessDMContext.class); > > if (threadInfos.length == 0) { >@@ -784,7 +790,7 @@ > } > } > >- private IMIContainerDMContext[] makeContainerDMCs(ICommandControlDMContext controlDmc, IThreadGroupInfo[] groups) { >+ protected IMIContainerDMContext[] makeContainerDMCs(ICommandControlDMContext controlDmc, IThreadGroupInfo[] groups) { > // This is a workaround for post-mortem tracing because the early GDB release > // does not report a process when we do -list-thread-group > // GDB 7.2 will properly report the process so this >Index: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java >diff -N src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,173 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+ >+package org.eclipse.cdt.dsf.gdb.service; >+ >+import java.util.Hashtable; >+import java.util.Map; >+ >+import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; >+import org.eclipse.cdt.dsf.datamodel.DMContexts; >+import org.eclipse.cdt.dsf.datamodel.IDMContext; >+import org.eclipse.cdt.dsf.debug.service.IProcesses; >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; >+import org.eclipse.cdt.dsf.gdb.service.command.GDBControlDMContext; >+import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; >+import org.eclipse.cdt.dsf.mi.service.IMIProcesses; >+import org.eclipse.cdt.dsf.mi.service.command.output.CLIInfoInferiorsInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIListThreadGroupsInfo; >+import org.eclipse.cdt.dsf.service.DsfSession; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Status; >+ >+public class GDBProcesses_7_1 extends GDBProcesses_7_0 { >+ >+ public GDBProcesses_7_1(DsfSession session) { >+ super(session); >+ // TODO Auto-generated constructor stub >+ } >+ >+ >+ @Override >+ protected void registerProcService() { >+ register(new String[] { IProcesses.class.getName(), >+ IMIProcesses.class.getName(), >+ IGDBProcesses.class.getName(), >+ GDBProcesses_7_1.class.getName() }, >+ new Hashtable<String, String>()); >+ } >+ >+ public boolean doIsRunNewProcessSupported() { >+ return true; >+ } >+ >+ @Override >+ public void isRunNewProcessSupported(IDMContext dmc, >+ DataRequestMonitor<Boolean> rm) { >+ rm.setData(true); >+ rm.done(); >+ } >+ >+ @Override >+ public void runNewProcess(IDMContext dmc, String file, >+ Map<String, Object> attributes, >+ DataRequestMonitor<IProcessDMContext> rm) { >+ final DataRequestMonitor<IProcessDMContext> requestMonitor = rm; >+ >+ if (dmc instanceof GDBControlDMContext) { >+ >+ if ( !doIsRunNewProcessSupported() ) { >+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Multi-process debug not supported.", null)); //$NON-NLS-1$ >+ requestMonitor.done(); >+ return; >+ } >+ >+ final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); >+ fCommandControl.queueCommand( >+ fCommandFactory.createCLIAddInferior( controlDmc ), >+ new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) { >+ @Override >+ protected void handleSuccess() { >+ IMIProcesses procService = getServicesTracker().getService(IMIProcesses.class); >+ if (procService != null) { >+ IProcessDMContext procDmc = procService.createProcessContext(controlDmc, null); >+ IMIContainerDMContext containerDmc = createContainerContext(procDmc, null); >+ getSession().dispatchEvent(new ContainerStartedDMEvent(containerDmc), getProperties()); >+ requestMonitor.setData(procDmc); >+ } >+ >+ requestMonitor.done(); >+ } >+ }); >+ >+ } else { >+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid process context.", null)); //$NON-NLS-1$ >+ requestMonitor.done(); >+ } >+ >+ } >+ >+ /* >+ * Selects active inferior >+ * Every process has an address space . Besides one address space may have multiple processes >+ * This is not supported now!!! >+ */ >+ public void selectActiveInferior(IDMContext dmc, int inferiorNo , >+ DataRequestMonitor<IProcessDMContext> rm) { >+ final DataRequestMonitor<IProcessDMContext> requestMonitor = rm; >+ >+ if (dmc instanceof GDBControlDMContext) { >+ >+ if ( !doIsRunNewProcessSupported() ) { >+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Multi-process debug not supported.", null)); //$NON-NLS-1$ >+ requestMonitor.done(); >+ return; >+ } >+ >+ final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); >+ fCommandControl.queueCommand( >+ fCommandFactory.createCLISelectInferior( controlDmc , inferiorNo ), >+ new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) { >+ @Override >+ protected void handleSuccess() { >+ System.out.println("Active inferior changed"); >+ requestMonitor.done(); >+ } >+ }); >+ >+ } else { >+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid process context.", null)); //$NON-NLS-1$ >+ requestMonitor.done(); >+ } >+ >+ } >+ >+ @Override >+ public void getProcessesBeingDebugged(final IDMContext dmc, final DataRequestMonitor<IDMContext[]> rm) { >+ final ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); >+ final IMIContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IMIContainerDMContext.class); >+ if (containerDmc != null) { >+ fThreadCommandCache.execute( >+ fCommandFactory.createMIListThreadGroups(controlDmc, containerDmc.getGroupId()), >+ new DataRequestMonitor<MIListThreadGroupsInfo>(getExecutor(), rm) { >+ @Override >+ protected void handleSuccess() { >+ rm.setData(makeExecutionDMCs(containerDmc, getData().getThreadInfo().getThreadList())); >+ rm.done(); >+ } >+ }); >+ } else { >+ fContainerCommandCache.execute( >+ fCommandFactory.createCLIInfoInferiors(controlDmc,null), >+ new DataRequestMonitor<CLIInfoInferiorsInfo>(getExecutor(), rm) { >+ @Override >+ protected void handleSuccess() { >+ rm.setData(makeContainerDMCs(controlDmc, getData().getGroupList())); >+ rm.done(); >+ } >+ @Override >+ protected void handleFailure() { >+ // If the target is not available, generate the list ourselves >+ IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[fDebuggedProcessesAndNames.size()]; >+ int i = 0; >+ for (String groupId : fDebuggedProcessesAndNames.keySet()) { >+ IProcessDMContext processDmc = createProcessContext(controlDmc, groupId); >+ containerDmcs[i++] = createContainerContext(processDmc, groupId); >+ } >+ rm.setData(containerDmcs); >+ rm.done(); >+ } >+ }); >+ } >+ } >+} >Index: src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java,v >retrieving revision 1.11 >diff -u -r1.11 GdbDebugServicesFactory.java >--- src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java 28 Apr 2010 23:50:48 -0000 1.11 >+++ src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java 12 May 2010 07:54:43 -0000 >@@ -45,6 +45,7 @@ > // This should eventually be "7.0" once GDB 7.0 is released > private static final String GDB_7_0_VERSION = "6.8.50.20090218"; //$NON-NLS-1$ > private static final String GDB_7_2_VERSION = "7.1.50"; //$NON-NLS-1$ >+ private static final String GDB_7_1_VERSION = "7.1"; //$NON-NLS-1$ > > private final String fVersion; > >@@ -133,7 +134,9 @@ > > @Override > protected IProcesses createProcessesService(DsfSession session) { >- if (GDB_7_0_VERSION.compareTo(fVersion) <= 0) { >+ if (GDB_7_1_VERSION.compareTo(fVersion) <= 0) { >+ return new GDBProcesses_7_1(session); >+ }else if (GDB_7_0_VERSION.compareTo(fVersion) <= 0) { > return new GDBProcesses_7_0(session); > } > return new GDBProcesses(session); >Index: src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java,v >retrieving revision 1.7 >diff -u -r1.7 CommandFactory.java >--- src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java 3 May 2010 15:20:04 -0000 1.7 >+++ src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java 12 May 2010 07:54:44 -0000 >@@ -39,6 +39,9 @@ > import org.eclipse.cdt.dsf.mi.service.command.commands.CLIThread; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLITrace; > import org.eclipse.cdt.dsf.mi.service.command.commands.CLIUnsetEnv; >+import org.eclipse.cdt.dsf.mi.service.command.commands.CLIInfoInferior; >+import org.eclipse.cdt.dsf.mi.service.command.commands.CLISelectActivateInferior; >+import org.eclipse.cdt.dsf.mi.service.command.commands.CLIAddInferior; > import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakAfter; > import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakCommands; > import org.eclipse.cdt.dsf.mi.service.command.commands.MIBreakCondition; >@@ -130,6 +133,7 @@ > import org.eclipse.cdt.dsf.mi.service.command.output.CLIInfoThreadsInfo; > import org.eclipse.cdt.dsf.mi.service.command.output.CLIThreadInfo; > import org.eclipse.cdt.dsf.mi.service.command.output.CLITraceInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.CLIInfoInferiorsInfo; > import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo; > import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakListInfo; > import org.eclipse.cdt.dsf.mi.service.command.output.MIDataDisassembleInfo; >@@ -182,6 +186,10 @@ > return new CLIAttach(ctx, pid); > } > >+ public ICommand<MIInfo> createCLIAddInferior(ICommandControlDMContext ctx) { >+ return new CLIAddInferior(ctx); >+ } >+ > public ICommand<CLICatchInfo> createCLICatch(IBreakpointsTargetDMContext ctx, String event, String[] args) { > return new CLICatch(ctx, event, args); > } >@@ -218,6 +226,14 @@ > return new CLIRecord(ctx, enable); > } > >+ public ICommand<MIInfo> createCLISelectInferior(ICommandControlDMContext ctx , int inferiorNo) { >+ return new CLISelectActivateInferior(ctx,inferiorNo); >+ } >+ >+ public ICommand<CLIInfoInferiorsInfo> createCLIInfoInferiors(ICommandControlDMContext ctx, String groupId) { >+ return new CLIInfoInferior(ctx);//TODO MIListThreadGroups(ctx, groupId); >+ } >+ > public ICommand<MIInfo> createCLISource(ICommandControlDMContext ctx, String file) { > return new CLISource(ctx, file); > } >Index: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java >diff -N src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIAddInferior.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.mi.service.command.commands; >+ >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >+ >+/** >+ * This command adds a new - null inferior >+ * TODO Native interface may change. >+ */ >+public class CLIAddInferior extends CLICommand<MIInfo> { >+ >+ public CLIAddInferior(ICommandControlDMContext ctx) { >+ super(ctx, "add-inferior"); //$NON-NLS-1$ >+ } >+ >+} >Index: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIInfoInferior.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIInfoInferior.java >diff -N src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIInfoInferior.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/mi/service/command/commands/CLIInfoInferior.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,40 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.mi.service.command.commands; >+ >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.mi.service.command.output.CLIInfoInferiorsInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIOutput; >+ >+/** >+ * This command adds a new - null inferior >+ * TODO Native interface may change. >+ */ >+public class CLIInfoInferior extends CLICommand<CLIInfoInferiorsInfo> { >+ >+ public CLIInfoInferior(ICommandControlDMContext ctx) { >+ super(ctx, "info inferior"); //$NON-NLS-1$ >+ } >+ >+ @Override >+ public CLIInfoInferiorsInfo getResult(MIOutput output) { >+ return (CLIInfoInferiorsInfo)getMIInfo(output); >+ } >+ >+ public MIInfo getMIInfo(MIOutput out) { >+ MIInfo info = null; >+ if (out != null) { >+ info = new CLIInfoInferiorsInfo(out); >+ } >+ return info; >+ } >+} >Index: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLISelectActivateInferior.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/mi/service/command/commands/CLISelectActivateInferior.java >diff -N src/org/eclipse/cdt/dsf/mi/service/command/commands/CLISelectActivateInferior.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/mi/service/command/commands/CLISelectActivateInferior.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.mi.service.command.commands; >+ >+import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; >+ >+/** >+ * This command adds a new - null inferior >+ * TODO Native interface may change. >+ */ >+public class CLISelectActivateInferior extends CLICommand<MIInfo> { >+ >+ public CLISelectActivateInferior(ICommandControlDMContext ctx , int inferiorNo) { >+ super(ctx, "inferior"+inferiorNo); //$NON-NLS-1$ >+ } >+ >+} >Index: src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoInferiorsInfo.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoInferiorsInfo.java >diff -N src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoInferiorsInfo.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoInferiorsInfo.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,125 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 TUBITAK-UEKAE-BTE and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * TUBITAK-UEKAE-BTE - GDB_7_1 support >+ *******************************************************************************/ >+ >+package org.eclipse.cdt.dsf.mi.service.command.output; >+ >+import java.util.Scanner; >+ >+import org.eclipse.cdt.dsf.concurrent.Immutable; >+import org.eclipse.cdt.dsf.mi.service.command.output.MIListThreadGroupsInfo.IThreadGroupInfo; >+ >+/** >+ * (org.eclipse.cdt.dsf.mi.service.command.output.CLIInfoInferiorsInfo) &"info inferior\n" >+~" Num Description Executable \n" >+~"* 1 <null> /home/onur/runtime-EclipseApplication/helloworks/Debug/helloworks \n" >+7^done >+* >+* >+* >+&"info inferiors\n" >+~" Num Description Executable \n" >+~" 2 <null> \n" >+~"* 1 process 1562 \n" >+ >+*/ >+public class CLIInfoInferiorsInfo extends MIInfo { >+ >+ @Immutable >+ private static class ThreadGroupInfo implements IThreadGroupInfo { >+ final String fGroupId; >+ final String fDescription; >+ final String fName; >+ >+ public ThreadGroupInfo(String id, String executable) { >+ fGroupId = id; >+ fDescription = executable; >+ fName = executable; >+ //fName = parseName(fDescription,fGroupId); >+ } >+ /* >+ private static String parseName(String desc , String groupId) { >+ String name = ""; >+ if ( desc.equals(" ") || desc.equals(null)){ >+ name = "Inferior" + groupId; >+ }else{ >+ // "/usr/sbin/dhcdbd --system" >+ name = desc.split("\\s", 2)[0]; //$NON-NLS-1$ >+ } >+ >+ return name; >+ } >+ */ >+ >+ public String getGroupId() { return fGroupId; } >+ public String getPid() { return fGroupId; } >+ >+ public String getName() { return fName; } >+ >+ public String getDesciption() { return fDescription; } >+ } >+ >+ >+ private IThreadGroupInfo[] fGroupList; >+ >+ public CLIInfoInferiorsInfo(MIOutput out) { >+ super(out); >+ parse(); >+ } >+ >+ public IThreadGroupInfo[] getGroupList() { return fGroupList; } >+ >+ protected void parse() { >+ if (isDone()) { >+ MIOutput out = getMIOutput(); >+ MIOOBRecord[] oobs = out.getMIOOBRecords(); >+ fGroupList = new IThreadGroupInfo[oobs.length - 2]; >+ for (int i = 0; i < oobs.length; i++) { >+ if (oobs[i] instanceof MIConsoleStreamOutput) { >+ MIStreamRecord cons = (MIStreamRecord) oobs[i]; >+ String str = cons.getString(); // * 1 <null> >+ parseGroups(str , i-2); >+ } >+ } >+ } >+ if (fGroupList == null) { >+ fGroupList = new IThreadGroupInfo[0]; >+ } >+ } >+ public boolean isCurrentThread; >+ private void parseGroups(String str , int index ) { >+ if(str.length() > 0 ){ >+ if (str.charAt(2) != 'N') { >+ Scanner scanner = new Scanner(str); >+ //TODO Birden fazla bosluk icin >+ scanner.useDelimiter(" "); >+ if ( scanner.hasNext() ){ >+ String currThread = scanner.next(); >+ if ( currThread.equals("*")){ >+ isCurrentThread = true; >+ }else{ >+ isCurrentThread = false; >+ } >+ String sGdbId = scanner.next(); >+ String sType = scanner.next(); >+ String sPid = scanner.next(); >+ String sExecutableName = scanner.next(); >+ if(sType.equals(null) || sType.equals(" ") || sType.equals("")){ >+ sExecutableName = "Inferior" + sGdbId; >+ } >+ >+ fGroupList[index] = new ThreadGroupInfo(sGdbId, sExecutableName); >+ } >+ scanner.close(); >+ } >+ } >+ } >+} >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 237306
:
166478
|
167440
|
168092
|
168093
|
168510
|
176501
|
178929
|
179595
|
179596
|
179913
|
182593
|
184318
|
185285
|
185617
|
185691
|
186266
|
187326
|
187357
|
190931
|
190997