|
2 | 2 |
|
3 | 3 | import be.ugent.topl.mio.debugger.Debugger; |
4 | 4 | import be.ugent.topl.mio.sourcemap.SourceMap; |
5 | | -import be.ugent.topl.mio.woodstate.Checkpoint; |
6 | 5 | import be.ugent.topl.mio.woodstate.Frame; |
7 | 6 | import be.ugent.topl.mio.woodstate.WOODDumpResponse; |
8 | 7 |
|
@@ -35,9 +34,6 @@ public GdbStub(Debugger debugger, String binaryLocation) { |
35 | 34 | }); |
36 | 35 | } |
37 | 36 |
|
38 | | - // Dummy register file (16 x 32-bit) |
39 | | - static int[] regs = new int[16]; |
40 | | - |
41 | 37 | private static final char[] HEX = "0123456789abcdef".toCharArray(); |
42 | 38 | private String toHex(byte[] data, int offset, int length) { |
43 | 39 | StringBuilder sb = new StringBuilder(length * 2); |
@@ -98,10 +94,6 @@ public void start() throws IOException { |
98 | 94 |
|
99 | 95 | byte[] wasmData = Files.readAllBytes(Path.of(binaryLocation)); |
100 | 96 |
|
101 | | - for (int i = 0; i < regs.length; i++) { |
102 | | - regs[i] = 0x11111111 * (i + 1); |
103 | | - } |
104 | | - |
105 | 97 | ServerSocket server = new ServerSocket(1234); |
106 | 98 | System.out.println("Waiting for GDB on port 1234..."); |
107 | 99 | Socket sock = server.accept(); |
@@ -395,9 +387,7 @@ private int checksum(byte[] data) { |
395 | 387 |
|
396 | 388 | private String encodeRegs() { |
397 | 389 | StringBuilder sb = new StringBuilder(); |
398 | | - for (int r : regs) { |
399 | | - sb.append(String.format("%08x", r)); |
400 | | - } |
| 390 | + sb.append(String.format("%08x", getCurrentState().getPc())); |
401 | 391 | return sb.toString(); |
402 | 392 | } |
403 | 393 | } |
0 commit comments