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 173147 Details for
Bug 311965
[launch] Remote attach launch does not work with GDB 7.1
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]
Fix for 7.0.1
zpatch.txt (text/plain), 7.18 KB, created by
Marc Khouzam
on 2010-06-30 15:08:08 EDT
(
hide
)
Description:
Fix for 7.0.1
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2010-06-30 15:08:08 EDT
Size:
7.18 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.21 >diff -u -r1.21 GDBProcesses_7_0.java >--- src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 3 Jun 2010 00:09:37 -0000 1.21 >+++ src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java 30 Jun 2010 19:03:58 -0000 >@@ -797,13 +797,24 @@ > } > // END OF WORKAROUND to be removed when GDB 7.2 is available > >- IMIContainerDMContext[] containerDmcs = new IMIContainerDMContext[groups.length]; >- for (int i = 0; i < groups.length; i++) { >- String groupId = groups[i].getGroupId(); >+ // With GDB 7.1, we can receive a bogus process when we are not debugging anything >+ // -list-thread-groups >+ // ^done,groups=[{id="0",type="process",pid="0"}] >+ // As for GDB 7.2, the pid field is missing altogether in this case >+ // -list-thread-groups >+ // ^done,groups=[{id="i1",type="process"}] >+ // Just ignore that entry >+ List<IMIContainerDMContext> containerDmcs = new ArrayList<IMIContainerDMContext>(groups.length); >+ for (IThreadGroupInfo group : groups) { >+ if (group.getPid() == null || >+ group.getPid().equals("") || group.getPid().equals("0")) { //$NON-NLS-1$ //$NON-NLS-2$ >+ continue; >+ } >+ String groupId = group.getGroupId(); > IProcessDMContext procDmc = createProcessContext(controlDmc, groupId); >- containerDmcs[i] = createContainerContext(procDmc, groupId); >+ containerDmcs.add(createContainerContext(procDmc, groupId)); > } >- return containerDmcs; >+ return containerDmcs.toArray(new IMIContainerDMContext[containerDmcs.size()]); > } > > public void getRunningProcesses(final IDMContext dmc, final DataRequestMonitor<IProcessDMContext[]> rm) { >Index: src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java,v >retrieving revision 1.4 >diff -u -r1.4 MIListThreadGroupsInfo.java >--- src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java 3 Jun 2010 00:09:36 -0000 1.4 >+++ src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java 30 Jun 2010 19:03:58 -0000 >@@ -34,6 +34,57 @@ > * list-thread-groups GROUPID, in the case of a running thread or a stopped thread: > * ^done,threads=[{id="1",target-id="Thread 162.32942",details="JUnitProcess_PT (Ready) 1030373359 44441",frame={level="0",addr="0x00000000",func="??",args=[]},state="stopped"}] > * ^done,threads=[{id="1",target-id="Thread 162.32942",details="JUnitProcess_PT Idle 981333916 42692",state="running"}] >+ * >+ * Example of outputs by version on Linux >+ * >+ * GDB 7.0 >+ * >+ * (when no inferior is running) >+ * -list-thread-groups >+ * ^done,groups=[] >+ * >+ * (with an inferior running) >+ * -list-thread-groups >+ * ^done,groups=[{id="19386",type="process",pid="19386"}] >+ * >+ * -list-thread-groups 19386 >+ * ^done,threads=[{id="1",target-id="process 19386",frame={level="0",addr="0x08048618",func="main",args=[],file="a.cc",fullname="/local/lmckhou/testing/a.cc",line="9"},state="stopped"}] >+ * >+ * -list-thread-groups --available >+ * ^done,groups=[{id="19371",type="process",description="gdb.7.0 -i mi testing/a.out",user="lmckhou"},{id="19386",type="process",description="/local/lmckhou/testing/a.out",user="lmckhou"},{id="19413",type="process",description="sleep 5",user="lmckhou"}] >+ * >+ * GDB 7.1 >+ * >+ * (when no inferior is running) >+ * -list-thread-groups >+ * ^done,groups=[{id="0",type="process",pid="0"}] >+ * >+ * (with an inferior running) >+ * -list-thread-groups >+ * ^done,groups=[{id="19424",type="process",pid="19424",cores=["3"]}] >+ * >+ * -list-thread-groups 19424 >+ * ^done,threads=[{id="1",target-id="process 19424",frame={level="0",addr="0x08048618",func="main",args=[],file="a.cc",fullname="/local/lmckhou/testing/a.cc",line="9"},state="stopped",core="3"}] >+ * >+ * -list-thread-groups --available >+ * ^done,groups=[{id="19418",type="process",description="gdb.7.1 -i mi testing/a.out",user="lmckhou"},{id="19424",type="process",description="/local/lmckhou/testing/a.out",user="lmckhou"},{id="19438",type="process",description="sleep 5",user="lmckhou"}] >+ * >+ * GDB 7.2 >+ * >+ * (when no inferior is running) >+ * -list-thread-groups >+ * ^done,groups=[{id="i1",type="process",executable="/local/lmckhou/testing/a.out"}] >+ * >+ * (with an inferior running) >+ * -list-thread-groups >+ * ^done,groups=[{id="i1",type="process",pid="19451",executable="/local/lmckhou/testing/a.out",cores=["2"]}] >+ * >+ * -list-thread-groups i1 >+ * ^done,threads=[{id="1",target-id="process 19451",frame={level="0",addr="0x08048618",func="main",args=[],file="a.cc",fullname="/local/lmckhou/testing/a.cc",line="9"},state="stopped",core="2"}] >+ * >+ * -list-thread-groups --available >+ * ^done,groups=[{id="19445",type="process",description="gdb.7.2 -i mi testing/a.out",user="lmckhou"},{id="19451",type="process",description="/local/lmckhou/testing/a.out",user="lmckhou"},{id="19462",type="process",description="sleep 5",user="lmckhou"}] >+ * > * @since 1.1 > */ > public class MIListThreadGroupsInfo extends MIInfo { >@@ -50,10 +101,12 @@ > final String fGroupId; > final String fDescription; > final String fName; >+ final String fPid; > >- public ThreadGroupInfo(String id, String description) { >+ public ThreadGroupInfo(String id, String description, String pid) { > fGroupId = id; > fDescription = description; >+ fPid = pid; > > fName = parseName(fDescription); > } >@@ -77,7 +130,7 @@ > } > > public String getGroupId() { return fGroupId; } >- public String getPid() { return fGroupId; } >+ public String getPid() { return fPid; } > > public String getName() { return fName; } > >@@ -129,7 +182,8 @@ > fGroupList = new IThreadGroupInfo[values.length]; > for (int i = 0; i < values.length; i++) { > MIResult[] results = ((MITuple)values[i]).getMIResults(); >- String id = "", desc = "";//$NON-NLS-1$//$NON-NLS-2$ >+ String id, desc, pid; >+ id = desc = pid = "";//$NON-NLS-1$ > > for (MIResult result : results) { > String var = result.getVariable(); >@@ -146,9 +200,23 @@ > desc = str.trim(); > > } >+ } else if (var.equals("pid")) { //$NON-NLS-1$ >+ MIValue value = result.getMIValue(); >+ if (value instanceof MIConst) { >+ String str = ((MIConst)value).getCString(); >+ pid = str.trim(); >+ } > } > } >- fGroupList[i] = new ThreadGroupInfo(id, desc); >+ // In the case of -list-thread-groups --available, the pid field is not present, but the >+ // pid is used as the main id. To know we are in this case, we check that we have >+ // a description, that only happens for -list-thread-groups --available >+ // We must check this because with GDB 7.2, there will be no pid field as a result >+ // of -list-thread-groups, if no process is actually running yet. >+ if (pid.equals("") && !desc.equals("")) { //$NON-NLS-1$ //$NON-NLS-2$ >+ pid = id; >+ } >+ fGroupList[i] = new ThreadGroupInfo(id, desc, pid); > } > } > }
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
Flags:
marc.khouzam
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 311965
:
167383
|
173087
| 173147