mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 04:54:27 +01:00
gdb: move all tests to userland
This commit is contained in:
1
userland/arch/arm/gdb_tests/README.adoc
Normal file
1
userland/arch/arm/gdb_tests/README.adoc
Normal file
@@ -0,0 +1 @@
|
||||
https://github.com/cirosantilli/linux-kernel-module-cheat#gdb-tests
|
||||
10
userland/arch/arm/gdb_tests/integer_registers.S
Normal file
10
userland/arch/arm/gdb_tests/integer_registers.S
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <lkmc.h>
|
||||
|
||||
LKMC_PROLOGUE
|
||||
/* 1 + 2 == 3 */
|
||||
mov r0, 1
|
||||
/* test-gdb-op1 */
|
||||
add r1, r0, 2
|
||||
/* test-gdb-result */
|
||||
LKMC_ASSERT_EQ(r1, =3)
|
||||
LKMC_EPILOGUE
|
||||
7
userland/arch/arm/gdb_tests/integer_registers.py
Normal file
7
userland/arch/arm/gdb_tests/integer_registers.py
Normal file
@@ -0,0 +1,7 @@
|
||||
def test(self):
|
||||
self.sendline('tbreak main')
|
||||
self.sendline('continue')
|
||||
self.continue_to('op1')
|
||||
assert self.get_int('$r0') == 1
|
||||
self.continue_to('result')
|
||||
assert self.get_int('$r1') == 3
|
||||
8
userland/arch/arm/gdb_tests/set_registers.S
Normal file
8
userland/arch/arm/gdb_tests/set_registers.S
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <lkmc.h>
|
||||
|
||||
LKMC_PROLOGUE
|
||||
mov r0, 1
|
||||
/* test-gdb-r0 */
|
||||
mov r1, 2
|
||||
/* test-gdb-r1 */
|
||||
LKMC_EPILOGUE
|
||||
8
userland/arch/arm/gdb_tests/set_registers.py
Normal file
8
userland/arch/arm/gdb_tests/set_registers.py
Normal file
@@ -0,0 +1,8 @@
|
||||
def test(self):
|
||||
self.sendline('tbreak main')
|
||||
self.sendline('continue')
|
||||
self.continue_to('r0')
|
||||
self.sendline('set $r0 = 3')
|
||||
self.continue_to('r1')
|
||||
assert self.get_int('$r0') == 3
|
||||
assert self.get_int('$r1') == 2
|
||||
Reference in New Issue
Block a user