mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 13:04:27 +01:00
gdb: move all tests to userland
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
.global main
|
||||
main:
|
||||
/* 1 + 2 == 3 */
|
||||
mov r0, #1
|
||||
/* test-gdb-op1 */
|
||||
add r1, r0, #2
|
||||
/* test-gdb-result */
|
||||
cmp r1, #3
|
||||
beq 1f
|
||||
bl abort
|
||||
1:
|
||||
mov r0, #0
|
||||
bx lr
|
||||
@@ -1,7 +0,0 @@
|
||||
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
|
||||
@@ -1,15 +1,15 @@
|
||||
/* I want to move el and all other "what's the initial value of such system register" into here. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
int main(void) {
|
||||
uint32_t cpsr;
|
||||
/*uint32_t mvfr1;*/
|
||||
__asm__ ("mrs %0, cpsr" : "=r" (cpsr) : :);
|
||||
/* TODO this is blowing up an exception, how to I read from it? */
|
||||
/*__asm__ ("vmrs %0, mvfr1" : "=r" (mvfr1) : :);*/
|
||||
printf("cpsr %" PRIx32 "\n", cpsr);
|
||||
|
||||
/* TODO this is blowing up an exception, how to I read from it? */
|
||||
/*uint32_t mvfr1;*/
|
||||
/*__asm__ ("vmrs %0, mvfr1" : "=r" (mvfr1) : :);*/
|
||||
/*printf("mvfr1 %" PRIx32 "\n", mvfr1);*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/* See the aarch64 version. */
|
||||
|
||||
#include <lkmc.h>
|
||||
|
||||
LKMC_PROLOGUE
|
||||
mov r0, #1
|
||||
/* test-gdb-r0 */
|
||||
mov r1, #2
|
||||
/* test-gdb-r1 */
|
||||
mov r0, #0
|
||||
LKMC_EPILOGUE
|
||||
@@ -1,8 +0,0 @@
|
||||
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