File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
src/main/java/be/ugent/topl/mio Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -267,15 +267,15 @@ else if (pkt.startsWith("z")) {
267267 sendPacket (out , "PacketSize=4000" );
268268 break ;
269269 case "qWasmCallStack:1" : // Get the callstack for thread 1.
270- Checkpoint lastCheckpoint = debugger .getCheckpoints ().getLast ();
271270 WOODDumpResponse state = getCurrentState ();
272- //long currentPc = (long) state.getPc() - codeSection.offset;
273- long currentPc = (long ) state .getPc ();
274- String result = toHex (currentPc );
275- for (int i = 0 ; i < state .getCallstack ().size () - 1 ; i ++) {
276- result += toHex (0xdead ); // TODO: Add other pc's in the callstack
271+ String result = toHex (state .getPc ());
272+ for (int i = state .getCallstack ().size () - 1 ; i >= 0 ; i --) {
273+ // Only functions are real callstack elements:
274+ Frame f = state .getCallstack ().get (i );
275+ if (f .getType () == 0 ) {
276+ result += toHex (f .getRa ());
277+ }
277278 }
278- log ("Callstack size: " + state .getCallstack ().size () + " pc = " + currentPc );
279279 sendPacket (out , result );
280280
281281 try {
You can’t perform that action at this time.
0 commit comments