harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r960600 - in /harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core: AgentEventRequest.cpp RequestModifier.cpp
Date Mon, 05 Jul 2010 13:53:09 GMT
Author: odeakin
Date: Mon Jul  5 13:53:09 2010
New Revision: 960600

URL: http://svn.apache.org/viewvc?rev=960600&view=rev
Log:
Add '\r' to our end of line tokens when parsing the SMAP. Currently SMAPs containing '\r'
characters will cause JDWP to step incorrectly while debugging.

Modified:
    harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp
    harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp?rev=960600&r1=960599&r2=960600&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/AgentEventRequest.cpp
Mon Jul  5 13:53:09 2010
@@ -185,11 +185,11 @@ jint StepRequest::GetCurrentLine()
 #pragma convlit(suspend)
 #endif /* ZOS */
 
-    char *tok = strtok(sourceDebugExtension, "\n");
+    char *tok = strtok(sourceDebugExtension, "\n\r");
     if (tok == NULL) return -1;
-    tok = strtok(NULL, "\n");
+    tok = strtok(NULL, "\n\r");
     if (tok == NULL) return -1;
-    tok = strtok(NULL, "\n"); /* This is the preferred stratum for this class */
+    tok = strtok(NULL, "\n\r"); /* This is the preferred stratum for this class */
     if (tok == NULL) return -1;
     if ( ( default_stratum == NULL || strlen(default_stratum) == 0 ) &&
          strcmp(tok, "Java") == 0)
@@ -198,14 +198,14 @@ jint StepRequest::GetCurrentLine()
     stratum = ( default_stratum == NULL || strlen(default_stratum) == 0 ) ?
                 tok : default_stratum;
 
-    while( ( tok = strtok(NULL, "\n") ) ) {
+    while( ( tok = strtok(NULL, "\n\r") ) ) {
         if (strlen(tok) >= 2) {
             while (tok[0] == '*' && tok[1] == 'S' && tok[2] == ' ') {
                 tok++; tok++;
                 while (tok[0] == ' ' && tok[0] != 0) tok++; // skip spaces
                 if (strcmp(stratum, tok) == 0) {
                     // this is the stratum that is required
-                    tok = strtok(NULL, "\n");
+                    tok = strtok(NULL, "\n\r");
                     if (tok == NULL) return -1;
                     // parse until we find another stratum section or 
                     // the end token
@@ -215,7 +215,7 @@ jint StepRequest::GetCurrentLine()
                             tok[0] == '*' && tok[1] == 'L' && tok[2] == '\0')
{
                             // parse line info section
                             do {
-                                tok = strtok(NULL, "\n");
+                                tok = strtok(NULL, "\n\r");
                                 if (tok == NULL) return -1;
                                 if (tok[0] >= '0' && tok[0] <= '9') {
                                     long int in_start = strtol(tok, &tok, 10);
@@ -251,7 +251,7 @@ jint StepRequest::GetCurrentLine()
                             } while (tok[0] != '*');
                             return -1;
                         }
-                        tok = strtok(NULL, "\n");
+                        tok = strtok(NULL, "\n\r");
                         if (tok == NULL) return -1;
                     }
                 }

Modified: harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp?rev=960600&r1=960599&r2=960600&view=diff
==============================================================================
--- harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
(original)
+++ harmony/enhanced/java/branches/java6/jdktools/modules/jpda/src/main/native/jdwp/common/agent/core/RequestModifier.cpp
Mon Jul  5 13:53:09 2010
@@ -104,15 +104,15 @@ bool SourceNameMatchModifier::Apply(JNIE
 
     // We want to get the 2nd token here, split by '\n'
     char *tok = NULL;
-    tok = strtok(sourceDebugExtension, "\n"); // 1st token
+    tok = strtok(sourceDebugExtension, "\n\r"); // 1st token
     if (tok == NULL) return false;
-    tok = strtok(NULL, "\n");
+    tok = strtok(NULL, "\n\r");
     if (tok == NULL) return false;
     if (MatchPatternSourceName(tok, m_pattern)) return true;
-    while(tok = strtok(NULL, "\n")) {
+    while(tok = strtok(NULL, "\n\r")) {
         if (strlen(tok) >= 2) {
             if (tok[0] == '*' && tok[1] == 'F' && tok[2] == '\0') {
-                tok = strtok(NULL, "\n");
+                tok = strtok(NULL, "\n\r");
                 if (tok == NULL) return false;
                 while (tok[0] != '*') {
                     if (tok[0] == '+') {
@@ -130,7 +130,7 @@ bool SourceNameMatchModifier::Apply(JNIE
                         if (MatchPatternSourceName(tok, m_pattern)) {
                             return true;
                         }
-                        tok = strtok(NULL, "\n");
+                        tok = strtok(NULL, "\n\r");
                         if (tok == NULL) return false;
                         if (MatchPatternSourceName(tok, m_pattern)) {
                             return true;
@@ -147,7 +147,7 @@ bool SourceNameMatchModifier::Apply(JNIE
                             return true;
                         }
                     }
-                    tok = strtok(NULL, "\n");
+                    tok = strtok(NULL, "\n\r");
                     if (tok == NULL) return false;
                 }
             }



Mime
View raw message