src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java
changeset 59065 5f458adec06b
parent 47216 71c04702a3d5
equal deleted inserted replaced
59064:f1a5d48d0471 59065:5f458adec06b
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   135                   System.out.println("CurrentFrameGuess: Choosing sp = " + curSP + ", pc = " + pc);
   135                   System.out.println("CurrentFrameGuess: Choosing sp = " + curSP + ", pc = " + pc);
   136                 }
   136                 }
   137                 setValues(curSP, null, pc);
   137                 setValues(curSP, null, pc);
   138                 return true;
   138                 return true;
   139               }
   139               }
       
   140               Frame oldFrame = frame;
   140               frame = frame.sender(map);
   141               frame = frame.sender(map);
       
   142               if (frame.getSP().lessThanOrEqual(oldFrame.getSP())) {
       
   143                   // Frame points to itself or to a location in the wrong direction.
       
   144                   // Break the loop and move on to next offset.
       
   145                   if (DEBUG) {
       
   146                       System.out.println("AMD64CurrentFrameGuess.run: frame <= oldFrame: " + frame);
       
   147                   }
       
   148                   break;
       
   149               }
   141             }
   150             }
   142           } catch (Exception e) {
   151           } catch (Exception e) {
   143             if (DEBUG) {
   152             if (DEBUG) {
   144               System.out.println("CurrentFrameGuess: Exception " + e + " at offset " + offset);
   153               System.out.println("CurrentFrameGuess: Exception " + e + " at offset " + offset);
   145             }
   154             }