mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
make gdb test automation even awesomer
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
* - read x30 */
|
||||
.global main
|
||||
main:
|
||||
/* test-gdb-before-x29 */
|
||||
mov x0, #1
|
||||
/* test-gdb-x0 */
|
||||
mov x1, #2
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
def test(self):
|
||||
self.sendline('tbreak main')
|
||||
self.sendline('continue')
|
||||
self.continue_to('x0')
|
||||
self.sendline('set $x0 = 3')
|
||||
self.continue_to('x1')
|
||||
assert self.get_int('$x0') == 3
|
||||
assert self.get_int('$x1') == 2
|
||||
self.sendline('set $x30 = 3')
|
||||
self.continue_to('x29')
|
||||
assert self.get_int('$x29') == 1
|
||||
|
||||
8
baremetal/arch/arm/regs.S
Normal file
8
baremetal/arch/arm/regs.S
Normal file
@@ -0,0 +1,8 @@
|
||||
/* See the aarch64 version. */
|
||||
.global main
|
||||
main:
|
||||
mov r0, #1
|
||||
/* test-gdb-r0 */
|
||||
mov r1, #2
|
||||
/* test-gdb-r1 */
|
||||
bx lr
|
||||
8
baremetal/arch/arm/regs.py
Normal file
8
baremetal/arch/arm/regs.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
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user