Skip to content

Commit 54aea09

Browse files
committed
Use gcc, patch test_fibonacci
1 parent 51fa52e commit 54aea09

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

debugger2/src/debugger/compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
async def compile(source_path: str | Path, output_path: str | Path) -> None:
77
clang = await create_subprocess_exec(
8-
"clang",
8+
"gcc",
99
str(source_path),
1010
"-o",
1111
str(output_path),

debugger2/src/debugger/test_fibonacci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdio.h>
22

33
void fibonacci(int n) {
4-
int a = 0, b = 1, next;
4+
int a = 0, b = 1, next = 0xbeef;
55
printf("Fibonacci sequence up to %d terms:\n", n);
66
for (int i = 1; i <= n; i++) {
77
printf("%d ", a);

debugger2/src/debugger/test_fibonacci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _(message: any) -> None:
5656
assert fibonacci["b"].type == "int"
5757
assert fibonacci["b"].value == 1
5858
assert fibonacci["next"].type == "int"
59-
assert fibonacci["next"].value == 0
59+
assert fibonacci["next"].value == 0xBEEF
6060

6161
main = frames[(1, "main")]
6262
assert len(main) == 1
@@ -66,7 +66,7 @@ def _(message: any) -> None:
6666
assert memory[fibonacci["n"].address, "int"].value == 10
6767
assert memory[fibonacci["a"].address, "int"].value == 0
6868
assert memory[fibonacci["b"].address, "int"].value == 1
69-
assert memory[fibonacci["next"].address, "int"].value == 0
69+
assert memory[fibonacci["next"].address, "int"].value == 0xBEEF
7070
assert memory[main["n"].address, "int"].value == 10
7171

7272
await debug.finish()

0 commit comments

Comments
 (0)