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 202326 Details for
Bug 356085
GDB MI parser in CDT/CDI is broken on Windows
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]
Patch for org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java
RxThread.java.patch (text/plain), 2.48 KB, created by
Stefan Bylund
on 2011-08-29 10:28:19 EDT
(
hide
)
Description:
Patch for org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/RxThread.java
Filename:
MIME Type:
Creator:
Stefan Bylund
Created:
2011-08-29 10:28:19 EDT
Size:
2.48 KB
patch
obsolete
>--- RxThread.java 2011-08-29 15:02:00.503000000 +0200 >+++ RxThread.java.fix 2011-08-29 15:06:42.788000000 +0200 >@@ -20,6 +20,8 @@ > import java.util.LinkedList; > import java.util.List; > import java.util.StringTokenizer; >+import java.util.regex.Matcher; >+import java.util.regex.Pattern; > > import org.eclipse.cdt.debug.mi.core.command.CLICommand; > import org.eclipse.cdt.debug.mi.core.command.Command; >@@ -61,11 +63,17 @@ > import org.eclipse.cdt.debug.mi.core.output.MIStreamRecord; > import org.eclipse.cdt.debug.mi.core.output.MITargetStreamOutput; > import org.eclipse.cdt.debug.mi.core.output.MIValue; >+import org.eclipse.core.runtime.Platform; > > /** > * Receiving thread of gdb response output. > */ > public class RxThread extends Thread { >+ private static final String MI_OUTPUT_REGEX = >+ "(.*?)([0-9]*(\\*(stopped|running)|=(thread|library)-|" + >+ "\\^(done|running|connected|error|exit)).*|[~@&]\".*\"|\\(gdb\\))"; //$NON-NLS-1$ >+ >+ private final Pattern fMiOutputPattern = Pattern.compile(MI_OUTPUT_REGEX); > > final MISession session; > LinkedList<MIStreamRecord> fStreamRecords = new LinkedList<MIStreamRecord>(); >@@ -84,6 +92,7 @@ > * search for the corresponding token in rxQueue for the ResultRecord. > */ > public void run() { >+ final boolean win32 = Platform.getOS().equals(Platform.OS_WIN32); > BufferedReader reader = new BufferedReader(new InputStreamReader(session.getChannelInputStream())); > try { > String line; >@@ -97,7 +106,14 @@ > session.writeToConsole(line + "\n"); //$NON-NLS-1$ > > setPrompt(line); >- processMIOutput(line + "\n"); //$NON-NLS-1$ >+ if (win32) { >+ String[] lines = splitMIOutput(line); >+ for (int i = 0; i < lines.length; i++) { >+ processMIOutput(lines[i] + "\n"); //$NON-NLS-1$ >+ } >+ } else { >+ processMIOutput(line + "\n"); //$NON-NLS-1$ >+ } > } > } catch (IOException e) { > //e.printStackTrace(); >@@ -160,6 +176,22 @@ > return fEnableConsole; > } > >+ private String[] splitMIOutput(String line) { >+ Matcher matcher = fMiOutputPattern.matcher(line); >+ if (matcher.matches() && (matcher.groupCount() >= 3)) { >+ String targetGroup = matcher.group(1); >+ String miGroup = matcher.group(2); >+ if (targetGroup.length() > 0) { >+ return new String[] {targetGroup, miGroup}; >+ } else { >+ return new String[] {miGroup}; >+ } >+ } else { >+ // Line does not match pattern, return it as a whole. >+ return new String[] {line}; >+ } >+ } >+ > /** > * Search for the command in the RxQueue, set the MIOutput > * and notify() the other end.
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 356085
:
202325
| 202326 |
202327