harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r574923 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/jvmti_break_intf.h src/jvmti/jvmti_break_intf.cpp
Date Wed, 12 Sep 2007 12:48:59 GMT
Author: gshimansky
Date: Wed Sep 12 05:48:59 2007
New Revision: 574923

URL: http://svn.apache.org/viewvc?rev=574923&view=rev
Log:
Applied patch from HARMONY-4191
[drlvm][jvmti][eut] Setting breakpoint to current location fires BREAKPOINT event


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h?rev=574923&r1=574922&r2=574923&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h Wed Sep 12 05:48:59
2007
@@ -84,7 +84,7 @@
 class VMBreakPoints
 {
 public:
-    VMBreakPoints() : m_break(NULL), m_last(NULL), m_local(NULL)
+    VMBreakPoints() : m_break(NULL), m_local(NULL)
     {
         for(unsigned index = 0; index < PRIORITY_NUMBER; index++ ) {
             m_intf[index] = NULL;
@@ -153,7 +153,6 @@
 private:
     VMBreakInterface* m_intf[PRIORITY_NUMBER];
     VMBreakPoint*     m_break;
-    VMBreakPoint*     m_last;
     VMLocalBreak*     m_local;
     Lock_Manager      m_lock;
 };

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp?rev=574923&r1=574922&r2=574923&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp Wed Sep 12 05:48:59
2007
@@ -83,24 +83,9 @@
 
     TRACE2("jvmti.break", "Create breakpoint interface: " << intf );
 
-    // add interface to the end of list
-    if( NULL == m_intf[priority] ) {
-        m_intf[priority] = intf;
-    } else {
-        VMBreakInterface *last = m_intf[priority];
-        for( ; last->m_next; last = last->m_next )
-            ;
-        last->m_next = intf;
-    }
-
-    // correct thread processing breakpoints
-    for(VMLocalBreak *local = m_local; local; local = local->next) {
-        if( local->priority == priority && NULL == local->intf ) {
-            TRACE2("jvmti.break", "Set local thread interface: "
-                << local << ", intf: " << intf );
-            local->intf = intf;
-        }
-    }
+    // add interface to the top of list
+    intf->m_next = m_intf[priority];
+    m_intf[priority] = intf;
 
     unlock();
 
@@ -214,29 +199,9 @@
         << (bp->method ? method_get_descriptor((Method*)bp->method) : "")
         << " :" << bp->location << " :" << bp->addr);
 
-    // add breakpoint to the end of list
-    if(m_last) {
-        m_last->next = bp;
-    } else {
-        m_break = bp;
-    }
-    m_last = bp;
-    bp->next = NULL;
-
-    // correct thread processing breakpoints
-    for(VMLocalBreak *local = m_local; local; local = local->next) {
-        if( !local->bp_next ) {
-            TRACE2("jvmti.break", "Set local thread next breakpoint: "
-                << local << ", next: "
-                << (bp->method
-                    ? class_get_name(method_get_class((Method*)bp->method)) : "(nil)")
-                << "."
-                << (bp->method ? method_get_name((Method*)bp->method) : "(nil)")
-                << (bp->method ? method_get_descriptor((Method*)bp->method) :
"")
-                << " :" << bp->location << " :" << bp->addr);
-            local->bp_next = bp;
-        }
-    }
+    // add breakpoint to the top of list
+    bp->next = m_break;
+    m_break = bp;
     return;
 }
 
@@ -303,20 +268,12 @@
         << " :" << bp->location << " :" << bp->addr);
 
     // remove breakpoint from list
-    VMBreakPoint *last = NULL;
-    for( VMBreakPoint *index = m_break;
-         index;
-         last = index, index = index->next )
+    for (VMBreakPoint** plast = &m_break; *plast;
+         plast = &((*plast)->next))
     {
-        if(index == bp) {
-            if(m_last == bp) {
-                m_last = last;
-            }
-            if(last) {
-                last->next = index->next;
-            } else {
-                m_break = index->next;
-            }
+        if (*plast == bp)
+        {
+            *plast = (*plast)->next;
             break;
         }
     }



Mime
View raw message