gdbstub/kernel.c

15 lines
260 B
C
Raw Permalink Normal View History

2025-09-20 17:55:30 +08:00
int add(int a, int b) {
return a + b; // 待调试的函数
}
int main() {
int x = 5;
int y = 3;
int result = add(x, y);
volatile char *tohost_addr = (volatile char *)(0x80001000 - 4);
*tohost_addr = 0xff;
*tohost_addr = result;
return 0;
}