File tree Expand file tree Collapse file tree
src/main/java/org/jdiextractor/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ protected void createTracePopulator() {
111111 * @return the thread where the execution to extract takes place
112112 */
113113 protected ThreadReference getThread () {
114- // WARNING: We assume the thread name matches 'entryMethod' (usually "main")
115- return this .getThreadNamed (config . getEntrypoint (). getMethodName () );
114+ // WARNING: We assume the thread name matches "main"
115+ return this .getThreadNamed ("main" );
116116 }
117117
118118 /**
Original file line number Diff line number Diff line change 1818 */
1919public class CallStackSnapshotExtractor extends AbstractExtractor <CallStackSnapshotExtractorConfig > {
2020
21-
2221 public CallStackSnapshotExtractor () {
2322 super (false );
2423 }
2524
2625 @ Override
2726 protected void executeExtraction () {
2827 try {
29- // wait for the breakpoint
30- this .waitForBreakpoint ();
28+ this .processEventsUntil (config .getEntrypoint ());
29+ int startFrame = this .getThread ().frameCount ();
30+
31+ this .processEventsUntil (config .getEndpoint ());
3132
3233 // Extract all frames
3334 List <StackFrame > frames = this .getThread ().frames ();
34- for (int i = frames .size () - 1 ; i >= 0 ; i --) {
35+ for (int i = frames .size () - startFrame - 1 ; i >= 0 ; i --) {
3536 StackFrame next = frames .get (i );
3637 this .createMethodWith (next );
3738 }
@@ -44,12 +45,6 @@ protected void executeExtraction() {
4445 }
4546 }
4647
47-
48-
49- private void waitForBreakpoint () throws IncompatibleThreadStateException {
50- this .processEventsUntil (config .getEndpoint ());
51- }
52-
5348 @ Override
5449 protected void reactToStepEvent (StepEvent event ) {
5550 // Nothing, should not happen in this scenario
@@ -60,5 +55,4 @@ protected void reactToMethodEntryEvent(MethodEntryEvent event) {
6055 // Nothing, should not happen in this scenario
6156 }
6257
63-
6458}
You can’t perform that action at this time.
0 commit comments